Container scheduling method applied to container arrangement system

By considering the dependencies and resource balance between containers, a multi-objective optimization algorithm is used to optimize container scheduling, which solves the problems of resource waste and fragmentation in the existing technology, and achieves more balanced resource allocation and utilization.

CN118964015APending Publication Date: 2024-11-15INST OF COMPUTING TECH CHINESE ACAD OF SCI
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411019329.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The existing container scheduling optimization solution has achieved certain results in alleviating the problems of uneven resource allocation and resource fragmentation of nodes, but it ignores the potential dependencies between the software running inside the container, resulting in waste of resources and difficulty in finding the best container. Scheduling decision making.

Method used

By obtaining the dependencies between containers, determining the overall resource balance and overall resource occupancy rate, and using a multi-objective optimization algorithm to minimize these indicators, we solve the container scheduling strategy so that the resource occupancy is more common among various worker nodes is achieved. balanced.

Benefits of technology

It effectively reduces the overall resource balance and overall resource occupancy rate, improves the resource utilization efficiency of container scheduling decisions, and ensures the balanced distribution of resources between various work nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964015A_ABST
    Figure CN118964015A_ABST
Patent Text Reader

Abstract

The invention provides a container scheduling method applied to a container arrangement system. The method comprises the following steps: S1, obtaining a dependency relationship between containers; s2, determining the overall resource balance degree and the overall resource occupancy rate based on the dependency relationship between the containers; and S3, taking the minimization of the overall resource balance degree and the overall resource occupancy rate as an optimization target, adopting a preset multi-target optimization algorithm to execute multiple rounds of iterative computation to obtain a target container scheduling strategy, and scheduling the container to a working node of the container arrangement system according to the target container scheduling strategy. According to the method, the dependency relationship between the containers and resource saving brought by the dependency relationship are considered, and the container scheduling strategy is solved by taking the overall resource balance degree and the overall resource occupancy rate determined according to the dependency relationship as optimization targets, so that the overall resource occupancy rate is reduced while the container scheduling strategy keeps resource load balance as much as possible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software virtualization, in particular to a container scheduling technology in the technical field of software virtualization, and more particularly to a container scheduling method applied to a container orchestration system. Background Art

[0002] With the rapid development of Internet technology and the widespread popularity of IT applications, modern enterprises have increasingly complex and diversified requirements for applications. Traditional monolithic application architectures are unable to meet the high concurrency, high availability, and rapid iteration requirements of modern applications due to their poor flexibility and insufficient scalability. Therefore, emerging architectural styles such as microservice architectures and containerization technologies have gradually become the focus of the industry.

[0003] Early virtualization technology mainly used virtual machines (VMs) as the basic unit for resource allocation and scheduling. Virtual machines simulate a complete hardware environment to run applications. Although they provide high isolation and security, they also have problems such as low resource utilization, low memory access efficiency, and long development cycles. These problems limit the widespread use of virtualization technology in modern applications.

[0004] In order to overcome the shortcomings of traditional virtualization technology, Docker container technology came into being. Docker is significantly different from virtual machines. It does not virtualize the hardware dimension, but shares the kernel of the host machine and runs the container as a process. This lightweight virtualization method makes Docker containers superior to traditional virtual machines in terms of startup speed, resource usage and performance. Docker containers contain application files and their dependent library files, which are packaged into an independent image and can be quickly deployed and run in any environment that supports Docker. Since containers do not affect each other, Docker provides efficient resource isolation and strong scalability. In addition, Docker's fast startup and lightweight features make it the preferred tool for publishing and building applications. More and more developers choose to use Docker as a development environment.

[0005] Although the popularity of Docker container technology has greatly simplified the packaging, distribution and deployment process of applications, as the scale of software systems grows, manual management and deployment of container images has become increasingly complex and unfeasible. In large-scale software systems, it is necessary to consider multiple aspects such as high availability, automated deployment, horizontal expansion, load balancing, fault recovery and resource optimization. These tasks are beyond the scope of manual management and require an automated and intelligent platform to manage and schedule containers. In response to this situation, Kubernetes (K8s for short) came into being. It was released and open sourced by Google. It is currently the most commonly used open source container orchestration and management platform in the microservice field, dedicated to automated application deployment, expansion and management. It provides a rich set of tools to make the management of container clusters simpler and more efficient. Kubernetes can achieve high availability, elastic scaling, automatic deployment and self-healing of containerized applications. Kubernetes clusters have relatively complete management capabilities. Its concept is to allow user-deployed applications to run, self-heal and maintain specified states in the cluster according to user expectations without excessive human intervention. In addition, Kubernetes also has strong scalability. Developers can expand its components at any time to cope with the ever-changing and complex production environment in practice.

[0006] In large-scale software systems, Kubernetes, as a container orchestration platform, can solve many complex deployment and management challenges, but one of the keys to its performance and efficiency is the scheduling strategy it chooses. The scheduling strategy refers to the decision in Kubernetes on how to allocate container instances to the worker nodes in the cluster. In different container scheduling scenarios, a reasonable scheduling strategy can ensure that applications obtain the required computing, storage, and network resources, and can effectively balance loads in the cluster, thereby improving the overall performance of the system. Kubernetes schedules containers by scheduling Pods. Pods are the smallest scheduling unit in Kubernetes. They can contain one or more closely related containers, share network and storage resources, and run on the same worker node. When Kubernetes schedules a Pod, it actually allocates a common worker node to all of its containers to ensure that they can work together and share resources. Containers in a Pod usually have the same life cycle and can share local file systems, IP addresses, and port spaces.

[0007] The container scheduling process of Kubernetes is that when receiving the Pod list submitted by the user, two processes need to be executed to determine the scheduling of the Pod to a certain cluster working node. Figure 1The scheduling process shown is used as an example to illustrate how to schedule containers. The container scheduling process of Kubernetes is as follows: Pre-selection process: Kube-scheduler obtains the Pod list and selects nodes that meet the Pod application conditions according to specific strategies; Optimization process: Score the selected nodes according to specific strategies and algorithms, and sort them according to the scores. Finally, select the node with the highest priority and schedule the Pod to this node. In the container scheduling process, Kubernetes has the following built-in pre-selection algorithms for container scheduling: Pod Fits Host: used to specify running on a certain cluster working node, Pod Fits Resources: used to check whether the available resources of the node are met, PodFits HostPorts: used to check whether the Pod application port is occupied, Pod Selector Matches: used to check the node label parameter matching, Check Node Memory Pressure: used to check the node memory pressure, Check Node DiskPressure: check the node disk pressure, No Disk Conflict: check the mounted volume and Pod configuration conflicts. In addition to the above pre-selection algorithms, Kubernetes also has the following built-in optimization algorithms for container scheduling: Least Requested Priority: used to give priority to nodes with the lowest resource consumption among nodes, and score them according to the current CPU and memory usage. The smaller the sum of CPU and memory usage, the higher the score of the working node. This algorithm can ensure the optimal performance of the Pod container when running; Balanced Resource Allocation: used to give priority to nodes with similar CPU and memory utilization, and score them according to the difference between CPU and memory resource utilization. The smaller the difference between CPU and memory resource utilization, the higher the score of the working node. This algorithm can ensure the balance of resources within the working nodes of the cluster; Image Locality Priority: Prioritize the selection of working nodes that already have images from the node list, and score them according to the total size of the node image. The larger the total size of the image, the higher the score of the working node. This algorithm can reduce the network bandwidth occupied by transmitting images in the Kubernetes network.

[0008] Although Kubernetes has built-in pre-selection and optimization algorithms for container scheduling, the container scheduling decisions based on these algorithms often have problems such as uneven node resource usage and serious resource fragmentation. Specific resource fragmentation scenarios include Figure 2As shown in the figure, when the built-in minimum resource algorithm of Kubernetes is used, Pod1 will be scheduled to Node2, and Pod2 will be scheduled to Node3. Then Pod3 cannot be scheduled and can only wait, causing problems such as cluster load imbalance, resource fragmentation and resource bucket effect. In this case, the actual optimal scheduling decision is to schedule Pod1 to Node1, Pod2 to Node3, and Pod3 to Node2. Similarly, the resource with the highest node utilization rate determines the number of Pods that the node can run.

[0009] In order to solve the above problems, researchers have proposed many container scheduling optimization solutions for Kubernetes. For example, the dominant resource fairness (DRF) method is introduced into the Kubernetes cluster, and a DRF-based resource fair allocation algorithm (RFAA) is proposed for the optimization stage. The container scheduling strategy is designed by considering the balance of resource occupancy between nodes, ensuring fairness between cluster working nodes. For example, when designing the scoring strategy of the optimization algorithm, not only the impact of CPU and memory occupancy on Pod scheduling is considered, but also the impact of network utilization and disk utilization on Pod scheduling is considered. For example, during the optimization stage, on the basis of comprehensive consideration of CPU, memory, network bandwidth and disk IO utilization, Pods are not scored one by one, but a heuristic algorithm is used to solve the overall scoring results of all Pods, and container scheduling is performed based on the results. For example, in addition to considering the CPU, memory, network bandwidth and disk IO utilization factors, resource balance is also considered. Resource balance is obtained by summing the difference between each resource occupancy rate and the average resource occupancy rate and then taking the average. It represents the degree of fragmentation of resource utilization, and the larger the resource balance value, the higher the degree of resource fragmentation, and vice versa. For example, many labels are added to each Pod to be scheduled to avoid too many Pods occupying the same resources from being scheduled to the same node. For example, considering the resource waste caused by the difference between the Pod's application for resources and the actual use of resources, the optimal utilization rate of each resource of each working node in the cluster is calculated by comprehensively evaluating the runtime data of the container. When scheduling the container, the Euclidean distance between the current utilization rate and the optimal utilization rate is considered to ensure that the resource utilization rate of each working node during system operation is close to the optimal. For example, a delay-aware container scheduling method is proposed to solve the heterogeneity and high latency problems of edge work nodes. When sorting work nodes, not only the remaining resources of the work nodes are considered, but also the potential delay caused by Pod allocation, including scheduling delay and processing delay, so as to ensure the resource utilization of work nodes while meeting business delay requirements. For another example, starting from the application layer, ignoring the network layer delay, directly modeling the actual user-perceived delay and designing it into the scoring strategy to ensure the user's service quality.

[0010] Although existing container scheduling optimization solutions have achieved certain results in alleviating the problems of uneven node resource allocation and resource fragmentation, these solutions mainly focus on the resource requirements of the container itself, such as CPU, memory, latency, network bandwidth, and disk IO, but ignore the potential dependencies between the software running inside the container and the resource optimization potential that such dependencies may bring. This has caused a certain amount of resource waste and made it difficult to find the best container scheduling decision.

[0011] It should be noted that this background technology is only used to introduce the relevant information of the present invention to help understand the technical solution of the present invention, but it does not mean that the relevant information is necessarily the prior art. If there is no evidence that the relevant information has been disclosed before the application date of the present invention, the relevant information shall not be regarded as the prior art. Summary of the invention

[0012] Therefore, the purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a container scheduling method applied to a container orchestration system.

[0013] The objectives of the present invention are achieved through the following technical solutions.

[0014] According to a first aspect of the present invention, there is provided a container scheduling method for a container orchestration system, wherein the container orchestration system is used to schedule multiple containers so as to deploy the multiple containers to working nodes for execution to implement the functions of a software system, wherein the software system includes multiple software components, each of which is encapsulated as a container, and the method includes: step S1, obtaining dependencies between containers, wherein the dependencies between containers refer to dependencies between software components corresponding to each container, and the dependencies between software components refer to the ability of software components to work together through data streams; step S2, determining an overall resource balance and an overall resource occupancy rate based on the dependencies between containers, wherein the overall resource balance indicates the degree of balance of resource loads in the container orchestration system, and the overall resource occupancy rate indicates the degree of resource occupancy in the container orchestration system; step S3, taking minimizing the overall resource balance and the overall resource occupancy rate as optimization goals, using a preset multi-objective optimization algorithm to perform multiple rounds of iterative calculations to obtain a target container scheduling strategy, and scheduling the container to the working node of the container orchestration system according to the target container scheduling strategy.

[0015] In some embodiments of the present invention, the dependencies between containers include loopback network card dependencies and shared memory dependencies, wherein the loopback network card dependency means that two containers scheduled to the same working node can communicate using the loopback network card; the shared memory dependency means that two or more containers scheduled to the same working node can access the same memory space of the working node for communication.

[0016] Preferably, in step S2, the overall resource balance is determined in the following manner:

[0017] F(x)=f bode +f total

[0018] in,

[0019]

[0020]

[0021] in,

[0022]

[0023]

[0024] in,

[0025]

[0026]

[0027]

[0028]

[0029]

[0030] Among them, F(x) represents the overall resource balance, f node Indicates the overall working node resource balance, f total Indicates the balance of cluster resources, σ i Indicates the resource balance of working node i, Indicates the CPU usage of worker node i, represents the memory usage of worker node i, represents the network bandwidth occupancy of worker node i, represents the disk usage of worker node i, v cluster represents the average resource utilization among the working nodes, l represents the number of working nodes, represents the overall mean of resource usage of worker node i, G represents the number of containers to be scheduled, τ i,j is the decision variable, τ i,j τ represents the time when container j is scheduled to work node i i,j =1, when not scheduled to working node i i,j =0, α represents the number of containers running in worker node i that can generate loopback network card dependencies with container j, μ1 represents the CPU increase ratio, represents the actual resource demand ratio of container j to CPU, β represents the number of containers running in worker node i that have a shared memory dependency with container j, and μ2 represents the memory increase ratio. represents the actual resource demand ratio of container j for memory, μ3 represents the network bandwidth saving ratio, Indicates the actual resource demand ratio of container j on the disk.

[0031] Preferably, in step S2, the overall resource occupancy rate is determined in the following manner:

[0032]

[0033] Among them, U(x) represents the overall resource occupancy rate.

[0034] In some embodiments of the present invention, the preset multi-objective optimization algorithm is a multi-objective optimization genetic algorithm, a particle multi-objective firefly algorithm, a non-dominated sorting whale optimization algorithm, a multi-objective jellyfish search algorithm, a multi-objective artificial hummingbird algorithm or a multi-objective particle swarm optimization algorithm.

[0035] In some embodiments of the present invention, in step S3, during each round of iterative calculation, the current round of container scheduling strategy is solved and archived with minimizing the overall resource balance and the overall resource occupancy rate as the optimization goal, and the container scheduling strategies of all rounds after multiple rounds of iterative calculation are processed according to preset rules to obtain the target container scheduling strategy, wherein each round of container scheduling strategy includes multiple container scheduling decisions.

[0036] In some embodiments of the present invention, the preset rule is: determining the dominance relationship between all container scheduling decisions based on the overall resource balance and the overall resource occupancy rate, and sorting the dominance relationship to obtain a non-dominated sorting result, wherein when the overall resource balance and the overall resource occupancy rate of a container scheduling decision are both smaller than those of another container scheduling decision, the container scheduling decision dominates the other container scheduling decision, and the non-dominated sorting result includes a multi-level sorting, each level of sorting includes one or more container scheduling decisions, and all container scheduling decisions in the previous level of sorting dominate all container scheduling decisions in the next level of sorting; based on the non-dominated sorting result, the congestion distance of all container scheduling decisions in the same level of sorting is calculated, and each container scheduling decision is sorted in descending order according to the congestion distance to obtain a congestion distance sorting result of the non-dominated sorting result; and multiple container scheduling decisions ranked first are selected from the non-dominated sorting result and its corresponding congestion distance sorting result to form a target container scheduling strategy.

[0037] In some embodiments of the present invention, the congestion distance of a container scheduling decision is calculated as follows: a difference between the overall resource balance of a container scheduling decision and a previous container scheduling decision, and a difference between the overall resource balance of a container scheduling decision and a subsequent container scheduling decision are calculated, and the two differences are summed to obtain a first congestion distance; a difference between the overall resource occupancy of a container scheduling decision and a previous container scheduling decision, and a difference between the overall resource occupancy of a container scheduling decision and a subsequent container scheduling decision are calculated, and the two differences are summed to obtain a second congestion distance; the first congestion distance and the second congestion distance are summed to obtain the congestion distance of the container scheduling decision.

[0038] Compared with the prior art, the advantages of the present invention are: considering the dependencies between containers and the resource savings brought about by the dependencies, and then determining the overall resource balance and the overall resource occupancy rate according to the dependencies between containers, and taking the overall resource balance and the overall resource occupancy rate as optimization goals to solve the container scheduling strategy, thereby reducing the overall resource balance and the overall resource occupancy rate, making the resource occupancy of the container scheduling decision more balanced among various working nodes. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The embodiments of the present invention are further described below with reference to the accompanying drawings, in which:

[0040] Figure 1 This is a diagram of the container scheduling process for Kubernetes;

[0041] Figure 2 A diagram showing an example of a resource fragmentation scenario when scheduling containers on Kubernetes.

[0042] Figure 3 A schematic diagram of a container scheduling method according to an embodiment of the present invention;

[0043] Figure 4 This is a schematic diagram of an example of a first three-level non-dominated front-end solution set for solving container scheduling in a simulation verification scenario according to an embodiment of the present invention;

[0044] Figure 5 This is a schematic diagram of an example of overall resource occupancy of container scheduling decisions in a simulation verification scenario according to an embodiment of the present invention;

[0045] Figure 6 This is a schematic diagram of an example of overall resource balance of container scheduling decision in a simulation verification scenario according to an embodiment of the present invention;

[0046] Figure 7 The figure is a schematic diagram of an example of resource occupancy rates among working nodes corresponding to a container scheduling decision in a simulation verification scenario according to an embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0048] As mentioned in the background technology section, although existing container scheduling optimization solutions have achieved certain results in alleviating the problems of uneven node resource allocation and resource fragmentation, these solutions mainly focus on the resource requirements of the container itself, such as CPU, memory, latency, network bandwidth, and disk IO, but ignore the potential dependencies between the software running inside the container and the resource optimization potential that such dependencies may bring. This has caused a certain amount of resource waste and made it difficult to find the best container scheduling decision.

[0049] Before specifically introducing the embodiments of the present invention, some of the terms used therein are explained as follows:

[0050] Worker node: refers to a server device or a node with computing power located in a container orchestration system, which is used to actually run container tasks instantiated from various images in the software system.

[0051] Software dependency: refers to the topological relationship that may exist between software components in a software system. Interrelated software components running on the same working node can save communication bandwidth.

[0052] Container scheduling: refers to the container orchestration system scheduling each running container in the software system to run on the working node.

[0053] In order to solve the problems in the prior art, the inventor analyzed the existing container scheduling optimization solutions and found that the existing container scheduling optimization mainly starts from the container itself, ignoring the possible dependencies between the software running inside the container and the resource savings that the dependencies can bring. Based on this, the inventor proposed a container scheduling method that considers the dependencies between containers. In this method, the dependencies between containers and the resource savings brought by the dependencies are considered, and then the overall resource balance and overall resource occupancy are determined according to the dependencies between containers. The overall resource balance and overall resource occupancy are used as optimization goals to solve the container scheduling strategy, so that the container scheduling strategy can reduce the overall resource occupancy while maintaining resource load balance as much as possible.

[0054] In summary, if Figure 3As shown, the present invention provides a container scheduling method applied to a container orchestration system, wherein the container orchestration system is used to schedule multiple containers so as to deploy the multiple containers to working nodes for operation to realize the functions of a software system, wherein the software system includes multiple software components, each of which is encapsulated as a container, and the method includes: step S1, obtaining dependencies between containers, wherein the dependencies between containers refer to dependencies between software components corresponding to each container, and the dependencies between software components refer to the ability of software components to work together through data streams; step S2, determining an overall resource balance and an overall resource occupancy rate based on the dependencies between containers, wherein the overall resource balance indicates the degree of balance of resource loads in the container orchestration system, and the overall resource occupancy rate indicates the degree of resource occupancy in the container orchestration system; step S3, taking minimizing the overall resource balance and the overall resource occupancy rate as optimization goals, using a preset multi-objective optimization algorithm to perform multiple rounds of iterative calculations to obtain a target container scheduling strategy, and scheduling the container to the working node of the container orchestration system according to the target container scheduling strategy.

[0055] In order to better understand the present invention, each step is described in detail below in conjunction with specific embodiments.

[0056] 1. Step S1

[0057] The step S1 is used to obtain the dependency relationship between containers.

[0058] According to one embodiment of the present invention, the dependencies between containers include loopback network card dependencies and shared memory dependencies, wherein the loopback network card dependency means that two containers scheduled to the same working node can communicate using the loopback network card; the shared memory dependency means that two or more containers scheduled to the same working node can access the same memory space of the working node for communication.

[0059] It should be noted that in the existing container scheduling schemes, when designing container scheduling schemes and scenario modeling, most of them start from the perspective of the resources occupied by the container itself, ignoring the possible dependencies between the software components running inside the container and the resource savings that can be brought about by the dependencies. In large-scale software systems, software components with different functions need to communicate through the network. When the containers encapsulated by these software components are scheduled to the same working node, the network communication can be replaced by using the loopback network card or shared memory communication inside the working node. At this time, the bandwidth required for communication between containers can be greatly reduced, thereby reducing resource consumption while slightly increasing the CPU or memory usage. For example, the data processing module in the software system needs to obtain data from the database module. If the data processing module and the database module are scheduled to the same working node, shared memory can be used to transmit data; for another example, the authentication service module in the software system needs to communicate with the user management module. When the authentication service module and the user management module are in the same working node, a loopback network card can be used for communication; for another example, the logging module in the software system needs to send log information to the monitoring module. When the logging module and the monitoring module are located in the same working node, the log data can be transmitted through shared memory. It should also be noted that the large-scale software system can be a 5G network simulation system, which includes five functional software components: simulation terminal, load client, 5G physical layer, 5G base station distributed unit and 5G base station centralized unit. These software components can be encapsulated as containers and scheduled to run in the container orchestration system.

[0060] Step S2

[0061] The step S2 is used to determine the overall resource balance and overall resource occupancy rate based on the dependency relationship between containers.

[0062] According to an embodiment of the present invention, in step S2, the overall resource balance is determined in the following manner:

[0063] F(x)=f bode +f total

[0064] in,

[0065]

[0066]

[0067] in,

[0068]

[0069]

[0070] in,

[0071]

[0072]

[0073]

[0074]

[0075]

[0076] Among them, F(x) represents the overall resource balance, f node Indicates the overall working node resource balance, f total Indicates the balance of cluster resources, σ i Indicates the resource balance of working node i, Indicates the CPU usage of worker node i, represents the memory usage of worker node i, represents the network bandwidth occupancy of worker node i, represents the disk usage of worker node i, v cluster represents the average resource utilization among the working nodes, l represents the number of working nodes, represents the overall mean of resource usage of worker node i, G represents the number of containers to be scheduled, τ i,j is the decision variable, τ i,j τ represents the time when container j is scheduled to work node i i,j =1, when not scheduled to working node i i,j =0, α represents the number of containers running in worker node i that can generate loopback network card dependencies with container j, μ1 represents the CPU increase ratio, represents the actual resource demand ratio of container j to CPU, β represents the number of containers running in worker node i that have a shared memory dependency with container j, and μ2 represents the memory increase ratio. represents the actual resource demand ratio of container j for memory, μ3 represents the network bandwidth saving ratio, Indicates the actual resource demand ratio of container j on the disk.

[0077] According to an embodiment of the present invention, in step S2, the overall resource occupancy rate is determined in the following manner:

[0078]

[0079] Among them, U(x) represents the overall resource occupancy rate.

[0080] It should be noted that the overall resource balance and overall resource utilization are related to the specific container scheduling decision x executed by the container orchestration system. The effects of different container scheduling decisions can be compared by calculating the overall resource balance and overall resource utilization of different container scheduling decisions. It should also be noted that the container scheduling decision can be expressed as x = [x1, x2, x3, ..., x G ], which is a row vector of length G, where G is the number of containers; x1,x2,x3,…,x G The value range of is the number of working nodes. Assuming the number of working nodes is L, then x1,x2,x3,…,x G The value range of is 1 to L; each point in the vector indicates to which working node the container corresponding to the point is scheduled. For example, when the value of x1 is 1, it means that the first container is scheduled to working node 1. For example, when the value of x2 is 5, it means that the second container is scheduled to working node 5. The meanings of other points are consistent with the above, so they are not elaborated.

[0081] Step S3

[0082] The step S3 is used to solve the target container scheduling strategy with minimizing the overall resource balance and the overall resource occupancy rate as the optimization goal, and schedule the container to the working node in the container orchestration system according to the container scheduling strategy.

[0083] According to one embodiment of the present invention, the preset multi-objective optimization algorithm is a multi-objective optimization genetic algorithm, a particle multi-objective firefly algorithm, a non-dominated sorting whale optimization algorithm, a multi-objective jellyfish search algorithm, a multi-objective artificial hummingbird algorithm or a multi-objective particle swarm optimization algorithm. It should be noted that the multi-objective optimization algorithm is adopted because the present invention includes two optimization objectives, one is to minimize the overall resource balance, and the other is to minimize the overall resource occupancy rate, and because the overall resource balance includes the resource balance within the working node and the resource balance within the cluster, when the overall resource balance is reduced, the container will be evenly scheduled to each working node to make the overall resource load more balanced, but this uniform scheduling method cannot make full use of the dependencies between tasks in the container, resulting in an increase in the overall resource occupancy rate. In other words, the two optimization objectives have opposite scheduling directions for the working nodes. If the two optimization objectives are converted into a single-objective optimization problem by weighted summation, the optimal container scheduling strategy cannot be accurately obtained. Therefore, it is necessary to adopt a multi-objective optimization method to find the Pareto frontier that minimizes the overall resource balance and the overall resource occupancy rate, and find the best container scheduling decision that meets actual needs in the Pareto frontier. It should also be noted that in multi-objective optimization problems, the Pareto front is a set of regions or points that represent possible optimal solutions when considering two or more objectives. For each point on the Pareto front, the improvement of any optimization objective will lead to the sacrifice of another optimization objective. Therefore, this front reflects the best balance point achieved between multi-objective optimization. In other words, the Pareto front shows the set of optimal solutions achieved by considering the trade-offs between different optimization objectives.

[0084] According to one embodiment of the present invention, in step S3, in each round of iterative calculation, the current round of container scheduling strategy is solved and archived with minimizing the overall resource balance and overall resource occupancy as the optimization goal, and all rounds of container scheduling strategies after multiple rounds of iterative calculation are processed according to preset rules to obtain the target container scheduling strategy, wherein each round of container scheduling strategy includes multiple container scheduling decisions. It should be noted that in addition to minimizing the overall resource balance and overall resource occupancy as the optimization goal in each round of iteration, the maximum value of the resources that can be provided in the working node needs to be considered. For any working node, the sum of a certain resource that can be consumed by all containers running on it cannot exceed the maximum value of the resource that the node can provide, that is: i∈[1,L], where It represents the maximum value of CPU resources that can be provided by worker node i, and L is the number of worker nodes; i∈[1,L], where Indicates the maximum value of memory resources that can be provided by worker node i; i ∈ [1, L], where represents the maximum value of the network bandwidth resource that the working node i can provide; i ∈ [1, L], where represents the maximum value of the disk resource that the working node i can provide.

[0085] According to an embodiment of the present invention, the preset rule is: determine the dominance relationship between all container scheduling decisions according to the overall resource balance degree and the overall resource occupancy rate, and sort the dominance relationship to obtain the non-dominated sorting result. Among them, when the overall resource balance degree and the overall resource occupancy rate of a container scheduling decision are both less than those of another container scheduling decision, then this container scheduling decision dominates the other container scheduling decision. The non-dominated sorting result includes multiple levels of sorting, each level of sorting includes one or more container scheduling decisions, and all container scheduling decisions in the upper level of sorting dominate all container scheduling decisions in the lower level of sorting; calculate the crowding distance for all container scheduling decisions at the same level of sorting based on the non-dominated sorting result, and sort each container scheduling decision in descending order of the crowding distance to obtain the crowding distance sorting result of the non-dominated sorting result; select multiple container scheduling decisions with the top rankings from the non-dominated sorting result and its corresponding crowding distance sorting result to form the target container scheduling strategy. It should be noted that the dominance relationship between container scheduling decisions is determined based on the results of their respective overall resource balance degrees and overall resource occupancy rates. Assuming there are container scheduling decision x and container scheduling decision y, if U(x) < U(y) and F(x) < F(y), then container scheduling decision x dominates container scheduling decision y.

[0086] According to an embodiment of the present invention, the congestion distance of a container scheduling decision is calculated as follows: the difference between the overall resource balance of a container scheduling decision and its previous container scheduling decision, and the difference between the overall resource balance of a container scheduling decision and its subsequent container scheduling decision are calculated, and the two differences are summed to obtain a first congestion distance; the difference between the overall resource occupancy of a container scheduling decision and its previous container scheduling decision, and the difference between the overall resource occupancy of a container scheduling decision and its subsequent container scheduling decision are calculated, and the two differences are summed to obtain a second congestion distance; the first congestion distance and the second congestion distance are summed to obtain the congestion distance of the container scheduling decision. It should be noted that the congestion reflects the relative distance between each container scheduling decision and other adjacent individuals in the solution space. It should also be noted that before performing the congestion calculation, all container scheduling decisions at the same level of sorting need to be sorted according to different optimization objectives based on the non-dominated sorting results. That is to say, for all container scheduling decisions at the same level of sorting, they are sorted according to the size of the overall resource balance value and the size of the overall resource occupancy value to obtain the sorting result of each optimization objective, and the congestion of the container scheduling decisions at both ends of each sorting result is set to infinity, and then the congestion calculation is performed based on the sorting result of each optimization objective.

[0087] In order to better understand the solution process of the target container scheduling strategy described in the present invention, the following takes a multi-objective optimization genetic algorithm as an example to explain in detail how to use a multi-objective optimization genetic algorithm to solve the target container scheduling strategy with minimizing the overall resource balance and the overall resource occupancy rate as the optimization objectives.

[0088] Among them, the solution process of the multi-objective optimization genetic algorithm is shown in Table 1. As can be seen from Table 1, the container scheduling solution process based on the multi-objective optimization genetic algorithm simulates the biological evolution mechanism to seek the optimal scheduling solution. The input of the multi-objective optimization genetic algorithm is the initial solution population size N and the maximum number of iterations T max , the output is the Pareto frontier of the container scheduling problem, where the initial solution population size means the number of individuals contained in the population is N, and each individual represents a possible container scheduling decision; the maximum number of iterations is T maxIndicates the maximum number of iterations or time for the algorithm to run, which is used to control the termination condition of the algorithm. During the calculation process, first, the initial parameters are set: the population P is initialized using the best point set method, and the fitness value of the initial population P is calculated (the fitness value is the overall resource balance and the overall resource occupancy rate), and the non-dominated ranking and crowding distance of each individual are calculated, the iteration counter t=0 is set, and the global archive A is initialized (the global archive A is initialized to be empty or contains the best individual in the initial population); then, the main loop of the multi-objective optimization genetic algorithm is executed: in each iteration, the random traversal sampling method is used to select N individuals as offspring Q in the current iteration population P, and then the chromosomes in the offspring Q (the chromosome is a row vector, which represents the container scheduling decision) are shuffled and indexed, and then the offspring Q after the crossover is shuffled according to Gaussian mutation is performed for the mutation probability, and then the mutated offspring Q is mixed with the current iteration population P to form a new population R, and its fitness is calculated. The individuals in the population R are non-dominated and sorted and the crowding distance is calculated (the calculation of non-dominated sorting and crowding refers to the previous embodiment, which will not be repeated here), and then the first N non-dominated individuals and individuals with high crowding are selected from the new population R as the next iteration population P and stored in the global archive A; finally, the maximum number of iterations T is executed. max After that, the fitness of the global archive A is calculated and non-dominated sorting and crowding distance calculations are performed, and its Pareto front is returned as the target container scheduling strategy.

[0089] Table 1

[0090]

[0091] The fitness calculation process in the multi-objective optimization genetic algorithm solution process is shown in Table 2. As can be seen from Table 2, the input is the container scheduling decision x, the CPU increase ratio μ1, the memory increase ratio μ2, the network bandwidth saving ratio μ3, the container resource consumption matrix D, and the container arrival order task; the output is the overall resource occupancy rate and overall resource balance of the current container scheduling decision, where the container scheduling decision x = [x1, x2, x3,…, x G ], the container arrival order task = [task1,task2,task3,…,task G ]. During the calculation process, first, perform initialization operations: initialize the resource usage of the working node, initialize the container operation status of the working node, and initialize the fitness r = 0; then, execute the for loop: first obtain the container task according to the order in which the container arrives i Type, and then get D according to the container number and type i Each column indicates the resource requirements, and then calculates the working node x i The container task is already running iThe number of containers with dependencies, recalculate the CPU, memory, and bandwidth requirements based on the dependencies, and then update the worker node x with the updated resource requirements i Resource usage, container task i Update to the set of containers running on the machine; finally: calculate the overall resource occupancy and overall resource balance, and output the fitness r = {U(x), F(x)} of the container scheduling decision x.

[0092] Table 2

[0093]

[0094] Based on the multi-objective optimization genetic algorithm shown in Table 1 above, the target container scheduling strategy can be calculated. Since the target container scheduling strategy includes multiple container scheduling decisions, a container scheduling decision can be selected from the target container scheduling strategy according to actual needs to execute container scheduling. The specific container scheduling execution process is shown in Table 3. As can be seen from Table 3, with the container scheduling decision x, the queue task of the container to be scheduled and the set of working nodes node as input, each container is scheduled to the working node node according to the container scheduling decision x.

[0095] Table 3

[0096]

[0097]

[0098] In order to better understand the difference between the container scheduling solution proposed in the present invention and the prior art, the difference between the container scheduling solution proposed in the present invention and the prior art is supplemented by a specific simulation verification process.

[0099] First, the simulation verification parameter settings are performed, and the setting results are shown in Table 4. As can be seen from Table 4, the number of containers to be scheduled is set to 20, the types of containers to be scheduled are set to 5, the working nodes are set to 10, and the dependencies between the software in the containers include 3 types. When containers 1 and 2, and containers 2 and 3 are on the same working node, the CPU consumption can be increased and the network bandwidth consumption can be reduced. When containers 3 and 4 are on the same working node, the memory consumption can be increased and the bandwidth consumption can be reduced. The CPU increase ratio μ1 and the memory increase ratio μ2 are both set to 0.1, and the network bandwidth saving ratio μ3 is set to 1. The container's CPU resource occupancy is set to 5-15%, the container's memory resource occupancy is set to 5-15%, the container's disk resource occupancy is set to 5-10%, the container's network bandwidth resource occupancy is set to 5-20%, the upper limit of the working node resource occupancy is set to 100%, and the container arrival order is set to [4,4,4,4,5,5,5,3,3,3,3,2,2,2,2,2,1,1,1,1,1].

[0100] Table 4

[0101]

[0102]

[0103] Then, the simulation parameters of the multi-objective optimization genetic algorithm are configured, and the configuration results are shown in Table 5. As can be seen from Table 5, the gene length is set to 20, the population size is set to 200, the crossover ratio is set to 100%, the number of iterations is set to 500, the global archive size is set to 2000, and the standard deviation of Gaussian mutation is set to 1.5.

[0104] Table 5

[0105]

[0106]

[0107] Finally, simulation verification is performed based on the set simulation parameters. During the simulation verification process, the same container queue to be scheduled is scheduled using the default Least Requested Priority algorithm, Balanced Resource Allocation algorithm, First Fit greedy algorithm, random scheduling algorithm and the container scheduling scheme described in the present invention. The overall resource occupancy and overall resource balance after container scheduling are performed according to the Least Requested Priority algorithm, Balanced Resource Allocation algorithm, First Fit greedy algorithm, random scheduling algorithm and the container scheduling method described in the present invention are calculated in turn. The container scheduling performance difference between the existing scheduling algorithm and the scheduling scheme proposed in the present invention is analyzed based on all the calculated overall resource occupancy and overall resource balance.

[0108] Before analyzing the container scheduling performance between the existing scheduling algorithm and the scheduling solution proposed in the present invention, the specific execution methods of the existing scheduling algorithm and the scheduling solution proposed in the present invention during the simulation verification process are first introduced.

[0109] Least Requested Priority algorithm: This algorithm will prioritize the scheduling of containers to the worker nodes with the lowest total resource usage among the worker nodes. When a container needs to be scheduled, the algorithm will calculate the percentage of CPU and memory required by the Pod in the available resources of the current worker node, and schedule the container to the worker node with the smallest percentage. When using this algorithm to solve the container scheduling results in the simulation verification scenario, when a container task is received, the algorithm will add all the resource consumption of the container to the current resource consumption of each worker node, and then calculate the total resource usage of each worker node, and then select the worker node with the smallest total resource usage.

[0110] Balanced Resource Allocation algorithm: This algorithm will prioritize deploying Pods to worker nodes with CPU and memory usage rates that are closer. The worker node with the most balanced usage of various resources (CPU, memory) is the best. When using this algorithm to solve the container scheduling results in the simulation verification scenario, when a container task is received, the algorithm will add all the resource consumption of the container to the current resource consumption of each worker node, and then calculate the sum of the absolute differences between the resource utilization of each worker node and the mean, and then select the worker node with the smallest sum.

[0111] First Fit Greedy Algorithm: This algorithm prioritizes scheduling containers to the worker nodes that can first meet their resource requirements. When using this algorithm to solve the container scheduling results in the simulation verification scenario, when a container task is received, the algorithm will check whether each worker node can run the container in the order of worker nodes numbered 1 to 10. If so, the container will be directly scheduled to the worker node.

[0112] Random Scheduling Algorithm: This algorithm will randomly schedule containers. When using this algorithm to solve the container scheduling results in the simulation verification scenario, when a container task is received, the algorithm will randomly select a worker node from the worker nodes to run the container.

[0113] The scheduling scheme proposed in the present invention is to minimize the overall resource balance and overall resource occupancy rate as the optimization goal, and use a multi-objective optimization genetic algorithm to solve the target container scheduling strategy. When solving the target container scheduling strategy in the simulation verification scenario through this scheme, the following is obtained: Figure 4 The first three levels of non-dominated front ends are shown. Figure 4It can be seen that the dots in the figure represent the Pareto optimal solution set of the multi-objective optimization problem in the simulation verification scenario, the square dots represent the second non-dominated solution set of the multi-objective optimization problem, and the triangular dots represent the third non-dominated solution set of the problem. Among them, the second-level non-dominated solution set refers to the set formed by screening out the suboptimal non-dominated solutions from the solution space using the Pareto frontier. These solutions are not dominated by other solutions on all optimization objectives, but are dominated by solutions in the Pareto optimal solution set on at least one optimization objective; similarly, the third-level non-dominated solution set is a more suboptimal non-dominated solution set. These solutions are not dominated by other solutions on all optimization objectives, but are dominated by solutions in the second-level non-dominated solution set on at least one optimization objective. Therefore, the final container scheduling decision needs to be weighed and selected in the Pareto optimal solution set. Figure 4 The horizontal axis represents the normalized overall resource occupancy rate generated by the scheduling decision corresponding to each solution. Figure 4 The vertical axis represents the normalized overall resource balance produced by the scheduling decision corresponding to each solution.

[0114] The Pareto optimal solution set obtained by solving the scheduling scheme proposed by the present invention is compared with the container scheduling decisions obtained by other algorithms. Figure 5 The overall resource utilization comparison chart and Figure 6 The overall resource balance comparison diagram shown in the figure shows that the blue line represents the Least Requested Priority algorithm, the green line represents the Balanced Resource Allocation algorithm, the yellow line represents the First Fit greedy algorithm, the orange line represents the random scheduling algorithm, and the red line represents the multi-objective optimization genetic algorithm used in the present invention. Figure 5 and Figure 6 It can be seen that the container scheduling decision corresponding to the First Fit greedy algorithm occupies the least resources, but the corresponding resource balance performance is the worst; the resource occupancy and resource balance performance of the container scheduling decision corresponding to the random scheduling algorithm are inferior to the container scheduling decisions corresponding to the Balanced Resource Allocation algorithm and the container scheduling decision corresponding to the Least Requested Priority algorithm, the resource occupancy and resource balance performance of the container scheduling decision corresponding to the Balanced Resource Allocation algorithm are inferior to the container scheduling decision corresponding to the Least Requested Priority algorithm, and the resource occupancy and resource balance of the container scheduling decision corresponding to the Least Requested Priority algorithm are the best in the existing algorithms. The resource occupancy and resource balance performance of the Pareto optimal solution set obtained by the scheduling scheme proposed in the present invention are better than the container scheduling decisions obtained by the existing algorithms.

[0115] In order to more intuitively observe the resource occupancy and resource balance performance between the Pareto optimal solution set obtained by the scheduling scheme proposed in the present invention and the container scheduling decisions obtained by other algorithms, the Least RequestedPriority algorithm is used as a benchmark, and three container scheduling decisions with better performance are selected from the Pareto optimal solution set obtained by the scheduling scheme proposed in the present invention, and the overall resource occupancy rate and overall resource balance comparison results are obtained as shown in Table 6. It can be seen from Table 6 that in the scheduling scenario considering the dependency relationship between containers, the container scheduling decision obtained by the container scheduling scheme proposed in the present invention has significant advantages over the container scheduling decision obtained by the existing algorithm. Specifically, compared with the container scheduling decision solved by the Balanced Resource Allocation algorithm, the container scheduling decision solved by the container scheduling solution proposed by the present invention can reduce the overall resource occupancy rate by about 6.79% on average; compared with the container scheduling decision solved by the Least RequestedPriority algorithm, the container scheduling decision solved by the container scheduling solution proposed by the present invention can reduce the overall resource occupancy rate by about 4.81% on average, which shows that the scheduling solution proposed by the present invention more efficiently utilizes the dependencies between containers when executing container scheduling, and effectively reduces the overall resource occupancy rate. In addition, the container scheduling solution proposed by the present invention is also very effective in reducing the overall resource balance. Specifically, compared with the container scheduling decision solved by the Balanced Resource Allocation algorithm, the container scheduling decision solved by the container scheduling solution proposed by the present invention can reduce the overall resource balance by about 58.38% on average; compared with the container scheduling decision solved by the Least RequestedPriority algorithm, the container scheduling decision solved by the container scheduling solution proposed by the present invention can reduce the overall resource balance by about 24.13% on average. It can be seen that the container scheduling scheme proposed in the present invention effectively considers the dependencies between containers, thereby reducing the overall resource balance and overall resource occupancy, and has better container scheduling performance than existing algorithms.

[0116] Table 6

[0117]

[0118] In order to more clearly analyze the role of the scheduling scheme that considers the dependencies between containers in saving network bandwidth, the overall resource occupancy composition of the container scheduling decision solved by the Least Requested Priority algorithm, the Balanced Resource Allocation algorithm, the FirstFit greedy algorithm and the container scheduling scheme proposed in the present invention is analyzed, and the resource occupancy results shown in Table 7 are obtained. It can be seen from Table 7 that compared with the container scheduling decision solved by the Balanced Resource Allocation algorithm, the container scheduling decision solved by the container scheduling scheme proposed in the present invention has an average bandwidth saving of 29.62%; compared with the container scheduling decision solved by the Least Requested Priority algorithm, the container scheduling decision solved by the container scheduling scheme proposed in the present invention has an average bandwidth saving of 22.36%. It can be seen that after considering the dependencies between containers, the network bandwidth resource occupancy of the working node can be reduced to a large extent, thereby achieving the purpose of reducing overall resource consumption.

[0119] Table 7

[0120]

[0121]

[0122] In order to more clearly observe the overall resource occupancy of the container scheduling decisions solved by the Least Requested Priority algorithm, the Balanced ResourceAllocation algorithm, the First Fit greedy algorithm, and the container scheduling solution proposed in this invention among various working nodes, Figure 7 The overall resource occupancy of the container scheduling decision NSGA-II (3) and the Least Requested Priority algorithm, Balanced Resource Allocation algorithm, and First Fit greedy algorithm are used as examples to analyze the differences between the existing algorithms and the container scheduling solution proposed in this invention. Figure 7 (a) is the overall resource occupancy rate of each worker node for the container scheduling decision NSGA-II (3); Figure 7 (b) The overall resource occupancy rate among various working nodes for the container scheduling decision solved by the Balanced Resource Allocation algorithm; Figure 7 (c) The overall resource occupancy rate among various working nodes for the container scheduling decision solved by the First Fit greedy algorithm; Figure 7(d) is the overall resource occupancy rate of the container scheduling decision among each working node solved by the Least Requested Priority algorithm. Figure 7 It can be seen that the container scheduling decision solved by the container scheduling solution proposed in the present invention is more balanced in resource occupancy among various working nodes than the container scheduling decisions solved by the Balanced Resource Allocation algorithm, the First Fit greedy algorithm and the Least Requested Priority algorithm.

[0123] The beneficial effects of the present invention are: considering the dependencies between containers and the resource savings brought about by the dependencies, and then determining the overall resource balance and the overall resource occupancy rate according to the dependencies between containers, and using the overall resource balance and the overall resource occupancy rate as optimization goals to solve the container scheduling strategy, thereby reducing the overall resource balance and the overall resource occupancy rate, making the resource occupancy of the container scheduling decision more balanced among various working nodes.

[0124] It should be noted that although the above describes the various steps in a specific order, it does not mean that the steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order as long as the required functions can be achieved.

[0125] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.

[0126] Computer readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. Computer readable storage medium can include, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof.

[0127] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A container scheduling method applied to a container orchestration system, wherein the container orchestration system is used to schedule multiple containers so as to deploy the multiple containers to working nodes for running to implement the functions of a software system, wherein the software system includes multiple software components, each of which is encapsulated as a container, and is characterized in that: The method comprises: Step S1, obtaining dependencies between containers, wherein the dependencies between containers refer to dependencies between software components corresponding to the containers, and the dependencies between software components refer to the ability of software components to work together through data flows; Step S2: determining an overall resource balance and an overall resource occupancy rate based on the dependency relationship between the containers, wherein the overall resource balance rate indicates the degree of balance of resource loads in the container orchestration system, and the overall resource occupancy rate indicates the degree of resource occupancy in the container orchestration system; Step S3, with minimizing the overall resource balance and overall resource occupancy as the optimization goal, a preset multi-objective optimization algorithm is used to perform multiple rounds of iterative calculations to obtain a target container scheduling strategy, and the container is scheduled to the working node of the container orchestration system according to the target container scheduling strategy.

2. The method according to claim 1, characterized in that The dependencies between containers include loopback network card dependencies and shared memory dependencies. The loopback network card dependency means that two containers scheduled to the same working node can communicate using the loopback network card; the shared memory dependency means that two or more containers scheduled to the same working node can access the same memory space of the working node for communication.

3. The method according to claim 2, characterized in that In step S2, the overall resource balance is determined as follows: F(x)=f bode +f total in, in, in, Among them, F(x) represents the overall resource balance, f node Indicates the overall working node resource balance, f total Indicates the balance of cluster resources, σ i Indicates the resource balance of working node i, Indicates the CPU usage of worker node i, represents the memory usage of worker node i, represents the network bandwidth occupancy of worker node i, represents the disk usage of worker node i, v cluster represents the average resource utilization among the working nodes, L represents the number of working nodes, represents the overall mean of resource usage of worker node i, G represents the number of containers to be scheduled, τ i,j is the decision variable, τ i,j τ represents the time when container j is scheduled to work node i i,j =1, when not scheduled to working node i i,j =0, α represents the number of containers running in worker node i that can generate loopback network card dependencies with container j, μ1 represents the CPU increase ratio, represents the actual resource demand ratio of container j to CPU, β represents the number of containers running in worker node i that have a shared memory dependency with container j, and μ2 represents the memory increase ratio. represents the actual resource demand ratio of container j for memory, μ3 represents the network bandwidth saving ratio, Indicates the actual resource demand ratio of container j on the disk.

4. The method according to claim 3, characterized in that: In step S2, the overall resource occupancy rate is determined in the following manner: Among them, U(x) represents the overall resource occupancy rate.

5. The method according to claim 4, characterized in that The preset multi-objective optimization algorithm is a multi-objective optimization genetic algorithm, a particle multi-objective firefly algorithm, a non-dominated sorting whale optimization algorithm, a multi-objective jellyfish search algorithm, a multi-objective artificial hummingbird algorithm or a multi-objective particle swarm optimization algorithm.

6. The method according to claim 5, characterized in that In step S3, during each round of iterative calculation, the current round of container scheduling strategy is solved and archived with minimizing the overall resource balance and the overall resource occupancy rate as the optimization goal, and the container scheduling strategies of all rounds after multiple rounds of iterative calculation are processed according to preset rules to obtain the target container scheduling strategy, wherein each round of container scheduling strategy includes multiple container scheduling decisions.

7. The method according to claim 6, characterized in that The preset rules are: Determine the dominance relationship between all container scheduling decisions according to the overall resource balance and the overall resource occupancy rate, and sort the dominance relationship to obtain a non-dominated sorting result, wherein, when the overall resource balance and the overall resource occupancy rate of a container scheduling decision are both less than another container scheduling decision, the container scheduling decision dominates the other container scheduling decision, and the non-dominated sorting result includes multi-level sorting, each level of sorting includes one or more container scheduling decisions, and all container scheduling decisions in the previous level of sorting dominate all container scheduling decisions in the next level of sorting; Based on the non-dominated sorting result, the congestion distance of all container scheduling decisions at the same level of sorting is calculated, and each container scheduling decision is sorted in descending order according to the congestion distance to obtain the congestion distance sorting result of the non-dominated sorting result; From the non-dominated sorting results and their corresponding congestion distance sorting results, multiple container scheduling decisions that are sorted first are selected to form a target container scheduling strategy.

8. The method according to claim 7, characterized in that The congestion distance for container scheduling decisions is calculated as follows: Calculate the difference between the overall resource balance of the container scheduling decision and the previous container scheduling decision, and the difference between the overall resource balance of the container scheduling decision and the next container scheduling decision, and sum the two differences to obtain the first congestion distance; Calculate the difference between the overall resource occupancy of the container scheduling decision and the previous container scheduling decision, and the difference between the overall resource occupancy of the container scheduling decision and the next container scheduling decision, and sum the two differences to obtain the second congestion distance; The first congestion distance and the second congestion distance are summed to obtain the congestion distance for container scheduling decision.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the steps of the method according to any one of claims 1 to 8.

10. An electronic device, characterized in that: include: one or more processors; as well as A memory, wherein the memory is used to store executable instructions; The one or more processors are configured to implement the steps of the method of any one of claims 1 to 8 by executing the executable instructions.

Citation Information

Cited By

  • Management method and system for high-availability strategy engine

    CN119961771A

  • Development method of low-code micro-service architecture client unlimited extension system

    CN121301036A