PLC integrated digital twinning control enhancement system and method
By introducing twin function block programming mechanism and two-level mapping form dynamic loading strategy in the PLC system, the architecture separation problem between the digital twin system and the control system in cloud PLC is solved, and the efficient integration and flexible scheduling of digital twin functions in the PLC system is realized, and the virtual and real fusion control capabilities of smart factories are improved.
Patent Information
- Application Number
- CN202510427334.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-04-07
AI Technical Summary
In the prior art, there is an architectural separation between the digital twin system of cloud PLC and the PLC control system, resulting in the spatial and temporal characteristics and inter-process independence of twin tasks and control tasks that cannot be directly mapped, making it difficult to quickly regulate virtual resources, and limiting the in-depth integration and flexible call of digital twin functions.
By introducing PLC integrated development environment module, operation environment module and virtual space module, the twin functional block programming mechanism is adopted to realize the development integration of control logic and twin services, and through DT decision-triggering sub-unit and client data analysis unit to complete parallel scheduling, design a dynamic loading strategy for two-level mapping forms to solve the elastic adaptation of twin services and physical devices in the space-time dimension.
It significantly improves the real-time embedding capability and convergence deployment efficiency of digital twin functions in PLC industrial control systems, provides high-reliability and scalable technical support for the virtual and real integration control of smart factories, and improves the intelligent decision-making capability and response speed of the control system.
Smart Images

Figure CN120540183A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud-based PLC control technology, and in particular to a control enhancement system and method for PLC integrated digital twins. Background Art
[0002] Programmable Logic Controllers (PLCs), as core components of industrial control systems, drive industrial equipment to complete manufacturing activities by running control programs. Traditional industrial control system architectures utilize PLCs as the core field control system, integrating industrial networks and various specialized industrial equipment to form a complete control system. In the context of the intelligent manufacturing transition, the evolution of PLC technology plays a key role in supporting the realization of industrial intelligence. With the advancement of computer technology, traditional PLC systems based on integrated hardware and software architectures are unable to meet the demands for flexibility and scalability.
[0003] Based on expansion needs, the new generation of industrial control technology, namely cloud PLC, is based on virtualization technology and adopts the concept of software-defined networking. It decouples the traditional dedicated PLC functional hardware and software, and realizes the functions of PLC control logic through application programs.
[0004] However, under the existing technical system, there is an architectural separation between the digital twin system based on cloud PLC and the PLC control system. This is mainly manifested in the fact that the spatiotemporal characteristics of the twin tasks and the control tasks, as well as the independence between processes, do not establish a direct mapping relationship with the control layer, or the established mapping relationship is too simple, resulting in the cloud PLC being unable to regulate virtual resources in a timely and rapid manner, which seriously restricts the deep integration and flexible calling of digital twin functions. Summary of the Invention
[0005] In order to solve the technical problem that there is an architectural split between the digital twin system based on cloud PLC and the PLC control system in the existing technology, which is mainly manifested in the spatiotemporal characteristics of the twin tasks and the control tasks, and the independence between the processes, and no direct mapping relationship is established with the control layer or the established mapping relationship is too simple, resulting in the cloud PLC being difficult to regulate virtual resources in a timely and rapid manner, and seriously restricting the deep integration and flexible calling of digital twin functions, the present invention provides a control enhancement system and method for PLC integrated digital twin.
[0006] The technical solutions provided by the embodiments of the present invention are as follows:
[0007] First aspect
[0008] An embodiment of the present invention provides a PLC integrated digital twin control enhancement system, including:
[0009] PLC physical access module, PLC integrated development environment module, PLC operating environment module and PLC virtual space module;
[0010] The PLC operating environment module is connected to the PLC physical access module, the PLC integrated development environment module and the PLC virtual space module respectively, and the PLC physical access module is connected to the PLC virtual space module;
[0011] The PLC integrated development environment module includes an instruction set generation unit, a digital twin function plug-in library, and a PLC compiler unit connected in sequence. The instruction set generation unit includes an FB library, a PLC control instruction generation unit, a control instruction mapping form, and a server intermediate variable set connected in sequence.
[0012] The PLC control instruction generation unit is used to receive user instructions from the user, and the PLC compiler unit is used to generate the operating environment in the PLC operating environment module;
[0013] The PLC operating environment module includes a protocol processing unit, a PLC main control logic unit and a server driver program connected in sequence, the PLC main control logic unit includes a DT decision trigger subunit, and the server driver program includes a policy control subroutine and a virtual control instruction sending subroutine;
[0014] The DT decision trigger subunit is connected to the server driver for data interaction, and the protocol processing unit is used to interact with the PLC physical access module for data interaction;
[0015] The PLC physical access module includes a physical IO interface and a physical data acquisition unit that are connected to each other;
[0016] The PLC virtual space module includes a client driver unit, a virtual IO management unit and a data parsing unit connected to each other, wherein the virtual IO management unit includes a space transformation subunit, a virtual IO handle and a virtual IO connected in sequence;
[0017] The virtual IO management unit is used to obtain the interface handle information of each target device virtual model and generate a device data mapping form for controlling the target device.
[0018] Second aspect
[0019] An embodiment of the present invention provides a control enhancement method for a PLC integrated digital twin, comprising:
[0020] S1: Receive user instructions;
[0021] S2: Initially configure the control enhancement system in conjunction with the PLC integrated development environment module to obtain the matching relationship between each target device and the virtual IO;
[0022] S3: Obtain the PLC control task and send the PLC control task to the PLC main control logic unit;
[0023] S4: Make a decision on the PLC control task based on the DT decision triggering sub-unit and determine the digital twin service control type of the PLC virtual space module;
[0024] S5: Control the virtual IO in the target PLC virtual space module according to the digital twin service control type.
[0025] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0026] In an embodiment of the present invention, by introducing a twin function block programming mechanism in the PLC integrated development environment level, that is, the environment can be modularly built according to user instructions, the development state integration of control logic and twin services is realized. A virtual-reality collaboration engine is constructed in the PLC operating environment module, and the parallel scheduling mechanism is completed according to the DT decision triggering sub-unit in the server-side driver and the data parsing unit of the client, so as to realize the dynamic resource configuration of physical control tasks and virtual auxiliary services. A two-level mapping form dynamic loading strategy between the control instruction mapping form and the device data mapping form is designed to solve the problem of elastic adaptation of twin services and physical devices in the time and space dimensions. Significantly improve the real-time embedding capability and fusion deployment efficiency of digital twin functions in PLC industrial control systems, and provide highly reliable and scalable technical support for the virtual-reality fusion control of smart factories. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0028] Figure 1 A schematic diagram of the structure of a PLC integrated digital twin control enhancement system provided by an embodiment of the present invention;
[0029] Figure 2 This is a timing diagram of the initial configuration of a control enhancement system for a PLC integrated digital twin provided by an embodiment of the present invention;
[0030] Figure 3 A control sequence diagram of an active control type of a digital twin service provided by an embodiment of the present invention;
[0031] Figure 4 A control sequence diagram of a passive control type of a digital twin service provided by an embodiment of the present invention;
[0032] Figure 5 A flow chart of a control enhancement method for a PLC integrated digital twin provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0033] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0034] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as an "exemplary" in the present invention should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner. Furthermore, in the embodiments of the present invention, "and / or" can mean both or either of the two.
[0035] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0036] Reference Manual Figure 1 , showing a structural schematic diagram of a control enhancement system of a PLC integrated digital twin provided by an embodiment of the present invention;
[0037] An embodiment of the present invention provides a control enhancement system for a PLC integrated digital twin, including:
[0038] PLC physical access module, PLC integrated development environment module, PLC operating environment module and PLC virtual space module.
[0039] Among them, the PLC integrated development environment IDE is a professional development platform for programmable logic controllers (PLCs). It integrates program design, debugging, testing and other functions into one, providing developers with graphical development tools. The FB library is an important programming unit in PLC programming, which is used to implement modular code encapsulation of specific functions. The function block encapsulates logical functions, data processing and state maintenance into an independent logical unit. Users can select digital twin function blocks when designing PLC applications. The PLC IDE has added a digital twin function plug-in library, namely the twin function block. The server driver specifies the intermediate variable type and exposes it to the PLC IDE. Users can establish a control instruction mapping form (Control Data Mapping, KDM) between intermediate variables and control instructions in the PLC IDE.
[0040] Furthermore, the PLC integrated development environment module builds on existing functionality by adding function blocks for controlling digital twin functions, including but not limited to standardized function blocks for virtual commissioning, remote monitoring, and decision-making. Twin function blocks support parameterized configuration to enable data exchange between different function modules, and a compiler generates the PLC runtime environment. Accordingly, the PLC virtual space module adds a client driver and virtual I / O management module to enable data exchange between PLC control instructions and the virtual I / O model.
[0041] The PLC Runtime Environment (RTE) module is a core component in a PLC system for executing and managing control programs. It can be deployed on a general-purpose system architecture server and runs user-compiled PLC programs. The PLC operation process consists of four parts: data input, logic processing, data output, and data cleanup. The first three parts are executed periodically. During the input phase, the RTE receives the status and parameters of the digital twin function blocks, executes the corresponding control logic based on the user-designed application, and then publishes the processed function block status and parameters during the output phase. A new DT decision trigger subunit has been added to the PLC main control logic unit. This subunit periodically scans the control logic, identifies trigger conditions, generates trigger signals, and transfers control to the server driver. The RTE server driver is newly added, primarily consisting of a policy control subroutine and a virtual control instruction sending subroutine. The policy control subroutine stores and provides intermediate variable information required for PLC operation and dynamically reconstructs the control instruction mapping table. The virtual control instruction sending subroutine establishes a connection with the client driver and transmits control data to the PLC virtual space module.
[0042] The PLC virtual space module is the core component of the digital twin system. Through the interaction between the virtual model and the physical control system, it enables efficient data transmission, dynamic mapping, and function switching. In the virtual space, the client driver, virtual I / O management module, and data parsing module are key functional units that jointly support the realization of digital twin functions.
[0043] The PLC operating environment module is connected to the PLC physical access module, the PLC integrated development environment module and the PLC virtual space module respectively, and the PLC physical access module is connected to the PLC virtual space module.
[0044] The PLC integrated development environment module includes an instruction set generation unit, a digital twin function plug-in library and a PLC compiler unit connected in sequence, wherein the instruction set generation unit includes an FB library, a PLC control instruction generation unit, a control instruction mapping form and a server intermediate variable set connected in sequence.
[0045] The PLC control instruction generation unit is used to receive user instructions from the user, and the PLC compiler unit is used to generate the operating environment in the PLC operating environment module.
[0046] The PLC operating environment module includes a protocol processing unit, a PLC main control logic unit and a server driver connected in sequence. The PLC main control logic unit includes a DT decision trigger subunit, and the server driver includes a strategy control subroutine and a virtual control instruction sending subroutine.
[0047] The DT decision trigger sub-unit is connected to the server driver for data interaction, and the protocol processing unit is used to interact with the PLC physical access module for data interaction.
[0048] The PLC physical access module includes a physical IO interface and a physical data acquisition unit that are interconnected.
[0049] The PLC virtual space module includes a client driver unit, a virtual IO management unit and a data parsing unit connected to each other, wherein the virtual IO management unit includes a space transformation subunit, a virtual IO handle and a virtual IO connected in sequence.
[0050] The virtual IO management unit is used to obtain the interface handle information of each target device virtual model and generate a device data mapping form for controlling the target device.
[0051] Specifically, the client driver unit consists of a state control unit, a read / write unit, and an operation evaluation unit. It receives control instruction mapping tables uploaded from the PLC RTE and writes data to the state control unit, switching between virtual and real service modes. The operation evaluation unit is responsible for obtaining virtual IO operation data, generating a strategy feasibility report, and feeding it back to the PLC-RTE. The virtual IO management unit is a newly added functional module that obtains interface handle information for each device model and, combined with node variables, performs data adaptation via the spatial transformation unit. The adapted data is then used to establish multiple device data mapping tables (DDMs) with the virtual IO device handle variables, enabling mapping and interaction between node information and virtual IO data. The mapping tables (DDMs) managed within the module support dynamic updates, enabling real-time adjustments to the state of the virtual IO device model based on system instructions. The data parsing unit is a newly added functional module that parses PLC control instructions or physical device data. Based on the instructions written by the client, different data tables are loaded or unloaded, mapped to the device data mapping table (DDM), and activated the corresponding digital twin functional module, enabling dynamic switching between different functions.
[0052] In an embodiment of the present invention, by introducing a twin function block programming mechanism in the PLC integrated development environment level, that is, the environment can be modularly built according to user instructions, the development state integration of control logic and twin services is realized. A virtual-reality collaboration engine is constructed in the PLC operating environment module, and the parallel scheduling mechanism is completed according to the DT decision triggering sub-unit in the server-side driver and the data parsing unit of the client, so as to realize the dynamic resource configuration of physical control tasks and virtual auxiliary services. A two-level mapping form dynamic loading strategy between the control instruction mapping form and the device data mapping form is designed to solve the problem of elastic adaptation of twin services and physical devices in the time and space dimensions. Significantly improve the real-time embedding capability and fusion deployment efficiency of digital twin functions in PLC industrial control systems, and provide highly reliable and scalable technical support for the virtual-reality fusion control of smart factories.
[0053] In a possible implementation, the PLC compiler unit includes a PLC editor, a PLC application integrator, and a compiler that are connected in sequence.
[0054] Among them, the PLC editor is used to generate PLC applications based on the digital twin function plug-in library, and the PLC application integrator is used to store various PLC applications.
[0055] The compiler is used to generate an operating environment corresponding to the PLC application, namely, an operating environment in the PLC operating environment module.
[0056] Specifically, the PLC compiler unit consists of three parts: the PLC editor, the PLC application integrator, and the compiler, which work together to implement the complete process from program design to runtime environment generation. The PLC editor is used to call function blocks in the digital twin function plug-in library for users to create control logic and applications. The generated multiple PLC applications are centrally managed and stored by the PLC application integrator. Finally, the compiler compiles the program content designed by the user into control code that can be executed in the PLC runtime environment, ensuring the coordination and consistency of the digital twin function and the physical control logic, and realizing the integration of development and deployment.
[0057] In one possible implementation, the PLC operating environment module further includes an initialization unit, an input unit, an output unit, and a cleanup unit. The initialization unit, input unit, PLC main control logic unit, output unit, and cleanup unit are sequentially connected. The protocol processing unit is connected to the input unit and output unit, respectively.
[0058] It should be noted that the PLC runtime environment module implements the core functions of the PLC system through a sequential structure consisting of an initialization unit, an input unit, a PLC main control logic unit, an output unit, and a cleanup unit. The initialization unit is responsible for system startup configuration, the input unit receives data from external devices, the PLC main control logic unit executes the control program, the output unit transmits the control results to the physical devices, and the cleanup unit handles resource release and system reset after the task is completed. Furthermore, the protocol processing unit is connected to the input and output units to ensure efficient data transmission and format conversion between the PLC and external devices.
[0059] In one possible implementation, the client driver unit includes an operation evaluation subunit, a read / write subunit, and a status control subunit connected in sequence. The status control subunit is connected to the data parsing unit. The operation evaluation subunit is connected to the virtual IO.
[0060] It should be noted that the client driver unit is composed of an operation evaluation subunit, a read / write subunit, and a state control subunit, which are used to dynamically control and manage digital twin services in the virtual space. The operation evaluation subunit is responsible for collecting virtual IO operation data and performing strategy feasibility assessments. The read / write subunit is used to interact with the PLC system, and the state control subunit adjusts the virtual service state based on PLC control data and transmits this state information to the data analysis unit. This enables dynamic loading, unloading, and function switching of the twin service, ensuring the coordinated operation of the virtual system and control logic.
[0061] In a possible implementation, the virtual IO corresponds to the target device in a one-to-one manner, and the identification ID of the virtual IO is the same as the device ID of the corresponding target device.
[0062] It can be understood that each virtual IO strictly corresponds to a physical target device and shares the same identification ID, so that the virtual model can accurately map and synchronize the physical device status, thereby achieving efficient data interaction and control consistency.
[0063] Specifically, the PLC integrated digital twin control enhancement system introduces standardized digital twin function blocks in the PLC development environment, allowing users to directly integrate virtual models with control logic during the programming phase, and automatically generate instruction mapping forms to achieve visual configuration and modular calling of twin services. When the system is running, relying on the DT decision trigger mechanism and server-side driver in the PLC operating environment, twin services can be dynamically loaded or unloaded according to control requirements to achieve switching between active control and passive observation modes. The client driver, virtual IO management and data parsing unit in the virtual space module jointly support real-time mapping and collaborative operation between virtual device models and physical IO. The overall system solves the problems of separation between traditional PLC and digital twin system architectures, rigid resource scheduling, and difficulty in real-time interaction, and improves the intelligent decision-making ability, response speed and deployment flexibility of the control system. It is particularly suitable for complex industrial control scenarios such as intelligent manufacturing, industrial simulation, and remote monitoring.
[0064] Reference Manual Figure 2 , shows the initial configuration timing diagram of a PLC integrated digital twin control enhancement system provided by an embodiment of the present invention.
[0065] Figure 2 The complete configuration process before the system is executed is demonstrated. The user selects the corresponding function block in the PLC-IDE (i.e., the PLC integrated development environment module) to build the control program. According to the identifier type and input and output format of each function block, a mapping relationship is established with the intermediate variables provided by the policy control unit. The control program is compiled to generate a runtime system and a control instruction mapping table (KDM). On the virtual space side, the system builds a virtual IO device model based on the physical IO device, including physical, geometric, behavioral and rule models, and assigns a unique interface ID to each model to form a virtual IO mapping form. On the physical side, the device operation data is collected through sensors, and a physical IO mapping form is generated according to the device ID. It is stored in the data acquisition module, thereby completing the three-layer mapping relationship between virtual and physical space (KDM, DDM, physical IO table). This process realizes accurate pre-configuration in the development stage of the digital twin system through hierarchical mapping and modular function block interface design, significantly improving development efficiency.
[0066] Reference Manual Figure 3 , shows a control timing diagram of an active control type of digital twin service provided by an embodiment of the present invention.
[0067] Figure 3The control sequence of the active control type of the digital twin service during the system execution phase is demonstrated. The server driver periodically scans the DT decision trigger module in the PLC main control logic. Upon detecting a trigger signal, the PLC execution process is interrupted, the KDM is reconstructed into a composite form of identifiers and mapping tables, and transmitted to the client driver. After the client driver receives the form through the read / write module, the state control module identifies the identifier type, unloads the old data table, parses the new mapping relationship, and completes the conversion of control instructions into virtual IO data by binding intermediate variables to the model interface in the DDM. After the virtual IO management unit drives the virtual device to operate, the operation evaluation subunit monitors the status in real time, evaluates the feasibility of the operation, and generates a report. Finally, the read / write subunit provides feedback to the PLC runtime environment module (i.e., PLC-RTE) and resumes execution. The advantages of this process lie in ensuring real-time response through periodic scanning, improving data conversion efficiency through the composite form, and forming a closed decision optimization loop in combination with the feasibility evaluation module. This enhances the dynamic adaptability and strategy verification capabilities of the digital twin in active control.
[0068] Reference Manual Figure 4 , shows a control timing diagram of a passive control type of digital twin service provided by an embodiment of the present invention.
[0069] Figure 4 The control sequence of the passive control type of the digital twin service in the system execution phase is demonstrated. The output stage control information in the PLC operating environment is transmitted to the physical IO module through the protocol processing unit. The data acquisition module obtains the physical IO table and uploads it to the client driver, waiting for the client to receive a response. The server driver periodically scans the DT decision trigger module in the PLC main control logic. After scanning the trigger signal, it interrupts the PLC execution process, obtains the target function block identifier and transmits it to the client driver, and resumes the PLC execution process. After the client driver receives the identifier through the read-write module, the state control module recognizes the identifier type as a passive service type, synchronously responds to the request of the data acquisition module and receives the physical IO table. The physical IO table is parsed, and the conversion of physical IO data to virtual IO data is completed by binding the ID type with the model interface in the DDM. Finally, the virtual IO management unit drives the virtual device to run. The advantage of the process flow is that the data synchronization of the virtual end is completely dominated by the PLC end. The PLC controls the timing and content of data reception on the virtual end by actively triggering the identifier transmission and interrupt recovery mechanism, which not only retains the master control of the PLC, but also ensures the consistency of data conversion when the virtual end responds passively through the device ID-model interface mapping relationship, realizing a collaborative mode of control priority and virtual synchronization slave.
[0070] Reference Manual Figure 5 , which shows a flow chart of a control enhancement method for a PLC integrated digital twin provided by an embodiment of the present invention.
[0071] The present invention also provides a control enhancement method for a PLC integrated digital twin, which is applied to the above-mentioned control enhancement system for the PLC integrated digital twin, and the method comprises:
[0072] S1: Receive user instructions.
[0073] S2: Perform initial configuration of the control enhancement system in conjunction with the PLC integrated development environment module to obtain the matching relationship between each target device and the virtual IO.
[0074] In a possible implementation, the matching relationship includes a control instruction mapping table, a virtual IO mapping table, and a physical IO mapping table. S2 specifically includes:
[0075] S201: Obtain a server intermediate variable set.
[0076] S202: Define function blocks in the digital twin function plug-in library according to the server intermediate variable set.
[0077] S203: Obtain a user instruction, and call a target function block corresponding to the user instruction.
[0078] S204: Determine the target function block identifier according to the target function block type.
[0079] S205: According to the input and output data formats of the target function blocks, a mapping relationship between each target function block and the intermediate variable is established to obtain a control instruction mapping table.
[0080] S206: Based on the target function block identifier and the mapping relationship, the compiler generates the operating environment in the PLC operating environment module to complete the PLC side configuration.
[0081] S207: Establish a virtual IO device model for the target device, allocate a virtual IO device model interface ID, and establish a mapping relationship between each virtual IO device model and the corresponding target device based on the virtual IO device model interface to obtain a virtual IO mapping form to complete the twin configuration.
[0082] The virtual IO device model includes a physical model, a geometric model, a behavioral model and a rule model.
[0083] S208: Obtain target device IDs, and establish mapping relationships between target device IDs based on target device data to obtain a physical IO mapping table.
[0084] S209: The mapping relationship between the target device IDs is stored in the physical data acquisition unit to complete the configuration of the PLC physical access module.
[0085] Specifically, during the configuration phase, the system first receives user instructions, in which the user specifies the control logic to be implemented and the target device information. The system then enters the initial configuration process, completing the mapping and binding between the twin system and the physical device through the PLC integrated development environment module. Specifically, the server-side driver provides a set of intermediate variables. Developers select or define corresponding function blocks from the digital twin function plug-in library and call the function blocks that match the user instructions to build the control program. Each function block is assigned a unique identifier. Based on its input and output formats, a mapping relationship is established between the intermediate variables to generate a control instruction mapping table (KDM). The compiler then compiles and generates the PLC runtime environment based on the identifiers and mapping relationships. On the virtual space side, the system constructs a virtual IO device model based on the physical IO devices, including physical, geometric, behavioral, and rule models. Each model is assigned a unique interface ID to form a virtual IO mapping table. On the physical side, sensors collect device operating data, generate a physical IO mapping table based on the device ID, and store it in the data acquisition module, thus completing the three-level mapping relationship between the virtual and physical spaces (KDM, DDM, and physical IO table). This process ensures that the digital twin functions and control programs are accurately connected during the development phase, laying the foundation for subsequent dynamic loading, collaborative control, and virtual-reality linkage.
[0086] S3: Obtain the PLC control task and send the PLC control task to the PLC main control logic unit.
[0087] S4: Make a decision on the PLC control task based on the DT decision trigger sub-unit and determine the digital twin service control type of the PLC virtual space module.
[0088] In a possible implementation, S4 specifically includes:
[0089] S401: Periodically scan the DT decision trigger subunit through the policy control subroutine.
[0090] S402: When there is a trigger signal in the DT decision trigger subunit, the digital twin function is turned on and the digital twin service control type of the trigger signal is obtained, where the digital twin service control type includes the digital twin service active control type and the digital twin service passive control type.
[0091] It should be noted that during the decision execution phase, when the PLC system detects a new control requirement during operation, the system determines whether to activate the digital twin service function based on the judgment result of the DT decision trigger subunit. Specifically, the policy control subroutine periodically scans the DT decision trigger subunit. Once a trigger signal is detected, indicating a change in the field control task or the need for higher-level auxiliary decision making, the digital twin service function is immediately activated. At this point, the system automatically determines the type of twin service control required based on the trigger signal content: whether to participate in the decision and control process as "active control" or to perform only virtual simulation and status recording as "passive observation." This mechanism, based on the three-layer mapping relationship pre-established during the configuration phase (control instruction mapping table, virtual IO mapping table, and physical IO mapping table), quickly identifies the required service type and loads the corresponding control resources. This ensures that in complex dynamic scenarios, the PLC system can autonomously and in real time call on twin resources to achieve more efficient and intelligent control responses, achieving seamless linkage and switching between virtual and real systems.
[0092] S5: Control the virtual IO in the target PLC virtual space module according to the digital twin service control type.
[0093] In a possible implementation, S5 specifically includes:
[0094] S501: When the digital twin service control type is the digital twin service active control type and a trigger signal is received, the PLC execution process is interrupted for a preset duration.
[0095] It should be noted that those skilled in the art can set the preset duration according to actual needs, and the present invention does not limit this.
[0096] S502: Obtain the target function block identifier in the control instruction mapping table in a shared memory manner through the policy control subroutine, and store the target function block identifier in the control buffer.
[0097] S503: Retrieve the control instruction mapping table in the control buffer through the virtual control instruction sending subroutine, and upload the control instruction mapping table to the client driver unit.
[0098] S504: Parse the control instruction mapping table to complete the conversion of control instruction data into virtual IO data.
[0099] S505: Map the converted control instruction data to the virtual IO through the virtual IO management unit to complete the control process of the active control type of the digital twin service.
[0100] S506: Obtain the virtual IO operation status during the control process through the operation evaluation subunit, evaluate the feasibility of the operation strategy and generate a feasibility report.
[0101] S507: Feedback the feasibility report to the operating environment module through the read-write subunit.
[0102] S508: Resume the PLC execution process.
[0103] It should be noted that during the execution phase, when the digital twin service is determined to be of "active control type," the system will dynamically control the target PLC based on control requirements. Specifically, upon detecting a trigger signal (identified by the DT decision trigger subunit), the server driver will interrupt the PLC execution process for a preset duration to free up system resources for loading and running the digital twin service. Subsequently, the policy control subroutine extracts the unique identifier of the currently executed twin function block through shared memory and stores it in the control buffer as a scheduling basis. Next, the virtual control instruction sending subroutine retrieves the KDM from the control buffer and uploads it to the client driver unit. The client driver unit parses the KDM and converts the control instruction data into virtual I / O operation data. The virtual I / O management unit maps the data to the corresponding virtual I / O, driving the virtual I / O operation. After the conversion is complete, the operation evaluation subunit obtains the virtual I / O operation status data and evaluates the feasibility of the policy. After the twin system completes the policy evaluation, it feeds the results back to the PLC. The system then resumes the original PLC execution process and continues or adjusts subsequent control tasks. This mechanism ensures that digital twin services can proactively intervene at key control nodes, provide auxiliary decision-making or simulation verification, and effectively improve the flexibility, intelligence level, and response accuracy of the control system.
[0104] In a possible implementation manner, after S507, the method further includes:
[0105] S508: Write the target function block identifier into the state control sub-unit of the client driver unit. The state control sub-unit unloads the historical form parsed by the data parsing unit according to the target function block identifier type, and switches the digital twin service control type to the digital twin service passive control type.
[0106] It should be noted that after the system completes the active control process and resumes PLC execution, it will enter the auxiliary observation phase of the twin service. At this time, the system writes the current target function block identifier to the state control subunit in the client driver unit to indicate whether the next twin service needs to switch modes. By identifying the type of the identifier, the state control subunit automatically unloads the historical data form loaded by the data parsing unit during the previous active control process, and switches to "passive control" mode according to the configuration corresponding to the current identifier. In this mode, the virtual space no longer intervenes in the control decision-making process, but acts as an observer, continuously receiving data from the PLC-RTE and the physical space to achieve synchronous updates and operations of virtual IO. This mechanism ensures that after the control task is completed, the digital twin service can seamlessly transition from the participatory control state to the lightweight observation state, saving resources while maintaining comprehensive monitoring capabilities of the system's operating status, providing preparation for subsequent scenarios that require re-intervention, and realizing flexible linkage and dynamic switching between virtual and real systems.
[0107] In practical applications, a PLC-integrated digital twin control enhancement method builds a dynamic collaborative mechanism that integrates virtual models and physical control systems, encompassing the entire "configuration-decision-execution-feedback" process. This method first receives user instructions through the PLC integrated development environment module, constructs a twin function block, generates a control program, and establishes a control instruction mapping table, a virtual I / O mapping table, and a physical I / O mapping table, completing the initial configuration of the virtual-physical system. During the runtime phase, the system uses a DT decision-triggering mechanism to determine whether to invoke the digital twin service and selects either active or passive control mode based on actual control requirements. In active mode, the system interrupts PLC execution, retrieves the twin function block, and executes and evaluates the virtual model's strategy, assisting in decision-making and providing synchronous feedback. Upon completion, the system resumes the original execution process. In passive mode, the virtual space only synchronously observes the physical system's operating status and does not participate in control decisions. This method enables modular invocation, on-demand loading, flexible switching, and efficient collaboration of digital twin services, significantly improving the intelligence, adaptability, and reliability of PLC control systems. It is suitable for industrial intelligent control requirements in multi-task, multi-state, and dynamic scenarios.
[0108] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0109] In an embodiment of the present invention, by introducing a twin function block programming mechanism in the PLC integrated development environment level, that is, the environment can be modularly built according to user instructions, the development state integration of control logic and twin services is realized. A virtual-reality collaboration engine is constructed in the PLC operating environment module, and the parallel scheduling mechanism is completed according to the DT decision triggering sub-unit in the server-side driver and the data parsing unit of the client, so as to realize the dynamic resource configuration of physical control tasks and virtual auxiliary services. A two-level mapping form dynamic loading strategy between the control instruction mapping form and the device data mapping form is designed to solve the problem of elastic adaptation of twin services and physical devices in the time and space dimensions. Significantly improve the real-time embedding capability and fusion deployment efficiency of digital twin functions in PLC industrial control systems, and provide highly reliable and scalable technical support for the virtual-reality fusion control of smart factories.
[0110] The above embodiments can be implemented in whole or in part through software, hardware (such as circuits), firmware, or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, the processes or functions described in accordance with the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired method (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains a collection of one or more available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, or magnetic tape), an optical medium (such as a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.
[0111] It should be understood that the term "and / or" as used herein simply describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. A and B can be singular or plural. Furthermore, the character " / " as used herein generally indicates an "or" relationship between the associated objects, but it may also indicate an "and / or" relationship. For specific understanding, please refer to the context.
[0112] In this disclosure, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, "at least one of a, b, or c" can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural.
[0113] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0114] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0115] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0116] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interface, indirect coupling or communication connection of the device or unit, which can be electrical, mechanical or other forms.
[0117] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0118] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0119] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0120] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
[0121] There are a few points to note:
[0122] (1) The drawings of the embodiments of the present invention only relate to the structures related to the embodiments of the present invention. Other structures may refer to conventional designs.
[0123] (2) For the sake of clarity, the thickness of layers or regions in the drawings used to describe the embodiments of the present invention are exaggerated or reduced, that is, these drawings are not drawn to scale. It is understood that when an element such as a layer, film, region, or substrate is referred to as being "on" or "under" another element, the element may be "directly" "on" or "under" the other element or intervening elements may be present.
[0124] (3) In the absence of conflict, the embodiments of the present invention and the features therein may be combined with each other to form new embodiments.
[0125] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. The protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A PLC integrated digital twin control enhancement system, characterized in that: include: PLC physical access module, PLC integrated development environment module, PLC operating environment module and PLC virtual space module; The PLC operating environment module is connected to the PLC physical access module, the PLC integrated development environment module and the PLC virtual space module respectively, and the PLC physical access module is connected to the PLC virtual space module; The PLC integrated development environment module includes an instruction set generation unit, a digital twin function plug-in library, and a PLC compiler unit connected in sequence, wherein the instruction set generation unit includes an FB library, a PLC control instruction generation unit, a control instruction mapping form, and a server intermediate variable set connected in sequence; Wherein, the PLC control instruction generation unit is used to receive a user instruction from a user, and the PLC compiler unit is used to generate an operating environment in the PLC operating environment module; The PLC operating environment module includes a protocol processing unit, a PLC main control logic unit and a server driver connected in sequence, the PLC main control logic unit includes a DT decision trigger subunit, and the server driver includes a policy control subroutine and a virtual control instruction sending subroutine; wherein the DT decision triggering subunit is connected to the server driver for data interaction, wherein the protocol processing unit is used to interact with the PLC physical access module for data interaction; The PLC physical access module includes a physical IO interface and a physical data acquisition unit connected to each other; The PLC virtual space module includes a client driver unit, a virtual IO management unit and a data parsing unit connected to each other, wherein the virtual IO management unit includes a space transformation subunit, a virtual IO handle and a virtual IO connected in sequence; The virtual IO management unit is used to obtain the interface handle information of each target device virtual model and generate a device data mapping form for controlling the target device.
2. The PLC integrated digital twin control enhancement system according to claim 1 is characterized in that: The PLC compiler unit includes a PLC editor, a PLC application integrator and a compiler connected in sequence; wherein the PLC editor is used to generate a PLC application according to the digital twin function plug-in library, wherein the PLC application integrator is used to store each of the PLC applications; The compiler is used to generate an operating environment corresponding to the PLC application, namely, an operating environment in the PLC operating environment module.
3. The PLC integrated digital twin control enhancement system according to claim 1 is characterized in that: The PLC operating environment module also includes an initialization unit, an input unit, an output unit and a cleaning unit; the initialization unit, the input unit, the PLC main control logic unit, the output unit and the cleaning unit are connected in sequence; the protocol processing unit is connected to the input unit and the output unit respectively.
4. The PLC integrated digital twin control enhancement system according to claim 1 is characterized in that: The client driver unit includes an operation evaluation subunit, a read-write subunit and a status control subunit connected in sequence; the status control subunit is connected to the data parsing unit; and the operation evaluation subunit is connected to the virtual IO.
5. The control enhancement system of PLC integrated digital twin according to claim 1 is characterized in that: The virtual IO corresponds to the target device one by one; the identification ID of the virtual IO is the same as the device ID of the corresponding target device.
6. A control enhancement method for PLC integrated digital twin, characterized in that: Methods include; S1: Receive user instructions; S2: Initially configure the control enhancement system in combination with the PLC integrated development environment module to obtain a matching relationship between each target device and the virtual IO; S3: Acquire a PLC control task, and send the PLC control task to the PLC main control logic unit; S4: Making a decision on the PLC control task according to the DT decision triggering subunit to determine the digital twin service control type of the PLC virtual space module; S5: Control the virtual IO in the target PLC virtual space module according to the digital twin service control type.
7. The control enhancement method of PLC integrated digital twin according to claim 6 is characterized in that: The matching relationship includes a control instruction mapping table, a virtual IO mapping table, and a physical IO mapping table; S2 specifically includes: S201: Acquire the server intermediate variable set; S202: defining a function block in the digital twin function plug-in library according to the server intermediate variable set; S203: Acquire the user instruction and call the target function block corresponding to the user instruction; S204: Determine the target function block identifier according to the target function block type; S205: Establishing a mapping relationship between each target function block and the intermediate variable according to the input and output data format of the target function block to obtain the control instruction mapping table; S206: Based on the target function block identifier and the mapping relationship, the compiler generates an operating environment in the PLC operating environment module to complete the PLC side configuration; S207: Establish a virtual IO device model for the target device, assign a virtual IO device model interface ID, and establish a mapping relationship between each virtual IO device model and the corresponding target device according to the virtual IO device model interface to obtain the virtual IO mapping table, thereby completing the twin configuration; S208: Obtain target device IDs, and establish mapping relationships between target device IDs based on target device data to obtain the physical IO mapping table; S209: Storing the mapping relationship between the target device IDs in the physical data acquisition unit to complete the configuration of the PLC physical access module.
8. The control enhancement method of PLC integrated digital twin according to claim 6 is characterized in that: The S4 specifically includes: S401: Periodically scanning the DT decision triggering subunit through the policy control subroutine; S402: When there is a trigger signal in the DT decision trigger subunit, the digital twin function is turned on and the digital twin service control type of the trigger signal is obtained, wherein the digital twin service control type includes the digital twin service active control type and the digital twin service passive control type.
9. The control enhancement method of PLC integrated digital twin according to claim 8, characterized in that: The S5 specifically includes: S501: When the digital twin service control type is the digital twin service active control type and a trigger signal is received, interrupt the PLC execution process for a preset time length; S502: Obtaining the target function block identifier in the control instruction mapping table in a shared memory manner through the policy control subroutine, and storing the target function block identifier in the control buffer; S503: Retrieving a control instruction mapping table in a control buffer through a virtual control instruction sending subroutine, and uploading the control instruction mapping table to a client driver unit; S504: Parse the control instruction mapping table to complete the conversion of control instruction data into virtual IO data; S505: Mapping the converted control instruction data to the virtual IO through the virtual IO management unit to complete the control process of the active control type of the digital twin service; S506: Obtain the virtual IO operation status during the control process through the operation evaluation subunit, evaluate the feasibility of the operation strategy and generate a feasibility report; S507: Feedback the feasibility report to the operating environment module through the read-write subunit; S508: Resume the PLC execution process.
10. The control enhancement method of PLC integrated digital twin according to claim 9 is characterized in that: After S507, the method further includes: S508: Write the target function block identifier into the state control sub-unit of the client driving unit. The state control sub-unit unloads the historical form parsed by the data parsing unit according to the target function block identifier type, and switches the digital twin service control type to the digital twin service passive control type.
Citation Information
Patent Citations
Mechanism logic modeling system based on digital twin
CN113722887A
AGVS virtual-real fusion intelligent management and control system based on digital twinning
CN116859849A
Cited By
Digital twinning enabling intelligent industrial centralized control method and system
CN120742770A
Method and system for dynamically expanding IO equipment control through PLC
CN121209409A