CN109145000B - Industrial real-time database OPC UA data interface implementation method - Google Patents
Industrial real-time database OPC UA data interface implementation method Download PDFInfo
- Publication number
- CN109145000B CN109145000B CN201810917401.1A CN201810917401A CN109145000B CN 109145000 B CN109145000 B CN 109145000B CN 201810917401 A CN201810917401 A CN 201810917401A CN 109145000 B CN109145000 B CN 109145000B
- Authority
- CN
- China
- Prior art keywords
- opc
- equipment
- database
- connection
- real
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a method for realizing an industrial real-time database OPC UA data interface, which comprises two parts of OPC UA equipment configuration and real-time data storage. The beneficial effects are as follows: the invention gets through the OPC UA data interface of the industrial real-time database, and can realize the reading and storage of the real-time data of the OPC UA equipment and the platform software; the invention provides record addition and/or modification of a database in the device configuration process, thereby effectively ensuring the application of all OPC UA devices; the invention integrates API provided by OPC Foundation official in the real-time database, and realizes the connection of OPC UA equipment and data reading and storing in the real-time database without other application programs; the configuration information is stored in a relational database, real-time data is stored in the real-time database, the storage of high-frequency real-time data of OPC UA is realized, and the operability is strong.
Description
Technical Field
The invention relates to the technical field of wireless network monitoring, in particular to a method for realizing an industrial real-time database OPC UA data interface.
Background
With the increasing complexity of industrial process systems, in order to ensure the safe and stable operation of the industrial process systems, industrial real-time database systems are increasingly widely applied in industrial process monitoring and become indispensable technical data platforms for advanced control, process detection and plant-level information management.
OPC is one of the commonly used transport protocols in industrial fields, is an interoperability standard for the automation industry and other industries for secure exchange of data, and has wide applications in various fields. It is platform independent and ensures seamless transfer of information between devices from multiple vendors. With the introduction of service-oriented architecture in manufacturing systems, new challenges are brought to OPC, and how to redefine architecture to ensure data security has prompted OPC funds to create new architecture — OPC UA to meet these needs. Meanwhile, OPC UA also provides an open technical platform with rich functions for future development and expansion. OPC UA is a platform-independent, service-oriented architecture specification that integrates all functions from the existing OPC Classic specification, providing a migration path for a more secure and extensible solution, which is compatible with the OPC Classic specification. The industrial real-time database is used as a support for large-scale data storage in the industrial field, and the integrated OPC UA data interface has higher practicability.
In the prior art, there is also a method for implementing an industrial real-time database interface, for example, the "industrial real-time database interface method" of patent publication No. CN 104965917 a, which discloses an industrial real-time database interface method, belonging to the technical field of wireless network monitoring, including OPC technology of real-time database and DCS interface, a method for implementing an interface, OPC configuration of a real-time database, and the like. However, the OPC Client software is used for obtaining the configuration of the patent, an interface machine is required to be connected externally, data is acquired to a database through the software on the interface machine, and the system integration level is low; and is based on OPC Classic specification, can't support OPC UA specification; the configuration information and the real-time data are stored in a relational database; connection is slow and information storage is slow.
Therefore, those skilled in the art are dedicated to develop an implementation method of an industrial real-time database OPC UA data interface to solve the problem that data cannot be transmitted between the existing real-time database and OPC UA devices.
Disclosure of Invention
In view of the above defects in the prior art, the technical problems to be solved by the present invention are that data cannot be transmitted between the existing real-time database and OPC UA devices, the system integration level is low, and the information storage is slow; the real-time database OPC UA data interface can realize the butt joint of the real-time database and industrial field OPC UA equipment and the butt joint of all platform software supporting OPC UA standards, and realize real-time data storage.
In order to solve the above problems, the present invention provides a method for implementing an industrial real-time database OPC UA data interface, comprising the following steps:
s1: starting data storage, and searching a connection URL (uniform resource locator) corresponding to the OPC UA equipment, a measuring point and a NodeID corresponding to the measuring point in an equipment database according to the name of the OPC UA equipment needing information storage; the measurement points refer to variables which need to be stored in real time on the OPC UA devices.
S2: and performing OPC UA equipment connection according to the URL, and reading and storing the information of the measuring point.
Further, in step S1, if the found OPC UA device is an OPC UA device already existing in the device database, the connection URL, the measurement point, and the NodeID information corresponding to the measurement point are matched in the device database.
Further, in step S1, if the found OPC UA device is a new OPC UA device, connecting the OPC UA devices that do not exist in the device database and acquiring variable information of the OPC devices, where each variable corresponds to a unique NodeID, reading the NodeID corresponding to the variable point, and matching out a measurement point that needs to be stored, thereby completing adding the new OPC UA device.
Further, when the new OPC UA device is connected, calling an OPC official to provide an API to realize OPC UA device connection, and displaying device variable information and variable information after connection is successful.
Further, the device database in step S1 is a relational database, and is used to store device names, connection URLs, measurement points, and nodeids corresponding to the measurement points of all OPC UA device configurations.
Further, two data tables are set in the device database, which are respectively:
(1) the device table is used for storing a connection URL, a device type and an associated real-time database name corresponding to the device;
(2) and the measuring point table is used for storing all measuring points, NodeIDs corresponding to the measuring points and associated equipment.
Further, in step S2, it is necessary to add a time stamp to the data after the data is successfully read, and write the real-time data.
Further, in step S2, if a connection failure occurs during the connection process of the OPC UA device, the connection will be retried, the number of times of the reconnection is 1 to 10, if the reconnection is unsuccessful, the connection will be stopped from being attempted, and the real-time data storage is finished.
Preferably, the number of rejoinings is 5.
Further, in step S2, data reading is performed in a loop, and when the loop condition is that data storage is started, the data reading will be retried after the data reading is abnormal, and the data reading will not succeed after 1-15 times of continuous reading, and the loop will be skipped, the connection will be disconnected, and the connection will be retried.
Preferably, the number of consecutive readings is 10.
Further, in the configuration process of the OPC UA device, the OPC UA device connection is performed after the device connection URL is configured, a measurement point which is stored in real time can be selected after the connection is successful, connection URL information of all OPC UA devices and corresponding measurement point information are stored in the device database, and database records can be modified or added.
By implementing the method for realizing the industrial real-time database OPC UA data interface provided by the invention, the following technical effects are achieved:
(1) the invention gets through the OPC UA data interface of the industrial real-time database, and can realize the reading and storage of the real-time data of the OPC UA equipment and the platform software;
(2) the invention provides record addition and/or modification of a database in the device configuration process, thereby effectively ensuring the application of all OPC UA devices;
(3) the invention integrates API provided by OPC Foundation official in the real-time database, and realizes the connection of OPC UA equipment and data reading and storing in the real-time database without other application programs; (ii) a
(4) The configuration information is stored in a relational database, real-time data is stored in the real-time database, the storage of high-frequency real-time data of OPC UA is realized, and the operability is strong.
Drawings
The conception, the specific structure and the technical effects of the present invention will be further described with reference to the accompanying drawings to fully understand the objects, the features and the effects of the present invention.
FIG. 1 is a schematic diagram of a data reading process according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of the device configuration in the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following embodiments are used to describe the technical aspects of the present invention in detail.
The invention provides a method for realizing an industrial real-time database OPC UA data interface, which comprises the following steps:
as shown in fig. 1, after the data storage is started, the device database and the device configuration information are searched by using the name of the OPC UA device which performs initialization and performs information storage as needed;
after initialization is completed, equipment connection is carried out according to user configuration information, and after connection is successful, data reading is carried out according to a measuring point associated with the equipment in the configuration information and a nodeID corresponding to the measuring point;
and successfully reading the data, adding a timestamp to the data, writing the data into the real-time database, and performing the processes of reading and writing the data into the real-time database in a cycle, wherein the cycle condition is when data storage is started.
Further, the OPC UA device configuration information searched in the above steps necessarily includes a connection URL corresponding to the device, a real-time database name, a device-associated measurement point, and a NodeID thereof.
Further, if the connection fails in the data storage process, connection attempt is carried out again, the number of the attempt is 5, and the data storage is stopped after 5 unsuccessful attempts;
if the data reading is abnormal, the reading is retried, and after 10 times of continuous reading fails, the loop is jumped out, the connection is disconnected, and the connection is retried.
Based on the above implementation method, before the OPC UA device starts the real-time storage, the OPC UA device configuration may be started as shown in fig. 2.
As shown in fig. 2, after the user configuration interface is opened, it is queried whether the OPC UA device that needs to store information is a device already existing in the device database, and different processing is performed according to different operations of the user:
if the searched OPC UA equipment is the OPC UA equipment already existing in the equipment database, calling an OPC official to provide API (application programming interface) to realize OPC equipment connection according to the matching connection URL, the measurement point and NodeID information corresponding to the measurement point in the equipment database by the name of the OPC UA equipment, and displaying the connection information, the variable information and the equipment associated measurement point of the equipment after the connection is successful, wherein a user can change the equipment; after the user clicks and saves, correspondingly updating the records in the relational database;
if the check result is that the equipment does not exist in the equipment database, calling an OPC official to provide an API to realize OPC UA equipment connection according to the URL input by the user, displaying equipment variable information and variable information after the connection is successful, checking a measuring point needing to be stored in real time by the user and a unique NodeID corresponding to the measuring point, and adding a record of new equipment in the equipment database after the user clicks and stores the measuring point and the unique NodeID.
Further, the configuration information in the above step necessarily includes a device name, a connection URL, a measurement point, and a nodeID corresponding to the measurement point.
Further, the device database is provided with the following related data tables:
(1) the device table is used for storing a connection URL, a device type and an associated real-time database name corresponding to the device;
(2) and the measuring point table is used for storing all measuring points, NodeIDs corresponding to the measuring points and associated equipment.
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concepts. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.
Claims (7)
1. An industrial real-time database OPC UA data interface implementation method is characterized by comprising the following steps:
s1: starting data storage, and searching a connection URL (uniform resource locator) corresponding to the OPC UA equipment, a measuring point and a NodeID corresponding to the measuring point in an equipment database according to the name of the OPC UA equipment needing information storage; wherein, the measuring point refers to a variable which needs to be stored in real time on the OPC UA equipment;
if the searched OPC UA equipment is the OPC UA equipment already existing in the equipment database, matching and connecting the URL, the measuring point and NodeID information corresponding to the measuring point in the equipment database;
if the searched OPC UA equipment is the OPC UA equipment which does not exist in the equipment database, connecting the new OPC UA equipment and acquiring variable information of the OPC equipment, wherein each variable corresponds to a unique NodeID, reading the NodeID corresponding to the variable point, matching out a measuring point which needs to be stored, and finishing adding the new OPC UA equipment
S2: and performing OPC UA equipment connection according to the URL, and reading and storing the information of the measuring point.
2. The method of claim 1, wherein the device database in step S1 is a relational database for storing all the device names, connection URLs, measurement points, and nodeids corresponding to the measurement points configured by the OPC UA devices.
3. The data interface implementation method of claim 2, wherein two data tables are set in the device database, which are respectively:
(1) the device table is used for storing a connection URL, a device type and an associated real-time database name corresponding to the device;
(2) and the measuring point table is used for storing all measuring points, NodeIDs corresponding to the measuring points and associated equipment.
4. The method for implementing data interface of claim 1, wherein in step S2, the data is read successfully and then the timestamp is added to the data, and the real-time data is written.
5. The method according to claim 1, wherein in step S2, if a connection failure occurs during the connection process of the OPC UA device, the connection is retried, the number of the retries is 1-10, and if the reconnection is not successful, the connection is stopped from being attempted, and the real-time data storage is finished.
6. The method for implementing data interface of claim 1, wherein in the step S2, data reading is performed in a loop, and when the loop condition is that data storage is started, the data reading is retried after an exception occurs, and the data reading is not successful after 1-15 times of continuous reading, and the loop is exited, the connection is disconnected, and the connection is retried.
7. The method according to claim 1, wherein in the OPC UA device configuration process, the OPC UA device connection is performed after completing the device connection URL, the measurement point which is stored in real time can be selected after the connection is successful, and the connection URL information of all the OPC UA devices and the corresponding measurement point information are stored in the device database, and the database record can be modified or added.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810917401.1A CN109145000B (en) | 2018-08-13 | 2018-08-13 | Industrial real-time database OPC UA data interface implementation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810917401.1A CN109145000B (en) | 2018-08-13 | 2018-08-13 | Industrial real-time database OPC UA data interface implementation method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109145000A CN109145000A (en) | 2019-01-04 |
CN109145000B true CN109145000B (en) | 2022-03-18 |
Family
ID=64792784
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810917401.1A Active CN109145000B (en) | 2018-08-13 | 2018-08-13 | Industrial real-time database OPC UA data interface implementation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109145000B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112035040B (en) * | 2020-08-31 | 2023-04-07 | 北京润科通用技术有限公司 | Interface variable information processing method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102768666A (en) * | 2011-05-05 | 2012-11-07 | 上海可鲁系统软件有限公司 | Method and system for storing and reading industrial data |
CN103529825A (en) * | 2013-10-23 | 2014-01-22 | 上海白丁电子科技有限公司 | Automatic equipment failure analysis and diagnosis method and device thereof |
CN103738369A (en) * | 2013-12-26 | 2014-04-23 | 北京交控科技有限公司 | ATS device and system based on OPC UA technology |
CN105045922A (en) * | 2015-08-26 | 2015-11-11 | 山东鲁能软件技术有限公司 | Electrical equipment monitoring method and device |
WO2015169355A1 (en) * | 2014-05-07 | 2015-11-12 | Siemens Aktiengesellschaft | Method and device for consistent set operations of data-changing opc-ua calls |
CN106444678A (en) * | 2016-10-31 | 2017-02-22 | 马鞍山钢铁股份有限公司 | Energy management system and method for metallurgical enterprise |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101042796A (en) * | 2006-03-23 | 2007-09-26 | 上海宝信软件股份有限公司 | Method for collecting process data of industry on-the-spot apparatus |
US10057379B2 (en) * | 2015-11-12 | 2018-08-21 | China Petroleum & Chemical Corporation | Systems and methods for drilling automation with OPC UA |
CN105911965B (en) * | 2016-03-14 | 2019-11-05 | 上海电气集团股份有限公司 | A method of realizing data analysis in data monitoring system |
CN106550052A (en) * | 2016-12-08 | 2017-03-29 | 南京富岛信息工程有限公司 | A kind of data acquisition unit and method based on OPC UA |
CN106773978B (en) * | 2016-12-28 | 2019-08-27 | 武汉科技大学 | A Device Data Acquisition System Based on OPC UA Protocol |
-
2018
- 2018-08-13 CN CN201810917401.1A patent/CN109145000B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102768666A (en) * | 2011-05-05 | 2012-11-07 | 上海可鲁系统软件有限公司 | Method and system for storing and reading industrial data |
CN103529825A (en) * | 2013-10-23 | 2014-01-22 | 上海白丁电子科技有限公司 | Automatic equipment failure analysis and diagnosis method and device thereof |
CN103738369A (en) * | 2013-12-26 | 2014-04-23 | 北京交控科技有限公司 | ATS device and system based on OPC UA technology |
WO2015169355A1 (en) * | 2014-05-07 | 2015-11-12 | Siemens Aktiengesellschaft | Method and device for consistent set operations of data-changing opc-ua calls |
CN105045922A (en) * | 2015-08-26 | 2015-11-11 | 山东鲁能软件技术有限公司 | Electrical equipment monitoring method and device |
CN106444678A (en) * | 2016-10-31 | 2017-02-22 | 马鞍山钢铁股份有限公司 | Energy management system and method for metallurgical enterprise |
Non-Patent Citations (2)
Title |
---|
基于OPC UA技术的 Labview 与 PLC通信;邱云 等;《计算机系统应用》;20170228;第26卷(第2期);第231-234页 * |
基于OPC UA的历史数据存取;陈骞 等;《微型电脑应用》;20100228;第26卷(第2期);第35-37页 * |
Also Published As
Publication number | Publication date |
---|---|
CN109145000A (en) | 2019-01-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104517181B (en) | Enterprise content management system and method for nuclear power station | |
WO2005088473A1 (en) | Apparatus and method for data consistency validation | |
CN112099972B (en) | Office file processing method, device and equipment based on RPA robot | |
US10387887B2 (en) | Bloom filter driven data synchronization | |
CN111225082B (en) | Identity management method and device of Internet of things intelligent equipment and Internet of things platform | |
CN104954482A (en) | Configuration management system and method | |
CN118427277A (en) | Data processing method and device and related equipment | |
CN115757612A (en) | Data synchronization method and device, computer equipment and storage medium | |
CN101193154B (en) | Testing data integration system and method for mobile phone product | |
CN109145000B (en) | Industrial real-time database OPC UA data interface implementation method | |
CN113778895A (en) | Automatic interface testing method and device | |
CN106775804A (en) | A kind of mobile terminal and its RFID read-write equipment adaptation method and device | |
US11221862B2 (en) | Capturing data from a live web application to populate a demo application | |
CN115808908A (en) | Data acquisition method, device, electronic equipment and storage medium | |
CN112860780B (en) | Data export method and device and terminal equipment | |
EP1383054A1 (en) | Data synchronization procedures for smartcards | |
CN117708857A (en) | Method and device for detecting electronic file, electronic equipment and medium | |
CN117873548A (en) | Configuration file updating method, device, equipment and computer medium | |
CN111124545A (en) | Application program starting method and device, electronic equipment and storage medium | |
CN103177079B (en) | Detection method, terminal and the server that a kind of theme updates | |
CN116860601A (en) | Collaborative debugging method, device, gateway, server and system | |
CN116680311A (en) | Mapping relation searching method and device, electronic equipment and storage medium | |
CN107943543A (en) | A kind of method and computer equipment of WEB application heat deployment | |
CN114185907A (en) | Method, device and electronic device for synchronizing database to data warehouse | |
CN112764996B (en) | Method and device for monitoring session of target library in database disaster tolerance environment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
EE01 | Entry into force of recordation of patent licensing contract | ||
EE01 | Entry into force of recordation of patent licensing contract |
Application publication date: 20190104 Assignee: Shanghai Electric Huicheng Intelligent System Co., Ltd Assignor: Shanghai Electrical Group Co., Ltd. Contract record no.: X2019310000022 Denomination of invention: A method for implementing OPC UA data interface of industrial real-time database License type: Common License Record date: 20191126 |
|
GR01 | Patent grant | ||
GR01 | Patent grant |