A method, system, device and medium for parsing and processing of multi-source heterogeneous devices
Through data type conversion between managers and service nodes, automatic adaptation and data parsing of multi-source heterogeneous devices are achieved, solving the processing difficulties of multiple connections and multiple protocols in existing technologies and improving the flexibility and scalability of the system.
Patent Information
- Application Number
- CN202411587599.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-11-07
AI Technical Summary
In the existing technology, physical gateways cannot handle the access of multiple types of devices with multiple connections and multiple protocols at the same time, and cannot support dynamic access of devices when applications are running.
By converting the data types of the first service node and the second service node, and using the manager to configure the ID for the tag group and add a pipeline, automatic adaptation and data parsing of communication protocols of different devices are achieved.
It realizes the dynamic access and processing of multi-source heterogeneous devices, improves the flexibility and scalability of the system, and solves the processing problems of multiple connections and multiple protocols.
Smart Images

Figure CN119420822B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of industrial internet, and in particular to a multi-source heterogeneous device analysis and processing method, system, device and medium. BACKGROUND
[0002] For an industrial internet platform, the most critical issue is how to use its own communication standard to obtain the required data from various devices. In general, the most common practice of platform integrators is to provide API (Application Programming Interface) or SDK (Software Development Kit), and then the factory side needs to develop adaptation in the access layer by itself to connect the industrial devices and the platform.
[0003] However, due to the complexity of industrial devices and bus protocols, it is difficult to access data, and general physical gateways cannot cope with the requirements of simultaneous multi-connection and multi-protocol. At the same time, there are many types of industrial communication interfaces and communication standards, and the workload of multi-source heterogeneous industrial protocol analysis is large. The existing analysis solution cannot support dynamic access of multiple types of devices in application runtime. SUMMARY
[0004] The technical problem to be solved by the present application is to solve the above-mentioned deficiencies of the prior art, and to provide a multi-source heterogeneous device analysis and processing method, system, device and medium, to solve the problem that general physical gateways cannot cope with the requirements of simultaneous multi-connection and multi-protocol, and cannot support dynamic access of multiple types of devices in application runtime.
[0005] In a first aspect, the present application provides a multi-source heterogeneous device analysis and processing method, which comprises:
[0006] The first service node obtains the corresponding tag group configuration ID according to the subscription request of the application;
[0007] The first service node converts the subscription request and the first data type corresponding to the tag group configuration ID into a preset unified data type and sends it to the manager, so that the manager adds the pipeline corresponding to the first service node to the tag group configuration ID, and sends the converted subscription request and the tag group configuration ID to the second service node, and makes the second service node convert the converted subscription request and the tag group configuration ID into a second data type, and then reads the data in the device according to the reading frequency corresponding to the tag group configuration ID.
[0008] Further, the first service node comprises an application server, an application plug-in and a first adapter, the first service node acquires a corresponding label group configuration ID according to a subscription request of an application, and specifically comprises:
[0009] The application server receives a subscription request sent by an application and forwards the subscription request to the application plug-in;
[0010] The application plug-in registers a label group of the subscription request in a configuration list corresponding to a device to obtain the label group configuration ID;
[0011] The first service node converts a first data type corresponding to the subscription request and the label group configuration ID into a preset uniform data type and sends the converted data to a manager, and specifically comprises:
[0012] The application plug-in sends the subscription request and the label group configuration ID to the first adapter;
[0013] The first adapter converts the first data type corresponding to the subscription request and the label group configuration ID into the uniform data type and sends the converted data to the manager.
[0014] Further, the second service node comprises a device, a device plug-in and a second adapter, and the method further comprises:
[0015] The first adapter receives the converted data message sent by the manager, the converted data message is obtained by the device plug-in saving data read from the device into a data variable, returning the data variable to the second adapter, converting the data variable into a data block by the second adapter and putting the data block into a data message, and converting the data message from the second data type into the uniform data type and sending the converted data message to the manager;
[0016] The first adapter converts the converted data message from the uniform data type into the first data type and sends the converted data message to the application plug-in;
[0017] The application plug-in sends the data message of the first data type to the application server.
[0018] In a second aspect, the application provides a parsing and processing method of a multi-source heterogeneous device, and the method comprises:
[0019] The manager receives the converted subscription request and the label group configuration ID sent by the first service node, the converted subscription request and the label group configuration ID are obtained by the first service node according to a subscription request of an application, acquiring a corresponding label group configuration ID, converting a first data type corresponding to the subscription request and the label group configuration ID into a preset uniform data type and sending the converted data;
[0020] The manager configures an ID for the tag group plus the pipeline corresponding to the first service node, and sends the converted subscription request and the tag group configuration ID to the second service node, and makes the second service node convert the converted subscription request and the tag group configuration ID into a second data type, and then reads data in the device according to a reading frequency corresponding to the tag group configuration ID.
[0021] Further, the first service node includes an application server, an application plug-in and a first adapter, and the second service node includes a device, a device plug-in and a second adapter, and the method further includes:
[0022] The manager receives a converted data message sent by the second adapter, wherein the converted data message is sent by the second adapter after the device plug-in saves data read from the device into a data variable, returns the data variable to the second adapter, converts the data variable into a data block in a data message, and converts the data message from a second data type to the unified data type;
[0023] The manager sends the converted data message to the first adapter through the pipeline, so that the first adapter converts the converted data message from the unified data type to the first data type and sends it to the application plug-in, and the application plug-in sends the data message of the first data type to the application server.
[0024] In a third aspect, the application provides a method for analyzing and processing a multi-source heterogeneous device, which includes:
[0025] The second service node receives the converted subscription request and the tag group configuration ID sent by the manager after the manager configures an ID for the tag group plus the pipeline corresponding to the first service node, wherein the converted subscription request and the tag group configuration ID are sent by the first service node to the manager after the first service node acquires a corresponding tag group configuration ID according to the application subscription request, and converts the first data type corresponding to the subscription request and the tag group configuration ID into a preset unified data type;
[0026] The second service node converts the converted subscription request and the tag group configuration ID into a second data type.
[0027] The second service node reads data in the device according to a reading frequency corresponding to the tag group configuration ID.
[0028] Further, the second service node comprises a device, a device plug-in and a second adapter, the second service node converts the converted subscription request and the tag group configuration ID into a second data type, specifically comprising:
[0029] The second adapter converts the converted subscription request and the tag group configuration ID from the unified data type into the second data type;
[0030] The second service node reads data in the device according to the reading frequency corresponding to the tag group configuration ID, specifically comprising:
[0031] The second adapter sends the subscription request and the tag group configuration ID of the second data type to the device plug-in;
[0032] The device plug-in acquires all data tags to be read according to the tag group configuration ID;
[0033] The device plug-in establishes a data tag ID queue arranged from small to large time interval according to the reading time interval corresponding to all data tags to be read, and reads data from the device according to the data tag ID queue and the reading time interval corresponding to each data tag.
[0034] Further, the first service node comprises an application server, an application plug-in and a first adapter, and the method further comprises:
[0035] The device plug-in saves the data read from the device into a data variable, and returns the data variable to the second adapter;
[0036] The second adapter converts the data variable into a data block in a data message, and sends the data message from the second data type to the manager after converting the data message into the unified data type, so that the manager sends the converted data message to the first adapter through the pipeline, so that the first adapter converts the converted data message from the unified data type into the first data type and sends it to the application plug-in, and the application plug-in sends the data message of the first data type to the application server.
[0037] In a fourth aspect, the application provides a multi-source heterogeneous device analysis and processing system, which comprises a first service node, a manager and a second service node
[0038] The first service node is used for executing the multi-source heterogeneous device analysis and processing method of the first aspect;
[0039] The manager is used for executing the multi-source heterogeneous device analysis and processing method of the second aspect;
[0040] The second service node is configured to perform the multi-source heterogeneous device parsing and processing method of the third aspect.
[0041] In a fifth aspect, the present application provides a multi-source heterogeneous device parsing and processing apparatus, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the multi-source heterogeneous device parsing and processing method of the first aspect or the second aspect or the third aspect.
[0042] In a sixth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the multi-source heterogeneous device parsing and processing method of the first aspect or the second aspect or the third aspect.
[0043] The present application provides a multi-source heterogeneous device parsing and processing method, system, apparatus and medium. Firstly, the first service node obtains the corresponding label group configuration ID according to the application subscription request; then the first service node converts the subscription request and the first data type corresponding to the label group configuration ID into a preset unified data type and sends it to the manager, so that the manager adds the pipeline corresponding to the first service node to the label group configuration ID, and sends the converted subscription request and the label group configuration ID to the second service node, and makes the second service node convert the converted subscription request and the label group configuration ID into a second data type, and then reads the data in the device according to the reading frequency corresponding to the label group configuration ID. The present application converts the data types of different service nodes into a unified data type, realizes automatic adaptation according to different device communication protocols, and can realize data parsing and exchange, which can better manage and control the dynamic access and processing of multi-source heterogeneous devices, can improve the flexibility and scalability of the system, and solves the problems that the existing physical gateway cannot cope with simultaneous multi-connection and multi-protocol requirements, and cannot support dynamic access of multiple types of devices in application runtime. BRIEF DESCRIPTION OF DRAWINGS
[0044] Figure 1 A flowchart of a multi-source heterogeneous device parsing and processing method according to the first embodiment of the present application;
[0045] Figure 2 A connection diagram of the manager, the first service node and the second service node according to the first embodiment of the present application;
[0046] Figure 3 A data label group configuration diagram according to the first embodiment of the present application;
[0047] Figure 4Structure diagram of the manager of the embodiment of the present application;
[0048] Figure 5 Connection diagram of the adapter and the plug-in of the embodiment of the present application;
[0049] Figure 6 Structure diagram of the access system of the multi-source heterogeneous device of the embodiment of the present application;
[0050] Figure 7 Data transmission processing diagram of the message routing and the hash-set mode of the embodiment of the present application;
[0051] Figure 8 Data transmission processing diagram of another message routing and hash-set mode of the embodiment of the present application;
[0052] Figure 9 Flow chart of the analysis and processing method of the multi-source heterogeneous device of the embodiment 2 of the present application;
[0053] Figure 10 Flow chart of the analysis and processing method of the multi-source heterogeneous device of the embodiment 3 of the present application;
[0054] Figure 11 Structure diagram of the analysis and processing system of the multi-source heterogeneous device of the embodiment 4 of the present application;
[0055] Figure 12 Structure diagram of the analysis and processing device of the multi-source heterogeneous device of the embodiment 5 of the present application. DETAILED DESCRIPTION
[0056] In order to make the skilled in the art better understand the technical solutions of the present application, the embodiments of the present application will be further described in detail below with reference to the drawings.
[0057] It can be understood that the specific embodiments and the drawings described herein are only used to explain the present application, but not to limit the present application.
[0058] It can be understood that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0059] It can be understood that, for the convenience of description, only the parts related to the present application are shown in the drawings of the present application, and the parts unrelated to the present application are not shown in the drawings.
[0060] It can be understood that each unit and module involved in the embodiments of the present application can only correspond to one entity structure, or can be composed of multiple entity structures, or multiple units and modules can be integrated into one entity structure.
[0061] It can be understood that the terms "first", "second" and the like in the embodiments of the present application are used to distinguish different objects or different processing of the same object, rather than to describe a specific order of the object.
[0062] It can be understood that the functions, steps marked in the flowcharts and block diagrams of the present application can occur in an order different from that marked in the drawings without conflict.
[0063] It can be understood that in the flowcharts and block diagrams of the present application, the architecture, functions and operations of the possible implementation of the system, device, equipment, method according to the embodiments of the present application are shown. Each block in the flowchart or block diagram can represent a unit, module, program segment, code, which contains executable instructions for implementing the specified function. Moreover, each block or combination of blocks in the block diagram and flowchart can be implemented by a hardware-based system for implementing the specified function, or by a combination of hardware and computer instructions.
[0064] It can be understood that the units and modules involved in the embodiments of the present application can be implemented by software or by hardware, for example, the units and modules can be located in a processor.
[0065] Embodiment 1:
[0066] The present embodiment provides a parsing and processing method of multi-source heterogeneous devices, which is applied to a first service node, as shown in the figure, the method comprises the steps of: Figure 1
[0067] Step S101: The first service node acquires the corresponding label group configuration ID according to the application subscription request.
[0068] In the present embodiment, the service node can include the roles of the subscriber and the provider, the first service node corresponds to the role of the subscriber, and usually corresponds to the northbound application. Each subscription request has a corresponding label group, and the label group can be pre-configured and defined. When defining, first create group information, fill in the time interval of collecting data from the device and the time interval of reporting data to the northbound application, then create a label, fill in the label information, including attributes, data types, drive address, multiplication coefficient, description, etc. If the label sets the write attribute, the device can be controlled in reverse. The label group configuration ID is used to uniquely identify a label group.
[0069] It should be noted that the main purpose of defining the label group is to effectively manage and organize the data collected from multiple devices, to ensure that the data collection and reporting process can be carried out according to the set time interval, so as to improve the efficiency of data processing and the response ability of the system. In addition, by creating a label, the data can be described and classified in detail, which is convenient for subsequent data analysis, monitoring and device control.
[0070] Step S102: The first service node sends the subscription request and the first data type corresponding to the tag group configuration ID to the manager after converting them into a preset unified data type, so that the manager adds a pipe corresponding to the first service node to the tag group configuration ID and sends the converted subscription request and the tag group configuration ID to the second service node, and makes the second service node convert the converted subscription request and the tag group configuration ID into a second data type and read data in the device according to a reading frequency corresponding to the tag group configuration ID.
[0071] In the embodiment, different service nodes provide application or driving services, but the data types that can be processed by each node are different. It can be seen that the data types processed by different service nodes are quite different, so an internal unified data type is needed as a transit. Therefore, the data type of the service node can be converted into a preset unified data type, or the unified data type can be converted into the data type of the service node.
[0072] In the embodiment, the manager receives the converted subscription request and the tag group configuration ID sent by the first service node, and adds a pipe corresponding to the first service node to the tag group configuration ID and then sends the converted subscription request and the tag group configuration ID to the second service node. After receiving the converted subscription request and the tag group configuration ID sent by the manager, the second service node converts the converted subscription request and the tag group configuration ID into a second data type and reads data in the device according to a reading frequency corresponding to the tag group configuration ID. The second service node corresponds to a role of a provider and usually corresponds to a southbound device.
[0073] Optionally, the first service node includes an application server, an application plug-in and a first adapter, and the first service node acquires a corresponding tag group configuration ID according to a subscription request of an application, specifically including:
[0074] The application server receives a subscription request issued by the application and forwards the subscription request to the application plug-in;
[0075] The application plug-in registers a tag group of the subscription request in a configuration list corresponding to a device to obtain the tag group configuration ID;
[0076] The first service node sends the subscription request and the first data type corresponding to the tag group configuration ID to the manager after converting them into a preset unified data type, specifically including:
[0077] The application plug-in sends the subscription request and the tag group configuration ID to the first adapter;
[0078] The first adapter converts the subscription request and the first data type corresponding to the tag group configuration ID into the uniform data type and sends to the manager.
[0079] In this embodiment, the adapter corresponding to the first service node is called the first adapter. Specifically, the application sends a subscription request, which is forwarded to the application plug-in by the application server. The application plug-in registers the tag group of the subscription request in the configuration list corresponding to the device after receiving the subscription request, obtains the ID of the tag group configuration, and notifies the first adapter of the request through a callback interface. The first adapter converts the data type and sends the subscription request and the tag group configuration ID to the manager.
[0080] In this embodiment, the manager includes a data tag manager and a message routing manager. The manager gives the data tag manager to manage the subscription request and the tag group configuration ID. The data tag manager adds the corresponding pipeline of the corresponding subscriber to the tag group of the subscription request. Then, the message routing manager routes the received data message to the second service node according to the tag configuration corresponding to the tag group configuration ID.
[0081] Optionally, the second service node includes a device, a device plug-in, and a second adapter. The method further includes:
[0082] The first adapter receives the converted data message sent by the manager. The converted data message is obtained by saving the data read from the device to a data variable by the device plug-in, returning the data variable to the second adapter, converting the data variable to a data block by the second adapter, putting the data block into a data message, and converting the data message from the second data type to the uniform data type and sending it to the manager.
[0083] The first adapter converts the converted data message from the uniform data type to the first data type and sends it to the application plug-in.
[0084] The application plug-in sends the data message of the first data type to the application server.
[0085] It should be noted that there are two connection methods between the plug-in and the adapter. One is that the plug-in is directly connected with the adapter, which is mostly applied in the south direction; the other is that the plug-in is connected with the adapter through a third-party agent, which is mostly applied in the north direction. Each adapter needs an independent thread to execute, and the loading of the plug-in also needs another thread to execute. Therefore, each service node has two execution threads. The user loads the required application or device plug-in into the adapter to become a service node to provide corresponding services. That is, each plug-in can provide different services, such as Web server, drive, MQTT, etc., as long as it is loaded into the adapter. Among them, the plug-in can be loaded into the adapter in the form of a Linux dynamic library (.so file), and these plug-ins support hot plug mode, that is, they can be loaded or unloaded at any time during runtime, which is convenient and flexible.
[0086] In the embodiment, the adapter corresponding to the second service node is referred to as a second adapter, Figure 2 A connection diagram of the manager and the first service node and the second service node is shown.
[0087] Among them, the second service node converts the converted subscription request and the tag group configuration ID into a second data type, specifically including the following steps: the second adapter converts the converted subscription request and the tag group configuration ID from the unified data type into the second data type; the second adapter sends the subscription request and the tag group configuration ID of the second data type to the device plug-in; the device plug-in acquires all data tags to be read according to the tag group configuration ID; and a data tag ID queue from small to large interval is established according to the reading time interval corresponding to all the data tags to be read, and data is read from the device according to the data tag ID queue and the reading time interval corresponding to each data tag.
[0088] In the embodiment, the device plug-in saves the data read from the device into a data variable, and returns the data variable to the second adapter; the second adapter converts the data variable into a data block and puts it into a data message, and sends the data message from the second data type to the unified data type to the manager; the manager receives the converted data message sent by the second adapter, and sends the converted data message to the first adapter through the pipeline, so that the first adapter converts the converted data message from the unified data type to the first data type and sends it to the application plug-in; and the application plug-in sends the data message of the first data type to the application server, and the application server returns it to the corresponding application.
[0089] It needs to be noted that connecting a large number of devices is a big challenge for all industrial internet projects. Device connection and data collection are different from traditional Internet of Things projects, which need to be considered from the perspective of automation. Not all legacy devices can provide the required device data through modification, which must be determined by the device and the project itself. It is not easy to connect all devices in a complex industrial environment with many different manufacturers using various communication protocols, and usually requires the support of the manufacturer, unless the customer has its own engineers to maintain the device. On the other hand, northbound needs to support more diverse applications, not just sending messages to the platform, extending the function by allowing some additional functions to be added to the basic connection, such as data stream processors. The whole process can be done on the edge side. Therefore, the purpose of the present application is to provide an adaptive protocol analysis mechanism and an efficient data caching and transmission method, a modular device management framework, to provide a flexible and scalable solution for multi-source heterogeneous device access and processing, to simplify the device integration process of the industrial Internet of Things platform, to improve the efficiency and reliability of data transmission, and to support dynamic access and multi-protocol collaboration, to meet the needs of various industrial application scenarios.
[0090] In a specific embodiment, the multi-source heterogeneous device analysis and processing method can include the following steps:
[0091] In the user configuration phase:
[0092] Step one, the user adds a device to the southbound device management interface, and the device information includes device name, device configuration button, delete button, node status, status switching button, connection status (5 states, initialization, configuration, ready, running, stopped), and plug-in module name.
[0093] Step two, configure the southbound device connection, such as the terminal URL of the OPC UA server device, the connection username, password, upload certificate and key file, complete the device configuration, and the device card automatically enters the running state.
[0094] Step three, create group information, and fill in the time interval for collecting data from the device and the time interval for reporting data to the northbound application; finally, create a tag for the current group, and fill in the tag information, including attributes, data types, drive addresses, multiplication coefficients, and descriptions. If the tag is set to write attributes, the device can be controlled in reverse.
[0095] In the multi-source heterogeneous dynamic device protocol analysis and processing phase:
[0096] Step one, the application issues a subscription request, which is forwarded to the application plug-in by the application server.
[0097] Step two, the application plug-in receives the forwarding data subscription request, registers the label group of the subscription request in the configuration list corresponding to the device, obtains the ID of the label group configuration, and notifies the adapter about the request through the callback interface.
[0098] Step three, the configuration ID of the subscription request label group is sent to the manager, and the manager delivers the subscription request to the data label manager for management. The data label manager adds the corresponding pipeline of the corresponding subscriber to the subscription request label group.
[0099] Step four, the manager sends a subscription request to the adapter associated with the device, and the adapter tells the driver plug-in (i.e. device plug-in) about the request through the callback interface.
[0100] Step five, the driver plug-in obtains all data labels to be read from the configuration ID of the label group, establishes an ID queue of data labels arranged from small to large interval time according to the interval time of data label reading, and sets a timer according to the interval time.
[0101] Optionally, in step five, the specific process of obtaining all data labels to be read by the driver plug-in from the configuration ID of the label group is as follows: the label group packs the same reading frequency into a group, so each service node has many data label groups, and each group has only one reading frequency. For example, the data label group configuration diagram is as shown in Figure 3 The northbound application can select to subscribe to those data label groups required by the user, and after subscription, the pipeline channel is registered in the sub-pipeline. The plug-in reads the data of the device according to the reading frequency of the label group. After reading the data, the data is sent to the manager, and the manager routes the data message to the final station data node according to the routing table.
[0102] Step six, when the timing time arrives, the ID of the requested data label is taken out from the head of the queue, the specific configuration information of the data label is obtained from the data label table through the ID, the configuration information is read from the device to determine the data to be read, and is put into the data variable.
[0103] Step seven, the driver plug-in returns the data variable information to the adapter through the callback interface.
[0104] Step eight, the adapter converts it into a data block and puts it into a data message to send to the manager.
[0105] Step nine, the manager calls the data label manager to quickly match the adapter of the subscriber according to the label group configuration ID contained in the data block, and sends the data message to all adapters of the subscriber.
[0106] Step ten, the adapter of the subscriber sends the data to the plug-in of the subscriber through the callback interface, and the plug-in of the subscriber sends the requested data to the subscriber application.
[0107] Further, the steps three, four, eight, nine, the manager is a very important module, managing the bus module and various adapters. As shown, it mainly has four modules: Figure 4
[0108] Data tag manager: a data tag configuration list, maintains all data tag configuration of this node.
[0109] Plug-in manager: users can dynamically load or unload dynamic.so file at any time and register in the plug-in table as alternative plug-ins.
[0110] Adapter manager: users can select the required plug-in according to the plug-in function and service provided in the plug-in table.
[0111] Message routing manager: according to the data tag configuration, route the received data message to the final node.
[0112] Further, as shown in the step four, step ten, the adapter and plug-in design separates two main functions: callback and interface. The service node will issue device data reading command according to the reading frequency set by the tag group and execute the plug-in function, and then execute the callback function when receiving the data response, and send the data to the subscribed node. Figure 5
[0113] When adding a new service node, a plug-in opening function must be executed, followed by an initialization function, and finally a configuration function. Before deleting the service node, the plug-in unit must run and then close.
[0114] Because there are different service nodes, providing application or driving service, but the data types handled by each node are different. It can be seen that the data types handled by different service nodes are very different, so an internal unified data type must be used as a transfer. In the Modbus protocol specification, the data type supported is defined, so the Modbus data type can be converted into the 5G full connection platform device integration function component unified data type in the service node. Generally, northbound applications such as MQTT or computing engines will transmit messages in JSON format, and the data types of JSON are only boolean, string, number, etc. The 5G full connection platform device integration function component unified data type is finally converted into the JSON data type to send messages.
[0115] There are two connection methods between plug-ins and adapters. One is that the plug-in is directly connected with the adapter, which is mostly used in southbound applications; the other is that the plug-in is connected with the adapter through a third-party agent, which is mostly used in northbound applications.
[0116] Each adapter needs an independent thread to execute, and loading plug-ins also needs another thread to execute. Therefore, each service node has two execution threads. Users load the required application or function plug-in into the adapter to provide corresponding services as the service node. Generally, plug-ins are loaded into the adapter in the form of Linux dynamic libraries (.so files). Moreover, these plug-ins support hot plug-in mode, that is, they can be loaded or unloaded at any time during runtime, which is convenient and flexible. According to the working conditions on site, the number of device driver nodes can be dynamically increased or decreased, and the system has good configurability. Therefore, in general, only the required services need to be implemented in the plug-in, and each plug-in implements one service, which isolates the coupling of functions between nodes.
[0117] In another specific embodiment, the multi-source heterogeneous device parsing and processing method is applied to a multi-source heterogeneous device access system, as shown in Figure 6 The system includes:
[0118] The top layer is a third-party application. Third-party software runs independently and provides application services, such as a streaming engine, an MQTT connection, and the like.
[0119] The middle layer is various function plug-ins. Each plug-in can provide different services, such as a Web server, a driver, an MQTT, and the like, as long as it is loaded into the adapter. The adapter and bridge mode are adopted. First, the plug-in internally contains a driver variable, which is associated with a general driver interface, and the drivers of different device protocols implement the functions of the driver interface, each of which has different functions inside. The plug-in is contained by the adapter, and the plug-in implements the creation of threads (i.e., pipes / channels) and the transmission of data, and the like; the adapter itself has other functions such as data format conversion. Thus, the driver and the adapter can be independently changed. For example, the upgrade or update of a specific driver will not affect the data transmission format; and the update of the data processing format of the adapter will not require the update of the driver.
[0120] The bottom layer is a core framework component. The bottom layer is a basic message transmission library; the message transmission of each node is completed by relying on the library, and basic thread management, dynamic library management, Web server, and MQTT function functions are provided; the functional component base lib is a 5G full-connection platform device integration functional component itself basic library, including general functions, logs; and finally, various types of adapters, including streaming, MQTT connection, and driver connection, and the like.
[0121] Among them, the basic message transmission library is a lightweight message layer, which adopts a star-shaped message bus design:
[0122] Point-to-point and peer-to-peer architecture: each process directly communicates with other processes without the need to relay through a central node. This reduces the risk of single-point failure and improves the overall robustness of the system.
[0123] Lightweight and high efficiency: not carrying maintenance Broker brings additional network hops, resource consumption and delay, makes message passing faster, suitable for resource limited environment, such as embedded system, edge computing.
[0124] Flexible deployment is simple: without configuring and maintaining centralized Broker, simplifying deployment, reducing operation and maintenance complexity, and reducing cost
[0125] Low latency: for scenarios requiring ultra-low latency, such as real-time data stream processing, the Broker design reduces one layer of forwarding, direct interaction, and improves immediacy.
[0126] As shown in Figure 6 There is no direct contact between the two modules of the scheme, and the contact between them is completely realized through the control and call of the main module.
[0127] Among them, the transmission processing after message routing is to process data through hash-set mode, which is suitable for efficient data parallel processing and reorganization on the edge side, and is also suitable for the scene that data is cached on the edge, and the cloud side obtains data through the message queue mode. For example, the message routing and hash-set mode data transmission processing schematic diagram can be as shown in Figure 7 Or 8.
[0128] The multi-source heterogeneous device analysis and processing method provided by the embodiment of the application first acquires the corresponding label group configuration ID according to the application subscription request; then the first service node converts the subscription request and the first data type corresponding to the label group configuration ID into a preset unified data type and sends it to the manager, so that the manager adds the pipeline corresponding to the first service node to the label group configuration ID, and sends the converted subscription request and the label group configuration ID to the second service node, and makes the second service node convert the converted subscription request and the label group configuration ID into a second data type, and then reads the data in the device according to the reading frequency corresponding to the label group configuration ID. The application converts the data types of different service nodes into a unified data type, realizes automatic adaptation according to different device communication protocols, and can analyze and exchange data, which can better manage and control the dynamic access and processing of multi-source heterogeneous devices, improve the flexibility and scalability of the system, and solve the problems that the existing physical gateway cannot cope with multiple connection and multiple protocol requirements at the same time, and cannot support dynamic access of multiple types of devices in application runtime.
[0129] Embodiment 2:
[0130] As Figure 9As shown, the embodiment provides a parsing and processing method of multi-source heterogeneous devices, applied to a manager, comprising:
[0131] Step S201: The manager receives the converted subscription request and the label group configuration ID sent by the first service node, wherein the converted subscription request and the label group configuration ID are obtained by the first service node according to the applied subscription request, and the first data type corresponding to the subscription request and the label group configuration ID is converted into a preset unified data type and then sent.
[0132] In the embodiment, the first service node includes an application server, an application plug-in and a first adapter. Specifically, the application sends a subscription request, which is forwarded to the application plug-in by the application server. After receiving the subscription request, the application plug-in registers the label group of the subscription request in the configuration list corresponding to the device to obtain the ID of the label group configuration, and informs the first adapter of the request through a callback interface. After data type conversion, the first adapter sends the subscription request and the label group configuration ID to the manager.
[0133] Step S202: The manager adds the pipeline corresponding to the first service node to the label group configuration ID, and sends the converted subscription request and the label group configuration ID to the second service node. The second service node converts the converted subscription request and the label group configuration ID into a second data type, and reads the data in the device according to the reading frequency corresponding to the label group configuration ID.
[0134] In the embodiment, the manager includes a data label manager and a message routing manager. The manager delivers the subscription request and the label group configuration ID to the data label manager for management. The data label manager adds the corresponding pipeline of the corresponding subscriber to the label group of the subscription request. Then, the message routing manager routes the received data message to the second service node according to the label configuration corresponding to the label group configuration ID.
[0135] Optionally, the second service node includes a device, a device plug-in and a second adapter, and the method further comprises:
[0136] The manager receives the converted data message sent by the second adapter, wherein the converted data message is obtained by saving the data read from the device into a data variable by the device plug-in, returning the data variable to the second adapter, converting the data variable into a data block by the second adapter, putting the data block into a data message, and sending the data message from the second data type to the unified data type.
[0137] The manager sends the converted data message to the first adapter through the pipeline, so that the first adapter converts the converted data message from the uniform data type to the first data type and sends it to the application plug-in, and the application plug-in sends the data message of the first data type to the application server.
[0138] In the embodiment, the device plug-in saves the data read from the device into a data variable and returns the data variable to the second adapter, the second adapter converts the data variable into a data block in a data message and sends the data message converted from the second data type to the uniform data type to the manager, the manager receives the converted data message sent by the second adapter and sends the converted data message to the first adapter through the pipeline, the first adapter receives the converted data message sent by the manager, converts the converted data message from the uniform data type to the first data type, and sends it to the application plug-in, and the application plug-in sends the data message of the first data type to the application server.
[0139] Embodiment 3
[0140] As shown in Figure 10 The embodiment provides a parsing and processing method of multi-source heterogeneous devices, applied to a second service node, and the method comprises the following steps:
[0141] In step S301, the second service node receives the converted subscription request and the tag group configuration ID sent by the manager after adding the pipeline corresponding to the first service node to the tag group configuration ID of the subscription request, wherein the converted subscription request and the tag group configuration ID are obtained by the first service node according to the subscription request of the application, and the first data type corresponding to the subscription request and the tag group configuration ID is converted into a preset uniform data type and sent to the manager.
[0142] In the embodiment, the first service node comprises an application server, an application plug-in and a first adapter. Specifically, the application sends a subscription request, which is forwarded to the application plug-in by the application server. After receiving the subscription request, the application plug-in registers the tag group of the subscription request in the configuration list corresponding to the device to obtain the ID of the tag group configuration, informs the first adapter of the request through a callback interface, and sends the subscription request and the tag group configuration ID to the manager after data type conversion by the first adapter. The manager adds the pipeline corresponding to the first service node to the tag group configuration ID and sends the converted subscription request and the tag group configuration ID to the second service node.
[0143] Step S302: The second service node converts the converted subscription request and the tag group configuration ID into a second data type.
[0144] Step S303: The second service node reads data in the device according to a read frequency corresponding to the tag group configuration ID.
[0145] Optionally, the second service node comprises a device, a device plug-in and a second adapter, and the second service node converts the converted subscription request and the tag group configuration ID into a second data type, specifically comprising:
[0146] The second adapter converts the converted subscription request and the tag group configuration ID from the uniform data type into the second data type;
[0147] The second service node reads data in the device according to a read frequency corresponding to the tag group configuration ID, specifically comprising:
[0148] The second adapter sends the subscription request and the tag group configuration ID of the second data type to the device plug-in;
[0149] The device plug-in acquires all data tags to be read according to the tag group configuration ID;
[0150] The device plug-in establishes a data tag ID queue arranged from small to large time interval according to the read time interval corresponding to the all data tags to be read, and reads data from the device according to the data tag ID queue and the read time interval corresponding to each data tag.
[0151] Optionally, the method further comprises:
[0152] The device plug-in saves the data read from the device into a data variable, and returns the data variable to the second adapter;
[0153] The second adapter converts the data variable into a data block in a data message, and sends the data message from the second data type to the manager after converting the data message from the second data type into the uniform data type, so that the manager sends the converted data message to the first adapter through the pipeline, so that the first adapter converts the converted data message from the uniform data type into the first data type after converting the data message from the uniform data type into the first data type, and sends the data message to the application plug-in, and the application plug-in sends the data message of the first data type to the application server.
[0154] It should be noted that there are two connection methods between the plug-in and the adapter. One is that the plug-in is directly connected with the adapter, which is mostly applied in the south direction; the other is that the plug-in is connected with the adapter through a third-party agent, which is mostly applied in the north direction. Each adapter needs an independent thread to execute, and the loading of the plug-in also needs another thread to execute. Therefore, each service node has two execution threads. The user loads the required application or device plug-in into the adapter to become a service node to provide corresponding services. That is, each plug-in can provide different services such as Web server, driver, MQTT, etc. as long as it is loaded into the adapter. Among them, the plug-in can be loaded into the adapter in the form of a Linux dynamic library (.so file), and these plug-ins support hot plug mode, that is, they can be loaded or unloaded at any time during runtime, which is convenient and flexible.
[0155] Embodiment 4
[0156] Reference Figure 11 The embodiment provides a multi-source heterogeneous device analysis and processing system, comprising a first service node 11, a manager 12 and a second service node 13.
[0157] The first service node 11 is used for executing the multi-source heterogeneous device analysis and processing method in the embodiment 1.
[0158] The manager 12 is used for executing the multi-source heterogeneous device analysis and processing method in the embodiment 2.
[0159] The manager 13 is used for executing the multi-source heterogeneous device analysis and processing method in the embodiment 3.
[0160] Embodiment 5
[0161] Reference Figure 12 The embodiment provides a multi-source heterogeneous device analysis and processing device, comprising a memory 21 and a processor 22, the memory 21 stores a computer program, and the processor 22 is configured to execute the computer program to execute the multi-source heterogeneous device analysis and processing method in the embodiment 1 or the embodiment 2 or the embodiment 3.
[0162] The memory 21 is connected with the processor 22, the memory 21 can adopt a flash memory or a read-only memory or other memories, and the processor 22 can adopt a central processing unit or a single-chip microcomputer.
[0163] Embodiment 6
[0164] The embodiment provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to realize the multi-source heterogeneous device analysis and processing method in the embodiment 1 or the embodiment 2 or the embodiment 3.
[0165] The computer-readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, computer program modules or other data. The computer-readable storage medium includes, but is not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disc (DVD) or other optical disc storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.
[0166] To sum up, the multi-source heterogeneous device analysis and processing method, system, device and medium provided by the embodiment of the application first acquire the corresponding label group configuration ID according to the application subscription request; then the first service node converts the subscription request and the first data type corresponding to the label group configuration ID into a preset unified data type and sends it to the manager, so that the manager adds the corresponding pipeline of the first service node to the label group configuration ID, and sends the converted subscription request and the label group configuration ID to the second service node, and makes the second service node convert the converted subscription request and the label group configuration ID into a second data type, and then reads the data in the device according to the reading frequency corresponding to the label group configuration ID. The application converts the data types of different service nodes into a unified data type, realizes automatic adaptation according to different device communication protocols, and can analyze and exchange data, which can better manage and control the dynamic access and processing of multi-source heterogeneous devices, improve the flexibility and scalability of the system, and solve the problems that the existing physical gateway cannot cope with simultaneous multi-connection and multi-protocol requirements, and cannot support dynamic access of multiple types of devices in application runtime.
[0167] It can be understood that the above embodiments are only exemplary embodiments adopted to illustrate the principles of the application, but the application is not limited thereto. Various modifications and improvements can be made by those skilled in the art without departing from the spirit and essence of the application, and these modifications and improvements are also considered within the protection scope of the application.
Claims
1. A method for parsing and processing multi-source heterogeneous devices, characterized in that: The method comprises: The first service node obtains the corresponding tag group configuration ID according to the application subscription request; The first service node converts the subscription request and the first data type corresponding to the tag group configuration ID into a preset unified data type and sends it to the manager, so that the manager adds the pipeline corresponding to the first service node to the tag group configuration ID, and sends the converted subscription request and the tag group configuration ID to the second service node, and makes the second service node convert the converted subscription request and the tag group configuration ID into a second data type, and then reads the data in the device according to the reading frequency corresponding to the tag group configuration ID, wherein the device is included in the second service node.
2. The method according to claim 1, characterized in that The first service node includes an application server, an application plug-in, and a first adapter. The first service node obtains the corresponding tag group configuration ID according to the application subscription request, specifically including: The application server receives the subscription request sent by the application and forwards the subscription request to the application plug-in; The application plug-in registers the tag group of the subscription request into the configuration list corresponding to the device and obtains the tag group configuration ID; The first service node converts the subscription request and the first data type corresponding to the tag group configuration ID into a preset unified data type and sends the data to the manager, specifically including: The application plug-in sends the subscription request and the tag group configuration ID to the first adapter; The first adapter converts the subscription request and the first data type corresponding to the tag group configuration ID into the unified data type and sends the converted data to the manager.
3. The method according to claim 2, characterized in that The second service node includes a device, a device plug-in, and a second adapter. The method further includes: The first adapter receives the converted data message sent by the manager, wherein the device plug-in saves the data read from the device into a data variable and returns the data variable to the second adapter. The second adapter then converts the data variable into a data block and puts it into a data message, converts the data message from the second data type to the unified data type, and then sends it to the manager; The first adapter converts the converted data message from the unified data type to the first data type and sends the converted data message to the application plug-in; The application plug-in sends the data message of the first data type to the application server.
4. A method for parsing and processing multi-source heterogeneous devices, characterized in that: The method comprises: The manager receives the converted subscription request and tag group configuration ID sent by the first service node, where the first service node obtains the corresponding tag group configuration ID according to the application's subscription request, converts the first data type corresponding to the subscription request and the tag group configuration ID into a preset unified data type, and then sends the converted subscription request and tag group configuration ID. The manager adds the pipeline corresponding to the first service node to the tag group configuration ID, and sends the converted subscription request and the tag group configuration ID to the second service node, and enables the second service node to convert the converted subscription request and the tag group configuration ID into a second data type, and then read the data in the device according to the reading frequency corresponding to the tag group configuration ID, wherein the device is included in the second service node.
5. The method according to claim 4, characterized in that The first service node includes an application server, an application plug-in, and a first adapter, the second service node includes a device, a device plug-in, and a second adapter, and the method further includes: The manager receives the converted data message sent by the second adapter, wherein the converted data message is obtained by the device plug-in saving the data read from the device into a data variable and returning the data variable to the second adapter. The second adapter then converts the data variable into a data block and puts it into a data message, and then converts the data message from the second data type to the unified data type before sending the data message. The manager sends the converted data message to the first adapter through the pipeline, so that the first adapter converts the converted data message from the unified data type to the first data type and then sends it to the application plug-in; and the application plug-in sends the data message of the first data type to the application server.
6. A method for parsing and processing multi-source heterogeneous devices, characterized in that: The method comprises: The second service node receives the tag group configuration ID of the subscription request from the manager plus the pipeline corresponding to the first service node, and then sends the converted subscription request and the tag group configuration ID. The converted subscription request and the tag group configuration ID are obtained by the first service node according to the subscription request of the application, and the first data type corresponding to the subscription request and the tag group configuration ID is converted into a preset unified data type and then sent to the manager. The second service node converts the converted subscription request and the tag group configuration ID into a second data type; The second service node reads data in a device according to a reading frequency corresponding to the tag group configuration ID, wherein the device is included in the second service node.
7. The method according to claim 6, characterized in that The second service node includes a device, a device plug-in, and a second adapter. The second service node converts the converted subscription request and the tag group configuration ID into a second data type, specifically including: The second adapter converts the converted subscription request and the tag group configuration ID from the unified data type into the second data type; The second service node reads data from the device according to the reading frequency corresponding to the tag group configuration ID, specifically including: The second adapter sends the subscription request of the second data type and the tag group configuration ID to the device plug-in; The device plug-in obtains all data tags to be read according to the tag group configuration ID; The device plug-in establishes a data tag ID queue arranged in ascending order according to the reading time intervals corresponding to all the data tags to be read, and reads data from the device according to the data tag ID queue and the reading time intervals corresponding to each data tag.
8. The method according to claim 7, characterized in that The first service node includes an application server, an application plug-in, and a first adapter. The method further includes: The device plug-in saves the data read from the device into a data variable and returns the data variable to the second adapter; The second adapter converts the data variable into a data block and places it into a data message, and converts the data message from the second data type to the unified data type and sends it to the manager, so that the manager sends the converted data message through the pipeline to the first adapter, so that the first adapter converts the converted data message from the unified data type to the first data type and sends it to the application plug-in, and the application plug-in sends the data message of the first data type to the application server.
9. A parsing and processing system for multi-source heterogeneous devices, characterized in that: The system includes a first service node, a manager, and a second service node: The first service node is used to execute the parsing and processing method for multi-source heterogeneous devices according to any one of claims 1 to 3; The manager is used to execute the parsing and processing method of multi-source heterogeneous devices according to claim 4 or 5; The second service node is used to execute the parsing and processing method for multi-source heterogeneous devices according to any one of claims 6 to 8.
10. A parsing and processing device for multi-source heterogeneous devices, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to implement the parsing and processing method of a multi-source heterogeneous device according to any one of claims 1 to 3, or to implement the parsing and processing method of a multi-source heterogeneous device according to claim 4 or 5, or to implement the parsing and processing method of a multi-source heterogeneous device according to any one of claims 6 to 8.
11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the parsing and processing method for a multi-source heterogeneous device as described in any one of claims 1 to 3, or implements the parsing and processing method for a multi-source heterogeneous device as described in claim 4 or 5, or implements the parsing and processing method for a multi-source heterogeneous device as described in any one of claims 6 to 8.
Citation Information
Patent Citations
Adding hierarchy of objects when ingesting and normalizing data from heterogeneous data sources
US12118015B1
Systems, methods, and apparatuses for verifying entries in disparate databases
US20220342859A1