A wireless data communication system

A wireless data communication system combining a Modbus analog-to-digital converter and a LoRa communication gateway, along with an SQL database and an asynchronous event loop module, solves the latency and instability problems of traditional wireless communication to a DCS distributed control system, and achieves continuous and reliable data transmission.

CN122395554APending Publication Date: 2026-07-14HUBEI ENERGY GRP EZHOU POWER GENERATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUBEI ENERGY GRP EZHOU POWER GENERATION CO LTD
Filing Date
2026-04-03
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

When traditional measurement points use wireless communication to connect to the DCS distributed control system, there are problems such as high communication latency and unstable communication nodes.

Method used

A wireless data communication system combining a Modbus analog-to-digital converter and a LoRa communication gateway is used. The LoRa communication transceiver module receives measurement point data and sends it to the LoRa communication gateway. The external industrial controller has a built-in SQL database to store and process data. The asynchronous event loop module and hardware abstraction layer are used to optimize communication, so as to achieve real-time data response and stable transmission.

Benefits of technology

This ensures that the system can still provide a continuous and reliable data stream even when wireless communication is unstable or delayed. It solves the communication delay and node instability problems in traditional wireless communication to DCS distributed control systems, and achieves instant response and stable data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122395554A_ABST
    Figure CN122395554A_ABST
Patent Text Reader

Abstract

The application relates to a wireless data communication system, a Modbus analog-digital converter is connected with a measuring point sensor, and collected measuring point data are stored in a first register; a wireless transparent transceiving device comprises a LoRa communication gateway and a LoRa communication transceiving module, the LoRa communication transceiving module receives the measuring point data and sends the measuring point data to the LoRa communication gateway; a master station interface of an externally-hung industrial controller is connected with the LoRa communication gateway, and a slave station interface is connected with a DCS distributed control system; the externally-hung industrial controller stores the measuring point data in an SQL database, in response to a read request of the DCS distributed control system, the measuring point data are extracted from a second register to be sent to the DCS distributed control system, and the measuring point data are read from the SQL database according to a first preset strategy to update the second register. The application can solve the problems of communication delay and unstable communication nodes in the prior art that traditional measuring points adopt wireless communication to the DCS distributed control system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of industrial data acquisition technology, and in particular to a wireless data communication system. Background Technology

[0002] The DCS (Distributed Control System) add-on system offers unparalleled flexibility and scalability during the retrofitting and upgrading of thermal power plants. It fully utilizes existing DCS infrastructure while introducing open IT and intelligent technologies, providing a crucial technical pathway for older power plants through the publicly available MODBUS communication protocol.

[0003] However, the traditional approach requires all field sensors to collect data via DCS cards before interacting with an external controller. Adding new sensors necessitates laying numerous cables and installing additional DCS data acquisition cards. For auxiliary sensors with low latency requirements, this traditional method results in long installation cycles and high costs. Using wireless data acquisition leads to unstable data transmission, frequent disconnections at sensors, and high data acquisition latency. Furthermore, when using RS485 communication, the latency can affect the communication scanning cycle of other devices on the same circuit. Summary of the Invention

[0004] This application provides a wireless data communication system to solve the problems of communication delay and communication node instability encountered by traditional measurement points when using wireless communication to DCS distributed control systems in related technologies.

[0005] This application provides a wireless data communication system, which includes: A Modbus analog-to-digital converter is used to connect to a measuring point sensor and store the measuring point data collected by the measuring point sensor in the first register of the Modbus analog-to-digital converter; A wireless transparent transmission transceiver device includes a LoRa communication gateway and a LoRa communication transceiver module with wireless communication connection. The LoRa communication transceiver module is used to receive measurement point data in a first register and send it to the LoRa communication gateway. An external industrial controller has a master interface connected to the LoRa communication gateway and a slave interface connected to the DCS distributed control system. The external industrial controller stores the received measurement point data in its SQL database, monitors the DCS distributed control system, and responds to the read request from the DCS distributed control system by retrieving measurement point data from the second register of the external industrial controller and sending it to the DCS distributed control system. It also reads measurement point data from the SQL database according to a first preset strategy to update the second register.

[0006] In one embodiment, the SQL database includes an SQL data table, which includes a primary key ID, the number of scan cycles when reading data from the first register, a timestamp, a measurement point ID, measurement point data collected by the measurement point sensor, and the measurement point data quality. The measurement point data quality is set to 0 or 1. When communication fails or data reading is abnormal, the measurement point data quality is 0; otherwise, the measurement point data quality is 1.

[0007] In one implementation, when communication fails or data reading is abnormal, the corresponding measurement point is assigned measurement point data in the SQL data table according to the second preset strategy. The second preset strategy includes: using the average value of the measurement point data obtained in the latest second preset number of scanning cycles as the measurement point data for the current scanning cycle.

[0008] In one embodiment, the external industrial controller has a built-in asynchronous event loop module based on the Libuv library, the asynchronous event loop module comprising: The sensor state machine submodule is used to update the sensor status at the measuring point. The status includes idle status, polling status, waiting for response status, timeout status, error status, and disabled status. The timer management submodule is used to assign timers to all measurement point data acquisition tasks and SQL database read / write tasks; The wireless communication adaptive optimization submodule is used to dynamically adjust the Modbus communication timeout based on the wireless channel frame drop rate. The data frame processing submodule is used to register response data frame processing functions to identify the measurement point ID, convert hexadecimal to floating point, and perform CRC data verification.

[0009] In one implementation, when the frame drop rate exceeds 0.2, the Modbus communication timeout is adjusted to twice the initial timeout; when the frame drop rate does not exceed 0.2 but exceeds 0.1, the Modbus communication timeout is adjusted to 1.5 times the initial timeout.

[0010] In one implementation, the first preset strategy includes: reading the measurement point data obtained from the SQL database for the latest first preset number of scan cycles, calculating the average value, and using the average value as the update data of the second register; or, reading the measurement point data with a quality of 1 obtained from the SQL database for the latest first preset number of scan cycles, calculating the average value, and using the average value as the update data of the second register.

[0011] In one implementation, the external industrial controller has a hardware abstraction layer, which includes a sensor abstraction parent class and multiple sensor subclasses that inherit from the sensor abstraction parent class. Sensors of the same type correspond to the same sensor subclass. All sensor subclasses contain the same fields and methods; The method includes at least: Functions for converting IEEE 754 big-endian hexadecimal numbers to floating-point numbers; A function used to read the decimal point position of measurement point data; A function used to read the units of measurement point data; A function used to generate Modbus communication CRC checksums.

[0012] In one embodiment, the Modbus analog-to-digital converter is connected to the measuring point sensor via Modbus communication and is used to convert the measuring point data collected by the measuring point sensor from analog signals to digital signals. And / or, the measuring point sensor includes at least one of a temperature sensor, a pressure sensor, a flow sensor, and a voltage sensor.

[0013] In one implementation, the LoRa communication gateway has channel frequencies of 4700×100kHz and 4800×100kHz, with one main and one backup.

[0014] In one embodiment, the Modbus analog-to-digital converter is connected to the LoRa communication transceiver module via an RS485 interface. And / or, the master station interface and the LoRa communication gateway, as well as the slave station interface and the DCS distributed control system, are connected via an RS485 interface.

[0015] The beneficial effects of the technical solution provided in this application include: The wireless data communication system provided in this application embodiment sets up a local SQL database as a data buffer in the external industrial controller, thereby continuously storing historical measurement point data and processing it according to a first preset strategy. This ensures that even in the case of unstable or delayed wireless communication, the system can still provide a continuous and reliable data stream to the DCS distributed control system. Since the external industrial controller uses a second register to temporarily store the processed measurement point data according to the first preset strategy, it achieves immediate response to read requests from the DCS distributed control system, thus solving the problems of high communication latency and unstable data transmission commonly encountered when traditional measurement points use wireless communication to access the DCS distributed control system. Therefore, this application solves the problems of communication latency and unstable communication nodes encountered by traditional measurement points using wireless communication to access the DCS distributed control system. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 A block diagram of a wireless data communication system provided in an embodiment of this application; Figure 2 A high-performance asynchronous event loop processing architecture diagram of an external industrial controller provided in the embodiments of this application; Figure 3 This is a working thread processing logic diagram of an external industrial controller provided in an embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] See Figure 1 As shown, this application provides a wireless data communication system applicable to sensor measurement point data acquisition in thermal power plants. Based on LoRa wireless transparent transmission technology, this application transmits the acquired measurement point data to an external industrial controller. The external industrial controller, the DCS distributed control system, and the wireless transparent transmission transceiver all use RS485 connections and Modbus data format for communication. Furthermore, the external industrial controller maintains a local SQL database to provide temporary data storage. The wireless data communication system includes a Modbus analog-to-digital converter, a wireless transparent transmission transceiver, and an external industrial controller.

[0020] The Modbus analog-to-digital converter is used to connect to the measuring point sensor and store the measuring point data collected by the measuring point sensor in the first register of the Modbus analog-to-digital converter.

[0021] It is understood that the Modbus analog-to-digital converter is connected to the measuring point sensor via Modbus communication and is used to convert the measuring point data collected by the measuring point sensor from analog signals to digital signals, and then store them in the first register of the Modbus analog-to-digital converter. Different measuring point sensors are assigned different first registers, and the first register temporarily stores the measuring point data. When new measuring point data is detected again, the new measuring point data is stored in the first register to overwrite the previously stored measuring point data.

[0022] As an example, the measuring point sensor includes at least one of a temperature sensor, a pressure sensor, a flow sensor, and a voltage sensor. Correspondingly, the measuring point data detected by the temperature sensor is the temperature data of the measuring point, the measuring point data detected by the pressure sensor is the pressure data of the measuring point, the measuring point data detected by the flow sensor is the flow data of the measuring point, and the measuring point data detected by the voltage sensor is the voltage data of the measuring point.

[0023] Understandably, Modbus analog-to-digital converters (ADCs) have multiple channels, each capable of connecting to a single sensor. A Modbus ADC can simultaneously connect multiple sensors of the same type; for example, an ADC with eight channels can connect eight temperature sensors simultaneously. These eight sensors detect temperatures at eight different sensor points, and the resulting temperatures are stored in corresponding registers allocated by the Modbus ADC. This multi-channel design reduces equipment costs, minimizes wiring, improves system reliability, enables centralized management of similar sensor points, and significantly enhances data acquisition efficiency and maintenance convenience in thermal power plants.

[0024] All measuring point sensors support the Modbus data communication protocol. If the measuring point sensor has its own analog-to-digital conversion function and does not require an additional Modbus analog-to-digital converter, then the measuring point sensor supports the RS485 interface.

[0025] The wireless transparent transmission transceiver includes a LoRa communication gateway and a LoRa communication transceiver module with wireless communication connection. The LoRa communication transceiver module is used to receive measurement point data in the first register and send it to the LoRa communication gateway. The LoRa communication gateway can communicate with multiple LoRa communication transceiver modules. Data transmission adopts a transparent transmission mode, and the LoRa communication transceiver module is connected to the RS485 loop of the field measurement point.

[0026] The LoRa communication gateway uses two channel frequencies: 4700×100kHz and 4800×100kHz. By configuring a dual-channel transmission, with one channel as the primary and one as the backup, stable communication can be ensured. The dual-channel design effectively avoids frequency band interference, and automatic switching between primary and backup ensures communication continuity, improves system reliability, and guarantees stable transmission of critical data from thermal power plants. Normally, 4700×100kHz is used; if this channel becomes unreachable, it will automatically switch to 4800×100kHz to attempt communication.

[0027] The Modbus analog-to-digital converter and the LoRa communication transceiver module are connected via an RS485 interface; the master station interface and the LoRa communication gateway, as well as the slave station interface and the DCS distributed control system, are connected via an RS485 interface, and the data transmission format is Modbus RTU.

[0028] The master interface of the external industrial controller is connected to the LoRa communication gateway, and the slave interface is used to connect to the DCS distributed control system. The external industrial controller is used to store the received measurement point data in its SQL database, listen to the DCS distributed control system, and respond to the read request of the DCS distributed control system. It extracts the measurement point data from the second register of the external industrial controller and sends it to the DCS distributed control system. It also reads the measurement point data from the SQL database according to a first preset strategy to update the second register.

[0029] As an example, the external industrial controller uses the domestically produced RK3588 as its main control chip. This external industrial controller features a CPU with a clock speed of up to 2.4GHz and a high-performance quad-core Mali-G610 GPU. It runs on a Linux operating system and has developed a complete Modbus master-slave communication configuration based on the Modbus protocol, achieving compatible data acquisition from heterogeneous devices, wireless transmission delay management and control, and a standardized data interface for communication with a DCS distributed control system.

[0030] This external industrial controller features a hardware interface including two USB 2.0 ports, two USB 3.0 ports, an HDMI output, an OTG interface, two RS485 interfaces, a 24V power interface, a push-button switch, and an LED indicator. One of the two RS485 interfaces serves as the master interface, connecting to a LoRa communication gateway and actively acquiring data from slave measurement points. The other serves as a slave interface, connecting to a DCS (Distributed Control System) and responding to data command requests from the DCS. This external industrial controller has an open operating system, compatible with C / C++ and Python development environments, facilitating the maintenance and deployment of algorithm functions.

[0031] The data transmission process for the measurement points in this application is as follows: (1) Bottom-up data acquisition flow (measuring point sensor → DCS distributed control system) Field physical quantity → Measuring point sensor → Modbus analog-to-digital converter → RS485 bus → LoRa communication transceiver module → LoRa wireless transparent transmission → LoRa communication gateway → RS485 bus → External industrial controller (master interface) → SQL database → External industrial controller (slave interface) → RS485 bus → DCS distributed control system.

[0032] (2) Top-down request-response flow (DCS distributed control system → measuring point sensor) DCS Distributed Control System → RS485 Bus → External Industrial Controller (Slave Interface) → Second Register → External Industrial Controller (Master Interface) → RS485 Bus → LoRa Communication Gateway → LoRa Wireless Transmission → LoRa Communication Transceiver Module → RS485 Bus → Modbus Digital-to-Analog Converter → Measuring Point Sensor.

[0033] The wireless data communication system provided in this application embodiment sets up a local SQL database as a data buffer in the external industrial controller, thereby continuously storing historical measurement point data and processing it according to a first preset strategy. This ensures that even in the case of unstable or delayed wireless communication, the system can still provide a continuous and reliable data stream to the DCS distributed control system. Since the external industrial controller uses a second register to temporarily store the processed measurement point data according to the first preset strategy, it achieves immediate response to read requests from the DCS distributed control system, thus solving the problems of high communication latency and unstable data transmission commonly encountered when traditional measurement points use wireless communication to access the DCS distributed control system. Therefore, this application solves the problems of communication latency and unstable communication nodes encountered by traditional measurement points using wireless communication to access the DCS distributed control system.

[0034] The external industrial controller includes a Modbus master station acquisition function to acquire measurement point data stored in the first register. This master station acquisition function abstracts sensors of the same type into a corresponding sensor subclass. All sensor subclasses inherit from the same sensor parent class, containing the same fields and methods, forming a set of underlying hardware abstraction layers (HAL). The HAL library functions are pre-developed according to the design manuals of each different type and brand of sensor.

[0035] Specifically, the external industrial controller has a hardware abstraction layer, which includes a sensor abstraction parent class and multiple sensor subclasses that inherit from the sensor abstraction parent class. Sensors of the same type correspond to the same sensor subclass. All sensor subclasses contain the same fields and methods. The methods include at least: (1) a function for converting IEEE 754 big-endian format hexadecimal to floating-point numbers; (2) a function for reading the decimal point position of the measurement point data; (3) a function for reading the unit of the measurement point data; and (4) a function for generating Modbus communication CRC checksums.

[0036] The hardware abstraction layer design in this application adopts an object-oriented class inheritance mechanism, abstracting the same type of sensor into corresponding sensor subclasses that inherit a unified parent class interface. This enables standardized management and data processing of sensors of different brands and types, ensuring consistent execution of key functions such as IEEE 754 big-endian format conversion, decimal point position recognition, automatic unit matching, and CRC verification. This application pre-develops dedicated class functions for each sensor type, avoiding parsing errors caused by data format differences, thus significantly improving the accuracy and reliability of data acquisition. Furthermore, by unifying the data processing flow and interface specifications, this application simplifies the configuration process for adding measurement points, thereby greatly improving system scalability and maintenance convenience.

[0037] Understandably, a custom HAL hardware abstraction library can be flexibly applied to various measuring point sensors, such as temperature sensors, pressure sensors, flow sensors, voltage sensors, PT100 platinum thermal sensors, etc.

[0038] When the external industrial controller acts as the master station, an SQL database is constructed to store the measurement data of each slave station (i.e., measurement point or measurement point sensor).

[0039] The SQL database includes SQL data tables, each containing a primary key ID, a scan cycle (scan_cycle) for reading data from the first register, a timestamp, a station ID (station_id), the value of the measurement point data collected by the measurement point sensor, and the data quality (data_quality). The scan_cycle is the number of measurement point data read by the external industrial controller after incrementing by 1, and the timestamp is the time when the measurement point data was read and stored, accurate to the year, month, day, hour, minute, and second. This SQL database is stored on the hard drive of the external industrial controller, and a synchronization lock ensures the atomicity of each read / write operation.

[0040] The measurement point data quality is set to 0 or 1. When communication fails or data reading is abnormal, the measurement point data quality is 0; otherwise, the measurement point data quality is 1. The scanning cycle configuration avoids the problem of some measurement point data being updated too quickly and others being delayed too much due to wireless communication, thus ensuring the synchronization of the measurement point data.

[0041] This application's SQL database stores complete historical data for each measurement point and marks it with scan_cycle, thereby ensuring strict time synchronization of data from multiple measurement points. The data_quality field identifies the data quality status in real time, enabling accurate identification and isolation of communication anomalies and preventing single-point failures from affecting the overall system. By employing a synchronization lock mechanism to ensure the atomicity of read and write operations, data consistency and integrity are ensured in a multi-threaded environment, effectively solving the problems of wireless communication latency and instability. This allows the DCS system to always obtain a continuous and reliable data stream, achieving seamless integration of wireless data with the DCS system.

[0042] Assuming there are 3 measurement points (station_id 101, 102, and 103 respectively), data is collected once per scanning cycle, as shown in the table below:

[0043] When communication fails or data reading is abnormal, the corresponding measurement point is assigned measurement point data in the SQL data table according to the second preset strategy; the second preset strategy includes: the average value of the measurement point data obtained in the latest second preset number of scanning cycles of the measurement point is used as the measurement point data of the measurement point in the current scanning cycle.

[0044] The second preset number of times can be set according to actual needs, and the second preset number of times is greater than or equal to 1.

[0045] For example, if the second preset number of scans is 1, and the current scan cycle is the 10th scan, then the measurement point data obtained in the 9th scan cycle will be used as the measurement point data for this scan cycle. As an example, in the table above with ID=4, if station_id=101 experiences a communication failure or data reading error, then value=100.5.

[0046] For example, if the second preset number of times is 3 and the current scanning cycle is the 10th time, then the average value of the measurement point data obtained in the 7th, 8th and 9th scanning cycles will be used as the measurement point data for the current scanning cycle.

[0047] The external industrial controller includes Modbus slave monitoring functionality. When acting as a slave, it starts a subprocess containing two threads. Thread 1 blocks and listens to a serial port, maintaining a memory space with a configurable slave address, number of second registers, and second register addresses. When it receives a read request from the DCS distributed control system, the external industrial controller reads measurement point data from the second register and sends it back to the DCS distributed control system in response. Thread 2 reads measurement point data from the SQL database according to a first preset strategy and fills the corresponding second register with it to update the data in the second register.

[0048] It is understandable that there are multiple second registers. Generally speaking, one measurement point data needs to be stored in two second registers. Therefore, the measurement point data of all measurement points will be stored in all the second registers of the external industrial controller.

[0049] The DCS distributed control system can connect to multiple external industrial controllers simultaneously. When the DCS distributed control system issues a read request, for external industrial controllers with different slave addresses, each external industrial controller will reply to the DCS distributed control system with the measurement point data stored in all of its second registers.

[0050] The first preset strategy includes: reading the measurement point data obtained from the latest first preset number of scan cycles from the SQL database, calculating the average value, and using the average value as the update data of the second register; or, reading the measurement point data with a quality of 1 obtained from the latest first preset number of scan cycles from the SQL database, calculating the average value, and using the average value as the update data of the second register.

[0051] The first preset number of times can be set according to actual needs, and the first preset number of times is greater than or equal to 1.

[0052] For example, if there are 50 measuring point sensors, each scanning cycle will scan and read the measuring point data of these 50 measuring point sensors, for a total of 50 measuring point data. Assuming that one measuring point data is stored in two second registers, the external industrial controller has a total of 100 second registers.

[0053] When thread 2 reads according to the first preset strategy, if the SQL database already stores the measurement point data of the 50 measurement point sensors obtained in the previous 100 scanning cycles, and the measurement point data quality of the 95th, 96th, 97th, and 99th scans is 1, while the measurement point data quality of the 98th and 100th scans is 0.

[0054] If the first preset number of times is 1, then the first preset strategy includes: reading the measurement point data obtained in the 100th scan cycle from the SQL database as the update data of the second register; or, reading the measurement point data obtained in the 99th scan cycle from the SQL database as the update data of the second register.

[0055] If the first preset number of times is 3, then the first preset strategy includes: reading the measurement point data obtained from the 98th, 99th and 100th scan cycles from the SQL database, calculating the average value, and using the average value as the update data of the second register; or, reading the measurement point data obtained from the 96th, 97th and 99th scan cycles from the SQL database, calculating the average value, and using the average value as the update data of the second register.

[0056] This application employs a dual-thread architecture to separate request response from data update. Thread 1 focuses on blocking and listening to DCS read requests in real time, while thread 2 independently updates register data according to a strategy, thereby solving the DCS response problem caused by wireless communication latency. Because the multi-strategy data filling mechanism can select the latest data or use only the average value of data with a quality of 1 based on the importance of the measurement point, it effectively filters communication anomaly noise and improves data reliability. Because the introduction of the data_quality flag enables precise isolation of single-point communication failures, it ensures that even if some measurement points experience communication anomalies, the DCS system can still obtain a complete and continuous data stream, achieving seamless integration and stable communication between wireless data and the DCS system.

[0057] The external industrial controller implements a high-performance asynchronous event loop function. This part fully considers the data delay that may occur in wireless communication and the failure of measurement devices. Based on the Libuv library, it implements asynchronous processing of data acquisition, database writing, database reading, and Modbus slave response functions through an event loop mechanism. In order to manage the data acquisition of multiple measurement sensors simultaneously and avoid the impact of a single measurement sensor failure on the overall system, the system uses Libuv as the core of the event loop to realize non-blocking asynchronous I / O operations.

[0058] Specifically, the external industrial controller has a built-in asynchronous event loop module based on the Libuv library, and the asynchronous event loop module includes: The sensor state machine submodule is used to update the sensor state of the measuring point. The state includes the idle state SENSOR_IDLE=0, the polling state SENSOR_POLLING, the waiting response state SENSOR_WAITING_RESPONSE, the timeout state SENSOR_TIMEOUT, the error state SENSOR_ERROR, and the disabled state SENSOR_DISABLED. The timer management submodule is used to assign timers to all measurement point data acquisition tasks and SQL database read / write tasks; The wireless communication adaptive optimization submodule is used to dynamically adjust the Modbus communication timeout based on the wireless channel frame drop rate. The data frame processing submodule is used to register response data frame processing functions to identify the measurement point ID, convert hexadecimal to floating point, and perform CRC data verification.

[0059] For example, when the frame drop rate exceeds 0.2, the Modbus communication timeout is adjusted to twice the initial timeout; when the frame drop rate is no more than 0.2 but exceeds 0.1, the Modbus communication timeout is adjusted to 1.5 times the initial timeout.

[0060] The above-mentioned 2x and 1.5x, frame drop rates exceeding 0.2 and frame drop rates not exceeding 0.2 but exceeding 0.1 are only examples and can be adjusted according to actual needs.

[0061] See Figure 2 As shown in the diagram, the architecture diagram demonstrates the high-performance asynchronous event loop processing system of the external industrial controller built on the Libuv library, presenting a multi-level asynchronous processing architecture with the event loop as the core and a fault-tolerant design for wireless communication.

[0062] The architecture uses the asynchronous event loop of the Libuv library as the core driving unit, which connects to various Modbus data acquisition tasks and database read / write tasks, and configures independent timers for them to achieve precise task scheduling.

[0063] Simultaneously, a sensor fault-tolerant state machine with six states (including idle, polling, waiting for response, timeout, error, and disabled states) was constructed to manage the communication status of each measurement point in real time. The architecture connects upwards to the data frame processing and Modbus slave response modules, integrating response data frame processing functions such as slave ID recognition, hexadecimal to floating-point conversion, and CRC data verification. It also designed a dynamic optimization link for communication parameters based on the wireless channel frame loss rate, which can adjust parameters such as timeout time and retry count in real time according to the frame loss rate. The overall architecture realizes non-blocking asynchronous I / O operations for data acquisition, database read / write, and Modbus slave response, ensuring that the failure of a single sensor does not affect the operation of the overall system, and adapting to the latency and disconnection characteristics of wireless communication scenarios.

[0064] See Figure 3 As shown, this logic diagram illustrates the working thread processing flow of the external industrial controller, presenting the dual-thread collaborative logic and data interaction link of the Modbus slave monitoring. The first layer is the Modbus master station acquisition thread logic, which starts by calling various sensor subclass functions from the hardware abstraction library (HAL), and after data parsing steps such as IEEE 754 format conversion and CRC check, writes the acquired measurement point data into the local SQL database. At the same time, it completes the synchronization lock control for database read and write and the data quality flag (1 for normal, 0 for abnormal), and accumulates and updates the scan cycle count. The second layer is the dual-thread collaborative logic of the Modbus slave monitoring. Thread 1 continuously blocks and listens to the RS485 serial port, maintains the configurable slave address and register memory space, and feeds back the corresponding register value after receiving the DCS master station read command; Thread 2 reads data from the SQL database according to the first preset strategy and completes the real-time update of the register data.

[0065] In the description of this application, it should be noted that the terms "upper," "lower," etc., indicating the orientation or positional relationship are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. Unless otherwise expressly specified and limited, the terms "installed," "connected," and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication between two elements. For those skilled in the art, the specific meaning of the above terms in this application can be understood according to the specific circumstances.

[0066] It should be noted that in this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0067] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A wireless data communication system, characterized in that, It includes: A Modbus analog-to-digital converter is used to connect to a measuring point sensor and store the measuring point data collected by the measuring point sensor in the first register of the Modbus analog-to-digital converter; A wireless transparent transmission transceiver device includes a LoRa communication gateway and a LoRa communication transceiver module with wireless communication connection. The LoRa communication transceiver module is used to receive measurement point data in a first register and send it to the LoRa communication gateway. An external industrial controller has a master interface connected to the LoRa communication gateway and a slave interface connected to the DCS distributed control system. The external industrial controller stores the received measurement point data in its SQL database, monitors the DCS distributed control system, and responds to the read request from the DCS distributed control system by retrieving measurement point data from the second register of the external industrial controller and sending it to the DCS distributed control system. It also reads measurement point data from the SQL database according to a first preset strategy to update the second register.

2. The wireless data communication system as described in claim 1, characterized in that: The SQL database includes SQL data tables, which include a primary key ID, the number of scan cycles when reading data from the first register, a timestamp, a measurement point ID, measurement point data collected by the measurement point sensor, and the measurement point data quality. The measurement point data quality is set to 0 or 1. When communication fails or data reading is abnormal, the measurement point data quality is 0; otherwise, the measurement point data quality is 1.

3. The wireless data communication system as described in claim 2, characterized in that: When communication fails or data reading is abnormal, the corresponding measurement point data is assigned to the SQL data table according to the second preset strategy. The second preset strategy includes: using the average value of the measurement point data obtained in the latest second preset number of scanning cycles as the measurement point data for the current scanning cycle.

4. The wireless data communication system as described in claim 1, characterized in that: The external industrial controller has a built-in asynchronous event loop module based on the Libuv library. The asynchronous event loop module includes: The sensor state machine submodule is used to update the sensor status at the measuring point. The status includes idle status, polling status, waiting for response status, timeout status, error status, and disabled status. The timer management submodule is used to assign timers to all measurement point data acquisition tasks and SQL database read / write tasks; The wireless communication adaptive optimization submodule is used to dynamically adjust the Modbus communication timeout based on the wireless channel frame drop rate. The data frame processing submodule is used to register response data frame processing functions to identify the measurement point ID, convert hexadecimal to floating point, and perform CRC data verification.

5. The wireless data communication system as described in claim 4, characterized in that: When the frame drop rate exceeds 0.2, the Modbus communication timeout is adjusted to twice the initial timeout; when the frame drop rate is no more than 0.2 but exceeds 0.1, the Modbus communication timeout is adjusted to 1.5 times the initial timeout.

6. The wireless data communication system as described in claim 1, characterized in that: The first preset strategy includes: reading the measurement point data obtained from the latest first preset number of scan cycles from the SQL database, calculating the average value, and using the average value as the update data of the second register; or, reading the measurement point data with a quality of 1 obtained from the latest first preset number of scan cycles from the SQL database, calculating the average value, and using the average value as the update data of the second register.

7. The wireless data communication system as described in claim 1, characterized in that: The external industrial controller has a hardware abstraction layer, which includes a sensor abstraction parent class and multiple sensor subclasses that inherit from the sensor abstraction parent class. Sensors of the same type correspond to the same sensor subclass. All sensor subclasses contain the same fields and methods; The method includes at least: Functions for converting IEEE 754 big-endian hexadecimal numbers to floating-point numbers; A function used to read the decimal point position of measurement point data; A function used to read the units of measurement point data; A function used to generate Modbus communication CRC checksums.

8. The wireless data communication system as described in claim 1, characterized in that: The Modbus analog-to-digital converter is connected to the measuring point sensor via Modbus communication and is used to convert the measuring point data collected by the measuring point sensor from analog signals to digital signals. And / or, the measuring point sensor includes at least one of a temperature sensor, a pressure sensor, a flow sensor, and a voltage sensor.

9. The wireless data communication system as described in claim 1, characterized in that: The LoRa communication gateway has channel frequencies of 4700×100kHz and 4800×100kHz, with one main and one backup.

10. The wireless data communication system as described in claim 1, characterized in that: The Modbus analog-to-digital converter and the LoRa communication transceiver module are connected via an RS485 interface. And / or, the master station interface and the LoRa communication gateway, as well as the slave station interface and the DCS distributed control system, are connected via an RS485 interface.