5G cloud PLC deployment method and device, electronic equipment and storage medium
By analyzing the performance indicators of the PLC program and the CPU main frequency of the node, determining the communication performance and computing power level of the node, and calculating the processing speed, the problem of low efficiency in deployment location selection in cloud PLC deployment is solved, and fast and accurate deployment is achieved.
Patent Information
- Application Number
- CN202410288730.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2025-09-16
AI Technical Summary
Existing technologies are unable to quickly and accurately identify suitable deployment locations when deploying cloud-based PLCs, resulting in low deployment efficiency.
By obtaining the performance indicators of the PLC program and the CPU main frequency of the node, the communication performance and computing power level of the node are determined, the processing speed of the node is calculated, and the target node whose processing speed meets the preset requirements is selected for deployment.
It can quickly and accurately find the appropriate deployment location and improve deployment efficiency.
Smart Images

Figure CN120659063A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a 5G cloud-based PLC deployment method, device, electronic device, and storage medium. Background Art
[0002] Cloud PLC realizes the separation of software and hardware, containerization and cloud deployment of PLC. It requires a high-performance network to provide network security for the cloud deployment of PLC. 5G+ cloud PLC is currently an important solution.
[0003] Currently, when deploying a cloud PLC, cloud PLC instances are usually created and the PLC program is uploaded to all possible deployment locations. The deployment locations are then tested one by one to see if they meet the performance requirements. The optimal deployment location is then selected, the PLC instance at that location is retained, and the PLC instances at other locations are deleted.
[0004] However, the full deployment approach results in a long initial testing time and requires technicians to perform repetitive tasks. As a result, it is impossible to quickly and accurately identify the appropriate deployment location, affecting deployment efficiency. Summary of the Invention
[0005] The present application provides a 5G cloud-based PLC deployment method, device, electronic device, and storage medium to solve the problem of being unable to quickly and accurately find a suitable deployment location, which affects deployment efficiency.
[0006] In a first aspect, the present application provides a 5G cloud-based PLC deployment method, including:
[0007] Obtain the performance indicators of the PLC program to be deployed and the CPU main frequency of the node. The performance indicators include the network address of the target I / O device, the total number of machine instructions, and the loop execution period. The node is a node in the 5G network that supports the deployment of cloud PLC.
[0008] Determine the node's communication performance and computing power level based on the performance indicators of the PLC program to be deployed and the node's CPU frequency;
[0009] Determine the node processing speed based on the performance indicators of the PLC program to be deployed, the node's communication performance, and the computing power level;
[0010] According to the processing speed of the node, the target node is determined for PLC deployment. The target node is the node whose processing speed meets the preset processing speed requirement.
[0011] In the embodiment of the present application, the communication performance and computing power level of the node are determined based on the performance indicators of the PLC program to be deployed and the CPU main frequency of the node, including:
[0012] Receive detection instructions;
[0013] According to the detection instruction, a test instruction is sent to the node, so that the node obtains the execution time of the test instruction after executing the test instruction;
[0014] Determine an average number of clock cycles for executing the test instructions at the node based on the number of test instructions sent to the node and the execution time of the test instructions;
[0015] Determine the node's computing power level based on the node's CPU main frequency and the average number of clock cycles it takes to execute test instructions.
[0016] The communication performance of the node is determined based on the network address of the target I / O device in the performance indicators of the PLC program to be deployed.
[0017] In an embodiment of the present application, determining the communication performance of a node according to the network address of the target I / O device in the performance indicator of the PLC program to be deployed includes:
[0018] Send a message to the network address of the target I / O device and determine the message sending time and message receiving time;
[0019] The communication performance of the node is determined based on the message sending time and message receiving time.
[0020] In the embodiment of the present application, the processing speed of the node is determined based on the performance indicators of the PLC program to be deployed, the communication performance and computing power level of the node, including:
[0021] Determine the PLC program execution time of the node based on the total number of machine instructions in the performance indicators of the PLC program to be deployed and the computing power level of the node;
[0022] Determine the target execution time of the node based on the node's PLC program execution time and the node's communication performance;
[0023] Determine the processing speed of the node based on the target execution time of the node and the loop execution period in the performance indicators of the PLC program to be deployed.
[0024] In an embodiment of the present application, determining a target node for PLC deployment based on the processing speed of the node includes:
[0025] determining a processing speed threshold characterized by a preset processing speed requirement;
[0026] Compare the processing speed and processing speed threshold of the node;
[0027] If the processing speed of the node is greater than the processing speed threshold, the node is determined to be a non-target node;
[0028] If the processing speed of the node is less than or equal to the processing speed threshold, the node is determined to be the target node.
[0029] In an embodiment of the present application, after determining that the node is a target node if the processing speed of the node is less than or equal to the processing speed threshold, the method further includes:
[0030] Determine the processing speed of the target node;
[0031] According to the processing speed of the target node, a global target node is determined, and the global target node represents the target node with the fastest processing speed.
[0032] In an embodiment of the present application, after determining a target node for PLC deployment based on the processing speed of the node, the method further includes:
[0033] Send deployment instructions, cloud PLC image and PLC program to the target node agent of the target node, so that the target node agent receives the cloud PLC image and PLC program according to the deployment instructions, and deploys the cloud PLC and loads the PLC program according to the cloud PLC image and PLC program.
[0034] In a second aspect, the present application provides a 5G cloud-based PLC deployment device, including:
[0035] An acquisition module is used to obtain the performance indicators of the PLC program to be deployed and the CPU main frequency of the node. The performance indicators include the network address of the target I / O device, the total number of machine instructions, and the loop execution period. The node is a node in the 5G network that supports the deployment of cloud PLC;
[0036] The first determination module is used to determine the communication performance and computing power level of the node based on the performance indicators of the PLC program to be deployed and the CPU main frequency of the node;
[0037] The second determination module is used to determine the processing speed of the node based on the performance indicators of the PLC program to be deployed, the communication performance and computing power level of the node;
[0038] The deployment module is used to determine the target node for PLC deployment based on the processing speed of the node. The target node is the node whose processing speed meets the preset processing speed requirement.
[0039] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0040] Memory stores computer-executable instructions;
[0041] The processor executes the computer-executable instructions stored in the memory to implement the 5G cloud-based PLC deployment method of the embodiment of the present application.
[0042] In a fourth aspect, the present application provides a computer-readable storage medium, which stores computer execution instructions. When the computer execution instructions are executed by a processor, they are used to implement the 5G cloud PLC deployment method of an embodiment of the present application.
[0043] The 5G cloud-based PLC deployment method, device, electronic device, and storage medium provided in the present application obtain the performance indicators of the PLC program to be deployed and the CPU main frequency of the node, wherein the performance indicators include the network address of the target I / O device, the total number of machine instructions, and the loop execution period, and the node is a node that supports the deployment of cloud-based PLC in the 5G network; according to the performance indicators of the PLC program to be deployed and the CPU main frequency of the node, the communication performance and computing power level of the node are determined; according to the performance indicators of the PLC program to be deployed, the communication performance and computing power level of the node are determined; according to the performance indicators of the PLC program to be deployed, the communication performance and computing power level of the node, the processing speed of the node is determined; according to the processing speed of the node, the target node is determined for PLC Deployment, the target node is a means of selecting a node whose processing speed meets the preset processing speed requirements. By analyzing the performance indicators of the PLC program, its computing power and communication performance requirements are obtained, and then the communication performance and computing power level of each node to be deployed are calculated on this basis. At the same time, in order to further determine whether the node meets the requirements of the PLC program, the processing speed of the node can be calculated. By comparing the processing speed of each deployment position, the deployment node can be directly determined. Since the node position is selected according to the requirements of the PLC program, the target node can meet the requirements of the PLC program, and then the appropriate deployment position can be found quickly and accurately to improve deployment efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] Figure 1 A flowchart of a 5G cloud-based PLC deployment method provided in an embodiment of the present application;
[0046] Figure 2 A flowchart of another 5G cloud-based PLC deployment method provided in an embodiment of the present application;
[0047] Figure 3 Schematic diagram of the architecture of the 5G cloud-based PLC deployment and management system provided in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of the structure of a 5G cloud-based PLC deployment device provided in an embodiment of the present application;
[0049] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0050] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0051] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0052] Currently, when deploying cloud PLCs, cloud PLC instances are usually created and PLC programs are uploaded to all possible deployment locations. The deployment locations are then tested one by one to see if they meet performance requirements. The optimal deployment location is then selected, the PLC instance at that location is retained, and PLC instances at other locations are deleted. For technical personnel, this requires a lot of time and effort to perform PLC deployment, environment configuration, performance testing, and other operations one by one. This is time-consuming and has low deployment efficiency in line with business needs.
[0053] In order to solve the above problems, the 5G cloud PLC deployment method provided by this application can obtain the computing power and communication performance requirements of the PLC program by analyzing its performance indicators, and then calculate the communication performance and computing power level of each node to be deployed on this basis. At the same time, in order to further determine whether the node meets the requirements of the PLC program, the processing speed of the node can be calculated. By comparing the processing speed of each deployment location, the deployment node can be directly determined. Since the node location is selected according to the requirements of the PLC program, the target node can meet the requirements of the PLC program. Thus, the problem of not being able to quickly and accurately find a suitable deployment location is solved.
[0054] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0055] The execution subject of the 5G cloud PLC deployment method provided in the embodiment of the present application can be a server. Among them, the server can be a mobile phone, tablet, computer and other devices. This embodiment does not impose any special restrictions on the implementation method of the execution subject, as long as the execution subject can obtain the performance indicators of the PLC program to be deployed and the CPU main frequency of the node, wherein the performance indicators include the network address of the target I / O device, the total number of machine instructions, and the loop execution period, and the node is a node that supports the deployment of cloud PLC in the 5G network; according to the performance indicators of the PLC program to be deployed and the CPU main frequency of the node, the communication performance and computing power level of the node are determined; according to the performance indicators of the PLC program to be deployed, the communication performance and computing power level of the node are determined; according to the performance indicators of the PLC program to be deployed, the communication performance and computing power level of the node, the processing speed of the node is determined; according to the processing speed of the node, the target node is determined for PLC deployment, and the target node is a node whose processing speed meets the preset processing speed requirements.
[0056] Among them, cloud PLC (Programmable Logic Controller) can refer to a programmable controller running in the cloud. It is a software-defined PLC that can directly communicate with the industrial Internet platform. For example, it can easily connect the PLC to the Internet, embed APP and analysis results into the machine and the cloud, realize intelligence and self-perception, and change and upgrade the PLC without replacing the PLC hardware. It can expand the application of the industrial Internet platform through APIs and ecosystems, that is, transfer industrial control from wired to wireless and from local to cloud.
[0057] Figure 1 Schematic diagram of the process of 5G cloud PLC deployment method provided in the embodiment of the present application. The execution subject of the method can be a server, and the embodiment of the present application is not particularly limited here, such as Figure 1 As shown, the method may include:
[0058] S101. Obtain performance indicators of the PLC program to be deployed and the CPU main frequency of the node, where the performance indicators include the network address of the target I / O device, the total number of machine instructions, and the loop execution period. The node is a node in the 5G network that supports the deployment of cloud PLC.
[0059] The PLC program to be deployed can refer to a programmable logic controller (PLC), a digital electronic device with a microprocessor. This digital logic controller, used for automated control, can load control instructions into memory for storage and execution at any time. The PLC can be modularly composed of an internal CPU, instruction and data memory, input and output units, power modules, digital analog modules, and other units. The PLC can receive (input) and send (output) various types of electrical or electronic signals and use them to control or monitor nearly all types of mechanical and electrical systems.
[0060] The performance indicators of a PLC program can refer to the software indicators of the program, including program capacity, programming language, communication function, running speed, instruction types, component types and quantity, etc., among which program capacity can refer to the size of PLC internal and external memory, generally ranging from several thousand bytes to several megabytes; programming language can refer to the language used by PLC to compile user programs. PLC can use many programming languages, including ladder diagrams, sentence tables, sequential function charts and function block diagrams; communication function can refer to remote I / O communication, computer communication, point-to-point communication, high-speed bus, MAP network, etc.; running speed can refer to the length of running processing time, which can be measured by the execution time of basic instructions; the more instruction types and the faster the execution speed, the better the PLC performance; the type and number of components can reflect the performance and scale of the PLC, and the number of I / O elements shows the input and output capabilities of the PLC; the more I / O element types (DC, AC, analog, high-speed counting, positioning, PID), the higher the performance level of the PLC. In an embodiment of the present application, the performance indicators of a PLC program can refer to the network address of the target I / O device, the total number of machine instructions, and the loop execution period, so as to calculate the performance requirements of the PLC program in subsequent steps.
[0061] Obtaining performance indicators of the PLC program to be deployed can refer to analyzing performance through physical layer testing or channel analysis during communication testing, which can quickly determine whether the PLC is connected and obtain its achievable performance. Among them, the physical layer testing method and the channel analysis method both select nodes in the network, perform signal transmission tests between nodes, determine whether the nodes can communicate, analyze the round-trip time and loop execution period from each node to the network address of the target I / O device, convert the PLC program into machine instructions, and count the total number of machine instructions. In an embodiment of the present application, obtaining the performance indicators of the PLC program to be deployed may refer to the user uploading the PLC program to be deployed to the management and control platform, and connecting the management and control platform to the 5G network from any base station. The PLC program analysis module in the management and control platform parses the program to obtain the required performance indicators and other information. Among them, the management and control platform may refer to the detection structure of the node agent responsible for counting all nodes, which is composed of a PLC program analysis module, an instruction sending module, a detection result receiving module, and a deployment decision module. Therefore, in addition to analyzing the PLC program, instructions can also be sent to the node agent, and the instructions include detection instructions and deployment instructions, and the detection results sent by the node agent can be received and deployment decisions can be made.
[0062] A node refers to the location where a PLC program can be deployed in a 5G cloud PLC system, including the 5G-MEC platform, the 5G base station baseband processing unit, and the general-purpose IPC (Industrial Personal Computer) architecture of industrial sites.
[0063] The CPU main frequency can refer to the clock frequency of each CPU core (CPU Clock Speed). The CPU main frequency indicates the oscillation speed of the digital pulse signal in the CPU.
[0064] 5G network (5th Generation Mobile Communication Technology) refers to a new generation of broadband mobile communication technology with the characteristics of high speed, low latency and large connection. 5G communication facilities are the network infrastructure for realizing the interconnection between people, machines and things.
[0065] S102: Determine the communication performance and computing power level of the node based on the performance indicators of the PLC program to be deployed and the CPU main frequency of the node.
[0066] Among them, communication performance can refer to the performance of transmitting information, which refers to the transmission and exchange of information from one place to another. The communication performance of a node can be measured by using RTT (Round-Trip Time), that is, the time required for data to be transmitted from the sending end to the receiving end of a link or network segment, also known as transmission time. In an embodiment of the present application, communication performance can be achieved by a node sending a message to the network address of a target I / O device, recording the message sending time, waiting for the response of the target I / O device, recording the message receiving time, and subtracting the message sending time from the message receiving time to obtain the response time.
[0067] The computing power level can refer to the computing ability to achieve the target output by processing information data (Computing Power). MIPS (Million Instructions Per Second) can be used as a standard to measure the computing power level of a node. The calculation formula of MIPS is:
[0068]
[0069] Among them, clock rate is the CPU main frequency of the node, and CPI (Clock Cycle Per Instruction) is the average number of clock cycles to execute instructions, which can be calculated by executing any type and number of test instructions.
[0070] In the embodiment of the present application, the method for determining the communication performance and computing power level of a node based on the performance indicators of the PLC program to be deployed and the CPU main frequency of the node may include:
[0071] Receive detection instructions;
[0072] According to the detection instruction, a test instruction is sent to the node, so that the node obtains the execution time of the test instruction after executing the test instruction;
[0073] Determine an average number of clock cycles for executing the test instructions at the node based on the number of test instructions sent to the node and the execution time of the test instructions;
[0074] Determine the node's computing power level based on the node's CPU main frequency and the average number of clock cycles it takes to execute test instructions.
[0075] The communication performance of the node is determined based on the network address of the target I / O device in the performance indicators of the PLC program to be deployed.
[0076] Among them, the detection instruction may refer to an instruction sent by the management and control platform to the node agent, requesting the node's computing power level and communication performance detection.
[0077] A node agent can refer to a lightweight process required on each computer that hosts a server instance. The node agent can start, stop, create, and delete server instances according to the instructions of the domain management server. It can also restart faulty server instances and provide a log file view of the faulty server, so that the local configuration system information library of each server instance is synchronized with the central system information library of the domain management server, and each local system information library only contains information related to the server instance or node agent. In an embodiment of the present application, the node agent is installed on all nodes in the 5G network that support the deployment of cloud-based PLC instances, including an instruction receiving module, a computing power level detection module, a communication performance detection module, a detection result return module, and a PLC deployment module. Therefore, it has the functions of receiving instructions from the control platform, detecting the computing power level and communication performance of the node, returning the detection results, and deploying PLC.
[0078] A test instruction may refer to an instruction executed by a node agent to detect the computing power level of a node after receiving a detection instruction sent by a control platform. In an embodiment of the present application, MIPS is used as the evaluation standard for the computing power level of a node, so it is necessary to execute a test instruction to obtain the average number of clock cycles (CPI) for executing instructions. The instruction type and number of test instructions are random, but in order to more conveniently calculate MIPS, the number of test instructions is generally set to millions. For example, the number of test instructions is set to five million, and the computing power level detection module executes five million test instructions of random instruction type, records the total time for executing the test instruction, and divides the total time by the number of five million to obtain the CPI.
[0079] Determining the communication performance of a node may refer to the communication performance detection module calculating the RTT of a communication link between the node and the target I / O using the timestamp option of the TCP message. TCP (Transmission Control Protocol) may refer to a connection-oriented, reliable, ordered, byte stream-based transport layer communication protocol. Pairs of processes in host computers connected to different but interconnected computer communication networks can rely on TCP to provide reliable communication services. The first field "kind" in the TCP message options specifies the type of option. The second field "length" specifies the total length of the option, which includes the 2 bytes occupied by the "kind" and "length" fields. The third field "info" contains specific information about the option. "kind=0" indicates the end of the option table. In some embodiments, the TCP option does not have the last two fields and only includes a 1-byte "kind" field. "kind=1" is a no-operation (nop) option with no special meaning and is generally used to pad the total length of the TCP option to an integer multiple of 4 bytes. "kind=2" is a maximum segment size option. When a TCP connection is initialized, the communicating parties use this option to negotiate the maximum segment size (MSS).
[0080] A timestamp can refer to a complete and verifiable data that can indicate that a piece of data existed before a specific time. It is usually a character sequence that uniquely identifies a certain moment in time. In other words, a timestamp can represent the time of a certain moment. By converting the timestamp code into a time format, the communication time between the node and the target I / O can be known.
[0081] In an embodiment of the present application, the node sends a TCP message to the target I / O, the kind field in the "options and padding" of the message header can be set to 8, the length field can be set to 10, and the timestamp field in info can be set to the time value when the module sends the message. Then the module waits for the response from the I / O. When the client receives the TCP message from the server, it responds with a reply message to the server. The reply message can refer to an ACK (Acknowledgement) message. When the node receives the ACK message sent by the I / O, the module records the time value at this moment and obtains the timestamp echo field from the message. This field is the time when the module sends the message to the I / O. Finally, the module subtracts the time of receiving the message from the time of sending the message to obtain the RTT.
[0082] In an embodiment of the present application, the method for determining the communication performance of a node according to the network address of the target I / O device in the performance indicator of the PLC program to be deployed may include:
[0083] Send a message to the network address of the target I / O device and determine the message sending time and message receiving time;
[0084] The communication performance of the node is determined based on the message sending time and message receiving time.
[0085] S103: Determine the processing speed of the node based on the performance indicators of the PLC program to be deployed, the communication performance and computing power level of the node.
[0086] Among them, the processing speed of the node may refer to the processing speed of the node executing the PLC program, which can be obtained by calculating the ratio of the PLC program execution time of the node to the PLC cycle execution period. In the embodiment of the present application, the PLC program execution time of the node may refer to the sum of the time T for the node to execute a single PLC program and the round-trip time RTT from the node to the network address of the I / O device (T+RTT). The calculation formula for the time T for the node to execute a single PLC program is:
[0087]
[0088] Where N is the total number of machine instructions of the PLC program, in millions, and MIPS is the number of million instructions executed per second, in millions per second.
[0089] In the embodiment of the present application, the method for determining the processing speed of a node may include:
[0090] Determine the PLC program execution time of the node based on the total number of machine instructions in the performance indicators of the PLC program to be deployed and the computing power level of the node;
[0091] Determine the target execution time of the node based on the node's PLC program execution time and the node's communication performance;
[0092] Determine the processing speed of the node based on the target execution time of the node and the loop execution period in the performance indicators of the PLC program to be deployed.
[0093] The target execution time of a node may refer to the sum of the execution time of the PLC program to be deployed on the node and the round-trip time from the node to the target I / O, that is, the sum of the PLC execution time and the PLC response time. The PLC response time may refer to the time required from the PLC receiving an input signal to the PLC outputting a control signal to the output end.
[0094] Since the PLC works in a cyclic scanning mode, the processing speed of the node can be expressed by dividing the target execution time of the node by the cyclic execution period of the PLC program to be deployed. This value does not indicate the specific processing speed of the node, but rather an indication of the speed of the node processing.
[0095] S104. Determine a target node for PLC deployment based on the processing speed of the node, where the target node is a node whose processing speed meets a preset processing speed requirement.
[0096] The preset processing speed requirement may refer to a processing speed requirement specified according to business needs. In some embodiments, the preset processing speed requirement may refer to a speed value corresponding to a node with the fastest processing speed, or may refer to meeting a specific processing speed value.
[0097] The target node may refer to a node whose processing speed meets the processing speed required for business processing among all nodes that support the deployment of cloud PLC instances in the 5G network.
[0098] In some embodiments, the number of target nodes is at least one.
[0099] In an embodiment of the present application, a method for determining a target node for PLC deployment based on the processing speed of the node may include:
[0100] determining a processing speed threshold characterized by a preset processing speed requirement;
[0101] Compare the processing speed and processing speed threshold of the node;
[0102] If the processing speed of the node is greater than the processing speed threshold, the node is determined to be a non-target node;
[0103] If the processing speed of the node is less than or equal to the processing speed threshold, the node is determined to be the target node.
[0104] The processing speed threshold may refer to a critical value at which the processing speed can meet business requirements. A smaller value of the node's processing speed indicates a shorter execution time of a PLC cycle, and a faster processing speed of the node indicates a better performance of the node. A larger value of the node's processing speed indicates a slower processing speed of the node, and a longer execution time of a PLC cycle, and a slower processing speed of the node indicates a worse performance of the node.
[0105] In this embodiment of the present application, after determining that the node is a target node if the processing speed of the node is less than or equal to the processing speed threshold, the method may further include:
[0106] Determine the processing speed of the target node;
[0107] According to the processing speed of the target node, a global target node is determined, and the global target node represents the target node with the fastest processing speed.
[0108] Among them, the global target node can refer to the node with the best performance among the target nodes. In the embodiment of the present application, a high-performance network is required to provide network security for the cloud deployment of PLC, so it is necessary to select the node with the best performance for cloud PLC deployment.
[0109] In the embodiment of the present application, after determining the target node for PLC deployment based on the processing speed of the node, the method may further include:
[0110] Send deployment instructions, cloud PLC image and PLC program to the target node agent of the target node, so that the target node agent receives the cloud PLC image and PLC program according to the deployment instructions, and deploys the cloud PLC and loads the PLC program according to the cloud PLC image and PLC program.
[0111] The target node agent may refer to the node agent at the cloud PLC deployment location determined by the control platform based on the PLC program analysis results and the detection results of each node agent.
[0112] A deployment instruction may refer to an instruction sent by the control platform to the node agent to request deployment on the target node after the control platform determines the target node for deploying the cloud PLC based on the information returned by the node agent and through calculation.
[0113] The cloud PLC image can refer to the cloud PLC program obtained by backing up the cloud PLC. The image file is immutable. In the embodiment of the present application, the cloud PLC image and the PLC program are used together as necessary files for deploying the PLC.
[0114] The 5G cloud-based PLC deployment method provided in the embodiment of the present application can obtain the computing power and communication performance requirements of the PLC program by analyzing its performance indicators, and then calculate the communication performance and computing power level of each node to be deployed on this basis. At the same time, in order to further determine whether the node meets the requirements of the PLC program, the processing speed of the node can be calculated, thereby directly determining the deployment node by comparing the processing speed of each deployment location. Since the node location is selected according to the requirements of the PLC program, the target node can meet the requirements of the PLC program, and then the appropriate deployment location can be found quickly and accurately, thereby improving deployment efficiency.
[0115] Figure 2 This is a flow chart of another 5G cloud PLC deployment method provided in the embodiment of the present application. The execution subject of this method can be a server, and this embodiment of the present application is not particularly limited here, such as Figure 2 As shown, the method may include:
[0116] S201. Install node agents on all nodes in the 5G network that support the deployment of cloud PLC, and connect the management and control platform to the 5G network from any base station.
[0117] S202. Upload the PLC program to the control platform. The PLC program analysis module in the control platform analyzes the PLC program to obtain the PLC program loop execution period, total number of instructions, target I / O address, and send them to the target module.
[0118] Among them, parsing the PLC program can refer to the PLC program analysis module identifying the network address of the target I / O and the PLC program loop execution period from the PLC program, and then converting the PLC program from a high-level language into machine instructions and calculating the total number of instructions.
[0119] The target module may refer to an instruction sending module and a deployment decision module, wherein the target I / O address is sent to the instruction sending module, and the PLC program loop execution period and the total number of instructions are sent to the deployment decision module.
[0120] S203. The instruction sending module sends a detection instruction to each node agent, and the instruction carries the target I / O address. After receiving the detection instruction, the instruction receiving module in the node agent notifies the computing power level detection module and the communication performance detection module to start detection.
[0121] S204: The computing power level detection module calculates the MIPS of the node, and the communication performance detection module calculates the RTT from the node to the target I / O. After completion, the two modules send the calculation results to the detection result return module, and the return module sends the results to the management and control platform.
[0122] S205. After receiving the detection results of all nodes, the management and control platform selects a target node, and the instruction sending module sends a deployment instruction to the target node, and sends the PLC program and the cloud PLC image to this node.
[0123] Among them, selecting the target node can refer to the deployment decision module calculating the time required for each node to execute the PLC program based on the number of PLC program instructions and the MIPS of each node, adding the time value to the RTT of each node to the target I / O, and then calculating the ratio of the addition result to the PLC loop execution period, excluding nodes with a ratio greater than 1, and selecting the node with the smallest ratio among the nodes with a ratio less than 1 as the optimal deployment position. Among them, when the ratio is 1, it means that the time taken for the PLC to execute a cycle is equal to the time obtained by addition. When the ratio is greater than 1, it means that the PLC cannot execute a cycle within this time. When the ratio is less than 1, it means that the PLC can execute more than one cycle within this time. The smaller the ratio is, the shorter the time taken for the PLC to execute a cycle is, and the better the performance of the node.
[0124] S206. After receiving the deployment instruction, the target node waits to receive the cloud PLC image and PLC program. After receiving the image and PLC program, the target node deploys the cloud PLC instance and loads the PLC program into the instance.
[0125] Another 5G cloud-based PLC deployment method provided by an embodiment of the present application can be achieved by installing a node agent on the node, and the management and control platform analyzes and transforms the PLC program to be deployed to obtain relevant information, and sends the relevant information to the node agent to perform node computing power level and communication performance detection. The node agent then transmits the detection results back to the management and control platform for further analysis to obtain the optimal deployment node result. Finally, the analysis results and the necessary PLC programs to be deployed are sent to the deployment node for deployment. Thus, through the functions of the various functional modules of the management and control platform and the node agent, the functional interaction between the management and control platform and the node agent has been achieved to complete the deployment work.
[0126] Figure 3 Schematic diagram of the architecture of the 5G cloud-based PLC deployment and management system provided in an embodiment of the present application.
[0127] The system is based on the 5G network platform, such as Figure 3 As shown, the system may include:
[0128] MEC (Mobile Edge Computing) refers to a technology that places computing and storage resources at the edge of the network, which can be used to improve the performance and efficiency of mobile applications. In the embodiments of this application, the cloud computing platform is migrated from the mobile core network to the edge of the mobile access network. By deploying edge nodes with computing, storage, and communication functions, the traditional wireless access network is equipped with service localization conditions, further providing end users with higher bandwidth and lower latency data services, significantly reducing the network load of the core network, and at the same time reducing the bandwidth requirements of data services for network backhaul.
[0129] 5G Core (5G Core) uses a large number of NFV (Network Function Virtualization) devices to establish reliable and secure network connections for end users and provide access to their services. The core domain handles various basic functions in mobile networks, such as connectivity and mobility management, authentication and authorization, user data management, and policy management.
[0130] gNB (generation NodeB) represents a 5G base station, whose main functions include sending and receiving wireless signals and managing wireless resources.
[0131] IPC (Industrial Personal Compute) is a computer device specially used in the field of industrial control and automation. It has durability, reliability and stability, and can adapt to complex industrial environments and harsh working conditions. It is widely used in industrial automation, production line control, monitoring systems and other industrial applications that require high performance and reliability.
[0132] In the embodiments of the present application, the 5G-MEC platform, the 5G base station baseband processing unit, and the general-purpose IPC architecture at the industrial site are all locations where PLC programs can be deployed in the 5G cloud PLC system.
[0133] The management and control platform is responsible for the detection structure of all node agents.
[0134] I / O (Input / Output) devices can refer to external hardware used to communicate with a computer. They are physical devices composed of chips, wires, power supplies, and other hardware components. They can receive data from a computer and send data to a computer.
[0135] The 5G cloud-based PLC deployment management system provided in the embodiment of the present application manages and calculates the deployment location of each IPC through a management and control platform to determine the final node location.
[0136] Figure 4 This is a structural diagram of the 5G cloud PLC deployment device provided in the embodiment of the present application. Figure 4 As shown, the 5G cloud PLC deployment device 40 includes: an acquisition module 401, a first determination module 402, a second determination module 403, and a deployment module 404.
[0137] Acquisition module 401 is used to obtain performance indicators of the PLC program to be deployed and the CPU main frequency of the node, where the performance indicators include the network address of the target I / O device, the total number of machine instructions, and the loop execution period. The node is a node in the 5G network that supports the deployment of cloud PLC;
[0138] A first determination module 402 is configured to determine the communication performance and computing power level of the node based on the performance indicators of the PLC program to be deployed and the CPU main frequency of the node;
[0139] The second determination module 403 is used to determine the processing speed of the node based on the performance indicators of the PLC program to be deployed, the communication performance and computing power level of the node;
[0140] The deployment module 404 is configured to determine a target node for PLC deployment based on the processing speed of the node, wherein the target node is a node whose processing speed meets a preset processing speed requirement.
[0141] In the embodiment of the present application, the first determining module 402 may also be specifically configured to:
[0142] Receive detection instructions;
[0143] According to the detection instruction, a test instruction is sent to the node, so that the node obtains the execution time of the test instruction after executing the test instruction;
[0144] Determine an average number of clock cycles for executing the test instructions at the node based on the number of test instructions sent to the node and the execution time of the test instructions;
[0145] Determine the node's computing power level based on the node's CPU main frequency and the average number of clock cycles it takes to execute test instructions.
[0146] The communication performance of the node is determined based on the network address of the target I / O device in the performance indicators of the PLC program to be deployed.
[0147] In the embodiment of the present application, the first determining module 402 may also be specifically configured to:
[0148] Send a message to the network address of the target I / O device and determine the message sending time and message receiving time;
[0149] The communication performance of the node is determined based on the message sending time and message receiving time.
[0150] In the embodiment of the present application, the second determining module 403 may also be specifically configured to:
[0151] Determine the PLC program execution time of the node based on the total number of machine instructions in the performance indicators of the PLC program to be deployed and the computing power level of the node;
[0152] Determine the target execution time of the node based on the node's PLC program execution time and the node's communication performance;
[0153] Determine the processing speed of the node based on the target execution time of the node and the loop execution period in the performance indicators of the PLC program to be deployed.
[0154] In the embodiment of the present application, the deployment module 404 may also be specifically used to:
[0155] determining a processing speed threshold characterized by a preset processing speed requirement;
[0156] Compare the processing speed and processing speed threshold of the node;
[0157] If the processing speed of the node is greater than the processing speed threshold, the node is determined to be a non-target node;
[0158] If the processing speed of the node is less than or equal to the processing speed threshold, the node is determined to be the target node.
[0159] In the embodiment of the present application, the deployment module 404 may also be specifically used to:
[0160] Determine the processing speed of the target node;
[0161] According to the processing speed of the target node, a global target node is determined, and the global target node represents the target node with the fastest processing speed.
[0162] In the embodiment of the present application, the deployment module 404 may also be specifically used to:
[0163] Send deployment instructions, cloud PLC image and PLC program to the target node agent of the target node, so that the target node agent receives the cloud PLC image and PLC program according to the deployment instructions, and deploys the cloud PLC and loads the PLC program according to the cloud PLC image and PLC program.
[0164] As can be seen from the above, the 5G cloud PLC deployment device 40 of the embodiment of the present application is composed of an acquisition module 401, which is used to obtain the performance indicators of the PLC program to be deployed and the CPU main frequency of the node, wherein the performance indicators include the network address of the target I / O device, the total number of machine instructions, and the loop execution period, and the node is a node that supports the deployment of cloud PLC in the 5G network; a first determination module 402 is used to determine the communication performance and computing power level of the node based on the performance indicators of the PLC program to be deployed and the CPU main frequency of the node; a second determination module 403 is used to determine the processing speed of the node based on the performance indicators of the PLC program to be deployed, the communication performance and computing power level of the node; a deployment module 404 is used to determine the target node for PLC deployment based on the processing speed of the node, and the target node is a node among the nodes whose processing speed meets the preset processing speed requirements. Therefore, by analyzing the performance indicators of the PLC program, its computing power and communication performance requirements can be obtained, and then the communication performance and computing power level of each node to be deployed can be calculated on this basis. At the same time, in order to further determine whether the node meets the requirements of the PLC program, the processing speed of the node can be calculated. By comparing the processing speed of each deployment location, the deployment node can be directly determined. Since the node location is selected according to the requirements of the PLC program, the target node can meet the requirements of the PLC program, and then the appropriate deployment location can be found quickly and accurately, thereby improving deployment efficiency.
[0165] Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 5 As shown, the electronic device 50 includes:
[0166] The electronic device 50 may include one or more processors 501 , one or more computer-readable storage media memories 502 , a communication component 503 , and other components. The processor 501 , the memory 502 , and the communication component 503 are connected via a bus 504 .
[0167] During the specific implementation process, at least one processor 501 executes the computer execution instructions stored in the memory 502, so that at least one processor 501 executes the above 5G cloud PLC deployment method.
[0168] The specific implementation process of the processor 501 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.
[0169] In the above Figure 5In the illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASICs), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.
[0170] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory.
[0171] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be classified into address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0172] In some embodiments, a computer program product is also proposed, including a computer program or instructions, which, when executed by a processor, implement the steps in any of the above-mentioned 5G cloud-based PLC deployment methods.
[0173] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0174] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0175] To this end, an embodiment of the present application provides a computer-readable storage medium, which stores multiple instructions, which can be loaded by a processor to execute the steps of any 5G cloud PLC deployment method provided in the embodiment of the present application.
[0176] The storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0177] According to one aspect of the present application, a computer program product or a computer program is provided. The computer program product or the computer program comprises computer instructions stored in a computer-readable storage medium.
[0178] Since the instructions stored in the storage medium can execute the steps of any 5G cloud-based PLC deployment method provided in the embodiments of the present application, the beneficial effects that can be achieved by any 5G cloud-based PLC deployment method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0179] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0180] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A 5G cloud-based PLC deployment method, characterized in that: Applied to a 5G cloud-based PLC deployment and management system, the method includes: Obtain performance indicators of the PLC program to be deployed and the CPU main frequency of the node, where the performance indicators include the network address of the target I / O device, the total number of machine instructions, and the loop execution period. The node is a node in the 5G network that supports the deployment of cloud PLC; Determine the communication performance and computing power level of the node based on the performance indicators of the PLC program to be deployed and the CPU main frequency of the node; Determining the processing speed of the node based on the performance indicators of the PLC program to be deployed, the communication performance and computing power level of the node; According to the processing speed of the node, a target node is determined for PLC deployment, and the target node is a node among the nodes whose processing speed meets a preset processing speed requirement.
2. The method according to claim 1, characterized in that Determining the communication performance and computing power level of the node according to the performance indicators of the PLC program to be deployed and the CPU main frequency of the node includes: Receive detection instructions; Sending a test instruction to the node according to the detection instruction, so that the node obtains the execution time of the test instruction after executing the test instruction; determining an average number of clock cycles for executing the test instructions by the node according to the number of test instructions sent to the node and the execution time of the test instructions; Determine the computing power level of the node based on the CPU main frequency of the node and the average number of clock cycles of the node executing the test instruction; The communication performance of the node is determined according to the network address of the target I / O device in the performance indicator of the PLC program to be deployed.
3. The method according to claim 2, characterized in that The determining the communication performance of the node according to the network address of the target I / O device in the performance indicator of the PLC program to be deployed includes: Sending a message to the network address of the target I / O device, and determining the message sending time and the message receiving time; The communication performance of the node is determined according to the message sending time and the message receiving time.
4. The method according to claim 1, wherein Determining the processing speed of the node according to the performance indicators of the PLC program to be deployed, the communication performance and computing power level of the node includes: Determining the PLC program execution time of the node based on the total number of machine instructions in the performance indicator of the PLC program to be deployed and the computing power level of the node; Determining a target execution time of the node based on the PLC program execution time of the node and the communication performance of the node; The processing speed of the node is determined according to the target execution time of the node and the cyclic execution period in the performance indicator of the PLC program to be deployed.
5. The method according to claim 1, wherein Determining a target node for PLC deployment according to the processing speed of the node includes: determining a processing speed threshold characterized by a preset processing speed requirement; comparing the processing speed of the node with a processing speed threshold; If the processing speed of the node is greater than the processing speed threshold, determining that the node is a non-target node; If the processing speed of the node is less than or equal to the processing speed threshold, the node is determined to be a target node.
6. The method according to claim 5, characterized in that After determining that the node is a target node if the processing speed of the node is less than or equal to the processing speed threshold, the method further includes: determining a processing speed of the target node; A global target node is determined according to the processing speed of the target node, where the global target node represents the target node with the fastest processing speed.
7. The method according to claim 5, characterized in that After determining the target node for PLC deployment based on the processing speed of the node, the method further includes: Send a deployment instruction, a cloud PLC image, and a PLC program to the target node agent of the target node, so that the target node agent receives the cloud PLC image and the PLC program according to the deployment instruction, and deploys the cloud PLC and loads the PLC program according to the cloud PLC image and the PLC program.
8. A 5G cloud-based PLC deployment device, characterized in that: The device comprises: An acquisition module is configured to obtain performance indicators of the PLC program to be deployed and the CPU main frequency of the node, wherein the performance indicators include the network address of the target I / O device, the total number of machine instructions, and the loop execution period. The node is a node in the 5G network that supports the deployment of cloud PLC; A first determination module is configured to determine the communication performance and computing power level of the node based on the performance indicators of the PLC program to be deployed and the CPU main frequency of the node; A second determination module is configured to determine a processing speed of the node based on a performance indicator of the PLC program to be deployed, a communication performance of the node, and a computing power level; The deployment module is used to determine a target node for PLC deployment based on the processing speed of the node, and the target node is a node whose processing speed meets the preset processing speed requirement among the nodes.
9. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the 5G cloud-based PLC deployment method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the 5G cloud-based PLC deployment method according to any one of claims 1 to 7.