Data acquisition gateway hot redundancy system and hot redundancy method of industrial control system

By introducing a thermal redundant system that controls gateways and data acquisition gateways into the industrial control system, data synchronization is achieved using MQTT and Redis clusters, the problem of intermediate variable synchronization after data acquisition gateway failure is solved, and the system reliability and data consistency are improved.

CN120498970APending Publication Date: 2025-08-15TIANJIN CAPITAL ENVIRONMENTAL PROTECTION GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510815558.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

After the data acquisition gateway in the existing industrial control system fails, it is impossible to ensure the synchronization of intermediate variables, resulting in the unavailability time of the control system during redundant switching, and the existing thermal redundant configuration cannot ensure the consistency of the data acquisition and control process.

Method used

The thermal redundant system that controls the gateway and the data acquisition gateway is adopted to transmit registration, heartbeat and switching messages through the MQTT service, combines the Redis cluster to store intermediate variables, and uses the Keepalived service to provide a unified IP address to ensure synchronization and quick switching of the master and backup devices of the data acquisition gateway.

Benefits of technology

It realizes rapid redundant switching of the data acquisition gateway, ensures timely synchronization of intermediate variables, reduces unavailable time of the control system, improves system reliability and data consistency, and simplifies the implementation of thermal redundancy control functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120498970A_ABST
    Figure CN120498970A_ABST
Patent Text Reader

Abstract

The invention provides a data acquisition gateway hot redundancy system and hot redundancy method of an industrial control system. The data acquisition gateway hot redundancy system comprises a control gateway and a plurality of sets of data acquisition gateways, the control gateway is provided with an MQTT service, a database and a hot redundancy registration service; the data acquisition gateway is provided with a hot redundancy client service; each set of data acquisition gateway comprises at least two data acquisition gateways, main and standby registration is carried out on the control gateway through a hot redundancy registration service, and a data acquisition gateway registration message, a data acquisition gateway hop message, a main and standby switching message and a database storage message are transmitted through an MQTT service. According to the invention, the problem that the synchronization of the intermediate variables cannot be ensured after the data acquisition gateway in the industrial control system network fails is avoided, the redundant equipment of the data acquisition gateway can quickly replace the original data acquisition gateway, the intermediate variables are synchronized in time, and the unavailable time of the control system in an overlong adaptation stage caused by redundancy switching is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and in particular relates to a data acquisition gateway hot redundancy system and a hot redundancy method for an industrial control system. Background Art

[0002] The industrial control system network is configured with a control gateway and an edge gateway. The control gateway (server) provides the control system, and the edge gateway (data acquisition gateway) is responsible for data acquisition. It also provides simple control programs for some production equipment. After the edge gateway is deployed, it needs to continuously collect data and control the production equipment through the simple control program. The control gateway controls all edge gateways.

[0003] Industrial control systems can become unavailable due to network, equipment hardware, and software issues, leading to data acquisition and control system failures. This can cause significant production accidents and economic losses. Therefore, it's essential to configure a hot-redundant system for industrial control systems.

[0004] In the existing technology, the control gateway can perform hot redundancy of the control system through program frameworks such as Nginx, and the data acquisition gateway registers the gateway and allocates the primary and backup gateways through the Netty service, and performs online judgment and automatic switching through the heartbeat mechanism provided by Netty.

[0005] The hot redundancy configuration described above in the prior art only ensures data consistency between the control system and the primary and backup systems, but cannot guarantee synchronization of variables during the data acquisition and control process. In particular, after the data acquisition gateway switches between primary and backup, the backup hardware or system requires a long adaptation time before it can properly operate. Summary of the Invention

[0006] The present invention proposes a data acquisition gateway hot redundancy system and hot redundancy method for an industrial control system.

[0007] To achieve the above object, the technical solution of the present invention is achieved as follows:

[0008] A data acquisition gateway hot redundancy system for an industrial control system includes a control gateway and several sets of data acquisition gateways; the control gateway is installed with an MQTT service, a database, and a hot redundancy registration service; the data acquisition gateway is installed with a hot redundancy client service;

[0009] Each data acquisition gateway includes at least two data acquisition gateways, which are registered as active and standby in the control gateway through the hot redundancy registration service, and transmit data acquisition gateway registration messages, data acquisition network jump messages, active and standby switch messages, and database storage messages through the MQTT service;

[0010] The database stores intermediate variables of the data acquisition and control process, and provides real-time and periodic data calls to the data acquisition gateway.

[0011] Furthermore, the control gateway installs the Keepalived service and provides a unified IP address to the outside world.

[0012] Furthermore, there are at least two control gateways, each providing hot redundancy.

[0013] Furthermore, the control gateway installs the Nodered main program, and the data acquisition gateway installs the data acquisition service implemented by Nodered visual programming.

[0014] Furthermore, the database uses Redis cluster to implement data storage.

[0015] Another aspect of the present invention further provides a hot redundancy method using the above-mentioned data acquisition gateway hot redundancy system, comprising:

[0016] S1. The data acquisition gateway connects to the hot redundancy registration service of the control gateway through the hot redundancy client service to perform hot redundancy registration. The first device to register is the main device, and the later device to register is the backup device.

[0017] S2. The data acquisition gateway regularly sends data acquisition gateway status check heartbeat information to the control gateway via MQTT; the control gateway receives the heartbeat information and determines the status of the primary device. If the primary device is abnormal, it sends a master-slave switch message to the backup device via MQTT;

[0018] S3. The data acquisition gateway sends database storage messages through MQTT to save the intermediate variables of the data acquisition and control process into the database. When the data acquisition gateway starts, it pulls the latest intermediate variable values from the database through MQTT and saves them locally. During the data acquisition process, MQTT is called regularly to synchronize the locally saved intermediate variables to the database.

[0019] Furthermore, in step S1, the data acquisition gateway judges based on the information returned by the control gateway. If the returned information is the master device, the data acquisition gateway automatically starts a Netty service to wait for other backup data acquisition gateways to register; if the returned information is the backup device, the data acquisition gateway actively connects to the Netty service of the gateway group where it is located, and synchronizes the configuration and intermediate variable information of the master device.

[0020] Furthermore, the control gateway installs the Keepalived service and provides a unified IP address to the outside world, and the data acquisition gateway performs hot redundancy registration through the IP address.

[0021] Furthermore, the control gateway is installed with the Nodered main program, and the data acquisition gateway is installed with the data acquisition service realized by Nodered visual programming, and the PLC and point data to be collected are configured according to the actual business situation.

[0022] Furthermore, the database uses a Redis cluster to implement data storage, and the main gateway and the backup gateway of the data acquisition gateway are connected to different Redis nodes respectively.

[0023] Compared with the prior art, the present invention has the following beneficial effects:

[0024] 1. The present invention avoids the problem of being unable to ensure the synchronization of intermediate variables after the data acquisition gateway in the industrial control system network fails. The redundant equipment of the data acquisition gateway can quickly replace the original data acquisition gateway and synchronize the intermediate variables in time, reducing the unavailability time of the control system due to the long adaptation phase caused by redundant switching.

[0025] 2. The present invention uses MQTT to realize the transmission of data acquisition network care jump messages, master-slave switching messages and intermediate variable database storage messages, thereby achieving lightweight, simplified and easy-to-implement hot redundancy control functions.

[0026] 3. The present invention uniformly exposes a new virtual IP address as the only IP of the control gateway for external services through the Keepalived service, thereby ensuring the security of the control gateway used for hot redundancy registration.

[0027] 4. The present invention realizes the control of the data acquisition process through Nodered visual programming, which can easily create and modify the process of data acquisition process and the process of intermediate variable storage, and adjust the hot redundancy function settings in real time according to needs.

[0028] 5. The present invention realizes the data storage function of the database through the Redis cluster, realizes the synchronization and disaster recovery of cached data through the cluster method, and ensures the security of data. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 This is a diagram of a hot redundancy structure of a control gateway according to an embodiment of the present invention;

[0030] Figure 2 This is a schematic diagram of the hot redundancy registration process of the data acquisition gateway according to an embodiment of the present invention;

[0031] Figure 3 Schematic diagram of a data acquisition gateway hot redundancy system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0033] The key design concept of this invention is to synchronize the collected data between the primary and backup devices of the data acquisition gateway through a hot redundancy system, and to control synchronization through heartbeat messages. The primary and backup devices of the data acquisition gateway use the same input data and control programs, ensuring that key variables (intermediate variables) and control states remain consistent during the primary-backup switchover. This consistency is further ensured through regular data consistency checks.

[0034] In order to make the purpose and features of the present invention more obvious and easy to understand, the present invention is further described below with reference to the accompanying drawings and specific embodiments.

[0035] This embodiment is primarily used in a sewage treatment plant. Its plant-level industrial control system consists of two hardware devices: a control gateway device (server) and a data acquisition gateway device (small host). There are at least two control gateways, each with independent hot redundancy. Several data acquisition gateways are deployed, with n sets deployed based on actual business needs. Each set consists of at least two data acquisition gateways, each with independent hot redundancy.

[0036] Control gateway devices such as Figure 1 As shown in the figure, hot redundancy and load balancing are achieved through the Nginx gateway. Figure 1 Three control gateways are set up in the system. The Nginx gateway polls the three control gateways through the load balancing control module. If the control gateway one is abnormal, it will be transferred to the control gateway two. If the control gateway two is abnormal, it will be transferred to the control gateway three. In this way, hot redundancy and load balancing are achieved.

[0037] The control gateway device installs MQTT services, databases, Nodered services and other middleware services, hot redundancy registration services and system customization services; the data acquisition gateway installs Nodered data acquisition services and hot redundancy client services.

[0038] Each control gateway can also install the Keepalived service. The Keepalived service is designed based on the VRRP protocol and can combine multiple routers into a single virtual router, providing a unified external IP address. After each control gateway is configured with the Keepalived service, a new virtual IP address is uniformly exposed as the control gateway's unique external service IP. Other services only need to connect to this virtual IP. If one control gateway goes offline, the Keepalived service automatically selects an online backup control gateway as the primary gateway, without affecting the overall control gateway service.

[0039] According to Figure 2As shown in the hot redundancy registration process, after the control gateway is started, log in to the control gateway system and select the data gateway management module. A gateway configuration interface will appear to configure all data acquisition gateway devices and create the corresponding data acquisition gateway group and data acquisition gateway information.

[0040] After the data acquisition gateway is started, log in to the system and pass the authorization code authentication. The hot redundancy client will automatically start and read the local SN code and IP address and other information. It will then send a registration message to the unique virtual IP exposed by the control gateway via MQTT to register the gateway. If the device information is consistent with the information configured on the control gateway, the registration is successful and the master / slave status of the data acquisition gateway will be returned. If the data acquisition gateway is the first registered device in the data acquisition gateway group, it will be identified as the master device in the data acquisition gateway group. If a master device already exists, it will be identified as the backup device in the data acquisition gateway group.

[0041] At the same time, the data acquisition gateway determines the status of the master device based on the information returned by the control gateway. If the response indicates that the device is the master, the data acquisition gateway automatically starts a Netty service to wait for the other backup data acquisition gateways to register. If the response indicates that the device is the backup, the data acquisition gateway proactively connects to the Netty service in its data acquisition gateway group and synchronizes the master device's configuration, intermediate variables, and other information. This process continues until all data acquisition gateway devices are powered on and complete the hot redundancy registration process, including device registration and master / backup assignment.

[0042] In this embodiment, the intermediate variables of the main and backup devices of the data acquisition gateway are all stored in the Redis cluster, and the storage process is to send database messages through MQTT for storage. Among them, the main device and backup device of the data acquisition gateway are respectively connected to different Redis nodes, and the synchronization and disaster recovery of cached data are realized through the cluster method to ensure the security of the data. When the data acquisition gateway device is started, each device first pulls the latest intermediate variable value stored in the Redis cluster through the MQTT service and saves it locally. After the device is started, it calculates and saves the intermediate variables according to the real-time data. During the data collection process, the device regularly calls the MQTT service to synchronize the locally stored intermediate variables to the Redis cluster. After analyzing the historical data and change trends and eliminating abnormal data, the system saves the calculated intermediate variables and sends them to each device to ensure the accuracy of the data.

[0043] The data collection process of the data collection gateway is implemented through Nodered visual programming on the basis of active-standby hot redundancy. Each data collection gateway will install the Nodered program, and configure the PLC and point data that need to be collected according to the actual business situation. Before data collection, the intermediate variables and configuration parameters are synchronized from the Redis cluster. The collected real-time data is first calculated through the memory, and after eliminating abnormal data, the variables are assigned uniformly. Finally, MQTT is sent through a scheduled task to upload the data. The control gateway subscribes to MQTT messages. After receiving the real-time data message, it first filters only the messages of the master device according to the active-standby status of the data collection gateway, and stores them in the database of the Redis cluster in real time. In this embodiment, the database can use a time series library, and the messages of the master device are stored in the second-level super table of the time series library in real time. The time series library stores second-level data. At this time, the latest real-time data of each point will be updated in real time in the memory and the interface will be exposed to obtain the latest real-time data for display.

[0044] The time series library provides stream computing capabilities. By configuring the real-time library's stream computing function, the system consolidates second-level data into minute-level data and synchronizes it to the real-time library's minute-level supertable. The control gateway periodically reads point data from the minute-level supertable, calculates it into hourly data, and stores it in the relational database. The control gateway's reporting center retrieves hourly data from the relational database and develops customized reports based on actual business needs.

[0045] After the above process, the data acquisition gateway hot redundancy system is set up. The process of switching between the main and standby systems is as follows: Figure 3 Shown, including:

[0046] Both the master and backup devices of the data acquisition gateway send heartbeat messages to the control gateway via MQTT. If an exception occurs in the master device, the control gateway sends a master-slave switch message via MQTT, and the backup device switches to the master device. The synchronization of intermediate variables is achieved through the Redis cluster database.

[0047] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A data acquisition gateway hot redundancy system for an industrial control system, characterized in that: It includes a control gateway and several sets of data acquisition gateways; the control gateway is installed with MQTT service, database, and hot redundancy registration service; the data acquisition gateway is installed with hot redundancy client service; Each data acquisition gateway includes at least two data acquisition gateways, which are registered as active and standby in the control gateway through the hot redundancy registration service, and transmit data acquisition gateway registration messages, data acquisition network jump messages, active and standby switch messages, and database storage messages through the MQTT service; The database stores intermediate variables of the data acquisition and control process, and provides real-time and periodic data calls to the data acquisition gateway.

2. The data acquisition gateway hot redundancy system of the industrial control system according to claim 1, characterized in that: The control gateway installs the Keepalived service and provides a unified IP address to the outside world.

3. The data acquisition gateway hot redundancy system of the industrial control system according to claim 1, characterized in that: There are at least two control gateways, each providing hot redundancy.

4. The data acquisition gateway hot redundancy system of the industrial control system according to claim 1, characterized in that: The control gateway is installed with the Nodered main program, and the data acquisition gateway is installed with the data acquisition service implemented by Nodered visual programming.

5. The data acquisition gateway hot redundancy system of the industrial control system according to claim 1, characterized in that: The database uses Redis cluster to implement data storage.

6. A hot redundancy method using the data acquisition gateway hot redundancy system according to any one of claims 1 to 5, characterized in that: include: S1. The data acquisition gateway connects to the hot redundancy registration service of the control gateway through the hot redundancy client service to perform hot redundancy registration. The first device to register is the main device, and the later device to register is the backup device. S2. The data acquisition gateway regularly sends data acquisition gateway status check heartbeat information to the control gateway via MQTT; the control gateway receives the heartbeat information and determines the status of the primary device. If the primary device is abnormal, it sends a master-slave switch message to the backup device via MQTT; S3. The data acquisition gateway sends database storage messages through MQTT to save the intermediate variables of the data acquisition and control process into the database. When the data acquisition gateway starts, it pulls the latest intermediate variable values from the database through MQTT and saves them locally. During the data acquisition process, MQTT is called regularly to synchronize the locally saved intermediate variables to the database.

7. The hot redundancy method according to claim 6, characterized in that: In step S1, the data acquisition gateway judges based on the information returned by the control gateway. If the returned information is the master device, the data acquisition gateway automatically starts a Netty service to wait for other backup data acquisition gateways to register; if the returned information is the backup device, the data acquisition gateway actively connects to the Netty service of the gateway group where it is located and synchronizes the configuration and intermediate variable information of the master device.

8. The hot redundancy method according to claim 6, characterized in that: The control gateway installs the Keepalived service and provides a unified IP address to the outside world. The data acquisition gateway performs hot redundancy registration through the IP address.

9. The hot redundancy method according to claim 6, characterized in that: The control gateway is installed with the Nodered main program, and the data acquisition gateway is installed with the data acquisition service realized by Nodered visual programming, and the PLC and point data to be collected are configured according to the actual business situation.

10. The hot redundancy method according to claim 6, characterized in that: The database uses a Redis cluster to implement data storage, and the main gateway and the backup gateway of the data acquisition gateway are connected to different Redis nodes respectively.