Event reliable synchronization method, system and device based on sequence number confirmation mechanism

By employing a sequence number confirmation mechanism and memory mapping technology in the hydropower station's remote communication system, the problems of data loss and inconsistency during communication link switching were solved, enabling reliable data synchronization and stable transmission, and improving the system's reliability and efficiency.

CN117896396BActive Publication Date: 2026-11-24NANJING NARI WATER RESOURCES & HYDROPOWER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410156230.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-04
Publication Date
2026-11-24
Estimated Expiration
2044-02-04

AI Technical Summary

Technical Problem

Existing hydropower station computer monitoring systems suffer from data loss, duplicate transmission, and inconsistency issues during communication link switching, especially lacking a synchronization mechanism for string-type events, resulting in insufficient communication reliability and stability.

Method used

A reliable event synchronization method based on a sequence number acknowledgment mechanism is adopted. This method establishes a remote event cache queue and a mirror file in the communication system, uses memory mapping technology to achieve data synchronization, and ensures data consistency during link switching or fault recovery through a sequence number acknowledgment mechanism.

Benefits of technology

This ensures that the remote communication system does not miss or resend data during faults or link switching, improving the reliability and stability of communication, reducing bandwidth resource consumption, and ensuring the integrity and consistency of event data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117896396B_ABST
    Figure CN117896396B_ABST
Patent Text Reader

Abstract

This invention discloses a reliable event synchronization method, system, and device based on a sequence number confirmation mechanism. The method creates a cache space data structure based on a unique identifier for a remote telemetry event (RTA) and a transmission sequence number, along with an event description string. Through configuration parameters, processes with a primary / backup relationship are associated to form a redundant group. For nodes without redundant associations, the local cache image file is updated synchronously while maintaining the local cache space, ensuring that the state before the failure can be restored from the local cache image file after a brief failure. For nodes with redundant associations, a sequence number confirmation mechanism is used to synchronize data using a minimized synchronization information frame composed of the unique identifier of the RTA event. This invention can complete event synchronization and breakpoint resumption in a single-machine environment, as well as the synchronization of the RTA event cache spaces within the redundant association group, in a very short time, greatly improving the reliability and stability of real-time event synchronization between remote telemetry communication devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of remote communication control of power systems, and more specifically, to methods, systems and equipment for ensuring the reliability and stability of remote communication in a hydropower station computer monitoring system. Background Technology

[0002] Telecommunication systems, as crucial nodes for collecting real-time operational data from hydropower stations, also serve as key links in communication with the superior master station dispatching system. They are a vital foundation and information source for power grid dispatch automation and river basin / centralized control dispatch automation. Reliable transmission of telemetry information is essential to ensure the stability and reliability of telemetry communication. IEC60870-5-104 communication is currently the primary means of telemetry communication in dispatching and river basin automation systems.

[0003] According to IEC 60870-5-104 standard, see appendix. Figure 1-5 The APDU of a message defines control information (APCI) to protect the message from loss and duplicate transmission, as well as control information for message transmission initiation and transmission connection monitoring. I-format messages always contain data (ASDU), with Bit0=0 in the first byte of the control field, used for transmitting data (ASDU). S-format messages contain only a 6-byte header (APCI) without data; Bit0=1 and Bit1=0 in the first byte of the control field, used to acknowledge received I-format data.

[0004] During transmission, the sender increments the transmission sequence number, and the receiver increments the reception sequence number. The reception sequence number returned by the receiver indicates a valid acknowledgment of all received messages with transmission sequence numbers less than its own, and anticipates receiving the next message with its own sequence number as the transmission sequence number. If long data transmissions are only performed in one direction, S-format acknowledgment messages can be sent in the other direction. The control station (i.e., the scheduling master station) acknowledges the I-frame data sent by the controlled stations through S-format frame messages. All transmitted data (I-frames) with reception sequence numbers less than those of the controlled stations (i.e., the various substations) represent valid reception by the control station.

[0005] The IEC 60870-5-104 standard designs the K and W sliding window parameters to improve message transmission efficiency. The maximum number of latest acknowledgment APDUs (W value) means that for every W frames of I messages sent by a substation, the master station must acknowledge it with one S frames. By properly applying this parameter, it is unnecessary to acknowledge and reply to every frame of telemetry event messages, greatly reducing the number of messages transmitted and alleviating bandwidth resource consumption in situations involving large data volumes.

[0006] IEC 60870-5-104 2006 requires the use of redundancy to improve communication reliability. Currently, hydropower station computer monitoring systems, as substations of IEC 60870-5-104 communication, generally employ redundant configurations for their remote communication servers. This means two remote communication servers are configured: one to update real-time data internally through the power station's computer monitoring system's dual (quad) network, and another to transmit data externally to the superior master station system via different physical links (power grid, telecommunications, etc.). Some smaller power plants use a single remote communication server, but the data transmission channel typically employs physical link redundancy. While these redundant configurations physically achieve communication redundancy, the reliability, integrity, and smooth operation of data during communication switching after brief failures of communication sub-nodes remain key challenges and difficulties in remote communication processing.

[0007] Currently, the computer monitoring system of hydropower stations has its own independent real-time database on different remote communication servers. These servers receive updates from the host's real-time database (containing information on sudden events) via multicast to ensure real-time data synchronization. However, for time-stamped event information, this real-time database update method can lead to event loss in occasional situations. For example, when a substation generates 10 remote event messages and uploads these 10 I-frames to the master station system, if the link switches (or the substation experiences a brief failure) when the master station receives 8 messages and replies with acknowledgment frames (S-frames), the remaining two I-frames may be lost because the master station has not yet received and processed them. The event information that has not yet received master station acknowledgment needs to be re-uploaded via a new channel after the link switch (or after the fault is recovered). It is evident that while the current redundant configuration mode of hydropower station telemetry communication ensures the reliability of telemetry communication to a certain extent, it still falls short of true redundancy of communication channels. This is because the redundancy of physical links alone cannot guarantee the reliability, integrity, and disturbance-free requirements of data during link switching. It is also necessary to achieve data synchronization of application redundancy to realize reliable redundancy of telemetry communication data.

[0008] Furthermore, with the continuous development of information technology, network bandwidth is no longer limited by technology, and some string-type event information that was not previously sent to the master station is gradually being sent. However, string-type events are different from actual SOE measurement point events. These types of events do not have pre-agreed mapping point numbers, and current technology lacks consideration for synchronization mechanisms for such events. Summary of the Invention

[0009] Purpose of the invention: The purpose of this invention is to provide a reliable event synchronization method, system, and device based on a sequence number confirmation mechanism, so as to achieve consistency in the application definition of telemetry event data before and after a brief failure of a communication node or a link switch, and to achieve the application effect of preventing false transmission, retransmission, and omission of telemetry data during a brief system failure or link switch, thereby minimizing the occupation of limited bandwidth resources in the case of large-volume redundant data transmission.

[0010] Technical solution: A reliable event synchronization method based on a sequence number confirmation mechanism, comprising the following steps:

[0011] By configuring configuration parameters, communication systems or devices that are mutually primary or backup are associated to establish a redundant association group for remote communication in hydropower stations. Each communication system or device independently establishes a local cache queue space for remote events to store unconfirmed remote events. The local cache queue space data is mapped to form a local event cache image file through memory mapping technology. The data structure of the event cache queue consists of a unique identifier for the remote event, a transmission sequence number, and an event description string.

[0012] For nodes without redundant associations, when the local process starts, it first reads the event cache image file, restores the cache queue state before the failure based on the image file, and then takes responsibility for receiving remote events and updating its own cache queue space. When it receives a communication confirmation frame from the master station, it deletes the confirmed event cache queue data in the cache queue space according to the reception sequence number of the communication confirmation frame, and simultaneously updates the event cache image file.

[0013] For nodes with redundant associations, after the local process starts, it periodically sends a message that the process has started to the associated processes in the redundant group, and repeatedly checks whether it receives a response from the other process within a specified time. If it does, it receives the synchronization data message from the associated process and updates the local cache queue space according to the synchronization data message. If not, it does not perform initial synchronization, and the local process is responsible for receiving remote event and independently updating its own cache queue space.

[0014] For nodes with redundant connections, when the local process changes from inactive to active, it locates all confirmed event data from the cache queue based on the received sequence number of the communication confirmation frame received from the master station, automatically deletes the confirmed remote event cache queue data, and updates the event cache image file. Then, it uses the unique remote event identifier of the last confirmed event to form a minimal synchronization information frame to notify the other side. When the other side receives this message, it compares the unique remote event identifier with the corresponding remote event data in the local event cache queue and deletes the corresponding confirmed remote event cache queue data.

[0015] When configuring configuration parameters, the parameters used for redundancy association include any one or more of the following: peer node name, IP address, or synchronization port number.

[0016] The unique identifier of a telemetry event includes three elements: event ID, event measurement, and event timestamp. The event timestamp uses the millisecond timestamp with the lowest resolution of the event.

[0017] The event ID is an 8-byte integer, which includes two cases: for actual SOE measurement point information, the event ID is represented by its actual point number; for string description events during system operation, its event ID is generated by the MD5 algorithm or other unique ID generation algorithm.

[0018] For nodes with redundant associations, when the local process is activated, the minimized synchronization information frame to be synchronized to the other side includes: according to the sequence number confirmation mechanism, the last confirmed event is found in the cache queue according to the transmission sequence number saved for each event, a unique identifier for the remote event is formed based on its characteristic information, and an important synchronization flag information frame is formed as the minimized synchronization information frame and sent to the inactive link on the other side.

[0019] The event's saved transmission sequence number is generated in the following way: when the local machine receives a new event, the transmission sequence number corresponding to the event is set to the initial value 0xFFFF; each time a new event is generated and sent to the master station, the transmission sequence number corresponding to the event is set to the transmission sequence number of the current IEC 60870-5-104 message frame, ranging from 0 to 0x7FFF.

[0020] Specifically, for nodes without redundant associations, restoring the pre-fault cache queue state locally based on the image file includes: determining the validity of the image file read after the process starts based on a preset fault recovery time threshold, treating events exceeding the fault recovery time threshold as outdated events and not uploading them, and restoring the pre-fault cache queue state based on the valid image file.

[0021] The cached data structure in the cache queue space uses a unidirectional queue to store cached data, following the first-in-first-out (FIFO) operation mode.

[0022] A reliable event synchronization system based on a sequence number confirmation mechanism, the system includes several remote communication servers, which serve as communication substations of a hydropower station and transmit data to the master station. These remote communication servers include communication systems or devices with a mutual master-backup relationship and stand-alone systems or devices. The communication systems or devices with a mutual master-backup relationship are associated through configuration parameters to form a redundant association group for remote communication in the hydropower station.

[0023] Each communication system or device independently establishes a local cache queue space for remote telemetry events to store unconfirmed remote telemetry events, and uses memory mapping technology to map the data of the local cache queue space to form a local event cache image file. The data structure of the event cache queue consists of a unique identifier for the remote telemetry event, a transmission sequence number, and an event description string.

[0024] Among them, nodes without redundant associations first read the event cache image file when the local process starts, restore the cache queue state before the failure according to the image file, and then take responsibility for receiving remote events and updating their own cache queue space. When a communication confirmation frame is received from the master station, the confirmed event cache queue data is deleted from the cache queue space according to the reception sequence number of the communication confirmation frame, and the event cache image file is updated synchronously.

[0025] After the local process starts, the redundant associated nodes periodically send a message that the process has started to the associated processes in the redundant group, and repeatedly check whether they receive a response from the other process within a specified time. If so, they receive the synchronization data message from the associated process and update their local cache queue space according to the synchronization data message. If not, they do not perform initial synchronization and the local node is responsible for receiving remote events and independently updating its own cache queue space.

[0026] When a node with redundant connections becomes active in its local process, it locates all confirmed event data from the cache queue based on the received sequence number of the communication confirmation frame received from the master station, automatically deletes the confirmed remote event cache queue data, and updates the event cache image file. Then, it uses the unique remote event identifier of the last confirmed event to form a minimized synchronization information frame to notify the other side. When the other side receives this message, it compares the unique remote event identifier with the corresponding remote event data in the local event cache queue and deletes the corresponding confirmed remote event cache queue data.

[0027] A computer device is deployed as a remote communication server and serves as a communication substation for a hydropower station to transmit data to a master station. The computer device can form a master-slave relationship with other remote communication servers or operate independently. When the computer device forms a master-slave relationship with other remote communication servers, the two are associated through configuration parameters to form a redundant association group for remote communication in the hydropower station.

[0028] The computer device independently establishes a local cache queue space for remote telemetry events to store unconfirmed remote telemetry events, and uses memory mapping technology to map the data of the local cache queue space to form a local event cache image file. The data structure of the event cache queue consists of a unique identifier for the remote telemetry event, a transmission sequence number, and an event description string.

[0029] When the computer device operates independently, it first reads the event cache image file when the local process starts, restores the cache queue state before the failure based on the image file, and then takes responsibility for receiving remote events and updating its own cache queue space. When it receives a communication confirmation frame from the master station, it deletes the confirmed event cache queue data in the cache queue space according to the reception sequence number of the communication confirmation frame, and simultaneously updates the event cache image file.

[0030] When the computer device has redundant associations, after the local process starts, it periodically sends a message that the local process has started to the associated processes in the redundant group, and cyclically judges whether it receives a response reply from the other process within a specified time. If it does, it receives the synchronization data message from the associated process and updates the local cache queue space according to the synchronization data message. If not, it does not perform initial synchronization, and the local device is responsible for receiving remote events and independently updating its own cache queue space.

[0031] When the computer equipment has redundant associations, when the local process changes from inactive to active, it locates all confirmed event data from the cache queue based on the received sequence number of the communication confirmation frame received from the master station, automatically deletes the confirmed remote event cache queue data, and updates the event cache image file; then, it uses the unique remote event identifier of the last confirmed event to form a minimized synchronization information frame to notify the other side. When the other side receives this message, it compares the unique remote event identifier with the corresponding remote event data in the local event cache queue and deletes the corresponding confirmed remote event cache queue data.

[0032] Beneficial Effects: This invention establishes a redundant association group for hydropower station remote communication, with each communication system or device independently establishing a remote event cache space. The cache data structure consists of a unique identifier for the remote event, a transmission sequence number, and an event description string. In a single-machine environment, memory mapping technology is used to synchronize local cache space data to the cache mirror file in real time. Upon receiving an acknowledgment frame and deleting the event cache queue, the local mirror cache file is updated simultaneously. Because memory mapping technology uses pointers to operate on files, it greatly improves the efficiency of local cache synchronization. In a dual-machine redundant environment, based on the confirmation mechanism of the received sequence number of the activated channel, an "important synchronization flag" information frame (minimized synchronization information frame) containing the unique identifier of the remote event is formed for data synchronization. This allows for the synchronization of remote event cache spaces within the redundant association group to be completed in a very short time. This invention significantly improves the reliability and stability of real-time event cache space synchronization between remote communication devices, ensuring that during any network communication anomaly, recovery, or link switching process in the remote communication system, there are no missed, mistransmitted, or retransmitted remote event signals to the master station system. Attached Figure Description

[0033] Figure 1 This is a diagram illustrating the APDU format definition for information transmission according to IEC 60870-5-104.

[0034] Figure 2 This is a diagram of the control fields for the information transmission format type (I format) in IEC 60870-5-104;

[0035] Figure 3 This is a control field diagram for the monitoring function type (S format) with IEC 60870-5-104 number;

[0036] Figure 4 This is a control field diagram for an unnumbered control function type (U format) according to IEC 60870-5-104;

[0037] Figure 5 This is a diagram illustrating the K and W parameter definitions for the sliding window;

[0038] Figure 6 This is a diagram illustrating the data structure definition of the "unique identifier of a remote event" and the design of the event data cache space structure.

[0039] Figure 7 It describes the workflow of event synchronization and breakpoint resume in a single-machine environment, as well as the workflow of the dual-machine event caching synchronization mechanism within a redundant group. Detailed Implementation

[0040] The technical solutions in the embodiments of the present invention will now be clearly and completely described in conjunction with the accompanying drawings.

[0041] In the scenario of remote communication in hydropower stations, remote communication servers act as communication substations, transmitting data to the master station. These remote communication servers include communication systems or devices with a primary and backup relationship (hereinafter referred to as dual-machine systems or redundant environments) and single-machine systems or devices (hereinafter referred to as single-machine systems or single-machine environments). However, even in single-machine environments, redundant physical links are often configured for data transmission. Each communication system or device collects real-time operating data of the power station and establishes its own corresponding cache space to store remote events. If a substation experiences a brief failure or a link switch occurs, the existing redundancy configuration cannot guarantee the reliability, integrity, and disturbance-free requirements of data during communication switching. To address this, this invention designs a method and system for reliable event synchronization based on a sequence number confirmation mechanism. Through the implementation of this mechanism, it ensures that after a brief system failure or link switch in remote communication, the remote event information of the substation can be automatically retransmitted through the reactivated channel without retransmission or error, achieving the function of automatically retransmitting remote event information that has not been confirmed by the master station.

[0042] To achieve the above objectives, this invention designs a cached data structure based on a "unique identifier for a remote event" + a transmission sequence number + an event description string. This cached data structure is as follows: Figure 6 As shown, the unique identifier SYNCMSG for remote telemetry events includes three elements: event ID MsgID, time stamp MsgTime, and event measurement MsgVal. The data structure SOELinkNode for a single cached time consists of the unique identifier SYNCMSG, the transmission sequence number serialNo, and the event description string MsgDesc. In memory space, SOELinkNode uses a unidirectional queue to store cached data, following a first-in-first-out (FIFO) pattern. According to an embodiment of the present invention, the local cache queue space for remote telemetry events at each node (i.e., substation) is used to store unconfirmed remote telemetry events. A local event cache image file is created by mapping the data in the local cache queue space using memory mapping technology, forming the data set of SOELinkNode.

[0043] According to an embodiment of the present invention, the event ID that uniquely identifies a telemetry event includes the following two types, both represented by 8-byte integer data to improve transmission efficiency:

[0044] 1) For actual SOE measurement point information, the event ID is represented by its actual point number;

[0045] 2) For string-described events during system operation, their event IDs can be generated using the MD5 algorithm or other unique ID generation algorithms.

[0046] The event timestamp in the unique identifier of a telemetry event uses the lowest resolution millisecond timestamp (that is, the time precision is at the millisecond level) of the telemetry event to ensure the uniqueness of the telemetry event.

[0047] According to an embodiment of the present invention, the generation method of the transmission sequence number on the substation side is as follows: when the local station receives a new event, the event transmission sequence number is set to the initial value 0xFFFF; each time a new event is to be sent to the master station, the transmission sequence number of the event is set to the transmission sequence number of the current IEC 60870-5-104 message frame, which ranges from 0 to 0x7FFF.

[0048] Therefore, as long as an acknowledgment frame (S-frame) message is received from the master station, it is possible to quickly determine which events have been actually received by the master station based on the acknowledgment sequence number of the message frame, and at the same time, it is possible to determine the position of the last event data confirmed in the buffer queue.

[0049] The unidirectional queue that stores cached data uses a singly linked list for data storage. This ensures the reliability of data storage while also meeting the efficiency requirements of data addition, deletion, and insertion operations, and improving the speed of the redundancy synchronization process.

[0050] For a dual-machine system, when synchronization occurs, only a minimal synchronization information frame containing a "unique identifier of the remote control event" needs to be transmitted. After receiving the information frame, the receiver parses the "unique identifier of the remote control event" and finds its position in the event buffer queue based on the three key features of the identifier. All remote control events before this position are information that has been confirmed by the master station. After deletion, the synchronization of the buffer queues of the redundant dual machines is completed.

[0051] For standalone systems, the same data structure and caching method are used. However, while creating the event cache queue, a local event cache image file is created using memory mapping technology. Upon receiving an acknowledgment frame and deleting the event cache queue, the local image cache file is updated synchronously. Because memory mapping technology operates on files using pointers, it greatly improves the efficiency of local cache synchronization. During normal operation, the local cache space and the cache image file are synchronized in real time. Based on the memory-mapped file technology, creation and synchronization can be completed simply by calling the corresponding memory mapping interface functions, so they will not be elaborated further. When a process experiences an abnormal failure and recovers immediately, it first reads the cache queue data from the cache image file, then takes responsibility for receiving remote events and updating its own cache queue space, maintaining the cache queue space data using the same acknowledgment mechanism based on the sent sequence number. Due to the high real-time performance of memory mapping technology, the local cache image file is synchronously updated as the cache queue space data changes.

[0052] When a substation node experiences a short-term failure and then recovers immediately, it can still restore the cache queue state before the failure from the cache image file, ensuring the consistency between the remote event cache and the state before the failure, thus realizing the "breakpoint resume" function. Generally, the time threshold for short-term failures is set to 5 minutes (but can also be set according to actual conditions). Historical events that exceed the time threshold are considered outdated events and will not be re-uploaded.

[0053] Furthermore, during the initialization and synchronization process of the dual-machine system, at the moment of process startup, the process that starts first performs a full synchronization of the remote control event buffer space to the process that starts later. After the dual-machine processes start normally (synchronization completed), based on the occurrence of the master station confirmation frame, the primary channel sends a minimized synchronization information frame containing the "unique identifier of the remote control event" as an "important synchronization flag" to the backup channel. The backup channel process then completes the screening and deletion of the remote control event buffer space on its side, thereby achieving synchronous updates of the remote control event buffer spaces on both sides and ensuring the dynamic consistency of the remote control event buffer datasets on both sides before and after channel switching.

[0054] For the burst synchronization process of a dual-machine system, the master station selects one link through redundant channels for STARTDT activation, while the other channel serves as a backup. Once the master and backup channels are determined, the dual-machine system of the substation can perform redundant data synchronization through the above synchronization process, ensuring that the backup machine's remote event buffer always stores the latest generated event data that has not yet been confirmed by the master station. Each time the master channel receives an S-frame with an acknowledgment sequence number from the master station, it locates the event position in its buffer space based on the acknowledgment sequence number, clears the corresponding confirmed remote event buffer data on its side, and simultaneously sends an "important synchronization flag" information frame with a "unique identifier for the remote event," immediately notifying the counterpart channel in the redundant group to determine and delete its remote event buffer, thus completing the event buffer synchronization. Due to the efficient use of the sequence number acknowledgment mechanism, each "important synchronization flag" information frame can synchronize a batch of confirmed events based on the user-set W parameter value, thereby significantly reducing the number of messages in the synchronization process and improving synchronization efficiency.

[0055] When the master station performs a link switch, since the link is in a hot standby state and the buffer data does not need to be synchronized during the switch, the switchover time can be minimized, and the consistency of the telemetry event buffer after the switchover can be guaranteed with that before the switchover. In this way, even if the master station misses some telemetry event data processing due to some reason during the switchover, it can be retransmitted through the new link after the switchover.

[0056] According to the communication characteristics of IEC 60870-5-104, only application data sent by the substation and confirmed by the frame sequence number can be considered to have been truly received by the master station. Therefore, although the application data of the two machines (i.e., the remote control event cache information) are maintained independently on different connections (links), their data attribute definitions and order are exactly the same. This invention provides a dual-machine data redundancy method for redundant environments. This method uses a sequence number confirmation mechanism based on IEC 60870-5-104 and a minimized synchronization information frame composed of a "unique identifier for remote control events" containing the three elements of a remote control event (event ID, event measurement, and event timestamp) for data synchronization. This method minimizes resource consumption caused by redundancy while ensuring redundancy reliability, greatly improving system reliability. For single-machine environments, this invention uses memory mapping technology to update the local cache space data to the cache image file in real time, ensuring that the pre-failure state can be restored from the cache image file after a brief substation failure.

[0057] Figure 7 The document describes the workflow for event synchronization and breakpoint resumption in a single-machine environment, as well as the synchronization process for cached data between redundant systems or devices. The specific steps are as follows:

[0058] Step 1: By configuring configuration parameters, processes (devices) with a primary / backup relationship are associated to form a redundant association group for the hydropower station's remote control communication. Parameters for redundant association may include: peer node name / IP address, synchronization port number, etc.

[0059] Step 2: After the process (device) starts, it periodically sends a message that the process has started to the associated processes in the redundancy group, and repeatedly checks whether it receives a response from the other process within a specified time (usually set to 5 seconds).

[0060] 2.0 In a standalone environment, there is no need to wait for a response from the other process. The local event cache image file is read directly, and it is determined whether the time characteristics of each event have timed out. If the event is valid, it is synchronized to the local event cache space queue. Then, the process itself performs subsequent maintenance and synchronization of the cache space queue and cache image file based on the sequence number confirmation mechanism.

[0061] 2.1 If a response is received from the other party within the specified time (usually set to 5 seconds), it means that an associated process has been started. Then, receive the synchronization data message from the associated process (the other side), wait for the synchronization end message to be received to indicate that the initialization synchronization is complete, set the local cache update completion flag m_fresh to 2, and update the local telemetry event cache space with the received new event data.

[0062] 2.2 If no response is received within the specified time (usually set to 5 seconds), it means that this side is the first process to start and does not need to receive initialization data. Set the local cache update completion flag m_fresh to 1, and then it will be responsible for receiving remote event and independently updating its own cache space.

[0063] Step 3: After the process starts, it waits for the master station to establish a connection and for the process to complete updating. Only then can it send a substation initialization completion message to notify the master station that the substation program (device) has completed initialization (104 protocol definition: type identifier:). <70> (Initialization complete), then wait for the link activation message from the master station.

[0064] Step 4: When the process transitions from inactive to active, based on the confirmation sequence number of the IEC 60870-5-104 communication confirmation frame (S-frame), all confirmed event data is located from the cache queue. Then, the confirmed remote control event cache space queue data is automatically deleted, and the cache image file is updated simultaneously. The "unique identifier of the remote control event" from the last confirmed event is used to form a minimal synchronization information frame, which is then sent to the other side (inactive link). When the other side receives this message, it compares the "unique identifier of the remote control event" with the corresponding remote control event data in its local event cache queue to complete the synchronization process of deleting the corresponding remote control event cache space on its side. This ensures that the cached data between the two links remains consistent in real time. Any cached data that is not deleted represents events that have not been confirmed by the master station and will be resent when the link is reactivated.

[0065] In a standalone environment, each time the system recovers from a brief failure, all unconfirmed events are first read from the local event cache image file to establish a mapping relationship between the local cache space and the cache image file. After that, they can be maintained in real time through the normal event maintenance process.

[0066] For redundant environments, steps 2 and 4 above only require sending all historical cache information and important flags during the first transmission of synchronization data. This means that the later-started communication process needs to synchronize all cached data to ensure consistency with the cached data of the earlier-started process. Afterward, because each process reliably receives real-time data from the monitoring system simultaneously, it can update its own event cache independently. The process activating the link only needs to immediately notify which remote events (i.e., important synchronization flags) have been confirmed by the master station. Since the master station uses a W sliding window parameter for acknowledging I-frames from the substation, the number of acknowledgment frames is greatly reduced, thus significantly reducing the amount of data that the substation's dual-machine cache needs to transmit synchronously.

[0067] The aforementioned dual-machine redundancy synchronization strategy significantly improves handover reliability. Because the new method employs real-time synchronization, the two machines synchronize their buffers simultaneously with the master station's confirmation of a new signal. This greatly reduces buffer inconsistencies caused by handover time differences, thus enhancing system reliability. Furthermore, the significantly reduced amount of synchronization data not only greatly lowers the load on the dual-machine redundant channels but also improves synchronization efficiency. This avoids the problem of long handover times due to excessive synchronization data, thereby improving system stability.

[0068] The present invention also provides a computer device, which is deployed as a remote communication server and serves as a communication substation of a hydropower station to transmit data to the master station. The computer device forms a master-slave relationship with other remote communication servers, or operates independently. When the computer device forms a master-slave relationship with other remote communication servers, the two are associated through configuration parameters to form a redundant association group for remote communication in the hydropower station.

[0069] The computer device independently establishes a local cache queue space for remote telemetry events to store unconfirmed remote telemetry events, and uses memory mapping technology to map the data of the local cache queue space to form a local event cache image file. The data structure of the event cache queue consists of a unique identifier for the remote telemetry event, a transmission sequence number, and an event description string.

[0070] When the computer device operates independently, it first reads the event cache image file when the local process starts, restores the cache queue state before the failure based on the image file, and then takes responsibility for receiving remote events and updating its own cache queue space. When it receives a communication confirmation frame from the master station, it deletes the confirmed event cache queue data in the cache queue space according to the reception sequence number of the communication confirmation frame, and simultaneously updates the event cache image file.

[0071] When the computer device has redundant associations, after the local process starts, it periodically sends a message that the local process has started to the associated processes in the redundant group, and cyclically judges whether it receives a response reply from the other process within a specified time. If it does, it receives the synchronization data message from the associated process and updates the local cache queue space according to the synchronization data message. If not, it does not perform initial synchronization, and the local device is responsible for receiving remote events and independently updating its own cache queue space.

[0072] When the computer equipment has redundant associations, when the local process changes from inactive to active, it locates all confirmed event data from the cache queue based on the received sequence number of the communication confirmation frame received from the master station, automatically deletes the confirmed remote event cache queue data, and updates the event cache image file; then, it uses the unique remote event identifier of the last confirmed event to form a minimized synchronization information frame to notify the other side. When the other side receives this message, it compares the unique remote event identifier with the corresponding remote event data in the local event cache queue and deletes the corresponding confirmed remote event cache queue data.

Claims

1. A method for reliable synchronization of events based on a sequence number acknowledgement mechanism, characterized in that, The method includes: By configuring configuration parameters, communication systems or devices that are mutually primary or backup are associated to establish a redundant association group for remote communication in hydropower stations. Each communication system or device independently establishes a local cache queue space for remote events to store unconfirmed remote events. The local cache queue space data is mapped to form a local event cache image file through memory mapping technology. The data structure of the event cache queue consists of a unique identifier for the remote event, a transmission sequence number, and an event description string. For nodes without redundant associations, when the local process starts, it first reads the event cache image file, restores the cache queue state before the failure based on the image file, and then takes responsibility for receiving remote events and updating its own cache queue space. When it receives a communication confirmation frame from the master station, it deletes the confirmed event cache queue data in the cache queue space according to the reception sequence number of the communication confirmation frame, and simultaneously updates the event cache image file. For nodes with redundant associations, after the local process starts, it periodically sends a message that the process has started to the associated processes in the redundant group, and repeatedly checks whether it receives a response from the other process within a specified time. If it does, it receives the synchronization data message from the associated process and updates the local cache queue space according to the synchronization data message. If not, it does not perform initial synchronization, and the local process is responsible for receiving remote event and independently updating its own cache queue space. For nodes with redundant connections, when the local process changes from inactive to active, it locates all confirmed event data from the cache queue based on the received sequence number of the communication confirmation frame received from the master station, automatically deletes the confirmed remote event cache queue data, and updates the event cache image file. Then, it uses the unique remote event identifier of the last confirmed event to form a minimal synchronization information frame to notify the other side. When the other side receives this message, it compares the unique remote event identifier with the corresponding remote event data in the local event cache queue and deletes the corresponding confirmed remote event cache queue data.

2. The method of claim 1, wherein, When configuring configuration parameters, the parameters used for redundancy association include any one or more of the following: peer node name, IP address, or synchronization port number.

3. The method of claim 1, wherein, The unique identifier of a telemetry event includes three elements: event ID, event measurement, and event timestamp. The event timestamp uses the millisecond timestamp with the lowest resolution of the event.

4. The method of claim 3, wherein, The event ID is an 8-byte integer, which includes two cases: for actual SOE measurement point information, the event ID is represented by its actual point number; for string description events during system operation, its event ID is generated by the MD5 algorithm or other unique ID generation algorithm.

5. The method of claim 3, wherein, For nodes with redundant associations, when the local process is activated, the minimized synchronization information frame to be synchronized to the other side includes: according to the sequence number confirmation mechanism, the last confirmed event is found in the buffer queue according to the transmission sequence number saved for each event, a unique identifier for the remote event is formed based on its characteristic information, and an important synchronization flag information frame is formed as the minimized synchronization information frame and sent to the inactive link on the other side.

6. The method of claim 5, wherein, The transmission sequence number saved for an event is generated in the following way: when the local machine receives a new event, the transmission sequence number corresponding to the event is set to the initial value 0xFFFF; each time a new event is generated and sent to the master station, the transmission sequence number corresponding to the event is set to the transmission sequence number of the current IEC 60870-5-104 message frame, which ranges from 0 to 0x7FFF.

7. The method of claim 1, wherein, For nodes without redundant associations, restoring the pre-failure cache queue state locally based on the image file includes: determining the validity of the image file read after the process starts based on a preset failure recovery time threshold, treating events exceeding the failure recovery time threshold as outdated events and not uploading them, and restoring the pre-failure cache queue state based on the valid image file.

8. The method according to claim 1, characterized in that, The cached data structure in the cache queue space uses a unidirectional queue to store cached data, following the first-in-first-out (FIFO) operation mode.

9. A reliable event synchronization system based on a sequence number confirmation mechanism, characterized in that, The system includes several remote communication servers, which serve as communication substations of the hydropower station and transmit data to the master station. These remote communication servers include communication systems or devices that are mutually primary and backup, as well as standby systems or devices. The communication systems or devices that are mutually primary and backup are associated through configuration parameters to form a redundant association group for the hydropower station's remote communication. Each communication system or device independently establishes a local cache queue space for remote telemetry events to store unconfirmed remote telemetry events, and uses memory mapping technology to map the data of the local cache queue space to form a local event cache image file. The data structure of the event cache queue consists of a unique identifier for the remote telemetry event, a transmission sequence number, and an event description string. Among them, nodes without redundant associations first read the event cache image file when the local process starts, restore the cache queue state before the failure according to the image file, and then take responsibility for receiving remote events and updating their own cache queue space. When a communication confirmation frame is received from the master station, the confirmed event cache queue data is deleted from the cache queue space according to the reception sequence number of the communication confirmation frame, and the event cache image file is updated synchronously. After the local process starts, the redundant associated nodes periodically send a message that the process has started to the associated processes in the redundant group, and repeatedly check whether they receive a response from the other process within a specified time. If so, they receive the synchronization data message from the associated process and update their local cache queue space according to the synchronization data message. If not, they do not perform initial synchronization and the local node is responsible for receiving remote events and independently updating its own cache queue space. When a node with redundant connections becomes active in its local process, it locates all confirmed event data from the cache queue based on the received sequence number of the communication confirmation frame received from the master station, automatically deletes the confirmed remote event cache queue data, and updates the event cache image file. Then, it uses the unique remote event identifier of the last confirmed event to form a minimized synchronization information frame to notify the other side. When the other side receives this message, it compares the unique remote event identifier with the corresponding remote event data in the local event cache queue and deletes the corresponding confirmed remote event cache queue data.

10. A computer device deployed as a remote communication server and serving as a communication substation in a hydropower station, transmitting data to a master station, wherein the computer device forms a master-slave relationship with other remote communication servers, or operates independently, characterized in that... When the computer equipment and other remote communication servers form a master-slave relationship, the two are associated through configuration parameter configuration to form a redundant association group for remote communication of the hydropower station. The computer device independently establishes a local cache queue space for remote telemetry events to store unconfirmed remote telemetry events, and uses memory mapping technology to map the data of the local cache queue space to form a local event cache image file. The data structure of the event cache queue consists of a unique identifier for the remote telemetry event, a transmission sequence number, and an event description string. When the computer device is running independently, it first reads the event cache image file when the local process starts, restores the cache queue state before the failure based on the image file, and then takes responsibility for receiving remote events and updating its own cache queue space. Upon receiving a communication confirmation frame from the master station, the confirmed event cache queue data is deleted from the cache queue space according to the received sequence number of the communication confirmation frame, and the event cache image file is updated synchronously. When the computer device has redundant associations, after the local process starts, it periodically sends a message that the local process has started to the associated processes in the redundant group, and cyclically judges whether it receives a response reply from the other process within a specified time. If it does, it receives the synchronization data message from the associated process and updates the local cache queue space according to the synchronization data message. If not, it does not perform initial synchronization, and the local device is responsible for receiving remote events and independently updating its own cache queue space. When the computer equipment has redundant associations, when the local process changes from inactive to active, it locates all confirmed event data from the cache queue based on the received sequence number of the communication confirmation frame received from the master station, automatically deletes the confirmed remote event cache queue data, and updates the event cache image file; then, it uses the unique remote event identifier of the last confirmed event to form a minimized synchronization information frame to notify the other side. When the other side receives this message, it compares the unique remote event identifier with the corresponding remote event data in the local event cache queue and deletes the corresponding confirmed remote event cache queue data.

Citation Information

Patent Citations

  • Data synchronization method of remote control channel

    CN102724289A

  • Automatic synchronization method of multistate data in integrated substation monitoring system

    CN103237065A