Redundant message transmission method between trusted DCS upper computer applications and related device
By introducing sm3 feature values into the message header and comparing, the message loss problem caused by A/B network failure in industrial automation systems is solved, the integrity and security of redundant message transmission are achieved, and the fault tolerance of the system is enhanced.
Patent Information
- Application Number
- CN202510133254.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-06
- Publication Date
- 2025-04-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In complex industrial automation systems, when the A/B network fails in the prior art, it is easy to cause instant messages to be lost and retransmitted.
By introducing sm3 feature values into the message header and recalculating and comparing the feature values when the peer receives the message, it ensures that the message is not tampered with during transmission, thereby realizing redundant message transmission.
It effectively prevents messages from being tampered with during transmission, ensures the integrity and security of data transmission, enhances the system's fault tolerance and reliability, and reduces system delays and failures caused by message loss or error processing.
Smart Images

Figure CN119902503A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of distributed control systems, and relates to a redundant message transmission method between trusted DCS host computer applications and a related device. Background Art
[0002] In complex industrial automation systems that require high reliability, the stable operation of trusted DCS (Distributed Control System) host computers plays a vital role. These host computers are not only responsible for monitoring the entire production process, but also undertake multiple tasks such as data processing, command issuance, and communication with field equipment. In order to ensure the high availability of the system and the security of data transmission, the current message interaction mechanism between host computers adopts dual-network redundant networking, that is, communication through two networks, A and B.
[0003] Generally, communication is limited to network A. When network A fails, communication will be switched to network B. In actual operation, if network A / B fails, messages will be lost instantly and cannot be retransmitted (due to communication efficiency issues, the host computer usually uses UDP (User Datagram Protocol) to transmit messages, which cannot guarantee communication quality), which will cause the loss of some messages, logs, and operation instructions during the network disconnection and switching. Summary of the invention
[0004] The present invention provides a redundant message transmission method and related device between trusted DCS host computer applications to solve the technical problem in the prior art that when an A / B network fails, instantaneous message loss and retransmission are easily caused.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a method for transmitting redundant messages between trusted DCS host computer applications, comprising the following steps: When the message sending program is started, the information status of each node establishing a link is first recorded, and then the message content is organized; the message content includes a message header and a message body, and the message header contains an sm3 feature value; The organized message content is packaged and sent to the peer end through network A and network B respectively; When the other end receives the message content, it parses the message header and recalculates the SM3 feature value through the SM3 algorithm, and compares the calculated SM3 feature value with the SM3 feature value in the message header; if they are inconsistent, the message content is discarded; if they are consistent, the message body is parsed and specific business processes are carried out.
[0006] Furthermore, in the step of first recording the information status of each node establishing a link, the information status includes: the name of the other party node, the IP address of network A, the IP address of network B, the timestamp of establishing the link, and the index of the sent message.
[0007] Furthermore, the index of the sent message is reset to 0 when the link is reestablished.
[0008] Furthermore, the message header of the message content specifically includes: the sending node from, the target node to, whether it is the first message restart of the restart, the message sequence number index, the message body length lenth and the sm3 feature value.
[0009] Furthermore, the sm3 characteristic value is the national secret sm3 verification value of the message body and the sender IP character string.
[0010] Furthermore, when the peer receives the message content, the message header is parsed, and the SM3 feature value is recalculated by the SM3 algorithm, and the calculated SM3 feature value is compared with the SM3 feature value in the message header; if they are inconsistent, the message content is discarded; if they are consistent, the message body is parsed, and the steps of the specific business process are specifically included: When the peer receives the message content, a circular buffer pool is applied in the memory to maintain the timestamp of the received message content, the message sequence number index and the sm3 feature value for establishing the link; the circular buffer pool can store information on the contents of 100 messages of the program that established the link; Obtain the node name of the sender according to the IP address of the message sender, read the host name of the local machine, and verify the sending node and target node in the message header of the message content; if the verification is inconsistent, discard the message content and send an alarm message; If the verification is consistent, the message header is parsed to determine whether the message content has been received from network A or network B; if the message content has been received, the message content is not processed; If the message content has not been received, parse the message to determine whether it is the first message of the restart; if whether it is the first message of the restart is true, clear the cache of the corresponding program in the circular cache pool; if whether it is the first message of the restart is false, do not clear the cache; Compare the message sequence number index in the cache with the message sequence number index in the message content. If they are consistent, discard the message. If they are inconsistent, the SM3 algorithm is used to calculate the SM3 feature value of the string composed of the message body and the sender IP, and the calculated SM3 feature value is compared with the SM3 feature value in the message header. If they are inconsistent, the message is discarded; if they are consistent, the message body is parsed and specific business processes are carried out.
[0011] Further, if the verification is consistent, the message header is parsed to determine whether the message content has been received from network A or network B; if the message content has been received, the message content is not processed, specifically including: If the verification is consistent, parse the message header, read the message sequence number index, the timestamp for establishing the link, and the sm3 characteristic value from the message header; take the modulus of the message sequence number index by 100, and find the corresponding cache after taking the modulus in the cache pool; if the timestamp for establishing the link and the sm3 characteristic value in the corresponding cache after taking the modulus are inconsistent with the received message, proceed to the next step; if they are consistent, it means that the message content sent from network A or network B has been received, and the message content will not be processed.
[0012] In a second aspect, the present invention provides a redundant message transmission system between trusted DCS host computer applications, comprising: The organization module is used to record the information status of each node that establishes a link when the message sending program is started, and then organize the message content; the message content includes a message header and a message body, and the message header contains an sm3 feature value; The sending module is used to package the organized message content and send it to the other end through network A and network B respectively; The parsing module is used to parse the message header when the other end receives the message content, and recalculate the SM3 feature value through the SM3 algorithm, and compare the calculated SM3 feature value with the SM3 feature value in the message header; if they are inconsistent, the message content is discarded; if they are consistent, the message body is parsed and specific business processes are carried out.
[0013] In a third aspect, the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method for transmitting redundant messages between trusted DCS host computer applications are implemented.
[0014] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for transmitting redundant messages between trusted DCS host computer applications are implemented.
[0015] Compared with the prior art, the present invention has the following beneficial effects: The present invention discloses a redundant message transmission method and related device between trusted DCS host computer applications; when sending a message, the information status of each node that establishes a link is recorded, and then the message content is organized; the organized message content is packaged and sent to the opposite end by network A and network B respectively; finally, when the opposite end receives the message, the message header is parsed, and the sm3 characteristic value is introduced into the message header, and the characteristic value is recalculated and compared when the opposite end receives the message. This mechanism effectively prevents the message from being tampered with during the transmission process, and ensures the integrity and security of data transmission. The present invention sends messages on network A and network B at the same time, and the method realizes redundant transmission of messages. Even if one of the networks fails, the other network can still ensure the reliable transmission of the message, thereby greatly enhancing the fault tolerance and reliability of the system. By ensuring the reliable transmission and timely processing of messages, the method can reduce system delays and failures caused by message loss or erroneous processing, thereby improving the user experience and satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0017] Figure 1 is a flow chart of the method of the present invention; Figure 2 is a schematic diagram of the system of the present invention; Figure 3 It is a schematic diagram of the computer device structure of the present invention. DETAILED DESCRIPTION
[0018] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0019] The following detailed description is an exemplary description, which is intended to provide further detailed description of the present invention. Unless otherwise specified, all technical terms used in the present invention have the same meaning as those generally understood by those skilled in the art to which the present application belongs. The terms used in the present invention are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention.
[0020] The present invention is further described in detail below in conjunction with the accompanying drawings: See also Figure 1The embodiment of the present invention discloses a method for transmitting redundant messages between trusted DCS host computer applications, comprising the following steps: S1, when the message sending program is started, the information status of each node establishing a link is first recorded, and then the message content is organized; the message content includes a message header and a message body, and the message header contains an sm3 feature value; In this step, the information status includes: the name of the other party node, the IP address of network A, the IP address of network B, the timestamp of establishing the link, and the index of the sent message (the index needs to be reset to 0 when re-establishing the link). The message header of the message content specifically includes: the sending node from, the target node to, whether it is the first message restarted, the message sequence number index, the message body length lenth and the sm3 feature value. The sm3 feature value is the national secret sm3 check value of the message body and the sender IP string.
[0021] S2, packages the organized message content and sends it to the peer end through network A and network B respectively; S3, when the other end receives the message content, it parses the message header and recalculates the SM3 feature value through the SM3 algorithm, and compares the calculated SM3 feature value with the SM3 feature value in the message header; if they are inconsistent, the message content is discarded; if they are consistent, the message body is parsed and specific business processes are carried out.
[0022] S301, when the other end receives the message content, a circular buffer pool is applied in the memory to maintain the timestamp of the received message content, the message sequence number index and the sm3 feature value for establishing the link; the circular buffer pool can store the information of 100 message contents of the program for establishing the link; S302, obtaining the node name of the sender according to the IP of the message sender, reading the host name of the local machine, and verifying the sending node and the target node in the message header of the message content; if the verification is inconsistent, discarding the message content and sending an alarm message; S303, if the verification is consistent, the message header is parsed to determine whether the message content has been received from network A or network B; if the message content has been received, the message content is not processed; S304, if the message content has not been received, parse the message to determine whether it is the first message of the restart; if the value of whether it is the first message of the restart is true, clear the cache of the corresponding program in the circular cache pool; if the value of whether it is the first message of the restart is false, do not clear the cache; S305, comparing the message sequence number index in the cache with the message sequence number index in the message content, and discarding the message if they are consistent; S306: If they are inconsistent, use the SM3 algorithm to calculate the SM3 feature value of the string composed of the message body and the sender IP, and compare the calculated SM3 feature value with the SM3 feature value in the message header. If they are inconsistent, discard the message; if they are consistent, parse the message body and perform specific business processes.
[0023] In a feasible implementation manner of the present invention, the step of parsing the message header if the verification is consistent, determining whether the message content has been received from network A or network B; and not processing the message content if the message content has been received, specifically includes: If the verification is consistent, parse the message header, read the message sequence number index, the timestamp for establishing the link, and the sm3 characteristic value from the message header; take the modulus of the message sequence number index by 100, and find the corresponding cache after taking the modulus in the cache pool; if the timestamp for establishing the link and the sm3 characteristic value in the corresponding cache after taking the modulus are inconsistent with the received message, proceed to the next step; if they are consistent, it means that the message content sent from network A or network B has been received, and the message content will not be processed.
[0024] Example: The embodiment of the present invention provides a method for transmitting redundant messages between trusted DCS host computer applications. The specific technical solution is as follows: Sender: a) When the program starts, a space is allocated in the memory to maintain the information of the program that establishes a connection with other nodes. The information status of each node that establishes a connection needs to be recorded. The content is as follows, saving the name of the other node, the IP address of network A, the IP address of network B, the timestamp of establishing the connection, and the index of the message sent (the index needs to be reset to 0 when re-establishing the connection). The specific code is as follows: Node:hsr231 ip a:198.120.1.231 ip b:198.121.1.231 timestamp:1710309730000 index:1 b) When the program sends a message, the message content is organized according to the following structure. The message content is divided into a message header and a message body. The message header includes the following: the sending node from, the target node to, whether it is the first message restart, the message sequence number index, the message body length lenth and the sm3 feature value. The sm3 feature value is the national secret sm3 check value of the message body and the sender IP string. The specific code is as follows: msd: { msg_head { from:hsr231to:hsr232 restart:fa1se index:10lenth:100 sm3:123456 } msg_body { xxxxxxxxxxxxxx } } c) After the message content is packaged, it is sent to the other end by network A and network B respectively.
[0025] Recipient: a) When the program starts, a circular buffer pool is allocated in the memory to maintain the timestamp of the received message content, the message sequence number index and the sm3 feature value. The cache can store information about 100 messages of the program that establishes the link. The specific code is as follows: index_cache {index; Timestamp; sm3; } b) When the program receives a message, it obtains the sender's node name in / etc / hosts according to the message sender's IP address, reads the local host name from hostnamectl, and verifies the from and to fields in the message header. If they are inconsistent, the message is discarded and an alarm is sent.
[0026] c) Parse the message header, read the message sequence number index, the timestamp for establishing the link, and the sm3 characteristic value from the message header, take the modulus of the message sequence number index by 100, and find the corresponding cache in the cache pool; if the timestamp for establishing the link and the sm3 characteristic value in the corresponding cache after taking the modulus are inconsistent with the received message, proceed to the next step; if they are consistent, it means that the message sent from network A or network B has been received, and the message will not be processed.
[0027] d) Parse the message to determine whether it is the first message of the restart. If the restart field is true, clear the cache of the corresponding program in the circular cache pool. If it is false, do not clear the cache.
[0028] e) Compare the index in the cache with the index in the message, and discard the message if they are consistent; f) If they are inconsistent, use the SM3 algorithm to calculate the characteristic value of the string composed of the message body and the sender IP, and compare the calculation result with the SM3 characteristic value in the message header. If they are inconsistent, the message is discarded; if they are consistent, the message body is parsed and specific business processes are carried out.
[0029] See also Figure 2 The embodiment of the present invention discloses a redundant message transmission system between trusted DCS host computer applications, including an organization module, a sending module and a parsing module. Among them, the organization module is used to record the information status of each node that establishes a link when the message sending program is started, and then organize the message content; the message content includes a message header and a message body, and the message header contains an sm3 feature value; the sending module is used to package the organized message content and send it to the opposite end by network A and network B respectively; the parsing module is used to parse the message header when the opposite end receives the message content, and recalculate the sm3 feature value through the sm3 algorithm, and compare the calculated sm3 feature value with the sm3 feature value in the message header; if they are inconsistent, the message content is discarded; if they are consistent, the message body is parsed to perform specific business processes.
[0030] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program code.
[0031] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0032] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0033] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in one or more boxes, such as Figure 3 shown.
Claims
1. A method for transmitting redundant messages between trusted DCS host computer applications, characterized in that: The following steps are involved: When the message sending program is started, the information status of each node establishing a link is first recorded, and then the message content is organized; the message content includes a message header and a message body, and the message header contains an sm3 feature value; The organized message content is packaged and sent to the peer end through network A and network B respectively; When the other end receives the message content, it parses the message header and recalculates the SM3 feature value through the SM3 algorithm, and compares the calculated SM3 feature value with the SM3 feature value in the message header; if they are inconsistent, the message content is discarded; if they are consistent, the message body is parsed and specific business processes are carried out.
2. A redundant message transmission method between trusted DCS host computer applications according to claim 1, characterized in that: In the step of first recording the information status of each node establishing a link, the information status includes: the name of the other party node, the IP address of network A, the IP address of network B, the timestamp of establishing the link and the index of the sent message.
3. A method for transmitting redundant messages between trusted DCS host computer applications according to claim 2, characterized in that: The index of the sent message is reset to 0 when the link is reestablished.
4. A method for transmitting redundant messages between trusted DCS host computer applications according to claim 2, characterized in that: The message header of the message content specifically includes: the sending node from, the target node to, whether it is the first message restart of the restart, the message sequence number index, the message body length lenth and the sm3 feature value.
5. A method for transmitting redundant messages between trusted DCS host computer applications according to claim 4, characterized in that: The sm3 characteristic value is the national secret sm3 verification value of the message body and the sender IP character string.
6. A method for transmitting redundant messages between trusted DCS host computer applications according to claim 4, characterized in that: When the other end receives the message content, the message header is parsed, and the SM3 feature value is recalculated by the SM3 algorithm, and the calculated SM3 feature value is compared with the SM3 feature value in the message header; If they are inconsistent, the message content is discarded; If they are consistent, the message body is parsed and specific business process steps are performed, including: When the peer receives the message content, a circular buffer pool is applied in the memory to maintain the timestamp of the received message content, the message sequence number index and the sm3 feature value for establishing the link; the circular buffer pool can store information on the contents of 100 messages of the program that established the link; Obtain the node name of the sender according to the IP address of the message sender, read the host name of the local machine, and verify the sending node and target node in the message header of the message content; if the verification is inconsistent, discard the message content and send an alarm message; If the verification is consistent, the message header is parsed to determine whether the message content has been received from network A or network B; if the message content has been received, the message content is not processed; If the message content has not been received, parse the message to determine whether it is the first message of the restart; if whether it is the first message of the restart is true, clear the cache of the corresponding program in the circular cache pool; if whether it is the first message of the restart is false, do not clear the cache; Compare the message sequence number index in the cache with the message sequence number index in the message content. If they are consistent, discard the message. If they are inconsistent, the SM3 algorithm is used to calculate the SM3 feature value of the string composed of the message body and the sender IP, and the calculated SM3 feature value is compared with the SM3 feature value in the message header. If they are inconsistent, the message is discarded; if they are consistent, the message body is parsed and specific business processes are carried out.
7. A method for transmitting redundant messages between trusted DCS host computer applications according to claim 6, characterized in that: If the verification is consistent, the message header is parsed to determine whether the message content has been received from network A or network B; If the message content has been received, the step of not processing the message content specifically includes: If the verification is consistent, the message header is parsed, and the message sequence number index, the timestamp of establishing the link, and the sm3 feature value are read from the message header; Modulo the message sequence number index by 100, and find the corresponding cache in the cache pool; if the timestamp and sm3 feature value of establishing the link in the corresponding cache after the modulo are inconsistent with the received message, proceed to the next step; if they are consistent, it means that the message content sent from network A or network B has been received, and the message content will not be processed.
8. A redundant message transmission system between trusted DCS host computer applications, characterized in that: include: The organization module is used to record the information status of each node that establishes a link when the message sending program is started, and then organize the message content; The message content includes a message header and a message body, and the message header includes an sm3 feature value; The sending module is used to package the organized message content and send it to the other end through network A and network B respectively; The parsing module is used to parse the message header when the other end receives the message content, and recalculate the SM3 feature value through the SM3 algorithm, and compare the calculated SM3 feature value with the SM3 feature value in the message header; if they are inconsistent, the message content is discarded; if they are consistent, the message body is parsed and specific business processes are carried out.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for transmitting redundant messages between trusted DCS host computer applications as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a redundant message transmission method between trusted DCS host computer applications as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Multi-intelligent stand-alone servo control system based on dual redundant CAN bus communication
CN106444713A
Data transmission system and method
CN111757043A
Module for supporting high-integrity redundancy management on AFDX terminal
CN113422714A
Real-time data transmission method and system based on dual networks and dual links
CN115037782A
Trusted controller redundancy method, system and equipment for DCS (Distributed Control System) and medium
CN117193195A