Search

CN-121984735-A - Bidirectional communication method of digital twin system and PLC equipment in Linux environment

CN121984735ACN 121984735 ACN121984735 ACN 121984735ACN-121984735-A

Abstract

The invention discloses a bidirectional communication method of a digital twin system and a PLC device in a Linux environment, which comprises the steps of establishing a secure communication channel based on TCP and TLS encryption and bidirectional authentication, defining an application layer message structure, completing initial secure link connection, developing and integrating a package communication function for a UE5 plug-in unit, providing a visual blueprint node to configure PLC device parameters and process message serialization, executing real-time bidirectional data interaction between the digital twin system and the PLC device based on the secure communication channel and the UE5 plug-in unit, detecting and automatically reconnecting to maintain connection through heartbeat, and constructing a UE5 item containing the plug-in unit into a Linux executable file through a cross compiling tool chain and deploying configuration. The invention meets the requirements of localization and autonomous control, and forms a complete solution for bidirectional communication between the digital twin system and the PLC equipment in a Linux environment with safety, real-time, easy use and good expansibility.

Inventors

  • HOU JIAHAO
  • YANG YANG
  • ZHAO BIN
  • JIA ZIHAO
  • HUI HUANG
  • ZHANG BEIBEI
  • Kou Xiaomei

Assignees

  • 中国电建集团西北勘测设计研究院有限公司

Dates

Publication Date
20260505
Application Date
20260126

Claims (8)

  1. The bidirectional communication method of the digital twin system and the PLC equipment in the Linux environment is characterized by comprising the following steps: step 1, establishing a secure communication channel based on TCP and TLS encryption and bidirectional authentication, defining an application layer message structure, and completing initial secure link connection; Step 2, developing and integrating a package communication function as a UE5 plug-in unit, and providing a visual blueprint node to configure PLC equipment parameters and process message serialization; Step 3, based on the secure communication channel and the UE5 plug-in, executing real-time bidirectional data interaction between the digital twin system and the PLC equipment, and maintaining connection with automatic reconnection through heartbeat detection; and 4, constructing the UE5 project containing the plug-in into a Linux executable file through a cross compiling tool chain and deploying configuration.
  2. 2. The method for bi-directional communication between a digital twin system and a PLC device in a Linux environment according to claim 1, wherein step 1 specifically comprises the steps of: step 1.1, establishing long connection between a digital twin system and PLC equipment based on a TCP protocol; step 1.2, on the basis of TCP connection, configuring and using TLS1.2 and above version protocols to carry out encryption transmission and bidirectional identity authentication, wherein the configuration content comprises deployment of a CA root certificate, a server certificate and a client certificate; step 1.3, defining two application layer message structures of handshake message and security message for communication; And 1.4, adopting RSA-2048 asymmetric encryption exchange keys, and carrying out data transmission by using AES-256-GCM symmetric encryption.
  3. 3. The method for two-way communication between the digital twin system and the PLC device in the Linux environment according to claim 2, wherein the handshake message defined in step 1.3 is used for connection initialization identity authentication, and includes a device identifier, an authentication token and a time stamp.
  4. 4. The method for bi-directional communication between a digital twin system and a PLC device in a Linux environment according to claim 2, wherein the secure message defined in step 1.3 is used for transmitting actual data, including an encrypted payload, a checksum and a sequence number, preventing replay attack by a sequence number and a time stamp mechanism, and verifying data integrity by the checksum.
  5. 5. The method for bi-directional communication between the digital twin system and the PLC device in the Linux environment according to claim 1, wherein the step 2 specifically comprises the steps of: step 2.1, creating a UE5 plug-in based on Sockets, networking, engine and an SSL core module, and supporting data conversion of a JSON format; Step 2.2, implementing the blueprint function library UBWCProtocolBlueprintLibrary, UBWCProtocolBlueprintLibrary in the UE5 plugin provides a create TLS server interface, create TLS client interface, message serialization interface, message deserialization interface, and device communication parameter configuration interface.
  6. 6. The method for bi-directional communication between the digital twin system and the PLC device in the Linux environment according to claim 1, wherein the step 3 specifically comprises the steps of: step 3.1, establishing and maintaining TCP long connection based on the safety communication channel established in the step 1 with the PLC equipment through the UE5 plug-in unit developed in the step 2; Step 3.2, enabling the digital twin system to send heartbeat messages to the PLC equipment according to a fixed period to detect the connection state, and if responses are not received for a plurality of times continuously, automatically initiating reconnection; Step 3.3, carrying out bidirectional data transfer: the PLC equipment sends state data, the data is transmitted to the digital twin system through encryption, and the digital twin system decrypts, verifies and updates the state of the corresponding equipment in the digital twin three-dimensional model after receiving the state data; In the downlink direction, a user sends a control instruction on a digital twin system interface, the digital twin system sequences the instruction into a corresponding data format according to the type of the target PLC equipment through a UE5 plug-in unit, the encrypted data is sent to the PLC equipment, after the PLC equipment executes the instruction, the execution result is encrypted and fed back, and the digital twin system receives and updates the interface state.
  7. 7. The method for bidirectional communication between a digital twin system and a PLC device in a Linux environment according to claim 1, wherein the end-to-end delay of the data interaction process in step 3 is controlled to be within 50 ms, and the retransmission mechanism is activated when the data transmission fails.
  8. 8. The method for bi-directional communication between the digital twin system and the PLC device in the Linux environment according to claim 1, wherein the step 4 specifically comprises the steps of: Step 4.1, compiling the UE5 item into a Linux executable file by using a Clang cross compiling tool chain in a Windows environment; step 4.2, adapting the Linux executable file to a domestic Linux system; step 4.3, generating a deployment package containing a CA root certificate, a server certificate, a client certificate, a runtime dependency library and a device communication configuration file; And 4.4, deploying a deployment package on the domestic Linux system, setting the self-starting of the system service and opening a corresponding firewall port.

Description

Bidirectional communication method of digital twin system and PLC equipment in Linux environment Technical Field The invention belongs to the technical field of industrial equipment communication, and particularly relates to a bidirectional communication method of a digital twin system and PLC equipment in a Linux environment. Background The existing communication technology of the digital twin system developed based on the illusion engine UE5 and the industrial equipment supporting the PLC realizes data transfer through a database or RestfulAPI, has the problems of high transmission delay (100 ms) and incapability of meeting the industrial real-time control requirement (less than or equal to 50 ms), lacks an encryption mechanism in the communication process, has the risks of stealing and tampering data transmission, and does not meet the industrial safety standard. In addition, the existing UE5 application is mainly concentrated in a Windows system, lacks the adaptation to domestic Linux systems such as kylin V10 and the like, cannot meet the requirements of domestic replacement policy and data security confidentiality, and has the advantages of non-standardized communication module, plug-in communication module, complicated integration process, poor compatibility and no contribution to quick development and deployment. Disclosure of Invention The invention aims to provide a bidirectional communication method of a digital twin system and PLC equipment in a Linux environment, which solves the problem that the prior art is difficult to realize safe real-time bidirectional communication between the digital twin system and the PLC equipment in a domestic Linux environment. The technical scheme adopted by the invention is that the bidirectional communication method of the digital twin system and the PLC equipment in the Linux environment comprises the following steps: step 1, establishing a secure communication channel based on TCP and TLS encryption and bidirectional authentication, defining an application layer message structure, and completing initial secure link connection; Step 2, developing and integrating a package communication function as a UE5 plug-in unit, and providing a visual blueprint node to configure PLC equipment parameters and process message serialization; Step 3, based on the secure communication channel and the UE5 plug-in, executing real-time bidirectional data interaction between the digital twin system and the PLC equipment, and maintaining connection with automatic reconnection through heartbeat detection; and 4, constructing the UE5 project containing the plug-in into a Linux executable file through a cross compiling tool chain and deploying configuration. The present invention is also characterized in that, The step 1 specifically comprises the following steps: step 1.1, establishing long connection between a digital twin system and PLC equipment based on a TCP protocol; step 1.2, on the basis of TCP connection, configuring and using TLS1.2 and above version protocols to carry out encryption transmission and bidirectional identity authentication, wherein the configuration content comprises deployment of a CA root certificate, a server certificate and a client certificate; step 1.3, defining two application layer message structures of handshake message and security message for communication; And 1.4, adopting RSA-2048 asymmetric encryption exchange keys, and carrying out data transmission by using AES-256-GCM symmetric encryption. The handshake message defined in step 1.3 is used for connection initiated identity authentication and contains the device identity, authentication token and time stamp. The secure message defined in step 1.3 is used to transfer the actual data, including the encrypted payload, checksum and sequence number, and the replay attack is prevented by the sequence number and time stamp mechanism, and the data integrity is verified by the checksum. The step 2 specifically comprises the following steps: step 2.1, creating a UE5 plug-in based on Sockets, networking, engine and an SSL core module, and supporting data conversion of a JSON format; Step 2.2, implementing the blueprint function library UBWCProtocolBlueprintLibrary, UBWCProtocolBlueprintLibrary in the UE5 plugin provides a create TLS server interface, create TLS client interface, message serialization interface, message deserialization interface, and device communication parameter configuration interface. The step 3 specifically comprises the following steps: step 3.1, establishing and maintaining TCP long connection based on the safety communication channel established in the step 1 with the PLC equipment through the UE5 plug-in unit developed in the step 2; Step 3.2, enabling the digital twin system to send heartbeat messages to the PLC equipment according to a fixed period to detect the connection state, and if responses are not received for a plurality of times continuously, automatically initiating rec