Real-time data acquisition method and device based on OpcUA and medium

By using super tables and subtables of time series databases in OpcUA's subscription and publishing mechanism, we optimize the collection and transmission of industrial equipment data, solving the problems of data surge and system complexity, and achieving efficient data acquisition and in different environments transmission.

CN119031276AActive Publication Date: 2024-11-26CHINA UNITED NETWORK COMM GRP CO LTD +1
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411132015.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-11-26
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

When the prior art collects and transmits data from industrial equipment in real time, there is a problem of a surge in data volume, and the system architecture is complex, so it cannot adapt to bare metal, private cloud and edge cloud environments, and the optimization technology of timing real-time data is not fully utilized.

Method used

Adopt the subscription and publishing mechanism based on OpcUA, by generating super tables and subtables of the timing database, data stream transmission is optimized based on the number, type and attribute information of device tags, and adjusted in the software architecture to reduce the transmission of associated data information.

Benefits of technology

It realizes efficient data acquisition and warehousing of multiple acquisition nodes under a network architecture without TSN switches, simplifies the system architecture, suitable for bare metal, private cloud and edge cloud environments, and maintains high write and associated query Under the premise of performance, the amount of data transmission is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119031276A_ABST
    Figure CN119031276A_ABST
Patent Text Reader

Abstract

The invention provides an OpcUA-based real-time data acquisition method and device and a medium, and specifically, the method comprises the following steps: generating list list information of an OpcUA Server according to preset OpcUA Server information; establishing OpcUA communication connection with an OpcUA acquisition node according to the list information, and acquiring equipment label information from the OpcUA acquisition node; creating a super table and a sub table of a time sequence database according to the equipment label information; classifying and grouping equipment labels according to the equipment label information, and issuing a data acquisition task to an OpcUA acquisition node by taking a group as a unit; and after real-time data sent by the OpcUA acquisition node is received, storing the real-time data to the super table and the sub-table of the time sequence database. According to the invention, large data volume real-time acquisition and transmission can be uniformly and efficiently realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a real-time data acquisition method, device and medium based on OpcUA. Background Art

[0002] With the continuous development of industrial information technology, more and more companies are turning to digital smart factories. However, in actual production, various devices use different protocols, and the interconnection of these devices involves heterogeneous networks, multi-generation device integration, and data fusion issues. Therefore, the OPC Foundation launched the OpcUA (Open Platform Communications Unified Architecture) communication specification.

[0003] As a vendor-independent, open, and standard technology, the OpcUA specification provides a good solution to the heterogeneous problems and information island problems between software and hardware. It enables devices with different protocols to uniformly convert data formats into the OpcUA data format for communication, and transmit device data to the subscriber in real time through the subscription and publishing mechanism of the OpcUA specification.

[0004] However, the real-time collection of data from underlying equipment sensors to production, process, energy consumption, etc. will lead to a surge in the amount of data collected and transmitted. Therefore, how to uniformly and efficiently collect and transmit large amounts of data in real time has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] The technical problem to be solved by the present application is to provide a real-time data collection method, device and medium based on OpcUA to solve the problems existing in the prior art in view of the above-mentioned deficiencies in the prior art.

[0006] In a first aspect, the present application provides a real-time data collection method based on OpcUA, applied to a server OpcUAServer, the method comprising:

[0007] S1. Generate OpcUA Server list information according to the preset OpcUA Server information;

[0008] S2. Establishing an OpcUA communication connection with an OpcUA collection node according to the list information, and obtaining device tag information from the OpcUA collection node;

[0009] S3. Create a super table and a sub-table of a time series database according to the device tag information;

[0010] S4. Classify and group the device tags according to the device tag information, and send data collection tasks to the OpcUA collection node in groups;

[0011] S5. After receiving the real-time data sent by the OpcUA collection node, the real-time data is saved to the super table and sub-table of the time series database.

[0012] In some embodiments, at least one of the following is included:

[0013] The list information includes at least one of a URL address, a user name, a password, an SSL certificate, a request timeout, a service name, and a publishing cycle;

[0014] The device tag information includes at least one of a tag name, a tag comment, a tag group, a namespace, a NodeID, a NodePath, a collection point data type, a collection point data address, and a collection point scanning rate.

[0015] In some embodiments, S3 includes:

[0016] S31, traversing the data types of the collection points, marking the value types that need to be converted, the data types of the collection points include at least one of integer, Boolean, floating point, and string;

[0017] S32, creating a corresponding super table for each value type;

[0018] S33. Create a corresponding sub-table for each device tag according to the converted numerical type corresponding to the device tag and the super-table of the corresponding numerical type.

[0019] In some embodiments, in S33, a corresponding sub-table is created for each device tag, including:

[0020] Determine whether the number of device tags is greater than a preset threshold;

[0021] If yes, a thread pool is created and the sub-tables are created in parallel in a multi-threaded environment;

[0022] If not, the subtables are created serially in a single-threaded environment.

[0023] In some embodiments, at least one of the following is included:

[0024] The table name of the super table is the corresponding numeric type,

[0025] The field columns of the super table include a timestamp and a corresponding value type;

[0026] The label column of the super table includes device label name, label comment, label group, collection point data address, NodeID, and NodePath;

[0027] The surface of the subtable is a combination of tag groups and tag names;

[0028] The sub-table inherits the label column from the super-table as the corresponding attribute value of the device label.

[0029] In some embodiments, in S4, classifying and grouping device tags according to the device tag information includes:

[0030] S41, determining the transmission weight of each data flow corresponding to each device tag according to the device tag information;

[0031] S42, determining a total transmission weight corresponding to each device tag according to the transmission weights of each data flow corresponding to each device tag;

[0032] S43: Classify and group the device tags according to the total transmission weight corresponding to each device tag.

[0033] In some embodiments, in S41, the data flow transmission weight of each device tag is calculated according to the following formula:

[0034] QZ=CON×FAC÷RATE

[0035] Among them, QZ is the transmission weight of the data stream, CON is a constant, FAC is a numerical type coefficient, and RATE is the acquisition point scanning rate.

[0036] In some embodiments, S43 includes:

[0037] S43a, sorting the M device tags in descending order of total transmission weight to obtain a set of data sets in descending order, where M is an integer greater than or equal to 1;

[0038] S43b, dividing the first N device tags in the data set into N groups in sequence, wherein each group contains one device tag, N is an integer greater than or equal to 1, and M is greater than or equal to N;

[0039] S43c, summing the transmission weights of the N+i-th device tag in the data set and the existing device tags in N groups in sequence, determining a target group with the smallest sum, and dividing the N+i-th device tag into the target group, where i is an integer greater than or equal to 1;

[0040] S43d, increase the value of i by one, and return to the step of summing the transmission weights of the N+i-th device tag in the data set with the existing device tags in the N groups in sequence, until all device tags are grouped.

[0041] In some embodiments, S5 includes:

[0042] After receiving the real-time data sent by the OpcUA collection node, the real-time data is cached to the corresponding classification group according to the device tag and classification group information;

[0043] When the amount of data in the classified group buffer reaches a preset threshold, the real-time data is written into the super table and sub-table of the time series database.

[0044] In a second aspect, the present application provides a real-time data collection device based on OpcUA, applied to a server OpcUAServer, the device comprising:

[0045] A list generation module, configured to generate list information of OpcUAServer according to preset OpcUA Server information;

[0046] A device tag acquisition module, configured to establish an OpcUA communication connection with an OpcUA acquisition node according to the list information, and acquire device tag information from the OpcUA acquisition node;

[0047] A database establishment module, which is configured to create a super table and a sub-table of a time series database according to the device tag information;

[0048] A classification and grouping module, which is configured to classify and group device tags according to the device tag information, and send data collection tasks to the OpcUA collection node in groups;

[0049] The data saving module is configured to save the real-time data to the super table and sub-table of the time series database after receiving the real-time data sent by the OpcUA acquisition node.

[0050] In a third aspect, the present application provides a real-time data collection device based on OpcUA, 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 real-time data collection method based on OpcUA described in the first aspect above.

[0051] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the real-time data collection method based on OpcUA described in the first aspect above is implemented.

[0052] The real-time data collection method, device and readable storage medium based on OpcUA provided by the present application are specifically, according to the preset OpcUA Server information, generate the list information of OpcUA Server; according to the list information, establish OpcUA communication connection with OpcUA collection node, and obtain the device tag information from OpcUA collection node; create super table and sub table of time series database according to the device tag information; classify and group device tags according to the device tag information, and send data collection tasks to OpcUA collection node in groups; after receiving the real-time data sent by OpcUA collection node, save the real-time data to the super table and sub table of time series database. The present application provides an efficient real-time data collection method based on OpcUA subscription and publishing mechanism, firstly, according to the number, type, attribute and other information of device tags of collection points, balance and optimize the transmission of subscribed and published real-time data streams, secondly, with the help of the data aggregation mechanism of super table and sub table of time series database, under the premise of maintaining high writing and associated query performance, greatly reduce the transmission of associated data information, and finally, optimize and adjust the software architecture, it can realize the real-time collection and transmission of large amounts of data in a unified and efficient manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0054] Figure 1 This is the architecture diagram of the OpcUA data collection and transmission system in the prior art;

[0055] Figure 2 The OpcUA data collection and transmission system architecture diagram provided in the embodiment of the present application;

[0056] Figure 3 A flowchart of a real-time data collection method based on OpcUA provided in an embodiment of the present application;

[0057] Figure 4 A schematic diagram of creating a super table and sub-table of a time series database provided in an embodiment of the present application;

[0058] Figure 5 A schematic diagram of the structure of a real-time data acquisition device based on OpcUA provided in an embodiment of the present application;

[0059] Figure 6 A schematic diagram of the structure of another real-time data acquisition device based on OpcUA provided in an embodiment of the present application.

[0060] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0061] In order to enable those skilled in the art to better understand the technical solution of the present application, the implementation mode of the present application will be further described in detail below with reference to the accompanying drawings.

[0062] It should be understood that the specific embodiments and drawings described herein are only used to explain the present application, rather than to limit the present application.

[0063] It can be understood that, in the absence of conflict, the various embodiments in the present application and the various features in the embodiments can be combined with each other.

[0064] It can be understood that, for the convenience of description, the drawings of the present application only show the parts related to the present application, while the parts unrelated to the present application are not shown in the drawings.

[0065] It can be understood that each unit and module involved in the embodiments of the present application may correspond to only one physical structure, or may be composed of multiple physical structures, or multiple units and modules may be integrated into one physical structure.

[0066] It can be understood that the terms "first", "second", etc. in the embodiments of the present application are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.

[0067] It is understandable that, in the absence of conflict, the functions and steps marked in the flowcharts and block diagrams of the present application may occur in an order different from that marked in the drawings.

[0068] It is understood that the flowcharts and block diagrams of the present application illustrate the possible architectures, functions, and operations of the systems, devices, equipment, and methods according to the various embodiments of the present application. Among them, each box in the flowchart or block diagram may represent a unit, module, program segment, code, which contains executable instructions for implementing the specified functions. Moreover, each box or combination of boxes in the block diagram and flowchart may be implemented by a hardware-based system that implements the specified functions, or by a combination of hardware and computer instructions.

[0069] It can be understood that the units and modules involved in the embodiments of the present application can be implemented by software or hardware, for example, the units and modules can be located in a processor.

[0070] Figure 1This is the architecture diagram of the OpcUA data collection and transmission system in the prior art, such as Figure 1 As shown in the figure, the data collection network consists of 0PCUA collection nodes, TSN switches and network management servers, where:

[0071] (1) OPCUA collection node, determines the real-time requirements of different data at different nodes through OPCUA tag data;

[0072] (2) Each port of the TSN switch uses queues of different priorities to control the data passing through the port to achieve data flow control;

[0073] (3) The network management server reads each tag in the OPCUA to obtain the size of the data volume of different nodes and the real-time requirements of different data, and designs corresponding optimization methods to meet the real-time requirements of the data flow of each node, avoiding the situation where real-time requirements cannot be met due to data congestion, while also ensuring the network bandwidth.

[0074] At present, the basic principle of data collection and transmission based on the OpcUA specification is: first determine the number, type, and real-time requirements of the OpcUA tags (collection points) in a single node, so as to determine the data volume of a single node and the requirements of each node in the data collection system for communication bandwidth occupancy, optimize the data flow through the network management server, and finally control the data flow through the TSN switch. In summary, the existing technology optimizes the data flow through the network management server and TSN switch based on the number, type, and attribute information of the device tags in the OpcUA Server, thereby effectively improving the real-time performance of the data flow in the data collection system.

[0075] However, the prior art has the following disadvantages:

[0076] First, data flow control is required with the help of network management servers and TSN switches. The system architecture is relatively complex and cannot form a unified solution that can be applied to bare metal, private cloud, edge cloud and other environments.

[0077] Second, with the improvement of cloud network technology and performance, communication bandwidth is no longer the main bottleneck, and innovative technologies such as compression, transmission, and storage of time-series real-time data have not been fully utilized to further optimize resource usage.

[0078] Based on the above-mentioned shortcomings of the prior art, the present application provides an efficient real-time data collection method and system based on the OpcUA subscription and publishing mechanism, which can realize the data collection and warehousing of multiple collection nodes by the server in a network architecture without the need for a TSN switch.

[0079] The main concepts of the present invention are:

[0080] The present application provides an efficient real-time data collection method and system based on the OpcUA subscription and publishing mechanism. Firstly, according to the number, type, attributes and other information of the equipment tags of the collection points, the real-time data stream transmission of subscription and publication is balanced and optimized. Secondly, with the help of the data aggregation mechanism of the super table and subtable of the time series database, the transmission of related data information is greatly reduced while maintaining high writing and related query performance. Finally, by optimizing and adjusting the software architecture, the real-time collection and transmission of large amounts of data can be realized in a unified and efficient manner.

[0081] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0082] The present application provides a real-time data acquisition method based on OPC UA. The working process of the method can be implemented by electronic devices, such as computers, handheld smart terminals, etc. For the convenience of explanation, the embodiments of the present application are described with the method execution subject as a computer.

[0083] Figure 2 The OpcUA data collection and transmission system architecture diagram provided in the embodiment of the present application is as follows: Figure 2 As shown, the data collection network consists of 0PCUA collection nodes and a network management server OpcUA Server. Compared with the existing method, this application does not need to set up a TSN switch, which greatly simplifies the system architecture and enables the technical solution to be applied to special environments such as bare metal, private cloud, and edge cloud.

[0084] Figure 3 A schematic diagram of a real-time data acquisition method based on OPC UA provided in an embodiment of the present application, such as Figure 3 As shown, the present application provides a real-time data collection method based on OpcUA, which is applied to a server OpcUA Server. The method includes S1-S5, which are as follows:

[0085] S1. Generate OpcUA Server list information according to the preset OpcUA Server information;

[0086] Specifically, the user may set the information of the OpcUA Server to be connected in the OpcUA Server, so that the OpcUA Server can generate the OpcUA Server list information.

[0087] Optionally, the list information includes at least one of a URL address, a user name, a password, an SSL certificate, a request timeout, a service name, and a publishing cycle;

[0088] S2. Establishing an OpcUA communication connection with an OpcUA collection node according to the list information, and obtaining device tag information from the OpcUA collection node;

[0089] Specifically, the OpcUA Server establishes connections with each OpcUA collection node in sequence according to the list information and based on the OpcUA communication protocol, and obtains all device tag information in the OpcUA collection node.

[0090] Optionally, the device tag information includes at least one of a tag name, a tag comment, a tag group, a namespace, a NodeID, a NodePath, a collection point data type, a collection point data address, and a collection point scanning rate.

[0091] S3. Create a super table and a sub-table of a time series database according to the device tag information;

[0092] Specifically, OpcUA Server creates a super table and sub table of the time series database according to the full device tag information, wherein the super table and sub table are data aggregation mechanisms for the same type of collection points provided by the time series database, which can greatly reduce the amount of data transmission and improve data insertion and query performance.

[0093] Figure 4 A schematic diagram of creating a super table and sub-table of a time series database provided in an embodiment of the present application, such as Figure 4 As shown, in some embodiments, S3 includes:

[0094] S31, traversing the data types of the collection points, marking the value types that need to be converted, the data types of the collection points include at least one of integer, Boolean, floating point, and string;

[0095] S32, creating a corresponding super table for each value type;

[0096] Optionally, the table name of the super table is a corresponding numerical type, the field column of the super table includes a timestamp and a corresponding numerical type; the label column of the super table includes a device label name, a label comment, a label group, a collection point data address, NodeID, and NodePath;

[0097] S33. Create a corresponding sub-table for each device tag according to the converted numerical type corresponding to the device tag and the super-table of the corresponding numerical type.

[0098] Optionally, the surface of the sub-table is a combination of tag grouping and tag name; the tag column inherited by the sub-table from the super-table is the corresponding attribute value of the device tag.

[0099] Specifically, a sub-table is created for each device tag based on the corresponding converted numerical type of the device tag and the super-table of the corresponding numerical type, wherein the combination of the tag group and the tag name is used as the sub-table name, and the tag column inherited from the super-table by the sub-table is designated as the corresponding attribute value of the device tag. After that, only the tag group, tag name, timestamp and tag numerical information are required to complete the real-time data storage in the database, thereby greatly reducing the data transmission and the data traffic of database writing.

[0100] In some embodiments, in S33, a corresponding sub-table is created for each device tag, including: determining whether the number of device tags is greater than a preset threshold; if so, creating a thread pool and creating sub-tables in parallel in a multi-threaded environment; if not, creating sub-tables serially in a single-threaded environment.

[0101] Specifically, if the number of device tags is large, for example, hundreds of thousands, hundreds of thousands of sub-tables need to be created, which takes a long time. A thread pool can be created to execute the steps of creating sub-tables in parallel.

[0102] S4. Classify and group the device tags according to the device tag information, and send data collection tasks to the OpcUA collection node in groups;

[0103] Specifically, OpcUA Server adopts a grouping strategy to classify and group device tags according to the full device tag information. The grouping strategy mainly uses tag grouping, collection point data type, and collection point scanning rate as parameters to balance the real-time data stream transmission pressure of each group.

[0104] In some embodiments, in S4, classifying and grouping device tags according to the device tag information includes:

[0105] S41, determining the transmission weight of each data flow corresponding to each device tag according to the device tag information;

[0106] In some embodiments, in S41, the data flow transmission weight of each device tag is calculated according to the following formula:

[0107] QZ=CON×FAC÷RATE

[0108] Among them, QZ is the transmission weight of the data stream, CON is a constant, and the possible value is 1000 milliseconds; FAC is a numerical type coefficient, and the specific possible values ​​are: 1.12 for Boolean numerical type, 1.16 for integer numerical type, 1.2 for floating point numerical type, and 1.3 for string numerical type; RATE is the acquisition point scanning rate, in milliseconds.

[0109] S42, determining a total transmission weight corresponding to each device tag according to the transmission weights of each data flow corresponding to each device tag;

[0110] S43: Classify and group the device tags according to the total transmission weight corresponding to each device tag.

[0111] In some embodiments, S43 includes:

[0112] S43a, sorting the M device tags in descending order of total transmission weight to obtain a set of data sets in descending order, where M is an integer greater than or equal to 1;

[0113] S43b, dividing the first N device tags in the data set into N groups in sequence, wherein each group contains one device tag, N is an integer greater than or equal to 1, and M is greater than or equal to N;

[0114] S43c, summing the transmission weights of the N+i-th device tag in the data set and the existing device tags in N groups in sequence, determining a target group with the smallest sum, and dividing the N+i-th device tag into the target group, where i is an integer greater than or equal to 1;

[0115] S43d, increase the value of i by one, and return to the step of summing the transmission weights of the N+i-th device tag in the data set with the existing device tags in the N groups in sequence, until all device tags are grouped.

[0116] Specifically, firstly, the M device labels to be processed are sorted, and a sorted data set is generated in descending order of the total transmission weight, which is recorded as [D1, D2, ..., DM], where D1 is the maximum data and DM is the minimum data.

[0117] Then, the sorted data set D is divided into N groups according to the following rules:

[0118] (1) Set N groups, denoted as [G1, G2, ..., GN], where N is the step-wise empirical value of the total number of device tags. For example, the total number of device tags is 5 in the interval (0, 1000], 10 in the interval (1000, 10000], and so on;

[0119] The largest element D1 in the data set is divided into group G1, the second largest element D2 is divided into group G2, and so on, until the Nth largest element DN is divided into group GN.

[0120] (2) For subsequent data, grouping starts from the N+1th largest data DA (A=N+1):

[0121] For each existing group Gi (i=1, 2, ..., N), calculate the sum of DA and all elements in Gi to obtain the sum Sij, where Sij is the sum of the i-th group.

[0122] Determine the group with the smallest sum, i.e., min(S1A, S2A, ..., SNA), and then divide the data DA into the group with the smallest sum Sij.

[0123] Repeat the above steps until all M data are divided into corresponding groups.

[0124] S5. After receiving the real-time data sent by the OpcUA collection node, the real-time data is saved to the super table and sub-table of the time series database.

[0125] In some embodiments, S5 includes: after receiving the real-time data sent by the OpcUA acquisition node, caching the real-time data to the corresponding classification group according to the device tag and classification group information; when the amount of data cached by the classification group reaches a preset threshold, writing the real-time data into the super table and sub-table of the time series database.

[0126] Specifically, in the parallel task, the OpcUA Server establishes a connection with the associated OpcUA collection node according to the OpcUA Server list information, so that each parallel task establishes an independent subscription and publishing communication channel with the OpcUA collection node; the OpcUA Server subscribes to the data of the device tag under the group from the OpcUA collection node, and waits for the OpcUA collection node to asynchronously transmit the data; the OpcUA collection node periodically sends the data of the device tag to the subscriber OpcUA Server according to the publishing cycle, and the data of the device tag includes NodeID, NodePath, timestamp and tag value. The OpcUA Server can associate the device tag and its classification group information through NodeID and NodePath, and cache the real-time data under the classification group until the cache reaches the set threshold to stimulate the batch writing of data into the super table and subtable of the time series database.

[0127] The present application provides an efficient real-time data collection method based on the OpcUA subscription and publishing mechanism. First, according to the number, type, attributes and other information of the equipment tags of the collection points, the real-time data stream transmission of subscription and publication is balanced and optimized. Secondly, with the help of the data aggregation mechanism of the super table and subtable of the time series database, the transmission of related data information is greatly reduced while maintaining high writing and related query performance. Finally, by optimizing and adjusting the software architecture, the real-time collection and transmission of large amounts of data can be realized in a unified and efficient manner.

[0128] It should be understood that, although the various steps in the flowcharts in the above-described embodiments are sequentially displayed according to the indications of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and they can be executed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily to be carried out sequentially, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0129] Figure 5 A schematic diagram of a real-time data acquisition device based on OPC UA provided in an embodiment of the present application, such as Figure 5 As shown, the present application provides 10. a real-time data acquisition device based on OpcUA, applied to a server OpcUA Server, the device comprising:

[0130] A list generation module 11, which is configured to generate OpcUAServer list information according to preset OpcUA Server information;

[0131] A device tag acquisition module 12, which is configured to establish an OpcUA communication connection with an OpcUA acquisition node according to the list information, and acquire device tag information from the OpcUA acquisition node;

[0132] A database establishment module 13, which is configured to create a super table and a sub-table of a time series database according to the device tag information;

[0133] A classification and grouping module 14, which is configured to classify and group device tags according to the device tag information, and send data collection tasks to the OpcUA collection node in groups;

[0134] The data storage module 15 is configured to store the real-time data in the super table and sub-table of the time series database after receiving the real-time data sent by the OpcUA collection node.

[0135] Regarding the limitation of the real-time data acquisition device based on OPCUA, please refer to the limitation of the real-time data acquisition method based on OPCUA in the above embodiments of the present application, and this embodiment will not be repeated here.

[0136] Figure 6 Another schematic diagram of a real-time data acquisition device based on OPCUA provided in an embodiment of the present application is as follows: Figure 6 As shown, in some embodiments, the present application provides a real-time data acquisition device based on OPCUA, including a memory 22 and a processor 21, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the real-time data acquisition method based on OPCUA in the above-mentioned embodiments of the present application.

[0137] The memory is connected to the processor, the memory may be a flash memory or a read-only memory or other memory, and the processor may be a central processing unit or a single-chip microcomputer.

[0138] In some embodiments, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the real-time data collection method based on OpcUA in the above-mentioned embodiments of the present application is implemented.

[0139] The computer-readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are 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 disk (DVD) or other optical disk 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.

[0140] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present application, but the present application is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and substance of the present application, and these modifications and improvements are also considered to be within the scope of protection of the present application.

Claims

1. A real-time data collection method based on OpcUA, characterized in that: Applied to the server OpcUA Server, the method includes: S1. Generate OpcUA Server list information according to the preset OpcUA Server information; S2. Establishing an OpcUA communication connection with an OpcUA collection node according to the list information, and obtaining device tag information from the OpcUA collection node; S3. Create a super table and a sub-table of a time series database according to the device tag information; S4. Classify and group the device tags according to the device tag information, and send data collection tasks to the OpcUA collection node in groups; S5. After receiving the real-time data sent by the OpcUA collection node, the real-time data is saved to the super table and sub-table of the time series database.

2. The real-time data collection method based on OpcUA according to claim 1, characterized in that: Include at least one of the following: The list information includes at least one of a URL address, a user name, a password, an SSL certificate, a request timeout, a service name, and a publishing cycle; The device tag information includes at least one of a tag name, a tag comment, a tag group, a namespace, a NodeID, a NodePath, a collection point data type, a collection point data address, and a collection point scanning rate.

3. The real-time data collection method based on OpcUA according to claim 1, characterized in that: S3, including: S31, traversing the data types of the collection points, marking the value types that need to be converted, the data types of the collection points include at least one of integer, Boolean, floating point, and string; S32, creating a corresponding super table for each value type; S33. Create a corresponding sub-table for each device tag according to the converted numerical type corresponding to the device tag and the super-table of the corresponding numerical type.

4. The real-time data collection method based on OpcUA according to claim 3, characterized in that: In S33, a corresponding sub-table is created for each device tag, including: Determine whether the number of device tags is greater than a preset threshold; If yes, a thread pool is created and the sub-tables are created in parallel in a multi-threaded environment; If not, the subtables are created serially in a single-threaded environment.

5. The real-time data collection method based on OpcUA according to claim 3 or 4, characterized in that: Include at least one of the following: The table name of the super table is the corresponding numeric type, The field columns of the super table include a timestamp and a corresponding value type; The label column of the super table includes device label name, label comment, label group, collection point data address, NodeID, and NodePath; The surface of the subtable is a combination of tag groups and tag names; The sub-table inherits the label column from the super-table as the corresponding attribute value of the device label.

6. The real-time data collection method based on OpcUA according to claim 1, characterized in that: In S4, classifying and grouping the device tags according to the device tag information includes: S41, determining the transmission weight of each data flow corresponding to each device tag according to the device tag information; S42, determining a total transmission weight corresponding to each device tag according to the transmission weights of each data flow corresponding to each device tag; S43: Classify and group the device tags according to the total transmission weight corresponding to each device tag.

7. The real-time data collection method based on OpcUA according to claim 6, characterized in that: In S41, the data flow transmission weight of each device tag is calculated according to the following formula: QZ=CON×FAC÷RATE Among them, QZ is the transmission weight of the data stream, CON is a constant, FAC is a numerical type coefficient, and RATE is the acquisition point scanning rate.

8. The real-time data collection method based on OpcUA according to claim 6 or 7, characterized in that: S43, including: S43a, sorting the M device tags in descending order of total transmission weight to obtain a set of data sets in descending order, where M is an integer greater than or equal to 1; S43b, dividing the first N device tags in the data set into N groups in sequence, wherein each group contains one device tag, N is an integer greater than or equal to 1, and M is greater than or equal to N; S43c, summing the transmission weights of the N+i-th device tag in the data set and the existing device tags in N groups in sequence, determining a target group with the smallest sum, and dividing the N+i-th device tag into the target group, where i is an integer greater than or equal to 1; S43d, increase the value of i by one, and return to the step of summing the transmission weights of the N+i-th device tag in the data set with the existing device tags in the N groups in sequence, until all device tags are grouped.

9. The real-time data collection method based on OpcUA according to claim 1, characterized in that: S5, including: After receiving the real-time data sent by the OpcUA collection node, the real-time data is cached to the corresponding classification group according to the device tag and classification group information; When the amount of data in the classified group buffer reaches a preset threshold, the real-time data is written into the super table and sub-table of the time series database.

10. A real-time data acquisition device based on OpcUA, characterized in that: Applied to the server OpcUA Server, the device comprises: A list generation module, configured to generate list information of OpcUA Servers according to preset OpcUA Server information; A device tag acquisition module, configured to establish an OpcUA communication connection with an OpcUA acquisition node according to the list information, and acquire device tag information from the OpcUA acquisition node; A database establishment module, which is configured to create a super table and a sub-table of a time series database according to the device tag information; A classification and grouping module, which is configured to classify and group device tags according to the device tag information, and send data collection tasks to the OpcUA collection node in groups; The data saving module is configured to save the real-time data to the super table and sub-table of the time series database after receiving the real-time data sent by the OpcUA acquisition node.

11. A real-time data acquisition device based on OpcUA, characterized in that: It comprises 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 real-time data collection method based on OpcUA as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the real-time data collection method based on OpcUA as described in any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Data collection method and device

    CN112764916A

  • Internet-of-Things time sequence big data processing method based on Internet of Things middleware

    CN112783901A

  • Internet of Things cloud equipment data acquisition system based on VPN (Virtual Private Network)

    CN114253242A

  • Production equipment visualization method based on operation data analysis

    CN116955468A

  • Time domain astronomical database creation method and time domain astronomical data retrieval method and device

    CN117931773A