Control system, control method and control equipment

By deploying multiple PLC master stations in the user space of the operating system of a multi-core programmable logic controller and utilizing abundant resources, the problem of insufficient control capability of a single PLC master station is solved, and efficient control of complex industrial equipment and full utilization of resources are achieved.

CN120722786APending Publication Date: 2025-09-30HENAN KUNLUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510607601.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-09-30

AI Technical Summary

Technical Problem

The control capabilities of a single PLC master station are limited and cannot meet the control needs of complex industrial equipment. In addition, existing solutions use virtual machine managers to virtualize multiple real-time operating systems, which increases control overhead and inefficiency.

Method used

Deploy multiple PLC master stations in the user state space of the operating system of a multi-core programmable logic controller, utilize the abundant processor core and network port resources, avoid data copying between the kernel and user state, reduce the virtual machine manager overhead, and achieve full resource utilization.

Benefits of technology

It achieves efficient control of complex industrial equipment, reduces control overhead, and improves the processing efficiency and resource utilization of the PLC master station.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120722786A_ABST
    Figure CN120722786A_ABST
Patent Text Reader

Abstract

The invention provides a control system, a control method and control equipment, relates to the technical field of industrial automatic control, and aims to deploy a plurality of PLC (Programmable Logic Controller) master stations in an operating system by utilizing abundant processor cores and network port resources of a multi-core programmable logic controller and realize control of complex industrial equipment by utilizing the plurality of PLC master stations. The control system specifically comprises a multi-core programmable logic controller and an operating system, and a plurality of PLC master stations are deployed in the operating system; the multi-core programmable logic controller comprises a plurality of processor cores and at least one network interface card, and the network interface card comprises at least one network port; one PLC master station is bound with at least one processing core and at least one network port; wherein each PLC master station runs on a processor core bound with the PLC master station and is used for receiving running information of at least one controlled target through a network port bound with the PLC master station and controlling the controlled target based on the running information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of industrial automatic control, and in particular to a control system, a control method and a control device. Background Art

[0002] A Programmable Logic Controller (PLC) system is a digital computer system used for industrial automation, widely used in manufacturing, mechanical control, process control, and other fields. A PLC system primarily consists of a PLC master station and PLC slave stations. The PLC master station receives operating information from external industrial equipment and generates control instructions based on this information. These instructions are then transmitted to the PLC slave stations, which convert these control instructions into signals that control the external industrial equipment, thereby achieving the function of controlling the external industrial equipment.

[0003] At present, industrial equipment is becoming more and more complex. The control capabilities of a single PLC master station are limited and cannot adapt to the control requirements of complex industrial equipment. Therefore, it is necessary to deploy multiple PLC master stations in the PLC system and use multiple PLC master stations to jointly realize the control of complex industrial equipment. Summary of the Invention

[0004] The present application provides a control system, a control method and a control device, which utilize the abundant processor core resources and network port resources of a multi-core programmable logic controller, deploy multiple PLC master stations in the operating system, and use multiple PLC master stations to realize the control of complex industrial equipment.

[0005] To achieve the above technical objectives, this application adopts the following technical solutions:

[0006] In the first aspect, the present application provides a control system, including a multi-core programmable logic controller and an operating system, wherein multiple PLC master stations are deployed in the operating system; the multi-core programmable logic controller includes multiple processor cores and at least one network interface card, and the network interface card includes at least one network port; a PLC master station is bound to at least one processing core and at least one network port; wherein each PLC master station runs on the processor core bound to itself, and is used to receive operating information of at least one controlled target through the network port bound to itself, and control the network port PLC master station bound to itself of the controlled target based on the operating information.

[0007] It is understandable that the operating system includes multiple PLC master stations, which use the processor cores and network port resources bound to them in the multi-core programmable logic controller to complete the control of at least one controlled target. Because the processor and network port resources occupied by the operating system kernel running on the multi-core programmable logic controller are limited, the multi-core programmable logic controller has abundant processor and network port resources. On this basis, the kernel is allowed to concentrate on using some processor cores and network ports, and the remaining processor cores and network ports are used to deploy multiple PLC master stations in the operating system (i.e., they are allocated to multiple PLC master stations for use). Each PLC master station is responsible for controlling some of the controlled targets of the industrial equipment. Multiple PLC master stations can be centralized to achieve control of complex industrial equipment.

[0008] In a possible implementation, the control system further includes a plurality of PLC slave stations, each PLC master station is used to manage at least one PLC slave station, and one PLC slave station is bound to one controlled target;

[0009] Each PLC master station receives the operation information of the first controlled target uploaded by the first PLC slave station managed by itself through its own bound network port; and / or sends the control instructions of the first controlled target to the first PLC slave station through its own bound network port, wherein the first controlled target is the controlled target bound to the first PLC slave station.

[0010] It can be understood that a first PLC slave station refers to each PLC slave station managed by a corresponding PLC master station. Control instructions are generated based on the operating information of the first controlled target and are used to instruct the first PLC slave station to perform control operations on the first controlled target. A PLC master station manages at least one PLC slave station, and each PLC slave station controls one controlled target. A controlled target can be a complete industrial device, such as a robot, or a partial component of a complete industrial device, such as the robot's left arm or right arm. Through this deployment, the control system can achieve refined control of industrial equipment.

[0011] In one possible implementation, the control system further includes a data management suite; the data management suite is configured to, in response to monitoring that the network port bound to the PLC master station uploads a first data packet encapsulating operation information of the first controlled target, obtain the first data packet, and store the first data packet in a first virtual space for the PLC master station to retrieve; and / or in response to monitoring that the PLC master station sends a second data packet encapsulating control instructions of the first controlled target, obtain the second data packet, and store the second data packet in a second virtual space for the network port bound to the PLC master station to retrieve and forward to the first PLC slave station; wherein the first virtual space is a space in the user state space of the operating system for storing data packets from the network port bound to the PLC master station; and the second virtual space is a space in the user state space of the operating system for storing data packets from the PLC master station.

[0012] It's understandable that multiple PLC master stations are deployed on a single operating system running on a multi-core programmable logic controller. Because the operating system's kernel consumes relatively few processor and network port resources, the multi-core programmable logic controller has abundant processor and network port resources. Therefore, assigning the kernel to specific processor cores and network ports and utilizing these abundant cores and network ports to deploy multiple PLC master stations fully utilizes resources. Compared to using a virtual machine manager to virtualize multiple real-time operating systems for multiple PLC master stations, this reduces the overhead of running the virtual machine manager and virtual machines.

[0013] Furthermore, in related schemes, when the network card detects an incoming packet, it uses direct memory access to send the packet to a pre-allocated kernel buffer. This then generates an interrupt to notify the incoming packet. The operating system responds and passes the received packet to the kernel's network stack for processing. After processing, the network stack copies the packet to user space for use by the motion control application deployed there. Once the motion control application sends a packet, the operating system copies the packet from user space to a memory buffer and passes it to the network stack for processing. After the network stack completes the processing, it notifies the network card of the packet's need for transmission. The network card copies the packet from the kernel's buffer to its own buffer and sends it to the network link. Upon successful transmission, the network card issues an interrupt to notify the kernel of the successful transmission, allowing the kernel to release the corresponding buffer. Clearly, this back-and-forth copying of packets between kernel and user space generates significant memory overhead.

[0014] Compared to related solutions, the data management suite in the embodiments of the present application is deployed in the user space of the operating system. When the data management suite detects a data packet from the outside, it bypasses the kernel's network driver module and uses direct memory access to send the data packet to a pre-allocated buffer located in the operating system's user space. The motion control application can then read the data packet from the buffer and process it directly at the source address. Accordingly, once the motion control application sends a data packet, the operating system sends the data packet to a pre-allocated buffer also located in the operating system's user space. The network card device directly copies the data packet from this buffer to its own buffer and sends it to the network link. This entire process does not require interruption and eliminates the data copy process between kernel and user space, saving memory overhead.

[0015] In one possible implementation, the PLC master station includes a motion control application, an EtherCAT protocol stack, and a network card driver; wherein the network card driver retrieves a first data packet encapsulating the operating information of the first controlled target from the first virtual space in a polling drive manner, and forwards it to the EtherCAT protocol stack, wherein the first virtual space is a space in the user space for storing data packets from the network port bound to the PLC master station; the EtherCAT protocol stack is used to decapsulate the first data packet to obtain the operating information of the first controlled target, and forward the operating information of the first controlled target to the motion control application; the motion control application is used to generate control instructions for the first controlled target based on the operating information of the first controlled target.

[0016] It can be understood that the control system configures a dedicated motion control application, EtherCAT protocol stack and network card driver for each PLC master station. The motion control application, EtherCAT protocol stack and network card driver in each PLC master station are responsible for transmitting the operation information uploaded by the PLC slave station managed by the PLC master station to the PLC master station. The operations of receiving device operation information between PLC master stations do not interfere with each other.

[0017] In one possible implementation, the motion control application is further used to forward the control instructions of the first controlled target to the EtherCAT protocol stack; the EtherCAT protocol stack is further used to encapsulate the control instructions of the first controlled target into a second data packet and forward the second data packet to the network card driver; the network card driver is further used to send the second data packet.

[0018] It can be understood that the motion control application, EtherCAT protocol stack and network card driver in each PLC master station are responsible for transmitting the control instructions issued by the PLC master station to the PLC slave stations managed by the PLC master station. The operations of issuing control instructions between PLC master stations do not interfere with each other.

[0019] In one possible implementation, the kernel of the operating system runs on at least one processing core, and the kernel is different from the processor core running on the PLC master station; and multiple PLC master stations run on different processor cores respectively.

[0020] It can be understood that the control system allocates different processor cores to the kernel and multiple PLC master stations respectively, avoiding the problem of reduced processing efficiency caused by competition for processor resources between different PLC master stations or between the PLC master station and the kernel, and ensuring the control speed of the PLC master station over the controlled targets it manages.

[0021] In a second aspect, the present application provides a method for creating a PLC master station, which is applied to a control system, wherein the control system includes a multi-core programmable logic controller (PLC) and an operating system; the multi-core programmable logic controller includes multiple processor cores and at least one network interface card, and the network interface card includes at least one network port; the method includes: in response to receiving a request to create a PLC master station, allocating a processor core and a network port to a target PLC master station; binding the PLC instance with the processor core and network port allocated to the target PLC master station to generate a target PLC master station; wherein the target PLC master station is used to receive operating information of at least one controlled target, and control the controlled target based on the operating information.

[0022] As you can understand, the execution entity provides the ability to dynamically expand the PLC master station. When the execution entity receives a request to create a PLC master station, it allocates a processor core and network port to the target PLC master station to be created, and then binds the allocated processor core and network port to the PLC instance to generate the target PLC master station. Users can flexibly issue PLC master station creation requests, allowing the control system's PLC master station scale to adapt to industrial control needs.

[0023] In one possible implementation, the above-mentioned allocation of processor cores and network ports to the target PLC master station includes: determining the number of target PLC master stations, wherein the number does not exceed the minimum value of unoccupied processor cores and network ports in the available resource pool; recording the occupancy status of multiple processor cores and the occupancy status of multiple network ports in the available resource pool; establishing resource groups equal to the number, wherein the resource group includes at least one unoccupied processor core and at least one unoccupied network port; and allocating multiple resource groups to multiple target PLC master stations.

[0024] It is understood that the execution entity maintains an available resource pool that records the occupancy status of multiple processor cores and multiple network ports. Furthermore, the execution entity allocates processor cores and network ports to the target PLC master station to be created only within the range of unoccupied processor cores and network ports. This ensures that the target PLC master station occupies different processor cores and network ports than previously created or created in the same batch of PLC master stations, thereby ensuring that PLC master stations within the control system do not interfere with each other.

[0025] In a possible implementation, the creation request further indicates at least one PLC slave managed by the target PLC master, with one PLC slave bound to one controlled target; the method further includes:

[0026] establishing communication connections between the network port allocated by the target PLC master station and the second PLC slave station managed by the target PLC master station, respectively, so that the target PLC master station receives operation information of the second controlled target uploaded by the second PLC slave station through the network port allocated by itself, and / or issues control instructions of the second controlled target to the second PLC slave station through the network port allocated by itself; the second controlled target is a controlled target bound to the second PLC slave station;

[0027] and configuring, in the user space of the operating system, a third virtual space for storing a third data packet encapsulating operation information of the second controlled target and uploaded from the network port allocated by the target PLC master station, and a fourth virtual space for storing a fourth data packet encapsulating control instructions of the second controlled target and issued from the target PLC master station;

[0028] And it is stated in the data management suite that in response to monitoring the network port allocated by the target PLC master station to upload a third data packet, the third data packet is stored in the third virtual space, and in response to monitoring the target PLC master station to send a fourth data packet, the sent fourth data packet is stored in the fourth virtual space.

[0029] It can be understood that a buffer is configured in the user state space for storing the third data packet from the network port assigned by the target PLC master station, so that the data management suite can bypass the kernel and directly store the third data packet of the network port into the buffer. At the same time, a buffer is configured in the user state space for storing the fourth data packet from the target PLC master station, so that the data management suite can bypass the kernel and directly store the fourth data packet into the buffer, thereby ensuring that the information reception and transmission of the PLC master station bypasses the kernel.

[0030] In one possible implementation, a PLC instance includes a network card driver, an EtherCAT protocol stack, and a motion control application; binding the PLC instance to a processor core and a network port assigned by a target PLC master station includes: performing a first initialization operation on the network port assigned by the target PLC master station, wherein the first initialization operation includes: declaring that the network port assigned by the target PLC master station retrieves a fourth data packet from a fourth virtual space, and forwarding the fourth data packet to a second PLC slave station; performing a second initialization operation on the network card driver in the PLC instance, wherein the second initialization operation includes: declaring that the network card driver retrieves a third data packet from a third virtual space, and issuing a fourth data packet, wherein the third data packet is decapsulated by the EtherCAT protocol stack to obtain operating information of a second controlled target, and the motion control application generates a control instruction for the second controlled target based on the operating information of the second controlled target; and the EtherCAT protocol stack encapsulates the control instruction of the second controlled target to obtain a fourth data packet;

[0031] Bind the initialized PLC instance to the processor core and initialized network port allocated by the target PLC master station to generate the target PLC master station.

[0032] It can be understood that when creating a PLC master station, it is necessary to establish a communication connection between the network port assigned by the PLC master station and the PLC slave station managed by the PLC master station, thereby establishing a communication path between the PLC master station and the PLC slave station managed by it; it is also necessary to declare the address of the network card driver in the PLC master station to retrieve the data packet from the user state space, and the address of the network port assigned by the PLC master station to retrieve the data packet from the user state space, so as to ensure the smooth upload of the operating information from the PLC slave station and the smooth issuance of the control instructions from the PLC master station.

[0033] In one possible implementation, the method further includes: retrieving a PLC instance from a target storage area, and in response to the number of target PLC master stations being multiple, batch copying the PLC instance based on the number of target PLC master stations, so that the processor cores and network ports allocated to the multiple target PLC master stations are respectively bound to the multiple PLC instances.

[0034] It can be understood that the embodiment of the present application pre-stores a PLC instance, in which the configuration required for the motion control application to receive and send messages is written. By calling and batch copying the PLC instance, a large number of PLC master stations can be quickly constructed.

[0035] In a possible implementation, the method further includes: changing the occupation status of the bound processor core and network card in the available resource pool to occupied.

[0036] It can be understood that changing the occupancy status of the bound processor core and network card in the available resource pool to occupied can ensure that the processor core and network card cannot be used in the subsequent creation of the PLC master station, thereby ensuring the exclusivity of the resources.

[0037] In one possible implementation, the method further includes: in response to the motion control application in the target PLC master station not receiving running information for more than a first preset time, unbinding the processor core and network card corresponding to the target PLC master station, and changing the occupancy status of the unbound processor core and network card in the available resource pool to unoccupied.

[0038] It is understandable that the PLC master station has not received any operating information for a long time, that is, it has not performed device control for a long time. At this time, the resources of the bound processor core and network card are wasted. Therefore, the resources are unbound and the PLC master station is destroyed to ensure that the resources are used as much as possible.

[0039] On the third aspect, the present application provides a control method, which is applied to a PLC master station of a control system, the control system includes a multi-core programmable logic controller and an operating system, and multiple PLC master stations are deployed in the operating system; the multi-core programmable logic controller includes multiple processor cores and at least one network interface card, and the network interface card includes at least one network port; a PLC master station is bound to at least one processing core and at least one network port; wherein the PLC master station runs on the processor core bound to itself; the method includes: receiving operation information of at least one controlled target through the network port bound to itself, and controlling the controlled target based on the operation information.

[0040] In a possible implementation, the control system further includes a plurality of PLC slave stations, each PLC master station is used to manage at least one PLC slave station, and one PLC slave station is bound to one controlled target;

[0041] Each PLC master station receives the operation information of the first controlled target uploaded by the first PLC slave station managed by itself through its own bound network port; and / or sends the control instructions of the first controlled target to the first PLC slave station through its own bound network port, wherein the first controlled target is the controlled target bound to the first PLC slave station.

[0042] In one possible implementation, the control system further includes a data management suite; the operation information of the first controlled target uploaded by the first PLC slave station managed by itself is received through the network port bound to itself, including: retrieving the first data packet encapsulating the operation information of the first controlled target from the first virtual space, wherein the data management suite responds to monitoring the network port bound to the PLC master station to upload the first data packet, obtains the first data packet, and stores the first data packet in the first virtual space; the first virtual space is a space in the user state space for storing data packets from the network port bound to the PLC master station.

[0043] In one possible implementation, control instructions for the first controlled target are sent to the first PLC slave station through the network port bound to itself, including: sending a second data packet encapsulating the control instructions for the first controlled target, wherein the data management suite obtains the second data packet in response to monitoring the PLC master station sending the second data packet, and stores the second data packet in a second virtual space for the network port bound to the PLC master station to retrieve and forward to the first PLC slave station; the second virtual space is a space in the user state space for storing data packets from the PLC master station.

[0044] In one possible implementation, the PLC master station includes a motion control application, an EtherCAT protocol stack, and a network card driver; the process of the PLC master station generating control instructions for the first controlled target includes: the network card driver retrieves a first data packet encapsulating the operating information of the first controlled target from a first virtual space in a polling drive manner, and forwards it to the EtherCAT protocol stack, wherein the first virtual space is a space in the user space for storing data packets from the network port bound to the PLC master station; the EtherCAT protocol stack decapsulates the first data packet to obtain the operating information of the first controlled target, and forwards the operating information of the first controlled target to the motion control application; the motion control application generates control instructions for the first controlled target based on the operating information of the first controlled target.

[0045] In one possible implementation, the process of the PLC master station issuing control instructions for the first controlled target includes: the motion control application sends the control instructions for the first controlled target to the EtherCAT protocol stack; the EtherCAT protocol stack encapsulates the control instructions for the first controlled target to obtain a second data packet, and forwards the second data packet to the network card driver; the network card driver issues the second data packet.

[0046] For the specific description of the third aspect and its various implementations in this application, reference can be made to the detailed description of the first aspect and its various implementations; and for the beneficial effects of the third aspect and its various implementations, reference can be made to the analysis of the beneficial effects in the various implementations of the first aspect, which will not be repeated here.

[0047] In a fourth aspect, the present application provides a control device. The control device includes modules for the method according to the second aspect or any possible design of the second aspect; and modules for the method according to the third aspect or any possible design of the third aspect.

[0048] In a fifth aspect, the present application provides a control device comprising a memory and a processor. The memory and the processor are coupled; the memory is configured to store computer program code, which includes computer instructions. When a first processor core in the processor executes the computer instructions, the control device executes the creation method according to the second aspect and any possible implementation thereof. When multiple second processor cores in the processor, each of which includes multiple PLC master stations, execute the computer instructions, the control device executes the control method according to the third aspect and any possible implementation thereof.

[0049] In a sixth aspect, the present application provides a control device comprising a processor, wherein a first processor core in the processor executes a creation method as in the second aspect and any possible implementation thereof; and a plurality of second processor cores having multiple PLC master stations deployed in the processor execute a control method as in the third aspect and any possible implementation thereof.

[0050] Exemplarily, the processor may be a multi-core programmable logic controller.

[0051] In a seventh aspect, the present application provides a computer-readable storage medium comprising a first computer instruction and a second computer instruction. When the first computer instruction is executed on a control device, the control device executes the method for creating a PLC master station according to the second aspect and any possible implementation thereof; and when the second computer instruction is executed on the control device, the control device executes the control method according to the third aspect and any possible implementation thereof.

[0052] In an eighth aspect, the present application provides a computer program product comprising first computer instructions and second computer instructions. When the first computer instructions are executed on a control device, the control device executes the method for creating a PLC master station according to the second aspect and any possible implementation thereof; and when the second computer instructions are executed on the control device, the control device executes the control method according to the third aspect and any possible implementation thereof.

[0053] For the specific description of the fourth to eighth aspects and their various implementations in this application, reference can be made to the detailed descriptions in the first and second aspects and their various implementations; and for the beneficial effects of the fourth to eighth aspects and their various implementations, reference can be made to the analysis of the beneficial effects in the first and second aspects and their various implementations, which will not be repeated here.

[0054] These and other aspects of the present application will become more readily apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 A schematic diagram of the structure of a control system provided in an embodiment of the present application;

[0056] Figure 2 A schematic diagram of the structure of another control system provided in an embodiment of the present application;

[0057] Figure 3 A schematic diagram of the structure of another control system provided in an embodiment of the present application;

[0058] Figure 4 A flow chart of a method for creating a PLC master station provided in an embodiment of the present application;

[0059] Figure 5 A schematic diagram of an implementation environment of a control method provided in an embodiment of the present application;

[0060] Figure 6 A schematic diagram of the hardware structure of a control device provided in an embodiment of the present application;

[0061] Figure 7 A flow chart of a control method provided in an embodiment of the present application;

[0062] Figure 8 A schematic diagram of the structure of a control device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] In the following, to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or execution order, and the words "first" and "second" do not necessarily mean different.

[0064] In the description of the embodiments of the present application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "a plurality" means two or more. Words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not limit them to be necessarily different.

[0065] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0066] For ease of understanding, the following briefly introduces the relevant terms involved in the embodiments of this application:

[0067] (1) Programmable Logic Controller (PLC): A digital computing controller designed for industrial use. It uses a programmable memory to store programs, execute user-oriented instructions such as logic operations, sequence control, timing, counting, and arithmetic operations, and control various types of machinery or production processes through digital or analog input / output.

[0068] (2) PLC system: A system with a programmable logic controller (PLC) as the main control unit, which includes a PLC master station and a PLC slave station.

[0069] (3) PLC Master: The core of the PLC system, it receives operating information from external industrial equipment and generates control instructions based on this information. The PLC Master can manage multiple PLC Slave stations and issue control instructions to them, enabling the control of external industrial equipment.

[0070] (4) Hard PLC master station: Strictly speaking, it is a hardware or a dedicated integrated circuit (ASIC) or processor chip with an embedded operating system to implement PLC instruction processing.

[0071] (5) Soft PLC master station: It is a technology based on a general operating system and PC platform that uses software to implement traditional hardware PLC control functions.

[0072] (6) PLC slave station: A device that can receive control instructions from the PLC master station and convert the control instructions into signals to control external industrial equipment.

[0073] (7) User-mode Data Plane Development Kit (DPDK): This is a user-mode data plane development kit that complies with the open source BSD-3-Clause protocol. It runs on the Linux system and is a collection of function libraries and drivers for fast data packet processing. It can greatly improve data processing performance and throughput, and improve the work efficiency of data plane applications.

[0074] (8) BSD-3-Clause Agreement: It is a loose, business-friendly, and code-sharing-encouraging open source license. It is widely used, protecting the copyright of the original author and promoting the development of the open source community.

[0075] (9) Virtual Machine Manager (VMM), also known as Hypervisor, is a software or hardware layer used to create, run, and manage virtual machines. It allows multiple operating systems to run in parallel on the same physical machine, with each operating system running in its own virtual environment.

[0076] (10) Real-Time Operating System (RTOS): An operating system specifically designed to handle real-time tasks. Its core feature is the ability to complete tasks within strict time limits and is suitable for time-sensitive application scenarios.

[0077] (11) Non-Real-Time Operating System (Non-RTOS): An operating system that does not emphasize time limits for task execution. Its design goal is to provide a general computing environment that supports multi-tasking, resource management, and user interaction, but does not strictly guarantee the response time and execution order of tasks.

[0078] (12) The EtherCAT (Ethernet for Control Automation Technology) protocol stack is the software component that implements EtherCAT communication and typically runs on master and slave devices. EtherCAT is a high-performance industrial Ethernet protocol designed specifically for industrial automation control systems.

[0079] (13) A Packet Processing Driver (PMD) is a high-performance network packet processing driver typically used in user-space network stacks (such as DPDK, Data Plane Development Kit) to bypass the overhead of traditional kernel network stacks and achieve low-latency and high-throughput packet processing. PMD interacts directly with the network card hardware to optimize the reception and transmission of packets and is widely used in fields such as Network Function Virtualization (NFV), Software Defined Networking (SDN), and High-Performance Computing (HPC).

[0080] (14) A Network Interface Card (NIC), also known as a network card, is a hardware interface between a computer or other network device and the network. It is responsible for sending data from the computer to the network and receiving data from the network.

[0081] (15) Network Port: It is a physical interface on a network device (such as a computer, switch, or router) used to connect a network cable or optical fiber to achieve data transmission. It is part of a network interface card (NIC) or network device and is responsible for sending data from the device to the network and receiving data from the network.

[0082] The control system provided in the embodiment of the present application can be applied to the control scenarios of industrial equipment. By flexibly creating multiple PLC master stations in the user space of the operating system in a multi-core programmable logic controller, it supports complex motion control algorithms and controls more PLC slave stations, thereby meeting the control needs of complex industrial equipment.

[0083] Traditional hard PLC master stations utilize dedicated, low-performance embedded AISI or processor chips as dedicated PLC controllers. This limited their deployment to a single PLC master station, limiting their flexibility and suitability for simple logic control and motion control of a few components of complex industrial equipment. Controlling complex industrial equipment with a hard PLC master station necessitated the simultaneous use of multiple hard PLC master stations, increasing control costs.

[0084] To meet the control needs of complex industrial equipment, related solutions have improved the hardware PLC master station, replacing the dedicated PLC controller with a more versatile multi-core programmable logic controller (such as an industrial computer). Furthermore, a virtual machine manager is used to virtualize multiple real-time operating systems under a non-real-time operating system. PLC master stations are built in each of these real-time operating systems, creating multiple virtual machines, each running a PLC master station in the operating system environment of the virtual machine. Although this solution can deploy multiple PLC master stations to meet the control needs of complex industrial equipment, it requires the introduction of a virtual machine manager, which increases the operating overhead of the virtual machine manager. Furthermore, each virtual machine runs an operating system, and other unrelated applications outside the PLC master station increase the operating overhead of the virtual machine and affect the PLC master station's data processing efficiency.

[0085] Since control overhead and control efficiency are very important for industrial control, it is urgent to propose a control system with low control overhead and high control efficiency. In view of this, an embodiment of the present application provides a control system, which deploys multiple PLC master stations in the user state space. The multiple PLC master stations use the processor cores and network port resources bound to themselves in the multi-core programmable logic controller to complete the control work of at least one controlled target managed by themselves. Since the kernel of the operating system generally only occupies part of the processor cores and network port resources in the multi-core programmable logic controller, the multi-core programmable logic controller has abundant processor cores and network ports. By utilizing the abundant processor core resources and network port resources, multiple PLC master stations are deployed in the user state space of the operating system, which realizes full utilization of resources and saves operating overhead.

[0086] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0087] Figure 1 A schematic diagram of the structure of a control system provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the system includes: a multi-core programmable logic controller 110 and an operating system 120, wherein multiple PLC master stations 130 are deployed in the operating system 120; the multi-core programmable logic controller 110 includes multiple processor cores 111 and at least one network interface card 112, and the network interface card 112 includes at least one network port 1121; and one PLC master station 130 is bound to at least one processing core 111 and at least one network port 1121.

[0088] In one possible implementation, the multiple processor cores 111 included in the multi-core programmable logic controller 110 are logical processor cores, the PLC master station is a soft PLC master station, and the PLC master station 130 is deployed in the user mode space of the operating system 120 .

[0089] Figure 1 In the user space of the operating system 120, PLC master station 130A, PLC master station 130B and PLC master station 130C are deployed. PLC master station 130A, PLC master station 130B and PLC master station 130C manage controlled targets 140A, controlled targets 140B and controlled targets 140C respectively. The multi-core programmable logic controller 110 includes processor cores 111A, 111B and 111C and network interface cards 112A and 112B. The network interface card 112A includes network ports 1121A and 1121B. The network interface card 112B includes a network port 1121C. The PLC master station 130A is bound to the processor core 111A and the network port 1121A. The PLC master station 130B is bound to the processor core 111B and the network port 1121B. The PLC master station 130C is bound to the processor core 111C and the network port 1121C.

[0090] It is understandable that the controlled target 140 may be a complete industrial device, such as a robot, or a partial component of a complete industrial device, such as the left arm or right arm of a robot.

[0091] Furthermore, the PLC master station 130 runs on the processor core 111 bound to itself, receives operation information of at least one controlled target 140 managed by itself through the network port bound to itself, and controls the controlled target 140 based on the operation information.

[0092] Among them, the multi-core programmable logic controller 110 is a general-purpose PLC controller widely used in industrial automation control. It includes a memory for storing system programs, application programs and data, an editor, a processor, a network interface card, a power supply, an external device interface, an I / O expansion interface, an input interface and an input interface, etc. It has high flexibility and programmability and can realize complex logical operations and control.

[0093] In one possible implementation, the above-mentioned operating system 120 can be a real-time operating system or a non-real-time operating system. Multiple PLC master stations 130 are directly deployed in the user space of the operating system 120. Each PLC master station 130 runs on one or more processor cores 111 bound to itself, and receives the operating information of at least one controlled target 140 managed by itself through one or more network ports 1121 bound to itself, generates control instructions based on the operating information, and issues control instructions to realize the control of the controlled target 140.

[0094] The kernel of the operating system 120 is bound to and runs on a designated processor core 111 , and the kernel and the processor cores 111 bound to multiple PLC master stations 130 may overlap.

[0095] Exemplarily, the kernel runs on the first processor core, the first PLC master station is bound to the first processor core, the second processor core and the third processor core, the second PLC master station is bound to the third processor core and the fourth processor core, the third PLC master station is bound to the fifth processor core, the fourth PLC master station is bound to the fifth processor core, and the fifth PLC master station is bound to the sixth processor core.

[0096] It can be seen that there is overlap in the processors bound to the kernel and the first PLC master station, the first and second PLC master stations, and the third and fourth PLC master stations. That is, the kernel and the first PLC master station are both bound to the first processor core, the first and second PLC master stations are both bound to the third processor core, and the third and fourth PLC master stations are both bound to the fifth processor core. In this way, although the processor core resources can be fully utilized, the inevitable competition for processor resources between the kernel and the first, second, third, and fourth PLC master stations may cause the PLC master station 130 to reduce the control speed of the controlled targets it manages due to mutual influence.

[0097] Alternatively, the kernel and the processor cores 111 bound to the plurality of PLC masters 130 are different from each other.

[0098] For example, the kernel is bound to the first processor core, the first PLC master station is bound to the second processor core, the second PLC master station is bound to the third processor core, the third PLC master station is bound to the fourth processor core, the fourth PLC master station is bound to the fifth processor core, and the fifth PLC master station is bound to the sixth processor core. The kernel and the PLC master stations 130 do not compete for processor resources and do not interfere with each other, thus ensuring the control speed of the controlled targets managed by the PLC master stations 130.

[0099] It should be noted that multiple PLC master stations 130 need to receive operation information of the controlled targets 140 managed by themselves or issue control instructions to the controlled targets 140 managed by themselves. There is no data cross-border between the multiple PLC master stations 130. Therefore, the network ports 1121 bound to the multiple PLC master stations 130 need to be set to be different from each other so that the multiple PLC master stations 130 can receive / send their own data through their respective network ports 1121.

[0100] In an embodiment of the present application, the control system deploys multiple PLC master stations 130 in user space. These multiple PLC master stations 130 utilize the processor cores 111 and network ports 1121 resources bound to them in the multi-core programmable logic controller 110 to complete control of at least one controlled target 140 that they manage. Since the kernel of the operating system 120 generally only occupies some of the processor cores 111 and network ports 1121 resources in the multi-core programmable logic controller 110, the multi-core programmable logic controller 110 has a surplus of processor cores 111 and network ports 1121. By utilizing the surplus processor core 111 and network port 1121 resources, multiple PLC master stations 130 are deployed in the user space of the operating system 120, achieving full resource utilization. Compared to using a virtual machine manager to virtualize multiple real-time operating systems for multiple PLC master stations 130 to run, this reduces the overhead of the virtual machine manager and virtual machine operations.

[0101] Figure 2 A structural diagram of another control system provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the control system includes: a multi-core programmable logic controller 210, an operating system 220 and multiple PLC slave stations 250; multiple PLC master stations 230 are deployed in the operating system 220, and each PLC master station 230 manages at least one PLC slave station 250; the multi-core programmable logic controller 210 includes multiple processor cores 211 and at least one network interface card 212, and the network interface card 212 includes at least one network port 2121; one PLC master station 230 is bound to at least one processing core 211 and at least one network port 2121; one PLC slave station 250 is bound to one controlled target 240; wherein the PLC master station 230 runs on the processor core 211 to which it is bound;

[0102] In a possible implementation, the control system further includes a plurality of PLC slave station clusters 251 , and each of the PLC master stations 230 manages at least one PLC slave station cluster 251 ; each PLC slave station cluster 251 includes at least one PLC slave station 250 .

[0103] It is understandable that the controlled target 240 may be a complete industrial device, such as a robot, or a partial component of a complete industrial device, such as the left arm or right arm of a robot.

[0104] When the controlled target 240 is a complete industrial equipment, multiple PLC slave stations 250 belonging to the same PLC slave station cluster 251 are interconnected in business, such as there are steps executed in sequence. Normally, the PLC slave station cluster 251 uploads the operation information of multiple controlled targets 240 corresponding to the multiple PLC slave stations 250 to the PLC master station 230, and receives the control instructions of multiple controlled targets 240 corresponding to the multiple PLC slave stations 250 issued by the PLC master station 230, thereby avoiding control errors caused by excessive control fragmentation between the controlled targets that are interconnected in business.

[0105] In the case where the controlled target 240 is a partial component of a complete industrial device, multiple PLC slave stations 250 belonging to the same PLC slave station cluster 251 belong to the same controlled device 241. Similarly, the PLC slave station cluster 251 uploads the operating information of the multiple controlled targets 240 corresponding to the multiple PLC slave stations 250 to the PLC master station 230, and receives the control instructions of the multiple controlled targets 240 corresponding to the multiple PLC slave stations 250 issued by the PLC master station 230, thereby realizing coordinated control of different parts of the unified device.

[0106] In one possible implementation, the multiple processor cores 211 included in the multi-core programmable logic controller 210 are logical processor cores, the PLC master station is a soft PLC master station, and the PLC master station 230 is deployed in the user space of the operating system 220.

[0107] Figure 2The controlled target 240 is taken as an example, which is a partial component of a complete industrial equipment. In the figure, the user space of the operating system 220 deploys the PLC master station 230A, PLC master station 230B and PLC master station 230C. The multi-core programmable logic controller 210 includes processor cores 211A, 211B and 211C and network interface cards 212A and 212B. The network interface card 212A includes network ports 2121A and 2121B. The network interface card 212B includes a network port 2121C. The PLC master station 230A is bound to the processor core 211A and the network port 2121A. The PLC master station 230B is bound to the processor core 211B and the network port 2121B. The PLC master station 230C is bound to the processor core 211C and the network port 2121C. PLC master station 230A, PLC master station 230B and PLC master station 230C respectively manage PLC slave station cluster 251A, PLC slave station cluster 251B and PLC slave station cluster 251C, and PLC slave station cluster 251A, PLC slave station cluster 251B and PLC slave station cluster 251C are respectively used to manage controlled devices 241A, controlled devices 241B and controlled devices 241C, wherein PLC slave station cluster 251A includes PLC slave station 250A, PLC slave station 250B and PLC slave station 250C, and PLC slave station 250A, PLC slave station 250B and PLC slave station 250C are respectively used to control the controlled targets 240A, controlled targets 240B and controlled targets 240C of the controlled device 241A.

[0108] Furthermore, the PLC master station 230 receives the operation information of the first controlled target uploaded by the first PLC slave station managed by itself through its own bound network port; and / or sends the control instructions of the first controlled target to the first PLC slave station through its own bound network port, wherein the first controlled target is the controlled target bound to the first PLC slave station, and the first PLC slave station refers to each PLC slave station 230 managed by the PLC master station 230.

[0109] In one possible implementation, the PLC master station 230 is used to manage at least one PLC slave station cluster 251, which means that the PLC master station 230 is communicatively connected with at least one PLC slave station cluster 251 through its bound network port 2121, and the network port 2121 can be an Ethernet physical network port.

[0110] The multiple PLC slave station clusters 251 managed by the PLC master station 230 can control multiple controlled devices 241 that have no business association with each other.

[0111] As an example, the PLC master station 230 manages the PLC slave station cluster 251 including: a first PLC slave station cluster and a second PLC slave station cluster, the first PLC slave station cluster and the second PLC slave station cluster being used to control a multi-axis linkage CNC grinding machine and an industrial robot respectively;

[0112] If a controlled device 241 is too complex, it can be split into multiple sub-devices. The PLC master station 230 manages multiple PLC slave clusters 251, each of which can control different sub-devices of the controlled device 241. For example, the PLC slave clusters 251 managed by the PLC master station 230 include a first PLC slave cluster, a second PLC slave cluster, and a third PLC slave cluster. The first, second, and third PLC slave clusters are used to control the multi-axis motion system, spindle system, and grinding wheel system of a multi-axis CNC grinding machine, respectively. In this case, the controlled target 240 is a component within a sub-device.

[0113] It should be noted that the PLC slave cluster 251 includes multiple PLC slaves 250, which are used to control different parts of the controlled device 241. Each PLC slave 250 can implement multiple controls for its corresponding part.

[0114] As an example, the PLC slave cluster 251 includes multiple PLC slaves 250 including a first PLC slave, a second PLC slave, a third PLC slave and a fourth PLC slave, wherein the first PLC slave, the second PLC slave, the third PLC slave and the fourth PLC slave are used to control the left arm, right arm, left leg and right leg of the industrial robot.

[0115] It should be noted that each PLC slave station 250 is used to perform multi-dimensional control of the corresponding controlled target 240A. For example, the second PLC slave station controls the right arm of the industrial robot to move linearly along the X axis, linearly along the Y axis, linearly along the Z axis, and rotate counterclockwise around its axis, etc. Through this deployment, the PLC master station 230 can exercise refined control over the controlled targets 240 it manages.

[0116] Figure 3 A structural diagram of another control system provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the control system includes: a multi-core programmable logic controller 310 and an operating system 320, multiple PLC slave station clusters 351 and a data management suite 360; multiple PLC master stations 330 are deployed in the operating system 320; the PLC master station 330 is used to manage at least one PLC slave station cluster 351, and the multiple PLC slave stations 350 in the PLC slave station cluster 351 are respectively bound to multiple controlled targets 340 in the same controlled device 341; the multi-core programmable logic controller 310 includes multiple processor cores 311 and at least one network interface card 312, and the network interface card 312 includes at least one network port 3121; one PLC master station 330 is bound to at least one processing core 311 and at least one network port 3121.

[0117] In one possible implementation, the multiple processor cores 311 included in the multi-core programmable logic controller 310 are logical processor cores, the PLC master station 330 is a soft PLC master station, and the PLC master station 330 is deployed in the user space of the operating system 320.

[0118] Figure 3 In the user space of the operating system 320, the PLC master station 330A, PLC master station 330B and PLC master station 330C are deployed. The multi-core programmable logic controller 310 includes processor cores 311A, 311B and 311C and network interface cards 312A and 312B. The network interface card 312A includes network ports 3121A and 3121B. The network interface card 312B includes network port 3121C. The PLC master station 330A is bound to the processor core 311A ​​and the network port 3121A. The PLC master station 330B is bound to the processor core 311B and the network port 3121B. The PLC master station 330C is bound to the processor core 311C and the network port 3121C. PLC master station 330A, PLC master station 330B and PLC master station 330C respectively manage PLC slave station cluster 351A, PLC slave station cluster 351B and PLC slave station cluster 351C, and PLC slave station cluster 351A, PLC slave station cluster 351B and PLC slave station cluster 351C are respectively used to manage controlled devices 341A, controlled devices 341B and controlled devices 341C, wherein PLC slave station cluster 351A includes PLC slave station 350A, PLC slave station 350B and PLC slave station 350C, and PLC slave station 350A, PLC slave station 350B and PLC slave station 350C are respectively used to control the controlled targets 340A, controlled targets 340B and controlled targets 340C of the controlled device 341A. The data management suite 360 ​​is a transit station for uploading operating information and issuing control instructions between the PLC slave cluster 351A and the PLC master 330A, the PLC slave cluster 351B and the PLC master 330B, and the PLC slave cluster 351C and the PLC master 330C. The PLC master 330A includes a motion control application 331A, an EtherCAT protocol stack 332B, and a network card driver 333C, which are used to process operating information to generate control instructions and issue control instructions.

[0119] Specifically, the data management suite 360 ​​is configured to, in response to detecting that the network port bound to the PLC master station 330 uploads a first data packet encapsulating the operating information of the first controlled target, obtain the first data packet and store the first data packet in a first virtual space for retrieval by the PLC master station 330; and / or, in response to detecting that the PLC master station 330 sends a second data packet encapsulating the control instructions of the first controlled target, obtain the second data packet and store the second data packet in a second virtual space for retrieval by the network port bound to the PLC master station 330 and forward it to the first PLC slave station; wherein the first virtual space is a space in the user state space of the operating system for storing data packets from the network port bound to the PLC master station; and the second virtual space is a space in the user state space of the operating system for storing data packets from the PLC master station. It is understandable that the first controlled target is the controlled target bound to the first PLC slave station, and the first PLC slave station refers to each PLC slave station 330 managed by the PLC master station 330. The data management suite 360 ​​monitors in real time whether each network port 3121 has uploaded the operating information of the controlled target 340. If so, the operating information is stored in the first virtual space allocated to the network port 3121 in the user space. In this way, the PLC master station 330 corresponding to the network port 3121 can retrieve the operating information and generate control instructions for the controlled target 340 based on the operating information. Similarly, the data management suite 360 ​​also monitors in real time whether each PLC master station 330 has issued a control instruction for the controlled target 340. If so, the control instruction is stored in the second virtual space allocated to the PLC master station 330 in the user space. In this way, the network port 3121 corresponding to the PLC master station 330 can retrieve the control instruction and convey the control instruction to the corresponding PLC slave station 350, so that the PLC slave station 350 controls the controlled target 340. During this process, the uploading of operating information and the issuance of control instructions are completed entirely in the user state space, without the involvement of the kernel state of the operating system 320. This avoids the memory copy overhead and context switching of operating information and / or control instructions between the kernel state and the user state in traditional PLC master stations, and reduces the consumption of processor resources.

[0120] In one possible implementation, the data management suite 360 ​​monitors in real time whether each network port 3121 has uploaded operating information of the controlled target 340, including: for each network port 3121, in response to receiving an information upload notification sent by the network port 3121, determining that the network port 3121 has uploaded operating information of the controlled target 340. Accordingly, the data management suite 360 ​​monitors in real time whether each PLC master station 330 has issued a control instruction to the controlled target 340, including: for each PLC master station 330, in response to receiving an instruction issuance notification sent by the PLC master station 330, determining that the PLC master station 330 has issued a control instruction to the controlled target 340.

[0121] In one possible implementation, the PLC master station 330 includes a motion control application 331 , an EtherCAT protocol stack 332 , and a network card driver 333 ;

[0122] Among them, the PLC master station 330 retrieves the operating information of the first controlled target from the first virtual space, and generates control instructions for the first controlled target based on the operating information of the first controlled target, specifically: the network card driver 333 retrieves the first data packet encapsulated with the operating information of the first controlled target from the first virtual space in a polling drive manner, and forwards it to the EtherCAT protocol stack 332; the EtherCAT protocol stack 332 decapsulates the first data packet to obtain the operating information of the first controlled target, and forwards the operating information of the first controlled target to the motion control application 331; the motion control application 331 generates control instructions for the first controlled target based on the operating information of the first controlled target.

[0123] The PLC master station 330 also issues control instructions for the first controlled target, specifically including: the motion control application 331 forwards the control instructions for the first controlled target to the EtherCAT protocol stack 332; the EtherCAT protocol stack 332 encapsulates the control instructions for the first controlled target into a second data packet, and forwards the second data packet to the network card driver 333; the network card driver 333 sends the second data packet in a polling drive manner.

[0124] The above-mentioned motion control application 331, EtherCAT protocol stack 332 and network card driver 333 are all deployed in the user state space. Each PLC master station 330 can receive the EtherCAT data packet encapsulated with the operating information of the controlled first controlled target 340 sent by the PLC slave station 350 through the network card driver 333, and pass it to the motion control application 331 after being decapsulated by the EtherCAT protocol stack 332; after being processed by the motion control application 331, the control instructions of the first controlled target are generated, and the control instructions of the first controlled target are encapsulated by the EtherCAT protocol stack 332 to generate EtherCAT data packets that are directly sent out through the network card driver 333. Compared with the traditional PLC master station deploying the motion control application 331 in the user state and the EtherCAT protocol stack 332 and the network card driver 333 in the kernel state, the copying overhead of the EtherCAT data packet between the kernel state and the user state is avoided.

[0125] The polling drive mode mentioned above refers to periodically receiving and sending EtherCAT data packets through the processor core 311, replacing the traditional PLC master station's interrupt mode of receiving and sending EtherCAT data packets with the polling drive mode, effectively improving I / O processing efficiency and reducing latency.

[0126] The EtherCAT data packet encapsulated with the control instructions of the first controlled target bound to the first PLC slave station and sent by the above-mentioned network card driver 333 arrives at the data management suite 360, and the data management suite 360 ​​stores it in the second virtual space, and then feedbacks the storage completion message to the network card driver 333. The network card driver 333 notifies the network port bound to the PLC master station 330 through a message to call it, or directly informs the PLC master station 330 to call it; the network port bound to the PLC master station 330 calls the control instructions of the first controlled target and forwards it to the first PLC slave station, so that the first PLC slave station controls the corresponding controlled target.

[0127] It is understood that different PLC master stations 330 are deployed with different motion control applications 331, EtherCAT protocol stacks 332, and network card drivers 333, and that the PLC master stations 330 do not interfere with each other in receiving and sending EtherCAT data packets. Furthermore, the control system 320 can also receive and send EtherCAT data packets in the same manner as a traditional PLC master station, which will not be further described here.

[0128] Figure 4 A flow chart of the method for creating a PLC master station provided in the embodiment of the present application is shown as follows: Figure 4 As shown, the execution subject of creating the PLC master station can be the above-mentioned control system, specifically the kernel of an operating system running on a multi-core programmable logic controller in the control system, the multi-core programmable logic controller includes multiple processor cores and at least one network interface card, and the network interface card includes at least one network port; the creation process includes:

[0129] S401, in response to receiving a request to create a PLC master station, allocating a processor core and a network port to a target PLC master station;

[0130] S402: Bind the PLC instance to the processor core and network port allocated by the target PLC master station to generate the target PLC master station. The target PLC master station is configured to receive operating information of at least one controlled target and control the controlled target based on the operating information. The PLC instance includes a motion control application, an EtherCAT protocol stack, and a network card driver.

[0131] The PLC instance described above is a piece of software code pre-stored in the target storage area. It contains the necessary configuration for receiving operational information and issuing control instructions, including, for example, the motion control application, the EtherCAT protocol stack, and the network card driver. Furthermore, PLC instances can be called and replicated at any time. Therefore, when a creation request includes multiple target PLC master stations, a large number of PLC master stations can be quickly constructed by calling and replicating PLC instances. In other words, the kernel provides the ability to dynamically expand PLC master stations, enabling the control system to adapt to industrial control needs.

[0132] In one possible implementation, the above-mentioned allocation of processor cores and network ports to the target PLC master station includes: determining the number of target PLC master stations, wherein the number does not exceed the minimum value of unoccupied processor cores and network ports in the available resource pool; recording the occupancy status of multiple processor cores and the occupancy status of multiple network ports in the available resource pool; establishing resource groups equal to the number, wherein the resource group includes at least one unoccupied processor core and at least one unoccupied network port; and allocating multiple resource groups to multiple target PLC master stations.

[0133] The execution entity maintains an available resource pool that records the occupancy status of multiple processor cores and network ports. The execution entity allocates processor cores and network ports to the newly created PLC master station only within the range of unoccupied processor cores and network ports. This ensures that the newly created PLC master station occupies different processor cores and network ports than those previously created or created in the same batch, thereby ensuring that PLC master stations within the control system do not interfere with each other.

[0134] In a possible implementation, the creation request further indicates at least one PLC slave managed by the target PLC master, with one PLC slave bound to one controlled target; and the execution subject is further configured to:

[0135] establishing communication connections between the network port allocated by the target PLC master station and the second PLC slave station managed by the target PLC master station, respectively, so that the target PLC master station receives operation information of the second controlled target uploaded by the second PLC slave station through the network port allocated by itself, and / or issues control instructions of the second controlled target to the second PLC slave station managed by itself through the network port allocated by itself; the second controlled target is the controlled target bound to the second PLC slave station;

[0136] as well as

[0137] The execution subject is further configured to configure in the user state space a third virtual space for storing a third data packet encapsulating operation information of the second controlled target and uploaded from the network port allocated by the target PLC master station, and to configure in the user state space a fourth virtual space for storing a fourth data packet encapsulating control instructions of the second controlled target and issued from the target PLC master station;

[0138] as well as

[0139] The above-mentioned execution entity is also used to declare in the data management suite deployed in the user-mode space that in response to monitoring the network port allocated by the target PLC master station to upload a third data packet, the third data packet is stored in the third virtual space, and in response to monitoring the target PLC master station to send a fourth data packet, the fourth data packet is stored in the fourth virtual space.

[0140] When creating a PLC master station, the above-mentioned execution entity needs to establish a communication connection between the network port assigned by the PLC master station and the PLC slave station managed by the PLC master station, thereby establishing a communication path between the PLC master station and the PLC slave station managed by it, so that the PLC slave station can upload the operating information of the control target bound to it and receive the control instructions of the control target bound to it by the PLC master station. The above-mentioned execution entity also configures a buffer in the user state space for storing the third data packet from the network port assigned by the target PLC master station, so that the data management suite can bypass the kernel and directly store the third data packet from the network port in the buffer. At the same time, a buffer is configured in the user state space for storing the fourth data packet from the target PLC master station, so that the data management suite can bypass the kernel and directly retrieve the fourth data packet from the buffer, thereby ensuring that the target PLC master station can bypass the kernel of the operating system when receiving and sending data packets, avoiding the data copying and context switching overhead of the data packet between the kernel state and user state of the operating system.

[0141] In one possible implementation, the PLC instance includes a network card driver, an EtherCAT protocol stack, and a motion control application; the above-mentioned binding of the PLC instance with the processor core and network port assigned to the target PLC master station includes: performing a first initialization operation on the network port assigned to the target PLC master station, wherein the first initialization operation includes: declaring that the network port assigned to the target PLC master station retrieves a fourth data packet from a fourth virtual space and forwarding the fourth data packet to a second PLC slave station; performing a second initialization operation on the network card driver in the PLC instance, wherein the second initialization operation includes: declaring that the network card driver in the PLC instance retrieves a third data packet from a third virtual space and sending a fourth data packet, wherein the third data packet is decapsulated by the EtherCAT protocol stack to obtain operating information of the second controlled target, and the motion control application generates control instructions for the second controlled target based on the operating information of the second controlled target; the EtherCAT protocol stack encapsulates the control instructions of the second controlled target to obtain a fourth data packet; and binding the initialized PLC instance to the processor core and initialized network port assigned to the target PLC master station to generate a target PLC master station.

[0142] The above execution entity declares that the network card driver in the PLC master station retrieves the address of the data packet from the user state space, and the network port allocated by the PLC master station retrieves the address of the data packet from the user state space, so that the data packet corresponding to the PLC master station can be uploaded and sent smoothly.

[0143] It is understandable that the first initialization operation and the second initialization operation also include other operations such as working mode configuration and MAC configuration, and their purpose is to enable the network port or network card driver to transmit messages normally.

[0144] In one possible implementation, the above-mentioned execution entity is also used to change the occupancy status of the bound processor core and network card in the available resource pool to occupied; in response to the motion control application in the target PLC master station not receiving running information for more than a first preset time, unbind the processor core and network card corresponding to the target PLC master station, and change the occupancy status of the unbound processor core and network card in the available resource pool to unoccupied.

[0145] It's understandable that changing the occupancy status of the bound processor core and network card in the available resource pool to occupied ensures that the processor core and network card cannot be used by subsequently created PLC master stations, thus ensuring resource exclusivity. If the PLC master station hasn't received operating information for an extended period, meaning it hasn't controlled devices, the bound processor core and network card resources are wasted. Therefore, these resources are unbound and the PLC master station is destroyed, ensuring maximum resource utilization.

[0146] In the embodiment of the present application, the abundant processor cores and network port resources of the multi-core programmable logic controller are utilized to bind multiple groups of processor cores and network port resources to multiple PLC master stations, thereby flexibly implementing multiple PLC master stations on the same multi-core programmable logic controller without the need to create virtual machines and real-time operating systems through a virtual machine manager, effectively avoiding the additional overhead brought by virtual machines and virtual machine managers.

[0147] Further, Figure 5 Schematic diagram of an implementation environment of a control method provided in an embodiment of the present application. Figure 5 As shown, the implementation environment may include: a multi-core programmable logic controller 510, multiple PLC slave station clusters 551 and a data management suite 560, multiple PLC master stations 530 are deployed in the user mode space of the operating system running on the multi-core programmable logic controller 510; the PLC master station 530 manages at least one PLC slave station cluster 551, and multiple PLC slave stations 550 in each PLC slave station cluster 551 are respectively bound to multiple controlled targets 540 in the same controlled device 541 (that is, the PLC slave station 550A, PLC slave station 550B and PLC slave station 550C in the PLC slave station cluster 551 are respectively bound to the controlled targets 540A, controlled targets 540B and controlled targets 540C in the controlled device 541).

[0148] The multi-core programmable logic controller 510 includes multiple processor cores and at least one network interface card, and the network interface card includes at least one network port, which is used to provide processor core resources and network port resources for multiple PLC master stations 530.

[0149] The PLC slave station 550 is used to monitor the operating information of the controlled target 540 and upload it through the network port bound to the corresponding PLC master station, and to call the control instructions of the controlled target 540 issued by the PLC master station 530 through the network port bound to the PLC master station 530, and convert the control instructions into control signals to control the controlled target 540.

[0150] The data management suite 560 is used to obtain the first data packet and store the first data packet in the first virtual space in response to monitoring the network port bound to the PLC master station 530 uploading the first data packet encapsulating the operation information of the controlled target 540; and / or obtain the second data packet and store the second data packet in the second virtual space in response to monitoring the PLC master station 530 sending the second data packet encapsulating the control instructions of the controlled target 540; the first virtual space and the second virtual space are respectively spaces in the user state space for storing the network port bound to the PLC master station 530 and the data packets from the PLC master station 530, and are generally located in the data management suite 560.

[0151] The PLC master station 530 runs on its own bound processor core and includes: the PLC master station 530 includes a motion control application 531 , an EtherCAT protocol stack 532 and a network card driver 533 ;

[0152] The network card driver 533 is used to retrieve the first data packet encapsulating the operation information of the controlled target 540 from the first virtual space in a polling drive manner, and forward it to the EtherCAT protocol stack 532; the EtherCAT protocol stack 532 decapsulates the first data packet to obtain the operation information, and forwards the operation information to the motion control application 531; the motion control application 531 generates control instructions based on the operation information.

[0153] The motion control application 531 also forwards the control instruction of the controlled target 540 to the EtherCAT protocol stack 532; the EtherCAT protocol stack 532 encapsulates the control instruction into a second data packet and forwards the second data packet to the network card driver 533; the network card driver 533 sends the second data packet in a polling drive manner.

[0154] Figure 6 This is a hardware structure diagram of a control device provided in an embodiment of the present application. Figure 6 , Figure 6 The control device 600 shown may include: a processor 601 , a memory 602 , a communication interface 603 , and a bus 604 . The processor 601 , the memory 602 , and the communication interface 603 may be connected via the bus 604 .

[0155] The processor 601 is the control center of the control device, and can be a general-purpose central processing unit such as a CPU, or other general-purpose processors, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0156] As an example, the processor 601 may include one or more CPUs, such as Figure 6 CPU 0 and CPU 1 are shown in Figure 1.

[0157] The memory 602 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0158] In one possible implementation, the memory 602 may exist independently of the processor 601. The memory 602 may be connected to the processor 601 via a bus 604 and may be used to store data, instructions, or program codes. When the processor 601 calls and executes the instructions or program codes stored in the memory 602, the method for creating or controlling a PLC master station provided in the embodiments of the present application may be implemented.

[0159] In another possible implementation, the memory 602 may also be integrated with the processor 601 .

[0160] The communication interface 603 is used to connect the control device to other devices via a communication network, which can be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication interface 603 may include a receiving unit for receiving data and a sending unit for sending data.

[0161] Bus 604 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. This bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0162] It should be pointed out that Figure 6 The structure shown in the figure does not constitute a limitation on the control device, except Figure 6 In addition to the components shown, the control device may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0163] Further, Figure 7 This is a flow chart of a control method provided in an embodiment of the present application. Figure 7 As shown, the execution subject of the control method is a PLC master station of the control system, the control system includes a multi-core programmable logic controller and an operating system, and multiple PLC master stations are deployed in the operating system; the multi-core programmable logic controller includes multiple processor cores and at least one network interface card, the network interface card includes at least one network port, and one PLC master station is bound to at least one processor core and at least one network port; wherein the PLC master station runs on the processor core bound to itself; the method includes:

[0164] S701, receiving operation information of at least one controlled target through its bound network port;

[0165] S702: Control the controlled target based on the operation information.

[0166] The technical solution provided by the embodiment of the present application is that multiple PLC master stations use the processor cores and network port resources bound to themselves in the multi-core programmable logic controller to complete the control work of at least one controlled target managed by themselves. Since the kernel of the operating system generally only occupies some of the processor cores and network port resources in the multi-core programmable logic controller, the multi-core programmable logic controller has abundant processor cores and network ports. By utilizing the abundant processor core resources and network port resources, multiple PLC master stations are deployed in the user state space of the operating system, achieving full utilization of resources. Compared with the method of using a virtual machine manager to virtualize multiple real-time operating systems for multiple PLC master stations to run, the operating overhead of the virtual machine manager and virtual machines is reduced.

[0167] In some possible implementations, the control system further includes a plurality of PLC slave stations, each PLC master station is used to manage at least one PLC slave station, and one PLC slave station is bound to one controlled target;

[0168] Each PLC master station receives the operation information of the first controlled target uploaded by the first PLC slave station managed by itself through its own bound network port; and / or sends the control instructions of the first controlled target to the first PLC slave station through its own bound network port, wherein the first controlled target is the controlled target bound to the first PLC slave station.

[0169] In some possible implementations, the control system further includes a data management suite;

[0170] The above-mentioned receiving the operation information of the first controlled target uploaded by the first PLC slave station managed by itself through the network port bound to itself includes:

[0171] A first data packet encapsulating operating information of a first controlled target is retrieved from a first virtual space, wherein the data management suite obtains the first data packet in response to monitoring that the network port bound to the PLC master station uploads the first data packet, and stores the first data packet in the first virtual space; the first virtual space is a space in the user state space for storing data packets from the network port bound to the PLC master station.

[0172] In some possible implementations, the sending of the control instruction of the first controlled target to the first PLC slave station through the network port bound to the first PLC slave station includes:

[0173] A second data packet encapsulating control instructions for the first controlled target is sent down, wherein the data management suite obtains the second data packet in response to monitoring that the PLC master station sends down the second data packet, and stores the second data packet in a second virtual space for the network port bound to the PLC master station to retrieve and forward to the first PLC slave station; the second virtual space is a space in the user state space for storing data packets from the PLC master station.

[0174] In some possible implementations, the PLC master station includes a motion control application, an EtherCAT protocol stack, and a network card driver;

[0175] The process of the PLC master station generating the control instruction for the first controlled object includes:

[0176] The network card driver retrieves a first data packet encapsulating the operation information of the first controlled target from the first virtual space in a polling drive manner, and forwards the data packet to the EtherCAT protocol stack, wherein the first virtual space is a space in the user space for storing data packets from the network port bound to the PLC master station;

[0177] The EtherCAT protocol stack decapsulates the first data packet to obtain the operation information of the first controlled target, and forwards the operation information of the first controlled target to the motion control application;

[0178] The motion control application generates a control instruction for the first controlled object based on the operation information of the first controlled object.

[0179] In some possible implementations, the process of the PLC master station issuing the control instruction to the first controlled target includes:

[0180] The motion control application sends the control instruction of the first controlled target to the EtherCAT protocol stack;

[0181] The EtherCAT protocol stack encapsulates the control instruction of the first controlled target to obtain a second data packet, and forwards the second data packet to the network card driver;

[0182] The network card driver sends the second data packet.

[0183] Further, Figure 8 A schematic diagram of the structure of a control device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the control device is applied to a PLC master station of a control system, and the control system includes a multi-core programmable logic controller and an operating system, and multiple PLC master stations are deployed in the operating system; the multi-core programmable logic controller includes multiple processor cores and at least one network interface card, and the network interface card includes at least one network port; a PLC master station is bound to at least one processor core and at least one network port; wherein the PLC master station runs on the processor core bound to itself; the control device includes: a receiving module 801 and a control module 802; wherein the receiving module 801 is used to receive the operating information of at least one controlled device through the network port bound to itself; and the control module 802 is used to control the controlled target based on the operating information.

[0184] It is understandable that the control device may be a multi-core programmable logic controller. The PLC master station is deployed in the user space of the operating system.

[0185] The technical solution provided by the embodiment of the present application is to control the multiple PLC master stations deployed in the user state space of the control system. The multiple PLC master stations use the processor cores and network port resources bound to themselves in the multi-core programmable logic controller to complete the control work of at least one controlled target managed by themselves. Since the kernel of the operating system generally only occupies part of the processor cores and network port resources in the multi-core programmable logic controller, the multi-core programmable logic controller has abundant processor cores and network ports. By utilizing the abundant processor core resources and network port resources, multiple PLC master stations are deployed in the user state space of the operating system, realizing full utilization of resources. Compared with related solutions, there is no need to use a virtual machine manager to virtualize multiple real-time operating systems for multiple PLC master stations to run, reducing the operating overhead of the virtual machine manager and virtual machines.

[0186] In some possible implementations, the control system further includes a plurality of PLC slave stations, each PLC master station is used to manage at least one PLC slave station, and one PLC slave station is bound to one controlled target; each PLC master station receives operation information of the first controlled target uploaded by the first PLC slave station managed by it through its own bound network port; and / or sends control instructions of the first controlled target to the first PLC slave station through its own bound network port, wherein the first controlled target is the controlled target bound to the first PLC slave station.

[0187] In some possible implementations, the control system further includes a data management suite; the operation information of the first controlled target uploaded by the first PLC slave station managed by itself is received through the network port bound to itself, including: retrieving the first data packet encapsulating the operation information of the first controlled target from the first virtual space, wherein the data management suite responds to monitoring the network port bound to the PLC master station to upload the first data packet, obtains the first data packet, and stores the first data packet in the first virtual space; the first virtual space is a space in the user state space for storing data packets from the network port bound to the PLC master station.

[0188] In some possible implementations, the above-mentioned sending of control instructions for the first controlled target to the first PLC slave station through the network port bound to itself includes: sending a second data packet encapsulating the control instructions of the first controlled target, wherein the data management suite obtains the second data packet in response to monitoring the PLC master station sending the second data packet, and stores the second data packet in the second virtual space for the network port bound to the PLC master station to retrieve and forward to the first PLC slave station; the second virtual space is a space in the user state space for storing data packets from the PLC master station.

[0189] In some possible implementations, the PLC master station includes a motion control application, an EtherCAT protocol stack, and a network card driver; the process of the PLC master station generating control instructions for the first controlled target includes: the network card driver retrieves a first data packet encapsulating the operating information of the first controlled target from the first virtual space in a polling drive manner, and forwards it to the EtherCAT protocol stack, wherein the first virtual space is a space in the user space for storing data packets from the network port bound to the PLC master station; the EtherCAT protocol stack decapsulates the first data packet to obtain the operating information of the first controlled target, and forwards the operating information of the first controlled target to the motion control application; the motion control application generates control instructions for the first controlled target based on the operating information of the first controlled target.

[0190] In some possible implementations, the process of issuing the control instructions of the first controlled target includes: the motion control application sends the control instructions of the first controlled target to the EtherCAT protocol stack; the EtherCAT protocol stack encapsulates the control instructions of the first controlled target to obtain a second data packet, and forwards the second data packet to the network card driver; the network card driver issues the second data packet.

[0191] An embodiment of the present application further provides a computer-readable storage medium, which stores computer program instructions, and the computer program instructions are used to enable a control device to execute the control method shown in the above embodiment.

[0192] An embodiment of the present application further provides a computer program product, including computer program instructions. When the computer program instructions are executed on a control device, the control device executes the control method shown in the above embodiment.

[0193] The control device, computer-readable storage medium, or computer program product provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding methods provided above, and will not be repeated here.

[0194] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device (such as a control device) is divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-described systems, devices (such as control devices) and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0195] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices (such as control devices) and methods can be implemented in other ways. For example, the device (such as control device) embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, 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 an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0196] The units described above 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 the units may be selected according to actual needs to achieve the purpose of the solutions in the embodiments of the present application.

[0197] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0198] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or 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.) or a processor to execute all or part of the steps of the method of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk.

[0199] The above are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A control system, characterized in that: It includes a multi-core programmable logic controller (PLC) and an operating system, wherein multiple PLC master stations are deployed in the operating system; the multi-core programmable logic controller includes multiple processor cores and at least one network interface card, and the network interface card includes at least one network port; one PLC master station is bound to at least one of the processing cores and at least one of the network ports; wherein, Each of the PLC master stations runs on a processor core bound to itself, and is used to receive operating information of at least one controlled target through a network port bound to itself, and to control the controlled target based on the operating information.

2. The control system according to claim 1, characterized in that: The control system further comprises a plurality of PLC slave stations, each of the PLC master stations is used to manage at least one of the PLC slave stations, and one of the PLC slave stations is bound to one of the controlled targets; Each of the PLC master stations receives, through its bound network port, the operation information of the first controlled target uploaded by the first PLC slave station managed by it; And / or send the control instruction of the first controlled target to the first PLC slave station through the network port bound to itself, wherein the first controlled target is the controlled target bound to the first PLC slave station.

3. The control system according to claim 2, characterized in that: The control system also includes a data management suite; The data management suite is configured to, in response to detecting that a first data packet encapsulating the operation information of the first controlled target is uploaded by the network port bound to the PLC master station, obtain the first data packet and store the first data packet in a first virtual space for retrieval by the PLC master station; and / or in response to monitoring that the PLC master station sends a second data packet encapsulating the control instruction, obtaining the second data packet and storing the second data packet in a second virtual space for retrieval by the network port bound to the PLC master station and forwarding the second data packet to the first PLC slave station; Among them, the first virtual space is a space in the user state space of the operating system, which is used to store data packets from the network port bound to the PLC master station; the second virtual space is a space in the user state space of the operating system, which is used to store data packets from the PLC master station.

4. The control system according to claim 2, characterized in that: The PLC master station includes motion control applications, EtherCAT protocol stack and network card driver; The network card driver is configured to retrieve a first data packet encapsulating the operation information of the first controlled target from a first virtual space in a polling-driven manner, and forward the data packet to the EtherCAT protocol stack, wherein the first virtual space is a space in the user space of the operating system for storing data packets from the network port bound to the PLC master station; The EtherCAT protocol stack is configured to decapsulate the first data packet to obtain operation information of the first controlled target, and forward the operation information of the first controlled target to the motion control application; The motion control application is used to generate the control instruction based on the operation information of the first controlled target.

5. The control system according to claim 4, characterized in that: The motion control application is further configured to forward the control instruction to the EtherCAT protocol stack; The EtherCAT protocol stack is further configured to encapsulate the control instruction into a second data packet and forward the second data packet to the network card driver; The network card driver is further configured to send the second data packet.

6. The control system according to claim 3, characterized in that: The kernel of the operating system runs on at least one of the processing cores, and the kernel is different from the processor core running on the PLC master station; and the plurality of PLC master stations respectively run on different processor cores.

7. A method for creating a PLC master station, characterized in that: Applied to a control system, the control system includes a multi-core programmable logic controller (PLC) and an operating system; the multi-core programmable logic controller includes multiple processor cores and at least one network interface card (NIC), the NIC including at least one network port; the method includes: In response to receiving a creation request of a PLC master station, allocating a processor core and a network port to a target PLC master station; Binding the PLC instance to the processor core and network port allocated by the target PLC master station to generate the target PLC master station; The target PLC master station is used to receive operation information of at least one controlled target and control the controlled target based on the operation information.

8. The method according to claim 7, characterized in that The allocation of a processor core and a network port to the target PLC master station includes: Determining the number of the target PLC master stations, wherein the number does not exceed the minimum value of unoccupied processor cores and network ports in an available resource pool; the available resource pool records the occupancy status of multiple processor cores and the occupancy status of multiple network ports; Establishing resource groups having the same number as the number, wherein the resource groups include at least one unoccupied processor core and at least one unoccupied network port; Allocate a plurality of the resource groups to a plurality of the target PLC master stations.

9. The method according to claim 7, characterized in that The creation request further indicates at least one PLC slave station managed by the target PLC master station, and one PLC slave station is bound to one controlled target; the method further includes: Establishing a communication connection between the network port allocated by the target PLC master station and a second PLC slave station managed by the target PLC master station, so that the target PLC master station receives operation information of the second controlled target uploaded by the second PLC slave station through the network port allocated by the target PLC master station, and / or issues control instructions of the second controlled target to the second PLC slave station through the network port allocated by the target PLC master station; the second controlled target is a controlled target bound to the second PLC slave station; as well as A third virtual space for storing a third data packet encapsulating the operation information of the second controlled target and uploaded from the network port allocated by the target PLC master station and a fourth virtual space for storing a fourth data packet encapsulating the control instruction and issued from the target PLC master station is configured in the user space of the operating system; as well as It is stated in the data management suite: in response to monitoring the network port allocated by the target PLC master station to upload the third data packet, the uploaded data packet is stored in the third virtual space; in response to monitoring the target PLC master station to send the fourth data packet, the fourth data packet is stored in the fourth virtual space.

10. The method according to claim 9, characterized in that The PLC instance includes a network card driver, an EtherCAT protocol stack, and a motion control application; Binding the PLC instance with the processor core and network port allocated by the target PLC master station includes: Performing a first initialization operation on the network port assigned by the target PLC master station, wherein the first initialization operation includes: declaring the network port assigned by the target PLC master station to retrieve the fourth data packet from the fourth virtual space, and forwarding the fourth data packet to the second PLC slave station; performing a second initialization operation on the network card driver in the PLC instance, wherein the second initialization operation includes: declaring the network card driver to retrieve the third data packet from the third virtual space, and issuing the fourth data packet, wherein the third data packet is decapsulated by the EtherCAT protocol stack to obtain operation information of the second controlled target, the motion control application generates the control instruction based on the operation information of the second controlled target; and the EtherCAT protocol stack encapsulates the control instruction to obtain the fourth data packet; The initialized PLC instance is respectively bound to the processor core allocated by the target PLC master station and the initialized network port to generate the target PLC master station.

11. The method according to claim 10, characterized in that The method further comprises: In response to the motion control application not receiving the running information for more than a first preset time, the processor core and the network card corresponding to the target PLC master station are unbound, and the occupation status of the unbound processor core and the network card in the available resource pool is changed to unoccupied.

12. A control method, characterized in that: A PLC master station is applied to a control system, wherein the control system includes a multi-core programmable logic controller and an operating system, wherein multiple PLC master stations are deployed in the operating system; the multi-core programmable logic controller includes multiple processor cores and at least one network interface card, wherein the network interface card includes at least one network port; one PLC master station is bound to at least one of the processing cores and at least one of the network ports; wherein the PLC master station runs on the processor core to which it is bound; The method comprises: Receive the operation information of at least one controlled target through its own bound network port, and control the controlled target based on the operation information.

13. A control device, characterized in that: comprising a memory and a processor; the memory and the processor are coupled; Wherein, the memory is used to store computer program code, and the computer program code includes computer instructions; the first processor core in the processor calls program instructions to execute the method as described in any one of claims 7 to 11, and the processor is deployed with multiple second processor cores of multiple PLC master stations calling program instructions to execute the method as described in claim 12.