CN116436794A - OPC real-time data integration and control method based on Internet of things model - Google Patents

OPC real-time data integration and control method based on Internet of things model Download PDF

Info

Publication number
CN116436794A
CN116436794A CN202310175231.5A CN202310175231A CN116436794A CN 116436794 A CN116436794 A CN 116436794A CN 202310175231 A CN202310175231 A CN 202310175231A CN 116436794 A CN116436794 A CN 116436794A
Authority
CN
China
Prior art keywords
opc
equipment
data
object model
instance
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.)
Pending
Application number
CN202310175231.5A
Other languages
Chinese (zh)
Inventor
顾文超
刘源
朱皓
卢良辉
宋杨
秦钢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Cloud Core Intelligent Technology Co ltd
Hangzhou Diji Intelligent Technology Co ltd
Original Assignee
Chongqing Cloud Core Intelligent Technology Co ltd
Hangzhou Diji Intelligent Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chongqing Cloud Core Intelligent Technology Co ltd, Hangzhou Diji Intelligent Technology Co ltd filed Critical Chongqing Cloud Core Intelligent Technology Co ltd
Priority to CN202310175231.5A priority Critical patent/CN116436794A/en
Publication of CN116436794A publication Critical patent/CN116436794A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to an OPC real-time data integration and control method based on an Internet of things model, which is used for initializing an OPC connection object by collecting an instance structure; configuring equipment parameters, initializing equipment data, constructing equipment instances of corresponding equipment, and mapping the point position relation between equipment object model information and OPC according to configuration; OPC parameters are configured, an OPC server is connected according to the configuration, the connection state is checked, and a connection state result is obtained; and reading and obtaining OPC point position data of the corresponding equipment object model according to the connection state result, and reporting the OPC point position data. OPC DA (OPC data Access) and OPC AE data access and control capability are provided for an instruction set Internet of things operating system. Depending on the device access capability of the OPC itself, devices which have been integrated by the OPC are quickly docked. The traditional OPC project is enabled to be intelligent through a physical model modeling mode, so that the old project is refreshed.

Description

OPC real-time data integration and control method based on Internet of things model
Technical Field
The disclosure relates to the technical field of control of the internet of things, in particular to an OPC real-time data integration and control method and device control system based on an internet of things model.
Background
Along with the promotion of industrial 4.0, internet of things and big data in a big background environment, more and more factories begin to intelligently reform themselves at present. Most factories are automated by OPC technology when manufacturing production lines.
OPC, OLE for Process Control, is an industry standard based on the OLE, COM and DCOM technologies of microsoft. With the rapid development of automation systems in the nineties, various standard automation software was developed by large automation manufacturers in order to access automation data in the devices, and the process used a myriad of different bus systems, protocols and interfaces. In order to eliminate the obstacle of interoperability between automation software and hardware platforms, the OPC foundation provides OPC standards, and a whole set of open interfaces, attributes and method standard sets are established for equipment communication of different manufacturers. According to different requirements of industrial applications, the OPC foundation mainly sets three OPC specifications, namely OPC DA (data access), OPC AE (alarm and event) and OPC HDA (historical data access). Since OPC is used in a relatively large amount in practical applications, OPC is called OPC DA in the case of using OPC.
Although OPC solves the problem of cross-vendor platform communication of devices, it relies on Windows COM/DCOM technology, which makes it unusable in Linux or other systems. In addition, in the practical application process, complex DCOM configuration needs to be performed on the OPC client and the server.
In order to solve the problems, the OPC foundation develops a new generation OPC technology-OPCUA (OPC Unified Architecture) on the basis of OPC, and the mutual communication between different systems and different protocol devices is realized. The method gets rid of the problem of strong dependence on Windows system, and can be run into a system outside Windows from the client and the server. But the new generation OPCUA has an incompatibility problem with the OPC class, which is the OPC technology of the previous generation. This problem makes components developed using the new technology OPCUA inaccessible to the OPC Classic system.
OPC data integration on the market at present mostly only supports OPCUA, but OPCDA and OPCAE do not. However, the existing projects at present mostly relate to the old projects for intelligent upgrading, and the cost investment for replacing basic equipment is huge, so that the technical upgrading and reconstruction are necessary.
Disclosure of Invention
In order to solve the problems, the application provides an OPC real-time data integration and control method and device control system based on an Internet of things model.
In one aspect of the application, an OPC real-time data integration and control method based on an internet of things model is provided, which comprises the following steps:
acquiring an instance structure and initializing an OPC connection object;
configuring equipment parameters, initializing equipment data, constructing equipment instances of corresponding equipment, and mapping the point position relation between equipment object model information and OPC according to configuration;
OPC parameters are configured, an OPC server is connected according to the configuration, the connection state is checked, and a connection state result is obtained;
and reading and obtaining OPC point position data of the corresponding equipment object model according to the connection state result, and reporting the OPC point position data.
As an optional embodiment of the present application, optionally, configuring device parameters, initializing device data, and constructing a device instance of a corresponding device, mapping a point location relationship between device object model information and OPC according to the configuration, including:
determining OPC equipment and initializing OPC equipment data;
constructing an equipment instance in the corresponding OPC equipment according to the configured equipment parameters;
through equipment management, mapping is carried out between object model information of the OPC equipment and OPC points, and binding of equipment object model attribute and OPC DA points and binding of equipment object model event and OPC AE points are completed;
after the point location binding is completed, the equipment object model information corresponding to the OPC equipment is reported to the intelligent gateway in a mode that the equipment instance is converted into an object model.
As an optional embodiment of the present application, optionally, when constructing an equipment instance, a method of constructing an equipment instance in an OPC equipment includes:
the intelligent gateway calls Java functions, loads and controls OPCACCess. Jar drivers;
an OPCACCess.jar driver receives the call of the intelligent gateway, instantiates OPC equipment according to the configuration information, and constructs an equipment instance in the corresponding OPC equipment;
and the data reported by the lower layer is given to the corresponding equipment instance, and the equipment object model information of the corresponding OPC equipment is reported to the intelligent gateway in a mode that the equipment instance is converted into an object model.
As an optional embodiment of the present application, optionally, when constructing an equipment instance, a method of constructing an equipment instance in an OPC equipment includes:
the intelligent gateway issues a write model instruction, and loads and controls an OPCACCess. Jar driver;
the OPCACCess.jar driver receives a write model instruction issued by the intelligent gateway, calls an OPCLirary.dll module in a JNA calling mode, instantiates an OPC object, and constructs an equipment instance in corresponding OPC equipment;
and the data reported by the lower layer is given to the corresponding equipment instance, and the equipment object model information of the corresponding OPC equipment is reported to the intelligent gateway in a mode that the equipment instance is converted into an object model.
As an optional embodiment of the present application, optionally, when the opclirary. Dll module instantiates an OPC object, further includes:
calling an OPCClass.dll module to provide a callable OPC interface for the OPCLirary.dll module through CLR support;
the OPCClass.dll module is a custom package class library of the OPC DA and the OPCAE called by the OPCLirary.dll module and is used for referencing an OPC interface of a third party library.
As an optional embodiment of the present application, optionally, checking the connection state to obtain a connection state result includes:
after the OPC server is connected, the connection state of the OPC server is checked, and whether the connection is successful or not is judged:
if the OPC server is not connected, waiting for a plurality of seconds, and connecting the OPC server again;
and if so, outputting a connection result.
As an optional implementation manner of the present application, optionally, according to a connection state result, reading and obtaining OPC point data of a corresponding equipment object model, and reporting the OPC point data, including:
after the OPC server is connected, according to the mapping binding relation between object model information and OPC points of the OPC equipment, the OPC point data of the related OPC equipment are read in full quantity to equipment object model attributes;
the OPC equipment completes initial starting and reports corresponding OPC point position data in full quantity.
As an optional implementation manner of the present application, optionally, when the OPC device reports corresponding OPC point location data, the method includes:
acquiring OPC point position data by adopting a point position subscription mode, and starting subscription delegation;
and sending the subscribed OPC point position data to a queue, and judging whether an issuing instruction exists in the issuing queue or not:
if yes, finding out an OPC DA point position identifier through the equipment object model attribute, and issuing an OPC Write operation according to the identifier; if the OPC DA point position identification is not found, checking whether the connection of the OPC server is normal or not;
if not, judging whether the exit is needed:
if yes, ending subscription commission, ending OPC connection, releasing equipment resources and releasing OPC examples;
otherwise, waiting for a plurality of seconds, and checking whether the connection of the OPC server is normal.
In another aspect of the present application, a device is further provided, which is configured to implement the method for integrating and controlling OPC real-time data based on the internet of things model, where the method includes:
the initialization module is used for acquiring an instance structure and initializing an OPC connection object;
the equipment instance construction module is used for configuring equipment parameters, initializing equipment data and constructing equipment instances of corresponding equipment, and mapping the point position relation between equipment object model information and OPC according to configuration;
the OPC connection module is used for configuring OPC parameters, connecting an OPC server according to the configuration, checking the connection state and obtaining a connection state result;
and the OPC data reporting module is used for reading and obtaining OPC point position data of the corresponding equipment object model according to the connection state result and reporting the OPC point position data.
In another aspect of the present application, an OPC real-time data integration and control method control system based on an internet of things model is also provided, including:
a processor;
a memory for storing processor-executable instructions;
the processor is configured to implement the method for integrating and controlling OPC real-time data based on the Internet of things model when executing the executable instructions.
The invention has the technical effects that:
the OPC connection object is initialized through collecting an instance structure; configuring equipment parameters, initializing equipment data, constructing equipment instances of corresponding equipment, and mapping the point position relation between equipment object model information and OPC according to configuration; OPC parameters are configured, an OPC server is connected according to the configuration, the connection state is checked, and a connection state result is obtained; and reading and obtaining OPC point position data of the corresponding equipment object model according to the connection state result, and reporting the OPC point position data. OPC DA (OPC data access) and OPC AE (OPC alarm and event) data access and control capabilities are provided for an instruction set internet of things operating system (ISysCore OS). Based on ISysCore OS object model, the southbound service code and northbound integration are decoupled. Depending on the device access capability of the OPC itself, devices which have been integrated by the OPC are quickly docked.
The scheme is supported by JNA and CLR, and Java, C++, C# codes are organically combined, so that the Java can call an OPC interface more directly; an OPC subscription mechanism is used instead of a point location polling mode, so that timeliness of point location data is optimized, and data delay is reduced; the traditional OPC project is enabled to be intelligent through an object model modeling mode. The previous generation OPC technology aiming at DCOM communication provides the support of big data access, so that the old project is renewed.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features and aspects of the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a schematic diagram of an application of an Internet of things framework of the present invention;
FIG. 2 shows a flow chart of an application implementation of the method of the invention;
FIG. 3 is a schematic diagram showing the functional structure of an OPC function module of the present invention;
fig. 4 shows a schematic diagram of a callback flow for the OPC DA and OPC AE of the present invention.
Detailed Description
Various exemplary embodiments, features and aspects of the disclosure will be described in detail below with reference to the drawings. In the drawings, like reference numbers indicate identical or functionally similar elements. Although various aspects of the embodiments are illustrated in the accompanying drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
In addition, numerous specific details are set forth in the following detailed description in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements, and circuits well known to those skilled in the art have not been described in detail in order not to obscure the present disclosure.
The invention is used for providing OPCDA (OPC data access) and OPCAE (OPC alarm and event) data access and control capability for an instruction set Internet of things operating system (ISysCoreOS). Based on the ISysCoreOS object model, the southbound service code and northbound integration are decoupled. Depending on the device access capability of the OPC itself, devices which have been integrated by the OPC are quickly docked.
As shown in the Internet of things framework of FIG. 1, the scheme relies on Windows DCOM components, and an intelligent gateway needs to be deployed in a Windows system (the intelligent gateway and an Internet of things platform communicate by adopting an MQTT, and the Internet of things platform is not limited by the MQTT). The intelligent gateway depends on the DCOM component, the security of the intelligent gateway completely depends on the Windows system, and intranet deployment is suggested.
In the internet of things framework shown in fig. 1, the OPC function module is mainly deployed in the intelligent gateway. The OPC function module is integrated and operated in the intelligent gateway and is specially responsible for communication with equipment adapted to an OPC protocol, and data enter an ISysCore OS in a physical model mode.
The working principle is as follows:
the user can upload the module to the drive library through ISysCore OS drive uploading function, bind equipment model attribute and OPC DA point position through equipment management/configuration in ISysCore OS, bind equipment model event and OPC AE point position, send down function through ISysCore intelligent gateway drive, distribute the module to intelligent gateway local, load the start module by intelligent gateway, the module will inherit equipment model information (attribute and event) and point position binding relation during start, through mutual mapping, accomplish the interactive association of the object model and OPC point position.
By means of the equipment integration service and other module services of the ISysCore OS, different usage applications and project sites are combined, such as:
1. through the combination of equipment integration and a rule engine, the automatic control of OPC equipment or the linkage of other protocol equipment can be completed;
2. the analysis of the operation data of the OPC equipment can be completed through the equipment integration and data processing and analyzing module;
3. the application programs for monitoring and controlling various supporting equipment can be completed through the support of various northbound application docking of ISysCore OS;
4. by the storage capability of the isysene OS, traceability of the operating state of the device and the like can be provided.
A description of an integration and control method of OPC real-time data using the object-to-object system will be specifically described below.
Example 1
As shown in fig. 2, in one aspect, the application provides an OPC real-time data integration and control method based on an internet of things model, which includes the following steps:
1. acquiring an instance structure and initializing an OPC connection object;
when the OPC data acquisition of the internet of things equipment is started, an OPC connection object is firstly required to be determined according to service scenes and the like. After the acquisition target is determined, initializing the target OPC equipment, and constructing a driving instance in the OPC connection objects for reporting equipment information when the driving instance is used. Therefore, an initialization process is needed for the OPC equipment first, and the collection of the instances is started.
2. Configuring equipment parameters, initializing equipment data, constructing equipment instances of corresponding equipment, and mapping the point position relation between equipment object model information and OPC according to configuration;
after the OPC devices are initialized, device instances are initially built for each (or custom determined) OPC device. By configuring parameters for the OPC equipment, the OPC equipment obtains data of the construction example. And mapping object model attributes and events of the OPC equipment and OPC point positions according to configuration.
As an optional embodiment of the present application, optionally, configuring device parameters, initializing device data, and constructing a device instance of a corresponding device, mapping a point location relationship between device object model information and OPC according to the configuration, including:
determining OPC equipment and initializing OPC equipment data;
constructing an equipment instance in the corresponding OPC equipment according to the configured equipment parameters;
through equipment management, mapping is carried out between object model information of the OPC equipment and OPC points, and binding of equipment object model attribute and OPC DA points and binding of equipment object model event and OPC AE points are completed;
after the point location binding is completed, the equipment object model information corresponding to the OPC equipment is reported to the intelligent gateway in a mode that the equipment instance is converted into an object model.
Specifically, the equipment object model attribute is bound with the OPC DA point and the equipment object model event is bound with the OPC AE point through equipment management/configuration in the ISysCore OS. After binding the equipment object model attribute of the OPC equipment with the OPC DA point, the OPC equipment has an OPC DA point mark; the corresponding OPC AE point positions are bound and then provided with OPC AE point position marks. And loading a starting module by the intelligent gateway, wherein the starting module inherits equipment object model information (attributes and events) and point location binding relations, and the interactive association of the object model and the OPC point location is completed through mutual mapping. Thus, when object model information of the OPC equipment is obtained and reported later, the object model information of the equipment can be obtained from the OPC point position data through the mapping relation.
The key is the construction of the device instance and the way the object model is transformed by the device instance. In this embodiment, the following two ways are provided to construct the device instance.
This patent is compiled using multi-language mixing. Because the C# ecology is complete in the OPC automatic control field, the friendliness is higher than that of any other language especially in Windows COM. All OPC Classic related items are currently almost entirely built around the c# technology stack.
Fig. 3 is a schematic diagram of the OPC functional module of the present application. An OPC function module comprising:
the OPCACCess. Jar is a driving packet loaded by the Java process of the intelligent gateway and is used for the service conversion between the upper layer and the lower layer of the intelligent gateway as a starting inlet of the patent. The intelligent gateway controls operations such as starting, stopping and configuring of the patent and the like by calling Java functions, equipment is instantiated by configuration, equipment examples are built in, data reported by the lower layer is given to corresponding equipment examples, the data are reported to the intelligent gateway by converting the equipment examples into an object model mode, or a write model instruction issued by the intelligent gateway can be called to C++ codes in OPCLirary.
OPCLirary.dll is a JNA C library module called by an upper module OPCAccess.jar, and is used for instantiating a NET class library OPCClass.dll of C# through CLR support (C++/CLI project), instantiating OPC connection, maintaining the corresponding relation between a point location and equipment ID and the point location ID through two HashMaps (unorded_map), maintaining OPC disconnection reconnection, and executing and issuing correspondence with OPC read-write operation by a translation upper layer. And executing correct subscription through the configuration of the point table and the OPC scanning result.
OPCClass.dll is a class library of custom package of OPC DA and AE called by an upper-level module OPCLirary.dll, and is used for referring to a third-party library OPCAutation and OPCNeteApi, so that OPC interface calling is simplified.
The following will describe two ways of constructing the device example provided in the present embodiment.
First kind:
as an optional embodiment of the present application, optionally, when constructing an equipment instance, a method of constructing an equipment instance in an OPC equipment includes:
the intelligent gateway calls Java functions, loads and controls OPCACCess. Jar drivers;
an OPCACCess.jar driver receives the call of the intelligent gateway, instantiates OPC equipment according to the configuration information, and constructs an equipment instance in the corresponding OPC equipment;
and the data reported by the lower layer is given to the corresponding equipment instance, and the equipment object model information of the corresponding OPC equipment is reported to the intelligent gateway in a mode that the equipment instance is converted into an object model.
The specific method comprises the following steps: the intelligent gateway controls operations such as starting, stopping, configuring and the like of the patent by calling Java functions, builds equipment examples by configuring instantiation equipment, and reports data reported by a lower layer to corresponding equipment examples by converting the equipment examples into an object model.
Second kind:
as an optional embodiment of the present application, optionally, when constructing an equipment instance, a method of constructing an equipment instance in an OPC equipment includes:
the intelligent gateway issues a write model instruction, and loads and controls an OPCACCess. Jar driver;
the OPCACCess.jar driver receives a write model instruction issued by the intelligent gateway, calls an OPCLirary.dll module in a JNA calling mode, instantiates an OPC object, and constructs an equipment instance in corresponding OPC equipment;
and the data reported by the lower layer is given to the corresponding equipment instance, and the equipment object model information of the corresponding OPC equipment is reported to the intelligent gateway in a mode that the equipment instance is converted into an object model.
The specific method comprises the following steps: the write model instruction issued by the intelligent gateway will also be called by JNA to c++ code in opclirary.
As an optional embodiment of the present application, optionally, when the opclirary. Dll module instantiates an OPC object, further includes:
calling an OPCClass.dll module to provide a callable OPC interface for the OPCLirary.dll module through CLR support;
the OPCClass.dll module is a custom package class library of the OPC DA and the OPCAE called by the OPCLirary.dll module and is used for referencing an OPC interface of a third party library.
See in particular the functional principle description of the "OPC functional module" above.
3. OPC parameters are configured, an OPC server is connected according to the configuration, the connection state is checked, and a connection state result is obtained;
the system has a disconnection reconnection mechanism, and ensures that an OPC host is immediately restored after being restarted.
As an optional embodiment of the present application, optionally, checking the connection state to obtain a connection state result includes:
after the OPC server is connected, the connection state of the OPC server is checked, and whether the connection is successful or not is judged:
if the OPC server is not connected, waiting for a plurality of seconds, and connecting the OPC server again;
and if so, outputting a connection result.
In this embodiment, if no link is detected in the OPC server, the OPC server is connected again after waiting for 3 seconds, and the connection state is continuously checked.
And after the OPC server is normally connected, formally entering data acquisition work.
4. And reading and obtaining OPC point position data of the corresponding equipment object model according to the connection state result, and reporting the OPC point position data.
In the patent, the OPC data is acquired by adopting the point location subscription method, so that the change of the data and the triggering of the event can be acquired at the first time in the running process of the program, and the timeliness of the data is improved.
As an optional implementation manner of the present application, optionally, according to a connection state result, reading and obtaining OPC point data of a corresponding equipment object model, and reporting the OPC point data, including:
after the OPC server is connected, according to the mapping binding relation between object model information and OPC points of the OPC equipment, the OPC point data of the related OPC equipment are read in full quantity to equipment object model attributes;
the OPC equipment completes initial starting and reports corresponding OPC point position data in full quantity.
And in the early stage, the interaction association between the equipment object model and the OPC point positions is completed through mutual mapping. Therefore, according to the association relationship, the corresponding object model information (attribute and event) can be found by using the associated OPC DA point identification and OPC AE point identification. The user can freely configure the data to be concerned and the establishment of the mapping relation through the equipment parameter configuration and the OPC parameter configuration, and can adapt to different OPC using environments through the configuration, unnecessary data is filtered, and the data processing pressure is reduced.
As shown in fig. 4, the object model information acquisition method is performed for the OPC DA points and the OPC AE points.
When the OPC DA point position triggers the data change callback, the corresponding object model attribute is found through the OPC DA point position mark, and then the corresponding modified data is reported through the object model attribute; if not, the process is ended.
When an OPC AE point position triggers an event reporting callback, finding a corresponding object model event through an OPC AE point position mark, and reporting an OPC alarm or event through the object model event; if not, ending the current process.
As an optional implementation manner of the present application, optionally, when the OPC device reports corresponding OPC point location data, the method includes:
acquiring OPC point position data by adopting a point position subscription mode, and starting subscription delegation;
and sending the subscribed OPC point position data to a queue, and judging whether an issuing instruction exists in the issuing queue or not:
if yes, finding out an OPC DA point position identifier through the equipment object model attribute, and issuing an OPC Write operation according to the identifier; if the OPC DA point position identification is not found, checking whether the connection of the OPC server is normal or not;
if not, judging whether the exit is needed:
if yes, ending subscription commission, ending OPC connection, releasing equipment resources and releasing OPC examples;
otherwise, waiting for a plurality of seconds, and checking whether the connection of the OPC server is normal.
As shown in fig. 2, the acquired OPC point location data is sent in a message subscription manner. The OPC data is acquired by adopting the point location subscription method, so that the change of the data and the triggering of the event can be acquired at the first time in the running process of the program, and the timeliness of the data is improved.
The message subscription and message queue information issuing mode is a common information receiving and transmitting means and will not be described in detail here.
Therefore, the Java can call the OPC interface more directly by organically combining Java, C++, C# codes through JNA and CLR support; an OPC subscription mechanism is used instead of a point location polling mode, so that timeliness of point location data is optimized, and data delay is reduced; the traditional OPC project is enabled to be intelligent through an object model modeling mode. The method can provide support for big data access aiming at the previous generation of OPC technology of DCOM communication, so that the old project is renewed.
It should be apparent to those skilled in the art that the implementation of all or part of the above-described embodiments of the method may be implemented by a computer program for instructing relevant hardware, and the program may be stored in a computer readable storage medium, and the program may include the steps of the embodiments of the control methods described above when executed. It will be appreciated by those skilled in the art that implementing all or part of the above-described embodiment methods may be implemented by a computer program for instructing relevant hardware, and the program may be stored in a computer readable storage medium, and the program may include the embodiment flow of each control method as described above when executed. The storage medium may be a magnetic disk, an optical disc, a Read-only memory (ROM), a random access memory (RandomAccessMemory, RAM), a flash memory (flash memory), a hard disk (HDD), or a Solid State Drive (SSD); the storage medium may also comprise a combination of memories of the kind described above.
Example 2
Based on the implementation principle of embodiment 1, in another aspect, the present application further provides an apparatus for implementing the method for integrating and controlling OPC real-time data based on the internet of things model, where the method includes:
the initialization module is used for acquiring an instance structure and initializing an OPC connection object;
the equipment instance construction module is used for configuring equipment parameters, initializing equipment data and constructing equipment instances of corresponding equipment, and mapping the point position relation between equipment object model information and OPC according to configuration;
the OPC connection module is used for configuring OPC parameters, connecting an OPC server according to the configuration, checking the connection state and obtaining a connection state result;
and the OPC data reporting module is used for reading and obtaining OPC point position data of the corresponding equipment object model according to the connection state result and reporting the OPC point position data.
The functional principles and interaction schemes of the above modules are specifically referred to the description of embodiment 1, and are not repeated here.
The modules or steps of the invention described above may be implemented in a general-purpose computing device, they may be centralized in a single computing device, or distributed across a network of computing devices, or they may alternatively be implemented in program code executable by a computing device, such that they may be stored in a memory device and executed by a computing device, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
Example 3
Still further, another aspect of the present application further provides an OPC real-time data integration and control method control system based on an internet of things model, including:
a processor;
a memory for storing processor-executable instructions;
the processor is configured to implement the method for integrating and controlling OPC real-time data based on the Internet of things model when executing the executable instructions.
Embodiments of the present disclosure control a system that includes a processor and a memory for storing processor-executable instructions. The processor is configured to implement any of the OPC real-time data integration and control methods based on the internet of things model when executing the executable instructions.
Here, it should be noted that the number of processors may be one or more. Meanwhile, in the control system of the embodiment of the present disclosure, an input device and an output device may be further included. The processor, the memory, the input device, and the output device may be connected by a bus, or may be connected by other means, which is not specifically limited herein.
The memory is a computer-readable storage medium that can be used to store software programs, computer-executable programs, and various modules, such as: the embodiment of the disclosure relates to a program or a module corresponding to an OPC real-time data integration and control method based on an Internet of things model. The processor executes various functional applications and data processing of the control system by running software programs or modules stored in the memory.
The input device may be used to receive an input number or signal. Wherein the signal may be a key signal generated in connection with user settings of the device/terminal/server and function control. The output means may comprise a display device such as a display screen.
The foregoing description of the embodiments of the present disclosure has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the technical improvement of the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (10)

1. OPC real-time data integration and control method based on Internet of things model is characterized by comprising the following steps:
acquiring an instance structure and initializing an OPC connection object;
configuring equipment parameters, initializing equipment data, constructing equipment instances of corresponding equipment, and mapping the point position relation between equipment object model information and OPC according to configuration;
OPC parameters are configured, an OPC server is connected according to the configuration, the connection state is checked, and a connection state result is obtained;
and reading and obtaining OPC point position data of the corresponding equipment object model according to the connection state result, and reporting the OPC point position data.
2. The method for integrating and controlling OPC real-time data based on the internet of things model according to claim 1, wherein configuring the device parameters, initializing the device data and constructing the device instance of the corresponding device, mapping the point location relationship between the device object model information and OPC according to the configuration, comprises:
determining OPC equipment and initializing OPC equipment data;
constructing an equipment instance in the corresponding OPC equipment according to the configured equipment parameters;
through equipment management, mapping is carried out between object model information of the OPC equipment and OPC points, and binding of equipment object model attribute and OPC DA points and binding of equipment object model event and OPC AE points are completed;
after the point location binding is completed, the equipment object model information corresponding to the OPC equipment is reported to the intelligent gateway in a mode that the equipment instance is converted into an object model.
3. The method for integrating and controlling OPC real-time data based on the internet of things model according to claim 2, wherein when constructing the device instance, the method for constructing the device instance in the OPC device comprises the following steps:
the intelligent gateway calls Java functions, loads and controls OPCACCess. Jar drivers;
an OPCACCess.jar driver receives the call of the intelligent gateway, instantiates OPC equipment according to the configuration information, and constructs an equipment instance in the corresponding OPC equipment;
and the data reported by the lower layer is given to the corresponding equipment instance, and the equipment object model information of the corresponding OPC equipment is reported to the intelligent gateway in a mode that the equipment instance is converted into an object model.
4. The method for integrating and controlling OPC real-time data based on the internet of things model according to claim 2, wherein when constructing the device instance, the method for constructing the device instance in the OPC device comprises the following steps:
the intelligent gateway issues a write model instruction, and loads and controls an OPCACCess. Jar driver;
the OPCACCess.jar driver receives a write model instruction issued by the intelligent gateway, calls an OPCLirary.dll module in a JNA calling mode, instantiates an OPC object, and constructs an equipment instance in corresponding OPC equipment;
and the data reported by the lower layer is given to the corresponding equipment instance, and the equipment object model information of the corresponding OPC equipment is reported to the intelligent gateway in a mode that the equipment instance is converted into an object model.
5. The method for integrating and controlling OPC real-time data based on the internet of things model according to claim 4, further comprising, when the opclirary.
Calling an OPCClass.dll module to provide a callable OPC interface for the OPCLirary.dll module through CLR support;
the OPCClass.dll module is a custom package class library of the OPC DA and the OPCAE called by the OPCLirary.dll module and is used for referencing an OPC interface of a third party library.
6. The method for integrating and controlling OPC real-time data based on the internet of things model according to claim 1, wherein checking the connection state to obtain the connection state result comprises:
after the OPC server is connected, the connection state of the OPC server is checked, and whether the connection is successful or not is judged:
if the OPC server is not connected, waiting for a plurality of seconds, and connecting the OPC server again;
and if so, outputting a connection result.
7. The method for integrating and controlling OPC real-time data based on the internet of things model according to claim 6, wherein reading and obtaining OPC point location data of a corresponding equipment object model according to a connection state result, and reporting the OPC point location data, comprises:
after the OPC server is connected, according to the mapping binding relation between object model information and OPC points of the OPC equipment, the OPC point data of the related OPC equipment are read in full quantity to equipment object model attributes;
the OPC equipment completes initial starting and reports corresponding OPC point position data in full quantity.
8. The method for integrating and controlling OPC real-time data based on the internet of things model according to claim 7, wherein when the OPC device reports the corresponding OPC point location data, the method comprises:
acquiring OPC point position data by adopting a point position subscription mode, and starting subscription delegation;
and sending the subscribed OPC point position data to a queue, and judging whether an issuing instruction exists in the issuing queue or not:
if yes, finding out an OPC DA point position identifier through the equipment object model attribute, and issuing an OPC Write operation according to the identifier; if the OPC DA point position identification is not found, checking whether the connection of the OPC server is normal or not;
if not, judging whether the exit is needed:
if yes, ending subscription commission, ending OPC connection, releasing equipment resources and releasing OPC examples;
otherwise, waiting for a plurality of seconds, and checking whether the connection of the OPC server is normal.
9. The device for implementing the OPC real-time data integration and control method based on the internet of things model according to any one of claims 1 to 8, which is characterized by comprising:
the initialization module is used for acquiring an instance structure and initializing an OPC connection object;
the equipment instance construction module is used for configuring equipment parameters, initializing equipment data and constructing equipment instances of corresponding equipment, and mapping the point position relation between equipment object model information and OPC according to configuration;
the OPC connection module is used for configuring OPC parameters, connecting an OPC server according to the configuration, checking the connection state and obtaining a connection state result;
and the OPC data reporting module is used for reading and obtaining OPC point position data of the corresponding equipment object model according to the connection state result and reporting the OPC point position data.
10. A control system, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the OPC real-time data integration and control method based on the internet of things model of any one of claims 1 to 8 when executing the executable instructions.
CN202310175231.5A 2023-02-28 2023-02-28 OPC real-time data integration and control method based on Internet of things model Pending CN116436794A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310175231.5A CN116436794A (en) 2023-02-28 2023-02-28 OPC real-time data integration and control method based on Internet of things model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310175231.5A CN116436794A (en) 2023-02-28 2023-02-28 OPC real-time data integration and control method based on Internet of things model

Publications (1)

Publication Number Publication Date
CN116436794A true CN116436794A (en) 2023-07-14

Family

ID=87082207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310175231.5A Pending CN116436794A (en) 2023-02-28 2023-02-28 OPC real-time data integration and control method based on Internet of things model

Country Status (1)

Country Link
CN (1) CN116436794A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118075115A (en) * 2024-04-19 2024-05-24 深圳奇迹智慧网络有限公司 Mounting method of Internet of things equipment, mounting device of Internet of things equipment and medium
CN118175045A (en) * 2024-05-14 2024-06-11 杭州逸琨科技有限公司 Internet of things object model determining method and device and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118075115A (en) * 2024-04-19 2024-05-24 深圳奇迹智慧网络有限公司 Mounting method of Internet of things equipment, mounting device of Internet of things equipment and medium
CN118175045A (en) * 2024-05-14 2024-06-11 杭州逸琨科技有限公司 Internet of things object model determining method and device and electronic equipment
CN118175045B (en) * 2024-05-14 2024-08-09 杭州逸琨科技有限公司 Internet of things object model determining method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN110413288B (en) Application deployment method, device, server and storage medium
CN116436794A (en) OPC real-time data integration and control method based on Internet of things model
US20150100829A1 (en) Method and system for selecting and executing test scripts
US20150100832A1 (en) Method and system for selecting and executing test scripts
EP0845742A2 (en) Methods and systems for booting a computer in a distributed computing system
US8510712B1 (en) Testing in-container software objects
CN102792270A (en) BIOS parameter virtualization via BIOS configuration profiles
JP2021500686A (en) Code module selection for device design
CN105144093A (en) Workload deployment with infrastructure management agent provisioning
US20150100831A1 (en) Method and system for selecting and executing test scripts
CN113505073B (en) Performance test method, device, equipment and medium of database
CN110659198A (en) Application program test case execution method and device and software test system
CN110013672A (en) Method, unit and the computer readable storage medium of the automatic test of game for machine operation
CN111752581A (en) Distributed system upgrading method and device and computer system
CN113268275B (en) Hardware equipment driving system based on microkernel and driving method thereof
US20220300262A1 (en) Method for constructing, running and implementing cross-platform application, terminal, server and system
CN111782251B (en) Method and device for updating software function module and computer equipment
CN113656001A (en) Platform component development method and device, computer equipment and storage medium
CN110806891B (en) Method and device for generating software version of embedded device
CN112732677A (en) Block link point deployment method, device, equipment and storage medium
US9250885B2 (en) Image forming apparatus operating based on framework capable of sharing function among a plurality of bundles and method of installing bundle in image forming apparatus
CN117041111A (en) Vehicle cloud function test method and device, electronic equipment and storage medium
CN115437647A (en) Multi-frame-adaptive micro-service deployment method, device, terminal and storage medium
CN114925516A (en) Method and device for automatic modeling and simulation
CN115480771A (en) Method for deploying algorithms and related device

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