Method and middleware for collection and distribution of industrial data, and storage medium

By providing a middleware for industrial data acquisition and distribution, the complexity and inefficiency of industrial data acquisition and distribution in the prior art are solved, and a general acquisition and distribution platform is realized, and the collection and distribution efficiency and flexibility are improved.

WO2025077111A1PCT designated stage expired Publication Date: 2025-04-17WISDRI ENG & RES INC LTD

Patent Information

Application Number
PCT/CN2024/083482
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-10-11
Filing Date
2024-03-25
Publication Date
2025-04-17

AI Technical Summary

Technical Problem

The existing technology has complexity and inefficiency in industrial data collection and distribution, and the lack of a general collection and distribution platform has led to the need for repeated collection work on different business scenarios.

Method used

It provides a middleware for industrial data acquisition and distribution, including configuration module, acquisition module, communication message queue module, data storage and distribution module and data query interface. Users can configure acquisition plans and tasks through the configuration module. The middleware automatically performs data acquisition, storage and distribution. The business side only needs to query the required data through the data query interface.

Benefits of technology

It realizes a common platform for industrial data acquisition and distribution, reduces the work burden on the business side, improves the efficiency of data acquisition and distribution, supports a variety of data source types, and enhances the flexibility and convenience of collection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024083482_17042025_PF_FP_ABST
    Figure CN2024083482_17042025_PF_FP_ABST
Patent Text Reader

Abstract

A method and middleware for collection and distribution of industrial data, and a storage medium. The middleware comprises: a configuration module, a collection module, a communication message queue module, a data storage and distribution module, and a data query interface, wherein the configuration module is used for receiving a collection scheme and a collection task which are configured by a user; the collection module is used for receiving the collection scheme and the collection task issued by the configuration module, and collecting data; the communication message queue module is used for receiving and publishing the collected data; the data storage and distribution module is used for storing and / or distributing the collected data; and the data query interface is used for querying the stored data for required data in response to a data query instruction. The method for collection and distribution is applicable to various fields of industrial control. A general platform for industrial data is provided, and repeated work of a service end is avoided, thus making collection and distribution of the industrial data convenient, and improving the efficiency of collection and distribution of the industrial data; and a customized query for collected data can be conveniently made.
Need to check novelty before this filing date? Find Prior Art

Description

Industrial data collection and distribution method, middleware and storage medium Technical Field

[0001] The present invention relates to the technical field of industrial data collection, and in particular to a method, middleware and storage medium for industrial data collection and distribution. Background Art

[0002] In recent years, with the rapid advancement of computer, communication, and control technologies, the traditional industrial control sector has undergone a major transformation, moving towards integration, networking, and intelligence. Computer, digital, and communication technologies are driving the continuous advancement of the industrial control market. The centralization and intelligence of industrial control systems have placed higher demands on industrial data collection. Only by uniformly collecting and storing data from various devices and external systems can systems such as real-time data monitoring and industrial control be built on this foundation. Industrial data refers to data generated in various industrial manufacturing processes, including data collection, integration, analysis, processing, and service applications, within the context of intelligent manufacturing models. Currently, the processing of industrial data, such as industrial control data, remains complex. Numerous different business scenarios require separate business modules to perform various tasks, including collection and analysis. This process is cumbersome and inefficient, and there is no convenient, universal collection and distribution platform.

[0003] Summary of the Invention

[0004] To solve the above technical problems, the present invention provides a method, middleware and storage medium for collecting and distributing industrial data, so as to provide a universal platform for collecting and distributing industrial data.

[0005] In order to achieve the above-mentioned object, on the one hand, a middleware for industrial data collection and distribution is provided, comprising: a configuration module, a collection module, a communication message queue module, a data storage and distribution module and a data query interface;

[0006] The configuration module is configured to receive user-configured acquisition plans and acquisition tasks and issue them to the acquisition module. The acquisition task includes an acquisition address, a data source type, a data source address, and / or an acquisition period. The data source type includes OPC data. When the data source type is OPC data, the configuration items of the acquisition plan include message types. The message types include a periodic type, which periodically acquires data from a selected data point; a change type, which acquires data from the changed data point when the data of a selected data point changes; and a mixed event type, which selects one or more data points as trigger data points. When the information change of the trigger data point meets a predetermined trigger condition, data from one or more associated data points associated with the trigger data point is acquired, and the acquired information of the associated data points and the trigger point information are sent together.

[0007] The collection module includes one or more collectors, which are used to receive the collection plan and collection tasks issued by the configuration module, collect data according to the collection plan and collection tasks, and send the collected data to the communication message queue;

[0008] a communication message queue module, configured to receive the collected data sent by the collection module and publish the collected data in a communication message queue;

[0009] A data storage and distribution module, configured to obtain collected data from a communication message queue by subscribing to messages in the communication message queue, and store and / or distribute the collected data;

[0010] The data query interface is used to respond to data query instructions, query required data from the stored data and provide it.

[0011] Preferably, the middleware, data source type also includes: MQTT type and / or Socket type.

[0012] When the data source type is MQTT type, the configuration items of the collection solution include the parsing starting point and the message topic.

[0013] When the data source type is Socket type, the configuration items of the acquisition solution include a parsing starting point.

[0014] Preferably, the configuration items of the middleware collection solution further include one or more of the following:

[0015] Communication message subject, message body key, message body value, time, whether to forward, forwarding subject, whether the collected data is persisted, persistent table name, and data entry.

[0016] Preferably, the middleware further includes:

[0017] Redis cache, used to store the latest data of collected data points;

[0018] The time series library is used to store historical data of collected data points.

[0019] Preferably, the middleware further includes:

[0020] The distribution message queue is used to receive data distributed by the data storage and distribution module for subscription and / or use by the business module.

[0021] Preferably, the middleware and the data storage and distribution module use multi-threading technology to concurrently process messages and store data.

[0022] Preferably, the middleware, the collection module further comprises:

[0023] The collected data is packaged in a unified format.

[0024] Preferably, the middleware further includes one or more of the following:

[0025] The configuration module is a website based on B / S architecture, used to provide a configuration interface;

[0026] The communication message queue is the EMQX message server;

[0027] The time series database is the InfluxDB database.

[0028] In another aspect, a method for collecting and distributing industrial data is provided, which is applied to any of the above-mentioned middleware, comprising:

[0029] The configuration module receives the user-configured acquisition plan and acquisition task, and issues the acquisition plan and acquisition task to the acquisition module; the acquisition task includes the acquisition address, data source type, data source address and / or acquisition period; the data source type includes: OPC data; when the data source type is OPC data, the configuration items of the acquisition plan include message types; the message types include: periodic type, which periodically acquires data of selected data points; change type, which acquires data of the changed data points when the data of the selected data points changes; and mixed event type, which selects one or more data points as trigger data points, and when the information change of the trigger data point meets the predetermined trigger condition, acquires data of one or more associated data points associated with the trigger data point, and the acquired information of the associated data points and the trigger point information will be sent together;

[0030] Receive the collection plan and collection task issued by the configuration module through the collection module, collect data according to the collection plan and collection task, and send the collected data to the communication message queue;

[0031] Receive the collected data sent by the collection module through the communication message queue module and publish the collected data in the communication message queue;

[0032] Obtaining the collected data from the communication message queue by subscribing to messages from the communication message queue through the data storage and distribution module, and storing and / or distributing the collected data;

[0033] The data query interface receives data query instructions, queries the stored data and returns the queried data.

[0034] On the other hand, a computer-readable storage medium is provided, wherein the storage medium stores at least one program, and the at least one program is executed by a processor to implement the method described above.

[0035] The above technical solution has the following technical effects:

[0036] An embodiment of the present invention provides a middleware for industrial data collection and distribution. The middleware provides a general platform for realizing the collection and distribution of industrial data such as industrial control data. Users can use the configuration module of the middleware to configure corresponding collection plans and collection tasks. The business end queries and obtains the industrial data required by the corresponding business module through the data query interface without having to worry about the collection and parsing work within the middleware, thereby reducing the work of the business end. The business end no longer needs to do repeated collection work for different business scenarios, and only needs to configure and query. This provides convenience for the collection and distribution of industrial data and improves the efficiency of industrial data collection and distribution; it is convenient to perform customized queries on the collected data; in addition, for OPC data sources, the message types of the configurable collection plan include periodic type, change type and mixed event type. Different message types can be selected according to different business scenario requirements, which enhances the flexibility and convenience of collection and improves the efficiency of collection.

[0037] In a further embodiment, the data source also includes MQTT type and / or Socket type data, and corresponding configuration items are provided, so that the middleware can support data collection from multiple industrial data sources including OPC type, MQTT type and Socket type, thereby efficiently collecting various different industrial data. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] FIG1 is a schematic diagram of the structure of middleware for industrial data collection and distribution according to an embodiment of the present invention;

[0039] FIG2 is a schematic diagram of the configuration and use process of a configuration module in the middleware for industrial data collection and distribution according to an embodiment of the present invention;

[0040] 3 is a schematic diagram of the structure of a collector in the middleware for industrial data collection and distribution according to an embodiment of the present invention;

[0041] 4 is a schematic diagram of a flow chart of message processing by a data storage and distribution module in the industrial data collection and distribution middleware according to an embodiment of the present invention;

[0042] FIG5 is a schematic diagram of a multi-threaded execution flow of a data storage and distribution module in the middleware for industrial data collection and distribution according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] To further illustrate various embodiments, the present invention is provided with accompanying drawings. These drawings form part of the present disclosure and are primarily used to illustrate the embodiments and, in conjunction with the relevant description in the specification, to explain the operating principles of the embodiments. By referring to these drawings, one of ordinary skill in the art will understand other possible embodiments and the advantages of the present invention. The components in the figures are not drawn to scale, and similar reference numerals are generally used to represent similar components.

[0044] The present invention will now be further described with reference to the accompanying drawings and specific embodiments.

[0045] Example 1:

[0046] The middleware for industrial data collection and distribution according to an embodiment of the present invention comprises: a configuration module, a collection module, a communication message queue module, a data storage and distribution module, and a data query interface; wherein,

[0047] The configuration module is used to receive the collection plan and collection task configured by the user, and send the collection plan and collection task to the collection module; the collection task includes the collection address such as the address of the corresponding collector, the data source type, the data source address and / or the collection period; the data source type includes: OPC data; when the data source type is OPC data, the configuration items of the collection plan include the message type; the message type includes: periodic type, which periodically collects the data of the selected data point; change type, which collects the data of the changed data point when the data of the selected data point changes; and mixed event type, which selects one or more data points as trigger data points, and when the information change of the trigger data point meets the predetermined trigger condition, collects one associated with the trigger data point. or data of multiple associated data points, the collected information of the associated data points and the trigger point information will be sent together; the acquisition module, including one or more collectors, is used to receive the acquisition plan and acquisition tasks issued by the configuration module, and collect data according to the acquisition plan and acquisition tasks, and send the collected data to the communication message queue; the communication message queue module is used to receive the collected data sent by the acquisition module and publish the collected data in the communication message queue; the data storage and distribution module is used to obtain the collected data from the communication message queue by subscribing to the messages of the communication message queue, and store and / or distribute the collected data; the data query interface is used to respond to the data query instruction, query and provide corresponding data from the stored data.

[0048] Example 2:

[0049] Figure 1 is a schematic diagram of the structure of the middleware for industrial data collection and distribution according to this embodiment of the present invention. In addition to the modules described in the embodiment, the middleware according to this embodiment also includes: a message queue module for implementing a message queue, a Redis cache, and a time sequence library.

[0050] In this embodiment, the configuration module is a website system based on a B / S architecture, which is used to provide users with a visual operation interface. Users can configure information such as collection plans, collection tasks, collectors, etc. through this operation interface, and send the configuration information to the collection module. The collection module includes several collectors, which can be flexibly configured and deployed according to the business scale. They perform collection tasks according to the configuration information sent by the configuration module, and then publish the collected data to the communication message queue. The communication message queue is used to realize communication between the collection module and the data storage and distribution module. The distribution message queue is used to receive messages published by the data storage and distribution module, and then for consumption by external business modules. The Redis cache is used to store the latest data of the collected data points. The time series library is used to store the historical data of the collected data points. The data query interface is mainly used for business module queries, and in response to query instructions, reads the corresponding data from the Redis cache and / or time series library, and then returns it to the interface caller.

[0051] In one specific implementation, both the communication message queue and the distribution message queue use EMQX as the message server. EMQX is a large-scale, elastically scalable, cloud-native, distributed IoT MQTT message server. It is an excellent open source product that fully supports MQTT 5.0 and 3.x protocol standards, offering improved scalability, security, and reliability, as well as massive connections, high performance, low latency, and high availability.

[0052] The collection plan includes information such as the collection topic, parsing configuration, forwarding topic, persistence, and collection point entries. The collection task includes the collector address, data source type, data source address, and collection period. In this example, the data source types include MQTT, OPC, and Socket. The collection period is only effective for periodic collection plans. Collection tasks can be issued and revoked to control the execution of the collection module. The collector information corresponding to the collector includes the collection task bound to the collector, the collector's issuance address, and / or the address of the collection task's data source, such as the OPC address, Socket address, or MQTT broker address.

[0053] Figure 2 is a schematic diagram of the configuration and use process of the configuration module in this embodiment of the present invention. As shown in Figure 2, the configuration work of the configuration module includes:

[0054] S1: Configure the collection plan

[0055] Since different data source types have different data acquisition methods, the configuration items of the collection plan are divided into basic configuration items, that is, items that need to be configured for all data sources, and configuration items that are exclusive to specific data source types.

[0056] The basic configuration items include: communication message subject, message body key, value, time, whether to forward, forwarding subject, whether to persist, persistence table name, data entry, etc.

[0057] The descriptions of the above configuration items are as follows:

[0058] Communication message topic: refers to the topic sent to the communication message queue;

[0059] The key, value, and time of the message body refer to the data structure configuration of the message;

[0060] Whether to forward: Indicates whether the message needs to be distributed to the distribution message queue module;

[0061] Forwarding topic: indicates the topic distributed to the distribution message queue;

[0062] Persistence: Indicates whether the data needs to be saved to a time series database.

[0063] Persistent table name: the table name saved in the time series database;

[0064] Data Entry: A list containing detailed information for each collection point:

[0065] Parsing starting point: refers to the hierarchical path of the data body of the external message.

[0066] MQTT acquisition solution-specific configurations include: parsing starting point and communication message topic; Socket acquisition solution-specific configuration items include: parsing starting point; OPC acquisition solution-specific configuration items include: message type.

[0067] OPC acquisition solution-specific configuration items include: message type; message types include the following three categories:

[0068] Periodic type: refers to a collection scheme that only includes periodic collection points. Its collection process is to read the data of the collection points from the OPC server on a periodic basis.

[0069] Change type: refers to a collection plan that only includes subscribed collection points, i.e., collected data points. The collection process is to subscribe to collection points from the OPC Server, receive data information about the changed points when the subscribed collection points change, and then send the received data information to the communication message queue module;

[0070] A hybrid event includes both subscription points (collection points) and periodic points (data points collected periodically). When the value of a subscription point (trigger point) changes, the OPC server reads data from other collection points related to the subscription point, such as periodic points, configured within the solution. The data from the trigger point and periodic points are then combined into a single message and sent to the communication message queue module. In a specific implementation, there can be one or more trigger points; changes in the trigger point value include increases and / or decreases in the trigger point value. In one specific implementation, a trigger point is marked by setting an event or trigger flag on the subscription point that serves as the trigger point.

[0071] S2: Configure the collection task

[0072] Similar to step S1, the collection task is also divided into basic configuration items and proprietary configuration items.

[0073] The basic configuration items include: task name, bound collection plan;

[0074] Proprietary configuration items include:

[0075] MQTT collection task-specific configuration items: MQTT connection address;

[0076] Socket collection task-specific configuration items: Socket connection address;

[0077] OPC collection task-specific configuration items: OPC namespace, user name, password, collection address, and collection cycle.

[0078] The descriptions of the above configuration items are as follows:

[0079] Task name: refers to the name of the collection task;

[0080] Bound collection plan: refers to the collection plan selected for the collection task;

[0081] MQTT connection address: refers to the address of the MQTT message server;

[0082] Socket connection address: refers to the socket connection address;

[0083] OPC namespace: the namespace for OPC connections;

[0084] Username: OPC user name;

[0085] Password: OPC password;

[0086] Collection address: refers to the OPC connection address;

[0087] Collection cycle: refers to the collection cycle of a periodic collection task.

[0088] S3: Configure the collector

[0089] To configure a collector, you need to bind the collector to the collection task and then configure the collector address.

[0090] S4: Send to collector

[0091] Sending a command to the collector means sending a command to the collection module to control the execution of the collector. The control command includes the following three:

[0092] 1. Send: Send the new collector configuration information obtained through the configuration module to the collection module. This command will overwrite the collector configuration currently being executed by the collector, and the collector will collect data according to the newly issued collection task;

[0093] 2. Pause: The collector stops the currently executing collection task, but still retains the collection configuration information;

[0094] 3. Execution: The collector reads the sent collector configuration information and starts executing the collection task.

[0095] The collection module includes one or more collectors. The collector can encapsulate the collected data in a unified format, such as a JSON string.

[0096] The acquisition module has the following data acquisition solutions based on the data source type:

[0097] 1. When the data source is of MQTT type, the collection task sends a subscription request to the data source according to the topic in the collection plan and receives messages related to the subscription;

[0098] 2. When the data source is of OPC Server type, the collection task sends a data collection request to the data source through the OPC Ua protocol according to the message type configured in the collection plan to obtain data;

[0099] 3. When the data source is of Socket type, the collection task creates a Socket object based on the configured server IP address and port number to monitor the data source and collect data when there is new data.

[0100] S51: Call the API interface to query historical data

[0101] Calling the API interface means calling the pre-set data query interface to query the collected data. When querying the latest data of a data point, the data query interface will read the data in the Redis cache. When querying the historical data of a data point, the data query interface will read the data in the time series library.

[0102] S52: Subscribe to distributed messages

[0103] When forwarding messages are configured in the collection solution, you can subscribe to the MQTT messages forwarded by the collection solution in the distribution message queue.

[0104] Figure 3 is a schematic diagram of the collector structure in this embodiment. As shown in Figure 3, a one-to-many relationship is adopted between the collector and the collection task, and between the collection task and the collection plan. The same collection plan can be assigned to different collection tasks, and multiple different collection tasks can be assigned to a collector, realizing concurrent data collection.

[0105] In this example, after receiving the collected data from the collection module, the data storage and distribution module further processes the data according to the collection plan configuration. This module primarily includes two functions: data storage and data distribution. The data storage primarily consists of a Redis cache and a time series database. The Redis cache primarily stores the latest data collected by collection points, while the time series database primarily stores historical data collected by collection points, such as the InfluxDB database. The Redis database used by the Redis cache is an unstructured database with extremely high read and write performance. Due to the need for real-time data monitoring on the business side, the latest data from collection points must be frequently read. Based on the characteristics of Redis, this embodiment of the present invention uses Redis to cache the latest data points to improve database read and write efficiency. Data distribution allows the collected data to be published to the distribution message queue module for subscription and use by business modules. InfluxDB is an open-source, distributed time series, event, and metric database written in Go and requiring no external dependencies. It is suitable for storing timestamped data such as device performance, logs, and IoT sensor data, and supports time-related functions such as maximum, minimum, and sum calculations.

[0106] Figure 4 is a message processing flow chart of the data storage and distribution module in this embodiment. Figure 4 shows the completion processing flow of a message. Among them, when the data storage and distribution module receives a message from the communication message queue, it starts the message processing process. First, it reads the collection plan configuration according to the collection plan ID contained in the message. If there is no collection plan configuration, it prints the log and ends the process; otherwise, it parses the message data according to the collection plan configuration, and then performs type verification on the data. If the data fails the type verification, it prints the log and exits the processing flow; if it passes the data verification, it first writes the data into the Redis cache as the latest data of the data point, and then performs the operation of whether to persist the time series library and forward it to the distribution message queue according to the collection plan configuration, and finally ends the process. The type check mainly checks the data type. InfluxDB supports the following data types: integer, floating point, Boolean, and string. Due to the diversity of data sources, the data types between different systems are also different. When configuring the data points of the collection plan, you need to configure the data type of each data point. This is equivalent to converting the external data type to the InfluxDB data type. For example, the unsigned integer, short integer, and long integer in OPC all correspond to the integer in InfluxDB. In this way, data can be checked according to the declared type to prevent incorrect data from being stored.

[0107] Figure 5 is a multi-threaded execution flow chart of the data storage and distribution module in this embodiment. Since data acquisition systems often suffer from data persistence—commonly known as "fast acquisition, slow storage"—to address this contradiction, the data storage and distribution module utilizes multi-threaded programming techniques in Java. This multi-threading technology allows for concurrent message processing and data storage. Parameters such as the number of core threads, work queues, and the maximum number of threads can be used to manage the execution of the thread pool, effectively improving the data processing capabilities of the data storage and distribution module and resolving the problem of collected data being accumulated in the communication message queue.

[0108] As shown in Figure 5, when using multi-threading technology, after the data storage and distribution module obtains the task, it first determines whether the core thread pool is full; if not, it creates a core thread to execute the task; if full, it continues to determine whether the work queue is full. If not, it puts the task into the work queue and waits for the thread to be idle to execute the task. If full, it continues to determine whether the maximum number of threads has been reached; if not, it creates a temporary thread to execute the task. If it has reached the maximum number of threads, it executes the rejection multi-threading strategy.

[0109] Multithreading technology in Java has the following characteristics and advantages:

[0110] 1. Reduce resource consumption: Reuse created threads through pooling technology to reduce the loss caused by thread creation and destruction;

[0111] 2. Improve response speed: When a task arrives, it can be executed immediately without waiting for thread creation;

[0112] 3. Improve thread manageability: Threads are a scarce resource. If created without limit, they will not only consume system resources, but also lead to imbalanced resource scheduling due to unreasonable thread distribution, reducing system stability. Using a thread pool allows for unified allocation, tuning, and monitoring.

[0113] 4. Avoid over-scheduling: The number of threads is limited, which avoids excessive thread creation and destruction and reduces scheduling overhead;

[0114] 5. Improve system stability: Reduce system failures caused by thread problems through unified thread management.

[0115] The distribution message queue is used to receive messages published by the data storage and distribution modules. It then distributes different business data to various topics based on the "forwarding topics" in the collection plan for subscription by external business modules. The distribution message queue can be implemented using the EMQX message server.

[0116] The data query interface provides multiple pre-set data query interfaces and multiple data definition query interfaces. After receiving a query instruction from the data query interface, data can be read from the Redis database and time series database and returned to the external business interface caller. The data query interface is used to query the data collected by the system; the data definition query interface is used to query the data points and data point structure information in the configured collection plan. When querying the latest data of a collection point, the data query module reads the data from the Redis database; when querying historical data of a collection point, the data query module reads the data from the time series database. In one specific implementation, the query interface uses a RESTful interface.

[0117] The RESTful interface is a web service architectural style that uses widely popular standards and protocols such as HTTP, URLs, XML, JSON, and HTML. It employs a lightweight, cross-platform, and cross-language architecture and adheres to a series of principles. For example, each URI represents a resource, and clients use verbs such as GET, POST, PUT, and DELETE to manipulate server-side resources. These verbs are used to retrieve, create, update, and delete resources, respectively. RESTful interfaces also manipulate resources by manipulating their representations, often using XML or HTML.

[0118] Example 3:

[0119] This embodiment further provides a method for collecting and distributing industrial data, which is applied to the above-mentioned middleware and includes the following steps:

[0120] The configuration module receives the user-configured acquisition plan and acquisition task and sends the acquisition plan and acquisition task to the acquisition module; the acquisition task includes the acquisition address, data source type, data source address and / or acquisition period; the data source type includes: OPC data; when the data source type is OPC data, the configuration items of the acquisition plan include message type; the message types include: periodic type, which periodically acquires data of the selected data point; change type, which acquires data of the changed data point when the data of the selected data point changes; and mixed event type, which selects one or more data points as trigger data points. When the information change of the trigger data point meets the predetermined trigger condition, the data of one or more associated data points associated with the trigger data point is acquired, and the acquired information of the associated data point and the trigger point information will be sent together;

[0121] Receive the collection plan and collection task issued by the configuration module through the collection module, collect data according to the collection plan and collection task, and send the collected data to the communication message queue;

[0122] Receive the collected data sent by the collection module through the communication message queue module and publish the collected data in the communication message queue;

[0123] Obtaining collected data from the communication message queue by subscribing to messages of the communication message queue through the data storage and distribution module, and storing and / or distributing the collected data;

[0124] The data query interface receives a data query instruction, queries the stored data and returns the searched data.

[0125] Example 4:

[0126] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method embodiment of the present invention are implemented.

[0127] If the modules included in the middleware or computer program are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM) and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.

[0128] Although the present invention has been particularly shown and described in conjunction with preferred embodiments, it will be understood by those skilled in the art that various changes in form and details may be made to the present invention without departing from the spirit and scope of the invention as defined in the appended claims, and all such changes are within the scope of protection of the present invention.

Claims

1. A middleware for industrial data collection and distribution, characterized in that: include: Configuration module, acquisition module, communication message queue module, data storage and distribution module and data query interface; The configuration module is used to receive the collection plan and collection task configured by the user, and send the collection plan and collection task to the collection module; The collection task includes a collection address, a data source type, a data source address and / or a collection period; The data source type includes: OPC data; when the data source type is OPC data, the configuration items of the acquisition scheme include message types; the message types include: periodic type, periodically acquiring data of selected data points; change type, when the data of the selected data point changes, acquiring the data of the changed data point; and mixed event type, selecting one or more data points as trigger data points, when the information change of the trigger data point meets the predetermined trigger condition, acquiring data of one or more associated data points associated with the trigger data point, and the acquired information of the associated data points and the information of the trigger point will be sent together; The acquisition module includes one or more collectors, which are used to receive the acquisition plan and acquisition task issued by the configuration module, collect data according to the acquisition plan and acquisition task, and send the collected data to the communication message queue; The communication message queue module is used to receive the collected data sent by the collection module and publish the collected data in the communication message queue; The data storage and distribution module is used to obtain the collected data from the communication message queue by subscribing to the messages of the communication message queue, and store and / or distribute the collected data; The data query interface is used to respond to data query instructions, query and return the queried data from the stored data.

2. The middleware according to claim 1, characterized in that: The data source type also includes: MQTT type and / or Socket type; When the data source type is MQTT type, the configuration items of the collection scheme include the parsing starting point and the message subject, and the collection task also includes the connection address of MQTT; When the data source type is a Socket type, the configuration items of the acquisition solution include a parsing starting point, and the acquisition task also includes a Socket connection address.

3. The middleware according to claim 1, characterized in that: The configuration items of the acquisition scheme also include one or more of the following: Communication message subject, message body key, message body value, time, whether to forward, forwarding subject, whether the collected data is persistent, persistent table name, and data entry.

4. The middleware according to claim 1, characterized in that: Also includes: Redis cache, used to store the latest data of collected data points; The time series library is used to store the historical data of the collected data points.

5. The middleware according to claim 1, characterized in that: Also includes: The distribution message queue is used to receive data distributed by the data storage and distribution module for subscription and / or use by the business module.

6. The middleware according to claim 1, characterized in that: The data storage and distribution module uses multi-threading technology to concurrently process messages and store data.

7. The middleware according to claim 1, characterized in that: The acquisition module further includes, before sending the collected data to the communication message queue: The format of the collected data is uniformly packaged.

8. The middleware according to claim 1, characterized in that: Also includes one or more of the following: The configuration module is a website based on B / S architecture, used to provide a configuration interface; The communication message queue is an EMQX message server; The time series database is the InfluxDB database.

9. A method for industrial data collection and distribution, applied to the middleware according to any one of claims 1 to 8, comprising: The configuration module receives the collection scheme and collection task configured by the user, and sends the collection scheme and collection task to the collection module; The collection task includes a collection address, a data source type, a data source address and / or a collection period; The data source type includes: OPC data; when the data source type is OPC data, the configuration items of the acquisition scheme include message types; the message types include: periodic type, periodically acquiring data of selected data points; change type, when the data of the selected data point changes, acquiring the data of the changed data point; and mixed event type, selecting one or more data points as trigger data points, when the information change of the trigger data point meets the predetermined trigger condition When a trigger event occurs, data of one or more associated data points associated with the trigger data point are collected, and the collected information of the associated data points and the information of the trigger point are sent together; Receiving the collection scheme and collection task issued by the configuration module through the collection module, collecting data according to the collection scheme and collection task, and sending the collected data to the communication message queue; Receiving the collected data sent by the collection module through the communication message queue module and publishing the collected data in the communication message queue; Obtaining the collected data from the communication message queue by subscribing to messages of the communication message queue through the data storage and distribution module, and storing and / or distributing the collected data; The data query interface receives a data query instruction, queries the stored data and returns the searched data.

10. A computer-readable storage medium, characterized in that: The storage medium stores at least one program, and the at least one program is implemented by a processor to implement the method for industrial data collection and distribution as claimed in claim 9.

Citation Information

Patent Citations

  • Data automatic acquisition intermediate member for aiming at PLC and use method thereof

    CN106483860A

  • Data collection and analysis platform capable of online configuring

    CN108009258A

  • Method and system for collecting definable events and states of equipment in real time based on message flow

    CN114546686A

  • Industrial data acquisition and distribution method, middleware and storage medium

    CN117348545A

  • Method, device and system for establishing connectivity between industrial environment and computing platform

    EP3917114A1

Cited By

  • Time sequence data acquisition method and device based on dynamic time window and fingerprint deduplication

    CN120804180A