Op c real-time data integration and control method based on internet of things thing model
Patent Information
- Application Number
- CN202310175231.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2043-02-28
AI Technical Summary
但目前现有项目中大多会涉及到老项目进行智能化升级,替换基础设备成本投入将会非常巨大,因此有必要进行技术升级改造
[0053]本申请通过采集实例构造,初始化OPC连接对象;配置设备参数,初始化设备数据并构造对应设备的设备实例,根据配置映射设备物模型信息与OPC的点位关系;配置OPC参数,根据配置连接OPC服务器,并检查连接状态,获得连接状态结果;根据连接状态结果,读取并获得对应设备物模型的OPC点位数据,并上报OPC点位数据。为指令集物联网操作系统(ISysCore OS)提供OPC DA(OPC数据访问)以及OPC AE(OPC报警和事件)数据接入和控制能力。以ISysCore OS物模型为基准,解耦南向业务代码和北向集成。依托于OPC自身的设备接入能力,快速对接已经被OPC集成的设备。
Smart Images

Figure CN116436794B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of Internet of Things (IoT) control technology, and in particular to OPC real-time data integration and control methods and device control systems based on IoT object models. Background Technology
[0002] With the advancement of Industry 4.0, the Internet of Things, and big data, more and more factories are embarking on their intelligent transformation. Most factories utilize OPC technology for automation when building their production lines.
[0003] OPC, or OLE for Process Control, is an industry standard based on Microsoft's OLE, COM, and DCOM technologies. With the rapid development of automation systems in the 1990s, various automation manufacturers developed different standard automation software to access automation data from devices. This process utilized numerous different bus systems, protocols, and interfaces. To eliminate interoperability barriers between automation software and hardware platforms, the OPC Foundation proposed the OPC standard, establishing a complete set of open interfaces, attributes, and methods for communication between devices from different manufacturers. Based on the different needs of industrial applications, the OPC Foundation mainly formulated three OPC specifications: OPC DA (Data Access), OPC AE (Alarms and Events), and OPC HDA (Historical Data Access). Later, because OPC DA was more commonly used in practical applications, OPC is generally referred to as OPC DA when using OPC.
[0004] While OPC solves the problem of cross-vendor platform communication for devices, it relies on Windows' COM / DCOM technology, making it unusable on Linux or other systems. Furthermore, in practical applications, complex DCOM configurations are required for both the OPC client and server.
[0005] To address the aforementioned issues, the OPC Foundation developed a new generation of OPC technology—OPCUCA (OPC Unified Architecture)—based on OPC, enabling communication between devices using different systems and protocols. It eliminates the strong dependency on Windows systems, allowing clients and servers to run on systems other than Windows. However, the new generation of OPCUCA is incompatible with the previous generation of OPC technology—OPC Classic. This incompatibility prevents components developed using the new OPCUCA from accessing the OPC Classic system.
[0006] Currently, most OPC data integration solutions on the market only support OPCUA, while OPCDA and OPCAE are not supported. However, many existing projects involve upgrading older projects to be more intelligent, and replacing basic equipment would be extremely costly, thus making technological upgrades necessary. Summary of the Invention
[0007] To address the aforementioned issues, this application proposes an OPC real-time data integration and control method and a device control system based on an Internet of Things (IoT) object model.
[0008] This application proposes a real-time data integration and control method for OPC based on an Internet of Things (IoT) object model, comprising the following steps:
[0009] Collect instance construction and initialize OPC connection object;
[0010] Configure device parameters, initialize device data and construct device instances for the corresponding devices, and map the device object model information and the point relationship of OPC according to the configuration;
[0011] Configure OPC parameters, connect to the OPC server according to the configuration, check the connection status, and obtain the connection status result;
[0012] Based on the connection status results, read and obtain the OPC point data of the corresponding device object model, and report the OPC point data.
[0013] As an optional implementation of this application, optionally, the following steps are taken: configuring device parameters, initializing device data and constructing a device instance corresponding to the device; mapping the device object model information and the point relationship of OPC according to the configuration, including:
[0014] Identify the OPC device and initialize the OPC device data.
[0015] Based on the configured device parameters, construct a device instance in the corresponding OPC device;
[0016] Through device management, a mapping is performed between the object model information of OPC devices and OPC points, completing the binding of device object model attributes with OPC DA points and the binding of device object model events with OPC AE points;
[0017] After the point binding is completed, the device object model information of the corresponding OPC device is reported to the smart gateway by converting the device instance into an object model.
[0018] As an optional implementation of this application, the method for constructing a device instance in an OPC device may include:
[0019] The smart gateway calls Java functions to load and control the OPCAccess.jar driver;
[0020] The OPCAccess.jar driver receives calls from the smart gateway, instantiates the OPC device according to the configuration information, and constructs a device instance in the corresponding OPC device.
[0021] The data reported from the lower layer is given to the corresponding device instance, and the device object model information of the corresponding OPC device is reported to the smart gateway by converting the device instance into an object model.
[0022] As an optional implementation of this application, the method for constructing a device instance in an OPC device may include:
[0023] The smart gateway issues instructions for writing object models, loads and controls the OPCAccess.jar driver;
[0024] The OPCAccess.jar driver receives writing instructions for the object model from the smart gateway, and calls the OPCLirary.dll module via JNA to instantiate the OPC object and construct a device instance in the corresponding OPC device.
[0025] The data reported from the lower layer is given to the corresponding device instance, and the device object model information of the corresponding OPC device is reported to the smart gateway by converting the device instance into an object model.
[0026] As an optional implementation of this application, optionally, when the OPCLirary.dll module instantiates the OPC object, it also includes:
[0027] With CLR support, the OPCClass.dll module provides a callable OPC interface for the OPCLirary.dll module;
[0028] The OPCClass.dll module is a custom wrapper library for OPC DA and OPCAE that is called by the OPCLirary.dll module and is used to reference the OPC interface of third-party libraries.
[0029] As an optional implementation of this application, optionally, checking the connection status and obtaining the connection status result includes:
[0030] After connecting to the OPC server, check the connection status of the OPC server to determine if the connection was successful:
[0031] If the connection fails, wait a few seconds and try connecting to the OPC server again.
[0032] If the connection is already established, output the connection result.
[0033] As an optional implementation of this application, optionally, based on the connection status result, the OPC point data of the corresponding device object model is read and obtained, and the OPC point data is reported, including:
[0034] After connecting to the OPC server, based on the mapping and binding relationship between the OPC device's object model information and the OPC point, the OPC point data of the relevant OPC device is fully read into the device object model attributes.
[0035] The OPC device completes its initial startup and reports all corresponding OPC location data.
[0036] As an optional implementation of this application, optionally, when the OPC device reports the corresponding OPC location data, it includes:
[0037] OPC point data is obtained using a point subscription method; the subscription delegate is then initiated.
[0038] Send the subscribed OPC point data to the queue, and check if there is a send command in the queue:
[0039] If yes, then find the OPC DA point identifier through the device object model attributes and issue an OPC Write operation based on the identifier; if the OPC DA point identifier is not found, then check whether the OPC server connection is normal.
[0040] No, then determine whether to exit:
[0041] If so, the subscription delegate will be terminated, the OPC connection will be terminated, device resources will be released, and the OPC instance will be released.
[0042] Otherwise, wait a few seconds and check if the OPC server connection is normal.
[0043] In another aspect, this application also proposes an apparatus for implementing the aforementioned OPC real-time data integration and control method based on an Internet of Things (IoT) object model, comprising:
[0044] The initialization module is used to construct the collection instance and initialize the OPC connection object;
[0045] The device instance construction module is used to configure device parameters, initialize device data and construct device instances for the corresponding devices, and map the device object model information and the point relationship of OPC according to the configuration.
[0046] The OPC connection module is used to configure OPC parameters, connect to the OPC server according to the configuration, check the connection status, and obtain the connection status result.
[0047] The OPC data reporting module is used to read and obtain the OPC point data of the corresponding device object model based on the connection status result, and report the OPC point data.
[0048] In another aspect, this application also proposes a control system based on an IoT object model for OPC real-time data integration and control, including:
[0049] processor;
[0050] Memory used to store processor-executable instructions;
[0051] The processor is configured to implement the OPC real-time data integration and control method based on the Internet of Things (IoT) object model when executing the executable instructions.
[0052] Technical effects of the present invention:
[0053] This application constructs and initializes OPC connection objects through data collection instances; configures device parameters, initializes device data, and constructs device instances corresponding to the devices; maps the device object model information to the OPC point relationships according to the configuration; configures OPC parameters, connects to the OPC server according to the configuration, checks the connection status, and obtains the connection status results; based on the connection status results, reads and obtains the OPC point data of the corresponding device object model, and reports the OPC point data. It provides OPC DA (OPC Data Access) and OPC AE (OPC Alarm and Event) data access and control capabilities for the instruction set IoT operating system (ISysCore OS). Based on the ISysCore OS object model, it decouples southbound business code and northbound integration. Relying on OPC's own device access capabilities, it quickly connects to devices already integrated with OPC.
[0054] This solution leverages JNA and CLR support, organically integrating Java, C++, and C# code to enable Java to directly call OPC interfaces. It optimizes the timeliness of point data and reduces data latency by using an OPC subscription mechanism instead of polling point locations. Furthermore, it empowers traditional OPC projects with intelligent features through object modeling. It also provides support for big data access to the previous generation of OPC technology for DCOM communication, revitalizing older projects.
[0055] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0056] The accompanying drawings, which are included in and form part of this specification, illustrate exemplary embodiments, features, and aspects of this disclosure together with the specification and serve to explain the principles of this disclosure.
[0057] Figure 1The diagram shown is a schematic representation of the IoT framework application of the present invention.
[0058] Figure 2 The diagram shown is a flowchart illustrating the application of the method of the present invention.
[0059] Figure 3 The diagram shown is a functional structure diagram of the OPC functional module of the present invention;
[0060] Figure 4 The diagram shows the callback process of OPC DA and OPC AE in this invention. Detailed Implementation
[0061] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0062] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0063] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.
[0064] This invention provides OPCDA (Optical Programming Interface) and OPCAE (Optical Programming Interface) data access and control capabilities for the instruction set IoT operating system (ISysCoreOS). Based on the ISysCoreOS object model, it decouples southbound business code from northbound integration. Leveraging OPC's inherent device access capabilities, it enables rapid connection to devices already integrated with OPC.
[0065] like Figure 1 The IoT framework shown in this solution relies on Windows DCOM components, requiring the smart gateway to be deployed on a Windows system (the smart gateway communicates with the IoT platform via MQTT, but the IoT platform is not subject to this restriction). Since the smart gateway depends on DCOM components, its security relies entirely on the Windows system itself; therefore, deployment on an intranet is recommended.
[0066] In such Figure 1In the IoT framework shown, this solution primarily deploys an OPC function module within the smart gateway. This OPC module, integrated into the smart gateway, is specifically responsible for communicating with devices compatible with the OPC protocol, and data is transmitted to the ISysCore OS in the form of object models.
[0067] The working principle is as follows:
[0068] Users can upload modules to the driver library through the ISysCore OS driver upload function. Through device management / configuration in ISysCoreOS, they can bind device object model attributes to OPC DA points and device object model events to OPC AE points. Then, through the ISysCore smart gateway driver distribution function, the module is distributed to the local smart gateway. The smart gateway loads and starts the module. When it starts, the module will inherit the device object model information (attributes and events) and point binding relationships. Through mutual mapping, the interaction and association between the object model and OPC points are completed.
[0069] Leveraging device integration services and other module services of ISysCore OS, various application scenarios and project sites can be created, such as:
[0070] 1. By combining device integration with a rule engine, it is possible to achieve automatic control of OPC devices or linkage with other protocol devices;
[0071] 2. Through the equipment integration and data processing and analysis module, the analysis of OPC equipment operation data can be completed;
[0072] 3. Through ISysCore OS's various northbound application interfaces, a variety of applications supporting device monitoring and control can be completed;
[0073] 4. Through the storage capabilities of ISysCore OS, it can provide the ability to trace the operating status of devices.
[0074] The following section describes in detail the method for integrating and controlling OPC real-time data using this IoT system.
[0075] Example 1
[0076] like Figure 2 As shown, this application proposes a real-time data integration and control method for OPC based on an Internet of Things (IoT) object model, including the following steps:
[0077] 1. Collect instance construction and initialize OPC connection object;
[0078] When starting OPC data collection from IoT devices, the first step is to determine the OPC connection objects based on the business scenario. After determining the collection targets, the target OPC devices need to be initialized, and driver instances need to be constructed in these OPC connection objects to report device information when the driver instances are running. Therefore, the first step is to initialize the OPC devices and start the instance collection.
[0079] 2. Configure device parameters, initialize device data and construct device instances corresponding to the devices, and map the device object model information and the point relationship of OPC according to the configuration;
[0080] After the OPC devices are initialized, a device instance is constructed for each (or a custom-defined) OPC device. This is achieved by configuring parameters on the OPC devices, allowing them to obtain the data for constructing the instance. Then, the object model attributes and events of the OPC devices are mapped to the OPC point identifiers according to the configuration.
[0081] As an optional implementation of this application, optionally, the following steps are taken: configuring device parameters, initializing device data and constructing a device instance corresponding to the device; mapping the device object model information and the point relationship of OPC according to the configuration, including:
[0082] Identify the OPC device and initialize the OPC device data.
[0083] Based on the configured device parameters, construct a device instance in the corresponding OPC device;
[0084] Through device management, a mapping is performed between the object model information of OPC devices and OPC points, completing the binding of device object model attributes with OPC DA points and the binding of device object model events with OPC AE points;
[0085] After the point binding is completed, the device object model information of the corresponding OPC device is reported to the smart gateway by converting the device instance into an object model.
[0086] Specifically, through device management / configuration in ISysCore OS, device object model attributes are bound to OPC DA points, and device object model events are bound to OPC AE points. After the OPC device object model attributes are bound to OPC DA points, they have an OPC DA point identifier; the corresponding OPC AE points, after binding, have an OPC AE point identifier. The smart gateway loads the startup module, which inherits the device object model information (attributes and events) and point binding relationships upon startup. Through mutual mapping, the interaction and association between the object model and OPC points are completed. In this way, when subsequently obtaining and reporting the object model information of OPC devices, the device object model information can be obtained from the OPC point data through the mapping relationship.
[0087] The key lies in the construction of device instances and the method of converting device instances into object models. This embodiment provides the following two methods for constructing device instances.
[0088] This patent uses a multi-language hybrid compilation. In the OPC automation field, C# has a complete ecosystem, especially in Windows COM, where its user-friendliness surpasses any other language. Currently, almost all OPC Classic-related projects are built around the C# technology stack.
[0089] like Figure 3 The diagram shown illustrates the composition of the OPC functional module of this application. The OPC functional module includes:
[0090] OPCAccess.jar is the driver package loaded by the Java process of the smart gateway. It is used for business conversion between the upper and lower layers of the smart gateway and serves as the startup entry point for this patent. The smart gateway controls the start, stop, and configuration operations of this patent by calling Java functions. It also instantiates devices through configuration, builds device instances internally, and sends data reported from the lower layer to the corresponding device instance. The device instance is then converted into an object model and reported to the smart gateway. Alternatively, the write object model instructions issued by the smart gateway will also call the C++ code in OPCLirary.dll through JNA.
[0091] OPCLirary.dll is a JNA C library module called by its parent module OPCAccess.jar. It instantiates the C# .NET class library OPCClass.dll via CLR support (in C++ / CLI projects), instantiates OPC connections, maintains the mapping between points and device IDs and point IDs using two unordered HashMaps, maintains OPC reconnection records, and translates the mapping between upper-layer execution and OPC read / write operations. Based on the point table configuration and OPC scan results, it executes the correct subscription.
[0092] OPCClass.dll is a custom-encapsulated class library for OPC DA and AE that is called by the parent module OPCLirary.dll. It is used to reference the third-party libraries OPCAutomation and OPCNetApi to simplify OPC interface calls.
[0093] The following will describe two ways of constructing device examples provided in this embodiment.
[0094] The first type:
[0095] As an optional implementation of this application, the method for constructing a device instance in an OPC device may include:
[0096] The smart gateway calls Java functions to load and control the OPCAccess.jar driver;
[0097] The OPCAccess.jar driver receives calls from the smart gateway, instantiates the OPC device according to the configuration information, and constructs a device instance in the corresponding OPC device.
[0098] The data reported from the lower layer is given to the corresponding device instance, and the device object model information of the corresponding OPC device is reported to the smart gateway by converting the device instance into an object model.
[0099] The specific approach is as follows: the smart gateway controls the start, stop, and configuration operations of this patent by calling Java functions, and instantiates the device through configuration, builds a device instance internally, and the data reported by the lower layer is given to the corresponding device instance, which is then converted into a physical model and reported to the smart gateway.
[0100] The second type:
[0101] As an optional implementation of this application, the method for constructing a device instance in an OPC device may include:
[0102] The smart gateway issues instructions for writing object models, loads and controls the OPCAccess.jar driver;
[0103] The OPCAccess.jar driver receives writing instructions for the object model from the smart gateway, and calls the OPCLirary.dll module via JNA to instantiate the OPC object and construct a device instance in the corresponding OPC device.
[0104] The data reported from the lower layer is given to the corresponding device instance, and the device object model information of the corresponding OPC device is reported to the smart gateway by converting the device instance into an object model.
[0105] Specifically, the writing model instructions issued by the smart gateway will also call the C++ code in OPCLirary.dll through JNA.
[0106] As an optional implementation of this application, optionally, when the OPCLirary.dll module instantiates the OPC object, it also includes:
[0107] With CLR support, the OPCClass.dll module provides a callable OPC interface for the OPCLirary.dll module;
[0108] The OPCClass.dll module is a custom wrapper library for OPC DA and OPCAE that is called by the OPCLirary.dll module and is used to reference the OPC interface of third-party libraries.
[0109] See the above description of the functional principles of the "OPC Functional Module" for details.
[0110] 3. Configure OPC parameters, connect to the OPC server according to the configuration, check the connection status, and obtain the connection status result;
[0111] This patent includes a disconnection reconnection mechanism to ensure immediate recovery after the OPC host crashes and restarts.
[0112] As an optional implementation of this application, optionally, checking the connection status and obtaining the connection status result includes:
[0113] After connecting to the OPC server, check the connection status of the OPC server to determine if the connection was successful:
[0114] If the connection fails, wait a few seconds and try connecting to the OPC server again.
[0115] If the connection is already established, output the connection result.
[0116] In this embodiment, if no connection to the OPC server is detected, wait 3 seconds and then reconnect to the OPC server to continue checking the connection status.
[0117] Once the OPC server connection is established, the data collection process can begin.
[0118] 4. Based on the connection status results, read and obtain the OPC point data of the corresponding device object model, and report the OPC point data.
[0119] This patent uses a point-to-point subscription method to obtain OPC data, ensuring that data changes and event triggers can be obtained as soon as the program runs, thus improving the timeliness of the data.
[0120] As an optional implementation of this application, optionally, based on the connection status result, the OPC point data of the corresponding device object model is read and obtained, and the OPC point data is reported, including:
[0121] After connecting to the OPC server, based on the mapping and binding relationship between the OPC device's object model information and the OPC point, the OPC point data of the relevant OPC device is fully read into the device object model attributes.
[0122] The OPC device completes its initial startup and reports all corresponding OPC location data.
[0123] In the initial stage, mutual mapping was used to establish the interactive association between the device object model and OPC points. Therefore, based on the association, the corresponding object model information (attributes and events) can be found using the associated OPC DA point identifier and OPC AE point identifier. Users can freely configure the data they need and the mapping relationships established through device parameter configuration and OPC parameter configuration. This configuration adapts to different OPC usage environments and filters out unnecessary data, reducing data processing pressure.
[0124] like Figure 4 As shown, this illustrates the method for obtaining the object model information corresponding to the OPC DA and OPC AE points.
[0125] When an OPC DA point triggers a data change callback, the corresponding object model attribute is found through the OPC DA point identifier, and then the corresponding modified data is reported through the object model attribute; if it is not found, the process ends.
[0126] When the OPC AE point triggers an event reporting callback, the corresponding object model event is found through the OPC AE point identifier, and then an OPC alarm or event is reported through the object model event; if not found, the current process ends.
[0127] As an optional implementation of this application, optionally, when the OPC device reports the corresponding OPC location data, it includes:
[0128] OPC point data is obtained using a point subscription method; the subscription delegate is then initiated.
[0129] Send the subscribed OPC point data to the queue, and check if there is a send command in the queue:
[0130] If yes, then find the OPC DA point identifier through the device object model attributes and issue an OPC Write operation based on the identifier; if the OPC DA point identifier is not found, then check whether the OPC server connection is normal.
[0131] No, then determine whether to exit:
[0132] If so, the subscription delegate will be terminated, the OPC connection will be terminated, device resources will be released, and the OPC instance will be released.
[0133] Otherwise, wait a few seconds and check if the OPC server connection is normal.
[0134] like Figure 2 As shown, the acquired OPC point data is transmitted via message subscription. Using point subscription to acquire OPC data ensures that the program can receive data changes and event triggers in real time during operation, improving data timeliness.
[0135] Message subscription and message queue message delivery are common methods for sending and receiving information, and will not be elaborated on here.
[0136] Therefore, this application, through JNA and CLR support, organically combines Java, C++, and C# code, enabling Java to more directly call OPC interfaces; it uses an OPC subscription mechanism, rather than polling points, to optimize the timeliness of point data and reduce data latency; and it empowers traditional OPC projects with intelligent features through object modeling. It can provide big data access support for the previous generation of OPC technology using DCOM communication, giving old projects new vitality.
[0137] Obviously, those skilled in the art should understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the control methods described above. Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the control methods described above. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.
[0138] Example 2
[0139] Based on the implementation principle of Embodiment 1, this application also proposes an apparatus for implementing the aforementioned OPC real-time data integration and control method based on an Internet of Things (IoT) object model, comprising:
[0140] The initialization module is used to construct the collection instance and initialize the OPC connection object;
[0141] The device instance construction module is used to configure device parameters, initialize device data and construct device instances for the corresponding devices, and map the device object model information and the point relationship of OPC according to the configuration.
[0142] The OPC connection module is used to configure OPC parameters, connect to the OPC server according to the configuration, check the connection status, and obtain the connection status result.
[0143] The OPC data reporting module is used to read and obtain the OPC point data of the corresponding device object model based on the connection status result, and report the OPC point data.
[0144] For details on the functional principles and interaction schemes of the above modules, please refer to the description in Example 1, which will not be repeated here.
[0145] The modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device, or fabricating them separately as individual integrated circuit modules, or fabricating multiple modules or steps into a single integrated circuit module. Thus, the present invention is not limited to any particular hardware and software combination.
[0146] Example 3
[0147] Furthermore, this application also proposes a control system based on an IoT object model for OPC real-time data integration and control, comprising:
[0148] processor;
[0149] Memory used to store processor-executable instructions;
[0150] The processor is configured to implement the OPC real-time data integration and control method based on the Internet of Things (IoT) object model when executing the executable instructions.
[0151] This disclosure discloses an embodiment of a system including a processor and a memory for storing processor-executable instructions. The processor is configured to implement any of the preceding IoT-based OPC real-time data integration and control methods when executing the executable instructions.
[0152] It should be noted here that the number of processors can be one or more. Furthermore, the control system in this embodiment may also include input devices and output devices. The processors, memory, input devices, and output devices can be connected via a bus or other means, without specific limitations herein.
[0153] As a computer-readable storage medium, the memory can be used to store software programs, computer-executable programs, and various modules, such as the program or module corresponding to the OPC real-time data integration and control method based on the Internet of Things (IoT) object model in this disclosure. The processor executes various functional applications and data processing of the control system by running the software program or module stored in the memory.
[0154] Input devices can be used to receive input digital numbers or signals. These signals can be key signals related to user settings and function control of the device / terminal / server. Output devices can include display devices such as screens.
[0155] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for real-time OPC data integration and control based on an Internet of Things (IoT) object model, characterized in that, Includes the following steps: The data collection instance is constructed and the OPC connection object is initialized, including: the smart gateway loads the OPCAccess.jar driver package as the upper-layer Java entry point, calls the OPCLirary.dll C++ module through JNA, OPCLirary.dll calls the OPCClass.dll encapsulation library through C++ / CLI, and OPCClass.dll encapsulates the OPC DA and OPC AE third-party COM interfaces. The three-layer hybrid link maintains the point mapping relationship and the OPC instance lifecycle in a hierarchical manner. Configure device parameters, initialize device data, and construct device instances for the corresponding devices. Map the device object model information and OPC point relationships according to the configuration, including: determining OPC devices and initializing OPC device data; constructing device instances in the corresponding OPC devices according to the configured device parameters; mapping the object model information of OPC devices to OPC points through device management, completing the binding of device object model attributes to OPC DA points and device object model events to OPC AE points; after completing the point binding, reporting the device object model information of the corresponding OPC devices to the smart gateway by converting device instances into object models. Configure OPC parameters, connect to the OPC server according to the configuration, check the connection status, and obtain the connection status result; Based on the connection status results, read and obtain the OPC point data of the corresponding device object model, and report the OPC point data, including: OPC point data is obtained using a point subscription method; the subscription delegate is then initiated. Send the subscribed OPC point data to the queue, and check if there is a send command in the queue: If yes, then find the OPC DA point identifier through the device object model attributes and issue an OPC Write operation based on the identifier; if the OPC DA point identifier is not found, then check whether the OPC server connection is normal. No, then determine whether to exit: If so, the subscription delegate will be terminated, the OPC connection will be terminated, device resources will be released, and the OPC instance will be released. Otherwise, wait a few seconds and check if the OPC server connection is normal.
2. The OPC real-time data integration and control method based on the Internet of Things (IoT) object model according to claim 1, characterized in that, When constructing a device instance, the methods for constructing a device instance in an OPC device include: The smart gateway calls Java functions to load and control the OPCAccess.jar driver; The OPCAccess.jar driver receives calls from the smart gateway, instantiates the OPC device according to the configuration information, and constructs a device instance in the corresponding OPC device. The data reported from the lower layer is given to the corresponding device instance, and the device object model information of the corresponding OPC device is reported to the smart gateway by converting the device instance into an object model.
3. The OPC real-time data integration and control method based on the Internet of Things (IoT) object model according to claim 1, characterized in that, When constructing a device instance, the methods for constructing a device instance in an OPC device include: The smart gateway issues instructions for writing object models, loads and controls the OPCAccess.jar driver; The OPCAccess.jar driver receives writing instructions for the object model from the smart gateway, and calls the OPCLirary.dll module via JNA to instantiate the OPC object and construct a device instance in the corresponding OPC device. The data reported from the lower layer is given to the corresponding device instance, and the device object model information of the corresponding OPC device is reported to the smart gateway by converting the device instance into an object model.
4. The OPC real-time data integration and control method based on the Internet of Things (IoT) object model according to claim 3, characterized in that, When the OPCLirary.dll module instantiates an OPC object, it also includes: With CLR support, the OPCClass.dll module provides a callable OPC interface for the OPCLirary.dll module; The OPCClass.dll module is a custom wrapper library for OPC DA and OPCAE that is called by the OPCLirary.dll module and is used to reference the OPC interface of third-party libraries.
5. The OPC real-time data integration and control method based on the Internet of Things (IoT) object model according to claim 1, characterized in that, Check the connection status and obtain the connection status results, including: After connecting to the OPC server, check the connection status of the OPC server to determine if the connection was successful: If the connection fails, wait a few seconds and try connecting to the OPC server again. If the connection is already established, output the connection result.
6. The OPC real-time data integration and control method based on the Internet of Things (IoT) object model according to claim 5, characterized in that, Based on the connection status results, read and obtain the OPC point data of the corresponding device object model, and report the OPC point data, including: After connecting to the OPC server, based on the mapping and binding relationship between the OPC device's object model information and the OPC point, the OPC point data of the relevant OPC device is fully read into the device object model attributes. The OPC device completes its initial startup and reports all corresponding OPC location data.
7. An apparatus for implementing the OPC real-time data integration and control method based on an Internet of Things (IoT) object model as described in any one of claims 1-6, characterized in that, include: The initialization module is used to construct the collection instance and initialize the OPC connection object; The device instance construction module is used to configure device parameters, initialize device data, construct device instances for the corresponding devices, and map the device object model information and the point relationship of OPC according to the configuration. The OPC connection module is used to configure OPC parameters, connect to the OPC server according to the configuration, check the connection status, and obtain the connection status result. The OPC data reporting module is used to read and obtain the OPC point data of the corresponding device object model based on the connection status result, and report the OPC point data.
8. A control system, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to implement the OPC real-time data integration and control method based on the Internet of Things object model as described in any one of claims 1 to 6 when executing the executable instructions.
Citation Information
Patent Citations
Manufacturing equipment-oriented digital twinborn model construction method
CN113656904A
Information modeling method for industrial robot manufacturing system
CN115309942A