A container scheduling method for smart power terminals
Patent Information
- Application Number
- CN202110582349.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-27
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2041-05-27
AI Technical Summary
这些调度算法的复杂度较高,需要大量的计算和长时间的模型训练才能获得较好的调度方案,而且智能电力终端的硬件资源较少且对容器的调度时间要求较高,因此当前的容器调度方法不适用于智能电力终端上的容器调度
[0014](1) By establishing an application software resource requirement library in the application center, the resource requirements can be obtained from the application center when creating a container, which can ensure that the container resource requirement configuration is accurate.
Smart Images

Figure CN115409300B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a container scheduling method for smart power terminals, belonging to the field of virtualization of hardware resources for power equipment terminals. Background Technology
[0002] With the development of smart grids and the Internet of Things (IoT) in the power sector, smart power terminal devices are being deployed and used on a large scale in power grids. These smart power terminal devices, essentially one or more mobile servers, possess strong data acquisition, processing, transmission, data storage, and other functions, and have become an important component of the physical layer of power IoT devices. Smart power terminal devices can install different business software according to user needs, achieving separation between business application software and hardware. Multiple business software programs can run simultaneously on a single smart power terminal device, with virtualization technology ensuring that each program operates independently and without interference. Virtualization technology is the core technology of smart power terminal devices. By virtualizing the device's CPU and memory, a single physical terminal device is transformed into multiple virtual terminal devices, each running multiple business software programs simultaneously. However, when a large number of applications run on a smart power terminal device, resource conflicts can affect the normal execution of the software, or unreasonable resource usage can lead to idle resources, reducing the hardware resource utilization rate of the smart power terminal. Therefore, to improve the utilization rate of smart power terminal hardware resources and avoid resource conflicts and idle resources, it is necessary to study resource scheduling technologies for smart power terminals.
[0003] Compared to traditional virtual machine technology, container technology offers advantages such as fast startup speed, easy migration, and consistent operating environment, making it a lightweight virtualization technology. Since smart power terminals have relatively fewer hardware resources than traditional servers, containers are the preferred choice for resource virtualization in smart power terminals, enabling efficient utilization of hardware resources through container scheduling. Current container scheduling problems mainly focus on container scheduling on large-scale clusters, and the methods used are mainly divided into static and dynamic categories. Static scheduling methods assume that the generation time and resource requirements of all containers are known, and can find the optimal scheduling scheme. Dynamic scheduling methods mainly address situations where the generation pattern of containers cannot be predicted. Scheduling algorithms include early optimization methods based on ant colony optimization, particle swarm optimization, and genetic algorithms, as well as current model-based methods, such as simple neural network algorithms based on regression models. These scheduling algorithms are highly complex, requiring significant computation and long-term model training to obtain a good scheduling scheme. Moreover, smart power terminals have limited hardware resources and high requirements for container scheduling time; therefore, current container scheduling methods are not suitable for container scheduling on smart power terminals.
[0004] Analysis of practical applications of smart power terminals reveals the following characteristics: First, terminal devices have limited hardware resources, typically consisting of only one or a few processing units. Second, to ensure the security of the smart grid, business software running on the terminal is usually downloaded, installed, and run from an application center, prohibiting unauthorized applications from running on the terminal. Third, commonly used resources on smart grid terminals include CPU, memory, Flash memory, and network bandwidth. Running multiple containers with a higher proportion of a particular resource on the same processing unit can easily lead to resource contention, significantly reducing container performance and consequently lowering terminal resource utilization. Therefore, container scheduling methods for smart power terminals need to fully consider these characteristics and design a lightweight and efficient container scheduling method to ensure the efficient utilization of smart power terminal resources. Summary of the Invention
[0005] This invention provides a container scheduling method for smart power terminals. The method aims to obtain the resource requirements of application software from the application center, configure the resource requirements of containers, combine the resource usage of each processing unit of the smart power terminal, calculate the correlation between containers and each processing unit, and allocate containers to the processing unit with the highest correlation for execution, thereby improving the utilization rate of hardware resources of smart power terminals.
[0006] The technical solution adopted in this invention is as follows:
[0007] A container scheduling method for smart power terminals specifically includes the following steps:
[0008] (1) Construct a resource requirement library: Extract various resource requirements of each application software from the application center and construct a resource requirement library to store the resource requirements of all application software.
[0009] (2) Obtaining resource requirements: When running the software, the smart power terminal obtains the current software's resource requirements from the resource requirement database in the application center;
[0010] (3) Obtain terminal usage status: Obtain the rated resource capacity and current available resource quantity of each processing unit of the smart power terminal;
[0011] (4) Screening candidate processing units: Initially screen candidate processing units, ensuring that the available resources of the candidate processing units can meet the container resource requirements;
[0012] (5) Assign processing units: Calculate the relevance between the container and each candidate processing unit, and assign the container to the processing unit with the highest relevance for execution.
[0013] The beneficial effects of this invention are as follows:
[0014] (1) By establishing an application software resource requirement library in the application center, the resource requirements can be obtained from the application center when creating a container, which can ensure that the container resource requirement configuration is accurate.
[0015] (2) Calculate the correlation degree between the resource requirements of the container and the rated and idle resources of the processing unit, and assign the container to the processing unit with the highest correlation degree to avoid competition for the same type of resources among multiple containers and improve the resource utilization rate of the smart power terminal.
[0016] (3) The scheduling method has fewer steps and the correlation calculation is simple. It requires less computing resources and is suitable for running on smart power terminals, ensuring the efficient execution of the smart power terminal container scheduling algorithm.
[0017] (4) The method of the present invention can effectively prevent the execution of illegal software on the smart power terminal and ensure the safe operation of the smart power terminal. Attached Figure Description
[0018] Figure 1 This invention relates to the network architecture of a container scheduling method for smart power terminals.
[0019] Figure 2 This is the specific process of the container scheduling method for smart power terminals according to the present invention.
[0020] Figure 3 This is the scheduling process in an embodiment of the present invention. Detailed Implementation
[0021] The technical solution of the present invention will be further described below with reference to the embodiments.
[0022] The container scheduling method proposed in this invention is mainly used in smart power terminals. When running business software on terminal devices, containers are typically used, with one container launched for each application software. The characteristics of containers reduce the mutual interference between application software and improve the utilization rate of terminal device hardware resources. Smart power terminals are gradually separating the hardware platform from the business system. The terminal device provides a unified hardware platform, while the business system is downloaded from the application center. The terminal device can support the operation of any application software. As the intelligence level of the smart grid increases, the hardware configuration of smart power terminals is becoming more advanced, and the number of application software running is increasing. Although containers maintain the isolation of the system operation process between application software, competition for hardware resources still exists among individual application software, and this competition will become more intense as the number of application software running on the terminal increases. Therefore, the container scheduling method for smart power terminals aims to allocate each container launched on the terminal device to the most suitable hardware processing unit, ensuring rapid container allocation and efficient utilization of terminal hardware resources.
[0023] The entire system is divided into two layers: local nodes and a remote application center. The remote application center is responsible for reviewing, uploading, and promoting all application software, as well as collecting the resource requirements for each application software. Local nodes are smart power terminal devices, typically containing one or more processing units. Each processing unit is a physical node with resources such as CPU, memory, Flash, and network bandwidth. Application software runs on a specific processing unit of the smart terminal. See [link to network architecture details] for more information. Figure 1 .
[0024] Currently, container allocation in smart power terminals primarily employs a greedy strategy, relying on user-defined resource requirements for application software. During allocation, only CPU and memory resource requirements are typically considered, assigning containers to processing nodes with the most available CPU or memory resources to meet their needs. Analysis and experiments reveal that user-defined resource requirements often deviate significantly from actual requirements, easily leading to wasted hardware resources or application termination. Furthermore, executing multiple containers sensitive to similar resources on the same processing unit can cause hardware resource conflicts, increasing application execution time and reducing hardware resource utilization. The scheduling process of the container scheduling method for smart power terminals proposed in this invention is as follows: Figure 2 As shown. This invention delegates the acquisition of application software resource requirements to the application center during software review, ensuring data accuracy, defining the relevance between containers and processing units, reducing resource conflicts among multiple containers on the same processing unit, and improving the hardware resource utilization of terminal devices. The specific container scheduling method includes the following five steps:
[0025] 1. Construction of the resource requirement database
[0026] ① The application center is working on application software S i The software needs to be executed during the review process, according to the software S i The usage of hardware resources such as CPU, memory, Flash storage, and network bandwidth during execution is recorded. i Required resources SR i =(SRC) i SRM i SRF i SRN i ), of which SRC i SRM i SRF i SRN i Representing software S respectively i The CPU resources, memory resources, storage capacity, and network bandwidth required for normal operation.
[0027] ② The application center establishes a resource requirement database RS={SR1,SR2,…,SR1,SR2,SR3,SR4,SR5,SR6,SR7,SR8,SR9,SR9,SR1,SR9 ...m}, where m is the number of application software in the application center, SR i For software S i The resource requirements are 1≤i≤m.
[0028] 2. Resource Requirements Acquisition
[0029] To ensure the security of the smart grid and prevent malicious software from damaging the power system, applications running on smart power terminals are typically downloaded from an application center. When a certain application software S runs on a smart power terminal N... i At that time, create a new container C for the software. i Obtain S from the application center via wired or wireless network i Resource demand information SR i =(SRC) i SRM i SRF i SRN i ) as container C i Resource requirements; if the currently running application is not in the application center, the application's resource requirements are configured by the user according to the application's actual needs. If multiple software programs need to run simultaneously, a container is created for each software program. The user assigns a priority to each container, and all containers form a container priority queue. Containers are created and scheduled for each application software one by one according to the user-defined priority from high to low.
[0030] 3. Obtain terminal usage information
[0031] ① Assume that the intelligent power terminal device N contains n processing units N = {PU1, PU2, ..., PU...} n}, obtain each processing unit (PU) through the hardware configuration table. t The rated resource capacity is RC t ={RCC t ,RCM t ,RCF t ,RCN t}, where n is the number of processing units contained in the terminal, 1≤t≤n, RCC t RCM t RCF t RCN t These represent the processing unit PU. t Configured rated CPU computing power, memory capacity, Flash capacity, and network bandwidth. If all processing units are homogeneous, i.e., have the same rated resource capacity, then only the rated resource capacity of one unit is stored.
[0032] ② Obtain each processing unit (PU) through the container controller or system resource manager. t The currently available resources are RAt ={RAC t RAM t ,RAF t ,RAN t}, where RAC t RAM t RAF t RAN t These represent the processing unit PU. t The currently available CPU computing power, memory capacity, Flash capacity, and network bandwidth.
[0033] 4. Processing Unit Filtering
[0034] ① If there are idle processing units with equal rated and available resources for each type, then randomly select an idle unit with no less than C rated resources for each type. i Resource demand processing unit (PU) t Assigned to container C i RCC t =RAC t ≥SRC i ,RCM t =RAM t ≥SRM i ,RCF t =RAF t ≥SRF i ,RCN t =RAN t ≥SRF i .
[0035] ② If there are no idle processing units or the rated resources of all idle units are less than C i Resource requirements, based on container C i Resource requirements SR i =(SRC) i SRM i SRF i SRN i ) and the available resources RA for each processing unit t ={RAC t RAM t ,RAF t ,RAN t}, filter out the candidate processing unit set CP that can host the container. i ={PU t |RAC t ≥SRC i RAM t ≥SRM i ,RAF t ≥SRF i,RAN t ≥SRF i The condition ,1≤t≤n} means that a container can only run if all available resources are no less than the processing units required by the container's resource needs. If CP i If the set is empty, meaning there are no processing units available to run the container, then a resource shortage warning will be displayed, and the scheduling process will be terminated or the container will wait for subsequent scheduling.
[0036] 5. Processing unit allocation
[0037] To fully utilize the hardware resources of the smart power terminal and reduce conflicts between containers on each processing unit, container C... i The task is assigned to the processing unit with the highest degree of relevance for execution. The specific process is as follows:
[0038] ① Calculate the PU for each candidate processing unit t Resource idle rate (RI) t ={RIC t RIM t ,RIF t ,RIN t}, where PU t ∈CP i CPU idle rate RIC t =RAC t / RCC t *100%, Memory Free Rate (RIM) t =RAM t / RCM t *100%, Flash Idle Rate (RIF) t =RAF t / RCF t *100%, Network Bandwidth Idle Rate (RIN) t =RAN t / RCN t *100%;
[0039] ② Calculate container C i In each candidate processing unit PU t Resource utilization rate CR i,t ={CRC i,t CRM i,t CRF i,t CRN i,t}, where PU t ∈CP i CPU utilization CRC i,t =SRC i / RCC t *100%, Memory Usage CRM i,t =SRM i / RCMt *100%, Flash Utilization CRF i,t =SRF i / RCF t *100%, Network bandwidth utilization (CRN) i,t =SRN i / RCN t *100%;
[0040] ③ Calculate the PU for each candidate processing unit t Average resource idle rate (RIA) t and container C i In PU t Average resource utilization rate CRA i,t RIA t =(RIC t +RIM t +RIF t +RIN t ) / 4, CRA i,t =(CRC) i,t +CRM i,t +CRF i,t +CRN i,t ) / 4;
[0041] ④ Calculate C i With each candidate processing unit PU t Similarity: Where Y i,t =YC i,t *R i,t ,
[0042] X i,t =(CRC) i,t -CRA i,t (RIC) t -RIA t )+(CRM i,t -CRA i,t (RIM) t -RIA t )
[0043] +(CRF i,t -CRA i,t (RIF) t -RIA t )+(CRN i,t -CRA i,t (RIN) t -RIA t )
[0044]
[0045]
[0046] ⑤ Calculate C i With each candidate processing unit PU t Relation i,t =1-|Sim i,t | Candidate processing unit set CP i All processing units are sorted from highest to lowest based on the absolute value of their associativity, and container C is then... i Execution is assigned to the processing unit with the highest correlation; if there are multiple processing units with the highest correlation, the processing unit with the highest correlation is randomly selected, and container C is then executed. i It is assigned to be executed.
[0047] Example
[0048] The container scheduling method in this embodiment is described in [reference]. Figure 3 The specific process is as follows: A smart power terminal contains two homogeneous processing units, PU1 and PU2, with CPU clock speeds of 1GHz, memory capacity of 1000MB, Flash capacity of 4000MB, and network bandwidth of 100MBps. Initially, no application software is running on the terminal. If the user needs to run three application software programs S1, S2, and S3 downloaded and installed from the application center, with priority S1>S2>S3, then three containers C1, C2, and C3 are first created for the three software programs S1, S2, and S3 and added to the container priority queue, with scheduling priority C1>C2>C3. Since PU1 and PU2 are both idle, C1 is randomly scheduled to PU1, and C2 is scheduled to PU2. Assuming the resource requirements of C1 and C2 are SR1 = (100MHz, 200MB, 40MB, 10MBps) and SR2 = (300MHz, 50MB, 40MB, 10MBps), the scheduling process for C3 is as follows:
[0049] ①The resource requirements of C3 obtained from the application center are SR3 = (50MHz, 500MB, 40MB, 50MBps);
[0050] ② The rated resources of processing units PU1 and PU2 are the same: RC1 = RC2 = {1GHz, 1000MB, 4000MB, 100MBps}; the available resources of PU1 and PU2 are RA1 = {900MHz, 800MB, 3960MB, 90MBps} and RA2 = {700MHz, 950MB, 3960MB, 90MBps}.
[0051] ③ Based on the available resources of PU1 and PU2, it can be determined that both PU1 and PU2 meet the resource requirements of C3, that is, the candidate processing unit set CP3 = {PU1, PU2}.
[0052] ④ Calculate the resource idle rate RI1 of PU1 = {90%, 80%, 99%, 90%} and the resource idle rate RI2 of PU2 = {70%, 95%, 99%, 90%}. C3 has the same resource utilization rate CR on PU1 and PU2. 3,1 =CR 3,2 ={5%, 50%, 1%, 50%};
[0053] ⑤ The calculated average resource idle rates for PU1 and PU2 are RIA1 = 89.75% and RIA2 = 88.5%, respectively. The average resource utilization rate of C3 on PU1 and PU2 is equal (CRA). 3,1 =CRA 3,2 = (5% + 50% + 1% + 50%) / 4 = 26.5%;
[0054] ⑥ The similarity scores between C3 and PU1 and PU2 were calculated to be Sim. 3,1 =-0.73, Sim 3,2 =0.30
[0055] ⑦ Calculate the correlation between C3 and PU1 and PU2, respectively. 3,1 =1-0.73=0.27, Relation 3,2 =1 - 0.30 = 0.7, due to Relation 3,1 <Relation 3,2 Therefore, container C1 is assigned to processing unit PU2.
[0056] The resource requirements show that C1 and C3 are memory-intensive containers with high memory requirements, while C2 is a CPU-intensive container with high CPU requirements. Therefore, C1 and C3 should not run on the same processing unit during container scheduling; otherwise, it will cause memory resource contention and significant waste of other resources. The scheduling results show that C1 runs on processing unit PU1, while C2 and C3 run on processing unit PU2, resulting in higher utilization of the physical resources of the smart power terminal.
[0057] The embodiments described herein are merely exemplary implementations. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to fully and completely disclose the invention and to fully convey the scope of the invention to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the accompanying drawings is not intended to limit the invention. In the accompanying drawings, the same units / elements are referred to by the same reference numerals.
[0058] Unless otherwise stated, the terms used herein (including technical terms) have the common understanding meaning to those skilled in the art; in addition, it is understood that terms defined by commonly used dictionaries should be understood to have a meaning consistent with the context of their relevant field, and should not be understood to have an idealized or overly formal meaning.
Claims
1. A container scheduling method for smart power terminals, characterized in that, The method specifically includes the following steps: (1) Construct a resource requirement library: Extract various resource requirements of each application software from the application center and construct a resource requirement library to store the resource requirements of all application software; (2) Obtaining resource requirements: When running the software, the smart power terminal obtains the current software's resource requirements from the resource requirement database in the application center; (3) Obtain terminal usage status: Obtain the rated resource capacity and current available resource quantity of each processing unit of the smart power terminal; (4) Screening candidate processing units: Initially screen candidate processing units, ensuring that the available resources of the candidate processing units can meet the container resource requirements; (5) Assigning processing units: Calculate the relevance between the container and each candidate processing unit, and assign the container to the processing unit with the highest relevance for execution. The specific steps are as follows: t t t t t t t i t t t t t t t t t t t t ② Calculate container C i In each candidate processing unit PU t Resource utilization rate CR i,t ={CRC i,t CRM i,t CRF i,t CRN i,t }, where PU t ∈CP i CPU utilization CRC i,t =SRC i / RCC t *100%, Memory Usage CRM i,t =SRM i / RCM t *100%, Flash Utilization CRF i,t =SRF i / RCF t *100%, Network bandwidth utilization (CRN) i,t =SRN i / RCN t *100%; ③ Calculate the PU for each candidate processing unit. t Average resource idle rate (RIA) t and container C i In PU t Average resource utilization rate CRA i,t RIA t =(RIC t +RIM t +RIF t +RIN t ) / 4, CRA i,t =(CRC i,t +CRM i,t +CRF i,t +CRN i,t ) / 4; ④ Calculate C i With each candidate processing unit PU t Similarity: ,in , ; ⑤ Calculate container C i With each candidate processing unit PU t Relation i,t =1-|Sim i,t | Candidate processing unit set CP i All processing units are sorted from highest to lowest based on the absolute value of their associativity, and container C is then... i Execution is assigned to the processing unit with the highest correlation; if there are multiple processing units with the highest correlation, the processing unit with the highest correlation is randomly selected, and container C is then executed. i It is assigned to be executed.
2. The container scheduling method for smart power terminals according to claim 1, characterized in that, The specific steps of step (1) are as follows: ① The application center is working on application software S i The software needs to be executed during the review process, according to the software S i The usage of CPU, memory, flash storage, and network bandwidth during execution is recorded by the software. i Required resources SR i =(SRC i SRM i SRF i SRN i ), of which SRC i SRM i SRF i SRN i Representing software S respectively i The CPU resources, memory resources, storage capacity, and network bandwidth required for normal operation; ② The application center establishes a resource requirement database RS = {SR1, SR2, …, SR} for all application software resource requirements. m }, where m is the number of application software in the application center, SR i For software S i The resource requirements are such that 1≤i≤m.
3. The container scheduling method for smart power terminals according to claim 1, characterized in that, The specific steps of step (4) are as follows: ① If there are idle processing units with equal rated resources and available resources for each type, then randomly select an idle unit with rated resources of each type not less than container C. i Candidate processing units (PUs) for resource requirements t Assigned to container C i RCC t =RAC t ≥SRC i ,RCM t =RAM t ≥SRM i , RCF t =RAF t ≥SRF i RCN t =RAN t ≥SRF i RCC t RCM t RCF t RCN t These represent candidate processing units PU, respectively. t The configured rated CPU computing power, memory capacity, Flash capacity, and network bandwidth, RAC t RAM t RAF t RAN t They represent candidate processing units PU respectively t The SRC currently has available CPU computing power, memory capacity, Flash capacity, and network bandwidth. i SRM i SRF i SRN i Representing software S respectively i The CPU resources, memory resources, storage capacity and network bandwidth required for normal operation, where m is the number of application software, 1≤i≤m, and n is the number of processing units contained in the terminal, 1≤t≤n; ② If there are no idle processing units or the rated resources of all idle units are less than those of container C. i Resource requirements are determined based on container C. i Resource requirements SR i =(SRC i SRM i SRF i SRN i ) and the available resources RA for each candidate processing unit t ={RAC t RAM t , RAF t RAN t }, filter out those that can hold container C i CP, the set of candidate processing units i ={PU t | RAC t ≥SRC i RAM t ≥SRM i , RAF t ≥SRF i RAN t ≥SRF i , 1≤t≤n}, meaning that all available resources are no less than container C. i Only candidate processing units with the required resource needs can run the container; if the collection of CPs i If the set is empty, meaning there are no processing units available to run the container, then a resource shortage warning will be displayed, and the scheduling process will be terminated or the container will wait for subsequent scheduling.
Citation Information
Patent Citations
Docker dynamic scheduling algorithm for typical containers
CN108897627A
Container scheduling method, scheduling device and electronic equipment
CN109582452A