CN115987904A - Method and system for transmitting message by multiple networks in one interface based on time slot granularity - Google Patents

Method and system for transmitting message by multiple networks in one interface based on time slot granularity Download PDF

Info

Publication number
CN115987904A
CN115987904A CN202211562091.9A CN202211562091A CN115987904A CN 115987904 A CN115987904 A CN 115987904A CN 202211562091 A CN202211562091 A CN 202211562091A CN 115987904 A CN115987904 A CN 115987904A
Authority
CN
China
Prior art keywords
time slot
data
precise
module
sent
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211562091.9A
Other languages
Chinese (zh)
Inventor
李铁成
刘清泉
范辉
王献志
赵宇皓
张卫明
郭少飞
李泽
王义波
毛玉荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Corp of China SGCC
Electric Power Research Institute of State Grid Hebei Electric Power Co Ltd
State Grid Hebei Energy Technology Service Co Ltd
Original Assignee
State Grid Corp of China SGCC
Electric Power Research Institute of State Grid Hebei Electric Power Co Ltd
State Grid Hebei Energy Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Corp of China SGCC, Electric Power Research Institute of State Grid Hebei Electric Power Co Ltd, State Grid Hebei Energy Technology Service Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN202211562091.9A priority Critical patent/CN115987904A/en
Publication of CN115987904A publication Critical patent/CN115987904A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method and a system for transmitting messages by multiple networks in one interface based on time slot granularity. The method comprises the following steps: acquiring the number of bytes sent by the time slot of each accurate time slot; receiving a plurality of data packets sent by a CPU every preset time interval, wherein the plurality of data packets comprise a GOOSE data packet, an MMS data packet and at least two SV data packets; determining an accurate time slot mark corresponding to the data in each data packet in the current time interval according to the length of the data in each data packet and the number of bytes sent by the time slot; storing data corresponding to each accurate time slot mark to an idle cache region in the current time interval according to each accurate time slot mark; and in the next time interval, sending the data stored in the buffer area to the target equipment according to each accurate time slot mark. The invention can simultaneously ensure that the sending time delay of the GOOSE message is smaller and a plurality of SV messages are sent in time when the messages are transmitted by combining a plurality of networks and a common port.

Description

Method and system for transmitting message by multiple networks in one interface based on time slot granularity
Technical Field
The invention relates to the technical field of power communication, in particular to a method and a system for transmitting messages by combining multiple networks and a common port based on time slot granularity.
Background
With the continuous development of relay protection technology, a new generation secondary system of a substation needs to adopt a multi-network-in-one common-port transmission mode based on the comprehensive and autonomous control of device software and hardware, a communication interface is shared in transmission of a Sampling Value (SV) message and a Generic Object Oriented Substation Event (GOOSE) message, and a communication interface is also shared in transmission of a Manufacturing Message Specification (MMS) message and a GOOSE message.
The SV message, the GOOSE message and the MMS message have different characteristics, and compared with the traditional SV message, the GOOSE message and the MMS message which are respectively sent by a single network port, the mode of multi-network-in-one common port transmission is more complicated; in the prior art, a data output mode aiming at multi-network integration is as follows: one method is to determine the priority of three types of data to ensure that an SV message is sent preferentially, but the method has low transmission efficiency and poor adaptability, and can cause great delay in the sending of the GOOSE message in a complex application scene; the other method is to transmit the SV message in a fixed period, and to transmit the GOOSE message or the MMS message between two SV messages, but the method can only transmit one SV message in each time interval, and cannot transmit the SV messages in time when a plurality of SV messages exist.
Therefore, a method for ensuring that the sending delay of the GOOSE message is small and that the GOOSE message can be sent in time when a plurality of SV messages exist is needed.
Disclosure of Invention
The embodiment of the invention provides a method and a system for transmitting a message by combining multiple networks and a common port based on time slot granularity, which aim to solve the problems that the sending time delay of a GOOSE message is short and a plurality of SV messages can not be sent in time when the message is transmitted by combining multiple networks and a common port in the prior art.
In a first aspect, an embodiment of the present invention provides a method for transmitting a packet through multiple networks and a common interface based on a time slot granularity, where the method includes:
acquiring the number of bytes sent by the time slot of each accurate time slot;
receiving a plurality of data packets sent by a CPU every preset time interval, wherein the plurality of data packets comprise a GOOSE data packet, an MMS data packet and at least two SV data packets;
determining an accurate time slot mark corresponding to the data in each data packet in the current time interval according to the length of the data in each data packet and the number of bytes sent by the time slot;
storing data corresponding to each accurate time slot mark to an idle cache region in the current time interval according to each accurate time slot mark;
and in the next time interval, sending the data stored in the buffer area to the target equipment according to each accurate time slot mark.
In a possible implementation manner, determining an accurate timeslot flag corresponding to data of each data packet in a current time interval according to a length of the data in each data packet and a number of bytes sent in a timeslot includes:
determining a precise time slot flag for each time interval;
sequentially determining SV accurate time slot marks of each SV data in the current time interval according to the length of the SV data in the SV data packet and the number of bytes sent by the time slot;
determining the GOOSE accurate time slot mark of the GOOSE data in the current time interval according to the SV accurate time slot mark, the GOOSE data in the GOOSE data packet and the number of bytes sent by the time slot;
and determining the MMS accurate time slot mark of the MMS data in the current time interval according to the SV accurate time slot mark, the GOOSE accurate time slot mark, the MMS data in the MMS data packet and the number of bytes sent in the time slot.
In a possible implementation manner, in a next time interval, sending data stored in the buffer to the target device according to each precise timeslot indicator, includes:
updating a control table stored in the current cache region according to each accurate time slot mark and the data corresponding to each accurate time slot mark, wherein the control table comprises each accurate time slot mark and the byte information of the data corresponding to each accurate time slot mark;
and in the next time interval, searching byte information corresponding to the time slot mark in the control table according to the time slot mark corresponding to the current precise time slot, and sending data corresponding to the byte information in the current cache region to the target equipment.
In a possible implementation manner, after searching the byte information corresponding to the time slot mark in the control table according to the time slot mark corresponding to the current precise time slot, and sending the data corresponding to the byte information in the current cache region to the target device, the method further includes:
and clearing the time slot marks in the control table and byte information corresponding to the time slot marks according to the time slot marks.
In one possible implementation manner, receiving a plurality of data packets sent by a CPU includes:
sending an interrupt signal to the CPU every preset time;
receiving a GOOSE data packet and at least two SV data packets sent by a CPU according to an interrupt signal;
and receiving the MMS data packet sent by the CPU according to the connection-oriented data packet.
In one possible implementation, each time interval is divided into a preset number of precise time slots on average;
determining a precise slot marker for each time interval, comprising:
determining two adjacent time intervals as a group of time periods;
determining an accurate time slot mark corresponding to each accurate time slot in each group of time slots based on each group of time slots to obtain a plurality of accurate time slot marks corresponding to each time interval in each group of time slots;
acquiring the number of time slot sending bytes of each precise time slot, comprising the following steps:
determining the number of bytes sent at intervals of each time interval according to the transmission rate of the connected Ethernet and the sampling rate of the CPU;
and determining the number of the time slot sending bytes of each precise time slot according to the number of the interval sending bytes and the preset number of the precise time slots included in each time interval.
In one possible implementation, determining the number of bytes sent per interval of time according to the transmission rate of the connected ethernet and the sampling rate of the CPU includes:
according to
Figure BDA0003985036570000031
Calculating the interval sending byte number of each time interval;
determining the number of the time slot sending bytes of each precise time slot according to the number of the interval sending bytes and the preset number of the precise time slots included in each time interval, wherein the method comprises the following steps:
according to
Figure BDA0003985036570000041
Calculating the number of bytes sent by the time slot of each accurate time slot;
wherein N is 1 Indicating the number of bytes sent in intervals, v indicating the transmission rate of the connected Ethernet, f tableIndicating the sampling rate, N, of the CPU 2 Indicating the number of transmitted bytes of the slot, and n indicates the preset number of the exact slot.
In a second aspect, an embodiment of the present invention provides a chip for transmitting a packet in a unified multiple network interface based on a time slot granularity, which is used to implement the method for transmitting a packet in a unified multiple network interface based on a time slot granularity, described in the first aspect or any possible implementation manner of the first aspect; the chip for transmitting the message by combining multiple networks and sharing one interface based on the time slot granularity comprises an SV data module, a GOOSE data module, an MMS data module, a time slot control module, a scheduling write-in module, a first cache region, a second cache region and a scheduling read-out module;
the output end of the time slot control module is respectively connected with the scheduling write-in module and the scheduling read-out module, the output end of the time slot control module is also used for being connected with the CPU, and the time slot control module is used for determining the accurate time slot;
the input end of the SV data module is used for receiving an SV control block sent by a CPU; the input end of the GOOSE data module is used for receiving a GOOSE control block sent by the CPU; the input end of the MMS data module is used for receiving MMS data packets sent by the CPU;
the SV data module, the GOOSE data module and the MMS data module are all connected with the input end of the scheduling write-in module, and the output end of the scheduling write-in module is respectively connected with the input end of the first cache region and the input end of the second cache region;
the output end of the first cache region and the output end of the second cache region are both connected with the input end of the scheduling and reading module, and the output end of the scheduling and reading module is used for sending data to the target device.
In a possible implementation manner, the chip for transmitting the message by multiple networks in one port based on the time slot granularity further comprises a first control table and a second control table;
the input end of the first control table is connected with the scheduling write-in module, the input end of the first control table is connected with the scheduling read-out module, and the first control table is also connected with the first cache region;
the input end of the second control table is connected with the scheduling write-in module, the input end of the second control table is connected with the scheduling read-out module, and the second control table is further connected with the second cache region.
In a third aspect, an embodiment of the present invention provides a system for transmitting a packet in a multiple network-in-one common port based on a time slot granularity, including a CPU, a target device, and a chip for transmitting a packet in a multiple network-in-one common port based on a time slot granularity, where the chip is described in any possible implementation manner of the second aspect or the second aspect;
the CPU and the chip which is based on the time slot granularity and is used for transmitting the message by the multi-network-in-one common port are connected through a first Ethernet and a PCIE bus;
the chip for transmitting the message by the multi-network-in-one common port based on the time slot granularity is connected with the target equipment through the second Ethernet.
The embodiment of the invention provides a method for transmitting messages by combining multiple networks and a common port based on time slot granularity, which comprises the steps of receiving a plurality of data packets sent by a CPU (central processing unit) at intervals of preset time, wherein the plurality of data packets comprise a GOOSE data packet, an MMS data packet and at least two SV data packets, and acquiring the data packets needing to be transmitted; determining an accurate time slot mark corresponding to the data of each data packet in the current time interval according to the length of the data in each data packet and the number of bytes sent in the time slot, and arranging GOOSE data, MMS data and a plurality of SV data in one time interval so as to output a plurality of SV data in time in the next time interval; according to each accurate time slot mark, storing the data corresponding to each accurate time slot mark to an idle buffer area in the current time interval, and storing the corresponding data according to the accurate time slot mark so as to output the data timely and accurately in the next time interval; in the next time interval, the data stored in the buffer area is sent to the target equipment according to each accurate time slot mark, SV data of a plurality of SV data packets can be sent to the target equipment in a period of time interval, timely sending of the SV data is guaranteed, GOOSE data of the GOOSE data packets can also be sent to the target equipment, delay time of the GOOSE data is not more than two time intervals, sending delay time of the GOOSE data is guaranteed to be small, and therefore the situation that sending delay time of the GOOSE data is small and the SV data are sent in time can be guaranteed at the same time.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart illustrating an implementation of a method for transmitting a packet through multiple networks in one interface based on a time slot granularity according to an embodiment of the present invention;
FIG. 2 is a diagram of data transmission provided by an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a chip for transmitting a packet through multiple networks in one interface based on time slot granularity according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a system for transmitting a packet through multiple networks and a common interface based on time slot granularity according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following description is made by way of specific embodiments with reference to the accompanying drawings.
Fig. 1 is a flowchart of an implementation of a method for transmitting a packet through multiple networks in one interface based on time slot granularity, which is detailed as follows:
step S101, acquiring the number of bytes sent by the time slot of each accurate time slot.
Step S102, receiving a plurality of data packets sent by the CPU at preset time intervals, wherein the plurality of data packets comprise a GOOSE data packet, an MMS data packet and at least two SV data packets.
In this embodiment, the number of bytes sent in the timeslot of each precise timeslot is first obtained, and then the data packet is received at preset time intervals to obtain the data packet, so as to determine the precise gap required for sending each data packet according to the data in the data packet, thereby scheduling and sending the data packet.
Step S103, according to the length of the data in each data packet and the number of bytes sent by the time slot, determining the precise time slot mark corresponding to the data in each data packet in the current time interval.
In this embodiment, the precise gap required for sending each data packet is determined, and the precise timeslot flag is used for marking, so that GOOSE data, MMS data, and SV data can be split according to the number of bytes sent in a timeslot in a time interval, so as to output SV data in time in a time interval subsequently, and facilitate subsequent sending of data packets.
And step S104, storing the data corresponding to each accurate time slot mark to an idle buffer area in the current time interval according to each accurate time slot mark.
In this embodiment, the received data is stored in the buffer according to the precise time slot flag, so that the data is sent according to the precise time slot in the following, and the data can be transmitted timely and accurately.
And step S105, in the next time interval, sending the data stored in the buffer area to the target equipment according to each accurate time slot mark.
In this embodiment, the data is sent according to the precise timeslot flag determined in a time interval, which can ensure that the previously acquired data can also be sent in a time interval, so that SV data in a plurality of SV data packets are all sent, and the delay time of the GOOSE data does not exceed two time intervals, thereby ensuring that the delay time is short.
The embodiment of the invention receives a plurality of data packets sent by a CPU (Central processing Unit) at preset time intervals, wherein the plurality of data packets comprise a GOOSE data packet, an MMS (multimedia message service) data packet and at least two SV data packets, and the data packets needing to be transmitted are obtained; determining an accurate time slot mark corresponding to the data of each data packet in the current time interval according to the length of the data in each data packet and the number of bytes sent in the time slot, and arranging GOOSE data, MMS data and a plurality of SV data in one time interval so as to output a plurality of SV data in time in the next time interval; storing the data corresponding to each precise time slot mark to an idle buffer area in the current time interval according to each precise time slot mark, and storing the corresponding data according to the precise time slot mark so as to output the data accurately in time in the next time interval; in the next time interval, the data stored in the buffer area is sent to the target equipment according to each accurate time slot mark, SV data of a plurality of SV data packets can be sent to the target equipment in a period of time interval, timely sending of the SV data is guaranteed, GOOSE data of the GOOSE data packets can be sent to the target equipment, delay time of the GOOSE data does not exceed two time intervals, sending delay time of the GOOSE data is guaranteed to be small, and therefore the situation that sending delay time of the GOOSE data is small and the SV data are sent in time can be guaranteed at the same time.
In a possible implementation manner, the step S102 receives a plurality of data packets sent by the CPU, which may be detailed as: sending an interrupt signal to the CPU every preset time; receiving a GOOSE data packet and at least two SV data packets sent by a CPU according to an interrupt signal; and receiving the MMS data packet sent by the CPU according to the connection-oriented data packet.
In this embodiment, the CPU sends the SV data packet and the GOOSE data packet only when receiving the interrupt signal, so that the interrupt signal needs to be sent to the CPU first, and then the GOOSE data packet and the SV data packet sent by the CPU are received; whereas MMS data can be originated at any time, independent of the interrupt signal.
In a possible implementation manner, step S103 determines, according to the length of data in each data packet and the number of bytes sent in a timeslot, an accurate timeslot flag corresponding to the data in each data packet in the current time interval, which may be detailed as: determining a precise time slot signature for each time interval; sequentially determining SV accurate time slot marks of each SV data in the current time interval according to the length of the SV data in the SV data packet and the number of bytes sent by the time slot; determining the GOOSE accurate time slot mark of the GOOSE data in the current time interval according to the SV accurate time slot mark, the GOOSE data in the GOOSE data packet and the number of bytes sent by the time slot; and determining the MMS accurate time slot mark of the MMS data in the current time interval according to the SV accurate time slot mark, the GOOSE accurate time slot mark, the MMS data in the MMS data packet and the number of bytes sent by the time slot.
In this embodiment, the precise time slot flag of each time interval is determined, so that each data packet can be divided according to the precise time slot flag to realize the scheduling of the data packet; the method comprises the steps of firstly determining an accurate time slot mark corresponding to an SV data packet, and then sequentially determining an accurate time slot mark corresponding to a GOOSE data packet and an accurate time slot mark corresponding to an MMS, so as to ensure that the SV data packet is transmitted in the highest priority and the GOOSE data packet is transmitted in the second best; in addition, if a plurality of SV data packets exist, for example, a first SV data packet, a second SV data packet and a third SV data packet exist, the precise time slot marks corresponding to the three SV data packets are sequentially determined, the precise time slot mark corresponding to the first SV data packet is determined, then the precise time slot mark corresponding to the second SV data packet is determined, and finally the precise time slot mark corresponding to the third SV data packet is determined, so that the determination of the precise time slot marks of the SV data packets is completed, and the three SV data packets can be transmitted in a time interval in the follow-up process.
The accurate time slot mark is determined by dividing and determining the length of data in a data packet and the number of bytes sent in a time slot, and if the length of the data in the data packet is less than the number of bytes sent in one time slot, the data packet corresponds to one accurate time slot mark; if the length of the data in the data packet is greater than the number of bytes sent in one time slot and less than the number of bytes sent in two time slots, the data packet corresponds to two accurate time slot marks; the ratio of the length of data in the data packet to the number of bytes sent by the time slot is calculated by a further method, so that the number of the accurate time slot marks corresponding to each data packet is determined; and determining the precise time slot mark corresponding to each data packet according to the arrangement sequence of the SV data packet, the GOOSE data packet and the MMS data packet.
For example, the length of data in the first SV data packet is 512 bytes, the length of data in the second SV data packet is 520 bytes, the length of data in the third SV data packet is 480 bytes, the length of data in the GOOSE data packet is 820 bytes, the length of data in the MMS data packet is 1500 bytes, and the number of bytes for slot transmission is 312 bytes, so that the first SV data packet occupies two precise slots corresponding to the two precise slot markers, the second SV data packet occupies two precise slots corresponding to the two precise slot markers, the third SV data packet also occupies two precise slots corresponding to the two precise slot markers, the GOOSE data packet occupies three precise slots corresponding to the three precise slot markers, and the MMS data packet occupies five precise slots corresponding to the five precise slot markers; and sequentially arranging, wherein the precise time slot marks corresponding to the first SV data packet are 1 and 2, the precise time slot marks corresponding to the second SV data packet are 3 and 4, the precise time slot marks corresponding to the third SV data packet are 5 and 6, the precise time slot marks corresponding to the GOOSE data packet are 7, 8 and 9, and the precise time slot marks corresponding to the MMS data packet are 10, 11, 12, 13 and 14.
In one possible implementation, each time interval is divided into a preset number of precise time slots on average; determining the precise time slot mark of each time interval, specifically: determining two adjacent time intervals as a group of time periods; and determining the accurate time slot marks corresponding to the accurate time slots in the time periods based on the time periods to obtain a plurality of accurate time slot marks corresponding to each time interval in the time periods.
In this embodiment, the precise time slots are obtained by dividing time intervals evenly, and each precise time slot corresponds to a precise time slot mark; two adjacent time intervals are used as a group of time periods, and the precise time slot mark is determined based on the group of time periods, so that the transmission of the previous group of data and the storage of the next group of data can be ensured at the same time, the accuracy of data transmission is ensured, and the chaos caused by the transmission of the data and the storage of the data is avoided.
For example, for a first time interval, a second time interval, a third time interval and a fourth time interval which are consecutive, where the first time interval and the second time interval are a set of time segments, the third time interval and the fourth time interval are a set of time segments, each time interval is divided into 100 segments, that is, each time interval includes 100 precise time slots, if the precise time slot flag corresponding to 100 precise time slots in the first time interval is 1 to 100, the precise time slot flag corresponding to 100 precise time slots in the second time interval is 101 to 200, the precise time slot flag corresponding to 100 precise time slots in the third time interval is 1 to 100, and the precise time slot flag corresponding to 100 precise time slots in the fourth time interval is 101 to 200, so as to determine the precise time slot flag of each set of time segments; correspondingly, the accurate time slot flag corresponding to the first group of data packets during storage may be 1 to 100, and the accurate time slot flag corresponding to the second group of data packets during storage may be 101 to 200, so as to distinguish two adjacent groups of data packets, thereby avoiding errors occurring during data transmission.
In one possible implementation manner, step S101 obtains the number of timeslot transmission bytes of each precise timeslot, which can be detailed as: determining the number of bytes sent at intervals of each time interval according to the transmission rate of the connected Ethernet and the sampling rate of a CPU (Central processing Unit); and determining the number of the time slot sending bytes of each precise time slot according to the number of the interval sending bytes and the preset number of the precise time slots included in each time interval.
Specifically, the number of bytes sent at an interval of each time interval is determined according to the transmission rate of the connected ethernet and the sampling rate of the CPU, which may be detailed as follows: according to
Figure BDA0003985036570000101
Calculating the interval sending byte number of each time interval; determining the number of bytes sent by the timeslot of each precise timeslot according to the number of bytes sent by the interval and the preset number of precise timeslots included in each time interval, which can be detailed as follows: according to>
Figure BDA0003985036570000102
Calculating the number of bytes sent by the time slot of each accurate time slot; wherein N is 1 Indicating the number of bytes sent in intervals, v the transmission rate of the connected Ethernet, f the sampling rate of the CPU, N 2 Indicating the number of transmitted bytes of a slot, n indicating the number of precise slotsAnd setting the number.
In the present embodiment, the number of interval transmission bytes can be determined based on the transmission rate of the connected ethernet and the sampling rate of the CPU, and the total number of bytes that can be transmitted in each time interval can be determined, so that the number of slot transmission bytes per precise slot can be determined based on the preset number of precise slots.
For example, the ethernet may be gigabit ethernet, the transmission rate of the gigabit ethernet is 1000Mbs, 125,000,000 bytes can be transmitted, the sampling rate of the SV packet in the CPU may be 4000Hz, and the number of bytes sent at each time interval is 31250 bytes; if each time interval is divided into 100 precise slots, the number of bytes transmitted per slot of a precise slot is about 312 bytes.
In a possible implementation manner, in step S105, in the next time interval, the data stored in the buffer is sent to the target device according to each precise timeslot flag, which may be detailed as: updating a control table stored in the current cache region according to each accurate time slot mark and the data corresponding to each accurate time slot mark, wherein the control table comprises each accurate time slot mark and the byte information of the data corresponding to each accurate time slot mark; and in the next time interval, searching byte information corresponding to the time slot mark in the control table according to the time slot mark corresponding to the current precise time slot, and sending data corresponding to the byte information in the current cache region to the target equipment.
In this embodiment, after the data in the data packet is stored in the buffer, the precise time slot flag and the byte information of the data may be stored in the data table in the buffer, so as to clarify the data stored in the buffer and the corresponding precise time slot flag, and thus, the corresponding data may be quickly determined from the buffer in the next time interval to be accurately transmitted.
In a possible implementation manner, after step S105, according to the timeslot flag corresponding to the current precise timeslot, searching the control table for the byte information corresponding to the timeslot flag, and sending the data corresponding to the byte information in the current buffer area to the target device, the method further includes: and clearing the time slot marks in the control table and byte information corresponding to the time slot marks according to the time slot marks.
In this embodiment, after sending the data in the cache region to the target device, it indicates that the corresponding data in the cache region has been sent, the information in the control table corresponding to the cache region may be cleared, which proves that the information has been sent, and when all the information in the control table is cleared, it indicates that all the data in the cache region has been sent to the target device, and the cache region is currently an idle cache region, and may continue to store the data in the next time interval; in addition, after all the data in the buffer area are sent to the target device, all the information in the control table can be cleared uniformly.
In a specific embodiment, gigabit ethernet is used for data transmission, the transmission rate of the gigabit ethernet is 1000Mbs, 125,000,000 bytes can be transmitted, the sampling rate of SV packets in the CPU can be 4000Hz, the number of bytes transmitted at each interval is 31250 bytes, each interval is divided into 100 precise slots, and the number of bytes transmitted at each time slot is about 312 bytes; the two time intervals are a set of time segments that include 200 exact time slots.
Receiving a plurality of data packets sent by a CPU, wherein the plurality of data packets comprise a first SV data packet, a second SV data packet, a GOOSE data packet and an MMS data packet, the length of data in the first SV data packet is 512 bytes, the length of data in the second SV data packet is 480 bytes, the length of data in the GOOSE data packet is 820 bytes, and the length of data in the MMS data packet is 1500 bytes; and storing the data packet into an idle cache region, and updating a control table stored in the cache region.
The precise time slot marks corresponding to the first SV data packet are 1 and 2, the precise time slot marks corresponding to the second SV data packet are 3 and 4, the precise time slot marks corresponding to the GOOSE data packet are 5, 6 and 7, and the precise time slot marks corresponding to the MMS data packet are 8, 9, 10, 11 and 12.
The control table in the cache area is specifically shown in table 1:
TABLE 1 control table
Precise time slot indicator Buffer block number Total number of blocks Current block number Total package length Current sub-packet length
1 1 2 1 512 312
2 2 2 2 512 200
3 3 2 1 480 312
4 4 2 2 480 168
5 5 3 1 820 312
6 6 3 2 820 312
7 7 3 3 820 196
8 8 5 1 1500 312
9 9 5 2 1500 312
10 10 5 3 1500 312
11 11 5 4 1500 312
12 12 5 5 1500 252
…… …… …… …… …… ……
n n / / / /
…… …… …… …… …… ……
100 100 / / / /
As can be seen from table 1, the control table corresponding to the buffer area may store byte information related to the data packet, so as to facilitate subsequent reading of data from the buffer area according to the current time slot flag, specifically, the corresponding buffer area is divided into 100 byte blocks, the block number of the 100 byte block corresponds to the number of the buffer block in table 1, when the current time slot flag is 1, it is determined that the block number of the corresponding buffer area is 1 from the control table, and then the data corresponding to the block number of the byte block in the buffer area that is 1 is sent to the target device; or, in the stored time interval, the current time slot flag is located at 1-100, the accurate time slot flag of the stored data is also 1-100, data is sent in the next time interval, the current time slot flag is located at 101-200, the time slot flag 101 corresponds to the accurate time slot flag 1, the time slot flag 102 corresponds to the accurate time slot flag 2, the time slot flag 103 corresponds to the accurate time slot flag 3, and the time slot flag and the accurate time slot flag are both corresponding in sequence.
Referring to the schematic diagram of data transmission described in fig. 2, a first SV data packet, a second SV data packet, a GOOSE data packet, and an MMS data packet are sequentially transmitted in a current time interval, and the first SV data packet, the second SV data packet, the GOOSE data packet, and the MMS data packet are sequentially transmitted again in a next time interval, so that the time length of one time interval, that is, 250us, of the transmission time interval of the first SV data packet in the preceding and following 2 time intervals can be ensured; similarly, the sending time intervals of the second SV data, GOOSE data and MMS data in the preceding and following 2 time intervals are also 250us respectively, so that when the CPU outputs a plurality of SV data packets, the accuracy and uniformity of the output time between the data packets can be guaranteed; meanwhile, the GOOSE packet and the MMS packet can also ensure sufficient communication bandwidth.
The embodiment of the invention provides a method for transmitting messages by combining multiple networks and a common port based on time slot granularity, which comprises the steps of receiving a plurality of data packets sent by a CPU (central processing unit) at intervals of preset time, wherein the plurality of data packets comprise a GOOSE data packet, an MMS data packet and at least two SV data packets, and acquiring the data packets needing to be transmitted; determining an accurate time slot mark corresponding to the data of each data packet in the current time interval according to the length of the data in each data packet and the number of bytes sent in the time slot, and arranging GOOSE data, MMS data and a plurality of SV data in one time interval so as to output a plurality of SV data in time in the next time interval; specifically, an accurate time slot mark corresponding to an SV data packet is determined firstly, and then an accurate time slot mark corresponding to a GOOSE data packet and an accurate time slot mark corresponding to an MMS are determined in sequence, so that the SV data packet is transmitted in the highest priority, and the GOOSE data packet is transmitted in the second best; storing the data corresponding to each precise time slot mark to an idle buffer area in the current time interval according to each precise time slot mark, and storing the corresponding data according to the precise time slot mark so as to output the data accurately in time in the next time interval; the control table stored in the current cache region is updated so as to clarify the data stored in the cache region and the corresponding precise time slot marks, and the data stored in the cache region is sent to the target equipment according to each precise time slot mark in the next time interval, so that the corresponding data can be quickly determined from the cache region to be accurately sent; therefore, SV data of a plurality of SV data packets can be sent to the target equipment within a period of time interval, the SV data can be sent in time, GOOSE data of the GOOSE data packets can also be sent to the target equipment, the time delay of the GOOSE data can not exceed two time intervals, the sending time delay of the GOOSE data is ensured to be smaller, and the purpose of simultaneously ensuring that the sending time delay of the GOOSE data is smaller and a plurality of SV data can be sent in time can be achieved; after the data is sent to the target device, the control table corresponding to the cache region is also cleared, so that the cache region is used as an idle cache region, and the data can be conveniently stored at the next time interval.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
The following are embodiments of the apparatus of the invention, reference being made to the corresponding method embodiments described above for details which are not described in detail therein.
Fig. 3 shows a chip for transmitting a packet by multiple networks and one interface based on timeslot granularity according to an embodiment of the present invention, which only shows a part related to the embodiment of the present invention for convenience of description, and the details are as follows:
as shown in fig. 3, the chip 3 for transmitting messages based on timeslot size and multiple networks in one interface is used to implement the above embodiment of the method for transmitting messages based on timeslot size and multiple networks in one interface; the chip 3 for transmitting messages by multiple networks and one interface based on time slot granularity comprises an SV data module 31, a GOOSE data module 32, an MMS data module 33, a time slot control module 34, a scheduling write-in module 35, a first buffer 36, a second buffer 37 and a scheduling read-out module 38.
The output end of the time slot control module 34 is respectively connected with the scheduling write-in module 35 and the scheduling read-out module 38, and the time slot control module 34 sends the determined accurate time slot to the scheduling write-in module 35 and the scheduling read-out module 38; the output of the timeslot control module 34 is also used to connect to the CPU, and the timeslot control module sends an interrupt signal to the CPU every preset time.
The input end of the SV data module 31 is used to receive SV data packets sent by the CPU; the input end of the GOOSE data module 32 is configured to receive a GOOSE data packet sent by the CPU; the input end of the MMS data module 33 is used for receiving MMS data packets sent by the CPU.
The SV data module 31, the GOOSE data module 32, and the MMS data module 33 are all connected to an input end of the scheduling write-in module 35, and an output end of the scheduling write-in module 35 is respectively connected to an input end of the first buffer area 36 and an input end of the second buffer area 37; the scheduling write module 35 reads data of each data packet in the SV data module 31, the GOOSE data module 32, and the MMS data module 33, determines an accurate timeslot flag corresponding to each data packet, stores the data of each data packet in an idle buffer, stores the data in different buffers at different time intervals, for example, stores the data in the first buffer 36 at the previous time interval, stores the data in the second buffer 37 at the current time interval, and stores the data in the first buffer 36 at the next time interval, so as to store the data alternately.
The output end of the first buffer area 36 and the output end of the second buffer area 37 are both connected to the input end of the scheduling read module 38, and the output end of the scheduling read module 38 is used for sending data to the target device; specifically, the scheduling and reading module 38 reads data from a corresponding buffer according to the current time slot flag, and sends the data to the target device; for example, if the current slot flag is 1, the data with the slot flag of 1 in the buffer is read.
In a possible implementation manner, the chip for transmitting a packet in a multi-network-in-one common port based on the time slot granularity further includes a first control table 361 and a second control table 371; the input end of the first control table 361 is connected with the scheduling write-in module 35, the input end of the first control table 361 is connected with the scheduling read-out module 38, and the first control table 361 is also connected with the first cache region 36; the input of the second control table 371 is connected to the schedule writing module 35, the input of the second control table 371 is connected to the schedule reading module 38, and the second control table 371 is further connected to the second buffer 37.
In this embodiment, the first control table 361 corresponds to the first buffer area 36, and is used for storing byte information of data in the first buffer area; the second control table 371 corresponds to the second buffer 37, and is used for storing byte information of the second buffer; under the control of the schedule reading module 38, data is read from the corresponding buffer according to the information in the first control table 361 or the second control table 371, and the data is transmitted to the target device.
The embodiment of the invention receives a plurality of data packets sent by a CPU (central processing unit) at preset time intervals, wherein the plurality of data packets comprise a GOOSE data packet, an MMS data packet and at least two SV data packets, and the data packets needing to be transmitted are obtained; determining an accurate time slot mark corresponding to the data of each data packet in the current time interval according to the length of the data in each data packet and the number of bytes sent in the time slot, and arranging GOOSE data, MMS data and a plurality of SV data in one time interval so as to output a plurality of SV data in time in the next time interval; specifically, an accurate time slot mark corresponding to an SV data packet is determined firstly, and then an accurate time slot mark corresponding to a GOOSE data packet and an accurate time slot mark corresponding to an MMS are determined in sequence, so that the SV data packet is transmitted in the highest priority, and the GOOSE data packet is transmitted in the second best; storing the data corresponding to each precise time slot mark to an idle buffer area in the current time interval according to each precise time slot mark, and storing the corresponding data according to the precise time slot mark so as to output the data accurately in time in the next time interval; the control table stored in the current cache region is updated so as to clarify the data stored in the cache region and the corresponding precise time slot marks, and the data stored in the cache region is sent to the target equipment according to each precise time slot mark in the next time interval, so that the corresponding data can be quickly determined from the cache region to be accurately sent; therefore, SV data of a plurality of SV data packets can be sent to the target equipment within a period of time interval, the SV data can be sent in time, GOOSE data of the GOOSE data packets can also be sent to the target equipment, the time delay of the GOOSE data can not exceed two time intervals, the sending time delay of the GOOSE data is ensured to be smaller, and the purpose of simultaneously ensuring that the sending time delay of the GOOSE data is smaller and a plurality of SV data can be sent in time can be achieved; after the data is sent to the target device, the control table corresponding to the cache region is also cleared, so that the cache region is used as an idle cache region, and the data can be conveniently stored at the next time interval.
The following are embodiments of the system of the invention, and for details not described in detail therein, reference may be made to the corresponding method embodiments described above.
Fig. 4 is a schematic structural diagram of a system for transmitting a packet by multiple networks and one interface based on timeslot granularity according to an embodiment of the present invention, where for convenience of description, only a part related to the embodiment of the present invention is shown, and details are as follows:
a system for transmitting messages based on time slot granularity and multiple networks in one interface comprises a CPU41, a target device 42 and a chip for transmitting messages based on time slot granularity and multiple networks in one interface.
The CPU and the chip which is based on the time slot granularity and is used for transmitting the message by the multi-network-in-one common port are connected through the first Ethernet and the PCIE bus.
The chip and the target device of the multi-network-in-one common-port message transmission based on the time slot granularity are connected through a second Ethernet.
The embodiment of the invention can carry out the test of the transmission message by arranging the CPU, the target equipment and the chip for transmitting the message by the multi-network-in-one and the same port based on the time slot granularity, and particularly realizes the test by the chip for transmitting the message by the multi-network-in-one and the same port based on the time slot granularity; the chip for transmitting the message by combining multiple networks and sharing one interface based on the time slot granularity receives a plurality of data packets sent by a CPU (central processing unit) at preset time intervals, wherein the plurality of data packets comprise a GOOSE (generic object oriented substation event) data packet, an MMS (multimedia message service) data packet and at least two SV (space vector) data packets, and the data packets needing to be transmitted are obtained; determining an accurate time slot mark corresponding to the data of each data packet in the current time interval according to the length of the data in each data packet and the number of bytes sent in the time slot, and arranging GOOSE data, MMS data and a plurality of SV data in one time interval so as to output a plurality of SV data in time in the next time interval; specifically, an accurate time slot mark corresponding to an SV data packet is determined firstly, and then an accurate time slot mark corresponding to a GOOSE data packet and an accurate time slot mark corresponding to an MMS are determined in sequence, so that the SV data packet is transmitted in the highest priority, and the GOOSE data packet is transmitted in the second best; storing the data corresponding to each precise time slot mark to an idle buffer area in the current time interval according to each precise time slot mark, and storing the corresponding data according to the precise time slot mark so as to output the data accurately in time in the next time interval; the control table stored in the current cache region is updated so as to clarify the data stored in the cache region and the corresponding precise time slot marks, and the data stored in the cache region is sent to the target equipment according to each precise time slot mark in the next time interval, so that the corresponding data can be quickly determined from the cache region to be accurately sent; therefore, SV data of a plurality of SV data packets can be sent to the target equipment within a period of time interval, the SV data can be sent in time, GOOSE data of the GOOSE data packets can also be sent to the target equipment, the time delay of the GOOSE data can not exceed two time intervals, the sending time delay of the GOOSE data is ensured to be smaller, and the purpose of simultaneously ensuring that the sending time delay of the GOOSE data is smaller and a plurality of SV data can be sent in time can be achieved; after the data is sent to the target device, the control table corresponding to the cache region is also cleared, so that the cache region is used as an idle cache region, and the data can be conveniently stored at the next time interval.
The above-mentioned embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein.

Claims (10)

1. A method for transmitting messages by multiple networks in one interface based on time slot granularity is characterized by comprising the following steps:
acquiring the number of bytes sent by the time slot of each accurate time slot;
receiving a plurality of data packets sent by a CPU every preset time interval, wherein the plurality of data packets comprise a GOOSE data packet, an MMS data packet and at least two SV data packets;
determining an accurate time slot mark corresponding to the data in each data packet in the current time interval according to the length of the data in each data packet and the number of bytes sent by the time slot;
storing data corresponding to each precise time slot mark to an idle cache region in the current time interval according to each precise time slot mark;
and in the next time interval, sending the data stored in the buffer area to the target equipment according to each accurate time slot mark.
2. The method for transmitting packets according to claim 1, wherein the determining the precise timeslot flag corresponding to the data of each packet in the current time interval according to the length of the data in each packet and the number of bytes sent in the timeslot comprises:
determining a precise time slot signature for each time interval;
sequentially determining SV accurate time slot marks of each SV data in the current time interval according to the length of the SV data in the SV data packet and the number of bytes sent by the time slot;
determining a GOOSE accurate time slot mark of the GOOSE data in the current time interval according to the SV accurate time slot mark, the GOOSE data in the GOOSE data packet and the number of bytes sent by the time slot;
and determining the MMS precise time slot mark of the MMS data in the current time interval according to the SV precise time slot mark, the GOOSE precise time slot mark, the MMS data in the MMS data packet and the number of bytes sent in the time slot.
3. The method for transmitting packets according to claim 1, wherein the step of sending the data stored in the buffer to the target device according to each precise timeslot flag in the next time interval comprises:
updating a control table stored in the current cache region according to each precise time slot mark and the data corresponding to each precise time slot mark, wherein the control table comprises each precise time slot mark and the byte information of the data corresponding to each precise time slot mark;
and in the next time interval, searching byte information corresponding to the time slot mark in the control table according to the time slot mark corresponding to the current precise time slot, and sending data corresponding to the byte information in the current cache region to the target equipment.
4. The method according to claim 3, wherein after searching byte information corresponding to the timeslot identifier in a control table according to the timeslot identifier corresponding to the current precise timeslot, and sending data corresponding to the byte information in a current buffer to a target device, the method further comprises:
and clearing the time slot marks in the control table and byte information corresponding to the time slot marks according to the time slot marks.
5. The method for transmitting packets according to claim 1, wherein the receiving a plurality of data packets sent by the CPU comprises:
sending an interrupt signal to the CPU every preset time;
receiving a GOOSE data packet and at least two SV data packets sent by the CPU according to the interrupt signal;
and receiving the MMS data packet sent by the CPU according to the connection-oriented data packet.
6. The method for multi-network-one-interface message transmission based on time slot granularity according to claim 2, wherein each time interval is divided into a preset number of precise time slots on average;
the determining the precise time slot identifier of each time interval comprises:
determining two adjacent time intervals as a group of time periods;
determining an accurate time slot mark corresponding to each accurate time slot in each group of time slots based on each group of time slots to obtain a plurality of accurate time slot marks corresponding to each time interval in each group of time slots;
the obtaining the number of bytes sent by the time slot of each precise time slot includes:
determining the number of bytes sent at intervals of each time interval according to the transmission rate of the connected Ethernet and the sampling rate of the CPU;
and determining the number of the time slot sending bytes of each precise time slot according to the number of the interval sending bytes and the preset number of the precise time slots included in each time interval.
7. The method for transmitting packets according to claim 6, wherein the determining the number of bytes sent at each interval according to the transmission rate of the connected ethernet and the sampling rate of the CPU comprises:
according to
Figure FDA0003985036560000031
Calculating the interval sending byte number of each time interval;
determining the number of bytes sent by the time slot of each precise time slot according to the number of bytes sent by the interval and the preset number of precise time slots included in each time interval, wherein the determining comprises the following steps:
according to
Figure FDA0003985036560000032
Calculating the number of bytes sent by the time slot of each accurate time slot;
wherein N is 1 Indicating the number of bytes sent in the interval, v indicating the transmission rate of the connected Ethernet, f indicating the sampling rate of the CPU, N 2 Indicating the number of bytes sent by the time slot, and n indicating the preset number of the precise time slot.
8. A chip for transmitting messages based on timeslot granularity and all-in-one interfaces, which is used for implementing the method for transmitting messages based on timeslot granularity and all-in-one interfaces according to any one of claims 1 to 7; the chip for transmitting the message by combining multiple networks and sharing one interface based on the time slot granularity comprises an SV data module, a GOOSE data module, an MMS data module, a time slot control module, a scheduling write-in module, a first cache region, a second cache region and a scheduling read-out module;
the output end of the time slot control module is respectively connected with the scheduling write-in module and the scheduling read-out module, the output end of the time slot control module is also used for being connected with a CPU, and the time slot control module is used for determining an accurate time slot;
the input end of the SV data module is used for receiving an SV data packet sent by the CPU; the input end of the GOOSE data module is used for receiving a GOOSE data packet sent by the CPU; the input end of the MMS data module is used for receiving MMS data packets sent by the CPU;
the SV data module, the GOOSE data module and the MMS data module are all connected with the input end of the scheduling write-in module, and the output end of the scheduling write-in module is respectively connected with the input end of the first cache region and the input end of the second cache region;
the output end of the first cache region and the output end of the second cache region are both connected with the input end of the scheduling and reading module, and the output end of the scheduling and reading module is used for sending data to target equipment.
9. The chip for transmitting packets according to claim 8, wherein the chip for transmitting packets according to the timeslot-based granularity further includes a first control table and a second control table;
the input end of the first control table is connected with the scheduling write-in module, the input end of the first control table is connected with the scheduling read-out module, and the first control table is also connected with the first cache region;
the input end of the second control table is connected with the scheduling write-in module, the input end of the second control table is connected with the scheduling read-out module, and the second control table is further connected with the second cache region.
10. A system for transmitting messages based on timeslot granularity and multiple networks in one interface, which is characterized by comprising a CPU, a target device and a chip for transmitting messages based on timeslot granularity and multiple networks in one interface according to claim 8;
the CPU and the chip for transmitting the message by the multi-network-in-one common port based on the time slot granularity are connected through a first Ethernet and a PCIE bus;
the chip for transmitting the message by the multi-network-in-one common port based on the time slot granularity is connected with the target equipment through a second Ethernet.
CN202211562091.9A 2022-12-07 2022-12-07 Method and system for transmitting message by multiple networks in one interface based on time slot granularity Pending CN115987904A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211562091.9A CN115987904A (en) 2022-12-07 2022-12-07 Method and system for transmitting message by multiple networks in one interface based on time slot granularity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211562091.9A CN115987904A (en) 2022-12-07 2022-12-07 Method and system for transmitting message by multiple networks in one interface based on time slot granularity

Publications (1)

Publication Number Publication Date
CN115987904A true CN115987904A (en) 2023-04-18

Family

ID=85973010

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211562091.9A Pending CN115987904A (en) 2022-12-07 2022-12-07 Method and system for transmitting message by multiple networks in one interface based on time slot granularity

Country Status (1)

Country Link
CN (1) CN115987904A (en)

Similar Documents

Publication Publication Date Title
US7801173B2 (en) Communication message conversion apparatus and communication message conversion method
US4586175A (en) Method for operating a packet bus for transmission of asynchronous and pseudo-synchronous signals
US7464201B1 (en) Packet buffer management apparatus and method
CN101873269B (en) Data retransmission device and method for distributing buffer to ports
CN101616083A (en) A kind of message forwarding method and device
US4901313A (en) A-point to multi-points communication system
EP0027006B1 (en) Decoding terrestrial interface modules bus structure
CN113971087A (en) Task allocation method, device and system and computer storage medium
CN114490467B (en) Message processing DMA system and method of multi-core network processor
CN110971543B (en) Transmission scheduling method and system of TTFC network
CN115987904A (en) Method and system for transmitting message by multiple networks in one interface based on time slot granularity
CN103106177B (en) Interconnect architecture and method thereof on the sheet of multi-core network processor
US4612541A (en) Data transmission system having high-speed transmission procedures
CN111405534A (en) Information transmission method, first terminal and computer storage medium
CN113473267B (en) Data transmission method, device and communication device
CN102857443B (en) Data writing method, device and system
CN117499351A (en) Message forwarding device and method, communication chip and network equipment
CN111193650B (en) Node receiving and dispatching control device based on SAE AS5643 standard
US7729302B2 (en) Adaptive control of multiplexed input buffer channels
US7414991B2 (en) Computing system and method to select data packet
CN109308180B (en) Processing method and processing device for cache congestion
CN110708253B (en) Message control method, flow table updating method and node equipment
CN112363963A (en) Data transmission method and device based on Powerlink bus
CN105656804A (en) Message processing method and device
CN113795047B (en) Downlink energy saving method, system, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination