Summary of the invention
The object of the present invention is to provide a kind of unification of three nets data transmission method for uplink based on real-time priority dynamic adjustment, purportsSolving the problems, such as that unification of three nets data transmission efficiency is low in the prior art and bad adaptability, realization improve data transfer are imitatedRate is adapted to different application scene.
To reach above-mentioned technical purpose, the present invention provides a kind of unification of three nets numbers based on real-time priority dynamic adjustmentAccording to sending method, the method includes following operations:
Configuration file is parsed, the relevant configured parameter that data are sent is obtained;
According to relevant configured parameter, all types of buffer areas are written into SV, GOOSE, MMS Framed Data, pass through resident timingDevice determines GOOSE, MMS data priority;
The output bus that the buffer area SV is switched in SV sending time window, switches in non-SV sending time windowThe output bus of the buffer area GOOSE, MMS;
Transmission for SV data sends intervalometer by SV and determines whether SV sending time window mark is effective,When window mark is effective, it is sent to after waiting SV data, SV data to arrive and sends buffer area;
Transmission for GOOSE, MMS data, poll scanning buffer compare priority and filter out data to be sent, lead toIt crosses time ruler register and judges whether that current SV transmission gap, which can be inserted, transfers data to transmission when can be insertedBuffer area;
The data sent in buffer area are sent to object module.
Preferably, the operation of SV Framed Data write-in buffer area is as follows:
According to the SV sending cycle of configuration, FPGA respectively generates sampling pulse by synchronous or punctual pulse per second (PPS);
According to the configuration template of SV in sampling pulse instance sample framing, the buffer area SV, juxtaposition bit buffering are write data intoArea's effective marker, while transmitting SV length parameter information.
Preferably, when the resident timer reaches overflow value, the priority of GOOSE or MMS data is promoted.
Preferably, the transmission concrete operations of the SV data are as follows:
Start SV and send intervalometer, when SV, which sends intervalometer, to be overflowed, it is effective to set SV transmission window mark;
After SV transmission window is effectively detected, waits next frame SV data simultaneously to remove SV and send window effective marker, whenWhen next frame SV data arrive, resets SV and send intervalometer and start reclocking.
Preferably, it is customized setting that the SV, which sends the overflow value of intervalometer,.
Preferably, it is as follows to filter out data concrete operations to be sent for the comparison priority:
The data buffer zone poll GOOSE and the data buffer zone MMS, when the buffer area in need for sending data is arrived in scanning,It latches the priority of the buffer area, residence time, length, hang up mark, buffering area code parameter to temporary register;
Temporary register is compared with the priority of priority register, when the priority stored in temporary register is highWhen priority register, by temporary register each data update to priority register, residence time latch register,Length register and buffering area code register;
When the priority stored in temporary register is equal with the value in priority register, then residence time is compared,If the dwell time values stored in temporary register are big, update priority register, residence time latch register, length and postStorage and buffering area code register, on the contrary it does not update;
When the priority stored in temporary register is less than priority register, the registers such as priority are not updated.
Preferably, described to judge whether that current SV, which can be inserted, sends gap concrete operations by time ruler registerAre as follows:
According to the length computation of data to be sent, it sends holding time, by data in this time and time ruler registerValue judges whether numerical value enters SV sending time window after being added, if into transmission condition is unsatisfactory for;If do not enteredSV sending time window will buffer the corresponding data transmission of area code to buffer area is sent, and the result that will add up is updated to time rulerRegister.
Preferably, the method also includes the transmission of data preemptive type, concrete operations are as follows:
After poll selectes a certain GOOSE data or MMS data according to current priority, need to delay data from correspondingIt rushes area and is transferred to transmission buffer area, during this period if having monitored that priority data more higher than current selected data arrives,Current data transmission is then interrupted, restores to send parameter, poll scans high-priority data again;
When the displacement of the GOOSE data of same control block, corresponding heartbeat frame is not sent or is currently written into transmission bufferingArea, then the GOOSE heartbeat data that currently displacement data can seize same control block are sent.
Specific embodiment
In order to clearly illustrate the technical characterstic of this programme, below by specific embodiment, and its attached drawing is combined, to thisInvention is described in detail.Following disclosure provides many different embodiments or example is used to realize different knots of the inventionStructure.In order to simplify disclosure of the invention, hereinafter the component of specific examples and setting are described.In addition, the present invention can be withRepeat reference numerals and/or letter in different examples.This repetition is that for purposes of simplicity and clarity, itself is not indicatedRelationship between various embodiments and/or setting is discussed.It should be noted that illustrated component is not necessarily to scale in the accompanying drawingsIt draws.Present invention omits the descriptions to known assemblies and treatment technology and process to avoid the present invention is unnecessarily limiting.
It is provided for the embodiments of the invention a kind of three net conjunctions based on real-time priority dynamic adjustment with reference to the accompanying drawingOne data transmission method for uplink is described in detail.
As shown in Figure 1, 2, the embodiment of the invention discloses a kind of unification of three nets numbers based on real-time priority dynamic adjustmentAccording to sending method, the method includes following operations:
Configuration file is parsed, the relevant configured parameter that data are sent is obtained;
According to relevant configured parameter, all types of buffer areas are written into SV, GOOSE, MMS Framed Data, pass through resident timingDevice determines GOOSE, MMS data priority;
The output bus that the buffer area SV is switched in SV sending time window, switches in non-SV sending time windowThe output bus of the buffer area GOOSE, MMS;
Transmission for SV data sends intervalometer by SV and determines whether SV sending time window mark is effective,When window mark is effective, it is sent to after waiting SV data, SV data to arrive and sends buffer area;
Transmission for GOOSE, MMS data, poll scanning buffer compare priority and filter out data to be sent, lead toIt crosses time ruler register and judges whether that current SV transmission gap, which can be inserted, transfers data to transmission when can be insertedBuffer area;
The data sent in buffer area are sent to object module.
The real-time priority dynamic adjustment mechanism of the embodiment of the present invention is as follows:
Transmission priority in three network datas is with SV data highest, in order to guarantee the transmission delay of SV data and issue discreteProperty stabilization, the stable feature of being spaced is sent according to SV, estimates SV sending time, 10us (configurable) is beaten before SV sending instantOpen SV sending time window, wait SV network data to be sent, after having sent SV, into non-SV sending time window, be inserted into GOOSE andMMS data are sent.
Configuration file is parsed, the relevant configuration parameter of sending module is obtained, function is sent to unification of three nets according to system requirementsIt can be carried out configuration, SV, GOOSE, MMS data, which are sent, enables that configuration can be combined, and enables one or more.To GOOSE,The basic priority that MMS sends data is configured, i.e., configurable GOOSE difference control block priority is controlled in multiple GOOSEBasic priority high data frame is preferentially sent when block heartbeat data is effective simultaneously.Configuration sends relevant time parameter, includesThe time parameter of Priority Inversion, the transmission rhythm of GOOSE data, SV sending time window allowance.
SV, GOOSE, MMS Framed Data are written by FPGA and send buffer area.
The buffer area SV is written into SV data, according to the SV sending cycle (usual 250us) of configuration, FPGA is by synchronizing or keepingWhen pulse per second (PPS), respectively generate sampling pulse, according to the configuration template of SV in sampling pulse instance sample framing, write data into SVBuffer area, juxtaposition bit buffering area effective marker, while transmitting the parameter informations such as SV length.
By the GOOSE data write-in buffer area GOOSE, it can be achieved that the common network of multiple GOOSE control blocks is sent.Utilize FPGA'sThe framing writing buffer operation of parallel processing feature, each GOOSE control block is mutually indepedent.FPGA goes to detect every the sampling timeCPU incoming GOOSE data array, according to configuration information, is mapped to corresponding GOOSE control when detecting data variationBlock controls corresponding control block displacement framing, and StNum parameter increases by 1, SqNum parameter and returns 0, and transmits GOOSE length, GOOSE classFramed Data is written its corresponding GOOSE data and delayed by parameters, each control blocks such as type (displacement, burst, heartbeat), interrupt identificationRush area.
Start two timers when GOOSE framing is completed, one is rhythm control timer, is used for the lower frame number of GOOSEAccording to framing, another resident timer promotes the excellent of current GOOSE data type when resident timer arrival overflow valueFirst grade, achievees the purpose that transmission of trying to be the first, and the overflow value of resident timer is configurable to 2, and counter reaches biggish spillingPriority is promoted again when value, and when data are removed in the buffer area GOOSE, corresponding resident timer resets.When GOOSE numberWhen according to variation, rhythm control timer directly overflows, and when GOOSE data do not change, rhythm control timer is according to currentThe corresponding Configuration Values of value dynamically load of SqNum are sent as overflow value, timer is resident and is always added according to the value of SqNum dynamicConfiguration Values are carried as overflow value.Each GOOSE control block can be divided into following excellent according to GOOSE type and resident timerFirst grade:
GOOSE conjugate (height), GOOSE bursty data (height), GOOSE heartbeat data (height), GOOSE conjugate (common),GOOSE bursty data (common), GOOSE heartbeat data (common), when the overflow value of resident timer configuration is 2 grades, preferentiallyGrade can also have GOOSE to conjugate (urgent), GOOSE bursty data (urgent), GOOSE heartbeat data (urgent).
The sequence of priority can configure, and be usually arranged as GOOSE displacement (urgent) > GOOSE bursty data (urgent) >GOOSE heartbeat data (urgent) > GOOSE conjugates (height) > GOOSE bursty data (height) > GOOSE and conjugates (common) > GOOSEHeartbeat data (height) > GOOSE bursty data (common) > GOOSE heartbeat data (common).
The buffer area MMS is written into MMS data, the data for sending MMS pass through the data bus transmission of CPU and FPGA, FPGAA fifo buffer is arranged in side, and the MMS module of FPGA transmits frame idle count control in fifo buffer by shaking hands with CPUThe MMS data for needing to be written.It is similar to GOOSE data processing in order to improve efficiency of transmission although MMS has retransmission mechanism, MMSResident timer is also designed in every frame data buffer area in buffer area, and Priority Inversion also occurs when timer overflows, tries to be the firstIt sends.
Network data sends scheduler module according to the sending time window for whether being currently SV to switch the buffer area SV and itsThe output bus of the data buffer zone of his GOOSE, MMS.In non-temporal window, network data sends scheduler module and passes through pollThe data buffer zone of GOOSE and MMS switches the output bus of the buffer area GOOSE, MMS, sends scheduler module by network dataControl, play the role of variable connector switching bus.
In the data transmission procedure of unification of three nets, according to actual needs, it can decide whether that enabled SV is sent by configuringFunction send the sending time window that GOOSE, MMS data without waiting for non-SV when not enabled SV is sent, do not needIt calculates whether frame to be sent can be inserted above-mentioned time window, only need to carry out priority ratio to rear transmission;When configuring SV transmission, InBefore SV sends configuration parameter completion, first scans GOOSE, MMS data and sent, do not influence the transmission function of GOOSE and MMSCan, it is run at this time according to the mechanism of not enabled SV function, after the completion of SV sends initialization, initialization module provides a SV hairAfter sending window useful signal, currently transmitted task idle, program goes that the write-in of first frame SV data is waited to send buffer area.
Transmission for SV data, in the buffer area SV data for the first time effectively after, starting SV sends intervalometer, works as SVSend intervalometer overflow when, set SV send window mark it is effective, usually configure SV send intervalometer overflow value be240us, SV are sent after window is effectively detected, and control program goes to wait next frame SV data and removes SV to send window effectiveMark, when next frame SV data arrive when, reset SV send intervalometer simultaneously start reclocking, it is ensured that SV send window withoutAccumulated error, the preferential stability for guaranteeing SV and sending.
Transmission for GOOSE, MMS data, in order to guarantee that GOOSE, MMS data can be normally inserted between two frame SVTime slot does not influence SV transmission, and creation time scale register, the register is for calculating GOOSE, MMS number to be sentAccording to whether having reliable sending time.When the SV to be sent such as each, resetting time scale register, after having sent SV data, rootAccording to the frame length for sending SV data, the time required for the data are sent is calculated, by the write time time scale register, intoEnter GOOSE, MMS data and send state, judges whether the data field GOOSE, MMS has data latency transmission.Poll GOOSE data are slowArea and the data buffer zone MMS are rushed, when the buffer area in need for sending data is arrived in scanning, the priority of the buffer area is latched, staysIt stays time, length, hang up the parameters such as mark, buffering area code to temporary register.
When hang-up mark when buffer area is effective, skips the buffer area and continue poll scanning;When hang-up mark is invalid, temporarilyRegister is compared with the priority of priority register, when the priority stored in temporary register is deposited higher than priorityWhen device, by temporary register each data update to priority register, residence time latch register, length register withAnd buffering area code register;When the priority stored in temporary register is equal with the value in priority register, then compareResidence time updates the registers such as priority if the dwell time values stored in temporary register are big, otherwise does not update;WhenWhen the priority stored in temporary register is less than priority register, the registers such as priority are not updated.The successively complete institute of pollAfter having register, buffering the data stored in area code register is the buffer area to be sent chosen at current time.
The data to be sent needs screened after being compared by poll scan priority judge whether that current SV can be insertedGap is sent, first renewal time scale register after data is selected, if the value that SV sends intervalometer is greater than time rulerThe SV value for sending intervalometer is then updated to time ruler register, otherwise not updated by the value of register.Update finishesAfterwards, according to the length computation of data to be sent, it sends holding time, by this time and data value phase in time ruler registerJudge whether numerical value enters SV sending time window after adding, if into transmission condition being unsatisfactory for, by the number of the buffer areaMark is hung up according to being placed in, epicycle SV sends gap and do not retransmit the data, improves transmitting efficiency, hangs up mark and sends in SV dataShi Fuwei, if not entering SV sending time window, will buffer the corresponding data transmission of area code to send buffer area, the knot that will add upFruit updates the poll transmission for starting next frame data to time ruler register.
When can not select transmission when GOOSE or MMS data since priority is lower, in certain time, Priority Inversion machineSystem can improve its priority, and preferentially send, to guarantee sending performance.When the resident timer overflow value of GOOSE displacement dataWhen being configured to 300us, when GOOSE displacement data 300us is still not sent, then the priority of displacement GOOSE is improved, is guaranteed excellentFirst send.When the resident timer overflow value of GOOSE heartbeat data is configured to 1s, after GOOSE heartbeat data normal heartbeatWhen 1s is still not sent, then the priority of the heartbeat data is improved, guarantees its preferential transmission.The Priority Inversion of other data typesDesign method is same as mentioned above.
In order to enable sending more efficiently, which is arranged preemptive type and sends mechanism, and preemptive type transmission is only applicable toThe transmission of GOOSE, MMS data, SV data can not be interrupted, including following two mode:
After poll selectes a certain GOOSE data or MMS data according to current priority, need to delay data from correspondingIt rushes area and is transferred to transmission buffer area, during this period, if having monitored that priority data more higher than current selected data arrives,Current data transmission is then interrupted, restores to send parameter, poll scans high-priority data again, which, which sends, can guarantee heightThe transmission of priority data postpones;
Since the displacement of GOOSE data is asynchronous generation, can be conjugated at once after a GOOSE heartbeat data, thisLast GOOSE heartbeat frame will affect the transmission delay of GOOSE displacement data in the case of kind, in order to improve sending performance and transmissionEfficiency, when the displacement of the GOOSE data of same control block, corresponding heartbeat frame is not sent or is currently written into transmission buffer area,The GOOSE heartbeat data that then currently displacement data can seize same control block is sent.
Finally, MAC module is successively read the data sent in buffer area, meter when sending has valid data in buffer areaCRC check is calculated, and transmits data to PHY chip or optical module is sent to by SEDER, unification of three nets frame is completed and sends.
The embodiment of the present invention is based on fpga chip, can be used in electric system being especially in intelligent substation protection and automaticChange equipment and be total to the application that mouth sends the network datas such as SV, GOOSE, MMS, by configuring division multipriority, dynamic is adjustedPriority simultaneously can invert in real time, seize transmit queue, realize that all types of network datas are total to mouth transmission.This method transmitting efficiency is high,Meet the publication discreteness of SV data and the release quickly performance of GOOSE data, and configure flexibly, transplantability is good, and this method is alsoIt is expansible to be applied in the similar application of other field.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the inventionMade any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within mind and principle.