Resource scheduling method and device, equipment, medium and program product
By combining genetic algorithms and ant colony algorithm in Kubernetes, the problem of unbalanced resource scheduling in the existing technology is solved, and more efficient resource utilization and load balancing are achieved.
Patent Information
- Application Number
- CN202411669905.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-18
AI Technical Summary
The existing Kubernetes resource scheduling strategy cannot fully weigh the matching degree between multiple Pods and node resources, resulting in unbalanced cluster load and the maximum number of Pods that node clusters under fixed resources can be deployed, resulting in waste of resources.
After receiving the Pod request, determine the speed of the Pod request and the task's tolerance for the creation time, create a time window and intercept the Pod request in real time. When the number of intercepted Pod requests reaches a preset number, a scheduling relationship matrix is constructed, and the optimal resource scheduling method for each Pod request to be scheduled to the node to be scheduled is determined using a combination of genetic algorithm and ant colony algorithm.
It realizes a sufficient trade-off on the matching degree between multiple Pods and node resources, improves the load balancing of the cluster, saves resources, and performs excellently in algorithm execution time.
Smart Images

Figure CN119645563A_ABST
Abstract
Description
Background Art
[0002] Kubernetes (K8S for short) is an open source container orchestration platform that automates the deployment, expansion, and management of computer containerized applications. Its purpose is to simplify the deployment and operation of containerized applications in production environments. Pod is the smallest unit that can be created and managed in a Kubernetes cluster. Node is the location where Pod is stored and is responsible for running the Pod scheduled to the node.
[0003] During the resource scheduling process, the K8S scheduler will schedule Pods to nodes and schedule resources. However, in the related technology, it is impossible to fully weigh the matching relationship between multiple Pods and node resources. Each time, only the optimal configuration of a single Pod in the node is considered, without considering the demand for various resource indicators of the subsequently created Pods, and without considering the load imbalance of the entire cluster, which leads to a decrease in the load balance in the cluster and the inability to achieve the maximum number of Pods that can be deployed in a node cluster under fixed resources, resulting in a waste of resources.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The present disclosure provides a resource scheduling method, apparatus, device, medium and program product, which can at least fully weigh the matching degree between multiple Pods and node resources and solve the problem of load imbalance in the entire cluster.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] In a first aspect, an embodiment of the present disclosure provides a resource scheduling method, the method comprising:
[0008] Based on the received container group Pod request, determine the Pod request speed and the tolerance of the task corresponding to the Pod request for creation time;
[0009] Create a time window based on the Pod request speed and the tolerance of the tasks corresponding to the Pod requests for creation time, and intercept the Pod requests in real time;
[0010] When the number of intercepted Pod requests reaches a preset number, a scheduling relationship matrix is constructed based on the intercepted Pod requests and the nodes to be scheduled in the available node queue to obtain an initialized chromosome population; wherein a chromosome represents a Pod being scheduled to a node;
[0011] Based on the initialized chromosome population, the genetic scheduling method is determined through the genetic algorithm;
[0012] According to the genetic scheduling method, the ant colony algorithm is used to determine the optimal resource scheduling method for each intercepted Pod request to be scheduled to the node to be scheduled, and respond to the intercepted Pod request.
[0013] In a possible embodiment, based on the initialization of the chromosome population, a genetic scheduling method is determined by a genetic algorithm, including:
[0014] The initial chromosome population is used as the current chromosome population of the genetic algorithm;
[0015] Determine the first heuristic function values corresponding to multiple first resource indicators when each Pod is scheduled to the node to be scheduled according to the current chromosome population;
[0016] According to the first heuristic function value, determine the fitness function value of each chromosome;
[0017] For the fitness function value of any chromosome and the fitness function value of each chromosome, determine the probability of each chromosome being selected;
[0018] Determine whether the genetic algorithm meets the first termination condition;
[0019] If yes, then end and determine the genetic scheduling method;
[0020] If not, a selection operation, a crossover operation and a mutation operation are performed according to the initialized chromosome population to obtain a new chromosome population as the current chromosome population until the genetic algorithm satisfies the first termination condition.
[0021] In a possible embodiment, the plurality of first resource indicators include at least: a central processing unit, a memory, a graphics processing unit, a neural network processing unit, a disk, and a network;
[0022] According to the initialized chromosome population, the first heuristic function values corresponding to multiple first resource indicators are determined when each Pod is scheduled to the node to be scheduled, including:
[0023] For any first resource indicator, according to the initialized chromosome population, determine the utilization rate of any first resource indicator corresponding to each node to be scheduled when each Pod is scheduled to the node to be scheduled, and the average utilization rate of all nodes to be scheduled corresponding to any first resource indicator;
[0024] Determine the utilization standard deviation of any first resource indicator according to the utilization and average utilization of any first resource indicator corresponding to each node to be scheduled, and obtain the utilization standard deviation of each first resource indicator;
[0025] According to the utilization standard deviation of each first resource indicator, first heuristic function values corresponding to the plurality of first resource indicators are determined.
[0026] In a possible embodiment, determining the genetic scheduling method includes:
[0027] According to the probability of each chromosome being selected and the target chromosome whose fitness function value is ranked before the preset position, the chromosome population output of the genetic algorithm is obtained;
[0028] Determine the genetic scheduling method based on the chromosome population output.
[0029] In a possible embodiment, according to the genetic scheduling method, an ant colony algorithm is used to determine the optimal resource scheduling method for scheduling each intercepted Pod request to the node to be scheduled, including:
[0030] According to the genetic scheduling method, it is converted into the initialization pheromone concentration, and the initialization pheromone concentration is used as the current pheromone concentration;
[0031] Determine the second heuristic function values corresponding to the multiple first resource indicators when each Pod is scheduled to the node to be scheduled;
[0032] Determine the probability of the ant colony selecting a node to be scheduled for each Pod based on the set of unscheduled Pods, the value of the second heuristic function, the initial pheromone concentration, and the importance of the pre-set pheromone concentration and the importance of the heuristic function;
[0033] According to the selection probability, a node to be scheduled is selected for each Pod until all Pods and nodes to be scheduled are scheduled, and the ant colony scheduling method is obtained;
[0034] Determine whether the ant colony algorithm meets the second termination condition;
[0035] If so, determine the optimal resource scheduling method;
[0036] If not, the updated pheromone concentration is determined according to the ant colony scheduling method as the current pheromone concentration until the ant colony algorithm satisfies the second termination condition.
[0037] In a possible embodiment, determining the updated pheromone concentration according to the ant colony scheduling method includes:
[0038] According to the ant colony scheduling method, after each Pod is scheduled to the node to be scheduled, the load balance and load ranking of the node to be scheduled are determined;
[0039] According to the load balance degree and load ranking, the increment of pheromone concentration is determined; wherein, the higher the load ranking, the higher the pheromone concentration released;
[0040] The updated pheromone concentration is determined according to the increment of the pheromone concentration and the initialization pheromone concentration.
[0041] In a possible embodiment, determining the Pod request speed according to the received Pod request includes:
[0042] Based on the Pod request, a resource query request is sent for a second resource indicator that the container orchestration platform cannot perceive;
[0043] receiving a feedback response of the second resource indicator and determining a response time;
[0044] Get the task level of the task corresponding to the Pod request;
[0045] Determine the Pod request rate based on response time and task level.
[0046] In a possible embodiment, determining, according to the received Pod request, the tolerance of the task corresponding to the Pod for the creation time includes:
[0047] Determine the creation time tolerance of the task corresponding to the Pod request based on the task type of the task corresponding to the Pod request.
[0048] In a second aspect, an embodiment of the present disclosure provides a resource scheduling device, including:
[0049] A determination unit, used to determine the Pod request speed and the tolerance of the task corresponding to the Pod request to the creation time according to the received container group Pod request;
[0050] The real-time interception unit is used to create a time window and intercept Pod requests in real time according to the Pod request speed and the tolerance of the task corresponding to the Pod request for creation time;
[0051] An initialization unit, which is used to construct a scheduling relationship matrix according to the intercepted Pod requests and the nodes to be scheduled in the available node queue when the number of intercepted Pod requests reaches a preset number, and obtain an initialized chromosome population; wherein the chromosome represents that a Pod is scheduled to a node;
[0052] The first scheduling unit is used to determine a genetic scheduling method through a genetic algorithm based on an initialized chromosome population;
[0053] The second scheduling unit is used to determine the optimal resource scheduling method for scheduling each intercepted Pod request to the node to be scheduled through the ant colony algorithm according to the genetic scheduling method, and respond to the intercepted Pod request.
[0054] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the method in the first aspect above by executing the executable instructions.
[0055] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method in the first aspect described above is implemented.
[0056] In a fifth aspect, according to another aspect of the present disclosure, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs any of the above methods.
[0057] The embodiments of the present disclosure provide a resource scheduling method, device, equipment, medium and program product, the method comprising: determining the Pod request speed and the tolerance of the task corresponding to the Pod request to the creation time according to the received Pod request, creating a time window according to the Pod request speed and the tolerance of the task corresponding to the Pod request to the creation time, and intercepting the Pod request in real time. When the number of intercepted Pod requests reaches a preset number, a scheduling relationship matrix is constructed according to the intercepted Pod request and the nodes to be scheduled in the available node queue to obtain an initialized chromosome population; wherein the chromosome represents that a Pod is scheduled to a node, based on the initialized chromosome population, a genetic scheduling method is determined by a genetic algorithm, and according to the genetic scheduling method, an ant colony algorithm is used to determine the optimal resource scheduling method for each intercepted Pod request to be scheduled to the node to be scheduled, and respond to the intercepted Pod request. Through the above method, the Pod request can be intercepted in real time, and a certain number of Pods and nodes in the time window are optimally matched. And by combining the genetic algorithm and the ant colony algorithm, the combination of global search and refined search is realized to achieve global load balancing.
[0058] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0060] Figure 1 A schematic diagram showing the structure of a resource scheduling system in an embodiment of the present disclosure is shown;
[0061] Figure 2 A flow chart of a resource scheduling method according to an embodiment of the present disclosure is shown;
[0062] Figure 3 A flowchart of a genetic algorithm scheduling process in an embodiment of the present disclosure is shown;
[0063] Figure 4 A flow chart of determining a heuristic function value in an embodiment of the present disclosure is shown;
[0064] Figure 5 A flow chart showing an optimal resource scheduling method in an embodiment of the present disclosure is shown;
[0065] Figure 6 A flow chart of updating pheromone concentration in an embodiment of the present disclosure is shown;
[0066] Figure 7 A flowchart of another method for determining an optimal resource scheduling method in an embodiment of the present disclosure is shown;
[0067] Figure 8 One of the schematic diagrams showing a scheduling method in an embodiment of the present disclosure;
[0068] Fig. 9 A second schematic diagram showing a scheduling method in an embodiment of the present disclosure is shown;
[0069] Fig.10 A schematic diagram showing the structure of a resource scheduling device in an embodiment of the present disclosure is shown;
[0070] Fig.11 A schematic structural diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0071] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0072] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0073] Explanation of the terms in this disclosure:
[0074] Kubernetes (K8S for short): is an open source container orchestration platform used to automate the deployment, expansion, and management of computer containerized applications. Its purpose is to simplify the deployment and operation of containerized applications in production environments.
[0075] Pod: It can be called a container group or container instance. It is the smallest unit that can be created and managed in a Kubernetes cluster, and it is also the smallest unit for resource scheduling. Multiple containers can run in a Pod. Containers running in the same Pod share the central processing unit (CPU), storage and other resources in the Pod. Pod is a disposable entity that is destroyed after use. Pod is not a process, but the environment required for the container (Docker) to run.
[0076] Node: A node is a place where Pods are stored and is responsible for running the Pods scheduled to the Node. Each Kubernetes cluster has several Nodes. If a Node fails, the master node will schedule all Pods on the Node to other nodes that are working normally.
[0077] Graphics Processing Unit (GPU): Originally used to accelerate image and video rendering, it is now also widely used in fields such as parallel computing and deep learning.
[0078] Neural Processing Unit (NPU): Designed specifically to accelerate neural network computing.
[0079] Disk: A medium used to permanently store data, including traditional mechanical hard disks (HDDs) and solid-state drives (SSDs).
[0080] Network (NET): refers to the network connection capabilities of the server, including the network card, network interface card (NIC), and network bandwidth.
[0081] In the related technology, the default resource scheduling strategy of K8s is mainly divided into the pre-selection stage and the optimization stage, and some commonly used default scheduling algorithms are provided in these two different stages.
[0082] The pre-selection stage is when selecting a suitable node for the pod to be scheduled. Some inappropriate nodes will be filtered out through some filtering conditions of the pod to be scheduled, and all the nodes that pass the screening will be collected into a candidate node list.
[0083] The optimization stage is to take all the pods that have passed the pre-selection stage, and then score each node according to some optimization algorithms and the corresponding weights of the algorithms, and finally select the node with the highest score as the deployment location of the pod to be scheduled. In other words, the default scheduling algorithm selects the most suitable Node node from the available node queue for each pod in turn through a certain scheduling strategy for scheduling.
[0084] The default K8s scheduler provides a variety of optimal scheduling algorithms, which can be roughly divided into two types. One is to try to schedule pods to nodes with relatively free CPU and memory resources. The other is to avoid load imbalance and prevent the occurrence of CPU and memory load imbalance on nodes. The default resource scheduling algorithm provided by the existing K8s pays more attention to execution efficiency, but pays less attention to the load balancing of the entire cluster, and cannot fully weigh the relationship between the matching degree of multiple pods and Node node resources. In addition, pods do not always exist and will be destroyed. With the destruction of some pods and the large changes in actual resource usage caused by business changes, it is easy to cause cluster load imbalance. The default scheduling method only supports static initial resource scheduling, and cannot implement dynamic scheduling according to the operation of the cluster, resulting in the inability to release some performance.
[0085] K8s provides a pluggable custom algorithm framework, and users can easily formulate their own resource scheduling algorithms according to their needs. The disclosed embodiment provides a resource scheduling method, which includes: determining the pod request speed and the tolerance of the task corresponding to the pod request to the creation time, creating a time window, and intercepting the pod request in real time, constructing a scheduling relationship matrix according to the intercepted pod request and the node to be scheduled, and obtaining the initialization chromosome population. The chromosome indicates that a pod is scheduled to a node. Based on the initialization chromosome population, the genetic scheduling method is determined by the genetic algorithm, and then the optimal resource scheduling method for each intercepted Pod request to be scheduled to the node to be scheduled is determined by the ant colony algorithm, and the intercepted pod request is responded to. Through the time window, a certain number of Pods are intercepted in real time and optimally matched with the node. Each time the scheduling is performed, the pod is optimally matched with the node according to the current situation, and the genetic algorithm and the ant colony algorithm are combined to realize the combination of global search and refined search, and realize global load balancing.
[0086] The resource scheduling method in the present disclosure can be applied to electronic devices, and can also be applied to resource scheduling systems.
[0087] Figure 1 A schematic diagram of the structure of a resource scheduling system that can be applied to an embodiment of the present disclosure is shown.
[0088] like Figure 1 As shown, the resource scheduling system 100 may include: a control plane 101 , a scheduler 102 , a distributed key-value storage system 103 and an application programming interface server 104 .
[0089] The control plane 101 is responsible for the management, scheduling, and coordination of the entire cluster.
[0090] After the scheduler 102 determines the optimal resource scheduling method, it persists the binding information of the Pod and Node nodes in the distributed key-value storage system (etcd) 103.
[0091] The distributed key-value storage system (etcd) 103 is a distributed key-value storage system for storing data of all clusters.
[0092] The application programming interface server 104 provides a unified interface for interacting with the cluster.
[0093] In a possible embodiment, the scheduler 102 is used to: determine the Pod request speed and the tolerance of the task corresponding to the Pod request to the creation time based on the received container group Pod request, create a time window based on the Pod request speed and the tolerance of the task corresponding to the Pod request to the creation time, and intercept the Pod request in real time. When the number of intercepted Pod requests reaches a preset number, a scheduling relationship matrix is constructed based on the intercepted Pod requests and the nodes to be scheduled in the available node queue to obtain an initialized chromosome population; wherein the chromosome represents a Pod scheduled to a node, and based on the initialized chromosome population, a genetic scheduling method is determined through a genetic algorithm, and based on the genetic scheduling method, an ant colony algorithm is used to determine the optimal resource scheduling method for each intercepted Pod request to be scheduled to the node to be scheduled, and the intercepted Pod request is responded to.
[0094] The present exemplary implementation is described in detail below with reference to the accompanying drawings and embodiments.
[0095] First, an embodiment of the present disclosure provides a resource scheduling method, which can be executed by the scheduler 102.
[0096] Figure 2 A flow chart of a resource scheduling method in an embodiment of the present disclosure is shown as follows: Figure 2 As shown, the resource scheduling method provided in the embodiment of the present disclosure includes the following steps:
[0097] S202: Determine the Pod request speed and the tolerance of the task corresponding to the Pod request to the creation time according to the received container group Pod request.
[0098] S204: Create a time window according to the Pod request speed and the tolerance of the task corresponding to the Pod request for creation time, and intercept the Pod request in real time.
[0099] After receiving the Pod request, you need to create a time window to intercept the Pod request. The size of the time window can be determined based on the order in which the Pod requests are created, the speed of the Pod requests, and the Pod's tolerance for time.
[0100] Among them, Pod request speed refers to the response time of the K8s cluster to the Pod request, as well as the task level.
[0101] The tolerance of the task corresponding to the Pod request to the creation time actually refers to the user's tolerance to the response time of the task corresponding to the Pod request.
[0102] In a possible embodiment, the method of determining the Pod request speed is not limited to this, and may also include other methods, which may be shown in the following embodiment: based on the Pod request, a resource query request is sent to a second resource indicator that the container orchestration platform cannot perceive, a feedback response to the second resource indicator is received, a response time is determined, a task level of the task corresponding to the Pod request is obtained, and the Pod request speed is determined according to the response time and the task level.
[0103] For example, when a K8s cluster creates a Pod, it is aware of resources such as the CPU, but it is not aware of some resources such as the GPU. K8s needs to send a resource query request to determine whether there are available resources to create a Pod to respond to this Pod request. The time from issuing a resource query request to receiving a feedback response is called the response time. During this time, a Pod cannot be created. This response time can be used as the basis for creating a time window.
[0104] For example, some resources, such as GPU, are scarce resources and need to be preempted through preemption strategies to a certain extent. Not all Pod requests can be directly applied for. GPU prioritizes allocating resources to Pod requests corresponding to tasks with high task levels. Therefore, when creating a Pod, you also need to obtain the task level of the task corresponding to the Pod request. If the task level is low, the corresponding GPU resources cannot be requested, and the waiting time is long, and the size of the created time window is large. If the task level is high, the corresponding GPU resources are requested, and the waiting time is short, and the size of the created time window is small.
[0105] In a possible embodiment, the method of determining the tolerance of the task corresponding to the Pod to the creation time is not limited to this, and may also include other methods, which may be shown in the following embodiment:
[0106] Determine the creation time tolerance of the task corresponding to the Pod request based on the task type of the task corresponding to the Pod request.
[0107] For example, if the task type of the task corresponding to the Pod request is a millisecond-level task, the tolerance for the creation time is very low, the creation time is short, and the size of the time window needs to be very small, or even cannot be intercepted.
[0108] For example, if the task type of the task corresponding to the Pod request is a second-level task, the size of the created time window can be set to milliseconds, for example, a dialog-type task.
[0109] For example, if the task type of the task corresponding to the Pod request is a minute-level task, the size of the created time window can be set to minutes, such as a task of photo editing or a task of video generation.
[0110] The above is merely an exemplary statement, and the method for determining the Pod request speed and the tolerance of the task corresponding to the Pod request to the creation time is not limited to this.
[0111] S206: When the number of intercepted Pod requests reaches a preset number, a scheduling relationship matrix is constructed according to the intercepted Pod requests and the nodes to be scheduled in the available node queue to obtain an initialized chromosome population, wherein a chromosome represents a Pod scheduled to a node.
[0112] In a possible embodiment, the intercepted Pod request can be represented by a set, and the Pod set is represented as P = {Pod1, Pod2, Pod3, ..., Pod n}, the corresponding available node queue to be scheduled nodes can also be represented by a set, where the set of nodes to be scheduled is represented by M = {Node1, Node2, Node3, ..., Node m}, and store the mapping relationship between Pod and Node in the relationship matrix X. The mapping relationship matrix is expressed as:
[0113]
[0114] Chromosome encoding: Decimal encoding is used. The chromosome has n bits, n represents the number of Pods to be scheduled, and the value of each position in the chromosome is 1 to m, where m represents the number of nodes to be scheduled in the cluster. The meaning of each value of the chromosome indicates that the Pod with the corresponding number will be scheduled to the node with the corresponding number of its chromosome value. For example, x 11 Indicates that Pod1 is scheduled to Node1.
[0115] S208: Based on the initialized chromosome population, determine the genetic scheduling method through a genetic algorithm.
[0116] S210: According to the genetic scheduling method, an optimal resource scheduling method for scheduling each intercepted Pod request to the node to be scheduled is determined by an ant colony algorithm, and the intercepted Pod request is responded to.
[0117] In a possible embodiment, during the scheduling process using the genetic algorithm and the ant colony algorithm, the parameters of the genetic algorithm and the ant colony algorithm can be initialized, and the population size, crossover probability, mutation probability, pheromone concentration importance, heuristic function importance, constants for calculating heuristic functions, pheromone volatility coefficients and the number of ants, as well as the minimum and maximum number of iterations of the algorithm can be set. The above is a process of setting parameters, which will not be repeated in the embodiments of the present disclosure.
[0118] Through the above method, in the process of scheduling, the time window is introduced, the Pod can be intercepted in real time and a certain number of Pods can be optimally matched with the nodes to be scheduled, so that the maximum number of Pods that can be deployed in the node cluster under fixed resources can be achieved, the load balance of the entire cluster can be improved, and resources can be saved. In addition, the algorithm execution time is also an important indicator for measuring the excellent performance of the algorithm. Users often have a certain tolerance for the execution time of an algorithm. The embodiment of the present disclosure considers both the resource scheduling time and the load balance of the cluster after resource scheduling. By integrating the genetic algorithm with the ant colony algorithm, the combination of global search and refined search can be achieved, which can reduce the algorithm execution time, and is significantly better than using a single algorithm in terms of algorithm execution time.
[0119] In the process of scheduling through genetic algorithm, the evaluation criteria for different resource indicators can be constructed through heuristic functions. Through the heuristic function, multiple different first resource indicators are taken into consideration in the process of scheduling through genetic algorithm, which can improve the effect of cluster load balancing.
[0120] This disclosure shows an embodiment of step S208. Figure 3 A flowchart of a genetic algorithm scheduling process in an embodiment of the present disclosure is shown. Figure 3 As shown, the following steps are included:
[0121] S302: Using the initial chromosome population as the current chromosome population of the genetic algorithm.
[0122] S304: Determine, according to the current chromosome population, first heuristic function values corresponding to multiple first resource indicators when each Pod is scheduled to the node to be scheduled.
[0123] In the embodiment shown in the present disclosure, during the scheduling process, it is not limited to considering the usage of two resources, CPU and memory. Considering only two resources, CPU and memory, will lead to inaccurate selection of scheduling nodes.
[0124] In a possible embodiment, the various first resource indicators in the embodiment of the present disclosure include at least: a central processing unit, a memory, a graphics processing unit, a neural network processing unit, a disk, and a network. In addition to considering the two resources of CPU and memory, the usage of various other resources is also considered. The first resource indicators shown are only examples and may include more than the above examples.
[0125] Figure 4 A flow chart of determining a heuristic function value in an embodiment of the present disclosure is shown, Figure 4 As shown, the following steps are included:
[0126] S402: For any first resource indicator, determine, based on the initialized chromosome population, when each Pod is scheduled to the node to be scheduled, the utilization rate of any first resource indicator corresponding to each node to be scheduled, and the average utilization rate of all nodes to be scheduled corresponding to any first resource indicator.
[0127] S404: Determine a utilization standard deviation of any first resource indicator according to the utilization and average utilization of any first resource indicator corresponding to each to-be-scheduled node, and obtain a utilization standard deviation of each first resource indicator.
[0128] In a possible embodiment, taking the first resource indicator of CPU as an example, the standard deviation of CPU utilization can be determined by the following formula (1), as shown below:
[0129]
[0130] Among them, cpu1 represents the CPU utilization rate on the node to be scheduled, Node1, when podi is scheduled to the node to be scheduled, Nodej; Indicates the average CPU utilization of all Node to be scheduled in the entire cluster when podi is scheduled to Nodej.
[0131] CPU std Indicates the standard deviation of CPU utilization on all nodes to be scheduled in the entire cluster when podi is scheduled to Nodej.
[0132] S406: Determine first heuristic function values corresponding to the plurality of first resource indicators according to the utilization standard deviation of each first resource indicator.
[0133] In a possible embodiment, taking the first resource indicator including: central processing unit, graphics processing unit, neural network processing unit, disk and network as an example, the first heuristic function value can be determined by the following formula (2), as shown below:
[0134]
[0135] Among them, GPU std Indicates the standard deviation of GPU utilization; Disk std Indicates the standard deviation of disk utilization; NPU std Represents the standard deviation of the utilization of the neural network processing unit; NET std represents the standard deviation of network utilization; Q is a constant; η ij (t) represents the first heuristic function value.
[0136] Through the above method, the types of resources considered by the scheduling algorithm in the optimization stage are fully considered, and resources such as graphics processing units, neural network processing units, disk IO and networks are included in the scope of matching between the nodes to be scheduled and the Pod scheduling. The node scheduling is refined to provide a basis for subsequent resource scheduling.
[0137] S306: Determine the fitness function value of each chromosome according to the first heuristic function value.
[0138] S308: For the fitness function value of any chromosome and the fitness function value of each chromosome, determine the probability of each chromosome being selected.
[0139] In a possible embodiment, the probability of each chromosome being selected can be determined by the following formula (3), as shown below:
[0140]
[0141] Among them, f(x i ) represents the fitness function value of chromosome i. The fitness function is used to evaluate the quality of chromosomes. The larger the fitness function value, the more suitable the chromosome is to survive to the next generation, which means that its scheduling plan is better.
[0142] Represents the sum of the fitness function values of all chromosomes.
[0143] x represents the independent variable of the usage of different first resource indicators in the fitness function.
[0144] By η ij The load balancing degree represented by (t) is used as the fitness function. The probability of each chromosome being selected is proportional to its fitness. The probability of each chromosome being selected P is obtained in turn. i .
[0145] S310: Determine whether the genetic algorithm satisfies the first termination condition; if so, execute S314; if not, execute S312.
[0146] S312: Perform selection operation, crossover operation and mutation operation according to the initialized chromosome population to obtain a new chromosome population as the current chromosome population, and return to execute S304.
[0147] In a possible embodiment, the selection operation is to use a method combining direct replication of the best individual and roulette wheel to ensure that the worst chromosome also has a certain probability of being selected into the next generation.
[0148] Crossover operation: Generate new chromosomes. The larger the crossover probability, the larger the search range of the solution space will be, destroying the high fitness chromosome structure. The smaller the crossover probability, the faster it will converge to the local optimal solution. The crossover probability can be selected in the range of 0.3-0.9. By way of example, 0.6 is used as the crossover probability in the embodiment of the present disclosure.
[0149] Mutation operation: If the mutation probability is too large, it is easy to find the global optimal solution, but it tends to be a random search, which makes it difficult for the algorithm to converge. The mutation probability can be set to be lower than 0.2. Exemplarily, the mutation probability is 0.1 in the embodiment of the present disclosure.
[0150] S314: Determine the genetic scheduling method.
[0151] In a possible embodiment, after determining whether the genetic algorithm satisfies the first termination condition, the method for determining the genetic scheduling method may include: obtaining the chromosome population output of the genetic algorithm based on the probability of each chromosome being selected and the target chromosome whose fitness function value is ranked before a preset position, and determining the genetic scheduling method based on the chromosome population output.
[0152] This disclosure shows an embodiment of step S210. Figure 5 A flowchart of an optimal resource scheduling method in an embodiment of the present disclosure is shown. Figure 5 As shown, the following steps are included:
[0153] S502: Converting into an initialization pheromone concentration according to the genetic scheduling method, and using the initialization pheromone concentration as the current pheromone concentration.
[0154] In a possible embodiment, the genetic scheduling method can be directly converted into initialization information for the scheduling process of the ant colony algorithm.
[0155] In a possible embodiment, a method combining a genetic algorithm and an ant colony algorithm is used to achieve a combination of global search and refined search, thereby avoiding falling into a local optimal solution. In order to prevent the ant colony algorithm from falling into a local optimal solution too early and facilitate the ant colony algorithm to conduct a more fair and extensive search for the optimal resource scheduling method in the early stage, the initial pheromone concentration can be set to the same value, that is, when the ants start searching, each Node node has the same attraction to the Pod.
[0156] S504: Determine second heuristic function values corresponding to multiple first resource indicators when each Pod is scheduled to the node to be scheduled.
[0157] In a possible embodiment, the manner of determining the heuristic function value is not further described.
[0158] The heuristic function determines the optimization ability of the ant colony algorithm to a large extent. At the same time, the heuristic function can also be used to determine the degree of importance the ant colony algorithm attaches to the optimization goal. That is, in different business scenarios, there are different optimization goals, and the heuristic function will also be different. The heuristic function can improve the cluster load balancing effect when the ant colony algorithm is looking for the optimal resource scheduling method.
[0159] S506: Determine the selection probability of the ant colony selecting a node to be scheduled for each Pod based on the unscheduled Pod set, the second heuristic function value, the current pheromone concentration, and the importance of the preset pheromone concentration and the importance of the heuristic function.
[0160] In a possible embodiment, the selection probability of the ant colony selecting a node to be scheduled for each Pod can be determined by formula (4), and formula (4) is as follows:
[0161]
[0162] Among them, t represents time t, i represents podi, j represents nodej to be scheduled, represents the probability of ant k selecting nodej to be scheduled for podi at time t; τ ij (t) represents the pheromone concentration, η ij (t) represents the value of the second heuristic function, which can also be understood as the expected function. k represents the set of pods that are not scheduled by ant k, α represents the importance of pheromone concentration, and β represents the importance of the second heuristic function.
[0163] After determining the selection probability of the ant colony selecting the node to be scheduled for each Pod, a roulette wheel is used to determine the Node node to which each Pod will be scheduled based on the selection probability of the ant colony selecting the node to be scheduled for each Pod.
[0164] S508: Select a node to be scheduled for each Pod according to the selection probability until all Pods and nodes to be scheduled are scheduled, and an ant colony scheduling method is obtained.
[0165] S510: Determine whether the ant colony algorithm satisfies the second termination condition; if so, execute S514; if not, execute S512.
[0166] S512: According to the ant colony scheduling method, determine the updated pheromone concentration as the current pheromone concentration, and return to execute S504.
[0167] S514: Determine the optimal resource scheduling method.
[0168] In a possible embodiment, when updating the pheromone concentration, the scheduling method of each ant calculates the load balance and ranking to determine the increase in the pheromone concentration to be updated by the ant, thereby increasing the effect of cluster load balance.
[0169] Figure 6 A flow chart of updating pheromone concentration in an embodiment of the present disclosure is shown. Figure 6 As shown, the following steps are included:
[0170] S602: Determine the load balance and load ranking of the node to be scheduled after each Pod is scheduled to the node to be scheduled according to the ant colony scheduling method.
[0171] S604: Determine the increment of pheromone concentration according to the load balance degree and the load ranking, wherein the higher the load ranking, the higher the released pheromone concentration.
[0172] S606: Determine the updated pheromone concentration according to the increment of the pheromone concentration and the initialization pheromone concentration.
[0173] Through the above method, the reward and punishment strategy that can be adopted in the embodiment of the present disclosure is: the pheromone concentration release amount is calculated by using a linear function balanced decline method, that is, the ant with the highest load balancing ranking will release the full pheromone concentration, and the ant with the lowest load balancing ranking will release a pheromone concentration of 0.
[0174] In a possible embodiment, after obtaining the initialized chromosome population, Figure 7 A flowchart of another method for determining optimal resource scheduling in an embodiment of the present disclosure is shown. Figure 7 As shown, the following steps are included:
[0175] S702: Using the initial chromosome population as the current chromosome population of the genetic algorithm.
[0176] S704: Determine, based on the current chromosome population, first heuristic function values corresponding to multiple first resource indicators when each Pod is scheduled to the node to be scheduled, where the multiple first resource indicators include at least: central processing unit, memory, graphics processing unit, neural network processing unit, disk, and network.
[0177] S706: Determine the fitness function value of each chromosome according to the first heuristic function value.
[0178] S708: For the fitness function value of any chromosome and the fitness function value of each chromosome, determine the probability of each chromosome being selected.
[0179] S710: Determine whether the genetic algorithm satisfies the first termination condition; if so, execute S714; if not, execute S712.
[0180] S712: Perform selection operation, crossover operation and mutation operation according to the initialized chromosome population to obtain a new chromosome population as the current chromosome population, and return to execute S704.
[0181] S714: Determine the genetic scheduling method.
[0182] S716: Convert the initialization pheromone concentration according to the genetic scheduling method, and use the initialization pheromone concentration as the current pheromone concentration.
[0183] S718: Determine second heuristic function values corresponding to multiple first resource indicators when each Pod is scheduled to the node to be scheduled.
[0184] S720: Determine the selection probability of the ant colony selecting a node to be scheduled for each Pod based on the unscheduled Pod set, the second heuristic function value, the current pheromone concentration, and the importance of the preset pheromone concentration and the importance of the heuristic function.
[0185] S722: Select a node to be scheduled for each Pod according to the selection probability until all Pods and nodes to be scheduled are scheduled, and an ant colony scheduling method is obtained.
[0186] S724: Determine whether the ant colony algorithm satisfies the second termination condition; if so, execute S728; if not, execute S726.
[0187] S726: According to the ant colony scheduling method, determine the updated pheromone concentration as the current pheromone concentration, and return to execute S718.
[0188] S728: Determine the optimal resource scheduling method.
[0189] In the related technology, there are the following problems: not only does it not take into account the usage of multiple resource indicators, but the degree of refinement is not enough, and the default optimization strategy is to perform optimization scoring based on the remaining resources of the node. However, considering the differences in node configurations, the remaining resources of high-configuration nodes are often more abundant than the remaining resources of low-configuration nodes. As a result, when the actual resource utilization rate of some low-configuration nodes in the cluster is far lower than the standard applied by the Pod's Yaml file, no more Pods are scheduled, resulting in a relatively large waste of resources. In fact, the resource utilization rate of some other high-configuration nodes in the cluster is overloaded, but because the configuration is too high, the scheduler cannot perceive it and continues to schedule Pods, causing cluster load imbalance problems and affecting the overall service capabilities of the cluster.
[0190] The embodiment of the present disclosure shows a schematic diagram of a scheduling process, which is divided into two figures for easy viewing, as shown in FIG. Figure 8 and Fig. 9 As shown, they include Pod1-6 and nodes Node1-3 respectively.
[0191] Through the above method, by using heuristic functions and considering the usage of multiple first resource indicators, and combining genetic algorithms and ant colony algorithms, it is possible to achieve a combination of global search and refined search, and optimally match each node to be scheduled with the Pod, thereby fully improving the load balancing degree of the entire cluster.
[0192] Based on the same inventive concept, the present disclosure also provides a resource scheduling device, such as the following embodiment. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0193] Fig.10 A schematic diagram of the structure of a resource scheduling device in an embodiment of the present disclosure is shown. Fig.10 As shown, the resource scheduling device 100 includes: a determination unit 1001, which is used to determine the Pod request speed and the tolerance of the task corresponding to the Pod request to the creation time according to the received container group Pod request, a real-time interception unit 1002, which is used to create a time window according to the Pod request speed and the tolerance of the task corresponding to the Pod request to the creation time, and intercept the Pod request in real time, an initialization unit 1003, which is used to construct a scheduling relationship matrix according to the intercepted Pod requests and the nodes to be scheduled in the available node queue when the number of intercepted Pod requests reaches a preset number, and obtain an initialized chromosome population; wherein the chromosome represents a Pod scheduled to a node, a first scheduling unit 1004, which is used to determine a genetic scheduling method based on the initialized chromosome population through a genetic algorithm, and a second scheduling unit 1005, which is used to determine the optimal resource scheduling method for each intercepted Pod request to be scheduled to the node to be scheduled through an ant colony algorithm according to the genetic scheduling method, and respond to the intercepted Pod request.
[0194] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0195] Refer to the following Fig.11 1100 according to this embodiment of the present disclosure is described. Fig.11 The electronic device 1100 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0196] like Fig.11 As shown, the electronic device 1100 is in the form of a general computing device. The components of the electronic device 1100 may include but are not limited to: at least one processing unit 1110, at least one storage unit 1120, and a bus 1130 connecting different system components (including the storage unit 1120 and the processing unit 1110).
[0197] The storage unit stores program codes, which can be executed by the processing unit 1110, so that the processing unit 1110 executes the steps of various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 1110 can execute the steps of any one of the above method embodiments.
[0198] The storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 11201 and / or a cache storage unit 11202 , and may further include a read-only storage unit (ROM) 11203 .
[0199] The storage unit 1120 may also include a program / utility 11204 having a set (at least one) of program modules 11205, such program modules 11205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0200] Bus 1130 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0201] The electronic device 1100 may also communicate with one or more external devices 1140 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1100, and / or communicate with any device that enables the electronic device 1100 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1150. Furthermore, the electronic device 1100 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1160. As shown, the network adapter 1160 communicates with other modules of the electronic device 1100 via a bus 1130. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0202] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0203] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method in the above embodiment.
[0204] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.
[0205] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, 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), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0206] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0207] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0208] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0209] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0210] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0211] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0212] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A resource scheduling method, characterized in that: The method comprises: Based on the received container group Pod request, determine the Pod request speed and the tolerance of the task corresponding to the Pod request for creation time; According to the Pod request speed and the tolerance of the task corresponding to the Pod request for creation time, a time window is created, and the Pod request is intercepted in real time; When the number of the intercepted Pod requests reaches a preset number, a scheduling relationship matrix is constructed according to the intercepted Pod requests and the nodes to be scheduled in the available node queue to obtain an initialized chromosome population; wherein the chromosome represents that a Pod is scheduled to a node; Based on the initialized chromosome population, determining a genetic scheduling method through a genetic algorithm; According to the genetic scheduling method, an optimal resource scheduling method for scheduling each intercepted Pod request to a to-be-scheduled node is determined by an ant colony algorithm, and the intercepted Pod request is responded to.
2. The method according to claim 1, characterized in that The step of determining a genetic scheduling method based on the initialized chromosome population through a genetic algorithm includes: Using the initial chromosome population as the current chromosome population of the genetic algorithm; Determine, according to the current chromosome population, first heuristic function values corresponding to multiple first resource indicators when each Pod is scheduled to the node to be scheduled; Determining the fitness function value of each chromosome according to the first heuristic function value; Determine the probability of each chromosome being selected for the fitness function value of any chromosome and the fitness function value of each chromosome; Determining whether the genetic algorithm satisfies a first termination condition; If yes, then end and determine the genetic scheduling method; If not, a selection operation, a crossover operation and a mutation operation are performed according to the initialized chromosome population to obtain a new chromosome population as the current chromosome population until the genetic algorithm satisfies the first termination condition.
3. The method according to claim 2, characterized in that The multiple first resource indicators include at least: a central processing unit, a memory, a graphics processing unit, a neural network processing unit, a disk, and a network; The first heuristic function values corresponding to the multiple first resource indicators when each Pod is scheduled to the node to be scheduled according to the initialized chromosome population include: For any first resource indicator, according to the initialized chromosome population, determine the utilization rate of any first resource indicator corresponding to each node to be scheduled and the average utilization rate of all nodes to be scheduled corresponding to any first resource indicator when each Pod is scheduled to the node to be scheduled; Determine the utilization standard deviation of any one of the first resource indicators according to the utilization rate of each to-be-scheduled node and the average utilization rate, and obtain the utilization standard deviation of each first resource indicator; The first heuristic function values corresponding to the plurality of first resource indicators are determined according to the utilization standard deviation of each first resource indicator.
4. The method according to claim 1 or 2, characterized in that: Determine the genetic scheduling method, including: According to the probability of each chromosome being selected and the target chromosome whose fitness function value is ranked before the preset position, the chromosome population output of the genetic algorithm is obtained; A genetic scheduling method is determined according to the chromosome population output.
5. The method according to claim 1, characterized in that: The method of determining the optimal resource scheduling mode for scheduling each intercepted Pod request to the node to be scheduled by an ant colony algorithm according to the genetic scheduling mode includes: Converting the genetic scheduling method into an initialization pheromone concentration, and using the initialization pheromone concentration as the current pheromone concentration; Determine the second heuristic function values corresponding to the multiple first resource indicators when each Pod is scheduled to the node to be scheduled; Determine the selection probability of the ant colony selecting a node to be scheduled for each Pod according to the unscheduled Pod set, the second heuristic function value, the initialization pheromone concentration, and the importance of the preset pheromone concentration and the importance of the heuristic function; According to the selection probability, a node to be scheduled is selected for each Pod until all Pods and nodes to be scheduled are scheduled, thereby obtaining an ant colony scheduling method; Determining whether the ant colony algorithm satisfies a second termination condition; If yes, determining the optimal resource scheduling method; If not, the updated pheromone concentration is determined according to the ant colony scheduling method as the current pheromone concentration until the ant colony algorithm satisfies the second termination condition.
6. The method according to claim 5, characterized in that According to the ant colony scheduling method, the updated pheromone concentration is determined, including: Determine, according to the ant colony scheduling method, the load balancing degree and load ranking of the node to be scheduled after each Pod is scheduled to the node to be scheduled; Determining the increment of pheromone concentration according to the load balance degree and load ranking; wherein the higher the load ranking, the higher the released pheromone concentration; An updated pheromone concentration is determined according to the increment of the pheromone concentration and the initialization pheromone concentration.
7. The method according to claim 1, characterized in that Determine the Pod request rate based on the received Pod request, including: Based on the Pod request, a resource query request is sent for a second resource indicator that is not perceived by the container orchestration platform; receiving a feedback response of the second resource indicator and determining a response time; Get the task level of the task corresponding to the Pod request; The Pod request speed is determined according to the response time and the task level.
8. The method according to claim 1, characterized in that: Based on the received Pod request, determine the creation time tolerance of the task corresponding to the Pod, including: According to the task type of the task corresponding to the Pod request, the tolerance of the task corresponding to the Pod for the creation time is determined.
9. A resource scheduling device, characterized in that: include: A determination unit, used to determine the Pod request speed and the tolerance of the task corresponding to the Pod request to the creation time according to the received container group Pod request; A real-time interception unit, used to create a time window according to the Pod request speed and the tolerance of the task corresponding to the Pod request for the creation time, and intercept the Pod request in real time; An initialization unit, configured to construct a scheduling relationship matrix according to the intercepted Pod requests and the nodes to be scheduled in the available node queue when the number of the intercepted Pod requests reaches a preset number, and obtain an initialized chromosome population; wherein the chromosome represents that a Pod is scheduled to a node; A first scheduling unit, configured to determine a genetic scheduling method through a genetic algorithm based on the initialized chromosome population; The second scheduling unit is used to determine the optimal resource scheduling mode for scheduling each intercepted Pod request to the node to be scheduled through an ant colony algorithm according to the genetic scheduling mode, and respond to the intercepted Pod request.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 8 by executing the executable instructions.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
12. A computer program product comprising: A computer program or instruction, characterized in that when the computer program or instruction is executed by a processor, the method described in any one of claims 1 to 8 is implemented.