An extensible industrial gateway system and its communication disruption pre-configuration protection method

CN122933385APending Publication Date: 2026-10-16TOKY ELECTRICAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611186730.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-06
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0005]针对上述现有技术中存在的缺陷,本发明公开了一种可扩展工业网关系统及其通信中断预配置保护方法,以解决现有技术中网关与现场模块通信中断时,模块输出要么保持最后状态而存在安全隐患,要么统一清零或复位而缺乏灵活性无法实现通道级差异化控制,以及预设故障状态值分散存储于各模块导致配置管理不便及模块更换时需重新配置的技术问题

Benefits of technology

1、本发明实现了输出通道级的差异化安全控制。本发明支持为同一模块的不同输出通道独立设置不同的预设故障状态,用户可根据不同设备、不同工艺环节的安全要求进行逐通道配置,实现了从“设备级粗放控制”到“通道级精细控制”的跨越,在确保安全性的同时兼顾了工业现场多样化的工艺需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122933385A_ABST
    Figure CN122933385A_ABST
Patent Text Reader

Abstract

The application discloses an extensible industrial gateway system and a communication interruption pre-configuration protection method thereof, and belongs to the technical field of industrial internet of things. The system comprises a gateway host and a plurality of field modules connected through a communication bus, wherein the gateway host is provided with a communication interface unit, a preset configuration unit, a storage unit, a communication detection unit and a fault execution unit. The method comprises the following steps: a preset fault state is independently configured for each output channel of each field module and is centrally stored in the gateway host; the gateway host continuously monitors the communication state of each field module; when it is determined that the communication is interrupted, the gateway host immediately issues the corresponding preset fault state to the field module, and forces each output channel to switch to a preset safe output state. The application realizes differentiated safety control of the output channel level in the communication interruption scene, and improves the safety and maintainability of the industrial control system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial Internet of Things (IoT) technology, specifically to a scalable industrial gateway system and its communication interruption pre-configuration protection method. Background Technology

[0002] Industrial gateways, serving as the core hub connecting field devices and upper-level management systems, are widely used in industrial automation. Gateways communicate with various field modules via fieldbuses (such as Modbus, PROFIBUS, and CAN) to acquire data and issue commands, while simultaneously connecting to the upper-level management system via Ethernet for data uploading and remote control. These field modules include at least digital input modules, digital output modules, analog input modules, analog output modules, and temperature controller modules. However, in actual industrial operation, the communication links between the gateway and the field modules are susceptible to interruptions due to factors such as wire breaks, electromagnetic interference, and equipment failures. When communication is interrupted, the gateway cannot promptly control the modules, leading to an uncontrollable state of the equipment and consequently affecting production safety and process stability.

[0003] To address the aforementioned communication interruption scenarios, existing technologies primarily employ the following approaches. One approach involves the module automatically locking and maintaining its current output state upon detecting a communication interruption. While this prevents unexpected changes in output values, the maintained state may represent a dangerous state prior to the interruption, leaving the device operating under unknown conditions and posing a serious safety hazard. Another approach involves resetting or clearing registers or output channels upon communication anomalies. Although this method allows the device to enter a relatively defined initial state, it employs a uniform global reset strategy, treating all channels equally and failing to differentiate based on the specific safety requirements of each channel. Furthermore, a scheme has emerged that allows users to preset fault state values, pre-storing fault state parameters for each channel in the module for recall during communication interruptions. However, this configuration requires individual module-by-module processing, making batch management difficult, and reconfiguration is necessary when a module is replaced due to failure, resulting in low maintenance efficiency.

[0004] In summary, existing technologies have problems such as security risks, lack of differentiated control capabilities, and inconvenient configuration management when dealing with communication interruptions between gateways and field modules, making it difficult to meet the actual needs of complex industrial sites for security and flexibility. Summary of the Invention

[0005] To address the shortcomings of the existing technologies, this invention discloses a scalable industrial gateway system and its communication interruption pre-configuration protection method. This solves the technical problems in the existing technologies where, when communication between the gateway and the field module is interrupted, the module output either remains in its last state, posing a safety hazard, or is uniformly cleared or reset, lacking flexibility and failing to achieve channel-level differentiated control. It also addresses the technical problems of pre-set fault state values ​​being scattered and stored in various modules, leading to inconvenient configuration management and the need for reconfiguration when modules are replaced.

[0006] To achieve the above objectives, the present invention provides the following solution: On one hand, the present invention provides a communication interruption pre-configuration protection method for a scalable industrial gateway system. The scalable industrial gateway system includes a gateway host and multiple field modules connected to the gateway host via a communication bus. The gateway host has a storage unit. The method includes the following steps: Preset configuration steps: Provide a configuration interface for users, independently configure preset fault states for each output channel of each field module, and store the preset fault states in the storage unit; Communication detection steps: The gateway host continuously monitors the communication status between itself and each field module to determine whether the communication is interrupted; Fault execution steps: When it is determined that the communication of a certain field module is interrupted, the gateway host immediately sends the corresponding preset fault status in the storage unit to the field module, forcing each output channel of the field module to switch to the corresponding preset safe output status.

[0007] Preferably, the preset fault state includes a first preset value and a second preset value. The first preset value is a safety output value executed when communication is interrupted, and the second preset value is a recovery output value executed after communication is restored. The method further includes a communication recovery step: when the gateway host detects that communication with a certain field module has been restored, it automatically sends the corresponding second preset value from the storage unit to the field module, and a normal operation command is issued. Specifically, the criterion for determining communication recovery is: after communication interruption, the gateway host receives M consecutive valid heartbeat responses, where M is an integer greater than or equal to 1.

[0008] Preferably, the communication detection step adopts a heartbeat packet detection mechanism: the gateway host sends heartbeat query commands to each field module sequentially at a preset period T, and starts a timeout timer when each heartbeat query command is sent; if a heartbeat response is received from a field module within T seconds, the module is determined to be communicating normally; if no heartbeat response is received from a field module within T seconds, a no-response record is accumulated; if no response is received after sending heartbeat query commands N times consecutively, the module is determined to be communicating interrupted, where N is an integer greater than or equal to 2.

[0009] Preferably, the detection period T is set by the user according to the on-site reliability requirements, and the range is 100ms to 10s.

[0010] Preferably, in the preset configuration step: the user connects to the gateway host through host computer configuration software. The host computer configuration software automatically scans and lists all field modules and their output channels on the bus by sending read requests to all possible device addresses on the bus and identifying online modules based on the responses. The user sets preset fault states for each output channel of each module. After configuration, all preset fault states are centrally stored in the non-volatile memory of the gateway host. The preset fault states are organized in the non-volatile memory using bus address and channel number as indexes.

[0011] Preferably, when a field module is damaged and replaced, the gateway host automatically identifies the bus address of the module and reads the preset fault status corresponding to that address from the storage unit and sends it to the module, without the need for manual reconfiguration.

[0012] Preferably, the field module includes at least a digital output module and an analog output module; for the digital output module, the preset fault state is "0" or "1"; for the analog output module, the preset fault state is any current value or voltage value within a preset range.

[0013] On the other hand, the present invention provides a scalable industrial gateway system, comprising: A gateway host and multiple field modules connected to the gateway host via a communication bus; The gateway host includes: A communication interface unit is configured to communicate data with the plurality of field modules; The preset configuration unit is configured to provide a user configuration interface for independently configuring a preset fault state when communication is interrupted for each output channel of each field module. The storage unit is configured to store the preset fault states configured by the preset configuration unit. All preset fault states are centrally stored in the non-volatile memory of the gateway host and organized using bus address and channel number as indexes. The communication detection unit is configured to continuously monitor the communication status between the gateway host and each field module, and determine whether the communication is interrupted. The fault execution unit is configured to immediately send the corresponding preset fault state in the storage unit to the field module through the communication interface unit when the communication detection unit determines that the communication of a certain field module is interrupted, thereby forcing each output channel of the field module to switch to the corresponding preset safe output state.

[0014] Preferably, the communication detection unit adopts a heartbeat packet detection mechanism: the gateway host sends heartbeat query commands to each field module sequentially at a preset period T, and the gateway host starts a timeout timer when each heartbeat query command is sent; if no heartbeat response is received from a field module within T seconds, a no-response record is accumulated; if no response is received after sending heartbeat query commands N times consecutively, the communication detection unit determines that the communication of the field module is interrupted, where N is an integer greater than or equal to 2.

[0015] Preferably, the preset fault state includes a first preset value and a second preset value. The first preset value is a safety output value executed when communication is interrupted, and the second preset value is a recovery output value executed after communication is restored. When the communication detection unit determines that communication has been restored, the fault execution unit automatically sends the corresponding second preset value from the storage unit to the corresponding field module and restores the normal operation command. The criteria for determining communication restoration are: after communication interruption, the communication detection unit receives M valid heartbeat responses consecutively, where M is an integer greater than or equal to 1. The fault execution unit is also configured to automatically identify the bus address of a field module when it is damaged and replaced, read the preset fault state corresponding to that address from the storage unit, and send it to the new module.

[0016] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention achieves differentiated safety control at the output channel level. It supports setting different preset fault states independently for different output channels of the same module. Users can configure each channel individually according to the safety requirements of different equipment and processes, achieving a leap from "equipment-level coarse control" to "channel-level fine control," ensuring safety while also meeting the diverse process needs of industrial sites.

[0017] 2. This invention achieves centralized configuration and management of preset fault states, with the gateway actively executing fault protection. The invention centrally stores preset fault states on the gateway host, allowing users to configure all modules and channels through a unified interface, supporting batch operations, backup, and recovery. Preset fault states are organized in non-volatile memory using bus address and channel number as indexes for easy and rapid retrieval. When a module is damaged and replaced, the gateway automatically sends the stored preset values ​​upon power-up of the new module, eliminating the need for manual reconfiguration. Simultaneously, the gateway actively detects communication interruptions and proactively sends preset safety values ​​via a heartbeat mechanism, enabling security protection without requiring any watchdog functionality in the modules. This significantly reduces maintenance workload, human error rate, and system deployment costs. Attached Figure Description

[0018] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. It should be noted that the following embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the invention. Various modifications and equivalent substitutions made by those skilled in the art without departing from the spirit and scope of the present invention should be considered within the scope of protection of the present invention.

[0019] Figure 1 This is a system architecture diagram of a scalable industrial gateway system and its communication interruption pre-configuration protection method according to the present invention.

[0020] Figure 2 This is the main flowchart of a scalable industrial gateway system and its communication interruption pre-configuration protection method according to the present invention.

[0021] Figure 3 This is a flowchart of the preset configuration steps of the present invention.

[0022] Figure 4 This is a flowchart of the communication detection steps of the present invention.

[0023] Figure 5 This is a flowchart of the fault execution steps of the present invention.

[0024] Figure 6 This is a flowchart of the communication recovery steps of the present invention. Detailed Implementation

[0025] The present invention will be further described below with reference to the accompanying drawings, but the scope of protection of the present invention is not limited thereto.

[0026] This invention provides a scalable industrial gateway system and its communication interruption pre-configuration protection method. The core concept is to centrally store the preset fault states of each output channel of each field module in the gateway host. The gateway host actively detects the communication status with each module and, upon detecting a communication interruption, proactively sends the corresponding preset fault state to the module, forcing the module's output to switch to a preset safe state. Through this method, this invention achieves differentiated safety control at the output channel level in communication interruption scenarios, while also realizing centralized configuration and management of preset fault states, reducing system deployment and maintenance costs.

[0027] Figure 1 This is a system architecture diagram of a scalable industrial gateway system and its communication interruption pre-configuration protection method according to the present invention. Figure 2 This is the main flowchart of the method of the present invention. Figures 3 to 6 The flowcharts are for the preset configuration step, communication detection step, fault execution step, and communication recovery step, respectively. The system structure and method steps of the present invention will be described in detail below with reference to the accompanying drawings.

[0028] Example 1 Please see Figure 1 This embodiment provides a scalable industrial gateway system for industrial automation control scenarios. The system connects multiple field modules via a fieldbus to achieve data acquisition and command issuance, and executes pre-configured security protection when communication between the gateway and the modules is interrupted.

[0029] like Figure 1 As shown, the system includes a gateway host 100 and multiple field modules 200 connected to the gateway host via a communication bus. The communication bus is an RS485 bus or an Ethernet bus. Each field module 200 is distinguished by a bus address, with the gateway host 100 acting as the master station and the modules acting as slave stations. Each field module 200 includes at least one or more of the following: digital input module (DI), digital output module (DO), analog input module (AI), analog output module (AO), and temperature controller module.

[0030] The gateway host 100 includes a communication interface unit 110, a preset configuration unit 120, a storage unit 130, a communication detection unit 140, and a fault execution unit 150.

[0031] The communication interface unit 110 is configured to communicate with the plurality of field modules 200, including sending commands and receiving responses. The commands include reading / writing registers and reading / writing coils.

[0032] The preset configuration unit 120 is configured to provide a user configuration interface for independently configuring preset fault states in case of communication interruption for each output channel of each field module 200. The user configuration interface is accessed via host computer configuration software. The user connects to the gateway host 100 (via Ethernet or RS485 port) through dedicated PC configuration software. After connection, the software sequentially sends commands to all possible addresses (e.g., 1-247) on the bus to read device identification codes or basic parameters according to a predefined communication protocol (e.g., Modbus protocol). Addresses that respond normally are identified as online modules. The software further obtains the type of each online module and the number of channels it supports by reading the module model register or parsing the device identification code, thereby automatically scanning and listing all field modules 200 and their channels on the bus. The user can individually set "communication interruption preset value" and "communication interruption recovery preset value" for each output channel of each module. For the DO module, users can select "0 (disconnect)" or "1 (connect)" via the drop-down menu; for the AO module, users can input a numerical range (0~20mA or 0~10V), which supports decimals; for the temperature controller module, users can input the target temperature (°C) or select modes such as "stop heating" or "maintain current".

[0033] The storage unit 130 is configured to store the preset fault states configured by the preset configuration unit 120. All preset configurations are centrally stored in the non-volatile memory of the gateway host 100, independent of the storage units of each field module 200. In one specific embodiment, the preset fault states are organized in the non-volatile memory in the form of an address mapping table. This mapping table uses the bus address (module station number) as the main index, and each bus address is further sub-indexed by the channel number. The storage area corresponding to each channel number is used to store two parameters for that channel: "communication interruption preset value" and "communication interruption recovery preset value". This address mapping table storage structure allows the gateway host to quickly find the corresponding preset value based on the bus address and channel number of the communication interruption module.

[0034] The communication detection unit 140 is configured to continuously monitor the communication status between the gateway host 100 and each field module 200 to determine whether communication is interrupted. Specifically, the communication detection unit 140 adopts a heartbeat detection mechanism: the gateway host 100 sends heartbeat query commands to each field module 200 sequentially at a preset period T, and starts a software timer when each heartbeat query command is sent, with a timeout period set to T seconds. If no heartbeat response is received from a module within T seconds, the communication detection unit 140 determines that the module's communication is interrupted. Further, the communication detection unit 140 only determines that the module's communication is interrupted if no response is received after sending heartbeat query commands N consecutively, where N is an integer greater than or equal to 2. The detection period T can be flexibly set by the user according to the field reliability requirements, ranging from 100ms to 10s.

[0035] The fault execution unit 150 is configured to immediately send the corresponding user-preset fault state (i.e., "communication interruption preset value") in the storage unit 130 to the field module 200 through the communication interface unit 110 when the communication detection unit 140 determines that the communication of a certain field module 200 is interrupted, thereby forcing each output channel of the field module 200 to switch to the corresponding preset safe output state.

[0036] Furthermore, when the communication detection unit 140 determines that communication has been restored, the fault execution unit 150 automatically sends the corresponding "preset value after communication interruption recovery" from the storage unit 130 to the corresponding field module 200, and the normal operation command is issued without manual intervention. Specifically, the criteria for determining communication recovery are as follows: after determining that the communication of a certain field module 200 has been interrupted, the communication detection unit 140 continues to send a heartbeat query command to the module at a preset period T. When M valid heartbeat responses are received consecutively (i.e., all M responses are received within the timeout period T), the module is determined to have resumed communication. Here, M is an integer greater than or equal to 1. Preferably, in order to maintain consistent reliability with the communication interruption determination, the value of M is the same as the number of consecutive no-response times N for interruption determination, for example, both are 3 times.

[0037] In this embodiment, even if the field module 200 does not have any watchdog or fault protection functions, the gateway host 100 can still achieve secure, controllable, and differentiated output protection through active detection and active distribution mechanisms. Example 2 Please see Figures 2 to 6 This embodiment provides a communication interruption pre-configuration protection method for a scalable industrial gateway system, which is applied to the scalable industrial gateway system described in Embodiment 1. Figure 2 This embodiment illustrates a flowchart of the steps involved in a communication interruption pre-configuration protection method for a scalable industrial gateway system. Figure 2 As shown, the method includes the following steps S1-S4.

[0038] S1. Preset configuration steps: Provide a configuration interface for users, independently configure preset fault states for each output channel of each field module, and store the preset fault states in the gateway host.

[0039] The preset fault state includes a first preset value and a second preset value. The first preset value is the security output value executed when communication is interrupted (i.e., the "communication interruption preset value"), and the second preset value is the recovery output value executed after communication is restored (i.e., the "communication interruption recovery preset value").

[0040] Figure 3 The flowchart illustrates the preset configuration steps of S1, a communication interruption pre-configuration protection method for a scalable industrial gateway system according to this embodiment. Figure 3 As shown, the preset configuration step S1 includes the following steps S11-S14.

[0041] S11. The user connects to the gateway host via PC-based host computer configuration software. The host computer configuration software establishes a communication connection with the gateway host via Ethernet or RS485 port. After successful connection, the configuration software sends read requests to all possible device addresses on the bus via broadcast or polling, according to a predefined communication protocol (such as Modbus protocol). It identifies online field modules based on whether there is a response, and obtains module type and channel information by reading the device model register, thereby automatically scanning and listing all field modules and their output channels on the bus.

[0042] S12. The user sets a first preset value and a second preset value for each output channel of each module. For the DO module, the user can select "0 (disconnect)" or "1 (connect)" through the drop-down menu; for the AO module, the user can enter any value in the range of 0~20mA or 0~10V (supporting decimal points) in the numerical input box, such as 4mA, 12mA, 20mA, etc., instead of only being able to select 0mA or keep the original value, so that the analog quantity regulation loop can maintain the safe opening required by the process after the network is disconnected; for the temperature controller module, the user can enter the target temperature value (°C), or select modes such as "stop heating" or "maintain current temperature" through the drop-down menu.

[0043] S13. After configuration, all preset values ​​are stored in the gateway host's non-volatile memory. After the user completes the configuration of each channel of all modules, they click the "Deploy Configuration" button. The host computer configuration software packages all preset configuration data and deploys it to the gateway host. After receiving the configuration data, the gateway host writes it into the non-volatile memory to ensure that the configuration data is not lost after the gateway host loses power. In a specific implementation, the preset values ​​in the non-volatile memory are organized using a key-value data structure with "bus address-channel number" as the key and "first preset value and second preset value" as the value. For example, the preset value of channel 2 of the DO module with bus address 3 can be represented by the storage path or label in the memory as "3-2", and the corresponding storage space stores the "communication interruption preset value" and "communication interruption recovery preset value" of this channel. This organization method facilitates the gateway to quickly retrieve and read the corresponding preset value according to the bus address of the interrupted module and the channel number to be controlled when a communication interruption occurs. All preset configurations are centrally stored in the gateway host, without relying on the storage units of each field module, thus achieving decoupling between configuration and execution.

[0044] S14. When a field module is damaged and replaced, the new module does not need to be reconfigured. The gateway host automatically sends the stored preset values ​​to the new module. When the user replaces the damaged field module, the new module is connected to the bus. The fault execution unit of the gateway host automatically identifies the bus address of the new module and reads the preset value corresponding to that address from the non-volatile memory. The preset value is then sent to the new module through the communication interface unit, ensuring configuration consistency and reducing maintenance error rate.

[0045] S2. Communication Detection Step: The gateway host continuously monitors the communication status between itself and each field module to determine whether communication is interrupted. This communication detection step employs a heartbeat detection mechanism, which is independent of normal I / O data exchange and will not affect normal data acquisition or command issuance.

[0046] Figure 4 A flowchart illustrating the communication detection steps of S2, a communication interruption pre-configuration protection method for a scalable industrial gateway system according to this embodiment, is shown. Figure 4 As shown, the communication detection step S2 includes the following steps S21-S25.

[0047] S21. The gateway host sends heartbeat query commands to each field module sequentially at a preset period T. The communication detection unit of the gateway host sends heartbeat query commands to each field module sequentially in a polling manner according to the preset period T. If n modules are connected to the bus, the gateway host sends heartbeat query commands sequentially to module 1, module 2, ..., module n, completing one round of queries before starting the next round of queries from module 1. The heartbeat query command is a short frame command, used only to confirm whether the communication link is normal.

[0048] S22. The gateway host starts a software timer with a timeout of T seconds. Upon completion of each heartbeat query command, the gateway host starts the software timer corresponding to that module, with a timeout of T seconds. If a heartbeat response is received from the module within T seconds, the timer is reset; if no response is received after T seconds, the timeout handling logic is triggered.

[0049] S23. If a heartbeat response is received from a module within T seconds, the module is considered to be communicating normally, and the next round of monitoring continues. If the on-site module is working normally, it should immediately reply with a heartbeat response after receiving the heartbeat query command. After receiving a heartbeat response within T seconds, the gateway host determines that the module is communicating normally, resets the module's no-response count to 0, and enters the next round of monitoring.

[0050] S24. If no heartbeat response is received from a module within T seconds, a no-response record is accumulated. If the gateway host does not receive a heartbeat response within T seconds due to momentary interference in the communication link, brief busyness of the module, or other reasons, the no-response count of that module is incremented by 1, but communication is not considered interrupted at this time, and the system continues to wait for the next round of heartbeat queries.

[0051] S25. If no response is received after sending heartbeat query commands N times consecutively, the communication detection unit determines that the module's communication is interrupted.

[0052] N is an integer greater than or equal to 2, which can be flexibly configured by the user according to the on-site electromagnetic environment and reliability requirements. If a module fails to return a heartbeat response for N consecutive times, i.e., the no-response count reaches N, the communication detection unit determines that the module's communication is interrupted. If a normal heartbeat response is returned during the accumulation process, the no-response count is reset to zero. By setting an interruption to be determined only after N consecutive no responses, false judgments caused by momentary electromagnetic interference or bus conflicts are effectively avoided, preventing unnecessary fault state switching.

[0053] The detection period T can be flexibly set by the user according to the on-site reliability requirements, ranging from 100ms to 10s. The smaller the T value, the faster the response to communication interruption and the shorter the time the device is in an uncontrollable state, but the bus communication load increases accordingly; the larger the T value, the lower the bus load, but the response speed will decrease accordingly.

[0054] S3. Fault Execution Steps: When a communication interruption is detected in a field module, the gateway host immediately sends the corresponding preset fault status from the storage unit to the field module, forcing each output channel of the field module to switch to the corresponding preset safe output status.

[0055] Figure 5 The flowchart illustrates the fault execution steps of S3, a communication interruption pre-configuration protection method for a scalable industrial gateway system according to this embodiment. Figure 5 As shown, the fault execution step S3 includes the following steps S31-S34.

[0056] S31. The communication detection unit determines that a certain field module has a communication interruption. After the communication detection unit confirms that a certain module has a communication interruption according to the determination logic in step S25, it immediately sends an interrupt trigger signal to the fault execution unit, carrying the bus address information of the module.

[0057] S32. The fault execution unit reads the first preset value (communication interrupt preset value) corresponding to the module from the storage unit. After receiving the interrupt trigger signal, the fault execution unit reads the first preset value pre-configured for the module from the non-volatile memory of the storage unit according to the module's bus address. In the implementation using a "bus address-channel number" key-value pair data structure, the fault execution unit constructs a lookup key based on the bus address and channel number to quickly locate and read the corresponding first preset value in the memory. The first preset value includes the preset status values ​​of all output channels of the module. For example, for the DO module, each channel is preset to "0" or "1"; for the AO module, each channel is preset to a certain current value or voltage value; for the temperature controller module, it is preset to "stop heating" or a certain target temperature.

[0058] S33. The fault execution unit sends the first preset value to the field module through the communication interface unit.

[0059] The fault execution unit assembles the first preset value it reads into a communication command and sends it to the corresponding field module through the communication interface unit. Even if the field module does not have any watchdog function, its communication receiving circuit can still receive and execute the commands issued by the gateway host. Therefore, this invention can achieve safe state switching without relying on the hardware capabilities of the module itself and is compatible with a large number of low-cost conventional I / O modules.

[0060] If the initial command delivery fails due to communication link instability, the retry mechanism of the fault execution unit will continue to attempt to write the first preset value into the module while there is still a possibility of single instruction transmission on the communication link, thus ensuring safe output to the greatest extent. From the detection of the interrupt to the issuance of the preset instruction, the time overhead is only the microsecond-level delay of reading the memory plus the millisecond-level time consumption of sending the instruction through the communication interface, which is usually within tens of milliseconds, much faster than the module's own watchdog timeout.

[0061] S34. Each output channel of the field module is switched to the corresponding preset safe output state.

[0062] After receiving the first preset value, the field module immediately switches the output state of each output channel according to the preset value. Different channels of the same module can perform different safety actions—for example, channel 1 is preset to "0" to stop the dangerous motor, and channel 2 is preset to "1" to turn on the alarm light—achieving channel-level differentiated safety control.

[0063] S4. Communication recovery steps: When the gateway host detects that communication with a certain field module has been restored, it automatically sends the corresponding second preset value (i.e., the "preset value after communication interruption recovery") in the storage unit to the field module and sends the normal operation command.

[0064] Figure 6The flowchart illustrates the communication detection steps of S4, a communication interruption pre-configuration protection method for a scalable industrial gateway system according to this embodiment. Figure 6 As shown, the communication detection step S4 includes the following steps S41-S45.

[0065] S41. The communication detection unit continuously sends heartbeat query commands to monitor the communication status. After determining that the communication of a certain module is interrupted, the gateway host continues to send heartbeat query commands to that module according to a preset period T to detect changes in the status of the communication link in real time.

[0066] S42. The communication detection unit detects that communication with a certain field module has been restored (heartbeat response has been received again). The specific restoration judgment criteria are as follows: After the interruption, the communication detection unit continues to send heartbeat query commands. If a heartbeat response from the module is successfully received within a certain period, the effective response count of the module is incremented by 1. When M consecutive effective heartbeat responses are received, the communication detection unit determines that the module's communication has been restored. Here, M is an integer greater than or equal to 1. Preferably, in order to maintain logical consistency with the communication interruption judgment, the value of M is the same as the number of consecutive no-response counts N for interruption judgment. For example, if N=3, then M is also preferably 3, that is, restoration is determined only after 3 consecutive successful heartbeat responses are received. This design avoids frequent state switching caused by instantaneous fluctuations in the communication link, ensuring the stability of the system. After confirming that communication has been restored, the gateway host resets the no-response count of the module to 0 and sends a restoration trigger signal to the fault execution unit.

[0067] S43. The fault execution unit reads the second preset value (preset value after communication interruption recovery) corresponding to the module from the storage unit. After receiving the recovery trigger signal, the fault execution unit reads the second preset value pre-configured for the module from the non-volatile memory of the storage unit according to the module's bus address. The second preset value contains the recovery status values ​​of all output channels of the module.

[0068] S44. The fault execution unit sends the second preset value to the field module through the communication interface unit. The fault execution unit assembles the read second preset value into a communication command and sends it to the corresponding field module through the communication interface unit.

[0069] S45. The field module returns to normal operation. After receiving the second preset value, the field module switches the output state of each output channel according to the preset recovery value, exits the fault mode, and resumes normal operation. The entire recovery process does not require on-site operators to power on or manually reset, achieving system self-healing. This is especially important for unattended stations and remote sites (such as oil fields, pipelines, and environmental monitoring stations), significantly reducing operation and maintenance costs and response delays.

[0070] Example 3 To further verify the technical effects of the present invention, the inventors conducted actual tests on the scalable industrial gateway system described in Embodiment 1 and the method described in Embodiment 2 under a typical industrial environment. The test objects were the DO module, AO module, and temperature controller module without watchdog functionality. The test environment configuration was as follows: the gateway host was the scalable industrial gateway (V1.0) described in this invention; the communication bus was RS485 with a baud rate of 38400bps; the heartbeat detection period T = 300ms; the threshold for determining N consecutive no-response cycles = 3.

[0071] 1. The digital output module controls the motor and alarm light, specifically: The site uses a DO module without a watchdog function. Channel 1 controls the start and stop of the mixing motor, and channel 2 controls the on and off of the fault alarm light. The user pre-configures the following settings through the host computer configuration software: the first preset value (communication interruption preset value) of channel 1 is "0", and the second preset value (preset value after communication interruption recovery) is "1"; the first preset value of channel 2 is "1", and the second preset value is "0".

[0072] During testing, the communication cable between the gateway and the DO module was manually disconnected to simulate a communication interruption. The gateway's communication detection unit detected the interruption within approximately 900ms (T×N=300ms×3 times). The fault execution unit immediately sent the first preset value "0" for channel 1 and the first preset value "1" for channel 2 to the DO module. The DO module outputs a low level on channel 1, stopping the motor; and outputs a high level on channel 2, illuminating the alarm light. The device then enters a safe and controllable state.

[0073] Subsequently, the communication cable was manually re-inserted to simulate communication restoration. Upon detecting the restoration, the gateway automatically sent the second preset value "1" for channel 1 and the second preset value "0" for channel 2 to the DO module. The motor restarted, and the alarm light went out. The entire process required no manual intervention.

[0074] 2. The analog output module controls the regulating valve, specifically: An AO module without a watchdog function is used on site. Its channel 1 controls the opening of a regulating valve, and outputs 12mA during normal operation (corresponding to 50% opening). The user pre-configures the following settings through the host computer configuration software: the first preset value (communication interruption preset value) is 4mA, and the second preset value (communication interruption recovery preset value) is 20mA.

[0075] During testing, the communication cable between the gateway and the AO module was manually disconnected. Upon detecting the communication interruption, the gateway immediately sent a first preset value of 4mA to the AO module, causing the valve to close to a safe opening, thus maintaining pipeline pressure and avoiding the risk of pipeline overpressure rupture or production process interruption. When communication was restored, the gateway automatically sent a second preset value of 20mA to the AO module, and the valve returned to its normal opening.

[0076] 3. The temperature controller module controls the heating, specifically: A temperature controller module without a watchdog function is used on site to control the temperature of a heating furnace, maintaining it at 50℃ during normal operation. The user pre-configures the following settings through the host computer configuration software: the first preset value (communication interruption preset value) is "stop heating", and the second preset value (communication interruption recovery preset value) is "restart heating to 50℃".

[0077] During testing, the communication cable between the gateway and the temperature controller module was manually disconnected. Upon detecting the communication interruption, the gateway immediately issued a "stop heating" command, and the temperature controller module stopped heating, preventing a safety hazard caused by the temperature continuously rising after the network outage. Once communication was restored, the gateway automatically issued a "restart heating to 50℃" command, and the temperature controller module resumed heating control.

[0078] 4. Validate the data During the above tests, the response time from communication interruption to gateway-triggered fault execution was within 900ms in each scenario. All module output channels accurately switched to the user-preset safe output state without any malfunctions or timeouts. After communication was restored, all modules automatically exited fault mode and returned to normal operation without data conflicts or abnormal states. The specific test results are as follows: DO module channel 1 was in a high-level output state (motor running) before the communication interruption, switched to a low-level output state (motor stopped) after the interruption, and switched back to a high-level output state (motor running) after resumption. DO module channel 2 was in a low-level output state (alarm light off) before the communication interruption, switched to a high-level output state (alarm light on) after the interruption, and switched back to a low-level output state (alarm light off) after resumption. AO module output 12mA before the communication interruption, switched to 4mA output after the interruption, and switched to 20mA output after resumption. Temperature controller module was in heating operation state before the communication interruption, switched to a stopped heating state after the interruption, and switched back to restart heating to 50℃ after resumption.

[0079] The above verification results demonstrate that even if the field module lacks any watchdog or fault protection functions, this invention can still achieve secure, controllable, and differentiated communication interruption output protection through the gateway's active detection and active distribution mechanism. Simultaneously, it verifies the effectiveness of the preset values ​​centrally stored in the gateway, which do not require reconfiguration after module replacement; the gateway can automatically distribute the preset values ​​to the new module, significantly reducing maintenance complexity.

[0080] The above description is merely an example and illustration of the structure of the present invention. Those skilled in the art can make various modifications or additions to the specific embodiments described, or use similar methods to replace them, as long as they do not deviate from the structure of the invention or exceed the scope defined in the claims, all of which should fall within the protection scope of the present invention.

Claims

1. A method for pre-configuring protection of communication interruptions in a scalable industrial gateway system, characterized in that, The scalable industrial gateway system includes a gateway host and multiple field modules connected to the gateway host via a communication bus, the gateway host having a storage unit; the method includes the following steps: Preset configuration steps: Provide a configuration interface for users, independently configure preset fault states for each output channel of each field module, and store the preset fault states in the storage unit; Communication detection steps: The gateway host continuously monitors the communication status between itself and each field module to determine whether the communication is interrupted; Fault execution steps: When it is determined that the communication of a certain field module is interrupted, the gateway host immediately sends the corresponding preset fault status in the storage unit to the field module, forcing each output channel of the field module to switch to the corresponding preset safe output status.

2. The communication interruption pre-configuration protection method for a scalable industrial gateway system according to claim 1, characterized in that, The preset fault state includes a first preset value and a second preset value. The first preset value is a safety output value executed when communication is interrupted, and the second preset value is a recovery output value executed after communication is restored. The method further includes a communication recovery step: when the gateway host detects that communication with a certain field module has been restored, it automatically sends the corresponding second preset value in the storage unit to the field module and restores the normal operation command; the judgment criterion for communication recovery is: after the communication interruption, the gateway host receives M valid heartbeat responses continuously, where M is an integer greater than or equal to 1.

3. The communication interruption pre-configuration protection method for a scalable industrial gateway system according to claim 1, characterized in that, The communication detection step employs a heartbeat packet detection mechanism: The gateway host sends heartbeat query commands to each field module sequentially at a preset period T. The gateway host starts a timeout timer when each heartbeat query command is sent. If a heartbeat response is received from a field module within T seconds, the module is considered to be communicating normally. If no heartbeat response is received from a field module within T seconds, a no-response record will be accumulated. If no response is received after sending heartbeat query commands N times consecutively, the module is considered to have interrupted communication, where N is an integer greater than or equal to 2.

4. The communication interruption pre-configuration protection method for a scalable industrial gateway system according to claim 3, characterized in that, The detection period T is 100ms to 10s.

5. The communication interruption pre-configuration protection method for a scalable industrial gateway system according to claim 1, characterized in that, In the preset configuration steps: Users connect to the gateway host through host computer configuration software. The host computer configuration software automatically scans and lists all field modules and their output channels on the bus by sending read requests to all possible device addresses on the bus and identifying online modules based on the responses. Users can set preset fault states for each output channel of each module; After configuration, all preset fault states are centrally stored in the gateway host's non-volatile memory. The preset fault states are organized in the non-volatile memory using bus address and channel number as indexes.

6. The communication interruption pre-configuration protection method for a scalable industrial gateway system according to claim 1, characterized in that, When a field module is damaged and replaced, the gateway host automatically identifies the bus address of the module and reads the preset fault status corresponding to that address from the storage unit and sends it to the module without manual reconfiguration.

7. The communication interruption pre-configuration protection method for a scalable industrial gateway system according to claim 1, characterized in that, The field module includes at least a digital output module and an analog output module; for the digital output module, the preset fault state is "0" or "1"; for the analog output module, the preset fault state is any current value or voltage value within a preset range.

8. A scalable industrial gateway system, characterized in that, include: A gateway host and multiple field modules connected to the gateway host via a communication bus; The gateway host includes: A communication interface unit is configured to communicate data with the plurality of field modules; The preset configuration unit is configured to provide a user configuration interface for independently configuring a preset fault state when communication is interrupted for each output channel of each field module. The storage unit is configured to store the preset fault states configured by the preset configuration unit. All preset fault states are centrally stored in the non-volatile memory of the gateway host and organized using bus address and channel number as indexes. The communication detection unit is configured to continuously monitor the communication status between the gateway host and each field module, and determine whether the communication is interrupted. The fault execution unit is configured to immediately send the corresponding preset fault state in the storage unit to the field module through the communication interface unit when the communication detection unit determines that the communication of a certain field module is interrupted, thereby forcing each output channel of the field module to switch to the corresponding preset safe output state.

9. The scalable industrial gateway system according to claim 8, characterized in that, The communication detection unit employs a heartbeat packet detection mechanism. The gateway host sends heartbeat query commands to each field module sequentially at a preset period T. The gateway host starts a timeout timer when each heartbeat query command is sent. If no heartbeat response is received from a field module within T seconds, a no-response record will be accumulated. If no response is received after sending heartbeat query commands N times consecutively, the communication detection unit determines that the communication of the field module is interrupted, where N is an integer greater than or equal to 2.

10. The scalable industrial gateway system according to claim 8, characterized in that, The preset fault state includes a first preset value and a second preset value. The first preset value is a safety output value executed when communication is interrupted, and the second preset value is a recovery output value executed after communication is restored. When the communication detection unit determines that communication has been restored, the fault execution unit automatically sends the corresponding second preset value in the storage unit to the corresponding field module to restore the normal command issuance; the criterion for determining communication restoration is: after the communication interruption, the communication detection unit receives M valid heartbeat responses continuously, where M is an integer greater than or equal to 1; The fault execution unit is also configured to automatically identify the bus address of a field module when it is damaged and replaced, and read the preset fault status corresponding to that address from the storage unit and send it to the new module.