Multi-mode communication data transmission method, trackside security platform, equipment and medium
By realizing dynamic data packet replenishment and dynamic time adjustment in the trackside safety platform, the problem of mismatch between the main cycle and the peripheral communication cycle and clock offset is solved, the reliability and real-time performance of multi-mode communication are improved, and communication problems are avoided. Interruptions and packet loss.
Patent Information
- Application Number
- CN202411010429.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-10-15
AI Technical Summary
In the multi-mode communication between the trackside safety platform and peripherals, the existing technology is difficult to effectively deal with the problem of mismatch between the main cycle and the peripheral communication cycle, as well as the clock offset problem of the platform's main computing module and communication module, resulting in communication interruption. and packet loss.
By realizing dynamic data packet replenishment and time dynamic adjustment between the main computing module and the platform communication module, reliable transmission of data packets and clock synchronization are ensured. The main computing module dynamically supplements packets according to the communication cycle length and the main cycle length, and controls the sending timing of data packets through the cache mechanism. The platform communication module performs clock synchronization based on the clock frame sent by the main computing module.
It improves the reliability and real-time performance of multi-mode communication, avoids communication interruption and packet loss, ensures the integrity of data transmission and clock synchronization, and supports the platform to maintain multiple communication nodes with different cycles.
Smart Images

Figure CN118784136A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication data transmission, and in particular to a multi-mode communication data transmission method, a trackside safety platform, equipment and a medium. Background Art
[0002] The traditional way of data exchange between the trackside safety platform and peripherals is generally synchronous communication, that is, the communication cycle of the platform communication module (SIU) is equal to the main cycle of the main operation module (SUU) or an integer multiple of the main cycle. However, the synchronous communication method has high requirements on the matching degree of the communication cycle of the local and peripheral devices. When the safety platform communicates with multiple peripherals with different communication cycles at the same time, the synchronous communication has the following problems: if the main cycle of the safety platform is longer than the communication cycle of the peripheral, some communication cycles of the peripheral may not receive data packets, resulting in communication interruption; if the main cycle of the safety platform is smaller than the communication cycle of the peripheral, the message buffer may overflow, resulting in packet loss in some communication cycles of the peripheral.
[0003] Multi-mode communication is a suitable solution for scenarios where communication occurs with multiple peripherals with different communication cycles. The trackside safety platform communicates by maintaining multiple communication nodes with different cycles and with peripherals with different cycles.
[0004] After searching, the Chinese invention patent CN111114600A discloses an intercity railway fully automatic unmanned driving system, in which the line management server is connected to the on-board equipment through a multi-mode communication gateway for data transmission. The above scheme does not provide a specific solution to the problem of mismatch between the platform main cycle and the peripheral communication cycle and the clock offset problem of the platform main operation module and the communication module.
[0005] Therefore, it is urgent to design a multi-mode communication data transmission solution for the trackside safety platform with high reliability and good real-time performance, which can effectively deal with the mismatch between the platform main cycle and the peripheral communication cycle and the clock offset problem between the platform main operation module and the communication module. Summary of the invention
[0006] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and to provide a multi-mode communication data transmission method, trackside safety platform, equipment and medium, which can effectively deal with the mismatch problem between the platform main cycle and the peripheral communication cycle and the clock offset problem between the platform main operation module and the communication module, thereby ensuring the reliability and real-time performance of the multi-mode communication data transmission process.
[0007] The purpose of the present invention can be achieved by the following technical solutions:
[0008] According to a first aspect of the present invention, a multi-mode communication data transmission method is provided for data transmission between a trackside safety platform and an external device, the trackside safety platform comprising a main computing module and a platform communication module, the trackside safety platform communicates with the external device via the platform communication module, the multi-mode communication data transmission method comprising:
[0009] The main operation module dynamically supplements the application data packet according to the relative relationship between the communication cycle length and the main cycle length and sends it to the platform communication module, including: when the main cycle length is greater than the communication cycle length, in the last main cycle of the cycle, correcting the virtual cycle number of the application data packet according to the main cycle number, and sending the supplementary packet to the platform communication module before the end of the current main cycle;
[0010] The platform communication module adjusts its communication cycle to be the same as the communication cycle of the external device, and controls the sending timing of the application data packet through a cache mechanism; wherein the platform communication module performs clock synchronization according to the clock frame sent by the main operation module.
[0011] Preferably, the cycle period is the least common multiple of the communication cycle length and the main cycle length.
[0012] Preferably, a supplementary packet is sent to the platform communication module before the current main cycle ends, and the number of supplementary packets in one cycle is the difference between the number of communication cycles and the number of main cycles in one cycle.
[0013] Preferably, when the main cycle length is less than or equal to the communication cycle length, no packet replenishment operation is performed, and the main cycle number is assigned to the virtual cycle number in each main cycle to update the virtual cycle number.
[0014] Preferably, in the last main cycle of the cycle, the virtual cycle number of the application data packet is corrected according to the main cycle number, and the corrected virtual cycle number is expressed as:
[0015] VSN=[(MVSN-2)P m / P c ]+1
[0016] Where: [.] means rounding down, MVSN is the main cycle number, P m is the main cycle length, P c is the length of the communication cycle.
[0017] Preferably, when the main cycle length is greater than the communication cycle length, no packet replenishment operation is performed in the main cycles other than the last main cycle in the cycle period. After entering the main cycle, the virtual cycle number is incremented by 1, and only one packet of data is sent to the platform communication module before the end of the current main cycle.
[0018] Preferably, the platform communication module adjusts its communication cycle to be the same as the communication cycle of the external device, and controls the sending timing of the application data packet through a cache mechanism, including:
[0019] A read queue for receiving application data packets sent by the main operation module and a cache queue for caching received application data packets are set in the platform communication module;
[0020] When the main computing module sends the application data packet to the platform communication module, the platform communication module first stores the application data packet in the read queue;
[0021] The main operation module sends a clock frame to the platform communication module at the beginning of each main cycle. After receiving the clock frame, the platform communication module processes the data in the read queue and the cache queue.
[0022] Preferably, after receiving the clock frame, the platform communication module processes the data in the read queue and the cache queue. c Less than the main period length P m The data processing process includes:
[0023] First, the platform communication module traverses all the data packets in the read queue, and for each packet of data: if the communication cycle number P of the current cycle is equal to the virtual cycle number VSN of the data packet, the platform communication module sends the current packet data to the external device; if the communication cycle number P of the current cycle is less than the virtual cycle number VSN of the data packet and the virtual cycle number VSN of the current packet data is greater than or equal to the virtual cycle number VSN of the end of the cache queue, the current packet data is stored in the end of the cache queue; in other cases, the current packet data is discarded;
[0024] Then, the head data of the cache queue is continuously read: if the communication cycle number P of the current cycle is equal to the virtual cycle number VSN of the data packet, the current packet data is sent; if the communication cycle number P of the current cycle is less than the virtual cycle number VSN of the data packet, the current packet data is put back to the head of the queue, and the platform communication module stops reading the cache queue; in other cases, the current packet data is discarded.
[0025] Preferably, after receiving the clock frame, the platform communication module processes the data in the read queue and the cache queue. c Greater than or equal to the main period length P m The data processing process includes:
[0026] If the current communication cycle number P within a cycle M and the communication cycle number A within a cycle M c Satisfy P%A c=1, |S|+1 packets are sent to the external device, where S is the number of supplementary packets. For data in the read queue or cache queue: if 1-|S|≤VSN-(P-1)P c / P m ≤1, send the current packet data; if the current packet data satisfies: VSN>(P-1)P c / P m +1, the current packet data is retained and stored in the cache queue; otherwise, the current packet data is discarded;
[0027] If the current communication cycle number P within a cycle M and the communication cycle number A within a cycle M c Satisfy P%A c ≠1, the read queue is read first and then the cache queue. The processing after reading the data includes:
[0028] 1) If the virtual cycle number VSN of the current packet data satisfies ([VSN / A m ]A m +1)P m ≠[P / A c ]A c P c , then discard the packet data, otherwise go to 2);
[0029] 2) If the virtual cycle number VSN of the current packet data satisfies VSN%A m =P%A c , then send data; if VSN%A m <P%A c , then discard the data; if VSN%A m >P%A c , the current packet data is stored in the cache queue.
[0030] Preferably, the platform communication module performs clock synchronization according to the clock frame sent by the main operation module, including:
[0031] The main operation module is provided with an incremental counter. During normal operation, the incremental counter increments by 1 every counting cycle until a clock frame is received or the count reaches a counting threshold T. SIU Or the communication cycle length P c , at this time the increment counter is cleared;
[0032] At the beginning of each main cycle, the clock of the platform communication module is corrected through a clock frame to align the start time of the communication cycle and the main cycle; wherein the clock frame includes a main cycle number field.
[0033] Preferably, when the main operation module receives the clock frame, the increment counter is cleared, and further includes:
[0034] The communication cycle number P within the update cycle M is:
[0035] P = [(MVSN-2)P m / P c ]+1
[0036] Update count threshold T SIU for:
[0037]
[0038] Where: MVSN is the main cycle number, P m is the main cycle length, and % is the modulo operation.
[0039] Preferably, when the count of the incremental counter in the main operation module reaches the count threshold T SIU When the counter is cleared, the communication cycle number is incremented by 1 within the cycle, and the communication cycle length P is c Assign a value to the counting threshold T SIU , to update the counting threshold T SIU .
[0040] Preferably, the platform communication module does not send or receive data after being powered on until the first clock frame arrives. The platform communication module initializes an increment counter according to the received clock frame, updates the communication cycle number P and the counting threshold T SIU , and then enters normal operation.
[0041] According to a second aspect of the present invention, there is provided a trackside safety platform, comprising a main computing module and a platform communication module, wherein the trackside safety platform uses any of the methods described above to perform multi-mode communication data transmission with an external device.
[0042] According to a third aspect of the present invention, there is provided an electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, any one of the methods described above is implemented.
[0043] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, any one of the methods described above is implemented.
[0044] Compared with the prior art, the present invention has the following beneficial effects:
[0045] 1) The main operation module of the present invention uses dynamic data compensation measures. When the main cycle is greater than the communication cycle, the main operation module regularly sends supplementary packets to the platform communication module to ensure that the platform communication module sends at least one packet of data to the peripheral device in each communication cycle, thereby avoiding communication interruption; when the main cycle is less than the communication cycle, the platform communication module uses a cache mechanism to ensure that all main operation module packets can be sent in time, thereby avoiding packet loss. While ensuring the reliability and real-time performance of communication, this method does not affect the data processing performance of the main operation module and is not affected by fluctuations in the sending time of the main operation module.
[0046] 2) The present invention periodically synchronizes the clocks of the platform communication module and the main operation module through a method of dynamic time adjustment, aligns the start time of the main cycle and the communication cycle at the beginning of the cycle, and corrects the platform communication module clock at the beginning of each main cycle, thereby alleviating the problems of clock offset and communication delay.
[0047] 3) The present invention supports hot plugging of the platform communication module. After the platform communication module is plugged into the slot, the clocks between the main computing module and the platform communication module can be aligned at any time through dynamic time compensation to ensure time synchronization. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is the communication architecture diagram of the trackside safety platform;
[0049] Figure 2 This is the platform communication timing diagram when the main cycle is 500ms and the peripheral communication cycle is 400ms;
[0050] Figure 3 This is the platform communication timing diagram when the main cycle is 500ms and the peripheral communication cycle is 600ms. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0052] Example
[0053] This embodiment provides a multi-mode communication data transmission method. The trackside safety platform realizes multiple modes of communication with external devices through the built-in platform communication module SIU and the main operation module SUU, such as synchronous cycle communication and asynchronous cycle communication, and supports configurability. The trackside safety platform receives data from the peripheral device through real-time processing. For the data transmitted to the peripheral device, the method mainly realizes multi-mode transmission by two measures: dynamic data compensation and dynamic time adjustment. The method solves the problems of communication interruption and packet loss through the measure of dynamic data compensation, solves the problem of transmission delay through dynamic time adjustment, supports the platform to maintain multiple communication nodes with different cycles, and ensures the reliability and real-time performance of the data transmission process.
[0054] The multi-mode communication data transmission method provided in this embodiment specifically includes:
[0055] 1. Dynamic compensation of SUU data
[0056] Without changing the main cycle of SUU, SUU is based on the communication cycle length P c and the main period length P m The relative relationship is dynamically supplemented and sent to the SIU.
[0057] Determine the number of packets required for the loop, and record the loop length M as P m , P c The least common multiple of
[0058] M = (P m , P c ) (1)
[0059] remember
[0060] A c = M / P c (2)
[0061] A m = M / P m (3)
[0062] Under the control of the time dynamic adjustment algorithm, the communication cycle and the main cycle start at the same time, then the cycle contains A c communication cycles and A m The number of packets that need to be added within a cycle length M is:
[0063] S = A c – A m (4)
[0064] The main cycle number is recorded as MVSN. Each time a new main cycle is entered, MVSN is incremented by 1. Define a virtual cycle number VSN. When the SUU encapsulates an external data packet according to the communication protocol, the VSN is updated and the VSN information is added to the external communication data packet so that the peripheral can obtain the VSN information. When the SUU encapsulates the PowerlLink bus data packet sent to the SIU, the bus data frame also contains the VSN segment so that the SIU can obtain the VSN information. According to the communication cycle length P c and the main period length P m Consider the following two situations for the relationship between the sizes of .
[0065] When P m ≤P c When S≤0, it means that in one cycle, SUU sends S more packets of data than SIU, and no additional packets are needed. VSN is updated once in each main cycle (i.e., the main cycle number MVSN is assigned to VSN), and a packet of data is sent to SIU.
[0066] When P m >P c When S>0, it means that SUU needs to supplement S packet data in one cycle. m =1), after receiving the application data packet, SUU corrects the virtual sequence number of the packet:
[0067] VSN=[(MVSN-2)P m / P c ]+1 (5)
[0068] Among them, [] means rounding down.
[0069] The S packet replenishment packet is created by copying the data packet. Every time a packet of data is generated, the VSN is incremented by 1 and the S+1 packet of data is sent to the communication board before the end of this main cycle. For other main cycles, the SUU does not replenish the packet. After entering the main cycle, the VSN is incremented by 1 and only one packet of data is sent to the SIU before the end of this main cycle.
[0070] 2. Dynamic compensation of SIU data in platform communication module
[0071] Adjust the communication cycle of the platform communication module SIU to be the same as the communication cycle of the peripherals, and control the sending timing of the data packet through the cache mechanism. Set up the read queue for receiving SUU application data packets and the buffer queue for caching received data packets in SIU. Define the communication cycle number P within the SIU loop. When SUU sends application data to SIU, SIU first stores the application data in the Read queue.
[0072] SUU sends a clock frame to the SIU at the beginning of each main cycle. After receiving the clock frame for T2 time, the SIU processes the data in the Read queue and the buffer queue. The logic is as follows:
[0073] When the communication cycle P c is less than the main cycle P m At this time, first the SIU traverses all the data packets in the Read queue. For each packet of data, if the current loop cycle number is equal to the virtual sequence number of the data packet (P = VSN), then the SIU sends this packet of data to the peripheral; if P < VSN and the VSN of this packet of data is greater than or equal to the VSN at the end of the buffer queue, then this packet of data is stored at the end of the buffer queue; in other cases, this packet of data is discarded. Then, continuously read the data at the head of the buffer queue. If P = VSN, then send this packet of data; if P < VSN, then put this packet of data back to the head of the queue, and the SIU stops reading the buffer data; in other cases, discard this packet of data.
[0074] When the communication cycle P c is greater than or equal to the main cycle P m At this time, first determine whether this communication cycle is a special cycle (whether P%A c is 1), and then read the Read queue first and then the buffer queue. The processing logic is similar:
[0075] 1) If this communication cycle is a special cycle, that is, P%A c = 1, then |S| + 1 packets of data need to be sent to the peripheral. For the data in the Read or buffer queue, if this packet of data satisfies
[0076] 1 - |S| ≤ VSN - (P - 1)P c / P m ≤ 1 (6), then send this packet of data; if
[0077] VSN > (P - 1)P c / P m + 1 (7)
[0078] then retain this packet of data and store it in the buffer; in other cases, discard this packet of data. In theory, the SIU needs to send |S| + 1 packets of data during the special cycle;
[0079] 2) If this cycle is other cycles, that is, P%A c ≠ 1, then read the Read queue first and then the buffer queue. The processing logic is similar: if the VSN of this packet of data satisfies
[0080] ([VSN / A m A m + 1)P m ≠ [P / Ac ]A c P c (8)
[0081] Then discard the packet data, otherwise proceed to the next step: if VSN%A m =P%A c , then send data; if VSN%A m <P%A c , then discard the data; if VSN%A m >P%A c The data is stored in buffer.
[0082] Through the above-mentioned SUU packet replenishment and SIU sending timing control mechanism, the communication interruption or packet loss problem between the security platform and the peripheral due to the inconsistency between the SUU main cycle and the peripheral communication cycle can be effectively avoided.
[0083] 3. Dynamic adjustment of time
[0084] SIU synchronizes its own clock according to the clock frame sent by SUU. The clock frame contains the master cycle number MVSN field to avoid data transmission delay caused by the clock difference between the two modules. This method sets an incremental counter for SIU with a counting cycle of 1ms; defines the counting threshold T SIU .
[0085] When the SIU is operating normally, the counter increments by 1 every 1ms until the SIU receives a clock frame or the count reaches T SIU or P c :
[0086] 1) When the SIU receives the clock frame, it clears the counter and updates the communication cycle number within the loop:
[0087] P = [(MVSN-2)P m / P c ]+1, (9)
[0088] Update count threshold
[0089]
[0090] 2) When the SIU counter reaches T SIU When the counter is cleared, the cycle number in the loop is incremented by 1, and the counting threshold T is updated. SIU =P c .
[0091] In particular, when the communication board is just inserted into the slot, the communication board does not send or receive data until the first clock frame arrives. The communication board uses this clock frame to initialize the counter value, update the communication cycle number P and the counting threshold T according to (9) (10).SIU , and then enters normal operation.
[0092] Through the above method, the clock of the communication board can be corrected with a clock frame at the beginning of each main cycle, aligning the start time of the communication cycle and the main cycle, alleviating the problems of clock offset and communication delay; the communication board initializes the clock through the first received clock frame and supports hot plugging.
[0093] like Figure 1 As shown, the trackside safety platform in this embodiment has external communication components including SUU, SIU, PowerLink bus and other modules. Among them, SUU is a two-out-of-two architecture. When preparing application data to be sent externally, the application message is first encapsulated according to the external communication protocol, and then encapsulated into a bus application message frame, which is sent to SIU through the PowerLink bus. An SIU module is connected to a peripheral with the same communication cycle. SIU parses the bus application message frame, encapsulates the information according to the network protocol, and sends it to the peripheral through the network port.
[0094] In this embodiment, the nodes maintained are in asynchronous communication. The main period of SUU is P m , the communication cycle of the peripheral is P c . Combined Figure 2 and Figure 3 , the multi-mode communication data transmission method of this embodiment is described in detail, and the method includes the following steps:
[0095] SUU processes the data as follows:
[0096] During initialization,
[0097] Step 100, according to (1)-(4), the cycle length M and the number of main cycles in one cycle A are calculated. m and the number of communication cycles A c , the number of packets required to be supplemented in one cycle is S, and VSN=0 and MVSN=0 are set;
[0098] In the main cycle,
[0099] Step 101, when the main cycle starts, update MVSN: MVSN = MVSN + 1, add MVSN information to the clock frame and send it to the bus. Figure 3 If S>0( Figure 2 Case) and MVSN%A m ==1, go to step 103; otherwise go to step 104;
[0100] Step 102, update VSN: VSN = MVSN, go to step 105;
[0101] Step 103, press (5) to update the VSN, and go to step 105;
[0102] Step 104, update VSN: VSN=VSN+1, then go to step 105;
[0103] Step 105, receiving the upper layer application message of this main cycle and saving it. Go to step 106;
[0104] Step 106, encapsulate the application message with the peripheral communication protocol header (add VSN information), and encapsulate the bus application message frame header (add VSN information). m ==1, go to step 107; otherwise go to step 108;
[0105] Step 107, copy the application message packet |S| copies, increment the VSN by 1 each time it is copied, and encapsulate the peripheral communication protocol header and the bus application message frame header respectively;
[0106] Step 108: The SUU sends the encapsulated data packet to the SIU via the PowerLink bus.
[0107] SIU processes the data as follows:
[0108] During initialization,
[0109] Step 200: SIU does not send or receive data until it receives the clock frame from SUU for the first time. When it receives the data frame from SUU for the first time, it clears the counter, updates the communication period P in the loop according to (9), and updates T according to (10). SIU . Start the counter process and the data receiving process (step 201);
[0110] During the communication cycle,
[0111] Step 201: The communication board counter increments by 1 every 1ms and stores the received bus application message in the Read queue. If the counter value reaches the counting threshold T SIU or P c =400, go to step 203;
[0112] Step 202, make a judgment in each counting cycle, if a clock frame is received, go to step 204; if the counter value reaches T2, go to step 205. Step 201 and step 202 are parallel tasks;
[0113] Step 203, update the communication period P in the cycle: P = P + 1; update T SIU =P c ; The counter is cleared to 0. Go to step 201;
[0114] Step 204: Receive the clock frame, obtain the MVSN value from the clock frame, and clear the counter to 0. Update the in-loop communication period P according to (9) and update T according to (10). SIU , go to Step 202;
[0115] Step 205: If S > 0, go to Step 211; otherwise, go to Step 221;
[0116] Step 211: Take out all the data packets from the Read queue, read their respective VSNs, and make the following judgments for each packet of data:
[0117] 1) If P == VSN, send this packet of data;
[0118] 2) If P < VSN and VSN is greater than or equal to the VSN at the end of the buffer queue, store this packet of data at the end of the buffer queue;
[0119] 3) In other cases, discard this packet of data.
[0120] Go to Step 212;
[0121] Step 212: Read a packet of data from the head of the buffer queue and make the following judgments:
[0122] 1) If P == VSN, send this packet of data and go to Step 212;
[0123] 2) If P < VSN, put this packet of data back to the head of the queue and go to Step 202;
[0124] 3) In other cases, discard this packet of data and go to Step 212.
[0125] Step 221: Determine whether this communication period is a special period. If P % A c == 1, then go to Step 222; otherwise, go to Step 224;
[0126] Step 222: Take out all the data packets from the Read queue, read their respective VSNs, and make the following judgments for each packet of data:
[0127] 1) If VSN meets (6), then send this packet of data;
[0128] 2) If VSN meets (7) and VSN is greater than or equal to the VSN at the end of the queue, store this packet of data at the end of the buffer queue;
[0129] 3) Otherwise, discard this packet of data.
[0130] Go to Step 223;
[0131] Step 223: Read a packet of data from the head of the buffer queue and make the following judgments:
[0132] 1) If VSN satisfies (6), the packet data is sent and the process goes to step 223;
[0133] 2) If VSN satisfies (7), put the data packet back to the head of the queue and go to step 202;
[0134] 3) Otherwise, discard the packet data and go to step 223.
[0135] Step 224, take out all data packets from the Read queue, read their respective VSNs, and for each data packet, if the VSN satisfies (8), discard the data packet; otherwise, make the following judgment:
[0136] 1) If VSN%A m = = P% A c , then send this packet data;
[0137] 2) If VSN%A m >P%A c , and the VSN is greater than or equal to the VSN at the end of the buffer queue, then the packet data is stored at the end of the buffer queue;
[0138] 3) Otherwise, discard the packet data.
[0139] Go to step 225;
[0140] Step 225, take a packet of buffer head data, if VSN satisfies (8), discard this packet of data; otherwise, make the following judgment:
[0141] 1) If VSN%A m = = P% A c , then send this packet data and go to step 225;
[0142] 2) If VSN%A m >P%A c , then put the packet data back to the head of the buffer and go to step 202;
[0143] 3) Otherwise, discard the packet data and go to step 225.
[0144] It is worth noting that the above solution can eliminate the impact of fluctuations in the time when the SUU sends bus application messages on the communication timing. Figure 2 As shown, when MVSN=2, if SUU sends the bus application message to the bus at a relatively early time, SIU may receive the data packet at P=2. At this time, the data packet needs to be cached and sent to the next communication cycle: according to step 211, the original packet with VSN=3 is placed at the end of the buffer. When P=3, the communication board will not receive data from the bus. At this time, the original packet data with VSN=3 is left in the buffer sequence. The communication board takes out the data packet and sends it to the peripheral device.
[0145] The electronic device of the present invention includes a central processing unit (CPU), which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) or loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for device operation can also be stored. The CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0146] Multiple components in the device are connected to the I / O interface, including: input units, such as keyboards, mice, etc.; output units, such as various types of displays, speakers, etc.; storage units, such as disks, optical disks, etc.; and communication units, such as network cards, modems, wireless communication transceivers, etc. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunication networks.
[0147] The processing unit performs the various methods and processes described above. For example, in some embodiments, methods S1 to S7 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via a ROM and / or a communication unit. When the computer program is loaded into the RAM and executed by the CPU, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the CPU may be configured to execute the method in any other appropriate manner (e.g., by means of firmware).
[0148] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip systems (SOCs), load programmable logic devices (CPLDs), and the like.
[0149] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0150] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0151] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A multi-mode communication data transmission method for data transmission between a trackside safety platform and an external device, wherein the trackside safety platform comprises a main computing module and a platform communication module, and the trackside safety platform communicates with the external device through the platform communication module, characterized in that: The multi-mode communication data transmission method comprises: The main operation module dynamically supplements the application data packet according to the relative relationship between the communication cycle length and the main cycle length and sends it to the platform communication module, including: when the main cycle length is greater than the communication cycle length, in the last main cycle of the cycle, correcting the virtual cycle number of the application data packet according to the main cycle number, and sending the supplementary packet to the platform communication module before the end of the current main cycle; The platform communication module adjusts its communication cycle to be the same as the communication cycle of the external device, and controls the sending timing of the application data packet through a cache mechanism; wherein the platform communication module performs clock synchronization according to the clock frame sent by the main operation module.
2. A multi-mode communication data transmission method according to claim 1, characterized in that: The cycle period is the least common multiple of the communication cycle length and the main cycle length.
3. A multi-mode communication data transmission method according to claim 1, characterized in that: Before the current main cycle ends, a supplementary packet is sent to the platform communication module, and the number of supplementary packets in one cycle is the difference between the number of communication cycles and the number of main cycles in one cycle.
4. A multi-mode communication data transmission method according to claim 1, characterized in that: When the main cycle length is less than or equal to the communication cycle length, no packet replenishment operation is performed. In each main cycle, the main cycle number is assigned to the virtual cycle number and the virtual cycle number is updated.
5. A multi-mode communication data transmission method according to claim 1, characterized in that: In the last main cycle of the cycle, the virtual cycle number of the application data packet is corrected according to the main cycle number, and the corrected virtual cycle number is expressed as: VSN=[(MVSN-2)P m / P c ]+1 Where: [.] means rounding down, MVSN is the main cycle number, P m is the main cycle length, P c is the length of the communication cycle.
6. A multi-mode communication data transmission method according to claim 1, characterized in that: When the main cycle length is greater than the communication cycle length, no packet replenishment operation is performed in the main cycles except the last main cycle in the cycle period. After entering the main cycle, the virtual cycle number is incremented by 1, and only one packet of data is sent to the platform communication module before the end of the current main cycle.
7. A multi-mode communication data transmission method according to claim 1, characterized in that: The platform communication module adjusts its communication cycle to be the same as the communication cycle of the external device, and controls the sending timing of the application data packet through a cache mechanism, including: A read queue for receiving application data packets sent by the main operation module and a cache queue for caching received application data packets are set in the platform communication module; When the main computing module sends the application data packet to the platform communication module, the platform communication module first stores the application data packet in the read queue; The main operation module sends a clock frame to the platform communication module at the beginning of each main cycle. After receiving the clock frame, the platform communication module processes the data in the read queue and the cache queue.
8. A multi-mode communication data transmission method according to claim 7, characterized in that: After receiving the clock frame, the platform communication module processes the data in the read queue and the cache queue. c Less than the main period length P m The data processing process includes: First, the platform communication module traverses all the data packets in the read queue, and for each packet of data: if the communication cycle number P of the current cycle is equal to the virtual cycle number VSN of the data packet, the platform communication module sends the current packet data to the external device; if the communication cycle number P of the current cycle is less than the virtual cycle number VSN of the data packet and the virtual cycle number VSN of the current packet data is greater than or equal to the virtual cycle number VSN of the end of the cache queue, the current packet data is stored in the end of the cache queue; in other cases, the current packet data is discarded; Then, the head data of the cache queue is continuously read: if the communication cycle number P of the current cycle is equal to the virtual cycle number VSN of the data packet, the current packet data is sent; if the communication cycle number P of the current cycle is less than the virtual cycle number VSN of the data packet, the current packet data is put back to the head of the queue, and the platform communication module stops reading the cache queue; in other cases, the current packet data is discarded.
9. A multi-mode communication data transmission method according to claim 7, characterized in that: After receiving the clock frame, the platform communication module processes the data in the read queue and the cache queue. c Greater than or equal to the main period length P m The data processing process includes: If the current communication cycle number P within a cycle M and the communication cycle number A within a cycle M c Satisfy P%A c =1, |S|+1 packets are sent to the external device, where S is the number of supplementary packets. For data in the read queue or cache queue: if 1-|S|≤VSN-(P-1)P c / P m ≤1, send the current packet data; if the current packet data satisfies: VSN>(P-1)P c / P m +1, the current packet data is retained and stored in the cache queue; otherwise, the current packet data is discarded; If the current communication cycle number P within a cycle M and the communication cycle number A within a cycle M c Satisfy P%A c ≠1, the read queue is read first and then the cache queue. The processing after reading the data includes: 1) If the virtual cycle number VSN of the current packet data satisfies ([VSN / A m ]A m +1)P m ≠[P / A c ]A c P c , then discard the packet data, otherwise go to 2), where A m is the number of main cycles in a cycle M; 2) If the virtual cycle number VSN of the current packet data satisfies VSN%A m =P%A c , then send data; if VSN%A m <P%A c , then discard the data; if VSN%A m >P%A c , the current packet data is stored in the cache queue.
10. A multi-mode communication data transmission method according to claim 1, characterized in that: The platform communication module performs clock synchronization according to the clock frame sent by the main operation module, including: The main operation module is provided with an incremental counter. During normal operation, the incremental counter increments by 1 every counting cycle until a clock frame is received or the count reaches a counting threshold T. SIU Or the communication cycle length P c , at this time the increment counter is cleared; At the beginning of each main cycle, the clock of the platform communication module is corrected through a clock frame to align the start time of the communication cycle and the main cycle; wherein the clock frame includes a main cycle number field.
11. A multi-mode communication data transmission method according to claim 10, characterized in that: When the main operation module receives the clock frame, the increment counter is cleared, and also includes: The communication cycle number P within the update cycle M is: P=[(MVSN-2)P m / P c ]+1 Update count threshold T SIU for: Where: MVSN is the main cycle number, P m is the main cycle length, and % is the modulo operation.
12. A multi-mode communication data transmission method according to claim 10, characterized in that: When the count of the up counter in the main operation module reaches the count threshold T SIU When the counter is cleared, the communication cycle number is incremented by 1 within the cycle, and the communication cycle length P is c Assign a value to the counting threshold T SIU , to update the counting threshold T SIU .
13. A multi-mode communication data transmission method according to claim 10, characterized in that: After the platform communication module is powered on, it does not send or receive data until the first clock frame arrives. The platform communication module initializes the increment counter according to the received clock frame, updates the communication cycle number P and the counting threshold T SIU , and then enters normal operation.
14. A trackside safety platform, comprising a main computing module and a platform communication module, characterized in that: The trackside safety platform adopts the method described in any one of claims 1 to 13 to perform multi-mode communication data transmission with external equipment.
15. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 1 to 13 is implemented.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
