A multi-protocol multi-interface data distribution system and method based on industrial edge gateway
By designing a multi-protocol and multi-interface data distribution system in the industrial edge gateway, the problems of limited memory and single interface protocol of the industrial edge gateway are solved, multi-protocol and multi-interface data distribution is realized, and the flexibility and stability of data docking are improved. , supports multi-platform data distribution, reducing development complexity and cost.
Patent Information
- Application Number
- CN202410741650.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-08-16
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Industrial edge gateways have limited memory and a single interface protocol in the existing technology, resulting in poor data docking stability and low flexibility, unable to meet the needs of multi-platform data distribution, and low fault tolerance, which increases cost and complexity.
Design a multi-protocol multi-interface data distribution system based on industrial edge gateways, including IoT middleware and industrial edge gateways, through transmission protocol configuration module, interface information configuration module, data source configuration module, custom data format module and other components. Achieve multi-protocol and multi-interface data distribution, support custom data formats and multiple data reporting methods, dynamically allocate memory space, and ensure the flexibility and stability of data docking.
It realizes multi-protocol and multi-interface data distribution, improves the flexibility and stability of data docking, supports data distribution to multiple user platforms, reduces development complexity and cost, and enhances the scalability of industrial edge gateways.
Smart Images

Figure CN118317008B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of industrial Internet of Things, and relates to a multi-protocol multi-interface data distribution system and method based on an industrial edge gateway. Background Art
[0002] Due to limited memory, industrial edge gateways in the industry generally use a single interface of the MQTT protocol to complete data docking. If the interface fails, the data will be lost, the stability is poor, the data docking format is single, and it cannot meet the data format requirements of different users. It is not flexible and scalable, and a lot of time is required to adapt to the needs of each user.
[0003] The industry's interface data docking protocol is single and cannot flexibly adapt to the needs of different communication protocols. When other protocols or interfaces need to be accessed, they need to be redesigned, which increases costs and complexity. In addition, the fault tolerance is low. If an interface fails, the entire communication system will be affected, and it cannot meet the needs of distributing data to multiple platforms.
[0004] For example, the IoT device access method and apparatus based on multi-protocol adaptation (publication number CN113938535A) cannot open multiple interfaces for a certain protocol or multiple protocols at the same time. Each connection is only one protocol and one interface. If there is a problem with the current interface, data loss will occur, and it cannot meet the needs of distributing data to multiple platforms; and uploading data "according to a predetermined data encapsulation format" lacks flexibility. Summary of the invention
[0005] The purpose of the present invention is to provide a multi-protocol multi-interface data distribution system and method based on an industrial edge gateway. The system and method are related to industries such as industrial automation, water affairs, and environmental protection, and are applied in scenarios where industrial edge gateways are used to complete data collection, data monitoring, and data distribution, and realize multi-platform monitoring management.
[0006] In order to achieve the above-mentioned object, the present invention provides a multi-protocol and multi-interface data distribution system based on an industrial edge gateway, including an Internet of Things middleware and an industrial edge gateway; the Internet of Things middleware includes a transmission protocol configuration module, an interface information configuration module, a data source configuration module, a custom data format module, an interface identification module, and a configuration file distribution module; the industrial edge gateway includes a configuration file receiving and storage module, an interface list parsing module, a built-in protocol module, an interface parsing and memory allocation module, a custom data format parsing module, a data encapsulation module, and an interface operation module;
[0007] The transmission protocol configuration module is used to configure a transmission protocol that matches the application layer protocol of the user platform;
[0008] The interface information configuration module is used to configure the interface information, client information or encryption configuration information of the user platform;
[0009] The interface information identification module is used to assign corresponding interface ID and protocol name to the configured interface;
[0010] The data source configuration module is used to configure the data source information, reporting method and default data format that need to be reported corresponding to the interface;
[0011] Custom data format module, used to customize the data format of the configured interface;
[0012] The configuration file sending module is used to send the files configured by the transmission protocol configuration module, the interface information configuration module, the interface information identification module, the data source configuration module, and the custom data format module to the industrial edge gateway;
[0013] The configuration file receiving and storage module is used to receive and store the configuration file sent by the IoT middleware;
[0014] The interface list parsing module reads the configuration file stored in the receiving and storage module, obtains the configured protocol data docking list, traverses and compares it with the protocols in the built-in protocol module, obtains all interfaces corresponding to the legal protocols, saves the interface list corresponding to the legal protocols, and sends the interface list corresponding to the legal protocols to the interface parsing and memory allocation module; the interface list corresponding to the legal protocols consists of the configured protocol type, interface ID, and protocol name;
[0015] Built-in protocol module for presetting transmission protocol type;
[0016] The interface parsing and memory allocation module is composed of an interface parsing module and a memory allocation module; the interface parsing module reads the configuration file stored in the configuration file receiving and storage module according to the interface list corresponding to the legal protocol obtained, and calls the CJSON library to obtain all configuration information corresponding to each interface ID in the interface list corresponding to the legal protocol from the configuration file, including data source, server information, client information, encryption configuration information, theme configuration information, data reporting method and data format information; the interface parsing module also identifies the custom interface according to the protocol name in the interface list corresponding to the legal protocol, and calls the custom JSON data format parsing module, and the custom JSON data format parsing module parses the defined data format into a reportable structure; the memory allocation module dynamically allocates interface memory space according to the number of interfaces, protocol type and the number of variables in the data source;
[0017] The custom data format parsing module is called by the interface parsing and memory allocation modules to parse the custom data format into a reportable structure; the custom data format parsing module is the custom JSON data format parsing module;
[0018] A data encapsulation module is used to encapsulate data into a reporting structure;
[0019] The interface operation module traverses each interface, runs the interface according to the protocol, and reports the data source to the user platform for the reporting interface; for the service interface, the data source is available to the user platform.
[0020] Regardless of whether it is the default data format interface or a custom interface, the configuration of the data source depends on the data required by the user platform.
[0021] In a preferred embodiment, the interface list parsing module opens the configuration file, and then calls the CJSON library to obtain the configured protocol data docking list, the protocol data docking list contains the interface ID, the configured protocol type, and the protocol name, and then traverses and compares with the built-in protocol type of the industrial edge gateway; the built-in protocol types correspond to the reported interface protocol types including MQTT, HTTP, and HJ212-2017, and the corresponding service interface protocol types include MODBUS and OPC UA; when the protocol type in the protocol data docking list cannot match the built-in protocol type of the industrial edge gateway, the protocol type is an illegal protocol, and all interfaces related to the protocol type are directly filtered; and when the protocol type in the protocol data docking list matches the built-in protocol type of the industrial edge gateway, the protocol type is a legal protocol, and all interfaces corresponding to the legal protocol are obtained according to the protocol data docking list, and the interface list corresponding to the legal protocol is saved until the entire protocol data docking list is traversed, and the obtained interface list corresponding to the legal protocol is sent to the interface parsing and memory allocation module.
[0022] Furthermore, the protocol name consists of a protocol type and a custom tag, and the interface information identification module of the Internet of Things middleware assigns a protocol name to each configured interface. When the interface information identification module identifies a custom data format configured by a custom data format module corresponding to a certain interface ID, the protocol name assigned to the interface is added with a custom tag.
[0023] The memory allocation module dynamically allocates memory space according to the number of interfaces in the interface list corresponding to the legal protocol, the protocol type and the number of variables in the data source. The memory space is used to store the data source, server information, client information, encryption configuration information, subject configuration information, data reporting method and data format information of the interface. The data source includes data ID, data type, data name, data status, value, data collection time, the server information includes server IP address, port number, user name, password, client information is client ID, and encryption configuration information includes server root certificate, client certificate, client private key; protocol type refers to: the protocol type MQTT, HTTP or HJ212-2017 corresponding to the reporting interface, and the protocol type MODBUS or OPC UA corresponding to the service interface.
[0024] Regardless of whether it is a service interface or a reporting interface, the data source includes data ID, data type, data name, data status, value, and data collection time.
[0025] According to the protocol type corresponding to each interface and whether the protocol name contains a custom tag, it is divided into 7 types of interfaces: MQTT, HTTP, MODBUS, OPCUA, HJ212-2017, custom MQTT, and custom HTTP;
[0026] The memory occupied by the interface configuration information of the 7 interfaces except the data source is Y A , Y B , Y C , Y D , Y E , Y F , Y G , Y A , Y B , Y C , Y D , Y E , Y F , Y G are respectively preset fixed values, which are determined according to the memory space required by the interface configuration file other than the data source corresponding to the interface type;
[0027] The memory occupied by the seven interface data source configurations is X A , X B , X C , X D , X E , X F , X G ; Among them, the memory space required for storing a single data in the data source is Q, the data is a variable, and the data volume in the 7 interface data source configurations is N A 、N B 、N C、N D 、N E 、N F 、N G ; The memory required for the 7 interface configurations is Z A , Z B , Z C , Z D , Z E , Z F , Z G ;
[0028] X i =N i *Q (1) Z i =N i *Q+Y i (2)
[0029] i=A, B, C, D, E, F, G;
[0030] S is the total size of the memory space that can be allocated by the memory allocation module; M is the maximum number of interfaces that can be configured in the IoT middleware; M satisfies the following conditions:
[0031] M=S / Z max (3)
[0032] Z max =N max *Q+Y max (4)
[0033] Z max Configure the maximum memory required for a single interface; N max The maximum amount of data that is defined for a single interface data source; max Y A , Y B , Y C , Y D , Y E , Y F , Y G The maximum value in .
[0034] M is calculated by the memory allocation module of the industrial edge gateway and sent to the IoT middleware by the memory allocation module. When the total number of interfaces configured in the IoT middleware exceeds M, the IoT middleware prompts that the number of interfaces allowed to be configured is full, making it impossible to complete the configuration of the interfaces that exceed the number in the IoT middleware. In this way, the memory space of the edge industrial gateway is prevented from being overloaded.
[0035] In a preferred embodiment, the processing steps of the custom JSON data format parsing module are:
[0036] The CJSON library is called to parse the custom JSON data structure configured by the custom data format module (specifically, after the memory allocation module allocates memory space for the interface, the content stored in the memory space includes the custom JSON data structure, and the custom JSON data format parsing module directly obtains the custom JSON data structure from the memory space). A recursive algorithm is used in the parsing process to recurse to the bottom layer of the data structure. In this article, the CJSON library is located in the industrial edge gateway.
[0037] The custom JSON data format parsing module starts from the root node and determines the type of the node. If it is an array, it needs to continue recursion; if it is an object, it needs to traverse the key-value pairs in the object;
[0038] When traversing all key-value pairs in the object, if it is a basic data type, including string, number, Boolean value, and NULL, the key-value pair is added to the parent node, and the data ID information is added to the key-value pair to replace the current value and collection time information when reporting; if it is an object or array, an object or array of the same type is created based on the object or array, and the object or array of the same type is used as the parent node of the child node. The key-value pair under the child node is hung under the created object or array, and the recursion is continued until the entire tree structure is traversed.
[0039] Furthermore, in the transmission protocol configuration module, the configured transmission protocol types include MQTT, HTTP, HJ212-2017, MODBUS, and OPC UA; in the interface information configuration module, the interface information includes the IP address, port number, and / or client information, encryption configuration information, and subject configuration information of the user platform; in the data source configuration module, the data source information includes data ID, data type, data name, data status, value, and data collection time, and the reporting method includes real-time, periodic, or regular reporting; the industrial edge gateway can act as a server to provide a data source for the user platform to obtain on demand, or it can act as a client to actively report data to the user platform;
[0040] The files configured by the transmission protocol configuration module, interface information configuration module, interface information identification module, data source configuration module, and custom data format module include:
[0041] ① A list of multiple interfaces and multiple protocols, i.e. a list of protocol data connection;
[0042] ②Configuration of a single interface protocol, i.e. MQTT / HTTP: server configuration, client configuration, reported data source, encryption configuration, reporting method, topic configuration; MODBUS / OPC UA / HJ212: server configuration, data source;
[0043] ③ Custom interface configuration. The custom interface is supported by MQTT / HTTP, and the data format defined by the interface is configured according to the JSON format specification.
[0044] In a preferred embodiment, it supports opening multiple interfaces for a single protocol, supports reporting data to multiple user platforms simultaneously through a single protocol, and supports opening multiple protocols simultaneously.
[0045] Furthermore, when deleting, modifying or adding interface information in a configuration file, the transmission protocol configuration module, interface information configuration module, interface information identification module, data source configuration module, and custom data format module in the Internet of Things middleware are used to delete, modify or add interface information, and a new configuration file with the same name as the configuration file is regenerated. After the new configuration file is sent to the industrial edge gateway, it overwrites the original configuration file and is re-stored by the configuration file receiving and storage module. The interface list parsing module generates an updated interface list corresponding to the legal protocol, and the interface parsing and memory allocation module re-parses and dynamically reallocates the memory space of each interface corresponding to the legal protocol, and then the interface running module re-runs each interface corresponding to the legal protocol.
[0046] Another object of the present invention is to disclose a multi-protocol multi-interface data distribution method based on an industrial edge gateway, comprising the following steps:
[0047] Configure the transmission protocol that matches the application layer protocol of the user platform in the IoT middleware; configure the interface information, client information or encryption configuration information, and subject configuration information of the user platform; configure the data source information, reporting method, and default data format that need to be reported corresponding to the interface, assign the corresponding interface ID and protocol name to the configured interface, configure the custom data format, and form a configuration file; configure either the custom data format or the default data format;
[0048] Send the configuration file on the IoT middleware to the industrial edge gateway;
[0049] The industrial edge gateway receives and stores the configuration file sent by the Internet of Things middleware, reads the configuration file, obtains the configured protocol data docking list, traverses and compares it with the protocol type in the built-in protocol module, obtains all interfaces corresponding to the legal protocol, and saves the interface list corresponding to the legal protocol; according to the interface list corresponding to the legal protocol, reads the configuration file, calls the CJSON library to obtain all configuration information corresponding to each interface ID in the interface list corresponding to the legal protocol from the configuration file, including data source, server information, client information, encryption configuration information, data reporting method and data format information; identifies the custom interface according to the protocol name in the interface list corresponding to the legal protocol, and parses the defined data format into a reportable structure; dynamically allocates interface memory space according to the number of interfaces, protocol type and the number of variables in the data source; traverses each interface, runs the interface according to the protocol, and reports the data source to the user platform for the reporting interface; for the service interface, the data source is available for the user platform to obtain.
[0050] In a preferred implementation scheme, each interface is traversed, and the interface is run according to the protocol. For the reporting interface, the data source is reported to the user platform; for the service interface, the data source is available to the user platform, specifically: the interface running module traverses each interface in the industrial edge gateway that dynamically allocates memory space, runs each interface according to the protocol corresponding to the interface, and each interface communicates one by one with the corresponding interface of one or more user platforms to report data (corresponding to the reporting interface) or call data (corresponding to the service interface); wherein each interface in the industrial edge gateway that dynamically allocates memory space, according to the configuration file issued by the Internet of Things middleware and after matching with the built-in protocol of the industrial edge gateway, realizes the dynamic allocation of the memory space of the interface corresponding to the legal protocol in the industrial edge gateway.
[0051] Compared with the prior art, the present invention supports multiple interface protocols, supports multiple interfaces for one protocol, multiple interfaces for multiple protocols, custom data formats, and multiple data reporting methods (real-time, periodic, and regular). It can simultaneously distribute SSL / TLS encrypted data to multiple user platforms without repeated development, and can perfectly connect according to the user-specified data format, thereby improving data connection efficiency and the scalability of industrial edge gateways. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 It is a schematic diagram of a multi-protocol and multi-interface data distribution system based on an industrial edge gateway;
[0053] Figure 2 A schematic diagram for multi-interface operation;
[0054] Figure 3 A diagram of a custom JSON data format parsing module. DETAILED DESCRIPTION
[0055] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0056] A multi-protocol multi-interface data distribution system based on an industrial edge gateway, comprising an Internet of Things middleware and an industrial edge gateway; the Internet of Things middleware comprises a transmission protocol configuration module, an interface information configuration module, a data source configuration module, a custom data format module, an interface identification module, and a configuration file distribution module; the industrial edge gateway comprises a configuration file receiving and storage module, an interface list parsing module, a built-in protocol module, an interface parsing and memory allocation module, a custom data format parsing module, a data encapsulation module, and an interface operation module;
[0057] The transmission protocol configuration module is used to configure a transmission protocol that matches the application layer protocol of the user platform;
[0058] The interface information configuration module is used to configure the interface information, client information or encryption configuration information of the user platform;
[0059] The interface information identification module is used to assign corresponding interface ID and protocol name to the configured interface;
[0060] The data source configuration module is used to configure the data source information, reporting method and default data format that need to be reported corresponding to the interface;
[0061] Custom data format module, used to customize the data format of the configured interface;
[0062] The configuration file sending module is used to send the files configured by the transmission protocol configuration module, the interface information configuration module, the interface information identification module, the data source configuration module, and the custom data format module to the industrial edge gateway;
[0063] The transmission protocol configuration module, interface information configuration module, interface information identification module, data source configuration module, and custom data format module are associated through interfaces. That is, when configuring interface information, the transmission protocol configuration module configures the transmission protocol and then immediately configures the corresponding interface information through the interface information configuration module (the protocol of the interface is the aforementioned configured transmission protocol). If it is a service interface, the interface information includes server information (for service interface, the server refers to the industrial edge gateway, and the server information is the connection information, specifically: for serial communication: service address, baud rate, check bit, data bit, stop bit; for network communication: port number). If it is a reporting interface , the interface information includes server information, client information, encryption configuration information, and topic configuration information; then the interface information identification module assigns a protocol name and a unique interface ID; then the data source configuration module configures the relevant data source information and default data format of the corresponding interface ID, and for the reporting interface, also configures the reporting method; optionally, the custom data format module configures the custom data format information (including data format and reporting method) of the corresponding interface ID; when there is corresponding custom data format information corresponding to a certain interface ID, the interface information identification module adds a custom tag to the corresponding protocol name, such as the protocol name corresponding to a certain interface ID is custom MQTT. For each interface, the default data format and the custom data format are selected to complete the configuration.
[0064] The configuration file receiving and storage module is used to receive and store the configuration file sent by the IoT middleware;
[0065] The interface list parsing module reads the configuration file stored in the receiving and storage module, obtains the configured protocol data docking list, traverses and compares it with the protocols in the built-in protocol module, obtains all interfaces corresponding to the legal protocols, saves the interface list corresponding to the legal protocols, and sends the interface list corresponding to the legal protocols to the interface parsing and memory allocation module; the interface list corresponding to the legal protocols consists of the configured protocol type, interface ID, and protocol name;
[0066] Built-in protocol module for preset transmission protocol types (MQTT, HTTP, HJ212-2017, MODBUS, OPCUA);
[0067] The interface parsing and memory allocation module is composed of an interface parsing module and a memory allocation module; the interface parsing module reads the configuration file stored in the configuration file receiving and storage module according to the interface list corresponding to the legal protocol obtained, and calls the CJSON library to obtain all configuration information corresponding to each interface ID in the interface list corresponding to the legal protocol from the configuration file, including data source, server information, client information, encryption configuration information, data reporting method and data format information; the interface parsing module also identifies the custom interface according to the protocol name in the interface list corresponding to the legal protocol, and calls the custom JSON data format parsing module, and the custom JSON data format parsing module parses the defined data format into a reportable structure; the memory allocation module dynamically allocates interface memory space according to the number of interfaces, protocol type and the number of variables in the data source; according to the protocol name in the interface list corresponding to the legal protocol, the custom interface is identified specifically: if the protocol name contains "custom", it is determined to be a custom interface; if the protocol name does not contain "custom", it is determined to be a common interface (i.e., an interface with a default data format).
[0068] The custom data format parsing module is called by the interface parsing and memory allocation modules to parse the custom data format into a reportable structure;
[0069] A data encapsulation module is used to encapsulate data into a reporting structure;
[0070] The interface operation module traverses each interface, runs the interface according to the protocol, and reports the data source to the user platform for the reporting interface; for the service interface, the data source is available to the user platform.
[0071] The interface list parsing module opens the configuration file, and then calls the CJSON library to obtain the configured protocol data docking list (the purpose of calling the CJSON library is to parse and obtain a list of multiple interfaces and multiple protocols from the configuration file). The protocol data docking list contains a list of interface IDs, configured protocol types, and protocol names, which are then traversed and compared with the built-in protocol types of the industrial edge gateway; the protocol types corresponding to the reporting interface in the built-in protocol types include MQTT, HTTP, and HJ212-2017, and the protocol types corresponding to the service interface include MODBUS and OPC UA; when the protocol type in the protocol data docking list cannot match the built-in protocol type of the industrial edge gateway, the protocol type is an illegal protocol, and all interfaces related to the protocol type are directly filtered; when the protocol type in the protocol data docking list matches the built-in protocol type of the industrial edge gateway, the protocol type is a legal protocol, and all interfaces corresponding to the legal protocol are obtained according to the protocol data docking list, and the interface list corresponding to the legal protocol is saved until the entire protocol data docking list is traversed, and the interface list corresponding to the legal protocol is sent to the interface parsing and memory allocation module. At this time, the interface list corresponding to the legal protocol is a list of all interface IDs corresponding to the legal protocol, the corresponding protocol type and the protocol name.
[0072] The protocol name consists of a protocol type and a custom tag. The interface information identification module of the Internet of Things middleware assigns a protocol name to each configured interface. When the interface information identification module identifies a custom data format configured by a custom data format module corresponding to a certain interface ID, the protocol name assigned to the interface is added with a custom tag.
[0073] The memory allocation module dynamically allocates memory space according to the number of interfaces in the interface list corresponding to the legal protocol, the protocol type and the number of variables in the data source. The memory space is used to store the data source, server information, client information, encryption configuration information, subject configuration information, data reporting method and data format information of the interface. The data source includes data ID, data type, data name, data status, value, data collection time, server information includes server IP address, port number, user name, password (corresponding to user platform), client information is client ID (corresponding to industrial edge gateway), encryption configuration information includes server root certificate, client certificate, client private key; protocol type refers to: MQTT, HTTP or HJ212-2017 protocol type corresponding to the reporting interface, and MODBUS or OPC UA protocol type corresponding to the service interface. This section takes the reporting interface as an example to explain in detail, where the server in this section is the user platform and the client is the industrial edge gateway.
[0074] One interface corresponds to a data source, each data source has several variables, and each variable corresponds to a data ID. The data source can be in the default data format or a custom data format.
[0075] Specifically, the memory space of the interface is allocated according to the number of interfaces in the interface list corresponding to the legal protocol, the protocol type and the number of variables in the data source, which means: the memory space is allocated according to the interface, and the memory space allocation of the interface is affected by the protocol type and the number of variables in the data source, wherein different protocol types require different memory spaces (determined according to the memory space required by different protocol types themselves). When there are too many variables (i.e., data) in the data source, the memory allocation module allocates more memory space to the interface, and vice versa.
[0076] The processing steps of the custom JSON data format parsing module are:
[0077] Call the CJSON library to parse the custom JSON data structure configured by the custom data format module. A recursive algorithm is used during the parsing process to recurse to the bottom layer of the data structure.
[0078] The custom JSON data format parsing module starts from the root node and determines the type of the node. If it is an array, it needs to continue recursion; if it is an object, it needs to traverse the key-value pairs in the object;
[0079] When traversing all key-value pairs in the object, if it is a basic data type, including string, number, Boolean value, and NULL, the key-value pair is added to the parent node, and the data ID information is added to the key-value pair to replace the current value and collection time information when reporting; if it is an object or array, an object or array of the same type is created based on the object or array, and the object or array of the same type is used as the parent node of the child node. The key-value pair under the child node is hung under the created object or array, and the recursion is continued until the entire tree structure is traversed.
[0080] In the transmission protocol configuration module, the configured transmission protocol types include MQTT, HTTP, HJ212-2017, MODBUS, and OPC UA; in the interface information configuration module, the interface information includes the IP address, port number, and / or client information, encryption configuration information, and subject configuration information of the user platform; in the data source configuration module, the data source information includes data ID, data type, data name, data status, value, data collection time, and the reporting method includes real-time, periodic, or regular reporting; the industrial edge gateway can act as a server to provide a data source for the user platform to obtain on demand, or it can act as a client to actively report data to the server-user platform;
[0081] The files configured by the transmission protocol configuration module, interface information configuration module, interface information identification module, data source configuration module, and custom data format module include:
[0082] ① A list of multiple interfaces and multiple protocols, i.e. a list of protocol data connection;
[0083] ②Configuration of a single interface protocol, i.e. MQTT / HTTP: server configuration, client configuration, reported data source, encryption configuration, reporting method, topic configuration; MODBUS / OPC UA / HJ212: server configuration, data source;
[0084] ③ Custom interface configuration. The custom interface is supported by MQTT / HTTP, and the data format defined by the interface is configured according to the JSON format specification.
[0085] Support opening multiple interfaces for a single protocol, that is, in one configuration, a single protocol can configure multiple interfaces in the IoT middleware (these interfaces correspond to one or more user platforms), and complete interface list parsing, interface parsing and memory allocation, and interface operation through the industrial edge gateway, supporting data reporting to multiple user platforms at the same time through a single protocol;
[0086] The present invention also supports the simultaneous activation of multiple protocols, that is, the IoT middleware can select multiple protocols in one configuration, configure multiple interfaces accordingly (these interfaces correspond to one or more user platforms), and complete interface list parsing, interface parsing and memory allocation, and interface operation through the industrial edge gateway, thereby actually activating multiple protocols at the same time.
[0087] One configuration forms a configuration file; each configuration corresponds to different data requirements; different configurations will generate different configuration files, and the names of the configuration files are also different. The total number of interfaces configured multiple times must not exceed the maximum number of interfaces M allowed to be configured by the IoT middleware.
[0088] When deleting, modifying or adding interface information in a configuration file, the transmission protocol configuration module, interface information configuration module, interface information identification module, data source configuration module, and custom data format module in the IoT middleware are used to delete, modify or add interface information, and a new configuration file with the same name as the configuration file is regenerated. The new configuration file is sent to the industrial edge gateway and overwrites the original configuration file. The dynamic interface memory space allocated by the original configuration file is parsed in the industrial edge gateway and released, and the configuration file receiving and storage module stores the new configuration file again. The interface list parsing module generates an updated interface list corresponding to the legal protocol, and the interface parsing and memory allocation module reparses and re-dynamically allocates the memory space of each interface corresponding to the legal protocol, and then the interface operation module re-runs each interface corresponding to the legal protocol. After a certain interface is configured and runs on the industrial edge gateway, unless the interface information in the configuration file is deleted, the interface will continue to run on the industrial edge gateway.
[0089] A multi-protocol multi-interface data distribution method based on an industrial edge gateway comprises the following steps:
[0090] Step 1: Configure the data source and select the transmission protocol
[0091] The IoT middleware presets the transmission protocol (MQTT, HTTP, HJ212-2017, MODBUS, OPC UA). According to the application layer protocol used by the user platform, the IoT middleware matches the corresponding transmission protocol. This protocol has met most application scenarios. If you encounter a scenario that cannot be met, both the IoT middleware and the industrial edge gateway need to be upgraded to improve the protocol type (that is, add a transmission protocol). Then, the interface information such as the IP address and port number of the user platform is configured on the IoT middleware through the interface information configuration module. For the reporting interface, the client information, encryption configuration information, and subject configuration information are also required. The data source that needs to be reported under this interface is added through the data source configuration module. Generally, the data name, data collection time, and value are included. Then configure the reporting method (real-time, periodic, rule [support configuration binding a rule, for example, after a certain data value is greater than 10, start pushing data]), and the default data format can be used. The configuration of this interface has been completed. In addition, for different business scenarios, the industrial edge gateway can act as a server (MODBUS, OPC UA) to provide data sources for user platforms to obtain on demand, and can also act as a client (MQTT, HTTP, HJ212-2017) to actively report data to the corresponding user platform. Figure 2 Environmental testing center, customer platform, industrial Internet of Things platform, MES / ERP, SCADA / DCS, etc.
[0092] Considering that different user platforms require different data formats, the industrial edge gateway also supports custom JSON data formats (MQTT, HTTP). You only need to customize the data source in the IoT middleware according to the needs of the user platform (which devices' data (equivalent to variables) need to be reported, devices refer to the devices connected to the industrial edge gateway, and the relevant data of the devices are collected to the industrial edge gateway), reporting methods such as real-time, periodic, and regular [supports configuration to bind a rule, such as starting to push data after a certain data value is greater than 10]) and data format (according to the JSON format specification). To customize the JSON data format (JSON data consists of key-value pairs, which are used to represent the attributes and values of data; basic data types include strings, numbers, Boolean values, arrays, objects, and NULL), users need to configure the hierarchical structure of objects and arrays and the position of the data source key-value pairs in the structure through the custom data format module.
[0093] Step 2: Configuration file distribution and storage
[0094] The industrial edge gateway supports MQTT (Message Queuing Protocol) and HTTP (Hypertext Transfer Protocol) protocols to receive user-configured configuration files. The IoT middleware or local client sends the configuration file to the industrial edge gateway through the MQTT protocol. In view of the needs of large amounts of data and multiple docking interfaces, the HTTP (Hypertext Transfer Protocol) protocol is generally used to receive the sent configuration file, and then the industrial edge gateway will save the configuration file in the local storage. The configuration file mainly contains the following contents:
[0095] ① A list of multiple interfaces and protocols, that is, a list of which protocols and interfaces are needed.
[0096] ②Configuration of a single interface protocol, i.e. MQTT / HTTP: server configuration, client configuration, reported data source, encryption configuration, reporting method, topic configuration; MODBUS / OPC UA / HJ212: server configuration, data source.
[0097] Topic configuration: For example, MQTT: topic name, set the corresponding string, and you can get the pushed data by subscribing to the string; HTTP: URL address, as the push address of the data.
[0098] ③Custom interface (MQTT / HTTP support) configuration, configure the data format defined by the docking interface according to the JSON format specification. Only the MQTT / HTTP protocol types support custom data formats.
[0099] Figure 1In the configuration file, the local client and the IoT middleware send the same information. If the local client sends the configuration file, its configuration method is exactly the same as the IoT middleware.
[0100] Step 3: Parse the interface list corresponding to the configuration and legal protocols
[0101] When the industrial edge gateway reads the configuration file in the local storage, it calls the interface list parsing module. The interface list parsing module opens the configuration file, and then calls the CJSON library in the industrial edge gateway to parse and obtain the configured protocol data docking list. The list contains the interface ID, the configured protocol type, and the list of protocol names (each interface ID corresponds to the protocol type and protocol name), and then traverses and compares with the built-in protocol types of the industrial edge gateway (for the protocol type of the reporting interface: MQTT, HTTP, HJ212-2017; for the protocol type of the service interface: MODBUS, OPC UA). When the protocol type of a protocol in the protocol data docking list cannot match the built-in protocol type of the industrial edge gateway, the protocol is an illegal protocol, and all interfaces related to the protocol type are directly filtered; when the protocol type of a protocol in the protocol data docking list matches the built-in protocol type of the industrial edge gateway, the protocol is a legal protocol. It takes several interfaces to obtain a certain protocol type from the configuration file, and the interface list corresponding to the configured legal protocol is saved until the entire protocol data docking list is traversed, and the interface list corresponding to the obtained legal protocol is sent to the interface parsing and memory allocation module.
[0102] Step 4: Interface parsing, storage allocation and management
[0103] The interface parsing and memory allocation module consists of an interface parsing module and a memory allocation module; the interface parsing module matches the configuration file corresponding to each interface according to the interface list corresponding to the legal protocol. If a legal protocol contains multiple interfaces, but the interface configurations are different, the interface parsing module of the industrial edge gateway calls the CJSON library built into the industrial edge gateway to match the configuration file corresponding to this interface based on the interface ID (this is done by matching the configuration file stored in the industrial edge gateway, i.e., in the configuration file, each interface ID has a corresponding protocol, data source, data format, and other information). At this time, all configuration information corresponding to each interface, such as the protocol type, data source, data format (including the default data format or custom data format), client information, server information, encryption configuration information, etc., is obtained.
[0104] The memory allocation module intelligently allocates memory space according to the number of interfaces in the interface list corresponding to the legal protocol, the protocol type (protocol type for reporting interface: MQTT, HTTP, HJ212-2017; protocol type for service interface: MODBUS, OPC UA) and the number of variables in the data source (i.e. the number of data IDs). If several interfaces are configured, the space for several interfaces is allocated. Because the interface is dynamic, the space used to store the interface configuration is also dynamically allocated. Because the number of interfaces required by each user platform is different, the storage space cannot be fixed to a certain size to ensure that each interface can process data efficiently and stably. That is, a dynamic storage management strategy is adopted to flexibly allocate storage space (i.e. memory space) according to the growth and change of data volume. The storage space is used to save the data source (data ID, data type, data name, data status, value, data collection time) of the protocol interface, server information (IP address, port number, user name, password), client information (client ID), encryption configuration (server root certificate, client certificate, client private key), data reporting method (real-time, periodic, rule [support configuration binding a rule, for example, after a data value is greater than 10, start pushing data]) and the pushed data format and other related information. For custom interfaces, the module will call the custom JSON data format parsing module (in accordance with the JSON format specification) to parse the custom data format into a reportable structure. In this way, flexible management and intelligent resource allocation of the interface protocol are realized, providing efficient and stable data processing services. The server in this paragraph refers to the user platform, and the client refers to the industrial edge gateway. The data types include Boolean type (unsigned 16-bit, signed 16-bit, unsigned 32-bit, signed 32-bit), single-precision floating point (unsigned 64-bit, signed 64-bit), double-precision floating point, etc. The data status includes online or offline. If the data can be collected, it is considered to be in an online state, and if the data cannot be collected, it is considered to be in an offline state.
[0105] The data source information (especially data status, value, and data collection time) stored in the storage space will change because the devices connected to the industrial edge gateway collect relevant data in real time and then collect the relevant data to the industrial edge gateway. When the subsequent interface is running, the data source information currently stored in the memory space is reported to the user platform.
[0106] According to the protocol type corresponding to each interface and whether the protocol name contains a custom tag, it is divided into 7 types of interfaces: MQTT, HTTP, MODBUS, OPCUA, HJ212-2017, custom MQTT, and custom HTTP; custom MQTT and custom HTTP are custom interfaces;
[0107] The memory occupied by the interface configuration information of the 7 interfaces except the data source is Y A , Y B , Y C , Y D , Y E , Y F , Y G , Y A , Y B , Y C , Y D , Y E , Y F , Y G The values are different depending on the protocol type and whether or not they contain custom tags, and are preset fixed values. It can also ensure that the memory occupied by the interface configuration information (data reporting method, data format, server, client, encryption configuration, and subject configuration information) of the seven interfaces other than the data source will not exceed these preset fixed values.
[0108] The memory occupied by the seven interface data source configurations is X A , X B , X C , X D , X E , X F , X G ; Among them, the memory space required for storing a single data in the data source is Q, the data is a variable, and the data volume in the 7 interface data source configurations is N A 、N B 、N C 、N D 、N E 、N F 、N G ; The memory required for the 7 interface configurations is Z A , Z B , Z C , Z D , Z E , Z F , Z G ;
[0109] X i =N i *Q (1) Z i =N i *Q+Y i (2)
[0110] i=A (representing MQTT), B (representing HTTP), C (representing MODBUS), D (representing OPC UA), E (representing HJ212-2017), F (representing custom MQTT), G (representing custom HTTP);
[0111] Different protocol types have no effect on the calculation of the memory occupied by the interface data source configuration X. The value of X depends on the number of data in the data source. Q is a fixed value and is not affected by different protocol types. It can ensure that the memory required for any data will not exceed Q. The Q of a single data of all interfaces is preset to the same value.
[0112] For the same protocol type, when the amount of Ni data is different, the memory required for the interface configuration is also different.
[0113] Where N i No more than N max (limited to the maximum amount of data of a single interface data source) and is an integer. For all interfaces, regardless of the protocol, data source configuration and data format, the maximum amount of data of the data source does not exceed N max .
[0114] S is the total size of the memory space that can be allocated by the memory allocation module. S does not exceed 70% of the total memory of the industrial edge gateway. M is the maximum number of interfaces that can be configured by the IoT middleware. M meets the following conditions:
[0115] M=S / Z max (3)
[0116] Z max =N max *Q+Y max (4)
[0117] Z max Configure the maximum memory required for a single interface; N max The maximum amount of data that is defined for a single interface data source; max Y A , Y B , Y C , Y D , Y E , Y F , Y G The maximum value in .
[0118] In addition to intelligently allocating interface memory space (the memory space is part of the industrial edge gateway CPU, and the total memory space size S that can be allocated by the memory allocation module is less than the total memory space of the industrial edge gateway CPU), the industrial edge gateway also intelligently allocates processing resources, which means: managing the CPU usage of each interface through the operating system built into the industrial edge gateway, so that the interface operation module can run the interface, where CPU refers to the CPU of the industrial edge gateway.
[0119] The data is encapsulated according to the default data format to obtain the reporting structure, or the data format is parsed through a custom JSON data format parsing module, and then the data is encapsulated to obtain the reporting structure, and then reported to the user platform.
[0120] Custom JSON data format parsing module ( Figure 3 ) Processing steps:
[0121] 1. First, configure the JSON data structure, not the data to be reported. Because the data source (value, collection time) will change, the custom JSON data format parsing module will replace the changed information in the structure according to the data ID when the reporting method meets the conditions (real-time, periodic, rule [supports configuration and binding a rule, such as starting to push data after a data value is greater than 10]).
[0122] 2. The industrial edge gateway will call the CJSON library to parse the configured JSON structure. The main algorithm used is a recursive algorithm because the JSON structure is a tree structure. The JSON object consists of key-value pairs, where the value can be a basic data type (such as a string, number, Boolean value, NULL) or a composite data type (such as an array or object). Therefore, the JSON object can be regarded as a tree, where the key of the object is a node, and the corresponding value can be a leaf node or another JSON object or array, thus forming a branch of the tree. It is necessary to recurse all the way to the bottom of the structure.
[0123] 3. The custom JSON data format parsing module starts from the root node and determines the type of the node. If it is an array, it needs to continue recursion; if it is an object, it needs to traverse the key-value pairs in the object.
[0124] 4. The key-value pairs in the object may also be of object type or array type, so it is necessary to traverse all the key-value pairs in the object. If it is a basic data type (such as string, number, Boolean value, NULL), add the key-value pair to the parent node and add data ID information to the key-value pair to replace the current value and collection time information when reporting.
[0125] 5. If it is an object or array, a similar type will be created based on this type and used as the parent node of the child node. The key-value pairs under the child node will be hung under this created type, and the recursion will continue until the entire tree structure is traversed.
[0126] Step 5: Interface operation and data upload
[0127] Start the interface operation module, which traverses each interface, runs the interface according to the protocol, and uploads the data source to the user platform. If it is a custom message format, the data is encapsulated according to the format requirements, and data distribution is completed according to the configured data reporting method (real-time, periodic, rule [supports configuration binding a rule, for example, after a data value is greater than 10, start pushing data]).
[0128] The present invention realizes multi-protocol and multi-interface support: the method allows the industrial edge gateway to select different transmission protocols (reporting interface: MQTT, HTTP, HJ212-2017; service interface: MODBUS, OPC UA) according to data docking requirements, and can simultaneously act as a server or client for data transmission; the reporting interface allows users to configure multiple, meeting the user's needs to report data sources to various cloud platforms.
[0129] The present invention realizes dynamic storage management of interfaces: the interface parsing module intelligently allocates processing resources and memory space according to the number, type and data processing requirements of interfaces to ensure that each interface can perform data processing efficiently and stably; the storage space dynamically allocated on demand will be used to save the interface's data source, server / client information, data format, data reporting method, encryption configuration and other information.
[0130] The present invention can customize the data format, and the gateway supports dynamic adjustment of the data format and transmission protocol to meet the needs of different user platforms; if the user configures a custom interface, the interface parsing module will call the custom data format parsing module to parse the custom data format into a reporting structure. When the data is reported, it will be matched with the data source configured by the user, and the data source selected by the user will be added to the reporting structure.
[0131] The data encryption and security of the present invention are excellent. In multi-protocol data docking, it is crucial to ensure the security of data. The industrial edge gateway (MQTT, HTTP) interface supports the use of SSL / TLS encryption technology to protect data in transmission. Encryption, one-way authentication, and two-way authentication can be selected to confirm that the other party of the communication is indeed the expected server, rather than a disguised middleman.
[0132] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the above embodiments do not limit the present invention in any form, and any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.
Claims
1. A multi-protocol and multi-interface data distribution system based on industrial edge gateway, It is characterized in that It includes an Internet of Things middleware and an industrial edge gateway; the Internet of Things middleware includes a transmission protocol configuration module, an interface information configuration module, a data source configuration module, a custom data format module, an interface information identification module, and a configuration file distribution module; the industrial edge gateway includes a configuration file receiving and storage module, an interface list parsing module, a built-in protocol module, an interface parsing and memory allocation module, a custom data format parsing module, a data encapsulation module, and an interface operation module; The transmission protocol configuration module is used to configure a transmission protocol that matches the application layer protocol of the user platform; The interface information configuration module is used to configure the interface information, client information or encryption configuration information of the user platform; The interface information identification module is used to assign corresponding interface ID and protocol name to the configured interface; The data source configuration module is used to configure the data source information, reporting method and default data format that need to be reported corresponding to the interface; Custom data format module, used to customize the data format of the configured interface; The configuration file sending module is used to send the files configured by the transmission protocol configuration module, the interface information configuration module, the interface information identification module, the data source configuration module, and the custom data format module to the industrial edge gateway; The configuration file receiving and storage module is used to receive and store the configuration file sent by the IoT middleware; The interface list parsing module reads the configuration file stored in the receiving and storage module, obtains the configured protocol data docking list, traverses and compares it with the protocols in the built-in protocol module, obtains all interfaces corresponding to the legal protocols, saves the interface list corresponding to the legal protocols, and sends the interface list corresponding to the legal protocols to the interface parsing and memory allocation module; The interface list corresponding to the legal protocol consists of the configured protocol type, interface ID, and protocol name; Built-in protocol module for presetting transmission protocol type; The interface parsing and memory allocation module is composed of an interface parsing module and a memory allocation module; the interface parsing module reads the configuration file stored in the configuration file receiving and storage module according to the interface list corresponding to the legal protocol obtained, and calls the CJSON library to obtain all configuration information corresponding to each interface ID in the interface list corresponding to the legal protocol from the configuration file, including data source, server information, client information, encryption configuration information, subject configuration information, data reporting method and data format information; The interface parsing module also identifies the custom interface according to the protocol name in the interface list corresponding to the legal protocol, and calls the custom JSON data format parsing module, which parses the defined data format into a reportable structure; the memory allocation module dynamically allocates interface memory space according to the number of interfaces, protocol types and the number of variables in the data source; The custom data format parsing module is called by the interface parsing and memory allocation modules to parse the custom data format into a reportable structure; A data encapsulation module is used to encapsulate data into a reporting structure; The interface operation module traverses each interface, operates the interface according to the protocol, and reports the data source to the user platform for the reporting interface; for the service interface, the data source is available for the user platform to obtain; Supports opening multiple interfaces for a single protocol, supports reporting data to multiple user platforms simultaneously through a single protocol; supports opening multiple protocols at the same time.
2. According to claim 1, a multi-protocol multi-interface data distribution system based on an industrial edge gateway, It is characterized in that The interface list parsing module opens the configuration file and then calls the CJSON library to obtain the configured protocol data docking list. The protocol data docking list contains the interface ID, the configured protocol type, and the protocol name, and then traverses and compares with the built-in protocol types of the industrial edge gateway; the protocol types corresponding to the reporting interface in the built-in protocol types include MQTT, HTTP, and HJ212-2017, and the protocol types corresponding to the service interface include MODBUS and OPC UA; when the protocol type in the protocol data docking list cannot match the built-in protocol type of the industrial edge gateway, the protocol type is an illegal protocol, and all interfaces related to the protocol type are directly filtered; and when the protocol type in the protocol data docking list matches the built-in protocol type of the industrial edge gateway, the protocol type is a legal protocol, and all interfaces corresponding to the legal protocol are obtained according to the protocol data docking list, and the interface list corresponding to the legal protocol is saved until the entire protocol data docking list is traversed, and the interface list corresponding to the obtained legal protocol is sent to the interface parsing and memory allocation module.
3. According to claim 1, a multi-protocol multi-interface data distribution system based on an industrial edge gateway, It is characterized in that The protocol name consists of a protocol type and a custom tag. The interface information identification module of the Internet of Things middleware assigns a protocol name to each configured interface. When the interface information identification module identifies a custom data format configured by a custom data format module corresponding to a certain interface ID, the protocol name assigned to the interface is added with a custom tag.
4. According to claim 1, a multi-protocol multi-interface data distribution system based on an industrial edge gateway, It is characterized in that The memory allocation module dynamically allocates memory space according to the number of interfaces in the interface list corresponding to the legal protocol, the protocol type and the number of variables in the data source. The memory space is used to store the data source, server information, client information, encryption configuration information, subject configuration information, data reporting method and data format information of the interface. The data source includes data ID, data type, data name, data status, value, data collection time, server information includes server IP address, port number, user name, password, client information is client ID, and encryption configuration information includes server root certificate, client certificate, and client private key; The protocol type refers to: the protocol type of the corresponding reporting interface is MQTT, HTTP or HJ212-2017, and the protocol type of the corresponding service interface is MODBUS or OPC UA; According to the protocol type corresponding to each interface and whether the protocol name contains a custom tag, it is divided into 7 types of interfaces: MQTT, HTTP, MODBUS, OPCUA, HJ212-2017, custom MQTT, and custom HTTP; The memory occupied by the interface configuration information of the 7 interfaces except the data source is Y A , Y B , Y C , Y D , Y E , Y F , Y G , Y A , Y B , Y C , Y D , Y E , Y F , Y G are preset fixed values respectively; The memory occupied by the seven interface data source configurations is X A , X B , X C , X D , X E , X F , X G ; The memory space required for a single data storage in the data source is Q, the data is a variable, and the data volumes in the seven interface data source configurations are N. A 、N B 、N C 、N D 、N E 、N F 、N G ; The memory required for the 7 interface configurations is Z A , Z B , Z C , Z D , Z E , Z F , Z G ; X i =N i *Q (1) Z i =N i *Q+Y i (2) i=A, B, C, D, E, F, G; S is the total size of the memory space that can be allocated by the memory allocation module; M is the maximum number of interfaces that can be configured in the IoT middleware; M satisfies the following conditions: M=S / Z max (3) Z max =N max *Q+Y max (4) Z max Configure the maximum memory required for a single interface; N max The maximum amount of data that is defined for a single interface data source; max Y A , Y B , Y C , Y D , Y E , Y F , Y G The maximum value in .
5. According to claim 1, a multi-protocol multi-interface data distribution system based on an industrial edge gateway, It is characterized in that The processing steps of the custom JSON data format parsing module are: Call the CJSON library to parse the custom JSON data structure configured by the custom data format module. A recursive algorithm is used during the parsing process to recurse to the bottom layer of the data structure. The custom JSON data format parsing module starts from the root node and determines the type of the node. If it is an array, it needs to continue recursion; If it is an object, iterate over the key-value pairs in the object; When traversing all key-value pairs in the object, if it is a basic data type, including string, number, Boolean value, and NULL, the key-value pair is added to the parent node, and the data ID information is added to the key-value pair to replace the current value and collection time information when reporting; if it is an object or array, an object or array of the same type is created based on the object or array, and the object or array of the same type is used as the parent node of the child node. The key-value pair under the child node is hung under the created object or array, and the recursion is continued until the entire tree structure is traversed.
6. According to claim 1, a multi-protocol multi-interface data distribution system based on an industrial edge gateway, It is characterized in that In the transmission protocol configuration module, the configured transmission protocol types include MQTT, HTTP, HJ212-2017, MODBUS, and OPC UA; in the interface information configuration module, the interface information includes the IP address, port number, and / or client information, encryption configuration information, and topic configuration information of the user platform; In the data source configuration module, data source information includes data ID, data type, data name, data status, value, data collection time, and reporting methods include real-time, periodic or regular reporting; The industrial edge gateway can act as a server to provide data sources for the user platform to obtain on demand, or it can act as a client to actively report data to the user platform; The files configured by the transmission protocol configuration module, interface information configuration module, interface information identification module, data source configuration module, and custom data format module include: ① A list of multiple interfaces and multiple protocols, i.e. a list of protocol data connection; ②Configuration of a single interface protocol, i.e. MQTT / HTTP: server configuration, client configuration, reported data source, encryption configuration, reporting method, topic configuration; MODBUS / OPC UA / HJ212: server configuration, data source; ③ Custom interface configuration. The custom interface is supported by MQTT / HTTP, and the data format defined by the interface is configured according to the JSON format specification.
7. According to claim 1, a multi-protocol multi-interface data distribution system based on an industrial edge gateway, It is characterized in that When deleting, modifying or adding interface information in a configuration file, the transmission protocol configuration module, interface information configuration module, interface information identification module, data source configuration module, and custom data format module in the Internet of Things middleware are used to delete, modify or add interface information, and a new configuration file with the same name as the configuration file is regenerated. After the new configuration file is sent to the industrial edge gateway, it overwrites the original configuration file and is restored by the configuration file receiving and storage module. The interface list parsing module generates an updated interface list corresponding to the legal protocol, and the interface parsing and memory allocation module re-parses and dynamically reallocates the memory space of each interface corresponding to the legal protocol, and then the interface running module re-runs each interface corresponding to the legal protocol.
8. A multi-protocol and multi-interface data distribution method based on industrial edge gateway, It is characterized in that The steps include: Configure the transmission protocol that matches the application layer protocol of the user platform in the IoT middleware; configure the interface information, client information or encryption configuration information, and subject configuration information of the user platform; configure the data source information, reporting method, and default data format that need to be reported corresponding to the interface, assign the corresponding interface ID and protocol name to the configured interface, configure the custom data format, and form a configuration file; You can choose to configure either the custom data format or the default data format; Send the configuration file on the IoT middleware to the industrial edge gateway; The industrial edge gateway receives and stores the configuration file sent by the IoT middleware, reads the configuration file, obtains the configured protocol data docking list, traverses and compares it with the protocol type in the built-in protocol module, obtains all interfaces corresponding to the legal protocol, and saves the interface list corresponding to the legal protocol; according to the interface list corresponding to the legal protocol, reads the configuration file, calls the CJSON library to obtain all configuration information corresponding to each interface ID in the interface list corresponding to the legal protocol from the configuration file, including data source, server information, client information, encryption configuration information, subject configuration information, data reporting method and data format information; identifies the custom interface according to the protocol name in the interface list corresponding to the legal protocol, and parses the defined data format into a reportable structure; dynamically allocates interface memory space according to the number of interfaces, protocol type and the number of variables in the data source; Traverse each interface, run the interface according to the protocol, and report the data source to the user platform for the reporting interface; for the service interface, the data source is available to the user platform; Supports opening multiple interfaces for a single protocol, supports reporting data to multiple user platforms simultaneously through a single protocol; supports opening multiple protocols at the same time.
9. A multi-protocol multi-interface data distribution method based on an industrial edge gateway according to claim 8, It is characterized in that Traverse each interface, run the interface according to the protocol, and for the reporting interface, report the data source to the user platform; for the service interface, the data source is available to the user platform, specifically: the interface running module traverses the interfaces that dynamically allocate memory space in the industrial edge gateway, runs each interface according to the protocol corresponding to the interface, and each interface communicates one by one with the corresponding interface of one or more user platforms to report or call data; among them, each interface that dynamically allocates memory space in the industrial edge gateway, according to the configuration file issued by the Internet of Things middleware and after matching with the built-in protocol of the industrial edge gateway, realizes the dynamic allocation of memory space of the interface corresponding to the legal protocol in the industrial edge gateway.
