Implementation method and system of containerized PLC, and management server

CN116909678BActive Publication Date: 2026-10-30CHINA MOBILE COMM LTD RES INST +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211080043.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-05
Publication Date
2026-10-30
Estimated Expiration
2042-09-05

AI Technical Summary

Technical Problem

这种PLC应用程序的部署方式缺乏灵活性,不能满足多样化应用场景的需求

Benefits of technology

[0018]本申请实施例提供的计算机可读存储介质,用于存储计算机程序,所述计算机程序使得计算机执行上述的容器化PLC的实现方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116909678B_ABST
    Figure CN116909678B_ABST
Patent Text Reader

Abstract

The application discloses a containerized PLC implementation method and system, a management server, and the method comprises the following steps: acquiring a plurality of PLC application programs; constructing a plurality of container images based on the plurality of PLC application programs, wherein different PLC application programs correspond to different container images; and distributing the plurality of container images to one or more controllers, wherein the container images are used for the controller to construct a container instance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of programmable logic controller (PLC) technology, and in particular to a containerized PLC implementation method and system, and a management server. Background Technology

[0002] PLCs are core control devices in the production processes of many industries, such as power, mining, and chemical production. Their working principle is to receive measurement data from sensors and cyclically run control algorithms to generate output signals for various actuators (such as motors, pumps, reactors, heat exchangers, etc.).

[0003] A PLC application (PCL App or PCL Program) is a software implementation of a PLC. Currently, PLC applications rely on dedicated embedded controllers for deployment, such as deploying the PLC application on an industrial personal computer (IPC). This deployment method lacks flexibility and cannot meet the needs of diverse application scenarios. Summary of the Invention

[0004] To address the aforementioned technical issues, embodiments of this application provide a method and system for implementing a containerized PLC, a management server, a controller, and a computer-readable storage medium.

[0005] The containerized PLC implementation method provided in this application embodiment is applied to a management server and includes:

[0006] Acquire multiple PLC applications;

[0007] Multiple container images are constructed based on the multiple PLC applications, wherein different PLC applications correspond to different container images;

[0008] The multiple container images are distributed to one or more controllers, and the container images are used by the controllers to build container instances.

[0009] The containerized PLC implementation method provided in this application embodiment is applied to a first controller, and the method includes:

[0010] Receive one or more container images from the management server, wherein the container images are built based on a PLC application, and different container images correspond to different PLC applications;

[0011] One or more container instances are constructed based on the one or more container images.

[0012] The management server provided in this application embodiment includes:

[0013] The program compilation service module is used to obtain multiple PLC applications; and to build multiple container images based on the multiple PLC applications, wherein different PLC applications correspond to different container images.

[0014] The node configuration service module is used to distribute the multiple container images to one or more controllers, and the container images are used by the controllers to build container instances.

[0015] The containerized PLC system provided in this application includes: a management server and one or more controllers, wherein the one or more controllers communicate with one or more actuators via a bus; wherein the management server is used to execute the above-described containerized PLC implementation method; and the controllers are used to execute the above-described containerized PLC implementation method.

[0016] The management server provided in this application embodiment includes a processor and a memory. The memory is used to store computer programs, and the processor is used to call and run the computer programs stored in the memory to execute the above-described containerized PLC implementation method.

[0017] The controller provided in this application includes a processor and a memory. The memory is used to store computer programs, and the processor is used to call and run the computer programs stored in the memory to execute the above-described containerized PLC implementation method.

[0018] The computer-readable storage medium provided in this application embodiment is used to store a computer program that causes a computer to execute the above-described containerized PLC implementation method.

[0019] In the technical solution of this application embodiment, a corresponding container image is built according to the PLC application. Different PLC applications can build different container images. The built container image is distributed to the controller, thereby creating a container instance corresponding to the PLC application on the controller. In this way, the purpose of deploying the PLC application through the container instance is achieved. Since the container instance has the characteristics of flexibility and lightweight, the deployment of PLC applications in this way is more flexible and can meet the needs of diverse application scenarios. Attached Figure Description

[0020] Figure 1 This is a PLC hardware architecture diagram;

[0021] Figure 2 This is a diagram of a software-based PLC architecture;

[0022] Figure 3 This is a diagram illustrating the working principle of the Runtime System.

[0023] Figure 4 This is a flowchart illustrating the implementation method of the containerized PLC provided in the embodiments of this application. Figure 1 ;

[0024] Figure 5 This is a flowchart illustrating the implementation method of the containerized PLC provided in the embodiments of this application. Figure 2 ;

[0025] Figure 6 This is a schematic diagram illustrating the composition of a general container image file provided in an embodiment of this application;

[0026] Figure 7 This is a schematic diagram illustrating the container instance environment construction and operation process provided in the embodiments of this application;

[0027] Figure 8 This is a flowchart of PLC dynamic migration provided in the embodiments of this application;

[0028] Figure 9 This is a schematic diagram of the flexible workshop production process provided in the embodiments of this application;

[0029] Figure 10 This is a schematic diagram of the structure of the management server provided in the embodiments of this application;

[0030] Figure 11 This is an architecture diagram of the containerized PLC system provided in the embodiments of this application;

[0031] Figure 12 This is a schematic structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0032] To facilitate understanding of the technical solutions of the embodiments of this application, the relevant technologies of the embodiments of this application are described below. The following relevant technologies are optional solutions and can be combined with the technical solutions of the embodiments of this application in any way, and they all fall within the protection scope of the embodiments of this application.

[0033] There are generally two ways to implement a PLC: hardware PLC and software PLC. Hardware PLC refers to implementing the PLC's functions through PLC hardware. Software PLC refers to implementing the PLC's functions through PLC application programs.

[0034] Figure 1 This is a PLC hardware architecture diagram, such as Figure 1As shown, the PLC hardware architecture mainly includes a central processing unit (CPU), memory storage module, input module, and output module. In addition, it may also include a power supply module, communication module, etc. Hardware-based PLCs have the following disadvantages: the PLC hardware architecture is closed and fixed, maintenance and upgrades are difficult, and compatibility with industrial communication protocols is poor.

[0035] Software-based PLCs can overcome the shortcomings of hardware-based PLCs. A software-based PLC (also simply called a soft PLC) uses open hardware as its platform and is based on the IEC 61131-3 or IEC 61149 industrial software programming specifications, implementing PLC functions through PLC application programs. Currently, most software-based PLC solutions are deployed based on IPCs, with pure software architectures and PCI board architectures. For example... Figure 2 As shown, in a pure software architecture, the PLC application (PLC App) is deployed on the IPC operating system (IPC OS); in a board-based architecture, the PLC application (PLC App) is deployed on the PLC PCI board. Software-based PLCs offer advantages such as low cost, high openness, and ease of use. However, current software-based PLCs have the following drawbacks: the PLC application relies on a dedicated embedded controller for deployment, such as deploying the PLC application on an IPC. This deployment method lacks flexibility and cannot meet the needs of diverse application scenarios.

[0036] Furthermore, for software-defined PLCs, there are both hardware-level virtualization solutions and software-level virtualization solutions. Hardware-level virtualization refers to using a runtime system as the real-time operating system for the PLC application. Commonly used runtime systems are CoDeSys or AnyControl. Through the runtime system, any embedded platform or industrial PC can be transformed into a controller based on the IEC61131-3 standard. Its working principle is as follows... Figure 3 As shown, software-level virtualization (KVM) refers to the use of a kernel-based virtual machine to virtualize PLC applications. KVM provides virtual hardware through hypervisor technology, supporting the upper-layer real-time and non-real-time kernels. KVM offers greater flexibility than hardware-level virtualization, but it requires hypervisor support and suffers from performance and efficiency limitations.

[0037] Therefore, the following technical solutions are proposed in the embodiments of this application. The technical solutions in the embodiments of this application propose a method and system for implementing containerized PLCs, and a management server. By shifting the deployment of PLC applications from dedicated embedded controllers to more flexible and lightweight container (Docker) instances, a "containerized PLC" solution is achieved. Container instances do not require Hypervisor support, implementing a kernel-level virtualization solution, thus achieving higher performance and efficiency. Furthermore, as a wrapper for PLC applications, container instances can deploy PLC applications on any infrastructure, giving PLC applications independent and easily portable capabilities, making them applicable to a wider range of industrial control scenarios. In addition, a containerized PLC management server (hereinafter referred to as the management server) provides management for the deployment of container instances for multiple controllers, enabling dynamic expansion and meeting the needs of flexible automated production in factories.

[0038] To facilitate understanding of the technical solutions of the embodiments of this application, the technical solutions of this application are described in detail below through specific embodiments. The above-mentioned related technologies are optional solutions and can be arbitrarily combined with the technical solutions of the embodiments of this application, all of which fall within the protection scope of the embodiments of this application. The embodiments of this application include at least some of the following contents.

[0039] The technical solution of this application proposes to construct a containerized PLC system by combining container technology. Container technology, also known as operating system-level virtualization, is a lightweight software virtualization method. Containers provide isolated runtime spaces for applications based on mechanisms such as the namespace of the operating system kernel. Furthermore, the container host can limit the amount of resources used by a single container, such as CPU, memory, disk I / O, and network, through cgroups. Because it shares the operating system kernel, containerization has lower overhead compared to other virtualization methods (such as VMware and KVM).

[0040] Figure 4 This is a flowchart illustrating the implementation method of the containerized PLC provided in the embodiments of this application. Figure 1 ,like Figure 4 As shown, the implementation method of the containerized PLC includes the following steps:

[0041] Step 401: The management server obtains multiple PLC applications; builds multiple container images based on the multiple PLC applications, with different PLC applications corresponding to different container images; distributes the multiple container images to one or more controllers, and the container images are used by the controllers to build container instances.

[0042] Here, for each of the multiple PLC applications, the management server constructs a container image corresponding to that PLC application based on the container image construction strategy corresponding to each PLC application. The container image construction strategy includes:

[0043] The first construction rule is used to construct a PLC APP module, which is used to implement a PLC application program.

[0044] The second construction rule is used to construct a runtime module, which is used to implement the software runtime environment of the PLC application.

[0045] The third construction rule is used to construct an I / O configuration module, which is used to configure the I / O variable addresses of the PLC application; and,

[0046] The fourth construction rule is used to construct a performance monitoring module, which is used to monitor information from the PLC application.

[0047] Different PLC applications build container images with different image modules, which include: a PLC APP module, a runtime module, an I / O configuration module, and a performance monitoring module. The PLC APP module is used to implement the PLC application, the runtime module is used to implement the software runtime environment of the PLC application, the I / O configuration module is used to configure the I / O variable addresses of the PLC application, and the performance monitoring module is used to monitor the information of the PLC application.

[0048] In some implementations, the management server determines the mapping relationship between the plurality of container images and the one or more controllers; based on the mapping relationship, the plurality of container images are distributed to the one or more controllers. Further, optionally, the management server saves the mapping relationship to a database.

[0049] In some implementations, the one or more controllers include a first controller on which a first container instance is built; a management server obtains user-inputted I / O configuration information for the first container instance and sends the I / O configuration information to the first controller, wherein the I / O configuration information is used by the first controller to configure the I / O variable addresses of the first container instance. Optionally, the management server saves the I / O configuration information to a database.

[0050] In some implementations, after the plurality of container images are distributed to one or more controllers, the management server performs at least one of the following management functions on at least some of the container instances built on the one or more controllers: starting container instances; restoring container instances; stopping container instances; pausing container instances; and monitoring the running status of container instances.

[0051] In some implementations, the plurality of PLC applications include a first PLC application, and the one or more controllers include a first controller, on which a first container instance is built. The first container instance is built based on a container image corresponding to the first PLC application. Upon detecting a migration instruction for the first PLC application, the management server migrates the first PLC application from the first container instance in the first controller to a second container instance in the second controller. Specifically, the management server migrates the first PLC application from the first container instance in the first controller to the second container instance in the second controller through the following steps:

[0052] 1) Retrieve the image information of the first container instance in the first controller from the database;

[0053] 2) Obtain the container image corresponding to the first PLC application based on the image information of the first container instance, and send the container image corresponding to the first PLC application to the second controller. The container image corresponding to the first PLC application is used by the second controller to build the second container instance.

[0054] 3) Synchronize the status information of the first container instance to the second container instance.

[0055] Here, synchronizing the state information of the first container instance to the second container instance can be achieved through the following steps:

[0056] 3-1) Pause both the first container instance and the second container instance;

[0057] 3-2) Receive the status information (e.g., status variables) of the first container instance reported by the first controller, and send the status information of the first container instance to the second controller. The status information of the first container instance is used by the second controller to update the status information of the second container instance. Optionally, save the status information of the first container instance to the database;

[0058] 3-3) Restore the first container instance and the second container instance;

[0059] 3-4) Terminate the first container instance and enable the second container instance;

[0060] In some implementations, the success of the migration is determined by whether the outputs of the first container and the second container are consistent; if the migration is successful, the first container is terminated and the output of the second container is enabled.

[0061] Step 402: The first controller receives one or more container images from the management server. The container images are built based on PLC applications, and different container images correspond to different PLC applications. One or more container instances are built based on the one or more container images.

[0062] Here, different container images have different image modules, which include: a PLC APP module, a runtime module, an I / O configuration module, and a performance monitoring module. The PLC APP module is used to implement the PLC application, the runtime module is used to implement the software runtime environment of the PLC application, the I / O configuration module is used to configure the I / O variable addresses of the PLC application, and the performance monitoring module is used to monitor the information of the PLC application.

[0063] It is understood that the container instance built based on the container image also includes the following modules: PLC APP module, runtime module, I / O configuration module, and performance monitoring module.

[0064] In some implementations, the one or more container instances include a first container instance; the first controller receives I / O configuration information for the first container instance issued by the management server; and configures the I / O variable addresses of the first container instance according to the I / O configuration information.

[0065] In some implementations, during the operation of the first container instance, if the first controller receives updated I / O configuration information for the first container instance issued by the management server, it reconfigures the I / O variable addresses of the first container instance according to the updated I / O configuration information.

[0066] In some implementations, the first controller scans input data from the I / O port into an input register; by running the first container instance, it performs the following operations: reads the input data from the input register; processes the input data to obtain output data; writes the output data into an output register; and outputs the output data from the output register to the I / O port, whereby the output data is used to control the actuator via the I / O port. Further, the first controller reports the operating information and status information of the first container instance to a management server. This operating information and status information are used by the management server for management related to the first container instance, such as for the management server to perform status backup, status recovery, migration, and anomaly handling of the PLC application corresponding to the first container instance.

[0067] Figure 5 This is a flowchart illustrating the implementation method of the containerized PLC provided in the embodiments of this application. Figure 2 ,like Figure 5 As shown, the implementation method of the containerized PLC includes the following steps:

[0068] Step 501: Manage the server to build the container image.

[0069] Specifically, after the user completes and compiles the PLC application, it is uploaded to the management server. The management server then builds a runtime image of the PLC program, which is also the container image of the PLC application.

[0070] Universal container images for PLC applications, such as Figure 6 As shown, PLC APP is the PLC application program written by the user (i.e., the PLC binary executable program); Runtime is the software running environment of the PLC application; the I / O configuration module can realize the automatic configuration of the I / O variable address of the PLC application; the performance monitoring module is used to monitor various information of the PLC application and periodically report the monitored information to the database of the management server for storage.

[0071] Step 502: The management server distributes the container image to the controller and performs I / O configuration.

[0072] Users distribute container images carrying different PLC applications to different controllers through the management server. Simultaneously, the management server stores the mapping relationship between controllers and container images in a database. The database records the mapping relationship in the following table:

[0073] Table 1: Mapping Relationship between Controllers and Containers

[0074] Controller_A Docker_1 Image_1 Run / Pause / Terminate ... ... ... ...

[0075] In addition, users can dynamically change the I / O configuration and save it to the database. An example format for the I / O configuration data table is as follows:

[0076] Table 2: I / O Configuration Data Table

[0077]

[0078] In Table 2 above, the address of a variable consists of an address identifier and a memory location. The address of the digital input register corresponding to an input terminal is represented by the wildcard "%I + address value", and the address of the digital output register corresponding to an output terminal is represented by the wildcard "%Q + address value". For example, the address wildcard %I0.01 corresponds to physical terminal X1, and %Q100.01 corresponds to physical terminal Y1. In addition, this data table also records information such as the data type, initial value, and whether the value is retained after power failure for each variable.

[0079] After receiving a container creation request from the management server, the controller constructs a container instance using the container image distributed by the management server and the initialized I / O configuration. During the container instance's execution, the runtime dynamically modifies the I / O addresses based on the I / O configuration issued by the management server. By modifying the I / O addresses, the same PLC application can control different downstream devices without modifying the code, achieving container image reusability.

[0080] In some implementations, the container instance environment building and running process is as follows: Figure 7 As shown, it includes the following steps:

[0081] S21. The runtime environment reads and parses the user-initialized I / O configuration issued by the management server.

[0082] S22, the I / O configuration module replaces address wildcards with actual physical addresses based on the I / O configuration.

[0083] S23. During the operation of the container instance corresponding to the PLC application, if the updated data issued by the I / O configuration service in the management server is detected, the address data table of the I / O configuration module of the container instance is updated and returned to S21.

[0084] S24. Scan the input variables from the I / O ports connected to the south of the controller into the input registers and read them centrally.

[0085] S25. The container instance runs with a fixed scan cycle and writes the output variables to the output register.

[0086] S26. After the container instance finishes running, the data in the output register is output to the I / O port in a centralized manner to control the operation of actuators such as robotic arms in real time.

[0087] S27. Container instances periodically report intermediate state variables and runtime performance parameters to the management server, and the server writes the data into the state variable data table, which can be used for data backup and alarms in abnormal situations.

[0088] As an example, the state variable data table is as follows:

[0089] Table 3: State Variable Data Table

[0090] M1 @3 %M0.01 Auxiliary relay S1 @# %S0.01 state T1 #1 %T0.01 timer ...

[0091] The data table shown in Table 3 records the names, values, and register address information of intermediate state variables such as auxiliary relay M, status register S, and timer register T. In the event of abnormal container termination, the management server can restore the initial state of the container instance to the state before termination based on the status variable information and continue to output control commands.

[0092] Step 503: Manage the container instances on the management server and monitoring controller.

[0093] The management server can start and stop container instances on the controller and monitor the running status of container instances.

[0094] In some implementations, the management server starts and initializes container instances on the controller node, and can restore container instances that are in a paused state.

[0095] In some implementations, while the container instance is running, the management server configures services through nodes, and users can forcibly terminate the execution of the container instance.

[0096] In some implementations, after each scan, the controller reports the container instance's runtime performance parameters, such as CPU load, memory, and latency jitter, to the management server. The management server saves the status information and issues real-time alerts for abnormal scenarios such as abnormal interruptions or spikes in latency jitter.

[0097] Step 504: Manage the server to dynamically migrate the PLC application.

[0098] In flexible manufacturing processes, adjustments to production line processes and procedures often necessitate the reconfiguration of PLC equipment, leading to difficulties in transporting traditional PLC hardware and complex wiring. The management server proposed in this application's embodiment can synchronously copy a PLC application from container instance-1 on controller A (denoted as controller A-container instance-1) to container instance-2 on controller B at another physical location (denoted as controller B-container instance-2), achieving dynamic migration of the same PLC application across different locations. The PLC dynamic migration flowchart is shown below. Figure 8 As shown, it includes the following steps:

[0099] S41. The management server first detects the dynamic migration command issued by the user. If the command is detected, it jumps to S42.

[0100] S42. Read the image information of container instance-1 on controller A from the database, and jump to S43.

[0101] S43. Pull the container image from the image library based on the image information of container instance-1, and create container instance-2 on controller B. Jump to S44.

[0102] S44. Pause container instance-1 and container instance-2, then proceed to S45.

[0103] S45, Controller A extracts the state variables generated by the program execution from container instance-1 and reports them to the management server, then jumps to S46.

[0104] S46. The management server retrieves the status variables and saves them to the database, then jumps to S47.

[0105] S47. Controller B retrieves the state variables from the management server database and jumps to S48.

[0106] S48, and update the state variables of container instance-2 to keep it synchronized with container instance-1, then jump to S49.

[0107] S49. The management server resumes running container instance-1 and container instance-2, then jumps to S410.

[0108] S410. Determine if the migration is correct based on whether the outputs of the two containers remain consistent after the current scan cycle. If incorrect, jump to S411; if correct, jump to S412 and S413.

[0109] S411. For incorrect migration handling, first roll back the updated result, then notify the user that the migration failed, and end the process with a failure status.

[0110] S412 and S413, for correct migration processing, terminate container instance-1, enable the output of container instance-2, complete the migration of the PLC application from controller A-container instance-1 to controller B-container instance-2, and end this process with a successful status.

[0111] The technical solution of the present application embodiment is illustrated below with a specific application example. It should be noted that the technical solution of the present application embodiment is not limited to the following application example, but can also be applied to application examples in other scenarios.

[0112] Research revealed that flexible workshops consider processing flexibility, such as multiple optional process paths for parts and multiple optional equipment for processes. Their scheduling decisions include determining the processing equipment (path) for each part and the processing sequence (start and finish times) on each piece of equipment. Taking the machining scheduling of a certain automotive part as an example, its flexible workshop production process is as follows: Figure 9 As shown, the machining workshop has four machining units with different processes. Each unit is responsible for handling only one type of process, which, in the process sequence, are precision turning, CNC milling, EDM, and wire cutting. Each unit mainly includes a general-purpose controller, a set of multiple machining devices with equivalent capabilities, and a parts conveying device. It is assumed that each machining unit has only 1-2 machining devices. On the one hand, depending on actual production needs, each process can use multiple machining devices, such as different models of CNC milling machines, with equipment selection based on the type of parts being processed. Different machining devices have fixed physical addresses on their external ports. Traditional device switching involves users manually modifying the addresses of each input / output variable in the program, or maintenance personnel manually plugging and unplugging devices to change the external ports of the machining devices to the addresses required by the program, resulting in poor maintenance efficiency and long switching times. Using the technical solution of this application embodiment, without power interruption, users modify the container's I / O address through the management server. During the environment construction process of the container instance, the address resolution library function of the I / O configuration module is called to achieve dynamic configuration of the I / O address during application runtime. On the other hand, the controllers of machining production lines often need to be changed, such as adding or removing processes. Taking the addition of an electroplating process as an example, the traditional factory approach is to redesign the entire production line, requiring the physical relocation of controllers and processing equipment for subsequent processes. Each change requires a 3-7 day shutdown and deployment by professionals. To address this, the technical solution of this application only requires adding a new process and changing the routing of its existing conveyor devices, without altering the positions of other process equipment and controllers. The PLC application can be migrated remotely by copying the controller container instances on both sides and updating the application status. The technical solution of this application requires only a short downtime (e.g., about half an hour) for container configuration and PLC application migration, and requires no on-site labor costs, achieving zero-cost modification.

[0113] The technical solution of this application embodiment proposes, on the one hand, a containerized PLC. Specifically, users can build container images for PLC applications through a management server and distribute them to controller nodes as needed, generating multiple container instances. Users can query the mapping relationship between nodes and instances, the running status of container instances, and other information in the background database, facilitating users to start, stop, and monitor container applications, thus realizing the decoupling of PLC application software and hardware and remote deployment. On the other hand, it proposes dynamic configuration of container instance I / O addresses. Specifically, during the operation of a container instance, users can change the I / O configuration at any time. The management server distributes the updated I / O configuration to the controller. The container instance's container I / O configuration module parses wildcard information and dynamically changes the I / O terminal address values ​​corresponding to program input and output variables, realizing dynamic adaptation of the program to different I / O-connected devices and enabling the reusability of container images. On the other hand, dynamic migration of PLCs is proposed. Specifically, for flexible manufacturing units that need to be adjusted on industrial production lines, the management server can provide dynamic migration capabilities for containerized PLCs. Specifically, by creating a new container instance with the same image and configuring the same state variable information, after the two container instances run a scan cycle at the same time, the new container instance can keep the output synchronized with the original container instance, thus realizing the migration of equipment with the same PLC application in different locations, which facilitates rapid adjustment of processes and ensures the flexibility of flexible production lines.

[0114] Figure 10 This is a schematic diagram of the structure of the management server provided in the embodiments of this application, as shown below. Figure 10 As shown, the management server includes:

[0115] The program compilation service module 1001 is used to acquire multiple PLC applications; and to build multiple container images based on the multiple PLC applications, wherein different PLC applications correspond to different container images.

[0116] The node configuration service module 1002 is used to distribute the multiple container images to one or more controllers, and the container images are used by the controllers to build container instances.

[0117] In some implementations, the program compilation service module 1001 is used to construct a container image corresponding to each of the plurality of PLC applications, based on a container image construction strategy corresponding to the PLC application, wherein the container image construction strategy includes:

[0118] The first construction rule is used to construct a PLC APP module, which is used to implement a PLC application program.

[0119] The second construction rule is used to construct the runtime module, which is used to implement the software runtime environment of the PLC application.

[0120] The third construction rule is used to construct an I / O configuration module, which is used to configure the I / O variable addresses of the PLC application; and,

[0121] The fourth construction rule is used to construct a performance monitoring module, which is used to monitor the information of the PLC application.

[0122] In some implementations, the node configuration service module 1002 is used to determine the mapping relationship between the plurality of container images and the one or more controllers; and based on the mapping relationship, distribute the plurality of container images to the one or more controllers.

[0123] In some implementations, the one or more controllers include a first controller on which a first container instance is built; the management server further includes an I / O configuration service module 1003, used to obtain I / O configuration information for the first container instance, and to send the I / O configuration information to the first controller, wherein the I / O configuration information is used by the first controller to configure the I / O variable addresses of the first container instance.

[0124] In some implementations, the management server further includes a performance monitoring service module 1004, which is used to manage at least some of the container instances built on the one or more controllers by: starting container instances; restoring container instances; stopping container instances; pausing container instances; and monitoring the running status of container instances.

[0125] In some implementations, the plurality of PLC applications include a first PLC application, and the one or more controllers include a first controller on which a first container instance is built, the first container instance being built based on a container image corresponding to the first PLC application; the performance monitoring service module 1004 is further configured to, upon detecting a migration instruction for the first PLC application, migrate the first PLC application from the first container instance in the first controller to a second container instance in the second controller.

[0126] In some implementations, the performance monitoring service module 1004 is further configured to obtain the image information of the first container instance in the first controller; obtain the container image corresponding to the first PLC application based on the image information of the first container instance, and send the container image corresponding to the first PLC application to the second controller, wherein the container image corresponding to the first PLC application is used by the second controller to build the second container instance; and synchronize the status information of the first container instance to the second container instance.

[0127] In some implementations, the performance monitoring service module 1004 is further configured to: suspend the first container instance and the second container instance; receive the status information of the first container instance reported by the first controller, and send the status information of the first container instance to the second controller, wherein the status information of the first container instance is used by the second controller to update the status information of the second container instance; resume the first container instance and the second container instance; terminate the first container instance and enable the second container instance.

[0128] In some implementations, the performance monitoring service module 1004 is further configured to receive the operating information and status information of the first container reported by the first controller, and save the operating information and status information of the first container to a database.

[0129] In some implementations, the management server further includes: an image library 1005 for storing container images; and a database 1006 for storing at least one of the following information: runtime and status information of container instances, mapping relationships between the plurality of container images and the one or more controllers, and I / O configuration information.

[0130] It should be noted that the management server can also be described as a containerized PLC management server; this application does not limit the name of the management server. As an example, Table 4 below lists the services provided by the management server:

[0131] Table 4: Service Data Table of Management Server

[0132]

[0133]

[0134] Those skilled in the art should understand that Figure 10 The functionality of the management server shown can be understood by referring to the relevant descriptions of the methods described above.

[0135] Figure 11 This is an architecture diagram of the containerized PLC system provided in the embodiments of this application, such as... Figure 11As shown, the system includes: a management server and one or more controllers ( Figure 11 The diagram illustrates controller A and controller B, which communicate with one or more actuators via a bus; wherein the management server is used to execute the method steps performed by the management server in the aforementioned scheme, and the controllers are used to execute the method steps performed by the first controller in the aforementioned scheme.

[0136] In practice, the management server can be deployed in a cloud server, employing a containerized scalable model to maximize the utilization of node resources, providing services such as node configuration, program compilation, I / O configuration, and performance monitoring. The management server connects to each controller via IP, including but not limited to standard Ethernet and 5G. Communication between components in the controlled industrial field (such as sensors and actuators) and each controller is achieved through an industrial bus.

[0137] The technical solution of this application embodiment, on the one hand, shifts the deployment of PLC applications from dedicated equipment to a more flexible container environment, breaking the traditional PLC hardware-software integrated architecture and the dependence of soft PLCs on industrial control computers. Simultaneously, compared with hardware virtualization methods such as KVM, container virtualization has lower hardware overhead and ensures real-time performance. Users can package the PLC application and its dependent resources together and place them in a cross-platform architecture environment, enabling flexible management of the PLC application, dynamic configuration of I / O addresses, and rapid application migration, providing convenience and flexibility for flexible industrial manufacturing. On the other hand, I / O configuration solves the problem that traditional PLCs and soft PLCs can only use fixed I / O addresses in the program, allowing users to dynamically adapt to different downstream devices without modifying the program, improving code maintenance efficiency. Furthermore, dynamic migration solves the problems of difficult on-site equipment transportation and cumbersome wiring caused by process scheduling in traditional PLCs. Users can dynamically allocate PLC applications on different devices, ensuring data continuity for seamless process switching and improving the flexibility of the production line.

[0138] Figure 12 This is a schematic structural diagram of an electronic device 1200 provided in an embodiment of this application. The electronic device may be a management server or a controller. Figure 12 The illustrated electronic device 1200 includes a processor 1210, which can call and run computer programs from memory to implement the methods in the embodiments of this application.

[0139] Optionally, such as Figure 12 As shown, the electronic device 1200 may further include a memory 1220. The processor 1210 can retrieve and run computer programs from the memory 1220 to implement the methods described in the embodiments of this application.

[0140] The memory 1220 can be a separate device independent of the processor 1210, or it can be integrated into the processor 1210.

[0141] Optionally, such as Figure 12 As shown, the electronic device 1200 may also include a transceiver 1230, and the processor 1210 may control the transceiver 1230 to communicate with other devices. Specifically, it may send information or data to other devices or receive information or data sent by other devices.

[0142] The transceiver 1230 may include a transmitter and a receiver. The transceiver 1230 may further include an antenna, and the number of antennas may be one or more.

[0143] Optionally, the electronic device 1200 may specifically be a management server in the embodiments of this application, and the electronic device 1200 may implement the corresponding processes implemented by the management server in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0144] Optionally, the electronic device 1200 may specifically be a controller in the embodiments of this application, and the electronic device 1200 may implement the corresponding processes implemented by the controller in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0145] It should be understood that the processor in the embodiments of this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0146] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0147] It should be understood that the above-described memory is exemplary and not a limiting description. For example, the memory in the embodiments of this application may also be static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM), etc. That is to say, the memory in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0148] This application also provides a computer-readable storage medium for storing computer programs.

[0149] Optionally, the computer-readable storage medium can be applied to the management server in the embodiments of this application, and the computer program causes the computer to execute the corresponding processes implemented by the management server in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0150] Optionally, the computer-readable storage medium can be applied to the controller in the embodiments of this application, and the computer program causes the computer to execute the corresponding processes implemented by the controller in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0151] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0152] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0153] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0154] The units described as separate components may or may not be physically separate. 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 the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0155] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0156] If the aforementioned functions are implemented as 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 this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0157] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for implementing a containerized programmable logic controller (PLC), characterized in that, Applied to a management server, the method includes: Acquire multiple PLC applications; Multiple container images are constructed based on the multiple PLC applications, wherein different PLC applications correspond to different container images; The container images are distributed to one or more controllers, and the container images are used by the controllers to build container instances. The construction of multiple container images based on the multiple PLC applications includes: For each of the plurality of PLC applications, a container image corresponding to the PLC application is constructed based on the container image construction strategy corresponding to the PLC application, wherein the container image construction strategy includes: The first construction rule is used to construct a PLC APP module, which is used to implement a PLC application program. The second construction rule is used to construct a runtime module, which is used to implement the software runtime environment of the PLC application. The third construction rule is used to construct an I / O configuration module, which is used to configure the I / O variable addresses of the PLC application; and, The fourth construction rule is used to construct a performance monitoring module, which is used to monitor information from the PLC application.

2. The method according to claim 1, characterized in that, The method further includes: Determine the mapping relationship between the plurality of container images and the one or more controllers; The step of distributing the plurality of container images to one or more controllers includes: Based on the mapping relationship, the multiple container images are distributed to the one or more controllers.

3. The method according to claim 1, characterized in that, The one or more controllers include a first controller on which a first container instance is built; the method further includes: Obtain the I / O configuration information for the first container instance, and send the I / O configuration information to the first controller. The I / O configuration information is used by the first controller to configure the I / O variable address of the first container instance.

4. The method according to any one of claims 1 to 3, characterized in that, After distributing the plurality of container images to one or more controllers, the method further includes: Manage at least one of the following for at least a portion of the container instances built on the one or more controllers: Start the container instance; Restore the container instance; Stop the container instance; Pause the container instance; Monitor the running status of container instances.

5. The method according to claim 1 or 2, characterized in that, The plurality of PLC applications include a first PLC application, and the one or more controllers include a first controller, on which a first container instance is built, the first container instance being built based on a container image corresponding to the first PLC application; the method further includes: If a migration instruction for the first PLC application is detected, the first PLC application is migrated from the first container instance in the first controller to the second container instance in the second controller.

6. The method according to claim 5, characterized in that, The migration of the first PLC application from the first container instance in the first controller to the second container instance in the second controller includes: Obtain the image information of the first container instance in the first controller; Based on the image information of the first container instance, the container image corresponding to the first PLC application is obtained, and the container image corresponding to the first PLC application is sent to the second controller. The container image corresponding to the first PLC application is used by the second controller to build the second container instance. The status information of the first container instance is synchronized to the second container instance.

7. The method according to claim 6, characterized in that, The step of synchronizing the state information of the first container instance to the second container instance includes: Pause the first container instance and the second container instance; The system receives the status information of the first container instance reported by the first controller, and sends the status information of the first container instance to the second controller. The status information of the first container instance is used by the second controller to update the status information of the second container instance. Restore the first container instance and the second container instance; Terminate the first container instance and enable the second container instance.

8. A method for implementing a containerized PLC, characterized in that, Applied to a first controller, the method includes: Receive one or more container images from the management server, wherein the container images are built based on a PLC application, and different container images correspond to different PLC applications; One or more container instances are constructed based on the one or more container images; wherein, the container image corresponding to the PLC application is constructed by the management server for each PLC application among multiple PLC applications, based on the container image construction strategy corresponding to the PLC application; wherein, the container image construction strategy includes: The first construction rule is used to construct a PLC APP module, which is used to implement a PLC application program. The second construction rule is used to construct a runtime module, which is used to implement the software runtime environment of the PLC application. The third construction rule is used to construct an I / O configuration module, which is used to configure the I / O variable addresses of the PLC application; and, The fourth construction rule is used to construct a performance monitoring module, which is used to monitor information from the PLC application.

9. The method according to claim 8, characterized in that, The one or more container instances include a first container instance; the method further includes: Receive I / O configuration information for the first container instance from the management server; Configure the I / O variable addresses for the first container instance based on the I / O configuration information.

10. The method according to claim 9, characterized in that, The method further includes: During the operation of the first container instance, if updated I / O configuration information for the first container instance is received from the management server, the I / O variable addresses of the first container instance are reconfigured according to the updated I / O configuration information.

11. The method according to claim 9 or 10, characterized in that, The method further includes: Scan input data from the I / O port into the input register; The first container instance is run to perform the following operations: read input data from the input register; process the input data to obtain output data; write the output data to the output register; and output the output data from the output register to an I / O port, wherein the output data is used by the I / O port to control the actuator.

12. The method according to claim 11, characterized in that, The method further includes: The running information and status information of the first container instance are reported to the management server, and the running information and status information of the first container are used by the management server to perform management related to the first container instance.

13. A management server, characterized in that, The management server includes: The program compilation service module is used to obtain multiple PLC applications; and to build multiple container images based on the multiple PLC applications, wherein different PLC applications correspond to different container images. The node configuration service module is used to distribute the multiple container images to one or more controllers, and the container images are used by the controllers to build container instances. The program compilation service module is also used for: For each of the plurality of PLC applications, a container image corresponding to the PLC application is constructed based on the container image construction strategy corresponding to the PLC application, wherein the container image construction strategy includes: The first construction rule is used to construct a PLC APP module, which is used to implement a PLC application program. The second construction rule is used to construct a runtime module, which is used to implement the software runtime environment of the PLC application. The third construction rule is used to construct an I / O configuration module, which is used to configure the I / O variable addresses of the PLC application; and, The fourth construction rule is used to construct a performance monitoring module, which is used to monitor information from the PLC application.

14. The management server according to claim 13, characterized in that, The one or more controllers include a first controller on which a first container instance is built; the management server further includes: The I / O configuration service module is used to obtain I / O configuration information for the first container instance and send the I / O configuration information to the first controller. The I / O configuration information is used by the first controller to configure the I / O variable address of the first container instance.

15. A containerized PLC system, characterized in that, The system includes: a management server and one or more controllers, wherein the one or more controllers communicate with one or more actuators via a bus; wherein... The management server is used to execute the method according to any one of claims 1 to 7; The controller is used to perform the method according to any one of claims 8 to 12.

16. A management server, characterized in that, include: A processor and a memory for storing a computer program, the processor for calling and running the computer program stored in the memory to perform the method as described in any one of claims 1 to 7.

17. A controller, characterized in that, include: A processor and a memory for storing a computer program, the processor for calling and running the computer program stored in the memory to perform the method as described in any one of claims 8 to 12.

18. A computer-readable storage medium, characterized in that, Used to store a computer program that causes a computer to perform the method as claimed in any one of claims 1 to 7, or the method as claimed in any one of claims 8 to 12.

Citation Information

Patent Citations

  • Container mirror image building method, container mirror image building system, container mirror image building device and storage medium

    CN107766126A