Method and apparatus for maintaining physical PLC by using virtual PLC, and medium
By configuring and switching virtual PLCs, the downtime problem caused by the need for redundancy when replacing physical PLCs in existing technologies is solved, enabling non-stop maintenance and improving maintenance efficiency and system reliability.
Patent Information
- Application Number
- PCT/CN2024/116036
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-03-05
AI Technical Summary
In existing technologies, replacing a running physical PLC requires a redundant backup PLC, which leads to downtime maintenance and makes it impossible to achieve maintenance without shutting down the machine.
By configuring a virtual PLC, synchronizing data and verifying output differences, switching to the virtual PLC output for maintenance, and synchronizing data and verifying physical PLC output differences before switching back to the physical PLC output, non-stop maintenance without the need for redundant backup PLCs can be achieved.
This enables non-stop maintenance of physical PLCs, improving maintenance efficiency and system reliability while reducing downtime.
Smart Images

Figure CN2024116036_05032026_PF_FP_ABST
Abstract
Description
A method, apparatus, and medium for maintaining a physical PLC using a virtual PLC. Technical Field
[0001] This invention relates to the field of industrial automation, and in particular to a method, apparatus, and medium for maintaining a physical PLC using a virtual PLC. Background Technology
[0002] As IT (Information Technology) is increasingly applied to industrial automation, new products are constantly emerging. One ingenious example is the virtual PLC (Virtual Programmable Logic Controller). Based on information technology and general-purpose hardware, it can provide the same functionality as a traditional physical PLC. Compared to traditional physical PLCs, virtual PLCs even have advantages in performance, cost, flexibility, scalability, and IT-OT connectivity. These characteristics make virtual PLCs a good choice for the future convergence of automation and IT-OT. Furthermore, it offers new possibilities for improving the performance of traditional physical PLCs.
[0003] Summary of the Invention
[0004] To achieve the above objectives, this invention proposes a method, apparatus, and storage medium for maintaining a physical PLC using a virtual PLC, enabling maintenance without downtime without requiring another physical PLC as a redundant backup.
[0005] This invention proposes a method for maintaining a physical PLC using a virtual PLC, comprising: configuring the virtual PLC: downloading the same configuration file and user program as the physical PLC running in the system to the virtual PLC; synchronizing data to the virtual PLC: turning off the output of the virtual PLC to the system, and synchronizing the input data from the system to the physical PLC to the virtual PLC, and synchronizing the process data from the physical PLC to the virtual PLC; verifying the virtual PLC output: keeping the output of the virtual PLC to the system turned off, verifying whether the difference between the calculated output generated by the virtual PLC and the calculated output generated by the physical PLC meets a first preset condition; switching to virtual PLC. Virtual PLC Output: Disables the output from the physical PLC to the system and enables the output from the virtual PLC to the system; Physical PLC Maintenance: Maintains the physical PLC's output from the system while keeping it disabled, and performs maintenance on the physical PLC; Synchronizes Data to Physical PLC: Synchronizes the input data and process data in the virtual PLC to the physical PLC; Verifies Physical PLC Output: Maintains the physical PLC's output from the system while keeping it disabled, and verifies whether the difference between the calculated output generated by the virtual PLC and the calculated output generated by the physical PLC meets a second preset condition; Switches to Physical PLC Output: Disables the output from the virtual PLC to the system and enables the output from the physical PLC to the system. This allows for maintenance without downtime, without requiring another physical PLC as a redundancy backup.
[0006] An embodiment of the present invention provides an apparatus for maintaining a physical PLC using a virtual PLC, comprising: configuring a virtual PLC module, configured to: download the same configuration file and user program as those in the physical PLC running in the system to the virtual PLC; synchronizing data to a virtual PLC module, configured to: disable the output of the virtual PLC to the system, and synchronously input the input data from the system to the physical PLC to the virtual PLC, and synchronize the process data in the physical PLC to the virtual PLC; verifying a virtual PLC output module, configured to: keep the output of the virtual PLC to the system disabled, and verify whether the difference between the calculated output generated by the virtual PLC and the calculated output generated by the physical PLC meets a first preset condition; and switching to the virtual PLC output module. The module is configured to: disable the output from the physical PLC to the system and enable the output from the virtual PLC to the system; maintain the physical PLC module, configured to: keep the output from the physical PLC to the system disabled and perform maintenance on the physical PLC; synchronize data to the physical PLC module, configured to: synchronize the input data and the process data in the virtual PLC to the physical PLC; verify the physical PLC output module, configured to: keep the output from the physical PLC to the system disabled and verify whether the difference between the calculated output generated by the virtual PLC and the calculated output generated by the physical PLC meets a second preset condition; switch to the physical PLC output module, configured to: disable the output from the virtual PLC to the system and enable the output from the physical PLC to the system. This allows for maintenance without downtime without requiring another physical PLC as a redundant backup.
[0007] An electronic device according to an embodiment of the present invention includes: at least one processor; and a memory coupled to the at least one processor, the memory being used to store instructions that, when executed by the at least one processor, cause the processor to perform the method described above.
[0008] The present invention provides a computer-readable storage medium storing computer instructions, which, when executed, perform the methods described in any of the above embodiments.
[0009] An embodiment of the present invention provides a computer program product, which includes a computer program that, when executed by a processor, implements the method described in any of the above embodiments. Attached Figure Description
[0010] The following figures are intended only to illustrate and explain the invention and do not limit the scope of the invention.
[0011] Figure 1 is a flowchart illustrating a method 100 for maintaining a physical PLC using a virtual PLC according to an embodiment of the present invention.
[0012] Figure 2 is a schematic diagram of a device 200 for maintaining a physical PLC using a virtual PLC according to an embodiment of the present invention.
[0013] Figure 3 is a schematic diagram of an electronic device 300 according to an embodiment of the present invention.
[0014] The annotations in the attached figures are explained as follows: Detailed Implementation
[0015] To provide a clearer understanding of the technical features, objectives, and effects of the present invention, specific embodiments of the present invention will now be described with reference to the accompanying drawings.
[0016] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the invention is not limited to the specific embodiments disclosed below.
[0017] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not specifically singular and may include plural forms. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.
[0018] Under normal circumstances, replacing a faulty PLC in operation is only applicable to redundant PLCs. For example, the SIMATIC S7-1500R redundant system compensates for potential CPU failures or redundant connections. When replacing a CPU during factory operation, the user does not need to interrupt the production process. Automatic master-slave switching occurs when the primary CPU fails or stops. For S7-1500R redundant use cases, both CPUs need to have the same part number and firmware version. Furthermore, the PROFINET device should support MRP and H-Sync forwarding.
[0019] User programs and configurations can also be updated during runtime. Runtime Configuration (CiR) is a feature that allows system and configuration changes (such as hardware additions or modifications) to be made during operation without causing plant downtime. Both TCiR and CiR / H-CiR have their own constraints.
[0020] Therefore, this invention proposes a more effective method, apparatus, and medium for maintaining a physical PLC using a virtual PLC.
[0021] Figure 1 is a flowchart illustrating a method 100 for maintaining a physical PLC using a virtual PLC according to an embodiment of the present invention. As shown in Figure 1, the method 100 may include:
[0022] Step S101, Configure Virtual PLC: Download the same configuration file and user program as the physical PLC running in the system to the virtual PLC.
[0023] In this embodiment, a license for the virtual PLC is obtained and / or the virtual PLC service is subscribed to, and the virtual PLC is deployed to the target environment of the system.
[0024] Specifically, licenses and / or subscriptions for virtual PLCs can be obtained based on usage time or time period.
[0025] Specifically, the target environment is typically an edge device. The target environment should have fieldbus connectivity and can be a network adapter supporting the PROFINET software protocol stack. Furthermore, if TSN or other real-time networking technologies are available, the target environment can also be a cloud server.
[0026] Step S102, Synchronize data to virtual PLC: Turn off the output of the virtual PLC to the system, and synchronize the input data of the system to the physical PLC to the virtual PLC, and synchronize the process data in the physical PLC to the virtual PLC.
[0027] In this embodiment, the process data synchronization from the physical PLC to the virtual PLC and the process data synchronization from the virtual PLC to the physical PLC are performed through a dedicated interface.
[0028] Specifically, the dedicated interface can be the same as the redundant PLC synchronization interface, or it can be the same as the online debugging data synchronization interface of the engineering station.
[0029] Specifically, synchronous input data can be achieved through a fieldbus protocol that allows multiple master stations to receive input data simultaneously.
[0030] Step S103, Verify the virtual PLC output: Keep the output from the virtual PLC to the system turned off, and verify whether the difference between the calculation output generated by the virtual PLC and the calculation output generated by the physical PLC meets the first preset condition.
[0031] Specifically, verify the output values and timing to ensure that the output of the virtual PLC is the same as that of the physical PLC, or that the deviation is acceptable. It may be acceptable for the output of the virtual PLC to lag behind the output of the physical PLC by a few time cycles, depending on the control objective.
[0032] Step S104, switch to virtual PLC output: turn off the output from the physical PLC to the system, and enable the output from the virtual PLC to the system.
[0033] In this embodiment, shutting down the output of the virtual PLC to the system means disconnecting the virtual PLC from the output module of the system that receives PLC data, and shutting down the output of the physical PLC to the system means disconnecting the physical PLC from the output module of the system that receives PLC data.
[0034] Step S105, Maintain physical PLC: Keep the output of the physical PLC to the system off and perform maintenance on the physical PLC.
[0035] Specifically, this could involve replacing the physical PLC, or performing maintenance such as firmware upgrades, configuration upgrades, or user program upgrades on the physical PLC. It is essential to ensure that the definitions of process data remain consistent or compatible before and after the update.
[0036] Step S106, Synchronize data to physical PLC: Synchronize the input data and the process data in the virtual PLC to the physical PLC.
[0037] Step S107, verify the physical PLC output: keep the output from the physical PLC to the system turned off, and verify whether the difference between the calculation output generated by the virtual PLC and the calculation output generated by the physical PLC meets the second preset condition.
[0038] Step S108, switch to physical PLC output: turn off the output from the virtual PLC to the system, and enable the output from the physical PLC to the system.
[0039] In this embodiment, the method further includes step S109, releasing the virtual PLC: releasing the license and / or subscription of the virtual PLC.
[0040] In this embodiment, the first preset condition and the second preset condition are that the calculation outputs of the virtual PLC and the physical PLC are the same and / or there is a time deviation that satisfies the control target.
[0041] Specifically, this application presupposes that the user must have complete control over the project, including hardware and software configuration, user programs, and related hardware equipment. Furthermore, the physical PLC should be free of fatal errors prior to maintenance.
[0042] Figure 2 is a schematic diagram of a device 200 for maintaining a physical PLC using a virtual PLC according to an embodiment of the present invention. As shown in Figure 2, the device 200 may include:
[0043] The virtual PLC module 201 is configured to download the same configuration files and user programs as those in the physical PLC running in the system to the virtual PLC.
[0044] The virtual PLC module 202 is configured to: disable the output of the virtual PLC to the system, synchronize the input data of the system to the physical PLC to the virtual PLC, and synchronize the process data in the physical PLC to the virtual PLC.
[0045] The virtual PLC output verification module 203 is configured to: keep the output from the virtual PLC to the system turned off, and verify whether the difference between the calculation output generated by the virtual PLC and the calculation output generated by the physical PLC meets a first preset condition.
[0046] Switch to virtual PLC output module 204, which is configured to: disable the output from the physical PLC to the system, and enable the output from the virtual PLC to the system.
[0047] The physical PLC module 205 is configured to maintain the physical PLC's output to the system while keeping it off, and to perform maintenance on the physical PLC.
[0048] The data synchronization module 206 is configured to synchronize the input data and the process data in the virtual PLC to the physical PLC.
[0049] The physical PLC output verification module 207 is configured to: keep the output from the physical PLC to the system off, and verify whether the difference between the calculation output generated by the virtual PLC and the calculation output generated by the physical PLC meets the second preset condition.
[0050] Switch to physical PLC output module 208, configured to: disable the output from the virtual PLC to the system, and enable the output from the physical PLC to the system.
[0051] The present invention also proposes an electronic device 300. Figure 3 is a schematic diagram of an electronic device 300 according to an embodiment of the present invention. As shown in Figure 3, the electronic device 300 includes a processor 310 and a memory 320, wherein the memory 320 stores instructions, wherein when the instructions are executed by the processor 310, they implement the method 100 described above.
[0052] The present invention also proposes a computer-readable storage medium having computer instructions stored thereon, which, when executed, perform the methods described above.
[0053] The present invention also proposes a computer program product, including a computer program that, when executed by a processor, performs the methods described above.
[0054] Some aspects of the methods and apparatus of this invention can be executed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The aforementioned hardware or software may be referred to as a "data block," "module," "engine," "unit," "component," or "system." The processor may be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DAPDs), programmable logic devices (PLCs), field-programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, or combinations thereof. Furthermore, aspects of this invention may be embodied as computer products residing in one or more computer-readable media, including computer-readable program code. For example, computer-readable media may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, magnetic tapes, etc.), optical discs (e.g., compact discs (CDs), digital multifunction discs (DVDs), etc.), smart cards, and flash memory devices (e.g., cards, sticks, key drives, etc.).
[0055] Flowcharts are used herein to illustrate the operations performed by the method according to embodiments of this application. It should be understood that the preceding operations are not necessarily performed in exact order. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations may be added to these processes, or one or more steps may be removed from them.
[0056] It should be understood that although this specification is described according to various embodiments, not every embodiment contains only one independent technical solution. This way of describing the specification is only for clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
[0057] The above description is merely an illustrative embodiment of the present invention and is not intended to limit the scope of the invention. Any equivalent changes, modifications, and combinations made by those skilled in the art without departing from the concept and principles of the present invention should fall within the scope of protection of the present invention.
Claims
1. A method (100) for maintaining a physical PLC using a virtual PLC, characterized in that, The method includes: Configure the virtual PLC (S101): Download the same configuration file and user program as the physical PLC running in the system to the virtual PLC; Synchronize data to virtual PLC (S102): Turn off the output of the virtual PLC to the system, and synchronize the input data of the system to the physical PLC to the virtual PLC, and synchronize the process data in the physical PLC to the virtual PLC; Verify virtual PLC output (S103): Keep the output of the virtual PLC to the system turned off, and verify whether the difference between the calculation output generated by the virtual PLC and the calculation output generated by the physical PLC meets the first preset condition; Switch to virtual PLC output (S104): Turn off the output from the physical PLC to the system and enable the output from the virtual PLC to the system; Maintenance of physical PLC (S105): Maintain the output of the physical PLC to the system while keeping it off, and perform maintenance on the physical PLC; Synchronize data to physical PLC (S106): Synchronize the input data and process data in the virtual PLC to the physical PLC; Verify physical PLC output (S107): Keep the output from the physical PLC to the system off, and verify whether the difference between the calculation output generated by the virtual PLC and the calculation output generated by the physical PLC meets the second preset condition; Switch to physical PLC output (S108): Disable the output from the virtual PLC to the system and enable the output from the physical PLC to the system.
2. The method according to claim 1, characterized in that, The configuration of the virtual PLC (S101) further includes: Obtain a license for the virtual PLC and / or subscribe to the virtual PLC service, and deploy the virtual PLC to the target environment of the system.
3. The method according to claim 1, characterized in that, The step of shutting down the output from the virtual PLC to the system is to disconnect the virtual PLC from the output module of the system that receives PLC data. The step of shutting down the output from the physical PLC to the system is to disconnect the physical PLC from the output module of the system that receives PLC data.
4. The method according to claim 1, characterized in that, After switching to the physical PLC output, the method further includes: Release Virtual PLC (S109): Release the license and / or subscription of the virtual PLC.
5. According to claim 1, the characteristic is that, The process data synchronization from the physical PLC to the virtual PLC and the process data synchronization from the virtual PLC to the physical PLC are performed through a dedicated interface.
6. The method according to claim 1, characterized in that, The first preset condition and the second preset condition are that the calculation outputs of the virtual PLC and the physical PLC are the same and / or there is a time deviation that satisfies the control target.
7. A device (200) for maintaining a physical PLC using a virtual PLC, characterized in that, The device includes: The virtual PLC module (201) is configured to download the same configuration files and user programs as those in the physical PLC running in the system to the virtual PLC. The virtual PLC module (202) is configured to: shut down the output of the virtual PLC to the system, and synchronously input the input data of the system to the physical PLC to the virtual PLC, and synchronize the process data in the physical PLC to the virtual PLC; The virtual PLC output module (203) is configured to: keep the output of the virtual PLC to the system off, and verify whether the difference between the calculation output generated by the virtual PLC and the calculation output generated by the physical PLC meets the first preset condition; Switch to the virtual PLC output module (204), configured to: disable the output of the physical PLC to the system, and enable the output of the virtual PLC to the system; The physical PLC module (205) is configured to maintain the physical PLC's output to the system while keeping it off, and to perform maintenance on the physical PLC. The data synchronization module (206) is configured to synchronize the input data and the process data in the virtual PLC to the physical PLC. The physical PLC output module (207) is configured to: keep the output from the physical PLC to the system off, and verify whether the difference between the calculation output generated by the virtual PLC and the calculation output generated by the physical PLC meets the second preset condition; Switch to the physical PLC output module (208), configured to: disable the output of the virtual PLC to the system, and enable the output of the physical PLC to the system.
8. Electronic equipment (300), including: At least one processor (310); as well as A memory (320) coupled to the at least one processor (310), the memory (320) being used to store instructions that, when executed by the at least one processor (310), cause the processor (310) to perform the method as described in any one of claims 1-6.
9. A computer-readable storage medium having stored thereon computer instructions that, when executed, perform the method according to any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, performs the method according to any one of claims 1-6.
Citation Information
Patent Citations
Programmable logic controller (PLC) redundancy control device for alternating current variable-frequency hoister
CN102491141A
Process control system
CN103324156A
Systems and methods for virtualizing a programmable logic controller
CN105612466A
Redundant hot standby control system, method, control device and computer readable storage medium
CN112204482B
Method and device for realizing redundant virtual PLC, equipment and storage medium
CN113434341A