Controller data dynamic full redundancy method, device and system and storage medium

By linking hash tables and doubly linked lists, the system automatically identifies data modification status and employs priority synchronization and periodic synchronization tasks. This solves the problems of missing key data and insufficient dynamic adaptability caused by manual screening in existing technologies, and achieves full data synchronization of redundant controllers, thereby improving the stability and reliability of the system.

CN121658558APending Publication Date: 2026-03-13SUPCON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-05
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing data synchronization technologies for redundant controllers rely on manual screening, lack dynamic adaptability, and are difficult to achieve full coverage, resulting in insufficient system stability and reliability.

Method used

By using a combination of hash tables and doubly linked lists, the system automatically identifies data modification status and achieves dynamic, full-coverage updates of data blocks through priority synchronization tasks and periodic synchronization tasks.

Benefits of technology

It achieves fully automatic dynamic redundancy synchronization without human intervention, ensuring data consistency during primary and backup controller switching, enhancing the system's fault tolerance and availability, and reducing switching disturbances and logic errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121658558A_ABST
    Figure CN121658558A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic full-redundancy synchronization method for data of a redundant controller. The method comprises the following steps: dividing to-be-synchronized data into a plurality of data blocks; when the data block is modified, quickly positioning the position of the data block in the double linked list through the hash table and moving the data block to the head of the double linked list so as to mark the data block as the latest data; if the data is new data, creating a new node, inserting the new node into the head of the double linked list, and recording in the hash table; starting a priority synchronization task, regularly selecting data from the head of the double linked list, and synchronizing the data to a standby controller; and starting a periodic synchronization task, and regularly selecting a data synchronization standby controller from the tail part of the double linked list. Through the dynamic priority synchronization task and the full-coverage periodic synchronization task, full-automatic and full-coverage data synchronization without manual intervention is realized, and the reliability and synchronization efficiency of the redundancy control system are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application pertains to data synchronization technology for redundant controllers, specifically relating to a method, apparatus, system, and storage medium for dynamic full redundancy of controller data. Background Technology

[0002] In industrial production, the DCS (Distributed Control System) serves as the core control hub, undertaking critical tasks such as production process monitoring, parameter adjustment, and fault handling. The controller, as the core computing and control unit of the DCS control station, directly determines the safety and efficiency of the entire industrial system due to its operational stability. To avoid production interruptions or data loss caused by a single controller failure, the mainstream solution in current technology is to adopt a dual-controller redundancy architecture—that is, the control station is configured with a working controller and a backup controller. Through a preset fault level arbitration mechanism (such as arbitration logic based on hardware status, operational anomalies, and communication link integrity), it is ensured that only one controller is always in working condition during the operation of the control station, while the other remains in standby. When the working controller fails, the backup controller can quickly take over control, achieving a "disruptive switchover," thereby significantly improving the system's fault tolerance and reliability.

[0003] To achieve "disruptive handover," the core prerequisite is ensuring that the operating status and data parameters of the standby controller and the working controller remain consistent. Therefore, the working controller needs to periodically synchronize redundant data (including process control parameters, I / O acquisition data, configuration information, historical operation records, etc.) to the standby controller. However, due to limitations in the bandwidth, transmission rate, and stability of data transmission equipment in the industrial field (such as inter-controller communication buses and data interface modules), the controller cannot achieve full real-time synchronization of all redundant data. Forcing full synchronization would not only consume a large amount of communication resources and cause delays in the transmission of critical control commands, but could also lead to synchronization interruptions due to data congestion, thus affecting system stability.

[0004] Given the aforementioned limitations, the commonly used approach in existing technologies is for system vendors and users to jointly and manually select a portion of data deemed "critical" for synchronization based on experience. This approach reduces synchronization overhead to some extent while still meeting basic reliability requirements.

[0005] However, the existing "manual screening of key data synchronization" solution has significant flaws, specifically: First, it relies heavily on human experience, posing a risk of omissions: whether data is "critical" largely depends on the engineer's subjective judgment. In actual industrial settings, certain data only demonstrates its importance under specific operating conditions or sequences, and is easily overlooked during the manual screening stage. If this unselected data is inconsistent during controller switching, it will directly cause system disturbances or even control logic errors, creating potential safety hazards.

[0006] Second, there is a lack of dynamic adaptability: the "criticality" of data is not static. Data that is frequently modified within the current control cycle is crucial for state synchronization, while data that remains unchanged for a long time has relatively lower urgency for synchronization. Existing static configuration schemes cannot dynamically adjust synchronization strategies according to actual data changes, resulting in limited synchronization resources not being allocated to the data that most needs synchronization, leading to low synchronization efficiency.

[0007] In summary, existing data synchronization technologies for redundant controllers, due to their reliance on manual screening and lack of dynamic adaptability and full coverage mechanisms, are insufficient to meet the industrial demand for "comprehensiveness, real-time performance, and flexibility" in redundant data synchronization. There is an urgent need for a technical solution that can automatically identify data importance, dynamically adjust synchronization strategies, and ensure the final synchronization of all data to address the shortcomings of existing technologies and further improve the reliability and switching stability of DCS redundant controllers. Summary of the Invention

[0008] In view of the above-mentioned shortcomings and deficiencies of the prior art, this application provides a method, device, system and electronic medium for dynamic full redundancy of controller data. It automatically identifies data modifications by linking hash tables and doubly linked lists, and uses priority synchronization tasks and periodic synchronization tasks to achieve dynamic full coverage updates of data blocks. This solves the three core problems of the prior art: reliance on manual labor, lack of dynamic adaptability and difficulty in achieving full resource coverage.

[0009] To achieve the above objectives, this application adopts the following technical solution: a dynamic full redundancy method for controller data, applied to data synchronization between redundant controllers, comprising: The working controller divides the data to be redundant into several data blocks; When any data block in the work controller is modified, the work controller checks whether the modified data block exists in the hash table. If the target data block already exists in the hash table, the work controller locates the current position of the target data block in the doubly linked list through the hash table, adjusts the node connection relationship of the doubly linked list, and moves the node corresponding to the target data block to the head of the doubly linked list. If the target data block does not exist in the hash table, the work controller inserts the target data block into the head of the doubly linked list and creates a key-value pair in the hash table. The key of the key-value pair is the identifier of the target data block, and the value is a reference to the position of the target data block in the doubly linked list. The working controller initiates a priority synchronization task, selects M data blocks starting from the head of the doubly linked list, and synchronizes the selected data blocks to the backup controller. The working controller initiates a periodic synchronization task, selecting N data blocks starting from the tail of the doubly linked list, and synchronizing the selected data blocks to the backup controller.

[0010] Furthermore, the doubly linked list is a doubly linear data structure that supports insertion and deletion operations with O(1) time complexity, provided that the target node has been located.

[0011] Furthermore, the doubly linked list is sorted from head to tail according to the time order of the most recently modified data block, with the most recently modified data block located at the head of the doubly linked list.

[0012] Furthermore, the priority synchronization task and the periodic synchronization task are configured independently, and the duration of the periodic synchronization task is no greater than the maximum allowed duration required for the full synchronization of the redundant data.

[0013] Furthermore, the periodic synchronization task includes the following steps: Query the number L of data blocks in the doubly linked list; Determine that the data block N=LM is synchronized starting from the tail of the doubly linked list; Determine if N is greater than 0; If N is less than or equal to 0, then skip the periodic synchronization task.

[0014] Furthermore, after synchronizing the data block to the backup controller, the working controller removes the data block information from the doubly linked list.

[0015] Furthermore, when the doubly linked list is empty, the priority synchronization task and the periodic synchronization task are skipped until the doubly linked list generates a new data block and is restarted.

[0016] The present invention also provides another embodiment, a controller data dynamic full redundancy device, applied to data synchronization between redundant controllers, comprising: The data partitioning module is used to divide the data to be redundant into several data blocks; The data update module checks whether the modified data block exists in the hash table when any data block is modified. If it exists, the current position of the target data block in the doubly linked list is located through the hash table, the node connection relationship of the doubly linked list is adjusted, and the node corresponding to the target data block is moved to the head of the doubly linked list. If it does not exist, the target data block is inserted at the head of the doubly linked list, and a key-value pair is created in the hash table. The key of the key-value pair is the identifier of the target data block, and the value is a reference to the position of the target data block in the doubly linked list. The priority synchronization module is used to initiate a priority synchronization task, select M data blocks starting from the head of the doubly linked list, and synchronize the selected data blocks to the backup controller. Periodic synchronization module: Used to start a periodic synchronization task, select N data blocks starting from the tail of the doubly linked list, and synchronize the selected data blocks to the backup controller.

[0017] This application also discloses a controller data dynamic full redundancy system, including: One or more processors; Computer-readable storage medium for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the method according to any one of claims 1 to 7.

[0018] This application also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.

[0019] The beneficial effects of this application are: 1. Fully automatic dynamic redundancy synchronization: No manual intervention is required. The system automatically identifies data modification status and dynamically adjusts synchronization priority through the linkage of hash table and doubly linked list. This avoids the omission of key data due to manual screening, ensures data consistency and system stability during the switching of master and backup controllers, and enhances the fault tolerance and availability of the control system.

[0020] 2. Simple and efficient dynamic synchronization mechanism: It adopts a strategy of prioritizing the synchronization of recently modified data to ensure that the state of the standby controller is as close as possible to the working controller, minimizing switching disturbances. At the same time, it utilizes the O(1) time complexity of insertion and deletion operations using hash tables and doubly linked lists, resulting in extremely low algorithm overhead. While ensuring high performance, it does not require any additional hardware costs.

[0021] 3. Full-coverage full-data synchronization mechanism: Through periodic synchronization tasks, low-frequency modified data at the tail of the doubly linked list is synchronized as a fallback, ensuring that data that has not been updated for a long time but still needs to remain consistent is synchronized within a preset period, eliminating the "static data synchronization blind spot" in traditional solutions, and avoiding logical errors caused by long-term data deviations in the backup controller. Attached Figure Description

[0022] This application is described with reference to the following figures: Figure 1 The flowchart of the controller data dynamic full redundancy method of this application is shown; Figure 2 This application illustrates the hash table and doubly linked representation. Figure 3 This paper illustrates a schematic diagram of the adjustment of the doubly linked list data block in this application. Figure 4 This application shows a schematic diagram of adding a doubly linked list data block; Figure 5 The flowchart of the periodic synchronization task for this application is shown. Detailed Implementation

[0023] To better explain and facilitate understanding of the present invention, it is described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described below are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other; for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0024] As the background technology indicates, in the field of industrial control, to ensure a smooth and stable switching process, the working controller must periodically synchronize its internal status data to the standby controller, keeping the standby controller in a "hot standby" state. However, limited by the controller's processing power and communication bandwidth, achieving complete real-time synchronization of all data is costly and difficult to implement. Therefore, the commonly adopted solution in existing technologies is that the DCS supplier, in conjunction with the user, pre-defines the range of "critical" redundant data based on the control requirements of the specific industrial scenario. The working controller only synchronizes data within this range to the standby controller, seeking a balance between "synchronization effectiveness" and "resource consumption." However, this method, due to its reliance on manual screening and lack of dynamic adaptability and full coverage mechanism, fails to meet the industrial scenario's requirements for "comprehensiveness, real-time performance, and flexibility" in redundant data synchronization.

[0025] To address the aforementioned issues, this application provides a dynamic full redundancy method for controller data, applied to data synchronization between redundant controllers. It automatically identifies data modifications through a combination of hash tables and doubly linked lists, and utilizes priority synchronization tasks and periodic synchronization tasks to achieve dynamic full-coverage updates of data blocks. The specific method is as follows: Figure 1 As shown, it includes: S100: The working controller divides the data to be redundant into several data blocks. The data division can be implemented in various ways, including but not limited to: 1. Fixed-size uniform division: The data space is evenly divided according to a preset fixed length (such as 10KB). This method has a simple calculation logic and is easy to manage with hash tables.

[0026] 2. Data Logical Structure-Based Partitioning: This method divides data according to its inherent semantics, such as dividing a complete functional module parameter or all attributes of a process variable into an independent data block. This approach enables more precise synchronization.

[0027] Those skilled in the art will understand that any method capable of dividing a continuous data space into independently identifiable and manageable units falls within the protection scope of this invention.

[0028] S200: When any data block in the work controller is modified, the work controller checks whether the modified data block exists in the hash table. If the target data block already exists in the hash table, the work controller locates the current position of the target data block in the doubly linked list through the hash table, adjusts the node connection relationship of the doubly linked list, and moves the node corresponding to the target data block to the head of the doubly linked list. If the target data block does not exist in the hash table, the work controller inserts the target data block into the head of the doubly linked list and creates a key-value pair in the hash table. The key of the key-value pair is the identifier of the target data block, and the value is a reference to the position of the target data block in the doubly linked list. Among them, such as Figure 2 As shown, the hash table contains key-value pairs for data blocks. The key is the identifier of the target data block, and the value is a reference to the position of the target data block in the doubly linked list. The hash table manages all the partitioned redundant data blocks, and each partitioned data block can be quickly located and its position confirmed using the key-value pairs in the hash table. When a data block is modified, the hash function of the hash table allows for quick location of the modified data block in the doubly linked list without traversing the entire list, thus ensuring the efficiency of data update and synchronization operations.

[0029] A doubly linked list is a doubly linear data structure that supports insertion and deletion operations with O(1) time complexity, provided the target node has been located. Furthermore, the doubly linked list is sorted from head to tail according to the time of the most recent modification of data blocks, with the most recently modified data block located at the head of the doubly linked list. Figure 3For example, a doubly linked list contains 5 data blocks A-E. When data block B in the doubly linked list is modified, the information of data block B in the hash table is looked up, and the data block numbered 1 is quickly located to identify the modified data block. Since data block B was recently modified, according to the sorting rules of the doubly linked list, the most recently modified data block B is moved to the head of the doubly linked list. At this time, the sorting of the 5 data blocks in the doubly linked list is BACDE. At the same time, the modified data block is quickly inserted / moved using the constant time complexity function O(1) of the doubly linked list. The fast location using the hash table O(1) and the insertion / moving using the doubly linked list O(1) work together to ensure the efficiency of dynamic management of data blocks. Even if there are a large number of data blocks in the system, the time spent on each data update and synchronization scheduling is still instantaneous and stable, which ensures the high real-time performance of the controller.

[0030] like Figure 4 As shown, when the data block to be modified does not exist in the hash table, the worker controller inserts the target data block into the head of the doubly linked list and creates a key-value pair in the hash table. Figure 4 If data block F is updated but not found in the hash table, the worker controller inserts it at the head of the doubly linked list. At this point, the data blocks in the doubly linked list are ordered as: FBACDE. Furthermore, a data block identifier with the number 5 is generated in the hash table to identify data block F and record its position pointer in the doubly linked list.

[0031] S300: The working controller starts a priority synchronization task, selects M data blocks starting from the head of the doubly linked list, and synchronizes the selected data blocks to the standby controller; S400: The working controller starts a periodic synchronization task, selects N data blocks starting from the tail of the doubly linked list, and synchronizes the selected data blocks to the standby controller.

[0032] The priority synchronization task and the periodic synchronization task are configured independently, and the periodic synchronization task is executed once after every x priority synchronization tasks. The priority synchronization task and the periodic synchronization task are configured independently and can be executed within the same cycle without affecting each other. Through the priority synchronization task, data blocks are selected from the head of the doubly linked list and synchronized to the backup controller. Newly modified data is synchronized to the backup controller, ensuring that urgent data is prioritized for synchronization. This ensures that the status of the backup controller closely follows the latest changes of the working controller within each cycle, greatly reducing data discrepancies and recovery time during the switchover process, and effectively reducing system disturbances.

[0033] Furthermore, leveraging the fallback feature of periodic synchronization tasks, every x cycles, a data block from the tail of the doubly linked list is synchronized to a separate controller via the periodic synchronization task. Since the data block at the tail of the doubly linked list is in a "long-term" unmodified state, its urgency is not as high as the frequently updated data at the head of the doubly linked list. However, it still contains some critical data that needs to be synchronized to the backup controller to prevent low-priority data from being left unsynchronized for extended periods, leading to the loss of critical data. The fallback feature of the periodic synchronization task ensures that low-priority data at the tail of the doubly linked list is also synchronized to the backup controller after multiple cycles, thus achieving full synchronization of redundant data.

[0034] Furthermore, such as Figure 5 As shown, the periodic synchronization task includes the following steps: Query the number L of data blocks in the doubly linked list; Determine that the data block N=LM is synchronized starting from the tail of the doubly linked list; Determine if N is greater than 0; If N is less than or equal to 0, then skip the periodic synchronization task.

[0035] Every x cycles after the priority synchronization task executes, a periodic synchronization task is executed to perform a fallback synchronization of redundant data. During the periodic synchronization task, the number L of data blocks in the doubly linked list for that cycle is queried. Since the priority and periodic synchronization tasks are independent, to avoid synchronizing duplicate data, the priority synchronization task first selects M data blocks from the head of the doubly linked list and synchronizes them to the backup controller. The periodic synchronization task then selects N data blocks from the tail of the doubly linked list and synchronizes them to the backup controller, where N = LM. If N is less than 0, it means that the priority synchronization task can complete the synchronization of all data within the current periodic synchronization task's execution cycle, achieving full redundancy for the backup controller's data. In this case, the periodic synchronization task is skipped to reduce resource consumption.

[0036] Furthermore, once a data block is synchronized, it is removed from the doubly linked list, and the corresponding key-value pair is deleted from the hash table. This prevents duplicate synchronization of data blocks and ensures that only unsynchronized data remains in the doubly linked list and hash table in the work controller, achieving a strict distinction between "unsynchronized / synchronized" data and guaranteeing consistency between the two controllers from the data source. It also effectively avoids the fallback synchronization attribute of periodic synchronization tasks, preventing the selection of data blocks already synchronized by priority synchronization tasks, thus ensuring the fallback synchronization effect of periodic synchronization tasks. Simultaneously, in this solution, the work controller dynamically adjusts the data arrangement order of the doubly linked list based on data block modifications, promptly deleting synchronized data blocks. While ensuring dynamic priority, this avoids the problem of unlimited extension of the doubly linked list leading to the backlog of critical data, effectively improving system availability.

[0037] by Figure 2 Taking this example, the implementation of this solution will be explained. The description of this embodiment is only a specific case introduction of this technical solution. The protection scope of this application includes, but is not limited to, the description scope of this embodiment. Other equivalent implementation methods are also within its protection scope. Figure 2 In this process, the work controller divides the redundant data into five equal blocks of a fixed size, and generates key-value pairs for each data block in a hash table. In this embodiment, the number of data blocks synchronized by the priority synchronization task in each cycle is configured as M=2, and the periodic synchronization task is executed once after the priority synchronization task has been executed five times, i.e., x=5.

[0038] In the first cycle, when the priority synchronization task starts, the data blocks in the doubly linked list are sorted from head to tail as ABCDE. At this time, the priority synchronization task selects two data blocks from the head of the doubly linked list and synchronizes them to the backup controller, thus completing the synchronization of data blocks A and B. These two data blocks are then removed from the doubly linked list and the hash table. At this point, the data blocks in the doubly linked list are sorted from head to tail as CDE.

[0039] In the second cycle, data block A and data block B are modified sequentially. Since data block A is modified first, the worker controller queries the hash table. Because the information of data blocks A and B has already been removed from the hash table and doubly linked list in the first cycle, the worker controller directly inserts data block A at the head of the doubly linked list and generates a key-value pair corresponding to data block A in the hash table. After B is modified, the worker controller performs the same operation. At this time, the data blocks in the doubly linked list are ordered BACDE. The priority synchronization task also selects the two data blocks B and A at the head of the doubly linked list, synchronizes them to the backup controller, and removes them from the hash table and doubly linked list. At this point, the data blocks in the doubly linked list are ordered CDE from head to tail.

[0040] In the third and fourth cycles, data block A and data block B are modified one after the other. The operation performed by the work controller is the same as in the second cycle. At the end of the fourth cycle, the data blocks of the doubly linked list are sorted as CDE.

[0041] In the fifth cycle, data blocks A and B are modified again. The working controller inserts them into the head of the doubly linked list in the order of modification, at which point the data blocks in the doubly linked list are ordered as BACDE. In this cycle, the priority synchronization task selects the two data blocks B and A at the head of the doubly linked list and synchronizes them to the backup controller. Furthermore, in this cycle, the periodic synchronization task begins the fallback synchronization of the doubly linked list. Since the number of doubly linked list data blocks to be synchronized this week is L=5, and the priority synchronization task synchronizes M=2 data blocks, the periodic synchronization task synchronizes N=LM=3 data blocks. Therefore, the periodic synchronization task selects three data blocks from the tail of the doubly linked list—data blocks E, D, and C—and synchronizes them to the backup controller. When this cycle is completed, the priority synchronization task and the periodic synchronization task jointly complete the full synchronization of the redundant data blocks in the doubly linked list and clear the doubly linked list, ensuring that the backup controller can dynamically synchronize the latest modified data in each cycle, keeping up with the latest changes from the working controller. The full synchronization of the periodic synchronization task can ensure that the full data synchronization is completed once every 5 cycles, and ensure that low priority data can also be fully synchronized once within a certain cycle, further ensuring the consistency of backup controller data and improving system availability.

[0042] In the sixth cycle, since the data in the doubly linked list has been fully synchronized and no data blocks have been modified in this cycle, both the doubly linked list and the hash table are empty. The priority synchronization task and the periodic synchronization task are skipped directly, and the system waits for the next data modification. The doubly linked list will give you the data blocks before starting again, reducing system resource consumption.

[0043] In another embodiment, if the redundant data blocks have not been modified during the fourth and fifth cycles, then during the fourth cycle, the data blocks in the doubly linked list are ordered as CDE. At this time, the priority synchronization task selects the two data blocks C and D at the head of the doubly linked list, synchronizes them to the backup controller, and removes them from the hash table and the doubly linked list. At the end of the fourth cycle, the doubly linked list will contain only one data block E.

[0044] In the fifth cycle, the periodic synchronization task queries the number of data blocks in the doubly linked list L=1. The priority synchronization task selects the two data blocks at the head of the doubly linked list. Therefore, the number of data blocks selected by the periodic synchronization task N=LM=-1, which is less than 0. Therefore, the periodic synchronization task is skipped directly, and the full data synchronization can be completed within the cycle by using only the priority synchronization task, thus reducing the resource consumption of the periodic synchronization task.

[0045] In another embodiment, such as Figure 4As shown, in the fifth cycle, a new data block F is added to the doubly linked list. At this time, the data blocks in the doubly linked list are ordered as FBACDE. If the maximum number of data blocks that the periodic synchronization task can synchronize in one cycle is 3, and the number of data blocks that the periodic synchronization task needs to synchronize in this cycle is N'=L'-M=4, which is greater than 3, then the periodic synchronization task will select data blocks from the tail of the doubly linked list for synchronization according to the maximum number of data blocks that can be synchronized in a single cycle. That is, it will select 3 data blocks from the tail of the doubly linked list, namely data block E, data block D, and data block C, and synchronize them to the backup controller. Data block A will remain in the doubly linked list, waiting for the next periodic synchronization task to perform a fallback full synchronization. When there are too many redundant data blocks, the latest modified data block will be synchronized through a priority synchronization task to ensure that urgent data can be synchronized to the backup controller in a timely manner. Setting a maximum number of synchronized data blocks for periodic synchronization tasks can effectively ensure that other tasks within the period have enough time to execute, guaranteeing the normal operation of the system. The fallback synchronization completed by multiple periodic synchronization tasks can also ensure that after multiple periodic synchronization tasks, the full synchronization of redundant data to be synchronized on the working controller is completed.

[0046] In summary, the beneficial effects of the method of the present invention are as follows: 1. Fully automatic dynamic redundancy synchronization: No manual intervention is required. Through the linkage of hash table and doubly linked list, it automatically identifies the data modification status and dynamically adjusts the synchronization priority, avoiding the omission of key data caused by manual screening. It ensures data consistency and system stability when switching between primary and backup controllers, and enhances the fault tolerance and availability of the control system.

[0047] 2. Simple and efficient dynamic synchronization mechanism: It adopts a strategy of prioritizing the synchronization of recently modified data to ensure that the state of the standby controller is as close as possible to the working controller, minimizing switching disturbances. At the same time, it utilizes the O(1) time complexity of insertion and deletion operations using hash tables and doubly linked lists, resulting in extremely low algorithm overhead. While ensuring high performance, it does not require any additional hardware costs.

[0048] 3. Full-coverage full-data synchronization mechanism: Through periodic synchronization tasks, low-frequency modified data at the tail of the doubly linked list is synchronized as a fallback, ensuring that data that has not been updated for a long time but still needs to remain consistent is synchronized within a preset period, eliminating the "static data synchronization blind spot" in traditional solutions, and avoiding logical errors caused by long-term data deviations in the backup controller.

[0049] Another embodiment of the present invention provides a controller data dynamic full redundancy device for data synchronization between redundant controllers, comprising: The data partitioning module is used to divide the data to be redundant into several data blocks; The data update module checks whether the modified data block exists in the hash table when any data block is modified. If it exists, the current position of the target data block in the doubly linked list is located through the hash table, the node connection relationship of the doubly linked list is adjusted, and the node corresponding to the target data block is moved to the head of the doubly linked list. If it does not exist, the target data block is inserted at the head of the doubly linked list, and a key-value pair is created in the hash table. The key of the key-value pair is the identifier of the target data block, and the value is a reference to the position of the target data block in the doubly linked list. The priority synchronization module is used to initiate a priority synchronization task, select M data blocks starting from the head of the doubly linked list, and synchronize the selected data blocks to the backup controller. Periodic synchronization module: Used to initiate periodic synchronization tasks, selecting N data blocks starting from the tail of the doubly linked list and synchronizing the selected data blocks to the backup controller.

[0050] This device utilizes a hash table and doubly linked list in the data update module, employing O(1) time complexity for fast location and insertion / moving operations, to automatically identify and dynamically adjust recently modified redundant data blocks. Simultaneously, through priority synchronization tasks for high-time-sensitive data, periodic synchronization tasks for low-frequency data as backup, and immediate data cleanup after synchronization, it achieves real-time data consistency between the two controllers without any synchronization blind spots. Compared to existing technologies, its advanced features lie in completely eliminating reliance on manual experience, achieving fully intelligent and adaptive management of the synchronization process, and achieving full data redundancy without any additional hardware costs while ensuring high performance. This provides an efficient and reliable implementation path for the design of high-reliability industrial control systems.

[0051] A third embodiment of the present invention provides a controller data dynamic full redundancy system, comprising: One or more processors; Computer-readable storage medium for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the method according to any one of claims 1 to 7.

[0052] A fourth embodiment of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.

[0053] It should be noted that any reference numerals placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The words "a" or "an" preceding a component do not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. The use of the terms first, second, third, etc., is for convenience only and does not indicate any order. These terms can be understood as part of the component names.

[0054] Furthermore, it should be noted that in the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0055] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the claims should be interpreted to include both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0056] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, then this invention should also include these modifications and variations.

Claims

1. A dynamic full redundancy method for controller data, applied to data synchronization between redundant controllers, characterized in that, include: The working controller divides the data to be redundant into several data blocks; When any data block in the work controller is modified, the work controller checks whether the modified data block exists in the hash table. If the target data block already exists in the hash table, the work controller locates the current position of the target data block in the doubly linked list through the hash table, adjusts the node connection relationship of the doubly linked list, and moves the node corresponding to the target data block to the head of the doubly linked list. If the target data block does not exist in the hash table, the work controller inserts the target data block into the head of the doubly linked list and creates a key-value pair in the hash table. The key of the key-value pair is the identifier of the target data block, and the value is a reference to the position of the target data block in the doubly linked list. The working controller initiates a priority synchronization task, selects M data blocks starting from the head of the doubly linked list, and synchronizes the selected data blocks to the backup controller. The working controller initiates a periodic synchronization task, selecting N data blocks starting from the tail of the doubly linked list, and synchronizing the selected data blocks to the backup controller.

2. The controller data dynamic full redundancy method according to claim 1, characterized in that, The doubly linked list is a doubly linear data structure that supports insertion and deletion operations with O(1) time complexity, provided that the target node has been located.

3. The controller data dynamic full redundancy method according to claim 2, characterized in that, The doubly linked list is sorted from head to tail according to the time of the most recent modification of the data blocks, with the most recently modified data block located at the head of the doubly linked list.

4. The controller data dynamic full redundancy method according to claim 1, characterized in that, The priority synchronization task and the periodic synchronization task are configured independently, and the duration of the periodic synchronization task is no greater than the maximum allowed duration required for the full synchronization of the redundant data.

5. The controller data dynamic full redundancy method according to claim 4, characterized in that, The periodic synchronization task includes the following steps: Query the number L of data blocks in the doubly linked list; Determine that the data block N=LM is synchronized starting from the tail of the doubly linked list; Determine if N is greater than 0; If N is less than or equal to 0, then skip the periodic synchronization task.

6. The controller data dynamic full redundancy method according to claim 1, characterized in that, After synchronizing the data block to the backup controller, the working controller removes the data block information from the doubly linked list.

7. The controller data dynamic full redundancy method according to claim 1, characterized in that, When the doubly linked list is empty, skip the priority synchronization task and the periodic synchronization task until the doubly linked list generates a new data block and then restarts.

8. A controller data dynamic full redundancy device, used for data synchronization between redundant controllers, characterized in that, include: The data partitioning module is used to divide the data to be redundant into several data blocks; The data update module checks whether the modified data block exists in the hash table when any data block is modified. If it exists, the current position of the target data block in the doubly linked list is located through the hash table, the node connection relationship of the doubly linked list is adjusted, and the node corresponding to the target data block is moved to the head of the doubly linked list. If it does not exist, the target data block is inserted at the head of the doubly linked list, and a key-value pair is created in the hash table. The key of the key-value pair is the identifier of the target data block, and the value is a reference to the position of the target data block in the doubly linked list. The priority synchronization module is used to initiate a priority synchronization task, select M data blocks starting from the head of the doubly linked list, and synchronize the selected data blocks to the backup controller. Periodic synchronization module: Used to start a periodic synchronization task, select N data blocks starting from the tail of the doubly linked list, and synchronize the selected data blocks to the backup controller.

9. A controller data dynamic full redundancy system, characterized in that, include: One or more processors; Computer-readable storage medium for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.