Controller function block redundancy synchronization method, system, and storage medium

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

Patent Information

Application Number
CN202611072117.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-20
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0010]鉴于现有技术的上述缺点、不足,本发明提供一种控制器功能块冗余同步方法、系统及存储介质,旨在实现三重化冗余控制器中功能块内部数据的精准、轻量化同步,解决现有技术中同步数据量大、缺乏功能级映射、组态复杂、故障定位困难的问题

Benefits of technology

1、轻量化同步,显著降低带宽占用和传输延迟:通过为每个功能块分配冗余信息ID并建立映射关系,同步粒度由传统的全局数据降为功能块内部数据,仅传输状态变量、中间计算结果等必要数据,实现数据同步灵活选择。配合专用缓存分区设计和三通道定向同步机制,有效避免了无效数据广播,大幅降低了通道间通信总线负载,缩短了同步周期,满足安全仪表系统对高实时性的要求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122902193A_ABST
    Figure CN122902193A_ABST
Patent Text Reader

Abstract

The application discloses a controller function block redundancy synchronization method and system, which is applied to a controller with at least three redundancy channels. The method comprises the following steps: allocating a redundancy information ID to a function block in the controller, establishing a mapping relationship among the redundancy information ID, a function block address offset and a redundancy cache offset, generating a redundancy information configuration and downloading the redundancy information configuration to each redundancy channel; each channel binds the redundancy information ID to the function block according to the function block address offset; when a user program is executed, the function block reads the redundancy information ID bound thereto, acquires the redundancy cache offset according to the mapping relationship, and writes internal data to a corresponding position of a sending area of the channel; through inter-channel communication, the data of the sending area of the channel are respectively synchronized to a first receiving area of a first adjacent channel and a second receiving area of a second adjacent channel; and the function block reads corresponding data from the first receiving area and the second receiving area of the channel respectively according to the redundancy information ID, and three-channel synchronization is completed. The application further discloses a corresponding redundancy synchronization system and a storage medium. Through function block level accurate mapping and a light synchronization mechanism, the application significantly reduces the amount of synchronization data and the occupation of communication bandwidth, and improves synchronization real-time performance and system maintainability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of industrial automation control technology, specifically relating to a controller function block redundancy synchronization method, system, and storage medium. Background Technology

[0002] In high-safety-level industrial scenarios such as petroleum, chemical, and power industries, Safety Instrumented Systems (SIS) place extremely stringent requirements on the reliability, fault tolerance, and data consistency of controllers. Triple Redundancy (TMR) architecture, due to its superior fault tolerance capabilities, has become the mainstream high-reliability controller solution. In this architecture, the controller contains three independently operating channels, each executing the same user program in parallel. Seamless switching in the event of a single channel failure is achieved through data synchronization and majority voting mechanisms.

[0003] In existing triple-redundant controllers, each channel runs the user program independently, and data such as state variables and intermediate calculation results within the function blocks are stored locally on each channel. To ensure that the backup channel can take over without disruption in the event of a failure in any channel, the data within the function blocks of the working channel must be synchronized to other redundant channels in real time.

[0004] Currently, existing technologies generally employ the following two synchronization methods: The first is the "global variable broadcasting" method, in which each channel periodically broadcasts the entire contents of the entire user program data area to other channels. The second is the "full data cycle synchronization" method, in which the input, output, and internal status data of all function blocks are packaged and transmitted as a whole according to a fixed time period.

[0005] However, the existing solutions mentioned above have the following core flaws: 1. Large amount of synchronized data, high bandwidth consumption, and poor real-time performance: Global broadcast or full synchronization requires the transmission of a large amount of unnecessary data (such as temporary variables and constants that do not need to be synchronized). The bandwidth of the inter-channel communication bus is occupied by a large amount of invalid data. As the number of functional blocks increases, the synchronization cycle is forced to be longer, which seriously affects the real-time response capability of the system.

[0006] 2. Lack of precise mapping at the functional block level, data is prone to corruption: Existing technologies do not have a dedicated synchronization mechanism designed for the data within a single functional block. Data from different functional blocks are stored mixed in the cache, lacking a clear mapping relationship, which can easily lead to data overwriting or incorrect association, resulting in synchronization failure.

[0007] 3. Redundant information is strongly coupled with function block addresses, resulting in complex configuration and poor scalability: Redundant synchronization configuration is usually hard-bound to the absolute address of the function block. When the user program structure changes (such as adding or deleting function blocks), a lot of manual modification of the synchronization configuration is required. The configuration work is cumbersome and prone to errors, and the system expansion and maintenance costs are extremely high.

[0008] 4. Difficulty in fault location: Due to the lack of independent identifiers and mapping relationships at the functional block level, when synchronization anomalies or data inconsistencies occur, maintenance personnel cannot quickly locate which specific functional block or channel has a problem, resulting in extremely low troubleshooting efficiency.

[0009] In summary, existing data synchronization technologies for triple redundant controllers are insufficient to meet the requirements of SIS systems for high real-time performance, high consistency, and easy maintenance of redundant data synchronization due to their coarse synchronization granularity, lack of mapping mechanisms, and rigid configuration methods. Therefore, there is an urgent need for a functional block-level, lightweight, and flexibly configurable data synchronization technology solution. Summary of the Invention

[0010] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a controller function block redundancy synchronization method, system and storage medium, which aims to achieve accurate and lightweight synchronization of data within function blocks in triple redundant controllers, and solve the problems of large synchronization data volume, lack of function level mapping, complex configuration and difficulty in fault location in the prior art.

[0011] To achieve the above objectives, the present invention provides the following solution: a controller function block redundancy synchronization method, applied to a controller with at least three redundant channels, comprising: Assign redundancy information IDs to function blocks in the controller, establish a mapping relationship between redundancy information IDs, function block address offsets and redundancy cache offsets, and generate redundancy information configurations; Download the redundant information configuration to each redundant channel; Each redundant channel binds its corresponding redundant information ID to the functional block based on the address offset of the functional block; When the user program is executed, the function block reads the redundant information ID bound to itself, obtains the corresponding redundant cache offset according to the mapping relationship, and writes the data inside this function block into the redundant cache offset position of the sending area of ​​this channel. Through inter-channel communication, the data in the transmission area of ​​this channel is synchronized to the first receiving area of ​​the first adjacent channel and the second receiving area of ​​the second adjacent channel, respectively. The redundant channel of the function block reads the data at the corresponding redundant buffer offset position from the first and second receiving areas of this channel according to the redundant information ID bound to it, so as to realize the data synchronization of the three channels.

[0012] Furthermore, each redundant channel is equipped with a functional block redundancy buffer, which includes a sending area, a first receiving area, and a second receiving area.

[0013] Furthermore, the sending area is used to store internal data to be synchronized for the functional block of this channel; the first receiving area is used to store data from the sending area of ​​the first adjacent channel; and the second receiving area is used to store data from the sending area of ​​the second adjacent channel.

[0014] Furthermore, the specific method for binding the redundant information ID to the function block includes: calculating the starting address of the function block in the user program data area based on the function block address offset in the redundant information configuration, and writing the corresponding redundant information ID into the specified offset position inside the function block.

[0015] Furthermore, the internal data of the functional block includes at least one or more of the functional block's state variables, intermediate calculation results, and output values.

[0016] Furthermore, after the redundant channel of the functional block reads data from the first receiving area and the second receiving area, it performs a voting update on the three-channel data to ensure the consistency of data within the functional block.

[0017] Furthermore, each redundant channel uses the user program execution cycle as its synchronization cycle, performing data transmission, inter-channel synchronization, and redundant data reading once per cycle.

[0018] The present invention also discloses a controller function block redundancy synchronization system, comprising: Configuration software is used to assign redundancy information IDs to function blocks that need to be synchronized, and to establish a mapping relationship between redundancy information IDs, function block address offsets and redundancy cache offsets, and generate redundancy information configurations. A multi-redundant controller comprising at least three redundant channels, each channel including: The user program data area is used to store function blocks; Function block redundancy buffer, including the sending area, the first receiving area and the second receiving area; The synchronization scheduling module is used to perform the following operations: Based on the downloaded redundant information configuration, bind the corresponding redundant information ID to the function block; When a function block is executed, the mapping relationship is queried according to the redundant information ID bound to the function block, and the data inside the function block is written to the redundant buffer offset position of the sending area of ​​this channel. Through inter-channel communication, the data in the transmission area of ​​this channel is synchronized to the first receiving area of ​​the first adjacent channel and the second receiving area of ​​the second adjacent channel, respectively. The redundant channel of the function block reads the data at the corresponding redundant buffer offset position from the first and second receiving areas of this channel according to the redundant information ID bound to it, so as to realize the data synchronization of the three channels.

[0019] Furthermore, the functional block redundancy buffer includes a sending area, a first receiving area, and a second receiving area; the sending area is used to store data to be synchronized in this channel, and the first receiving area and the second receiving area are used to store data from the first adjacent channel and the second adjacent channel, respectively.

[0020] The present invention also discloses a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.

[0021] The beneficial effects of this application are: 1. Lightweight synchronization significantly reduces bandwidth consumption and transmission latency: By assigning redundant information IDs to each functional block and establishing a mapping relationship, the synchronization granularity is reduced from traditional global data to data within the functional block. Only necessary data such as state variables and intermediate calculation results are transmitted, enabling flexible selection of data synchronization. Combined with a dedicated cache partition design and a three-channel directional synchronization mechanism, invalid data broadcasting is effectively avoided, significantly reducing the load on the inter-channel communication bus, shortening the synchronization cycle, and meeting the high real-time requirements of safety instrumented systems.

[0022] 2. Flexible configuration and strong system maintainability: A three-dimensional mapping of redundancy information ID, function block address offset, and redundancy cache offset is established through configuration software, decoupling redundancy synchronization configuration from function block addresses. When adding, deleting, or adjusting function blocks, only the configuration table needs to be updated; there is no need to modify the underlying synchronization logic or recompile the user program. Simultaneously, each function block has an independent redundancy information ID, allowing for rapid location of the specific function block and channel in case of synchronization anomalies, significantly reducing system maintenance and troubleshooting time.

[0023] 3. Robust Data Consistency Guarantee Mechanism: Each channel's synchronization scheduling module uses the user program execution cycle as its synchronization cycle. Within each cycle, it completes data transmission, inter-channel synchronization, and redundant data reading, ensuring continuous consistency of data across the three channels. After reading the data from the three channels, the function block effectively shields data deviations introduced by single-channel failures or communication anomalies through three-channel voting, providing a reliable data foundation for seamless switching and ensuring the safety and availability of the control system. Attached Figure Description

[0024] This application is described with reference to the following figures: Figure 1 A flowchart of the controller function block redundancy synchronization method of this application is shown; Figure 2 The flowchart for binding redundant information IDs in this application is shown; Figure 3 A schematic diagram of redundant channel data transmission in this application is shown; Figure 4The diagram shows the redundant synchronization data structure and mapping relationship of the functional blocks in this application. Detailed Implementation

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

[0026] As the background technology indicates, in the field of industrial automation control, traditional global variable broadcasting or full-data-cycle synchronization methods in triple-redundant controllers suffer from problems such as large synchronization data volume, high bandwidth consumption, poor real-time performance, lack of precise function block-level mapping leading to data corruption, and strong coupling between redundant information and function block addresses resulting in complex configuration and poor scalability. These issues make it difficult to meet the stringent requirements of safety instrumented systems for accurate, real-time, and maintainable synchronization of redundant data. Therefore, there is an urgent need for a technical solution with precise function block-level mapping, a lightweight synchronization mechanism, and flexible configuration to achieve efficient and reliable synchronization of data within the three-channel function blocks.

[0027] To address the aforementioned issues, this application provides a controller function block redundancy synchronization method and system. By assigning redundancy information IDs to function blocks and establishing a three-dimensional mapping between IDs and address offsets and cache offsets, precise synchronization and flexible configuration at the function block level are achieved. This enables high real-time synchronization of internal state data between three channels with extremely low bandwidth overhead, effectively ensuring the security and availability of the control system. Specific methods are as follows: Figure 1 As shown, it includes: S1: Assign redundancy information IDs to function blocks in the controller, establish a mapping relationship between redundancy information IDs, function block address offsets and redundancy cache offsets, and generate redundancy information configuration.

[0028] Redundancy information configuration is generated by configuration software. Users write user programs using this software, which contain multiple function blocks. Each function block occupies a contiguous address space in the controller's memory, storing its input parameters, output values, state variables, and intermediate calculation results. Based on the structure of the user program, the configuration software assigns a unique redundancy information ID to each function block that needs to participate in redundancy synchronization. This redundancy information ID is the core index for achieving precise function block-level synchronization in this invention. The configuration software assigns a unique redundancy information ID to each function block in the controller that needs to participate in redundancy synchronization. This redundancy information ID remains globally unique across all redundant channels of the same controller and will not conflict due to identical function block names or changes in program structure.

[0029] Meanwhile, the configuration software establishes a record for each function block assigned a redundancy information ID. This record contains a three-dimensional mapping relationship between three core fields: redundancy information ID, function block address offset, and redundancy cache offset. This decouples and associates the logical identifier (redundancy information ID), storage location (function block address offset), and synchronization location (redundancy cache offset) of the function block. This means that synchronization operations no longer depend on the absolute address or name of the function block, but are indexed by the redundancy information ID. When the function block address changes, only the address offset field in the configuration table needs to be updated; there is no need to modify the function block logic or reallocate the redundancy information ID, significantly reducing system maintenance costs. Furthermore, the redundancy information ID refines the synchronization granularity to individual function blocks, synchronizing only those configured with redundancy information IDs, fundamentally eliminating the transmission of invalid data.

[0030] S2: Download the redundant information configuration to each redundant channel.

[0031] After the redundancy information configuration is generated in the configuration software, it needs to be downloaded to each independent channel of the multi-redundancy controller. Each channel of the multi-redundancy controller is configured independently, with its own processor, memory, etc. The configuration software needs to download the same redundancy information configuration to each channel to ensure that the data in each channel is completely consistent.

[0032] S3: Each redundant channel binds its corresponding redundant information ID to the functional block based on the address offset of the functional block. Further, the specific method is as follows... Figure 2 As shown, it includes: S301: The synchronous scheduling module sequentially reads a redundant information configuration record from the configuration table and extracts three core fields: redundant information ID, function block address offset, and redundant cache offset.

[0033] S302: Based on the function block address offset in the redundancy information configuration, calculate the starting address of the function block in the user program data area. The synchronization scheduling module obtains the base address of the current channel's user program data area and, combined with the function block address offset in the redundancy information configuration, determines the starting address of the function block in the user program data area. For example, if the base address of the user program data area is 0x40000000H and the address offset of a function block in the configuration table is 0x1028H, then the starting address of the function block in memory is 0x40001028H. Through this calculation, the configuration table associates the logical mapping of the function block with its actual physical storage location.

[0034] S303: Write the corresponding redundant information ID to the specified offset position inside this function block.

[0035] By binding redundant information IDs to function block address offsets, the redundant information IDs are written into the function block itself. This allows the function block to read its own ID during operation without relying on an external context, and independently complete mapping queries and data synchronization, thus decentralizing the synchronization logic. Furthermore, since the redundant information ID binding depends on the address offset rather than the absolute address, changes in the user program's data area base address will not affect the binding result. As long as the address offset remains unchanged, the configuration does not need to be regenerated to complete the binding, enhancing the system's adaptability.

[0036] S4: When the user program is executed, the function block reads the redundant information ID bound to itself, obtains the corresponding redundant cache offset according to the mapping relationship, and writes the data inside this function block into the redundant cache offset position of the sending area of ​​this channel.

[0037] In a multi-redundant controller, each channel independently runs the same user program. During user program execution, the generated data within the function block is stored in the redundancy buffer offset within that channel, enabling redundant channels to process and store data. Furthermore, the data within the function block includes at least one or more of the following types of function blocks: State variables: State information that a function block needs to maintain across multiple consecutive execution cycles, such as cumulative values, current timer values, edge detection flags, and historical sampled values. These variables reflect the function block's execution history and are the basis for the continuity of the function block's behavior.

[0038] Intermediate calculation results: Intermediate variables generated by the function block during algorithm execution. Although these variables are not directly output, if the backup channel lacks these intermediate values ​​during fault switching, it may cause output jumps or slower algorithm convergence.

[0039] Output value: The output signal generated by the function block's calculations. Although the output value can usually be obtained externally through the output pin, it is more efficient to read and synchronize it directly from inside the function block, and it avoids the complexity of pin mapping.

[0040] Furthermore, based on the function block address offset and the redundant cache offset, the synchronization data is written to the specified position in the transmission area of ​​this channel, waiting for data synchronization with other channels.

[0041] S5: Through inter-channel communication, synchronize the data in the sending area of ​​this channel to the first receiving area of ​​the first adjacent channel and the second receiving area of ​​the second adjacent channel, respectively. After all functional blocks have completed writing the data in their sending areas, prepare the data to be synchronized in the sending areas. Since the data in the sending areas is the latest internal data just written by each functional block in the current user program cycle, the data in the sending areas at this time represents a complete state snapshot of this channel in this cycle.

[0042] Furthermore, each redundant channel internally includes a function block redundancy buffer, comprising: a sending area, a first receiving area, and a second receiving area. The sending area stores internal data to be synchronized for the function block of this channel; the first receiving area stores data from the sending area of ​​the first adjacent channel; and the second receiving area stores data from the sending area of ​​the second adjacent channel. This is illustrated using a three-channel redundant controller as an example. Figure 3 The three channels shown are Channel A, Channel B, and Channel C. Each channel includes a sending area, a first receiving area, and a second receiving area. Taking Channel A as an example, it includes a sending area A, used to store the data stored in Channel A, and is communicatively linked to the first receiving area of ​​Channel B and the second receiving area of ​​Channel C, respectively, for sending the data stored in sending area A to Channel B and Channel C. The first receiving area of ​​Channel A is linked to the sending area of ​​Channel C, used to receive data sent by Channel A to sending area C. The second receiving area of ​​Channel A is linked to the sending area of ​​Channel B, used to receive data from sending area B. Each channel holds a copy of the data from all three channels, providing a complete data foundation for subsequent three-channel data voting and consistency updates.

[0043] by Figure 4 Taking this as an example, the steps for data synchronization between channels are explained in detail.

[0044] S501: Initiate inter-channel communication. The synchronization scheduling module sends the data in the sending area to two adjacent target channels simultaneously through the inter-channel communication bus.

[0045] S502: Receive data from adjacent target channels. If it is the first adjacent channel, write the received data of that channel into the first receiving area; if it is the second adjacent channel, write the data of that channel into the second receiving area. For example... Figure 4 As shown, since the sending area, the first receiving area, and the second receiving area use the exact same offset rule, the redundant buffer offset value corresponding to the same functional block is 0x30H. When this channel sends data, it retrieves the data from the 0x30H position in the sending area, and the target channel directly writes it to the 0x30H position in the receiving area after receiving it. The data of the same functional block is stored in the sending area and each receiving area in a completely corresponding location, without the need for any address translation or offset remapping calculation, which simplifies the synchronization logic and improves transmission efficiency.

[0046] By physically separating the sending and receiving areas, the function blocks of this channel are written only to the sending area, the synchronization scheduling module is written only to the receiving area, and the function blocks read only from both the sending and receiving areas. Each data stream has a clear direction and does not intersect, fundamentally avoiding read / write conflicts. This eliminates the need for mutexes or semaphores for protection, simplifies software design, and eliminates the risks of blocking and priority inversion caused by locking. Furthermore, the physical isolation of the two receiving areas ensures that data from two different source channels automatically falls into their respective independent storage areas, without the need for software tags or additional fields to distinguish data sources. When reading data, the function blocks automatically identify that data in the first receiving area comes from the first adjacent channel, and data in the second receiving area comes from the second adjacent channel, simplifying the implementation of voting logic.

[0047] Furthermore, after data transmission is completed, the data receiving channel sends a data transmission acknowledgment frame to the data sending channel to indicate whether data transmission has been completed. If the data sending channel does not receive an acknowledgment signal from any target channel within a preset timeout period, it determines that the synchronization of that target channel has failed and records the fault status. Simultaneously, after data transmission is complete, the data receiving channel also verifies the received data packets, for example, by using a CRC checksum to verify data integrity. If the verification fails, the data packet is discarded and a retransmission is requested from the source channel. If multiple retransmissions still fail, the synchronization link of that channel is determined to be faulty, and the fault handling process begins.

[0048] By using data transmission acknowledgment frames and data packet verification, the system's fault tolerance is enhanced. Data transmission acknowledgment frames enable the channel to perceive the target channel's reception status in real time, quickly identifying and isolating problematic links in the event of communication anomalies or target channel failures, preventing data loss from impacting system security. Data packet verification, through methods such as CRC checks, ensures that no bit errors, packet loss, or out-of-order delivery occur during transmission, comprehensively guaranteeing the integrity and correctness of synchronized data from the physical layer to the data link layer. The combined efforts of these two methods enable the inter-channel synchronization links to possess fault self-detection and self-isolation capabilities, while simultaneously ensuring the accuracy of the data sources participating in the three-channel voting. This fundamentally eliminates the risk of voting bias or malfunctions caused by data transmission errors, providing crucial support for the high reliability and determinism of the safety instrumented system.

[0049] S6: The redundant channel of the function block reads the corresponding redundant cache offset position data from the first and second receiving areas of this channel according to its bound redundant information ID, realizing three-channel data synchronization. The function block first reads its bound redundant information ID, which is written into the specified offset position inside the function block in step S3. The read at runtime is a pure memory access with extremely low overhead. The function block uses the redundant information ID as an index to query the local redundant information configuration table to obtain the corresponding redundant cache offset, and then reads data from the three partitions respectively: reads the internal data generated by this channel in this cycle from the sending area of ​​this channel, reads the data of the first adjacent channel from the first receiving area, and reads the data of the second adjacent channel from the second receiving area. The three partitions use the same offset rule, and the same redundant cache offset can simultaneously locate the corresponding data position in the three partitions without any address translation. After obtaining the three sets of data, the function block performs a two-out-of-three majority vote, taking at least two consistent values ​​as the result. During the voting process, if the data of a certain channel deviates from the other two channels for several consecutive cycles, the system automatically marks it as a faulty channel and removes it from the subsequent vote. The voting result serves as the final internal data for this functional block in the current cycle, directly updating the block's state variables, intermediate calculation results, and output values. Data voting updates for each functional block are executed independently, achieving a decentralized voting architecture and eliminating the single point of failure risk of centralized voting. The voting mechanism itself possesses both fault tolerance and fault diagnosis capabilities, ensuring that the three-channel data converges consistently at the end of each cycle, providing a reliable data foundation for seamless switching of the SIS system.

[0050] Furthermore, each redundant channel uses the user program execution cycle as its synchronization cycle, performing data transmission, inter-channel synchronization, and redundant data reading once per cycle. Each redundant channel uses the user program execution cycle as its synchronization cycle, sequentially performing these three operations within each cycle, forming a complete synchronization closed loop. After each functional block completes its logical operation, it immediately writes its internal data into the transmission area of ​​its respective channel, ensuring that the transmission area always retains the latest calculation results within the current cycle. Once all functional blocks have completed execution, the synchronization scheduling module centrally initiates inter-channel synchronization, simultaneously pushing the data from the transmission area to the receiving areas of adjacent channels. Subsequently, the functional blocks read redundant data from the receiving areas and complete the three-channel voting, achieving data consistency fusion. Because the redundant channels within a functional block have identical configuration programs and consistent execution cycles, the synchronization cycle is combined with the user program execution cycle, eliminating the need for additional timed scheduling or external trigger signals. The synchronization operation is driven by the program's execution progress, making timing management simple and reliable. Each operation is executed exactly once per cycle, with a fixed execution frequency and predictable duration. The load on the inter-channel communication bus is stable and controllable, with no sudden traffic spikes or unpredictable delays, meeting the stringent deterministic time requirements of the SIS system. Data within each functional block completes a full synchronization loop within each cycle, with a fixed synchronization delay of one user program cycle, ensuring data freshness. Furthermore, any reception anomalies during the synchronization phase of any channel can be immediately detected and fault handling triggered in the subsequent voting phase, without waiting for additional heartbeats or timeout cycles, resulting in more timely fault response. This design seamlessly embeds the synchronization function into the user program's time frame, achieving forced convergence and consistency of the three channels' data within each cycle with extremely low scheduling overhead, providing deterministic and high real-time data assurance for seamless handover.

[0051] In summary, the beneficial effects of the method of the present invention are as follows: 1. Lightweight Synchronization, Precise Synchronization at the Function Block Level: By assigning redundant information IDs to each function block and establishing a mapping relationship, the synchronization granularity is reduced from traditional global data to data within the function block. Only necessary data such as state variables and intermediate calculation results are transmitted, enabling flexible selection of data synchronization. Combined with the partitioned buffer design of the sending area, first receiving area, and second receiving area, invalid data occupancy of the inter-channel communication bus is eliminated, significantly reducing transmission latency and meeting the high real-time requirements of SIS systems.

[0052] 2. Flexible configuration and strong system maintainability: A three-dimensional mapping of redundancy information ID, function block address offset, and redundancy cache offset is established through configuration software, decoupling redundancy synchronization configuration from function block addresses. The logical identifier (redundancy information ID), storage location (function block address offset), and synchronization location (redundancy cache offset) of a function block are decoupled and associated. This means that synchronization operations no longer depend on the absolute address or name of the function block, but are indexed by the redundancy information ID. When the function block address changes, only the address offset field in the configuration table needs to be updated; there is no need to modify the function block logic or reallocate the redundancy information ID, significantly reducing system maintenance costs. Furthermore, each function block has an independent redundancy information ID, allowing for quick location of the specific function block and channel in case of synchronization anomalies, greatly reducing system maintenance and troubleshooting time.

[0053] 3. Robust Data Consistency Guarantee Mechanism: The sending area, first receiving area, and second receiving area are physically isolated, with clear read / write data flow directions, eliminating the need for locking protection and the risks of blocking and contention. The synchronization cycle is bound to the user program execution cycle, with each operation executed once within each cycle. Execution time is predictable, and communication load is stable and controllable, meeting the stringent time requirements of safety instrumented systems. Each channel synchronization scheduling module uses the user program execution cycle as its synchronization cycle, completing data transmission, inter-channel synchronization, and redundant data reading within each cycle to ensure continuous consistency of data across the three channels. After reading data from the three channels, the function block uses a three-channel voting process to effectively shield against data deviations introduced by single-channel failures or communication anomalies, providing a reliable data foundation for seamless switching and ensuring the safety and availability of the control system.

[0054] In another embodiment of the present invention, a controller function block redundancy synchronization system is also disclosed, comprising: Configuration software is used to assign redundancy information IDs to function blocks that need to be synchronized, and to establish a mapping relationship between redundancy information IDs, function block address offsets and redundancy cache offsets, and generate redundancy information configurations. A multi-redundant controller comprising at least three redundant channels, each channel including: The user program data area is used to store function blocks; Function block redundancy buffer, including the sending area, the first receiving area and the second receiving area; The synchronization scheduling module is used to perform the following operations: Based on the downloaded redundant information configuration, bind the corresponding redundant information ID to the function block; When a function block is executed, the mapping relationship is queried according to the redundant information ID bound to the function block, and the data inside the function block is written to the redundant buffer offset position of the sending area of ​​this channel. Through inter-channel communication, the data in the transmission area of ​​this channel is synchronized to the first receiving area of ​​the first adjacent channel and the second receiving area of ​​the second adjacent channel, respectively. The redundant channel of the function block reads the data at the corresponding redundant buffer offset position from the first and second receiving areas of this channel according to the redundant information ID bound to it, so as to realize the data synchronization of the three channels.

[0055] Furthermore, the functional block redundancy buffer includes a sending area, a first receiving area, and a second receiving area; the sending area is used to store data to be synchronized in this channel, and the first receiving area and the second receiving area are used to store data from the first adjacent channel and the second adjacent channel, respectively.

[0056] The redundant synchronization system disclosed in this application organically integrates the generation and distribution of redundant information configuration, function block ID binding, data transmission, inter-channel synchronization, and voting updates, achieving fully automated management of the entire process from configuration to runtime synchronization. In the system architecture, the configuration software, as the configuration entry point, decouples redundant information from function block addresses, simplifying the complexity of engineering configuration. The user program data area and function block redundancy cache within each channel are divided into a sending area, a first receiving area, and a second receiving area, working closely with the synchronization scheduling module. The physical isolation design between the sending and receiving areas eliminates the need for locking during data reading and writing, avoiding concurrent conflicts. The synchronization scheduling module uniformly coordinates data transmission, inter-channel synchronization, and redundant data reading, automatically completing a full synchronization loop within each user program cycle without manual intervention. Simultaneously, the system adopts a distributed synchronization architecture. The synchronization scheduling module is responsible for data transfer between channels, while the voting logic is executed independently by each function block, ensuring the reliability of data aggregation and eliminating the single point of failure risk of centralized voting. The system can be deployed without changing the user program logic, has good compatibility with existing engineering projects, and the function of the synchronous scheduling module is naturally aligned with the execution cycle of the user program. It has extremely low real-time overhead and predictable time behavior, making it suitable for safety instrumented application scenarios with stringent deterministic requirements.

[0057] A third embodiment of the present invention discloses a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.

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

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

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

[0061] 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 controller function block redundancy synchronization method, applied to a controller with at least three redundant channels, characterized in that, include: Assign redundancy information IDs to function blocks in the controller, establish a mapping relationship between redundancy information IDs, function block address offsets and redundancy cache offsets, and generate redundancy information configurations; Download the redundant information configuration to each redundant channel; Each redundant channel binds its corresponding redundant information ID to the functional block based on the address offset of the functional block; When the user program is executed, the function block reads the redundant information ID bound to itself, obtains the corresponding redundant cache offset according to the mapping relationship, and writes the data inside this function block into the redundant cache offset position of the sending area of ​​this channel. Through inter-channel communication, the data in the transmission area of ​​this channel is synchronized to the first receiving area of ​​the first adjacent channel and the second receiving area of ​​the second adjacent channel, respectively. The redundant channel of the function block reads the data at the corresponding redundant buffer offset position from the first and second receiving areas of this channel according to the redundant information ID bound to it, so as to realize the data synchronization of the three channels.

2. The redundancy synchronization method according to claim 1, characterized in that, Each redundant channel is equipped with a functional block redundancy buffer, which includes a sending area, a first receiving area, and a second receiving area.

3. The redundancy synchronization method according to claim 2, characterized in that, The sending area is used to store internal data to be synchronized for the functional blocks of this channel; the first receiving area is used to store data from the sending area of ​​the first adjacent channel; and the second receiving area is used to store data from the sending area of ​​the second adjacent channel.

4. The redundancy synchronization method according to claim 3, characterized in that, The specific method for binding the redundancy information ID to the function block includes: calculating the starting address of the function block in the user program data area based on the function block address offset in the redundancy information configuration, and writing the corresponding redundancy information ID into the specified offset position inside the function block.

5. The redundancy synchronization method according to claim 1, characterized in that, The internal data of the function block includes at least one or more of the following: the function block's state variables, intermediate calculation results, and output values.

6. The method according to claim 1, characterized in that, After the redundant channel of the functional block reads data from the first receiving area and the second receiving area, it performs a voting update on the data of the three channels to ensure the consistency of data within the functional block.

7. The redundancy synchronization method according to claim 1, characterized in that, Each redundant channel uses the user program execution cycle as its synchronization cycle, performing data transmission, inter-channel synchronization, and redundant data reading once per cycle.

8. A controller functional block redundancy synchronization system, characterized in that, include: Configuration software is used to assign redundancy information IDs to function blocks that need to be synchronized, establish a mapping relationship between redundancy information IDs, function block address offsets and redundancy cache offsets, and generate redundancy information configurations. A multi-redundant controller comprising at least three redundant channels, each channel including: The user program data area is used to store function blocks; Function block redundancy buffer, including the sending area, the first receiving area and the second receiving area; The synchronization scheduling module is used to perform the following operations: Based on the downloaded redundant information configuration, bind the corresponding redundant information ID to the function block; When a function block is executed, the mapping relationship is queried according to the redundant information ID bound to the function block, and the data inside the function block is written to the redundant buffer offset position of the sending area of ​​this channel. Through inter-channel communication, the data in the transmission area of ​​this channel is synchronized to the first receiving area of ​​the first adjacent channel and the second receiving area of ​​the second adjacent channel, respectively. The redundant channel of the function block reads the data at the corresponding redundant buffer offset position from the first and second receiving areas of this channel according to the redundant information ID bound to it, so as to realize the data synchronization of the three channels.

9. The redundant synchronization system according to claim 8, characterized in that, The functional block redundancy buffer includes a sending area, a first receiving area, and a second receiving area; the sending area is used to store data to be synchronized in this channel, and the first receiving area and the second receiving area are used to store data from the first adjacent channel and the second adjacent channel, respectively.

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.