Virtual-real workshop synchronous operation method and system based on OPC UA
Through OPC UA technology, efficient collection and real-time mapping of equipment data is achieved in the manufacturing workshop, which solves the obstacles in equipment monitoring and data transmission, ensures the synchronous operation of virtual workshops and physical workshops, and improves system response speed and data fusion efficiency.
Patent Information
- Application Number
- CN202510495066.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-08-01
AI Technical Summary
The real-time online monitoring of equipment in the existing manufacturing workshops is not fully covered, there are breakpoints in the information transmission channel, the equipment operation status and task information are not promptly feedback, there are obstacles to data collection and transmission, and the differences in equipment interfaces of various manufacturers lead to different data formats, affecting the efficiency of data fusion.
Using the virtual and real workshop synchronization operation method based on OPC UA, the device data is collected and converted through the OPC UA server, unique identifiers and timestamps are defined, and real-time data mapping and synchronization are achieved using the event subscription mechanism, and data transmission is optimized by combining embedded OPC UA server and edge computing.
It realizes efficient collection and analysis of multi-source heterogeneous equipment data, ensures data integrity and consistency, reduces transmission delay, improves response speed and system real-time performance, and realizes real-time synchronization of virtual and real workshops.
Smart Images

Figure CN120406237A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computing technology, and particularly relates to a method and system for synchronous operation of virtual and physical workshops based on OPC UA. Background Art
[0002] The digital twin workshop is a new manufacturing mode that combines the physical workshop with the virtual workshop. Through real-time data collection of the physical workshop and simulation of the virtual workshop, the synchronous operation of the virtual and physical workshops is realized. This mode has the following characteristics: the virtual workshop can reflect the state and operation of the physical workshop in real time; the virtual workshop performs high-precision simulation of the equipment, processes, and environment of the physical workshop; a large amount of real-time data drives the operation and decision-making of the virtual workshop.
[0003] The development of the Internet of Things technology provides powerful data support for the digital twin workshop. The Internet of Things technology includes: collecting real-time data of the physical workshop through various sensors (such as temperature sensors, pressure sensors, position sensors, etc.); using wireless communication technologies such as Wi-Fi, ZigBee, LoRa, etc. for data transmission between devices.
[0004] OPC UA (Open Platform Communications Unified Architecture) is a communication protocol for industrial automation, which can run on different operating systems and hardware platforms, provides security mechanisms such as data encryption, user authentication, and access control, supports the transmission of complex data types and data structures, and supports event-driven data transmission and alarm mechanisms.
[0005] Traditional workshop manufacturing processes mainly include manufacturing execution, data collection and monitoring, production line control, and unit control. In actual operation, quite a number of manufacturing enterprises manage their equipment relatively dispersedly, and the equipment is relatively independent of each other without centralized management and control. There are still many situations in an information island state, data collection is not sufficient, and there are obstacles to data fusion. After sorting out and investigating the enterprise situation, according to the construction requirements of the digital twin workshop, the following problems mainly exist in the information perception and fusion of the current manufacturing workshop:
[0006] (1) Real-time online monitoring of equipment is not fully covered, and some equipment still needs to be visited on-site to view the equipment status, perform collection, and input relevant data;
[0007] (2) The operating status of some equipment cannot be timely fed back to the management level, and there are breakpoints in the information transmission channel, requiring manual assistance;
[0008] (3) There are situations where relevant task information, design process data, etc. cannot be obtained in a timely and accurate manner;
[0009] (4) There are problems such as equipment abnormalities and failures in some parts, which cannot be reported and processed in a timely manner;
[0010] (5) When manually inputting various production data and equipment operation data, due to the influence of equipment interface differences among manufacturers, it is time-consuming and error-prone. From the above-mentioned partial problem summary, the problems existing in the current workshop information perception and fusion mainly focus on two aspects: First, the horizontal channels of machine-to-machine and the vertical channels of machine-to-various upper-level systems in data collection and transmission are not fully connected, resulting in transmission obstacles; Second, the inconsistent data formats caused by differences in data collection equipment interfaces affect the data fusion efficiency and even prevent fusion. These will also be the difficulties and challenges faced by the digital twin workshop in the next step of construction. Summary of the Invention
[0011] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide an efficient data collection and transmission method for the synchronous operation of virtual and physical workshops based on OPC UA.
[0012] The technical solution adopted to solve the above technical problems is:
[0013] A method for synchronous operation of virtual and physical workshops based on OPC UA includes the following steps:
[0014] Step 1. Physical workshop data collection
[0015] The OPC UA server collects industrial equipment data of the physical workshop, converts the collected industrial equipment data into the OPC UA standard protocol format, and stores the industrial equipment data address in the address space of the OPC UA server;
[0016] Step 2. Data transmission
[0017] The OPC UA server serves as the data sender, defines a unique identifier for each data point and attaches a timestamp to ensure data timeliness, and performs serialization processing on the data. The OPC UA client in the virtual workshop serves as the receiver to receive the data;
[0018] Step 3. Data mapping
[0019] The OPC UA client in the virtual workshop parses the received data, extracts the data value, timestamp, and data type, and binds them to the corresponding variables in the virtual workshop;
[0020] According to the data type and equipment attributes, the physical workshop data is mapped to the twin model of the virtual workshop in real time;
[0021] Step 4. Data update and synchronization
[0022] Based on the OPC UA event subscription mechanism, the OPC UA client in the virtual workshop defines the data points or events to be subscribed.
[0023] When the data in the physical workshop changes and meets the trigger conditions, the OPC UA server updates the data.
[0024] When the data points or events subscribed by the OPC UA client in the virtual workshop change, the OPC UA server pushes the updated data, and the corresponding variables in the virtual workshop are updated in real time.
[0025] The virtual workshop adjusts the state of the twin model in real time according to the updated data to ensure the synchronous operation of the virtual and physical workshops.
[0026] Preferably, the OPC UA server includes an external OPC UA server and an embedded OPC UA server; the external OPC UA server uses KEPServerex software to collect industrial equipment data in the physical workshop through Ethernet communication.
[0027] The embedded OPC UA server is developed through an ESP32 development board. The embedded OPC UA server is connected to the underlying devices through the ESP32 development board, and uses a protocol conversion program to convert the underlying device data into the OPC UA protocol format to collect the underlying device data in the physical workshop that cannot be collected by the KEPServerex software.
[0028] Preferably, the external OPC UA server uses KEPServerex software to collect industrial equipment data in the physical workshop through Ethernet communication, including: configuring KEPServerEX, adding channels and devices, configuring tags, starting data collection, configuring the OPC UA server, defining events and alarms, and configuring client connections.
[0029] The adding of channels and devices: In the KEPServerEX interface, select the "Channels" option and add it. A channel is a communication connection between KEPServerEX and a device or data source. Under the channel, select the "Devices" option and add it. A device is a specific physical device or data source under the channel. Set a unique name for the device, add a device description for easy identification, and configure the data collection frequency and scan rate.
[0030] The configuring of tags: Under the device, select the "Tags" option and add it. A tag is a specific data point in the device, representing a certain parameter or state of the device. Set a unique name for each tag, add a tag description for easy identification, set the data type of the tag, map the tag to the specific data address of the device, and configure the collection frequency and update rate of the tag.
[0031] The configured OPC UA server: Install the OPC UA plugin in the KEPServerEX software, set the name and description of the OPC UA server, add the tags in KEPServerEX to the data points of the OPC UA server, and configure the data point properties;
[0032] The defined events and alarms: Define the event types, set the event trigger conditions, configure the actions after the event is triggered, and configure the receivers and notification methods of the event notifications;
[0033] The configured client connection: Configure the connection with KEPServerEX in the OPC UA client in the virtual workshop, and subscribe to the data points published in KEPServerEX and set the data update frequency.
[0034] Preferably, in the data transmission of step 2, define the event trigger conditions on the external OPC UA server and the ESP32 development board, detect the event trigger conditions through interruption or polling, and once satisfied, trigger the event. After the external OPC UA server and the ESP32 development board collect the relevant data, they are transmitted to the receiving end through the OPC UA protocol.
[0035] Preferably, the relevant data collected by the ESP32 development board is transmitted to the receiving end through the OPC UA protocol after edge processing.
[0036] Preferably, the edge processing method is: Deploy a filtering algorithm on the ESP32 development board, use a compression algorithm to reduce the data volume, when the data meets the defined trigger conditions, trigger the event handler, monitor the resource usage in real time, and adjust the data collection frequency and processing strategy according to the resource usage.
[0037] Preferably, in the data mapping of step 3, the method of binding to the corresponding variables in the virtual workshop is:
[0038]
[0039] In the formula, P B (), P I (), P R (), P F (), P S () respectively represent the variables of boolean, integer, real, floating point and string in the physical workshop, V B (), V I (), V R (), V F (), V S () respectively represent the variables of boolean, integer, real and string types in the virtual workshop, X represents the name of the processing equipment, and i represents the variable name. Indicates a binding relationship, Indicates a one-to-one mapping relationship.
[0040] A virtual-real workshop synchronous operation system based on OPC UA includes: a physical entity industrial control computer with an OPC UA server, a digital virtual workshop system with an OPC UA client, an industrial Ethernet switch, an industrial Ethernet, a data acquisition module with an embedded OPC UA server, and an entity workshop Ethernet communication device;
[0041] The system communicates according to the virtual-real workshop synchronous operation method based on OPC UA.
[0042] The beneficial effects of the present invention are as follows:
[0043] Through OPC UA technology, the present invention realizes the efficient acquisition and parsing of multi-source heterogeneous device data in the physical workshop, ensures the integrity and consistency of the data, and uses the efficient communication mechanism of OPC UA to ensure that the data can be transmitted to the virtual workshop in real time, reducing data transmission delay and improving the response speed of the system.
[0044] The present invention performs edge processing on the data on the ESP32 development board, reduces the amount of data transmitted to the central server, lightens the network burden, improves the data processing efficiency, realizes fast response, can make local decisions according to preset logics and algorithms, and improves the real-time performance and reliability of the system.
[0045] Through the event trigger mechanism, the present invention performs data transmission only when key data changes, reduces unnecessary data communication, improves the system efficiency, and uses the subscription mechanism of OPC UA to ensure that the client can receive data change notifications in a timely manner, realizing the real-time synchronization of the virtual-real workshop. Description of the Drawings
[0046] Figure 1 is a flowchart of the virtual-real workshop synchronous operation method based on OPC UA of the present invention;
[0047] Figure 2 is a framework diagram of the data acquisition and transmission of the present invention. Detailed Embodiments
[0048] The present invention will be further described in detail below in conjunction with the drawings and embodiments, but the present invention is not limited to the following embodiments.
[0049] In Figure 1 the virtual-real workshop synchronous operation method based on OPC UA of this embodiment includes the following steps:
[0050] Step 1. Physical workshop data acquisition
[0051] Step 1.1 The external OPC UA server uses KEPServerex software to collect industrial equipment data from the physical workshop through Ethernet communication, converts the collected industrial equipment data into the OPC UA standard protocol format, and stores the industrial equipment data address in the address space of the OPC UA server for unified management and access of the data;
[0052] Among them, the external OPC UA server uses KEPServerex software to collect industrial equipment data from the physical workshop through Ethernet communication, including: configuring KEPServerEX, adding channels and devices, configuring tags, starting data collection, configuring the OPC UA server, defining events and alarms, and configuring client connections;
[0053] Adding channels and devices: In the KEPServerEX interface, select the "Channel" option and add it. The channel is the communication connection between KEPServerEX and the device or data source. Under the channel, select the "Device" option and add it. The device is the specific physical device or data source under the channel. Set a unique name for the device, add a device description for easy identification, and configure the data collection frequency and scan rate;
[0054] Configuring tags: Under the device, select the "Tag" option and add it. The tag is the specific data point in the device, representing a certain parameter or state of the device. Set a unique name for each tag, add a tag description for easy identification, set the data type of the tag, such as boolean, integer, floating point, etc., map the tag to the specific data address of the device, and configure the collection frequency and update rate of the tag;
[0055] Configuring the OPC UA server: Install the OPC UA plugin in the KEPServerEX software, set the name, description, port number, and security settings of the OPC UA server, add the tags in KEPServerEX to the data points of the OPC UA server, and configure the data point attributes, such as the name, description, and data type of the data point;
[0056] Defining events and alarms: Define event types, such as a value exceeding a threshold, a status change, etc., set event trigger conditions, such as the temperature exceeding 30°C, configure the actions after the event is triggered, such as logging, sending notifications, executing scripts, etc., and configure the recipients and notification methods of the event notifications, such as email, SMS, etc.;
[0057] Configuring client connections: Configure the connection with KEPServerEX in the OPC UA client in the virtual workshop, and subscribe to the data points published in KEPServerEX and set the data update frequency.
[0058] Step 1.2 For the underlying device data in the physical workshop that cannot be collected by the KEPServerex software, an embedded OPC UA server developed using an ESP32 development board is connected to the underlying device. The device data is converted into the OPC UA protocol format through a protocol conversion program for collection, and the data address is stored in the address space of the embedded OPC UA server;
[0059] Step 2. Data Transmission
[0060] The external OPC UA server and the embedded OPC UA server act as data senders. A unique identifier is defined for each data point and a timestamp is attached to ensure data timeliness. The data is serialized to ensure the consistency and integrity of the data during network transmission. The OPC UA client in the virtual workshop acts as the receiver to receive the data;
[0061] Event trigger conditions are defined on the external OPC UA server and the ESP32 development board. The event trigger conditions are detected through interrupts or polling. Once satisfied, the event is immediately triggered. The external OPC UA server and the ESP32 development board collect relevant data, which is transmitted to the receiver through the OPC UA protocol after edge processing;
[0062] Among them, the edge processing method is as follows: A filtering algorithm is deployed on the ESP32 development board, and a compression algorithm is used to reduce the amount of data. When the data meets the defined trigger conditions, the event handler is triggered to monitor the resource usage in real time, and the data collection frequency and processing strategy are adjusted according to the resource usage.
[0063] Step 3. Data Mapping
[0064] The OPC UA client in the virtual workshop parses the received data, extracts information such as data values, timestamps, and data types, and binds them to the corresponding variables in the virtual workshop, as follows:
[0065]
[0066] In the formula, P B (), P I (), P R (), P F (), P S () represent the variables of boolean, integer, real number, floating point number, and string in the physical workshop respectively, and V B (), V I (), V R (), V F (), V S() represent variables of boolean, integer, real number, and string types in the virtual workshop, X represents the name of the processing equipment, and i represents the variable name. represents the binding relationship. represents a one-to-one mapping relationship.
[0067] According to the data type and equipment attributes, the physical workshop data is mapped to the twin model of the virtual workshop in real time.
[0068] Step 4. Data update and synchronization
[0069] Based on the event subscription mechanism of OPC UA, the OPC UA client in the virtual workshop defines the data points or events to be subscribed.
[0070] When the data in the physical workshop changes and meets the trigger conditions, the external OPC UA server and the embedded OPC UA server update the data.
[0071] When the data points or events subscribed by the OPC UA client in the virtual workshop change, the external OPC UA server and the embedded OPC UA server actively push the updated data, and the corresponding variables in the virtual workshop are updated in real time.
[0072] The virtual workshop adjusts the state of the twin model in real time according to the updated data to ensure the synchronous operation of the virtual and physical workshops.
[0073] A virtual and physical workshop synchronous operation system based on OPC UA includes: a physical entity industrial control computer with an OPC UA server, a digital virtual workshop system with an OPC UA client, an industrial Ethernet switch, an industrial Ethernet, a data acquisition module with an embedded OPC UA server, and an entity workshop Ethernet communication device; the system communicates according to the virtual and physical workshop synchronous operation method based on OPC UA.
[0074] The following takes a preferred embodiment as an example for detailed description:
[0075] The OPC UA specification defines a standard communication interface for data exchange between different software products, which can realize the acquisition and parsing of multi-source heterogeneous data in the production process and further realize interoperability.
[0076] 1. Constructed a framework for real-time acquisition and transmission of production workshop data
[0077] Aiming at problems such as the difficulty in obtaining and transmitting data information of heterogeneous devices at the bottom layer of the on-site workshop, based on OPC UA technology, an external OPC server constructed using KEPServerex software, combined with an embedded OPC UA server developed using an ESP32 development board, a framework for real-time data acquisition and transmission in the production workshop was constructed. The data acquisition and transmission framework for the workshop site is as Figure 2 shown. An external OPC UA server and an embedded OPC UA server were established as the data acquisition end and the sending end of data transmission; an OPC UA client was constructed in the virtual workshop and information service layer of the digital virtual workshop system as the receiving end of data transmission, forming a data transmission channel of OPC UA server - client. In the Figure 2 framework, data acquisition is divided into two levels: Ethernet communication and protocol-driven communication. First, the physical entity industrial control computer installed with KEPServerex software is connected to devices such as PLCs, sensors, robotic arm controllers, and motion controllers connected to the industrial switch through Ethernet, forming a primary communication channel; then, through the protocol driver built into KEPServerex software, based on the established Ethernet primary communication channel, the data addresses of workshop devices are obtained in an addressing manner and stored in the address space of the constructed OPC UA server. In addition, the data of the offline simulation process of the virtual workshop can be acquired in real time through the simulation-driven protocol; finally, for devices that cannot be acquired by the external OPC UA server, an embedded data acquisition module developed based on the ESP32 development board is used. By connecting the ESP32 development board to the underlying device, writing a low-level data protocol conversion program and an OPC UA server program in the ESP32 development board, the low-level data is converted and then connected to the embedded OPC UA server and saved in the address space, and the data is transmitted to the OPC UA client through the WiFi function and encryption, thus realizing the acquisition and transmission of data of physical workshop devices.
[0078] In the KEPServerex software, the data obtained from the on-site workshop is summarized and classified, and then converted into data that meets the OPC UA protocol standard, and the data is transmitted in real time to the digital virtual workshop system constructed by VC software through the OPC UA S / C data transmission structure. In addition, the data is transmitted to the SQL database, Excel software, and Internet of Things platform, etc. through the protocol-driven transmission method. Through the above methods, it is possible to effectively realize the real-time and comprehensive acquisition of multi-source heterogeneous device data in the physical workshop, as well as the unified integration and planning of the acquired data, and be able to perform efficient analysis and processing on the data.
[0079] 2. Synchronous operation of virtual and physical workshops
[0080] To achieve smooth data acquisition and transmission, enabling the synchronous operation of the physical workshop and the virtual workshop, which is an important part of the three-dimensional real-time visualization display of the production process in the physical workshop. It is necessary to transmit the node data information of each physical device collected in the on-site workshop in real time and map it one by one to the device twin model constructed in the virtual workshop. Connect the built external OPC UA server and the embedded OPC UA server to the OPC UA client in the digital virtual workshop system to form a data transmission channel. Analyze the physical workshop data information collected by the physical workshop perception module devices, and create variable information corresponding to the device data in the OPC UA server according to the addresses corresponding to the data information, including information such as data name, address, data type, and scanning rate, to achieve the acquisition of physical workshop device data. On this basis, the physical workshop node data and the virtual workshop simulation variables are bound one by one according to the physical workshop data type and the action variables and communication interfaces in each attribute established in the twin device model (such as binding the joint axis variables of the physical robotic arm and the virtual robotic arm belonging to the floating-point type, and binding the on / off door signals of the physical machine tool and the virtual machine tool belonging to the boolean type, etc.), so as to realize the real-time transmission of physical workshop data to the virtual workshop. The data variable binding form can be described as:
[0081]
[0082] In the formula: P B (), P I (), P R (), P F (), P S () are variables representing boolean values, integers, real numbers, floating-point numbers, and string types in the physical workshop respectively; V B (), V I (), V R (), V F (), V S () are variables representing boolean values, integers, real numbers, and string types in the virtual workshop respectively; X is the name of the processing equipment; i is the variable name; is the binding relationship; is a one-to-one mapping relationship.
[0083] The binding methods of other types of data variables are the same as above. After the data variables are mapped one by one, the virtual workshop and the physical workshop maintain the same initial state. When the physical workshop starts running, the OPC UA server obtains the data changes during the operation of the physical workshop.
[0084] The steps for the OPC UA server to obtain the data changes during the operation of the physical workshop are as follows:
[0085] A1: Data acquisition process
[0086] 1) Initial configuration: First, initial configuration needs to be performed on the OPC UA server, including defining data points (also known as nodes), which directly correspond to the specific parameters or states of physical devices. The configuration also involves setting communication parameters such as the acquisition frequency (scanning rate), communication protocol, and device address.
[0087] 2) Establishing connections: The OPC UA server uses the configuration information to establish connections with physical devices. Different types of devices may require different communication protocols and interfaces. In this study, these connections are implemented through the middleware KEPServerEX to support a wide range of devices and protocols.
[0088] 3) Data subscription and acquisition: After the connections are established, the OPC UA server sends data acquisition requests to physical devices according to the preset acquisition frequency. For parameters crucial for real-time monitoring and control, in this study, the server is configured to use a subscription mechanism, that is, the device only sends updates to the server when the data changes.
[0089] A2: Data update and synchronization
[0090] 1) Variable update: When new data is received from physical devices, the OPC UA server immediately updates the corresponding data points (nodes). This includes numerical updates, status changes, or event triggers, etc.
[0091] 2) Events and alarms: For critical parameters and states, events and alarms are configured on the OPC UA server. When these parameters reach the preset thresholds or specific changes occur in the states, the server not only updates the data but also can trigger alarms or events, providing signals for subsequent processing and response.
[0092] 3) Client notification: OPC UA supports an advanced subscription mechanism, allowing client applications (such as monitoring systems, data analysis tools, or other management software) to subscribe to specific data points or events. Once the relevant data points are updated or events are triggered, the OPC UA server immediately notifies all clients that have subscribed to this information, ensuring real-time data synchronization.
[0093] A3: Advanced features
[0094] Data quality and timestamp: OPC UA not only transmits data values but also provides data quality metrics and accurate timestamps. This guarantees the reliability and accuracy of the data.
[0095] Security: OPC UA has built-in advanced security features, including data encryption, authentication, and access control, ensuring the security of data transmission.
[0096] Modeling and Scalability: OPC UA supports data modeling, allowing the definition of complex data structures and relationships. This makes the integration with physical devices and systems more flexible and powerful.
[0097] By leveraging the above processes and features, an OPC UA server is used to efficiently and reliably obtain real-time operation data from the physical workshop, ensuring that the virtual workshop can accurately reflect the latest state of the physical workshop, thus achieving the synchronous operation of the virtual and physical workshops.
[0098] Taking the data changes during the operation of the physical workshop obtained by the OPC UA server as the signals for collection and transmission, the data collection and transmission are realized, and then the synchronous operation of the virtual / physical workshops is completed.
[0099] To achieve the synchronous operation of the virtual and physical workshops, in-depth research has been conducted on the key technical components, data flow, and implementation of the synchronization mechanism throughout the process. This includes the advanced processing of data, synchronization strategies, real-time feedback, and deep integration between systems.
[0100] 2.1 Advanced Data Processing and Synchronization Decision Algorithm
[0101] Edge Computing Integration: Integrate edge computing devices at the physical device end to preprocess and preliminarily analyze data. This can reduce the amount of data transmitted over the network and improve the response speed.
[0102] Applying edge computing integration technology to the embedded OPC UA server framework based on ESP32 can further optimize the process of multi-source heterogeneous data collection and parsing, improve data processing efficiency, reduce network latency, and enhance data security. Edge computing allows data to be processed closer to the data source, thus reducing the burden on the central server and the demand for broadband. The following is the application method of edge computing integration technology:
[0103] Basic Principle: Edge computing processes data at the source where it is generated (i.e., the edge of the network), rather than sending all data to the cloud or central data center for processing. This method reduces data transmission time and improves processing speed.
[0104] Key Technologies:
[0105] Data Preprocessing: Filter, aggregate, and compress data at the edge node, and only send the necessary information to the central server or cloud for further analysis.
[0106] Local Decision-making: Edge devices can make decisions locally according to preset logic and algorithms, such as device control and anomaly alarm, to achieve fast response.
[0107] Resource Optimization: Dynamically allocate edge computing resources according to the requirements of tasks, optimize the use of computing and storage resources, and improve the overall performance of the system.
[0108] Edge Computing Application Combining ESP32 and OPC UA:
[0109] · Data Acquisition and Preliminary Processing:
[0110] Assume that the amount of data generated by each sensor per second is D. After preliminary processing, the amount of data is reduced to a% (0 < a < 100) of the original. Then the amount of data D' sent by the edge node to the central server per second = a% × D.
[0111] Deploy simple data processing algorithms on the ESP32 device, such as noise filtering, data compression, etc., to reduce the amount of data that needs to be transmitted to the OPC UA server.
[0112] · Real-time Local Decision-making:
[0113] Set a threshold T. When the collected data x satisfies a certain condition f(x) > T, perform a specific operation.
[0114] Application: Utilize the computing power of ESP32 to monitor key operation parameters in real time. When the data exceeds the threshold, react immediately, such as adjusting process parameters or stopping the machine, without waiting for the response of the central server.
[0115] · Integration into the Digital Twin System
[0116] Data Synchronization and Model Update: Synchronize the key data processed by the edge to the digital twin model through the OPC UA server for real-time updating of the state of the virtual environment, improving the accuracy and response speed of the model.
[0117] Dynamic Resource Allocation: Dynamically adjust the data acquisition frequency and processing strategy according to the processing capabilities and network conditions of the edge nodes, optimize the use of system resources, and ensure that key data can be processed and transmitted in a timely manner.
[0118] Through the above methods, the integration of edge computing technology not only optimizes the data processing process, reduces the burden on the central server, but also improves the response speed and security of the system. The edge computing application combining ESP32 and OPC UA technologies provides an effective way to achieve efficient multi-source heterogeneous data acquisition and analysis.
[0119] 2.2 Real-time Synchronization Strategy
[0120] 2.2.1 Timestamps and Serialization: Ensure that each piece of collected data has an accurate timestamp and serialization identifier, so that the data remains consistent and traceable during transmission and processing.
[0121] Timestamp and serialization technologies are the foundation for achieving data consistency, integrity, and synchronization between systems. In the embedded OPC UA server framework built on ESP32, these technologies can ensure the integrity and order of each data packet during the process of multi-source heterogeneous data collection and data parsing, thereby improving the accuracy and efficiency of data processing.
[0122] Principle of Application of Timestamp Technology
[0123] A timestamp is a record of the specific date and time when data or an event is created, modified, or transmitted. It provides a clear time reference for data, ensuring data synchronization and consistency, especially in distributed systems.
[0124] In data collection, each data point can be labeled as D(t, v), where t is the timestamp indicating the specific time of data collection, and v is the data value.
[0125] When collecting data on the ESP32 side, attach a timestamp accurate to milliseconds to each data point to ensure that the data can be processed and analyzed in chronological order.
[0126] ·Principle of Application of Serialization Technology
[0127] Serialization refers to the process of converting a data structure or object state into a format that can be stored or transmitted so that the original state can be restored later through deserialization. Serialization not only involves the encoding of data content but also includes the preservation of data types, structures, etc.
[0128] Suppose there is a data structure S containing n data points {D1, D2,..., D n}, the serialization process can be represented as a function F(S) = B, where B is a binary string that can uniquely represent the content and structure of S.
[0129] Before data transmission, use the computing power of the ESP32 to serialize the collected data into a unified format (such as JSON, XML, or a proprietary format), and then send it to the server through the OPC UA protocol. This not only reduces the complexity of the data but also ensures the consistency and integrity of the data during network transmission.
[0130] ·Detailed Application of Combining Timestamp and Serialization Technologies
[0131] (1) Data Collection and Marking:
[0132] When collecting data on the ESP32 side, attach timestamps to each data point and then perform serialization processing. For example, package sensor data and its collection time into a JSON object.
[0133] Example: `{"timestamp":"2024-04-10T14:00:00Z","sensor_value":25.5}`
[0134] (2) Data transmission and synchronization:
[0135] Transmit the serialized data object through the OPC UA protocol to ensure that the structure and type of the data remain unchanged during transmission. At the same time, use timestamps to maintain the timing of the data.
[0136] On the server side, use timestamps to sort and synchronize the received data to ensure the timing and accuracy of data processing and analysis.
[0137] (3) Data parsing and application:
[0138] On the receiving end (such as a data analysis platform or a virtual workshop model), deserialize the serialized data to restore it to the original data structure, and perform appropriate processing and analysis based on timestamps.
[0139] Use timestamps to detect and correct possible delays or out-of-order problems in data transmission, ensuring data consistency and integrity.
[0140] By applying timestamps and serialization techniques in detail in the OPC UA server framework based on ESP32, the entire process from efficient collection of multi-source heterogeneous data, accurate transmission to data parsing can be effectively realized, providing accurate and synchronized data support for the digital twin workshop.
[0141] 2.2.2 Event trigger mechanism: Utilize the event subscription mechanism of OPC UA to trigger data synchronization only when key parameters change, rather than synchronizing continuously. This can effectively reduce unnecessary data transmission and improve system efficiency.
[0142] In the embedded OPC UA server framework built based on ESP32, the event trigger mechanism can effectively improve the efficiency of data collection and parsing, ensuring that processing and transmission are only performed when key data changes. The core of the event trigger mechanism lies in defining a set of rules or conditions. When these conditions are met, a series of operations are automatically started, such as data collection, processing, and transmission. This mechanism can reduce unnecessary data communication, save resources, and at the same time ensure that the system can respond promptly to important events.
[0143] The event trigger mechanism is based on two core concepts:event and trigger. An event is an important or critical action or change that occurs in the system, such as sensor data exceeding a preset threshold. A trigger is a logical mechanism that activates the processing flow related to the event when specific conditions or rules are met.
[0144] Implementation Steps and Technical Applications of the Event Trigger Mechanism:
[0145] (1) Define Events and Conditions
[0146] On the ESP32 device, various sensor data can be defined for events, and each event is associated with one or more trigger conditions, such as numerical thresholds (e.g., the temperature exceeds 30°C) or state changes (e.g., the device changes from the running state to the stopped state).
[0147] The embedded OPC UA server deployed on the ESP32 device needs to be able to recognize and respond to these conditions. For example, when the temperature sensor reading exceeds the preset threshold, an event is triggered, which causes data collection and transmission to the OPC UA server.
[0148] (2) Event Listening and Detection
[0149] Event listening is the process of continuously detecting whether the event trigger conditions are met. This can be achieved through polling or interrupts. Polling is the process of periodically checking whether the conditions are met, while interrupts are generated by hardware or software and respond immediately when the conditions are met.
[0150] On the ESP32, it is preferred to use the interrupt-driven method to implement event listening to reduce resource consumption and achieve fast response. For example, when the sensor data exceeds the threshold, this change is immediately captured through a GPIO interrupt, triggering subsequent data processing and transmission processes.
[0151] (3) Event Handling and Response
[0152] Once an event is triggered, the corresponding handler or response action is executed. This may include data collection, processing, logging, and sending alerts or data over the network, etc.
[0153] After the event is triggered, the ESP32 device can immediately collect relevant data and package this data and send it to the server through the OPC UA protocol. At the same time, the event log can be recorded locally, or an instant alert can be sent to the system administrator through the network interface.
[0154] (4) Data Transmission and Synchronization
[0155] Event-based data transmission means that data communication only occurs when an event is triggered. This method is more efficient than continuous or timed data collection and can reduce the burden on the network and server.
[0156] Through the OPC UA protocol, the data changes triggered by events are transmitted to the central server or cloud platform with minimal latency, achieving data synchronization between the virtual workshop and the physical workshop. The subscription and publishing mechanisms of OPC UA can be used to optimize this process, ensuring that only clients subscribed to specific events will receive data update notifications.
[0157] Through the above methods, the application of the event trigger mechanism in the embedded OPC UA framework based on ESP32 not only improves the efficiency of data processing and transmission, but also enhances the real-time performance and response ability of the system, providing effective support for the realization of efficient multi-source heterogeneous data acquisition and parsing.
[0158] Dynamic update of the digital twin model
[0159] 1. Model adaptive adjustment: Dynamically adjust the parameters in the digital twin model according to real-time data and analysis results, such as simulating the operating state of the production line and adjusting equipment configuration.
[0160] 2. Simulation and optimization: Use the updated model for simulation experiments, test different production strategies, and perform process optimization and resource allocation to obtain the optimal solution.
[0161] 3. Real-time feedback and visualization
[0162] 3.1 Dynamic monitoring interface: Through a highly interactive user interface, real-time display the status of the physical workshop and the digital twin workshop, including production data, equipment operating status, alarm information, etc.
[0163] The dynamic monitoring interface technology is a key component for realizing the synchronous operation of the virtual and physical workshops. It provides an intuitive way for operators to monitor and control the production process in real time. In the embedded OPC UA server framework based on ESP32, the dynamic monitoring interface technology can effectively display the results of multi-source heterogeneous data acquisition and parsing, assisting in decision-making and operation execution. The following is how to use the dynamic monitoring interface technology in detail:
[0164] (1) Basic principles for designing the dynamic monitoring interface
[0165] Real-time data visualization: The interface should be able to display real-time data from the physical workshop, such as sensor data like temperature, pressure, speed, and equipment status information.
[0166] User interactivity: Provide interactive controls such as buttons, sliders, etc., allowing operators to send control commands or adjust parameter settings.
[0167] Modular design: Adopt a modular design to facilitate customizing and expanding the interface to meet different monitoring requirements.
[0168] (2) Technical Implementation of the Dynamic Monitoring Interface
[0169] Data Binding:
[0170] Principle: By using data binding technology, the interface elements are directly associated with the background data source to achieve automatic data update.
[0171] Application: In the dynamic monitoring interface, the display components of each monitoring index (such as dashboards, charts, etc.) are bound to the data collected by the ESP32 through the OPC UA server. When the data is updated, the interface automatically refreshes to display the latest value.
[0172] Event-driven Update:
[0173] Principle: The interface update is not through polling data changes, but through event-driven. When the background data meets specific conditions or changes, the interface update event is triggered.
[0174] Application: By using the event subscription mechanism of OPC UA, when specific data changes (such as the temperature exceeds the warning value), warning or prompt messages are automatically displayed on the monitoring interface.
[0175] Front-end and Back-end Separation:
[0176] Principle: Adopt the front-end and back-end separation architecture. The front-end is responsible for interface display and user interaction, and the back-end is responsible for data processing and storage.
[0177] Application: The back-end realizes data collection and processing based on ESP32 and OPC UA server. The front-end constructs a dynamic monitoring interface through web technologies (such as HTML5, CSS, JavaScript) and communicates with the back-end through RESTful API or WebSocket to achieve real-time display and interaction of data.
[0178] Through the above methods, the dynamic monitoring interface technology can effectively realize the real-time display and interaction of the data collected in the embedded OPC UA server framework based on ESP32, providing powerful real-time monitoring and control capabilities for operators and strengthening the synchronous operation of virtual and physical workshops.
[0179] 3.2 User Interaction and Simulation Decision-making: Allow users to simulate various operations and decisions in the virtual environment, such as adjusting the production line layout, simulating emergency handling, etc., and then apply these decisions to the physical workshop or use them for further analysis and optimization.
[0180] 4. Deep Integration between Systems
[0181] 4.1 Open APIs and Standardized Interfaces: The adoption of open APIs and standardized interfaces promotes communication between different systems and components, ensuring data consistency and accuracy, and also facilitating the future expansion and upgrade of systems.
[0182] Open API (Application Programming Interface) and standardized interface technologies play a key role in achieving efficient communication and integration between systems. In the embedded OPC UA server framework built on ESP32, these technologies can be used to achieve seamless connection with multi-source heterogeneous data acquisition and parsing systems, improving the flexibility and scalability of data interaction. The following is how to apply open API and standardized interface technologies in detail:
[0183] 4.1.2 Application of Open APIs
[0184] Principle: Open APIs define a set of standard request and response formats, allowing external systems to access specific services and data through the network. These APIs follow the REST (Representational State Transfer) principle, use HTTP as the communication protocol, and support CRUD (Create, Read, Update, Delete) operations.
[0185] Technical Implementation:
[0186] JSON / XML Data Format: Use JSON or XML format to exchange data because they are widely supported and easy for humans to read and machines to parse.
[0187] RESTful Services: Design RESTful services, provide a unique URI for each resource (such as sensor data, device status, etc.), and perform operations through HTTP methods such as GET, POST, PUT, DELETE.
[0188] OAuth Authentication: Adopt security frameworks such as OAuth to implement access control and ensure the security of data exchange.
[0189] 4.1.3 Standardized Interfaces
[0190] Principle: Standardized interfaces refer to communication interfaces that follow recognized standards (such as OPC UA, MQTT, etc.), ensuring that different devices and systems can exchange information in a compatible manner.
[0191] Technical Implementation:
[0192] OPC UA Interface: The embedded OPC UA server built on ESP32 should implement the services and interfaces defined by the OPC UA specification, supporting functions such as data access, historical data access, and event subscription.
[0193] MQTT Protocol: For scenarios that require lightweight message passing, an MQTT client can be implemented to achieve message exchange between devices through the publish / subscribe mode.
[0194] In the embedded OPC UA framework based on ESP32, the following functions can be achieved by combining open APIs and standardized interface technologies:
[0195] Data collection and access: Provide access to the collected multi-source heterogeneous data through RESTful APIs. For example, a third-party system can access the real-time or historical data of a specific sensor through a GET request.
[0196] Device control and management: Use OPC UA services to achieve remote control and management of devices. For example, change device parameters or obtain device status by calling OPC UA interfaces.
[0197] Event-driven data processing: Implement an event-based data notification mechanism through the MQTT protocol. When the device status changes, push messages to subscribed clients immediately.
[0198] System integration and interoperability: Use standardized interfaces such as OPC UA to ensure interoperability with other industrial automation systems (such as MES, SCADA), and achieve seamless flow of data and commands.
[0199] In this way, open APIs and standardized interface technologies not only provide a standardized communication mechanism between internal components of the system, but also facilitate external system access and integration, greatly enhancing the openness, flexibility, and scalability of the system.
[0200] The implementation of the above key steps, from the mapping of the physical workshop production process to the virtual workshop, to the synchronous operation of the virtual / physical workshop driven by twin data in real time, completes the construction of the digital twin workshop. The digital twin workshop with efficient communication lays a solid foundation for the visualization of the workshop production status and the real-time dynamic display of information.
[0201] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for synchronous operation of virtual and physical workshops based on OPC UA, characterized in that, It includes the following steps: Step 1. Physical workshop data collection The OPC UA server collects the industrial equipment data of the physical workshop, converts the collected industrial equipment data into the OPC UA standard protocol format, and stores the industrial equipment data address in the address space of the OPC UA server; Step 2. Data transmission The OPC UA server, as the data sender, defines a unique identifier for each data point and attaches a timestamp to ensure data timeliness, and performs serialization processing on the data. The OPC UA client in the virtual workshop receives the data as the receiver; Step 3. Data mapping The OPC UA client in the virtual workshop parses the received data, extracts the data value, timestamp, and data type, and binds them to the corresponding variables in the virtual workshop; According to the data type and device attributes, the physical workshop data is mapped to the twin model of the virtual workshop in real time; Step 4. Data update and synchronization Based on the event subscription mechanism of OPC UA, the OPC UA client in the virtual workshop defines the data points or events to be subscribed; When the data in the physical workshop changes and meets the trigger conditions, the OPC UA server updates the data; When the data points or events subscribed by the OPC UA client in the virtual workshop change, the OPC UA server pushes the updated data, and the corresponding variables in the virtual workshop are updated in real time; The virtual workshop adjusts the state of the twin model in real time according to the updated data to ensure the synchronous operation of the virtual and physical workshops.
2. The method for synchronous operation of virtual and physical workshops based on OPC UA according to claim 1, wherein, The OPC UA server includes an external OPC UA server and an embedded OPC UA server; the external OPC UA server uses KEPServerex software to collect the industrial equipment data of the physical workshop through Ethernet communication; The embedded OPC UA server is developed through an ESP32 development board. The embedded OPC UA server is connected to the underlying device through the ESP32 development board, and uses a protocol conversion program to convert the underlying device data into the OPC UA protocol format to collect the underlying device data in the physical workshop that cannot be collected by the KEPServerex software.
3. The method for synchronous operation of virtual and physical workshops based on OPC UA according to claim 2, characterized in that The external OPC UA server uses KEPServerex software to collect the industrial equipment data of the physical workshop through Ethernet communication, including: configuring KEPServerEX, adding channels and devices, configuring tags, starting data collection, configuring the OPC UA server, defining events and alarms, and configuring client connections; The adding channels and devices: In the KEPServerEX interface, select the "Channel" option and add it. The channel is the communication connection between KEPServerEX and the device or data source. Under the channel, select the "Device" option and add it. The device is the specific physical device or data source under the channel. Set a unique name for the device, add a device description for easy identification, and configure the data collection frequency and scan rate; The configuration tags: Select the "Tags" option under the device and add them. Tags are specific data points in the device, representing a certain parameter or state of the device. Set a unique name for each tag, add a tag description for easy identification, set the data type of the tag, map the tag to the specific data address of the device, and configure the acquisition frequency and update rate of the tag. The configuration of the OPC UA server: Install the OPC UA plugin in the KEPServerEX software, set the name and description of the OPC UA server, add the tags in KEPServerEX to the data points of the OPC UA server, and configure the data point attributes. The definition of events and alarms: Define the event type, set the event trigger conditions, configure the actions after the event is triggered, and configure the recipients and notification methods of the event notifications. The configuration of the client connection: Configure the connection with KEPServerEX in the OPC UA client in the virtual workshop, and subscribe to the data points published in KEPServerEX and set the data update frequency.
4. The method for synchronous operation of virtual and physical workshops based on OPC UA according to claim 2, wherein In the data transmission of step 2, define the event trigger conditions on the external OPC UA server and the ESP32 development board, detect the event trigger conditions through interrupt or polling. Once satisfied, trigger the event. After the external OPC UA server and the ESP32 development board collect the relevant data, transmit it to the receiving end through the OPC UA protocol.
5. The method for synchronous operation of virtual and physical workshops based on OPC UA according to claim 4, characterized in that, The relevant data collected by the ESP32 development board is transmitted to the receiving end through the OPC UA protocol after edge processing.
6. The method for synchronous operation of virtual and physical workshops based on OPC UA according to claim 5, characterized in that, The edge processing method is: Deploy a filtering algorithm on the ESP32 development board, use a compression algorithm to reduce the data volume. When the data meets the defined trigger conditions, trigger the event handler, monitor the resource usage in real time, and adjust the data acquisition frequency and processing strategy according to the resource usage.
7. The method for synchronous operation of virtual and physical workshops based on OPC UA according to claim 1 or 2, characterized in that In the data mapping of step 3, the method of binding to the corresponding variables in the virtual workshop is: Wherein, P B (), P I (), P R (), P F (), P S () respectively represent variables of boolean, integer, real number, floating point number and string in the physical workshop, V B (), V I (), V R (), V F (), V S () respectively represent variables of boolean, integer, real number and string types in the virtual workshop, X represents the name of the processing equipment, i represents the variable name, represents the binding relationship, represents a one-to-one mapping relationship.
8. A virtual-real workshop synchronous operation system based on OPC UA, characterized in that, Including: A physical entity industrial control computer with an OPC UA server, a digital virtual workshop system with an OPC UA client, an industrial Ethernet switch, an industrial Ethernet, a data acquisition module with an embedded OPC UA server, and an entity workshop Ethernet communication device. The system communicates according to the OPC UA-based virtual-real workshop synchronous operation method as described in any one of claims 2-6.