CN118317008A - Multi-protocol multi-interface data distribution system and method based on industrial edge gateway - Google Patents

Multi-protocol multi-interface data distribution system and method based on industrial edge gateway Download PDF

Info

Publication number
CN118317008A
CN118317008A CN202410741650.5A CN202410741650A CN118317008A CN 118317008 A CN118317008 A CN 118317008A CN 202410741650 A CN202410741650 A CN 202410741650A CN 118317008 A CN118317008 A CN 118317008A
Authority
CN
China
Prior art keywords
interface
protocol
data
module
configuration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410741650.5A
Other languages
Chinese (zh)
Other versions
CN118317008B (en
Inventor
石守业
甘元林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hewo Wulian Technology Nanjing Co ltd
Original Assignee
Hewo Wulian Technology Nanjing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hewo Wulian Technology Nanjing Co ltd filed Critical Hewo Wulian Technology Nanjing Co ltd
Priority to CN202410741650.5A priority Critical patent/CN118317008B/en
Publication of CN118317008A publication Critical patent/CN118317008A/en
Application granted granted Critical
Publication of CN118317008B publication Critical patent/CN118317008B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Computer And Data Communications (AREA)
  • Communication Control (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The 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, wherein the system comprises an Internet of things middleware and the industrial edge gateway; the middleware of the Internet of things comprises a transmission protocol configuration module, an interface information configuration module, a data source configuration module, an interface identification module, a custom data format module and a configuration file issuing module; the industrial edge gateway comprises a configuration file receiving and storing module, an interface list analyzing module, a built-in protocol module, an interface analyzing and memory distributing module, a self-defined data format analyzing module, a data packaging module and an interface running module. The invention supports multiple interface protocols, self-defines data formats, and multiple data reporting modes (real-time, periodic and regular), simultaneously completes data distribution to multiple user platforms, does not need repeated development, and improves the data docking efficiency and the expandability of the industrial edge gateway according to the appointed data formats.

Description

Multi-protocol multi-interface data distribution system and method based on industrial edge gateway
Technical Field
The 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
The industrial edge gateway has the advantages that due to the limited internal limit, data butt joint is generally finished through an MQTT protocol single interface in the industry, fault data of the interface is lost, stability is poor, the data butt joint format is single, the data format requirements of different users cannot be met, flexibility is low, expansibility is low, and a large amount of time is required to be invested to adapt to the requirements of each user.
The intra-industry interface data docking protocol is single, and cannot flexibly adapt to different communication protocol requirements, and when other protocols or interfaces need to be accessed, redesign is needed, so that the cost and the complexity are increased; in addition, the fault tolerance is low, a certain interface fails, the whole communication system is affected, and the requirement of distributing data to a plurality of platforms cannot be met.
For example, an access method and an access device (publication number CN 113938535A) of an internet of things device based on multi-protocol adaptation cannot simultaneously open a plurality of interfaces for a certain protocol or a plurality of protocols, each time of docking is only one interface of a protocol, the current interface has a problem, the problem of losing data can occur, and the requirement of distributing data to a plurality of platforms cannot be met; and the data is uploaded according to a predetermined data packaging format, so that the flexibility of use is insufficient.
Disclosure of Invention
The invention aims to provide a multi-protocol multi-interface data distribution system and method based on an industrial edge gateway. The system and the method relate to industries such as industrial automation, water affairs, environmental protection and the like, and are applied to the scene of completing data acquisition, data monitoring and data distribution by using an industrial edge gateway and realizing multi-platform monitoring management.
In order to achieve the above object, the present invention provides a multi-protocol multi-interface data distribution system based on an industrial edge gateway, which comprises an internet of things middleware and an industrial edge gateway; the middleware of the Internet of things 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 issuing module; the industrial edge gateway comprises a configuration file receiving and storing module, an interface list analyzing module, a built-in protocol module, an interface analyzing and memory distributing module, a custom data format analyzing module, a data packaging module and an interface running module;
The transmission protocol configuration module is used for configuring a transmission protocol matched with an application layer protocol of the user platform;
The interface information configuration module is used for configuring interface information, client information or encryption configuration information of the user platform;
The interface information identification module is used for distributing corresponding interface ID and protocol name to the configured interface;
the data source configuration module is used for configuring data source information, a reporting mode and a default data format which correspond to the interface and need to be reported;
the custom data format module is used for customizing the data format of the configured interface;
the configuration file issuing module is used for issuing the files configured by the transmission protocol 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 storing module is used for receiving and storing the configuration file issued by the middleware of the Internet of things;
The interface list analysis module is used for reading and receiving the configuration file stored by the storage module, obtaining a configured protocol data docking list, performing traversal comparison with a protocol in the built-in protocol module, obtaining all interfaces corresponding to legal protocols, storing the interface list corresponding to the legal protocols, and sending the interface list corresponding to the legal protocols to the interface analysis and memory allocation module; the interface list corresponding to legal protocol consists of configured protocol type, interface ID and protocol name;
the built-in protocol module is used for presetting a transmission protocol type;
The interface analysis and memory allocation module consists of an interface analysis module and a memory allocation module; the interface analysis module reads the configuration file to receive the configuration file stored by the storage module according to the obtained interface list corresponding to the legal protocol, and calls 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, wherein the configuration information comprises data source, server information, client information, encryption configuration information, theme configuration information, data reporting mode and data format information; the interface analysis module is used for identifying a custom interface according to the protocol name in the interface list corresponding to the legal protocol, calling the custom JSON data format analysis module and analyzing the defined data format into a structure capable of reporting by the custom JSON data format analysis module; the memory allocation module dynamically allocates interface memory space according to the number of interfaces, the protocol type and the number of variables in the data source;
The self-defined data format analysis module is called by the interface analysis and memory allocation module and is used for analyzing the self-defined data format into a structure capable of being reported; the custom data format analysis module is a custom JSON data format analysis module;
The data encapsulation module is used for encapsulating the data into a reporting structure;
The interface operation module traverses each interface and reports the data source to the user platform according to the protocol operation interface and the reporting interface; for the service interface, the data source is provided for the user platform to acquire.
Whether a default data format interface or a custom interface, the configuration of the data sources is dependent on the data required by the user platform.
In a preferred embodiment, the interface list parsing module opens the configuration file, then calls CJSON a library to obtain a configured protocol data docking list, wherein the protocol data docking list comprises an interface ID, a configured protocol type and a protocol name, and then performs traversal comparison with the protocol type built in the industrial edge gateway; the protocol types of the built-in protocol types corresponding to the reporting interfaces comprise MQTT, HTTP, HJ212-2017, and the protocol types of the corresponding service interfaces comprise MODBUS and OPC UA; when the protocol type in the protocol data docking list cannot be matched with the protocol type built in the industrial edge gateway, the protocol type is illegal, and all interfaces related to the protocol type are directly filtered; and when the protocol type in the protocol data docking list is matched with the protocol type built in the industrial edge gateway, the protocol type is legal, all interfaces corresponding to the legal protocol are obtained according to the protocol data docking list, the interface list corresponding to the legal protocol is stored until the complete protocol data docking list is traversed, and the obtained interface list corresponding to the legal protocol is sent to the interface analysis and memory allocation module.
Further, the protocol name is composed of a protocol type and a custom mark, the interface information identification module of the middleware of the internet of things allocates the protocol name to each configured interface, and when the interface information identification module identifies the custom data format configured by the custom data format module corresponding to a certain interface ID, the custom mark is added to the protocol name allocated to the interface.
The memory allocation module dynamically allocates memory space according to the number of interfaces in an interface list corresponding to legal protocols, the number of protocol types and the number of variables in a data source, wherein the memory space is used for storing data sources, server side information, client side information, encryption configuration information, theme configuration information, a data reporting mode and data format information of the interfaces, the data sources comprise data IDs, data types, data names, data states, numerical values and data acquisition time, the server side information comprises server side IP addresses, port numbers, user names and passwords, the client side information is a client side ID, and the encryption configuration information comprises server root certificates, client side certificates and client side private keys; the 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.
The data source comprises a data ID, a data type, a data name, a data state, a numerical value and a data acquisition time, whether the service interface or the reporting interface is adopted.
And dividing 7 interfaces according to the protocol type and the protocol name corresponding to each interface and whether the protocol name contains the custom mark: MQTT, HTTP, MODBUS, OPCUA, HJ212-2017, custom MQTT and custom HTTP;
The memory size occupied by the interface configuration information except the data source of the 7 interfaces is YA、YB、YC、YD、YE、YF、YG,YA、YB、YC、YD、YE、YF、YG respectively and is a preset fixed value, and the memory size is determined according to the memory space required by the interface configuration file except the data source corresponding to the interface type;
The memory size occupied by the 7 interface data source configurations is X A、XB、XC、XD、XE、XF、XG respectively; the size of the memory space required by single data storage in the data source is Q, the data is a variable, and the data amount in the 7 interface data source configurations is N A、NB、NC、ND、NE、NF、NG respectively; the memories required by the configuration of the 7 interfaces are Z A、ZB、ZC、ZD、ZE、ZF、ZG respectively;
Xi=Ni*Q (1)
Zi=Ni*Q+Yi (2)
i=A,B,C,D,E,F,G;
S is the total size of the memory space which can be allocated by the memory allocation module; m is the maximum number of interfaces allowed to be configured by the middleware of the Internet of things; m satisfies the following conditions:
M=S/Zmax (3)
Zmax=Nmax*Q+Ymax (4)
Z max is the maximum memory required for single interface configuration; n max is the maximum data size of the data source of the defined single interface; y max is the maximum value in Y A、YB、YC、YD、YE、YF、YG.
M is calculated by a memory allocation module of the industrial edge gateway and is sent to the Internet of things middleware by the memory allocation module, when the total number of interfaces configured in the Internet of things middleware exceeds M, the Internet of things middleware prompts that the number of the interfaces allowed to be configured is full, so that the interfaces exceeding the number cannot be configured in the Internet of things middleware, and in this way, the overload of the memory space of the edge industrial gateway is prevented.
In a preferred embodiment, the processing steps of the custom JSON data format parsing module are as follows:
Invoking CJSON a library, analyzing according to a custom JSON data structure configured by a custom data format module (specifically, when a memory allocation module allocates a memory space for an interface, the content stored in the memory space comprises the custom JSON data structure, and a custom JSON data format analysis module directly acquires the custom JSON data structure from the memory space), wherein a recursion algorithm is adopted in the analysis process, and recursion is carried out on the bottommost layer of the data structure; here, CJSON libraries are all located within the industrial edge gateway;
the user-defined JSON data format analysis module starts from a root node, judges the type of the node, and if the node is an array, the recursion is required to be continued; if the object is the object, traversing key value pairs in the object;
Traversing all key value pairs in the object, if the key value pairs are basic data types, adding the key value pairs to a father node if the basic data types comprise character strings, numbers, boolean values and NULL, and adding data ID information in the key value pairs for replacing current numerical values and collecting time information during reporting; if the object is an object or an array, creating the object or the array of the same type according to the object or the array, taking the object or the array of the same type as a father node of a child node, hanging key value pairs under the child node under the created object or the array, and recursively traversing until the whole tree structure is traversed.
Further, in the transport protocol configuration module, the configured transport protocol types include MQTT, HTTP, HJ212-2017, MODBUS, OPC UA; in the interface information configuration module, the interface information comprises an IP address and a port number of a user platform, and/or client information, encryption configuration information and theme configuration information; in the data source configuration module, the data source information comprises a data ID, a data type, a data name, a data state, a numerical value and a data acquisition time, and the reporting mode comprises real-time, periodic or regular reporting; the industrial edge gateway can be used as a server to provide a data source for a user platform to acquire according to the need, and can also be used as a client to actively report data to the user platform;
the files configured by the transmission protocol configuration module, the interface information identification module, the data source configuration module and the custom data format module comprise:
① A list of multiple interfaces and multiple protocols, namely a protocol data docking list;
② Configuration of the single interface protocol, i.e., MQTT/HTTP: server configuration, client configuration, reported data source, encryption configuration, reporting mode and theme configuration; MODBUS/OPC UA/HJ212: the server side configures and data sources;
③ The custom interface is configured, the custom interface is supported by MQTT/HTTP, and the data format defined by the interface is configured according to JSON format specification.
In a preferred embodiment, a plurality of interfaces are opened aiming at single protocol support, and data reporting to a plurality of user platforms through the single protocol is supported simultaneously; supporting simultaneous opening of multiple protocols.
Further, when deleting, modifying or adding interface information in a certain configuration file, deleting, modifying or adding interface information through a transmission protocol configuration module, an interface information identification module, a data source configuration module and a custom data format module in the middleware of the internet of things, regenerating a new configuration file consistent with the name of the configuration file, after the new configuration file is issued to an industrial edge gateway, covering an original configuration file, and re-receiving and storing the new configuration file through the configuration file, and generating an interface list corresponding to an updated legal protocol through an interface list analysis module, re-analyzing and dynamically distributing memory space of each interface corresponding to the legal protocol through an interface analysis and memory distribution module, and re-operating each interface corresponding to the legal protocol through an interface operation module.
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:
configuring a transmission protocol matched with an application layer protocol of a user platform in the middleware of the Internet of things; configuring interface information, client information or encryption configuration information and theme configuration information of a user platform; configuring data source information, reporting mode and default data format corresponding to the interface, distributing corresponding interface ID and protocol name to the configured interface, configuring custom data format, and forming configuration file; wherein the custom data format and the default data format are configured alternatively;
The configuration file on the middleware of the Internet of things is issued to an industrial edge gateway;
The industrial edge gateway receives and stores the configuration file issued by the middleware of the Internet of things, reads the configuration file, acquires a configured protocol data docking list, performs traversal comparison with the protocol types in the built-in protocol module, acquires all interfaces corresponding to legal protocols, and stores an interface list corresponding to the legal protocols; reading a configuration file according to an interface list corresponding to a legal protocol, and calling CJSON a library to acquire all configuration information corresponding to each interface ID in the interface list corresponding to the legal protocol from the configuration file, wherein the configuration information comprises a data source, server information, client information, encryption configuration information, a data reporting mode and data format information; identifying a custom interface according to the protocol name in the interface list corresponding to the legal protocol, and analyzing the defined data format into a structure capable of being reported; dynamically allocating interface memory space according to the number of interfaces, the protocol type and the number of variables in a data source; traversing each interface, operating the interfaces according to a protocol, and reporting the data source to a user platform aiming at the reporting interface; for the service interface, the data source is provided for the user platform to acquire.
In a preferred embodiment, traversing each interface, running the interface according to a protocol, reporting the data source to the user platform for the reporting interface; for a service interface, a data source is provided for a user platform to acquire, specifically: the interface operation module traverses each interface which dynamically allocates memory space in the industrial edge gateway, operates each interface according to a protocol corresponding to the interface, and performs one-to-one communication between each interface and one or more interfaces corresponding to the user platforms to perform data reporting (corresponding to reporting interfaces) or data calling (corresponding to service interfaces); and each interface for dynamically distributing the memory space in the industrial edge gateway is matched with a built-in protocol behind the industrial edge gateway according to the configuration file issued by the middleware of the Internet of things, so that the dynamic distribution of the memory space of the interface corresponding to the legal protocol in the industrial edge gateway is realized.
Compared with the prior art, the invention supports multiple interface protocols, supports one protocol to multiple interfaces and multiple protocols to customize data formats and multiple data reporting modes (real-time, periodic and regular), can simultaneously distribute the SSL/TLS encrypted data to multiple user platforms without repeated development, perfectly butt-joints according to the data formats appointed by users, and improves the data butt-joint efficiency and the expandability of the industrial edge gateway.
Drawings
FIG. 1 is a schematic diagram of an industrial edge gateway-based multi-protocol multi-interface data distribution system;
FIG. 2 is a schematic diagram of a multi-interface operation;
Fig. 3 is a schematic diagram of a custom JSON data format parsing module.
Detailed Description
The invention will be further described with reference to the drawings and the specific examples.
A multi-protocol multi-interface data distribution system based on an industrial edge gateway comprises an Internet of things middleware and the industrial edge gateway; the middleware of the Internet of things 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 issuing module; the industrial edge gateway comprises a configuration file receiving and storing module, an interface list analyzing module, a built-in protocol module, an interface analyzing and memory distributing module, a custom data format analyzing module, a data packaging module and an interface running module;
The transmission protocol configuration module is used for configuring a transmission protocol matched with an application layer protocol of the user platform;
The interface information configuration module is used for configuring interface information, client information or encryption configuration information of the user platform;
The interface information identification module is used for distributing corresponding interface ID and protocol name to the configured interface;
the data source configuration module is used for configuring data source information, a reporting mode and a default data format which correspond to the interface and need to be reported;
the custom data format module is used for customizing the data format of the configured interface;
the configuration file issuing module is used for issuing the files configured by the transmission protocol configuration module, the interface information identification module, the data source configuration module and the custom data format module to the industrial edge gateway;
The transmission protocol configuration module, the interface information identification module, the data source configuration module and the user-defined data format module are related through interfaces, namely when interface information is configured, the transmission protocol configuration module configures the transmission protocol, and then immediately configures corresponding interface information (the protocol of the interface is the configured transmission protocol) through the interface information configuration module, if the interface information is a service interface, the interface information comprises service end information (aiming at the service interface, the service end refers to an industrial edge gateway, the service end information is connection information, particularly, when serial port communication is carried out, service address, baud rate, check bit, data bit and stop bit, and when network port communication is carried out, port number) and if the interface information is a reporting interface, the interface information comprises service end information, client end information, encryption configuration information and theme configuration information; then the interface information identification module distributes the protocol name and the unique interface ID; then, relevant data source information and default data formats corresponding to the interface ID are configured through a data source configuration module, and a reporting mode is also configured for the reporting interface; optionally, configuring custom data format information (including data format and reporting mode) corresponding to the interface ID by a custom data format module; when the corresponding interface ID has corresponding custom data format information, the interface information identification module adds a custom mark in the corresponding protocol name, for example, the protocol name corresponding to the certain interface ID is the custom MQTT. For each interface, the default data format and the custom data format are selected to complete configuration.
The configuration file receiving and storing module is used for receiving and storing the configuration file issued by the middleware of the Internet of things;
The interface list analysis module is used for reading and receiving the configuration file stored by the storage module, obtaining a configured protocol data docking list, performing traversal comparison with a protocol in the built-in protocol module, obtaining all interfaces corresponding to legal protocols, storing the interface list corresponding to the legal protocols, and sending the interface list corresponding to the legal protocols to the interface analysis and memory allocation module; the interface list corresponding to legal protocol consists of configured protocol type, interface ID and protocol name;
the built-in protocol module is used for presetting transmission protocol types (MQTT, HTTP, HJ212-2017, MODBUS, OPC UA);
The interface analysis and memory allocation module consists of an interface analysis module and a memory allocation module; the interface analysis module reads the configuration file to receive the configuration file stored by the storage module according to the obtained interface list corresponding to the legal protocol, and calls CJSON a library to obtain all configuration information corresponding to each interface ID in the interface list corresponding to the legal protocol from the configuration file, wherein the configuration information comprises data source, server information, client information, encryption configuration information, data reporting mode and data format information; the interface analysis module is used for identifying a custom interface according to the protocol name in the interface list corresponding to the legal protocol, calling the custom JSON data format analysis module and analyzing the defined data format into a structure capable of reporting by the custom JSON data format analysis module; the memory allocation module dynamically allocates interface memory space according to the number of interfaces, the 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 identification of the custom interface specifically refers to: if the protocol name contains 'custom', judging that the protocol name is a custom interface; if the protocol name does not contain "custom", it is determined to be a normal interface (i.e., an interface of a default data format).
The self-defined data format analysis module is called by the interface analysis and memory allocation module and is used for analyzing the self-defined data format into a structure capable of being reported;
The data encapsulation module is used for encapsulating the data into a reporting structure;
The interface operation module traverses each interface and reports the data source to the user platform according to the protocol operation interface and the reporting interface; for the service interface, the data source is provided for the user platform to acquire.
The interface list analysis module opens the configuration file, then calls CJSON a library to obtain a configured protocol data docking list (the purpose of calling CJSON the library is to analyze and obtain ① multi-interface and multi-protocol list from the configuration file), the protocol data docking list comprises a list of interface IDs, configured protocol types and protocol names, and then carries out traversal comparison with the protocol types built in the industrial edge gateway; the protocol types of the built-in protocol types corresponding to the reporting interfaces comprise MQTT, HTTP, HJ212-2017, and the protocol types of the corresponding service interfaces comprise MODBUS and OPC UA; when the protocol type in the protocol data docking list cannot be matched with the protocol type built in the industrial edge gateway, the protocol type is illegal, and all interfaces related to the protocol type are directly filtered; and when the protocol type in the protocol data docking list is matched with the protocol type built in the industrial edge gateway, the protocol type is legal, all interfaces corresponding to the legal protocol are obtained according to the protocol data docking list, the interface list corresponding to the legal protocol is stored until the complete protocol data docking list is traversed, the obtained interface list corresponding to the legal protocol is sent to the interface analysis and memory allocation module, and the interface list corresponding to the legal protocol at the moment is a list of all interface IDs, corresponding protocol types and protocol names corresponding to the legal protocol.
The protocol name consists of a protocol type and a custom mark, the interface information identification module of the middleware of the Internet of things allocates the protocol name to each configured interface, and when the interface information identification module identifies the custom data format configured by the custom data format module corresponding to a certain interface ID, the custom mark is added to the protocol name allocated to the interface.
The memory allocation module dynamically allocates memory space according to the number of interfaces in an interface list corresponding to legal protocols, the number of protocol types and the number of variables in a data source, wherein the memory space is used for storing data sources, server side information, client side information, encryption configuration information, theme configuration information, a data reporting mode and data format information of the interfaces, the data sources comprise data IDs, data types, data names, data states, numerical values and data acquisition time, the server side information comprises server side IP addresses, port numbers, user names and passwords (corresponding to user platforms), the client side information is a client side ID (corresponding to an industrial edge gateway), and the encryption configuration information comprises server root certificates, client side certificates and client side private keys; the 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. The report interface is taken as an example to describe in detail, wherein the service end in the section is a user platform, and the client end is an industrial edge gateway.
One of the interfaces corresponds to a data source, each of which has a number of variables, and each of the variables corresponds to a data ID. The data source may be a default data format or a custom data format.
Specifically, the allocation of the interface memory space according to the number of interfaces in the interface list, the protocol type and the number of variables in the data source corresponding to the legal protocol means: memory space is allocated according to interfaces, and the memory space allocation of the interfaces is influenced by the types of protocols and the number of variables in the data sources, wherein the memory space required by different types of protocols is different (determined according to the memory space required by the different types of protocols). When the variables (i.e. data) in the data source are more, the memory allocation module allocates more memory space to the interface, and vice versa.
The processing steps of the custom JSON data format analysis module are as follows:
Invoking CJSON a library, analyzing according to the custom JSON data structure configured by the custom data format module, and recursing to the bottommost layer of the data structure by adopting a recursion algorithm in the analysis process;
the user-defined JSON data format analysis module starts from a root node, judges the type of the node, and if the node is an array, the recursion is required to be continued; if the object is the object, traversing key value pairs in the object;
Traversing all key value pairs in the object, if the key value pairs are basic data types, adding the key value pairs to a father node if the basic data types comprise character strings, numbers, boolean values and NULL, and adding data ID information in the key value pairs for replacing current numerical values and collecting time information during reporting; if the object is an object or an array, creating the object or the array of the same type according to the object or the array, taking the object or the array of the same type as a father node of a child node, hanging key value pairs under the child node under the created object or the array, and recursively traversing until the whole tree structure is traversed.
In the transmission protocol configuration module, the configured transmission protocol types comprise MQTT, HTTP, HJ212-2017, MODBUS and OPC UA; in the interface information configuration module, the interface information comprises an IP address and a port number of a user platform, and/or client information, encryption configuration information and theme configuration information; in the data source configuration module, the data source information comprises a data ID, a data type, a data name, a data state, a numerical value and a data acquisition time, and the reporting mode comprises real-time, periodic or regular reporting; the industrial edge gateway can be used as a server to provide a data source for a user platform to acquire according to the need, and can also be used as a client to actively report data to the server-user platform;
the files configured by the transmission protocol configuration module, the interface information identification module, the data source configuration module and the custom data format module comprise:
① A list of multiple interfaces and multiple protocols, namely a protocol data docking list;
② Configuration of the single interface protocol, i.e., MQTT/HTTP: server configuration, client configuration, reported data source, encryption configuration, reporting mode and theme configuration; MODBUS/OPC UA/HJ212: the server side configures and data sources;
③ The custom interface is configured, the custom interface is supported by MQTT/HTTP, and the data format defined by the interface is configured according to JSON format specification.
Opening a plurality of interfaces aiming at single protocol support, namely, in one configuration, the single protocol can configure a plurality of interfaces (the interfaces correspond to one or a plurality of user platforms) in the middleware of the Internet of things, and interface list analysis, interface analysis and memory allocation and interface operation are completed through an industrial edge gateway, so that data reporting to a plurality of user platforms through the single protocol is supported;
The invention also supports the simultaneous opening of a plurality of protocols, namely, the middleware of the Internet of things can select a plurality of protocols in one configuration, correspondingly configures a plurality of interfaces (the interfaces correspond to one or a plurality of user platforms), and completes interface list analysis, interface analysis, memory allocation and interface operation through the industrial edge gateway, thereby actually opening a plurality of protocols simultaneously.
One configuration file is formed by one configuration; each configuration corresponds to a different data requirement; different configurations performed at different times will produce different configuration files, and the names of the configuration files will also be different. The total number of interfaces configured for multiple times cannot exceed the maximum number M of interfaces allowed to be configured by the middleware of the Internet of things.
When deleting, modifying or adding interface information in a certain configuration file, deleting, modifying or adding interface information through a transmission protocol configuration module, an interface information identification module, a data source configuration module and a user-defined data format module in the middleware of the Internet of things, regenerating a new configuration file consistent with the name of the configuration file, issuing the new configuration file to an industrial edge gateway, covering the original configuration file, analyzing the allocated dynamic interface memory space in the industrial edge gateway by the original configuration file, releasing, re-receiving the new configuration file by the configuration file, storing the new configuration file by the interface list analysis module, generating an updated interface list corresponding to a legal protocol by the interface list analysis module, re-analyzing and re-dynamically distributing memory spaces of all interfaces corresponding to the legal protocol by the interface analysis and memory distribution module, and re-operating all interfaces corresponding to the legal protocol by the interface operation module. When an interface completes configuration and runs on an industrial edge gateway, the interface continues to run on the industrial edge gateway unless the interface information in the configuration file is deleted.
A multi-protocol multi-interface data distribution method based on an industrial edge gateway comprises the following steps:
Step 1, configuring data source selection transmission protocol
The middleware of the Internet of things presets a transmission protocol (MQTT, HTTP, HJ212-2017, MODBUS, OPC UA). According to the application layer protocol used by the user platform, the corresponding transmission protocol is matched with the middleware of the Internet of things, the protocol already meets most application scenes, and if the scenes which cannot be met are met, the middleware of the Internet of things and the industrial edge gateway are required to be upgraded to perfect the protocol type (namely, the transmission protocol is increased). Then, interface information such as an IP address, a port number and the like of a user platform is configured on the middleware of the Internet of things through an interface information configuration module, and client information, encryption configuration information and theme configuration information are also required to be configured for reporting interfaces; the data source configuration module adds the data source to be reported under the interface, which is generally data name, data acquisition time and numerical value, and reconfigures the reporting mode (real-time, period and rule [ support configuration binding rule, for example, when a certain data value is more than 10, data pushing is started) ], and can adopt a default data format, so that the configuration of the interface is completed. In addition, for different business scenes, the industrial edge gateway can serve as a server (MODBUS, OPC UA) to provide a data source for a user platform to acquire as required and serve as a client (MQTT, HTTP, HJ 212-2017) to actively report data to a corresponding user platform. The user platform is such as the environment detection center, the client platform, the industrial Internet of things platform, MES/ERP, SCADA/DCS, etc. in FIG. 2.
Considering that the data formats required by different user platforms are different, the industrial edge gateway also supports custom JSON data formats (MQTT and HTTP), and only the middleware of the Internet of things is required to configure data sources (which devices require reporting of data (corresponding to variables) under the devices, the devices refer to the devices connected with the industrial edge gateway, and the related data of the devices are collected into the industrial edge gateway) in a real-time, periodic and regular manner (support configuration binding of a rule, for example, after a certain data value is more than 10, data pushing is started) and the data formats (according to JSON format specifications) according to the requirements of the user platforms. The user-defined JSON data format (JSON data is composed of key value pairs, the key value pairs are used for representing the attribute and the value of the data, the basic data types comprise character strings, numbers, boolean values, arrays, objects and NULL), and a user needs to configure the structural hierarchy of the objects and the arrays and the positions of the key value pairs of the data sources in the structure through the user-defined data format module.
Step2, configuration file issuing and storing
The industrial edge gateway supports MQTT (message queuing protocol), HTTP (hypertext transfer protocol) protocols to receive user configured profiles. The middleware of the internet of things or the local client side issues the configuration file to the industrial edge gateway through the MQTT protocol, aiming at the requirements of a large amount of data and a plurality of docking interfaces, the issued configuration file is generally received by using an HTTP (hyper text transfer protocol) protocol, and then the industrial edge gateway can store the configuration file in a local storage. The configuration file mainly comprises the following contents:
① A list of multiple interfaces, multiple protocols, i.e. which protocols are required, a list of interfaces required.
② Configuration of the single interface protocol, i.e., MQTT/HTTP: server configuration, client configuration, reported data source, encryption configuration, reporting mode and theme configuration; MODBUS/OPC UA/HJ212: and configuring a server side and a data source.
Theme configuration: for example, the MQTT comprises a theme name, a corresponding character string and a data pushing method, wherein the pushed data can be obtained by subscribing the character string; HTTP, URL address, as push address of data.
③ Custom interface (MQTT/HTTP supported) configuration, data formats defined by the interface are configured according to JSON format specification. Only two protocol types, MQTT/HTTP, support the customization of data formats.
In fig. 1, the information of the configuration file issued by the local client and the middleware of the internet of things is consistent. If the configuration file is issued by the local client, the configuration mode is identical to the middleware of the Internet of things.
Step 3, analyzing interface list corresponding to configuration and legal protocol
The industrial edge gateway calls an interface list analysis module when reading a configuration file in a local storage, the interface list analysis module opens the configuration file, then calls a CJSON library in the industrial edge gateway to analyze and acquire a configured protocol data docking list, wherein the list comprises an interface ID, a configured protocol type and a list of protocol names (each interface ID corresponds to the protocol type and the protocol name), then carries out traversal comparison with a protocol type (a protocol type for reporting an interface: MQTT, HTTP, HJ-2017; a protocol type for a service interface: MODBUS and OPC UA) built in the industrial edge gateway, and when the protocol type of a certain protocol in the protocol data docking list cannot be matched with the protocol type built in the industrial edge gateway, the protocol is an illegal protocol, and all interfaces related to the protocol type are directly filtered; and when the protocol type of a certain protocol in the protocol data docking list is matched with the protocol type built in the industrial edge gateway, the protocol is legal, a plurality of interfaces are needed for acquiring the certain protocol type from the configuration file, the interface list corresponding to the configured legal protocol is stored until the complete protocol data docking list is traversed, and the interface list corresponding to the obtained legal protocol is sent to the interface analysis and memory allocation module.
Step 4, interface parsing, memory allocation and management
The interface analysis and memory allocation module consists of an interface analysis module and a memory allocation module; the interface analysis module matches the configuration file corresponding to each interface according to the interface list corresponding to the legal protocol, if one legal protocol contains a plurality of interfaces, but the configuration of the interfaces is different, the interface analysis module of the industrial edge gateway calls a CJSON library arranged in the industrial edge gateway according to the interface ID to match the configuration file corresponding to the interface (the configuration file stored by the industrial edge gateway is matched, that is, each interface ID has the corresponding protocol, data source, data format and other information in the configuration file), and all the configuration information such as the protocol type, the data source, the data format (including the default data format or the custom data format), the client information, the server information, the encryption configuration information and the like corresponding to each interface are obtained at this time.
The memory allocation module intelligently allocates the memory space according to the number of interfaces in the interface list corresponding to legal protocols, the protocol types (for reporting interfaces: MQTT, HTTP, HJ, 212-2017; for service interfaces: MODBUS, OPC UA) and the number of variables in the data source (i.e. the number of data IDs), configures several interfaces, allocates the space of several interfaces, and because the interfaces are dynamic, the space for storing 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, so that each interface can efficiently and stably perform data processing, namely, a dynamic storage management strategy is adopted, and the storage space (i.e. the memory space) is flexibly allocated according to the increase and change of the data quantity. The storage space stores data source (data ID, data type, data name, data state, value, data acquisition time) of the protocol interface, server information (IP address, port number, user name, password), client information (client ID), encryption configuration (server root certificate, client private key), data reporting mode (real-time, period, rule [ support configuration binding rule, for example, when a certain data value is greater than 10, start pushing data) ], and related information such as pushed data format. For the custom interface, the module invokes a custom JSON data format parsing module (according to JSON format specification) to parse the custom data format into a structure that can be reported. By the method, flexible management and intelligent resource allocation of the interface protocol are realized, and efficient and stable data processing service is provided. The server side in this section refers to the user platform, and the client side refers to the industrial edge gateway. Among the data types are Boolean types (unsigned 16 bits, signed 16 bits, unsigned 32 bits, signed 32 bits), single precision floating point (unsigned 64 bits, signed 64 bits), double precision floating point numbers, and the like. The data state comprises online or offline, and the data can be acquired to be considered as an online state and the data can be acquired to be considered as an offline state.
The data source information (especially data state, value, data acquisition time) stored in the storage space will change, because: after the equipment connected with the industrial edge gateway collects relevant data in real time, the relevant data are collected to the industrial edge gateway. When the subsequent interface operates, the data source information currently stored in the memory space is reported to the user platform.
And dividing 7 interfaces according to the protocol type and the protocol name corresponding to each interface and whether the protocol name contains the custom mark: MQTT, HTTP, MODBUS, OPCUA, HJ212-2017, custom MQTT and custom HTTP; the self-defined MQTT and the self-defined HTTP are self-defined interfaces;
The memory size occupied by the interface configuration information of the 7 interfaces except the data source is YA、YB、YC、YD、YE、YF、YG,YA、YB、YC、YD、YE、YF、YG which is different according to different protocol types and whether the interface configuration information contains a custom mark or not and is a preset fixed value respectively; the memory occupied by interface configuration information (data reporting mode, data format, server, client, encryption configuration and theme configuration information) of 7 interfaces except the data source can be ensured not to exceed the preset fixed values;
The memory size occupied by the 7 interface data source configurations is X A、XB、XC、XD、XE、XF、XG respectively; the size of the memory space required by single data storage in the data source is Q, the data is a variable, and the data amount in the 7 interface data source configurations is N A、NB、NC、ND、NE、NF、NG respectively; the memories required by the configuration of the 7 interfaces are Z A、ZB、ZC、ZD、ZE、ZF、ZG respectively;
Xi=Ni*Q (1)
Zi=Ni*Q+Yi (2)
i=a (stands for MQTT), B (stands for HTTP), C (stands for MODBUS), D (stands for OPCUA), E (stands for HJ 212-2017), F (stands for custom MQTT), G (stands for custom HTTP);
The different protocol types have no influence on the calculation of the occupied memory X of the interface data source configuration, and 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, so that the memory required by any data can not exceed Q, and Q of single data of all interfaces is preset with the same value.
And the same protocol type, when the Ni data volume is different, the memory required by the interface configuration is also different.
Where N i is not greater than N max (the maximum data size of the data source of a defined single interface) and is an integer. All interfaces, regardless of the protocol, how the data source and data format are configured, the maximum data size of the data source does not exceed N max.
S is the total size of the memory space which can be allocated by the memory allocation module, and S is not more than 70% of the total memory of the industrial edge gateway; m is the maximum number of interfaces configurable by the middleware of the Internet of things; m satisfies the following conditions:
M=S/Zmax (3)
Zmax=Nmax*Q+Ymax (4)
Z max is the maximum memory required for single interface configuration; n max is the maximum data size of the data source of the defined single interface; y max is the maximum value in Y A、YB、YC、YD、YE、YF、YG.
In addition to intelligently allocating interface memory space (the memory space is part of the industrial edge gateway CPU, and the total size S of the memory space that can be allocated by the memory allocation module is smaller than the total memory space of the industrial edge gateway CPU), the industrial edge gateway also intelligently allocates processing resources to: the CPU usage of each interface is managed by an operating system built in the industrial edge gateway, so that the interface operation module can operate the interface, wherein the CPU refers to the CPU of the industrial edge gateway.
And carrying out data encapsulation according to a default data format to obtain a reporting structure, or carrying out data format analysis through a custom JSON data format analysis module, then carrying out data encapsulation to obtain the reporting structure, and then reporting to a user platform.
The custom JSON data format parsing module (fig. 3) processes the steps of:
1. The JSON data structure is first configured, not the data that is ultimately to be reported. Because the data sources (values and collection time) are changed, the custom JSON data format analysis module can replace the changed information in the structure according to the data ID under the condition that the reporting mode is satisfied (real-time, periodic and rule [ support configuration binding a rule, for example, after a certain data value is greater than 10, start pushing data) ].
2. The industrial edge gateway will call CJSON a library to parse out the configured JSON structure, mainly using a recursive algorithm, because the JSON structure is a tree structure, and the JSON object is composed of key-value pairs, where the value may be a basic data type (e.g. string, number, boolean, NULL) or a complex data type (e.g. tuple or object). Thus, a JSON object can be considered a tree, where the keys of the object are nodes and the corresponding values can be leaf nodes or another JSON object or array, forming branches of the tree. It is necessary to recursively go to the lowest level of the structure.
3. The user-defined JSON data format analysis module starts from the root node, judges the type of the node, and if the node is an array, the recursion is required to be continued; if it is an object, key-value pairs in the object are traversed.
4. There may be an object type or an array type in the key value pair in the object, so that if all key value pairs in the object are basic data types (such as character strings, numbers, boolean values, NULL), the key value pair is added to the parent node, and data ID information is added in the key value pair to replace the current value and collect time information when reporting.
5. If the object is an array, the same type is created according to the type, and is used as a father node of the child node, and key value pairs under the child node are hung under the created type, and the recursion is continued until the complete tree structure is traversed.
Step5, interface operation and data uploading
The interface operation module is started, the interface operation module traverses each interface, the interfaces are operated according to a protocol, a data source is uploaded to a user platform, if the data source is in a self-defined message format, the data is packaged according to the format requirement, and the data distribution is completed according to a configured data reporting mode (real-time, periodic and rule [ support configuration binding one rule, for example, after a certain data value is more than 10, data pushing is started ].
The invention realizes multi-protocol and multi-interface support: the method allows the industrial edge gateway to select different transmission protocols (reporting interfaces: MQTT, HTTP, HJ212-2017; service interfaces: MODBUS, OPC UA) according to the data docking requirements, and can be used as a server or a client for data transmission at the same time; the reporting interface allows the user to configure a plurality of data sources, and meets the requirement that the user reports the data sources to each cloud platform.
The invention realizes the interface dynamic storage management: the interface analysis module intelligently allocates processing resources and memory space according to the number, types and data processing requirements of interfaces so as to ensure that each interface can efficiently and stably process data; the storage space dynamically allocated as required is used for storing information such as data sources, server/client information, data formats, data reporting modes, encryption configuration and the like of the interface.
The invention can customize the data format, the gateway supports the dynamic adjustment of the data format and the transmission protocol, so as to meet the requirements of different user platforms; if the user configures the user-defined interface, the interface analysis module can call the user-defined data format analysis module to analyze the user-defined data format into a reporting structure, the data reporting process can be matched with the data source configured by the user, and the data source selected by the user is added into the reporting structure.
The invention has excellent data encryption and security, in the multiprotocol data butt joint, the security of the data is ensured, the industrial edge gateway (MQTT, HTTP) interface supports the use of SSL/TLS encryption technology to protect the data in transmission, encryption, unidirectional authentication and bidirectional authentication can be selected to confirm that the counterpart of communication is indeed an expected server, rather than the disguise of a man in the middle.
The foregoing has shown and described the basic principles, principal features and advantages of the invention. It will be appreciated by persons skilled in the art that the above embodiments are not intended to limit the invention in any way, and that equivalent substitutions or equivalent modifications may be made to achieve the technical solution, all falling within the scope of the invention.

Claims (10)

1. The multi-protocol multi-interface data distribution system based on the industrial edge gateway is characterized by comprising an Internet of things middleware and the industrial edge gateway; the middleware of the Internet of things 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 issuing module; the industrial edge gateway comprises a configuration file receiving and storing module, an interface list analyzing module, a built-in protocol module, an interface analyzing and memory distributing module, a custom data format analyzing module, a data packaging module and an interface running module;
The transmission protocol configuration module is used for configuring a transmission protocol matched with an application layer protocol of the user platform;
The interface information configuration module is used for configuring interface information, client information or encryption configuration information of the user platform;
The interface information identification module is used for distributing corresponding interface ID and protocol name to the configured interface;
the data source configuration module is used for configuring data source information, a reporting mode and a default data format which correspond to the interface and need to be reported;
the custom data format module is used for customizing the data format of the configured interface;
the configuration file issuing module is used for issuing the files configured by the transmission protocol 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 storing module is used for receiving and storing the configuration file issued by the middleware of the Internet of things;
The interface list analysis module is used for reading and receiving the configuration file stored by the storage module, obtaining a configured protocol data docking list, performing traversal comparison with a protocol in the built-in protocol module, obtaining all interfaces corresponding to legal protocols, storing the interface list corresponding to the legal protocols, and sending the interface list corresponding to the legal protocols to the interface analysis and memory allocation module; the interface list corresponding to legal protocol consists of configured protocol type, interface ID and protocol name;
the built-in protocol module is used for presetting a transmission protocol type;
The interface analysis and memory allocation module consists of an interface analysis module and a memory allocation module; the interface analysis module reads the configuration file to receive the configuration file stored by the storage module according to the obtained interface list corresponding to the legal protocol, and calls 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, wherein the configuration information comprises data source, server information, client information, encryption configuration information, theme configuration information, data reporting mode and data format information; the interface analysis module is used for identifying a custom interface according to the protocol name in the interface list corresponding to the legal protocol, calling the custom JSON data format analysis module and analyzing the defined data format into a structure capable of reporting by the custom JSON data format analysis module; the memory allocation module dynamically allocates interface memory space according to the number of interfaces, the protocol type and the number of variables in the data source;
the self-defined data format analysis module is called by the interface analysis and memory allocation module and is used for analyzing the self-defined data format into a structure capable of being reported;
The data encapsulation module is used for encapsulating the data into a reporting structure;
The interface operation module traverses each interface and reports the data source to the user platform according to the protocol operation interface and the reporting interface; for the service interface, the data source is provided for the user platform to acquire.
2. The multi-protocol multi-interface data distribution system based on the industrial edge gateway according to claim 1, wherein the interface list analysis module opens the configuration file, then calls CJSON a library to obtain a configured protocol data docking list, wherein the protocol data docking list contains an interface ID, a configured protocol type and a protocol name, and then performs traversal comparison with the protocol type built in the industrial edge gateway; the protocol types of the built-in protocol types corresponding to the reporting interfaces comprise MQTT, HTTP, HJ212-2017, and the protocol types of the corresponding service interfaces comprise MODBUS and OPC UA; when the protocol type in the protocol data docking list cannot be matched with the protocol type built in the industrial edge gateway, the protocol type is illegal, and all interfaces related to the protocol type are directly filtered; and when the protocol type in the protocol data docking list is matched with the protocol type built in the industrial edge gateway, the protocol type is legal, all interfaces corresponding to the legal protocol are obtained according to the protocol data docking list, the interface list corresponding to the legal protocol is stored until the complete protocol data docking list is traversed, and the obtained interface list corresponding to the legal protocol is sent to the interface analysis and memory allocation module.
3. The multi-protocol multi-interface data distribution system based on industrial edge gateway according to claim 1, wherein the protocol name consists of a protocol type and a custom mark, the interface information identification module of the middleware of the internet of things allocates the protocol name to each configured interface, and when the interface information identification module identifies the custom data format configured by the custom data format module corresponding to a certain interface ID, the custom mark is added to the protocol name allocated to the interface.
4. The multi-protocol multi-interface data distribution system based on the industrial edge gateway according to claim 1, wherein the memory allocation module dynamically allocates memory space according to the number of interfaces in an interface list corresponding to legal protocols, the number of protocol types and the number of variables in a data source, wherein the memory space is used for storing data sources, server side information, client side information, encryption configuration information, theme configuration information, data reporting mode and data format information of the interfaces, the data sources comprise data IDs, data types, data names, data states, values and data acquisition time, the server side information comprises server side IP addresses, port numbers, user names and passwords, the client side information is client side ID, and the encryption configuration information comprises server root certificates, client side certificates and client side private keys; the protocol type refers to: protocol types MQTT, HTTP or HJ212-2017 corresponding to the reporting interface and protocol types MODBUS or OPC UA corresponding to the service interface;
And dividing 7 interfaces according to the protocol type and the protocol name corresponding to each interface and whether the protocol name contains the custom mark: MQTT, HTTP, MODBUS, OPCUA, HJ212-2017, custom MQTT and custom HTTP;
the memory size occupied by interface configuration information of 7 interfaces except a data source is YA、YB、YC、YD、YE、YF、YG,YA、YB、YC、YD、YE、YF、YG respectively and is a preset fixed value;
The memory size occupied by the 7 interface data source configurations is X A、XB、XC、XD、XE、XF、XG respectively; the size of the memory space required by single data storage in the data source is Q, the data is a variable, and the data amount in the 7 interface data source configurations is N A、NB、NC、ND、NE、NF、NG respectively; the memories required by the configuration of the 7 interfaces are Z A、ZB、ZC、ZD、ZE、ZF、ZG respectively;
Xi=Ni*Q (1)
Zi=Ni*Q+Yi (2)
i=A,B,C,D,E,F,G;
S is the total size of the memory space which can be allocated by the memory allocation module; m is the maximum number of interfaces allowed to be configured by the middleware of the Internet of things; m satisfies the following conditions:
M=S/Zmax (3)
Zmax=Nmax*Q+Ymax (4)
Z max is the maximum memory required for single interface configuration; n max is the maximum data size of the data source of the defined single interface; y max is the maximum value in Y A、YB、YC、YD、YE、YF、YG.
5. The multi-protocol multi-interface data distribution system based on the industrial edge gateway according to claim 1, wherein the processing steps of the custom JSON data format parsing module are as follows:
Invoking CJSON a library, analyzing according to the custom JSON data structure configured by the custom data format module, and recursing to the bottommost layer of the data structure by adopting a recursion algorithm in the analysis process;
the user-defined JSON data format analysis module starts from a root node, judges the type of the node, and if the node is an array, the recursion is required to be continued; if the object is the object, traversing key value pairs in the object;
Traversing all key value pairs in the object, if the key value pairs are basic data types, adding the key value pairs to a father node if the basic data types comprise character strings, numbers, boolean values and NULL, and adding data ID information in the key value pairs for replacing current numerical values and collecting time information during reporting; if the object is an object or an array, creating the object or the array of the same type according to the object or the array, taking the object or the array of the same type as a father node of a child node, hanging key value pairs under the child node under the created object or the array, and recursively traversing until the whole tree structure is traversed.
6. The industrial edge gateway-based multi-protocol multi-interface data distribution system according to claim 1, wherein the transport protocol configuration module is configured with transport protocol types including MQTT, HTTP, HJ212-2017, MODBUS, OPC UA; in the interface information configuration module, the interface information comprises an IP address and a port number of a user platform, and/or client information, encryption configuration information and theme configuration information; in the data source configuration module, the data source information comprises a data ID, a data type, a data name, a data state, a numerical value and a data acquisition time, and the reporting mode comprises real-time, periodic or regular reporting; the industrial edge gateway can be used as a server to provide a data source for a user platform to acquire according to the need, and can also be used as a client to actively report data to the user platform;
the files configured by the transmission protocol configuration module, the interface information identification module, the data source configuration module and the custom data format module comprise:
① A list of multiple interfaces and multiple protocols, namely a protocol data docking list;
② Configuration of the single interface protocol, i.e., MQTT/HTTP: server configuration, client configuration, reported data source, encryption configuration, reporting mode and theme configuration; MODBUS/OPC UA/HJ212: the server side configures and data sources;
③ The custom interface is configured, the custom interface is supported by MQTT/HTTP, and the data format defined by the interface is configured according to JSON format specification.
7. The industrial edge gateway-based multi-protocol multi-interface data distribution system according to claim 1, wherein multiple interfaces are opened for a single protocol support, and data reporting to multiple user platforms through the single protocol is supported simultaneously; supporting simultaneous opening of multiple protocols.
8. The multi-protocol multi-interface data distribution system based on industrial edge gateway according to claim 1, wherein when deleting, modifying or adding interface information in a certain configuration file, the interface information is deleted, modified or added by a transmission protocol configuration module, an interface information identification module, a data source configuration module and a custom data format module in the middleware of the internet of things, a new configuration file consistent with the name of the configuration file is regenerated, the new configuration file is issued to the industrial edge gateway, then covers the original configuration file, and is received by a configuration file receiving and storing module again, and an interface list corresponding to the updated legal protocol is generated by an interface list analyzing module, then the memory space of each interface corresponding to the legal protocol is analyzed again and dynamically allocated again by an interface analyzing and memory allocation module, and each interface corresponding to the legal protocol is restarted by an interface running module.
9. The multi-protocol multi-interface data distribution method based on the industrial edge gateway is characterized by comprising the following steps:
configuring a transmission protocol matched with an application layer protocol of a user platform in the middleware of the Internet of things; configuring interface information, client information or encryption configuration information and theme configuration information of a user platform; configuring data source information, reporting mode and default data format corresponding to the interface, distributing corresponding interface ID and protocol name to the configured interface, configuring custom data format, and forming configuration file; wherein the custom data format and the default data format are configured alternatively;
The configuration file on the middleware of the Internet of things is issued to an industrial edge gateway;
The industrial edge gateway receives and stores the configuration file issued by the middleware of the Internet of things, reads the configuration file, acquires a configured protocol data docking list, performs traversal comparison with the protocol types in the built-in protocol module, acquires all interfaces corresponding to legal protocols, and stores an interface list corresponding to the legal protocols; reading a configuration file according to an interface list corresponding to a legal protocol, and calling CJSON a library to acquire all configuration information corresponding to each interface ID in the interface list corresponding to the legal protocol from the configuration file, wherein the configuration information comprises a data source, server information, client information, encryption configuration information, theme configuration information, a data reporting mode and data format information; identifying a custom interface according to the protocol name in the interface list corresponding to the legal protocol, and analyzing the defined data format into a structure capable of being reported; dynamically allocating interface memory space according to the number of interfaces, the protocol type and the number of variables in a data source; traversing each interface, operating the interfaces according to a protocol, and reporting the data source to a user platform aiming at the reporting interface; for the service interface, the data source is provided for the user platform to acquire.
10. The multi-protocol multi-interface data distribution method based on the industrial edge gateway according to claim 9, wherein traversing each interface, running the interface according to the protocol, reporting the data source to the user platform for the reporting interface; for a service interface, a data source is provided for a user platform to acquire, specifically: the interface operation module traverses each interface which dynamically allocates the memory space in the industrial edge gateway, operates each interface according to a protocol corresponding to the interface, and performs one-to-one communication with the interfaces corresponding to one or more user platforms to report or call data; and each interface for dynamically distributing the memory space in the industrial edge gateway is matched with a built-in protocol behind the industrial edge gateway according to the configuration file issued by the middleware of the Internet of things, so that the dynamic distribution of the memory space of the interface corresponding to the legal protocol in the industrial edge gateway is realized.
CN202410741650.5A 2024-06-11 2024-06-11 Multi-protocol multi-interface data distribution system and method based on industrial edge gateway Active CN118317008B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410741650.5A CN118317008B (en) 2024-06-11 2024-06-11 Multi-protocol multi-interface data distribution system and method based on industrial edge gateway

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410741650.5A CN118317008B (en) 2024-06-11 2024-06-11 Multi-protocol multi-interface data distribution system and method based on industrial edge gateway

Publications (2)

Publication Number Publication Date
CN118317008A true CN118317008A (en) 2024-07-09
CN118317008B CN118317008B (en) 2024-08-16

Family

ID=91720982

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410741650.5A Active CN118317008B (en) 2024-06-11 2024-06-11 Multi-protocol multi-interface data distribution system and method based on industrial edge gateway

Country Status (1)

Country Link
CN (1) CN118317008B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109005166A (en) * 2018-07-23 2018-12-14 合沃物联技术(南京)有限公司 A kind of middleware system for Internet of things and its multi protocol conversion method
CN111031034A (en) * 2019-12-11 2020-04-17 研祥智能科技股份有限公司 Multi-protocol convergence edge computing gateway
CN111163147A (en) * 2019-12-24 2020-05-15 深圳供电局有限公司 Gateway device, multi-protocol data transmission method and computer device
CN111917717A (en) * 2020-06-24 2020-11-10 格创东智(深圳)科技有限公司 Method and system for automatically analyzing industrial field protocol based on gateway identification
CN112261061A (en) * 2020-11-03 2021-01-22 合沃物联技术(南京)有限公司 Equipment multi-protocol analysis method based on industrial Internet of things gateway
CN115714822A (en) * 2022-11-02 2023-02-24 中国人民解放军31155部队 Multi-protocol centralized control intelligent communication gateway of command center
CN117478765A (en) * 2023-11-08 2024-01-30 浪潮软件科技有限公司 Information interaction method based on Internet of things multi-protocol adaptation
CN117978888A (en) * 2024-01-18 2024-05-03 浪潮工创(山东)供应链科技有限公司 Gateway and data transmission method using same

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109005166A (en) * 2018-07-23 2018-12-14 合沃物联技术(南京)有限公司 A kind of middleware system for Internet of things and its multi protocol conversion method
CN111031034A (en) * 2019-12-11 2020-04-17 研祥智能科技股份有限公司 Multi-protocol convergence edge computing gateway
CN111163147A (en) * 2019-12-24 2020-05-15 深圳供电局有限公司 Gateway device, multi-protocol data transmission method and computer device
CN111917717A (en) * 2020-06-24 2020-11-10 格创东智(深圳)科技有限公司 Method and system for automatically analyzing industrial field protocol based on gateway identification
CN112261061A (en) * 2020-11-03 2021-01-22 合沃物联技术(南京)有限公司 Equipment multi-protocol analysis method based on industrial Internet of things gateway
CN115714822A (en) * 2022-11-02 2023-02-24 中国人民解放军31155部队 Multi-protocol centralized control intelligent communication gateway of command center
CN117478765A (en) * 2023-11-08 2024-01-30 浪潮软件科技有限公司 Information interaction method based on Internet of things multi-protocol adaptation
CN117978888A (en) * 2024-01-18 2024-05-03 浪潮工创(山东)供应链科技有限公司 Gateway and data transmission method using same

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
胡存;骆德汉;童怀;: "基于Modbus与MQTT融合工业能耗网关系统设计", 物联网技术, no. 04, 20 April 2019 (2019-04-20) *
陈丽芬;叶迅凯;赵鹏;周中良;储成诚;李禹翔;: "一种多协议互操作智能网关的实现", 家电科技, no. 02, 1 April 2020 (2020-04-01) *

Also Published As

Publication number Publication date
CN118317008B (en) 2024-08-16

Similar Documents

Publication Publication Date Title
CN111835786B (en) System for data acquisition and equipment control of multi-protocol equipment
EP1014748B1 (en) Management system for a multi-level communication network
CN108989066B (en) Equipment management method and device
US7657624B2 (en) Network usage management system and method
CN100461150C (en) Performing message and transformation adapter functions in a network element on behalf of an application
US20040172412A1 (en) Automated configuration of packet routed networks
CN108769121A (en) Intelligent industrial equips the method for uploading of internet of things data acquisition system and gathered data
CN104322010A (en) Systems and methods for comparing configuration files and generating corrective commands
US20020152297A1 (en) Quality of service control, particularly for telecommunication
US20030033162A1 (en) Coordinated management of contracts and services particulary for telecommunications
CN106559251A (en) A kind of Compilation Method and corresponding interface, component and system based on YANG models
CN102271052A (en) Network system, network management device and gateway device
CN101099345A (en) Interpreting an application message at a network element using sampling and heuristics
CN104394211A (en) Hadoop-based user behavior analysis system design and implementation method
CN108833267A (en) Intelligent industrial gateway
US10887408B2 (en) Remote monitoring of network communication devices
CN105991361A (en) Monitoring method and monitoring system for cloud servers in cloud computing platform
CN115913937B (en) Container multi-network card network configuration method, device, equipment and storage medium
CN100499502C (en) Trap analyzing and preprocessing system and method thereof
CN113381875B (en) Method for acquiring configuration data
CN118317008B (en) Multi-protocol multi-interface data distribution system and method based on industrial edge gateway
CN109714193B (en) Method for taking over object storage service based on zuul routing forwarding mode
EP2747341B1 (en) Connecting computer management systems via cellular digital telecommunication networks
CN107181701B (en) The collection method and device of common gateway interface data
US20230030925A1 (en) Dynamic data recombination through deployable modules

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant