Opc ua service system supporting Tdensine and working method thereof
Patent Information
- Application Number
- CN202411064341.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-08
AI Technical Summary
[0002]Tdengine 目前已经成为国内主流的时序数据库,使用该数据库的企业和单位越来越多,使用场景也越来越丰富;但是,目前市场上的 opc ua 服务系统大多是CS架构实现的,当前现有的 opc ua 服务软件都不支持 Tdengine 时序数据库数据服务功能,因此,有必要研究一种可以将Tdengine 数据库转为opc ua协议的方法和系统来解决上述问题
[0008]与现有技术相比,本发明具有的优点和积极效果是:
Smart Images

Figure CN118916413A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to an opc ua service system supporting Tdengine and a working method thereof. Background Art
[0002] Tdengine has become the mainstream time series database in China. More and more enterprises and units use this database, and its usage scenarios are becoming more and more diverse. However, most of the opc ua service systems on the market are implemented in the CS architecture. The existing opc ua service software does not support the data service function of the Tdengine time series database. Therefore, it is necessary to study a method and system that can convert the Tdengine database into the opc ua protocol to solve the above problems. Summary of the invention
[0003] The object of the present invention is to provide an opc ua service system supporting Tdengine and a working method thereof which are simple to operate and convenient to use in view of the above problems.
[0004] In order to achieve the above object, the technical solution of the present invention is: An opc ua service system supporting Tdengine comprises a connector for connecting to a Tdengine database and an MQTT message queue, a configuration center for managing connection information of the Tdengine database and the MQTT message queue and opcua node information, a task center for dynamically creating opc ua node information, an opc ua service center for providing service links and data publishing functions, and a mysql database for storing opc ua node information; the Tdengine database and the MQTT message queue are connected to a signal end of the task center via the connector, the signal end of the configuration center is connected to a signal end of the task center, and the signal end of the task center is connected to a signal end of the opc ua service center; the signal ends of the configuration center and the task center are both connected to the signal end of the mysql database.
[0005] Furthermore, the opc ua service system also includes a web management page for configuring Tdengine database and MQTT message queue connection information; the signal end of the web management page is respectively connected to the signal end of the connector, configuration center, task center, and opcua service center.
[0006] A working method of an opc ua service system supporting Tdengine, comprising the following steps: S1. Connect to the Tdengine database or MQTT message queue through the connector; S2. Through the configuration center, the connection information of the Tdengine database, the MQTT message queue, and the node configuration information of the opc ua are queried and stored in the mysql database; S3, the task center creates or deletes the root directory and opcua node information through the opc ua node configuration information in the mysql database; S4. The OPC UA service center performs data publishing and data subscription operations on the OPC UA node information created or deleted by the task center.
[0007] Furthermore, in step S3, the task center periodically compares the opc ua node configuration information in the mysql database, and creates or deletes the root directory and opc ua node information based on the comparison results.
[0008] Compared with the prior art, the present invention has the following advantages and positive effects: The present invention is based on the BS architecture opc ua service system, which adopts a system architecture with separated front-end and back-end, and can support the publication of Tdengine data and MQTT messages as opc ua services, thereby improving the convenience of using Tdengine data; at the same time, the present invention adopts a cross-platform framework design, supports cross-platform and containerized deployment of the system, and improves the stability and security of the system; and it avoids the cumbersome operation of installing the client on the user's computer in the CS architecture system. The user can directly access the system through the browser, which greatly improves the user's convenience, and at the same time facilitates the subsequent operation and maintenance and management operations, further improving the use effect of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0010] Figure 1 It is a system framework diagram of the present invention; Figure 2 is an operation flow chart of the present invention; Figure 3 This is a working diagram of the configuration center; Figure 4 This is a working diagram of the mission center. DETAILED DESCRIPTION
[0011] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work, any modifications, equivalent substitutions, improvements, etc., should be included in the protection scope of the present invention.
[0012] like Figure 1 As shown, the present invention discloses an opc ua service system supporting Tdengine, including a web management page for configuring Tdengine database and MQTT message queue connection information, a connector for connecting to the Tdengine database and the MQTT message queue, a configuration center for managing the Tdengine database and MQTT message queue connection information and opc ua node information, a task center for dynamically creating opc ua node information, an opc ua service center for providing service links and data publishing functions, and a mysql database for storing opc ua node information; The Tdengine database and MQTT message queue are connected to the signal end of the task center via the connector, the signal end of the configuration center is connected to the signal end of the task center, and the signal end of the task center is connected to the signal end of the opc ua service center; the signal ends of the configuration center and the task center are both connected to the signal end of the mysql database; the signal end of the web management page is respectively connected to the signal ends of the connector, the configuration center, the task center, and the opc ua service center.
[0013] The web management page provides a visual way to configure the connection information of Tdengine and mqtt and the node information to be released by the opc ua service. The front end uses vue.js+css+html5 technology to implement page configuration capabilities, provides connection configuration of mqtt and tdengine databases, and provides opc ua node configuration functions, which are mainly used to dynamically add and modify opc ua data nodes.
[0014] The configuration center is used to manage Tdengine and mqtt connection information and opc ua node information, and provides the functions of adding, deleting, modifying and checking. The modification function uses the .net8 web api to provide a RESTful api interface that can be called by the front-end page, and stores the configuration information in the mysql database; Figure 3 shown.
[0015] The task center is mainly responsible for dynamically creating opc ua nodes and data subscription, parsing, and publishing functions. The task center uses the Task thread pool provided by .net8 to start a scheduled task to query the node configuration information saved in the mysql database and compare the new and old nodes. If new node configuration information appears, the scheduling center will call the opc ua service center to publish the node. Similarly, if some configuration nodes are deleted, the scheduling center will also call the opcua service center to remove the existing nodes; Figure 4 shown.
[0016] The connector provides a tool for connecting Tdengine and mqtt. The connector abstracts a common interface, inherits the common interface and implements the connection functions of Tdengine and mqtt respectively. The implementation of the Tdengine connector encapsulates the Tdengine.Connector3.1.1 SDK package officially provided by Tdengine, and the mqtt connector uses the MQTTnet4.3.x SDK package provided by a third party.
[0017] The Opc ua service center is implemented based on the .net version of the SDK package OPCFoundation.NetStandard.Opc.Ua officially provided by the Opc Foundation. The service link, data publishing and data subscription functions provided by this package are used.
[0018] The opc ua service system in the present invention accesses Tdengine and mqtt by means of data subscription. When the service is started, a connection is created according to the Tdengine and mqtt connection information configured on the page, and the directory and node of opc ua are created according to the configured node information. After the service is started, the opc ua client can connect to the service to obtain the data of mqtt and Tdengine. like Figure 2 As shown, the specific operation steps of the working method of the opc ua service system are as follows: S1. Connect to the Tdengine database or MQTT message queue through the connector; S2. Through the configuration center, the connection information of the Tdengine database, the MQTT message queue, and the node configuration information of the opc ua are queried and stored in the mysql database; S3, the task center creates or deletes the root directory and opcua node information through the opc ua node configuration information in the mysql database; S4. The OPC UA service center performs data publishing and data subscription operations on the OPC UA node information created or deleted by the task center.
[0019] The present invention is based on the BS architecture opc ua service system, which adopts a system architecture with separated front-end and back-end, and can support the publishing of Tdengine data and MQTT messages as opc ua services, thereby improving the convenience of using Tdengine data; at the same time, the present invention adopts a cross-platform framework design, supports cross-platform and containerized deployment of the system, and improves the stability and security of the system; and it avoids the cumbersome operation of installing the client on the user's computer in the CS architecture system. The user can directly access the system through the browser, which greatly improves the user's convenience, and at the same time facilitates the subsequent operation and maintenance and management operations, further improving the use effect of the present invention.
Claims
1. An opc ua service system supporting Tdengine, characterized in that: The opc ua service system includes a connector for connecting to a Tdengine database and an MQTT message queue, a configuration center for managing connection information of the Tdengine database and the MQTT message queue and opc ua node information, a task center for dynamically creating opc ua node information, an opc ua service center for providing service links and data publishing functions, and a mysql database for storing opc ua node information; the Tdengine database and the MQTT message queue are connected to the signal end of the task center via the connector, the signal end of the configuration center is connected to the signal end of the task center, and the signal end of the task center is connected to the signal end of the opc ua service center; the signal ends of the configuration center and the task center are both connected to the signal end of the mysql database.
2. The opc ua service system supporting Tdengine as claimed in claim 1, characterized in that: The opc ua service system also includes a web management page for configuring Tdengine database and MQTT message queue connection information; the signal end of the web management page is respectively connected to the signal end of the connector, the configuration center, the task center, and the opc ua service center.
3. A working method of the opc ua service system supporting Tdengine as claimed in claim 2, characterized in that: The following steps are involved: S1. Connect to the Tdengine database or MQTT message queue through the connector; S2. Through the configuration center, the connection information of the Tdengine database, the MQTT message queue, and the node configuration information of the opc ua are queried and stored in the mysql database; S3, the task center creates or deletes the root directory and opc ua node information through the opc ua node configuration information in the mysql database; S4. The OPC UA service center performs data publishing and data subscription operations on the OPC UA node information created or deleted by the task center.
4. The working method of the opc ua service system supporting Tdengine as claimed in claim 3, characterized in that: In step S3, the task center periodically compares the opc ua node configuration information in the mysql database, and creates or deletes the root directory and opc ua node information based on the comparison results.
Citation Information
Patent Citations
Message push system based on MQTT protocol
CN107809489A
