CANOPEN protocol-based driving and mining data interaction method, equipment and medium

Through the CANOPEN protocol and the pre-failure time mechanism, combined with synchronous messages and timestamp messages, the low-cost, efficient and reliable data interaction between the logic processing unit and the IO execution unit in the switch control system is achieved, and the problems of high cost, low efficiency and insufficient reliability of the drive-and-retrieval data interaction in the prior art are solved, ensuring the timeliness and security of data.

CN116155639BActive Publication Date: 2025-09-02CASCO SIGNAL LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211626059.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-15
Publication Date
2025-09-02
Estimated Expiration
2042-12-15

AI Technical Summary

Technical Problem

In the existing switch control system, the interactive process of driving and data acquisition has problems such as high cost, low efficiency and insufficient reliability. Especially in the communication between the logic processing unit and the IO execution unit, timeliness and reliability are difficult to guarantee.

Method used

The CANOPEN protocol is adopted to use CAN bus communication in master-slave mode, and the time reference is unified by synchronous packets and timestamp packets, and the time is corrected through the pre-failure time mechanism, combined with PDO packets to transmit data, and a security layer verification mechanism is added to ensure the validity and security of the data.

Benefits of technology

It realizes low-cost, high-efficiency and high-reliability data interaction, ensures timeliness and security of data, avoids cumulative errors caused by clock drift, and improves system availability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116155639B_ABST
    Figure CN116155639B_ABST
Patent Text Reader

Abstract

The present invention relates to a CANopen protocol-based drive and acquisition data interaction method, device, and medium. The method is used for data interaction between a logic processing unit and an I / O execution unit. The interaction method uses the CAN bus as the communication medium, adopts a master-slave mode, uses the logic processing unit as the master node, and the I / O execution unit as the slave node. The CANopen communication protocol is used, synchronization messages and timestamp messages are used to unify the time base and perform time correction, and PDO messages are used to transmit collected data and drive command messages. Compared with existing technologies, the present invention has the advantages of low cost, high efficiency, high availability, and high reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a train signal control system, and in particular to a drive and production data interaction method, device and medium based on the CANOPEN protocol. Background Art

[0002] In the rail transit signal industry, driving equipment and collecting signals is a common control behavior, and the turnout controller is one of the systems that completes this function. The turnout control system contains subsystems such as the logic processing unit and the IO execution unit. The IO execution unit is mainly responsible for driving peripheral devices and collecting the status of peripheral devices. The logic processing unit is responsible for system logic operations, generating drive information based on the results of the logic operations, and sending it to the IO execution unit to drive the equipment; at the same time, it processes the device status information collected by the IO execution unit. As a high-security product, the turnout control system has strict requirements on the safety response time of the driving and collecting process and the security of the data. The timeliness and reliability of the data interaction between the logic processing unit and the IO execution unit are particularly important. The selection of the communication protocol and the design of the communication mechanism are key links in the entire system.

[0003] Therefore, how to provide a low-cost, high-efficiency, high-availability and high-reliability mining data interaction technology has become a technical problem that needs to be solved. Summary of the Invention

[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a low-cost, high-efficiency, high-availability and high-reliability driving and mining data interaction method, equipment and medium based on the CANOPEN protocol.

[0005] The purpose of the present invention can be achieved by the following technical solutions:

[0006] According to a first aspect of the present invention, a method for interacting with acquisition data based on the CANOPEN protocol is provided. The method is used for data interaction between a logic processing unit and an IO execution unit. The interaction method uses a CAN bus as a communication medium, adopts a master-slave mode, uses the logic processing unit as a master node, and the IO execution unit as a slave node. The CANOPEN communication protocol is used, and synchronization messages and timestamp messages are used to unify the time reference and correct the time. At the same time, PDO messages are used to transmit acquisition data and drive command messages.

[0007] As a preferred technical solution, the method specifically includes the following steps:

[0008] Step S1, the master node periodically broadcasts a timestamp message;

[0009] Step S2: After receiving the timestamp message, all nodes synchronize their local time and calculate the expected expiration time.

[0010] Step S3, the master node periodically sends synchronization messages;

[0011] Step S4, each node determines the validity of the synchronization message according to the timer status;

[0012] Step S5: After receiving the valid synchronization message, each node uses the pre-expiration time to calculate the data security layer and performs data sending and receiving processing;

[0013] Step S6: Each node recalculates the expected failure time.

[0014] As a preferred technical solution, the method for calculating the pre-failure time in step S2 is:

[0015] T invalid= T NTP+ T SYNC ,T invalid is the latest expected failure time, T NTP The time when the timestamp message is received, T SYNC It is the synchronization message period.

[0016] As a preferred technical solution, step S4 specifically includes:

[0017] After receiving a synchronization message, a node checks the timer status. If the synchronization message has timed out or is received too early, it is considered an invalid message. In this case, no data processing is performed and the timer is reloaded to the time when the next synchronization message arrives. If a synchronization message is received within the valid time range, the timer is restarted.

[0018] As a preferred technical solution, step S5 is specifically as follows:

[0019] Latest expected failure time T invalid Participate in the calculation of the PDO data security layer. Both the collected data and the drive command need to add a security layer before sending.

[0020] As a preferred technical solution, after receiving the synchronization message, each node of the logic processing unit processes as follows:

[0021] The drive command generated by the logical operation is sent to the IO execution unit after adding a security layer;

[0022] Process the collected data received from the IO execution unit using T invalid Verify the security layer of the data and discard the data if the verification fails.

[0023] As a preferred technical solution, after receiving the synchronization message, each node of the IO execution unit processes as follows:

[0024] The IO execution unit adds a security layer to the collected device status information and sends it to the logic processing unit;

[0025] After the IO execution unit receives the driver command, it uses T invalid A security layer for verifying data, which drives external devices according to commands.

[0026] As a preferred technical solution, the calculation method of the pre-failure time in step S6 is:

[0027] T invalid= T pre-invalid +T SYNC , T invalid is the latest pre-aging time, T pre-invalid is the last calculated expected failure time, T SYNC It is the synchronization message period.

[0028] According to a second aspect of the present invention, an electronic device is provided, comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the method when executing the program.

[0029] According to a third aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method described above is implemented.

[0030] Compared with the prior art, the present invention has the following advantages:

[0031] 1. For application scenarios with frequent communications but small single-packet data volumes, the CAN bus was selected. By innovatively combining synchronization messages, timestamp messages, and PDO messages in the CANOPE protocol and adding a guarantee mechanism, the periodic validity and timeliness of the data are guaranteed.

[0032] 2. To ensure the timeliness of data in the entire system, the above solution combines synchronization messages and timestamp messages to design a pre-expiration time mechanism. The pre-expiration time is included in the calculation of the PDO data security layer. The data receiver confirms the timeliness security by verifying the security layer.

[0033] 3. Both the logical processing unit and the IO execution unit contain multiple nodes. Each node in the solution maintains a timer bound to the synchronization message to monitor the validity of the synchronization message, avoiding data unreliability caused by unconditional trust in the synchronization message.

[0034] 4. The timestamp message and synchronization message periodically update the pre-expiration time to ensure the consistency of the pre-expiration time of each node in each cycle. At the same time, each node synchronizes the master node time through the timestamp message to avoid the cumulative error caused by clock drift between different nodes, which ultimately leads to data failure. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is a schematic diagram of the turnout control system;

[0036] Figure 2 It is a flow chart of communication between the logic processing unit and the IO execution unit; DETAILED DESCRIPTION

[0037] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0038] Data exchange between the logic processing unit and the IO execution unit is frequent, but the single data volume is small and the real-time requirements are high. Therefore, the present invention selects the CAN bus as the communication medium and adopts a master-slave mode. The logic processing unit competes to produce a master node, and the IO execution units are all slave nodes. The CANOPEN communication protocol is used. Synchronization messages and timestamp messages are used to unify the time base and correct the time. PDO messages are used to transmit collected data and drive command messages. In order to further ensure the timeliness and security of the data, the master node periodically broadcasts timestamp messages. After receiving the timestamp message, each node updates the local time and calculates the expected expiration time. The expected expiration time and device identification participate in the calculation of the PDO message security layer. The data is valid only after the receiving party verifies that the security layer has passed, thereby improving the security of the data. At the same time, the validity of the synchronization message is monitored. Each node will process the PDO message data and recalculate the expected expiration time only after receiving a valid synchronization message, ensuring the continued validity of the data.

[0039] The specific process of the present invention is as follows:

[0040] S1: The master node periodically broadcasts timestamp messages (NTP).

[0041] S2: After receiving the timestamp message, all nodes synchronize their local time and calculate the expected expiration time.

[0042] S3: The master node periodically sends synchronization messages (SYNC).

[0043] S4: Each node determines the validity of the synchronization message based on the timer status.

[0044] S5: After receiving the valid synchronization message, each node uses the pre-failure time to calculate the data security layer and performs data sending and receiving processing.

[0045] S6: Each node recalculates the expected failure time.

[0046] The calculation method of the pre-failure time in step S2 is:

[0047] T invalid= T NTP+ T SYNC ,T invalid is the latest expected failure time, T NTP The time when the timestamp message is received, T SYNC It is the synchronization message period.

[0048] The specific steps of step S4 include:

[0049] After receiving a synchronization message, a node checks the timer status. If the synchronization message has timed out or is received too early, it is considered an invalid message. In this case, no data processing is performed and the timer is reloaded to the time when the next synchronization message arrives. If a synchronization message is received within the valid time range, the timer is restarted.

[0050] The specific contents of step S5 include:

[0051] T invalid Participate in the calculation of the PDO data security layer, that is, both the collected data and the drive command need to add a security layer before sending.

[0052] After each node in the logical processing unit receives the synchronization message:

[0053] 1. The drive command generated by the logical operation is added with a safety layer and then sent to the IO execution unit.

[0054] 2. Process the collected data received from the IO execution unit using T invalid Verify the security layer of the data and discard the data if the verification fails.

[0055] After each node of the IO execution unit receives the synchronization message:

[0056] 1. The collection node adds a security layer to the collected device status information and sends it to the logic processing unit.

[0057] 2. The driver node receives the drive command and uses T invalid A security layer for verifying data, which drives external devices according to commands.

[0058] The calculation method of the pre-failure time in step S6 is:

[0059] T invalid= T pre-invalid+ T SYNC , T invalid is the latest pre-aging time, T pre-invalid is the last calculated expected failure time, T SYNCIt is the synchronization message period. Specific embodiments

[0061] like Figure 1 As shown in the figure, the logic processing unit (A and B) in the turnout control system forms a 2x2 redundant structure, and the two internal logic processing boards form a 2-out-of-2 safety guarantee. The logic processing unit is responsible for performing logical operations, generating drive commands, and sending them to the I / O execution unit via the redundant CAN bus. The logic processing unit also processes the collected data from the I / O execution unit.

[0062] The acquisition board in the IO execution unit is responsible for collecting the status of the external switch equipment and sending it to the logic processing unit; the drive board is responsible for receiving the drive command from the logic processing unit and driving the external device.

[0063] like Figure 2 As shown, an example is given to introduce the data interaction process between the logic processing unit and the IO execution unit in the present invention. The master node is determined by the logic processing unit in the initialization phase, and the other nodes are all slave nodes. The timestamp message and the synchronization message are broadcast, and all nodes can receive them, including the master node. The timestamp message period is 180ms, the synchronization message period is 60ms, and the timer is set to the synchronization message period length. It should be noted that the following example is a display of a dynamic continuous process, and the setting of the relevant initial values ​​is not considered. The normal process includes the following steps:

[0064] In step S1, the master node periodically broadcasts a timestamp message and a synchronization message, where the timestamp message carries the time 11:35.

[0065] Step S2: After receiving the timestamp message, all master and slave nodes update their local time and calculate the pre-failure time T invalid =T NTP+ T SYNC =1135+60=1195;

[0066] Step S3: After receiving the synchronization message, all nodes determine the validity of the synchronization message based on the timer. If the synchronization message is received within the valid time range, the timer is restarted and the process goes to S4. If it is received outside the valid time range, the timer is reloaded and the process goes to S6.

[0067] Step S4: The node that needs to send data uses T invalid Calculate the security layer of the data, package the data and send it;

[0068] Step S5: The node receiving the data uses T invalid Verify the security layer of the data. If the verification passes, the data is valid; if the verification fails, the data is discarded.

[0069] Step S6: Each node recalculates the expected failure time T invalid =T invalid+ T SYNC =1195+60=1255;

[0070] Step S7: If a timestamp message is received again, go to step S1; if a synchronization message is received, go to step S2;

[0071] The above is an introduction to the method embodiment. The following further illustrates the solution of the present invention through electronic device and storage medium embodiments.

[0072] 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.

[0073] Many components in a device are connected to the I / O interface, including: input units, such as a keyboard and mouse; output units, such as various types of displays and speakers; storage units, such as magnetic disks and optical disks; and communication units, such as network cards, modems, and wireless communication transceivers. The communication unit allows the device to exchange information / data with other devices via computer networks such as the Internet and / or various telecommunication networks.

[0074] The processing unit performs the various methods and processes described above, such as the inventive method. For example, in some embodiments, the inventive method can 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 can be loaded and / or installed on the device via a ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of the inventive method described above can be performed. Alternatively, in other embodiments, the CPU can be configured to perform the inventive method by any other appropriate means (e.g., by means of firmware).

[0075] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and 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 (SOCs), complex programmable logic devices (CPLDs), and the like.

[0076] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. Such program code 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 when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0077] In the context of the present invention, machine-readable medium can be a tangible medium that can contain or store a program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0078] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. A method for exchanging data between a drive and an IO execution unit based on the CANOPEN protocol, wherein the method is used for exchanging data between a logic processing unit and an IO execution unit, and is characterized in that: The interactive method uses CAN bus as the communication medium, adopts master-slave mode, uses the logic processing unit as the master node, and the IO execution unit as the slave node. It also uses the CANopen communication protocol, and uses synchronization messages and timestamp messages to unify the time base and correct the time. At the same time, PDO messages are used to transmit collected data and drive command messages. The method specifically comprises the following steps: Step S1, the master node periodically broadcasts a timestamp message; Step S2: After receiving the timestamp message, all nodes synchronize their local time and calculate the expected expiration time. Step S3, the master node periodically sends synchronization messages; Step S4, each node determines the validity of the synchronization message according to the timer status; Step S5: After receiving the valid synchronization message, each node uses the pre-expiration time to calculate the data security layer and performs data sending and receiving processing; Step S6, each node recalculates the expected failure time; The calculation method of the pre-failure time in step S2 is: T invalid= T NTP+ T SYNC , T invalid is the latest expected failure time, T NTP The time when the timestamp message is received, T SYNC It is the synchronization message period; The step S5 is specifically as follows: Latest expected failure time T invalid Participate in the calculation of the PDO data security layer. Both the collected data and the drive command need to add a security layer before sending.

2. The method for exchanging mining data based on the CANOPEN protocol according to claim 1, characterized in that: The step S4 specifically includes: After receiving a synchronization message, a node checks the timer status. If the synchronization message has timed out or is received too early, it is considered an invalid message. In this case, no data processing is performed and the timer is reloaded to the time when the next synchronization message arrives. If a synchronization message is received within the valid time range, the timer is restarted.

3. The method for exchanging mining data based on the CANOPEN protocol according to claim 1, characterized in that: After receiving the synchronization message, each node of the logic processing unit processes as follows: The drive command generated by the logical operation is sent to the IO execution unit after adding a security layer; Process the collected data received from the IO execution unit using T invalid Verify the security layer of the data and discard the data if the verification fails.

4. The method for exchanging mining data based on the CANOPEN protocol according to claim 1, characterized in that: After receiving the synchronization message, each node of the IO execution unit processes as follows: The IO execution unit adds a security layer to the collected device status information and sends it to the logic processing unit; After the IO execution unit receives the driver command, it uses T invalid A security layer for verifying data, which drives external devices according to commands.

5. The method for exchanging mining data based on the CANOPEN protocol according to claim 1, characterized in that: The calculation method of the pre-failure time in step S6 is: T invalid =T pre-invalid+ T SYNC , T invalid is the latest pre-aging time, T pre-invalid is the last calculated expected failure time, T SYNC It is the synchronization message period.

6. 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 5 is implemented.

7. 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 5 is implemented.

Citation Information

Patent Citations

  • Security slave station system based on CANopen protocol

    CN112383457A

  • Control method for EtherMAC digital signal coupling timestamp

    CN115242343A