A configurable data acquisition system for industrial Internet of Things

By designing a configurable data acquisition system and utilizing a unified protocol interface and multi-threading technology, flexible switching between long and short connections is achieved, solving the problem of data acquisition difficulties caused by differences in device communication capabilities and improving the reliability and stability of data acquisition.

CN118921383BActive Publication Date: 2025-01-07BEIJING GUOXIN HUISHI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410877826.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2025-01-07
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

Existing industrial IoT systems struggle to adapt flexibly to different devices based on their varying communication capabilities, leading to difficulties in data collection and frequent device crashes and restarts.

Method used

Design a configurable data acquisition system, including a perception layer, a configuration layer, and a task scheduling layer. Through a unified protocol interface and multi-threading technology, it can achieve flexible switching between long and short connections and perform customized configuration and management according to the differences in device capabilities.

Benefits of technology

It improves the reliability and stability of data acquisition, reduces the data communication processing pressure on the equipment, adapts to differences in equipment communication capabilities, and ensures the continuity of data acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118921383B_ABST
    Figure CN118921383B_ABST
Patent Text Reader

Abstract

The present invention discloses a configurable data acquisition system for industrial Internet of Things, including a data acquisition module for providing support for multiple data communication protocols of industrial Internet of Things devices; the data acquisition module includes a perception layer, a configuration layer and a task scheduling layer; the perception layer provides access and data perception capabilities of multiple protocols; the configuration layer performs customized configuration according to differences in device communication capabilities; and the task scheduling layer performs unified management of protocol connections and read and write operations. The advantages are: the data acquisition operation can be customized according to the data communication processing capabilities of the device, thereby improving the reliability and stability of the data perception capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of industrial Internet of Things, and in particular to a configurable data acquisition system for industrial Internet of Things. Background Art

[0002] There are many types of industrial equipment and instruments, such as Siemens, Mitsubishi, Omron, Panasonic, General Electric, etc. The differences in communication protocols and equipment configurations have led to very complex application scenarios for the Industrial Internet of Things. New equipment has high configuration and strong communication and processing capabilities, while old equipment has low configuration and often has poor communication and processing capabilities, and some do not even support long-connection communication. At present, the data collection and processing of the perception layer system is usually rigid, and often uses the SDK provided by the protocol to establish a long connection based on Socket and read data at a fixed frequency. It does not have the ability to flexibly adapt the collection according to the differences in the communication capabilities of the devices, resulting in many devices or instruments with poor communication processing capabilities often shutting down, requiring frequent restarts or reconnections, making data collection difficult. Summary of the invention

[0003] The object of the present invention is to provide a configurable data acquisition system for industrial Internet of Things, so as to solve the above-mentioned problems existing in the prior art.

[0004] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0005] A configurable data acquisition system for industrial Internet of Things, comprising a data acquisition module for supporting multiple data communication protocols of industrial Internet of Things devices; the data acquisition module comprises a perception layer, a configuration layer and a task scheduling layer;

[0006] The perception layer provides access and data perception capabilities for multiple protocols; the configuration layer performs customized configuration based on differences in device communication capabilities; and the task scheduling layer performs unified management of protocol connections and read and write operations.

[0007] Preferably, the perception layer defines a unified Protocol interface, including Connect method, Disconnect method, IsConnected method, Read method, Write method, and EventHandler method;

[0008] The Connect method has no parameters and no return value. It is used to unify the entry of protocol connection. The specific logic falls into the implementation class, shielding the complexity of multiple protocol connections.

[0009] The Disconnect method has no parameters and no return value, and is used for the interrupt operation of the unified protocol;

[0010] The IsConnected method has no parameters and returns a Boolean value, which is used to monitor the protocol status. It returns a true value when connected and a false value when disconnected.

[0011] The parameter of the Read method is a list of read points, and the sub-items include attributes such as data identification, address, length, type, and byte order;

[0012] The parameters of the Write method are the write point information, including the data address, operation type, write value, type and other attributes, and there is no return value;

[0013] The EventHandler method receives a handler for monitoring various events that occur during the operation of the protocol.

[0014] Preferably, the protocol implementation class first implements the Protocol interface and defines a specific long connection mode; the short connection inherits the long connection implementation class by inheritance, rewrites the Read method and the Writer method, and adds the Connect method and the Disconnect method before and after the operation, respectively, to implement the read and write operations of the short connection mode.

[0015] Preferably, the protocol configured in the configuration layer includes the access protocol type, connection address, connection port, connection mode, and reading frequency;

[0016] The connection address and connection port are the IP and port number corresponding to the protocol respectively; the connection mode is long connection and short connection; the reading frequency is the interval between data reading operations.

[0017] Preferably, the collection item point information configured by the configuration layer includes a collection identifier, a function code, a data address, a data type, and a data length; the collection identifier is used to uniquely mark a collection point; the function code is used to distinguish between multiple read or write types within the protocol; the data address is the specific storage location of the item point data on the protocol server; the data type is used for data verification and conversion; and the data length is used to limit the specific data reading and writing length.

[0018] Preferably, the protocol information and the collection item point information are in a one-to-many correspondence. The configuration layer receives the configuration information through the front-end page, and after interface calls and data processing, persists it to the corresponding protocol table and collection item point table in the MySQL database.

[0019] Preferably, the task scheduling layer arranges and schedules the connection and reading methods of the protocol according to the configuration information of the protocol; the system introduces the idea of ​​AOP aspect-oriented programming, and according to the life cycle of the program, loads the relevant configuration information of the protocol in the system initialization phase, including protocol information and collection item point information, associates the protocol information and collection item point information and organizes them into a protocol item point configuration dictionary; and uses multi-threading technology to asynchronously establish protocol connections.

[0020] Preferably, the system defines a first task scheduler that is executed every N seconds to perform the protocol reading operation; the protocol connection of the long connection type will always be maintained, and the protocol reading operation will be called when reading data; the protocol connection of the short connection type will not be maintained, and the reading operation will first establish a connection, then read and process the data, and the connection will be disconnected after the processing is completed.

[0021] Preferably, the system maintains a global protocol reading time dictionary in the cache. Before reading, the system first obtains the last reading time, connection mode and reading interval. According to the reading interval configuration, it determines whether the reading interval is met this time, thereby determining the data that needs to be read this time. If the judgment is passed, the reading is performed, otherwise it will be skipped, thereby realizing the timed reading function of the protocol;

[0022] If the configuration changes, the system will automatically synchronize the changed configuration, reestablish the connection, and dynamically collect data.

[0023] Preferably, the system defines a second task scheduler that is executed every M seconds to reconnect abnormally interrupted devices; abnormal device information is collected through the EventHand l er method and cached in a lost connection protocol list of the system; when the second task scheduler is executed, it checks whether there is a protocol in the lost connection list, and if so, calls the Connect method of the protocol to reconnect.

[0024] The beneficial effects of the present invention are as follows: 1. The system of the present invention can customize data collection operations according to the data communication processing capabilities of the equipment, thereby improving the reliability and stability of data perception capabilities. 2. The system of the present invention can implement long-connection collection for equipment with strong communication processing capabilities; implement short-connection collection for old equipment with weak communication processing capabilities; and implement timed data collection for scenarios that are not sensitive to data changes. This can adapt to the differences in equipment communication capabilities, reduce the data communication processing pressure of the equipment, and improve the reliability and stability of data collection. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 This is a schematic diagram of a specific method for the perception layer to achieve long and short connections in an embodiment of the present invention;

[0026] Figure 2It is a schematic diagram of the specific configuration and persistence method of the configuration layer in an embodiment of the present invention;

[0027] Figure 3 It is a schematic diagram of a specific scheduling method of the task scheduling layer in an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation methods described herein are only used to explain the present invention and are not used to limit the present invention.

[0029] Embodiment 1

[0030] In this embodiment, in order to cope with the various types of industrial equipment, various communication and processing capabilities, some old equipment does not support long connection communication and other complex industrial application scenarios. The present invention provides a configurable data acquisition system for industrial Internet of Things, and the system specifically includes two modules: data acquisition and asset management. The data acquisition module is used to provide support for various data communication protocols of industrial Internet of Things devices, such as Siemens S7 series, Mitsubishi MC series, various Modbus series protocols, etc. The asset management module can realize the configuration management of industrial equipment and instruments, and associate the acquisition protocols and acquisition attributes of each device.

[0031] The present invention mainly relates to the data acquisition module of the system. The data acquisition module is divided into three levels: perception layer, configuration layer and task scheduling layer. The perception layer provides access and data perception capabilities of multiple protocols; the configuration layer performs customized configuration according to the differences in device communication capabilities; and the task scheduling layer performs unified management of protocol connections and read and write operations.

[0032] 1. Perception layer

[0033] The perception layer defines a unified Protocol interface, including Connect method, Disconnect method, IsConnected method, Read method, Write method, and EventHandler method.

[0034] (1) Connect method: has no parameters and no return value. It is used to unify the entry of protocol connection. The specific logic falls into the implementation class, shielding the complexity of multiple protocol connections.

[0035] (2) Disconnect method: no parameters, no return value, used for interrupt operations of unified protocols.

[0036] (3) IsConnected method: no parameters, return value is Boolean type, used to monitor the protocol status, returns true value when connected, and returns false value when disconnected.

[0037] (4) Read method: The parameter is a list of read points, and the sub-items include attributes such as data identifier, address, length, type, and byte order.

[0038] (5)Write method: The parameters are the write point information, including the data address, operation type, write value, type and other attributes, and there is no return value.

[0039] (6)EventHandler method: Receives a handler to monitor various events that occur during protocol operation.

[0040] In this embodiment, since the connection modes are divided into long connection and short connection, the protocol implementation class first implements the Protocol interface and defines the specific long connection mode. The short connection inherits the long connection implementation class by inheritance, rewrites the Read method and the Write method, and adds the Connect method and the Disconnect method before and after the operation to implement the read and write operations of the short connection mode. The specific implementation method is as follows: Figure 1 shown.

[0041] 2. Configuration layer

[0042] The configuration layer is the configuration basis for the connection layer and task scheduling layer.

[0043] The configured protocol includes the access protocol type, connection address, connection port, connection mode, reading frequency, etc. The connection address and connection port are the IP and port number corresponding to the protocol respectively; the connection mode is long connection and short connection; the reading frequency is the interval of data reading operation, expressed in seconds.

[0044] The configured collection item information includes collection identification, function code, data address, data type, data length, etc. The collection identification is used to uniquely mark a collection point; the function code is used to distinguish between multiple read or write types in the protocol; the data address is the specific storage location of the item data on the protocol server; the data type is used for data verification and conversion, such as integer, floating point, character, etc.; the data length is used to limit the specific data reading and writing length.

[0045] In this embodiment, the protocol information and the collection point information are in a one-to-many correspondence. The configuration layer receives the configuration information through the front-end page, and after interface calls and data processing, it is persisted to the corresponding protocol table and collection point table of the MySQL database. The specific configuration and persistence methods are as follows Figure 2 shown.

[0046] 3. Task Scheduling Layer

[0047] The task scheduling layer arranges and schedules the connection and reading methods of the protocol according to the configuration information of the protocol; the system introduces the idea of ​​AOP aspect-oriented programming, and according to the life cycle of the program, loads the relevant configuration information of the protocol during the system initialization phase, including protocol information and collection item point information, associates the protocol information and collection item point information and organizes them into a protocol item point configuration dictionary; and uses multi-threading technology to asynchronously establish protocol connections. Specifically, Figure 3 shown.

[0048] In this embodiment, the system defines a first task scheduler that is executed every N seconds (such as 1 second) to perform the protocol read operation; the protocol connection of the long connection type will be maintained, and the protocol read operation will be called when reading data; the protocol connection of the short connection type will not be maintained, and the read operation will first establish a connection, then read and process the data, and the connection will be terminated after the processing is completed. Figure 3 ① in the.

[0049] In this embodiment, the system maintains a global protocol read time dictionary in the cache. Before reading, the system will first obtain the last read time, connection mode and read interval. According to the read interval configuration, it is determined whether the read interval is met this time, so as to determine the data to be read this time. If the judgment is passed, the reading is performed, otherwise it will be skipped to realize the timed reading function of the protocol; the process is as follows Figure 3 ② in the.

[0050] If the configuration changes, the system will automatically synchronize the configuration changes, reestablish the connection, and dynamically collect data. Figure 3 ③ in the.

[0051] In this embodiment, the system defines a second task scheduler that is executed every M seconds (such as 15 seconds) to reconnect abnormally interrupted devices; abnormal device information is collected through the EventHand l er method and cached in a lost connection protocol list of the system; when the second task scheduler is executed, it will check whether there is a protocol in the lost connection list. If so, the Connect method of the protocol is called to reconnect, thereby improving the reliability of data collection in the system.

[0052] In this embodiment, there are 10 ventilation and dust removal units in the workshop, all of which support the Siemens S7-1200 protocol for data communication, but the equipment data communication processing capability is relatively weak and only supports one data channel. Using the Socket long connection method, data is read every 15 seconds. Since other systems will also try to connect to the data communication module, in less than 30 minutes, data communication is abnormal, the connection is interrupted, and the connection cannot be restored. After the equipment data communication module is restarted, the connection can be re-established and communicate normally. Using the system of the present invention, according to the short connection method (the data channel will not be occupied for a long time), the strategy of reading once every 15 seconds is configured. After the system is running, the equipment runs normally without communication interruption.

[0053] There are nearly 200 temperature and humidity meters in the workshop, which are divided into 2 manufacturers, and both support ModbusTCP protocol for data communication. If the data is read every 3 seconds, the temperature and humidity meter of one manufacturer will be interrupted in communication, and the meter needs to be powered off to restore communication. Since the temperature and humidity data do not change frequently, the system of the present invention is used to configure the collection strategy for the meters of the two manufacturers respectively. The instrument with good processing ability is configured to collect data every 60 seconds, and the instrument with poor processing ability is configured to collect data every 180 seconds. After the system is running, the instrument operates normally without communication interruption.

[0054] Embodiment 2

[0055] In this embodiment, it is planned to collect data from one workshop ventilation and dust removal equipment and one temperature and humidity meter. The details are as follows:

[0056] The data communication module of the ventilation and dust removal equipment uses the Siemens S7-1200 protocol, and the temperature and humidity instrument uses the ModbusTCP protocol. The above equipment and instruments have been connected to the network, the ports have been exposed, and they are running normally.

[0057] Based on the Siemens S7 series protocol and ModbusTCP protocol, the system creates corresponding long connection implementation classes, such as Protocol Siemens Imp l and Protocol ModbusTCP Imp l, implements the methods in the Protocol interface, and defines related properties according to the needs of protocol connection and data reading. For example, the Siemens S7 series protocol requires the host address, port, bracket number and slot number, and the ModbusTCP protocol requires the host address, port and register address. And implement the logic of the interface definition method according to the business scenario. Then create a short connection class, inherit the long connection implementation class, rewrite the Connect, Disconnect, Read and Write methods, where the logic of the first two is empty, the Read method calls the Connect method, Read method and Disconnect method of the parent class in sequence, and the Write method is the same as above.

[0058] When configuring, first configure the protocol table, set the protocol type to S7-1200, the connection address to the IP address, the connection port to the corresponding port number, the connection mode to long connection, and the reading frequency to 15 seconds. Set the associated collection item points to the attributes provided by the device, such as high pressure difference, the function code to MD, the data address to 1116, the data type to floating point, and the data length to 1 byte. The specific implementation shall be based on the actual configuration of the device. Then set the temperature and humidity instrument, select the protocol type to ModbusTCP, the connection address to the IP address, the connection port to the corresponding port number, the connection mode to long connection, and the reading frequency to 3 seconds. And set the associated collection item points, such as temperature, the function code to 03, the data address to 1, the data type to unsigned integer, and the data length does not need to be configured (read according to fixed length).

[0059] Run the system for 120 minutes, observe the data collection and equipment connection status, and find that the equipment and instruments have communication interruption. Restore the equipment, adjust the ventilation and dust removal equipment configuration, use short connection, and read data every 15 seconds; adjust the temperature and humidity instrument to read data every 180 seconds. After the system configuration is synchronized, continue to observe the operation status for 2 days, and no abnormalities occur in the communication between the equipment and instruments. The stability and reliability of the entire data collection have been significantly improved.

[0060] By adopting the above technical solution disclosed in the present invention, the following beneficial effects are obtained:

[0061] The present invention provides a configurable data acquisition system for industrial Internet of Things. The system of the present invention can customize data acquisition operations according to the data communication processing capabilities of the equipment, thereby improving the reliability and stability of data perception capabilities. The system of the present invention can implement long-connection acquisition for equipment with strong communication processing capabilities; implement short-connection acquisition for old equipment with weak communication processing capabilities; and implement timed data acquisition for scenarios that are not sensitive to data changes. This can adapt to the differences in equipment communication capabilities, reduce the data communication processing pressure of the equipment, and improve the reliability and stability of data acquisition.

[0062] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be considered as the scope of protection of the present invention.

Claims

1. A configurable data acquisition system for industrial Internet of Things, characterized by: It includes a data acquisition module for providing support for multiple data communication protocols of industrial Internet of Things devices; the data acquisition module includes a perception layer, a configuration layer and a task scheduling layer; The perception layer provides access and data perception capabilities for multiple protocols; the configuration layer performs customized configuration according to differences in device communication capabilities, implements long connection collection for devices with strong communication processing capabilities, and implements short connection collection for old devices with weak communication processing capabilities; The task scheduling layer manages the connection and read and write operations of the protocol in a unified manner; The perception layer defines a unified Protocol interface, including Connect method, Disconnect method, IsConnected method, Read method, Write method, and EventHandler method; The Connect method has no parameters and no return value. It is used to unify the entry of protocol connection. The specific logic falls into the implementation class, shielding the complexity of multiple protocol connections. The Disconnect method has no parameters and no return value, and is used to unify the interruption operation of the protocol; The IsConnected method has no parameters and returns a Boolean value, which is used to monitor the protocol status. It returns a true value when connected and a false value when disconnected. The parameter of the Read method is a list of read points, and the sub-items include attributes such as data identification, address, length, type, and byte order; The parameters of the Write method are the write point information, including the data address, operation type, write value, type and other attributes, and there is no return value; The EventHandler method receives a handler for monitoring various events that occur during the operation of the protocol; The protocol implementation class first implements the Protocol interface and defines the specific long connection mode. The short connection inherits the long connection implementation class by inheritance, rewrites the Read method and the Write method, and adds the Connect method and the Disconnect method before and after the operation to implement the read and write operations of the short connection mode. The task scheduling layer arranges and schedules the connection and reading methods of the protocol according to the configuration information of the protocol; the system introduces the idea of ​​AOP aspect-oriented programming, and loads the relevant configuration information of the protocol, including protocol information and collection item point information, in the system initialization stage according to the life cycle of the program operation, and associates the protocol information and the collection item point information and organizes them into a protocol item point configuration dictionary; and uses multi-threading technology to asynchronously establish protocol connections; The system maintains a global protocol read time dictionary in the cache. Before reading, it will first obtain the last read time, connection mode and read interval. According to the read interval configuration, it determines whether the read interval is met this time, so as to determine the data to be read this time. If the judgment is passed, the reading will be carried out, otherwise it will be skipped, so as to realize the timed reading function of the protocol. If the configuration changes, the system will automatically synchronize the changed configuration, reestablish the connection, and dynamically collect data.

2. The configurable data acquisition system for industrial Internet of Things according to claim 1, characterized in that: The protocols configured in the configuration layer include the access protocol type, connection address, connection port, connection mode, and reading frequency; The connection address and connection port are the IP and port number corresponding to the protocol respectively; the connection mode is long connection and short connection; the reading frequency is the interval between data reading operations.

3. The configurable data acquisition system for industrial Internet of Things according to claim 2, characterized in that: The collection item point information configured in the configuration layer includes collection identifier, function code, data address, data type, and data length; the collection identifier is used to uniquely mark a collection point; the function code is used to distinguish between multiple read or write types within the protocol; the data address is the specific storage location of the item point data on the protocol server; the data type is used for data verification and conversion; the data length is used to limit the specific data reading and writing length.

4. The configurable data acquisition system for industrial Internet of Things according to claim 3, characterized in that: There is a one-to-many correspondence between protocol information and collection item point information. The configuration layer receives configuration information through the front-end page, and after interface calls and data processing, it is persisted to the corresponding protocol table and collection item point table in the MySQL database.

5. The configurable data acquisition system for industrial Internet of Things according to claim 1, characterized in that: The system defines a first task scheduler that is executed every N seconds to perform protocol read operations. The protocol connection of the long connection type will be maintained, and the protocol read operation will be called when reading data. The protocol connection of the short connection type will not be maintained. The read operation will first establish a connection, then read and process the data, and the connection will be terminated after the processing is completed.

6. The configurable data acquisition system for industrial Internet of Things according to claim 1, characterized in that: The system defines a second task scheduler that is executed every M seconds to reconnect abnormally disconnected devices; abnormal device information is collected through the EventHandler method and cached in a lost connection protocol list of the system; when the second task scheduler is executed, it checks whether there is a protocol in the lost connection list, and if so, calls the Connect method of the protocol to reconnect.

Citation Information

Patent Citations

  • Method for building monitoring agent software of host machine

    CN101799751A

  • Server for realizing double-channel connection, terminal, method and system

    CN105553712A