Pod scheduling method and device, electronic equipment and storage medium

By calculating the temporal distribution similarity of node and Pod resource utilization, Pod scheduling is optimized, solving the problems of resource contention and waste in Kubernetes and improving resource utilization.

CN115373807BActive Publication Date: 2026-11-24CHINA MOBILE GRP BEIJING +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110544965.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-19
Publication Date
2026-11-24
Estimated Expiration
2041-05-19

AI Technical Summary

Technical Problem

In existing Kubernetes systems, the Pod scheduling mechanism fails to effectively utilize the changing trends of node resources, leading to resource contention and waste, which affects Pod performance and resource utilization.

Method used

By obtaining the actual resource utilization of the node cluster and the time distribution sequence of the resource requirements of the Pods to be scheduled, similarity is calculated to optimize the scheduling process, reduce resource contention, and improve utilization.

Benefits of technology

The Pod scheduling process has been optimized, reducing the probability of resource contention and improving the utilization of node resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115373807B_ABST
    Figure CN115373807B_ABST
Patent Text Reader

Abstract

This invention discloses a pod scheduling method, apparatus, electronic device, and storage medium. The pod scheduling method includes: acquiring the time distribution sequence of the actual resource utilization rate of each node in a node cluster and the time distribution sequence of the resource demand of the pod to be scheduled; obtaining the similarity between the time distribution sequence of the actual resource utilization rate of each node and the time distribution sequence of the resource demand of the pod to be scheduled; selecting pre-selected nodes that meet preset pre-selection conditions based on the similarity corresponding to each pre-selected node; obtaining the score of each pre-selected node based on the score of each pre-selected node and a preset optimization strategy; and obtaining the node to be allocated to the pod to be scheduled from the pre-selected nodes. Embodiments of this invention can reduce pod resource contention caused by resource constraints and improve the utilization rate of node resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of resource scheduling technology, specifically to a pod scheduling method, apparatus, electronic device, and storage medium. Background Technology

[0002] Pod scheduling is a crucial aspect of Kubernetes container cluster management. The kube-scheduler scheduling process consists of two phases: Predicates and Priorities. Both phases consider the resource load of cluster nodes. If a new pod is to be assigned to a node, that node's priority is determined by the ratio of its free capacity to its total capacity (i.e., (total capacity - total capacity of existing pod requests on the node - capacity of the new pod request) / total capacity). CPU and memory have equal weight, and the node with the highest ratio receives the highest score. It's important to note that this priority function effectively allocates pods across nodes based on resource consumption.

[0003] In the Kubernetes system, resources are shared by multiple tenants by default, inevitably leading to resource contention among tenants. Pods on the same node will also compete for resources when resources are limited. Kubernetes has designed two configuration options to regulate pod resource allocation and contention mechanisms: Request and Limit. Existing Pod scheduling or rescheduling triggered by replica control mechanisms considers node resources, load, storage method, and affinity factors when selecting target nodes. However, the assessment of node resource status is determined by the total node resources and the total resource requests from all Pods on that node. This can lead to overlapping load peaks among Pods, limiting the actual resource usage of each Pod and reducing Pod performance; conversely, it can also lead to overlapping load troughs among Pods, resulting in underutilization of node resources and resource waste. Summary of the Invention

[0004] Based on the problems existing in the prior art, this invention proposes a pod scheduling method, apparatus, electronic device, and storage medium.

[0005] In a first aspect, embodiments of the present invention provide a pod scheduling method, including:

[0006] Obtain the time distribution sequence of the actual resource utilization of each node in the node cluster and the time distribution sequence of the resource demand of the pod to be scheduled;

[0007] Obtain the time distribution sequence of the actual resource utilization of each node and the time distribution sequence of the resource demand of the pod to be scheduled;

[0008] Based on all similarities, select pre-selected nodes that meet the preset pre-selection conditions from the node cluster;

[0009] Based on the similarity corresponding to each pre-selected node, a score is obtained for each pre-selected node. Based on the scores of each pre-selected node and a preset optimization strategy, the node to be allocated to the pod to be scheduled is obtained from the pre-selected nodes.

[0010] In some examples, obtaining the time distribution sequence of the actual resource utilization of each node in the node cluster includes:

[0011] Obtain the actual resource utilization rate of each node in the node cluster within a predetermined time period, and serialize the actual resource utilization rate of each node in the node cluster within the predetermined time period to obtain the actual resource utilization rate sequence of each node.

[0012] The actual resource utilization rate sequence of each node is standardized to obtain the time distribution sequence of the actual resource utilization rate of each node.

[0013] In some examples, obtaining the time distribution sequence of resource requirements for the pod to be scheduled includes:

[0014] Obtain historical running data of the Pod to be scheduled within a predetermined time period, so as to obtain the resource requirements of the Pod to be scheduled based on the historical running data of the Pod to be scheduled, and serialize the resource requirements of the Pod to be scheduled to obtain the resource requirement sequence of the Pod to be scheduled.

[0015] The resource demand sequence of the pod to be scheduled is standardized to obtain the time distribution sequence of the resource demand of the pod to be scheduled.

[0016] In some examples, the process of filtering pre-selected nodes from the node cluster based on all similarities, which meets preset pre-selection criteria, includes:

[0017] From the node cluster, select initial pre-selected nodes that meet the preset pre-selection conditions;

[0018] Obtain nodes from the initial pre-selected nodes whose similarity is less than a preset threshold;

[0019] The pre-selected nodes are obtained from the nodes whose similarity is less than a preset threshold in the initial pre-selected nodes.

[0020] In some examples, the process of obtaining a score for each pre-selected node based on the similarity of each pre-selected node, and then determining the node to be allocated to the pod to be scheduled from the pre-selected nodes based on the scores of each pre-selected node and a preset optimization strategy, includes:

[0021] The similarity between the preset value and each pre-selected node is calculated, and the difference is used as the score of each pre-selected node;

[0022] The pre-selected nodes are filtered according to the optimization strategy to obtain the initial optimized nodes;

[0023] Based on the score of the initial preferred node, the node to be assigned to the pod to be scheduled is obtained.

[0024] In some examples, the various similarities between the time distribution sequence of the actual resource utilization of each node and the time distribution sequence of the resource demand of the pod to be scheduled include:

[0025] By matching the time distribution sequence of the actual resource utilization rate of each node with the time distribution sequence of the resource demand of the pod to be scheduled, the similarity between the time distribution sequence of the actual resource utilization rate of each node and the time distribution sequence of the resource demand of the pod to be scheduled is obtained.

[0026] In some examples, the similarity between the time distribution sequence of the actual resource utilization of each node and the time distribution sequence of the resource demand of the pod to be scheduled is as follows:

[0027] (U node-cpu *U pod-cpu ) / ∑U node_cpu ,

[0028] Among them, U node-cpu The U represents the time distribution sequence of the actual resource utilization of each node. pod-cpu This is the time distribution sequence of the resource requirements of the pod to be scheduled.

[0029] Secondly, embodiments of the present invention provide a pod scheduling device, comprising:

[0030] The sequence acquisition module is used to obtain the time distribution sequence of the actual resource utilization of each node in the node cluster and the time distribution sequence of the resource demand of the pod to be scheduled.

[0031] The similarity acquisition module is used to obtain the time distribution sequence of the actual resource utilization rate of each node and the time distribution sequence of the resource demand of the pod to be scheduled.

[0032] The pre-selection module is used to filter out pre-selected nodes that meet preset pre-selection conditions from the node cluster based on all similarities.

[0033] The optimization module is used to obtain the score of each preselected node based on the similarity corresponding to each preselected node, and to obtain the node to be allocated to the pod to be scheduled from the preselected nodes based on the scores of each preselected node and a preset optimization strategy.

[0034] Thirdly, embodiments of the present invention also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the pod scheduling method as described in the first aspect.

[0035] Fourthly, embodiments of the present invention also provide a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the pod scheduling method as described in the first aspect.

[0036] As can be seen from the above technical solutions, the pod scheduling method, apparatus, electronic device, and storage medium provided in the embodiments of the present invention utilize the time distribution of the actual resource utilization rate of the target node and the time distribution of the resource demand of the pods to be scheduled to calculate the similarity between the two distribution sequences. The similarity judgment is introduced into the pre-selection process and the successful selection process of pod scheduling, thereby optimizing the pod scheduling process. This reduces pod resource contention caused by resource constraints and improves the utilization rate of node resources. Attached Figure Description

[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0038] Figure 1 This is a flowchart of a pod scheduling method provided in an embodiment of the present invention;

[0039] Figure 2 This is a schematic diagram illustrating the priority of pod scheduling to nodes provided by another embodiment of the present invention;

[0040] Figure 3 This is a structural block diagram of a pod scheduling device provided in an embodiment of the present invention;

[0041] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0042] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings. The following examples are only used to more clearly illustrate the technical solutions of the present invention and should not be construed as limiting the scope of protection of the present invention.

[0043] The following describes a pod scheduling method, apparatus, electronic device, and storage medium according to embodiments of the present invention, with reference to the accompanying drawings.

[0044] Figure 1 A flowchart of a pod scheduling method provided by an embodiment of the present invention is shown. Figure 1 As shown, an embodiment of the present invention provides a pod scheduling method, which includes the following:

[0045] S101: Obtain the time distribution sequence of the actual resource utilization rate of each node in the node cluster and the time distribution sequence of the resource demand of the pod to be scheduled.

[0046] In one embodiment of the present invention, obtaining the time distribution sequence of the actual resource utilization rate of each node in the node cluster includes: obtaining the actual resource utilization rate of each node in the node cluster within a predetermined time period, and serializing the actual resource utilization rate of each node in the node cluster within the predetermined time period to obtain the actual resource utilization rate sequence of each node; and standardizing the actual resource utilization rate sequence of each node to obtain the time distribution sequence of the actual resource utilization rate of each node.

[0047] For example, the actual CPU and memory utilization rates of each node over a continuous period (i.e., a predetermined time) are collected and serialized according to a daily, weekly, or monthly cycle, with hourly or minute-level granularity. The peak periods are then determined from this sequence. The utilization rate sequence is then standardized, with only the peak (which may have more than one) and its two (or more) adjacent time points marked as 1, and all other time points marked as 0. For example, the CPU utilization rate with a daily cycle and hourly granularity is: Usage node-cpu = [5%, 10%, 20%, 40%, 50%, 55%, 60%, 55%, 50%, 40%, 20%, 10%, 5%, 10%, 20%, 40%, 50%, 55%, 60%, 55%, 50%, 40%, 20%, 10%]. After standardization, U node-cpu =[0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0].

[0048] The step of obtaining the time distribution sequence of resource requirements of the pod to be scheduled includes: obtaining historical running data of the pod to be scheduled over a predetermined period, obtaining the resource requirements of the pod to be scheduled based on the historical running data of the pod to be scheduled, and serializing the resource requirements of the pod to be scheduled to obtain a resource requirement sequence of the pod to be scheduled; and standardizing the resource requirement sequence of the pod to be scheduled to obtain a time distribution sequence of the resource requirements of the pod to be scheduled.

[0049] For example, when a Pod (i.e., the pod to be scheduled) is being scheduled for the first time, the initial value of the resource demand distribution sequence for that Pod can be determined based on the business model of the services it hosts. The dimension, granularity, and standardization method of the sequence are consistent with the method used to process the actual resource utilization distribution sequence of the node. When a Pod is recreated by a replica controller, if historical Pod runtime data exists, the resource demand sequence of the Pod on the new node can be determined using historical actual resource statistics. After the above steps, the time distribution sequence of the resource demand of the Pod to be scheduled is obtained. pod-c [0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0].

[0050] S102: Obtain the similarity between the time distribution sequence of the actual resource utilization rate of each node and the time distribution sequence of the resource demand of the pod to be scheduled.

[0051] The process of obtaining the time distribution sequence of the actual resource utilization rate of each node and the time distribution sequence of the resource demand of the pod to be scheduled includes: matching the time distribution sequence of the actual resource utilization rate of each node with the time distribution sequence of the resource demand of the pod to be scheduled to obtain the time distribution sequence of the actual resource utilization rate of each node with the time distribution sequence of the resource demand of the pod to be scheduled.

[0052] In this example, the similarities between the time distribution sequence of the actual resource utilization of each node and the time distribution sequence of the resource demand of the pod to be scheduled are as follows:

[0053] (U node-cpu *U pod-cpu ) / ∑U node_cpu ,

[0054] Among them, U node-cpu The U represents the time distribution sequence of the actual resource utilization of each node. pod-cpu This is the time distribution sequence of the resource requirements of the pod to be scheduled.

[0055] S103: Based on all similarities, select pre-selected nodes from the node cluster that meet the preset pre-selection conditions.

[0056] The process of selecting pre-selected nodes that meet preset pre-selection conditions from the node cluster based on all similarities includes: selecting initial pre-selected nodes that meet preset pre-selection conditions from the node cluster; obtaining nodes in the initial pre-selected nodes whose similarity is less than a preset threshold; and obtaining the pre-selected nodes based on the nodes in the initial pre-selected nodes whose similarity is less than the preset threshold.

[0057] Specifically, in existing pod scheduling mechanisms, the scheduling process is divided into two phases: a pre-selection phase and a optimization phase. This step optimizes the existing pre-selection strategy, for example, by further determining U based on the existing pre-selection strategy. node-cpu and U pod-cpu Similarity = (U node-cpu *U pod-cpu ) / ∑U node_cpu And set a threshold h1 (i.e., a preset threshold). If the similarity is greater than the threshold h1, the node is excluded, that is, the pre-selection condition is not passed. In this example, the preset threshold h1 is, for example, 80%.

[0058] S104: Based on the similarity corresponding to each pre-selected node, obtain the score of each pre-selected node, and based on the score of each pre-selected node and the preset optimization strategy, obtain the node to be allocated to the pod to be scheduled from the pre-selected nodes.

[0059] In one embodiment of the present invention, a score is obtained for each pre-selected node based on the similarity of each pre-selected node, and the node to be allocated to the pod to be scheduled is obtained from the pre-selected nodes based on the scores of each pre-selected node and a preset optimization strategy. This includes: subtracting the similarity of each pre-selected node from a preset value, and using the difference as the score of each pre-selected node; filtering the pre-selected nodes according to the optimization strategy to obtain initial preferred nodes; and obtaining the node to be allocated to the pod to be scheduled based on the score of the initial preferred nodes.

[0060] Specifically, based on the existing optimization phase, further judgment of U node-cpu and U pod-cpu Similarity = (U node-cpu *U pod-cpu ) / ∑U node_cpu The (preset value - similarity) is used as the node's score and participates in the overall optimization stage calculation. The preset value can be set to 1.

[0061] like Figure 2As shown, based on the actual resource utilization of a node and the temporal trend (i.e., sequence) of the resource requirements of the Pods to be scheduled, the lower the similarity between the two distributions, the more suitable the Pods to be scheduled are for that node; conversely, the higher the similarity between the two distributions, the less suitable the Pods are for that node. Figure 2 As shown: the priority of pod1, pod2, and pod3 being scheduled to this node is: pod1 > pod2 > pod3.

[0062] The pod scheduling method of this invention adds a similarity judgment to the original judgment mechanism in the pre-selection stage; that is, if the similarity is greater than a preset threshold, the pre-selection fails. In the optimization stage, a score is added to the original judgment mechanism to obtain the node to be scheduled.

[0063] After obtaining the scheduled node, the process enters the Selecthost and Bind phases, which are existing technologies and will not be elaborated here.

[0064] According to the pod scheduling method of this invention, the similarity between the actual resource utilization time distribution of the target node and the resource demand time distribution of the pods to be scheduled is calculated. This similarity is then incorporated into the pre-selection and successful selection processes of pod scheduling, thereby optimizing the pod scheduling process. This reduces pod resource contention caused by resource constraints and improves the utilization rate of node resources.

[0065] In existing technologies, pod scheduling or rescheduling mechanisms do not utilize the characteristics of node and pod load models, nor their trends over time. This can easily lead to overlapping pod load peaks, causing resource contention; and it may also result in overlapping load troughs for different pods, leading to underutilization of node resources and resource waste. In this application, the actual resource utilization of a node and the temporal trends of the resource demands of the pods to be scheduled are used. Lower similarity between these two distributions indicates that the pod is more suitable for scheduling on that node; conversely, higher similarity indicates that the pod is not suitable for scheduling on that node. This reduces the probability of resource contention between pods and improves node resource utilization.

[0066] Figure 3 A schematic diagram of the structure of a pod scheduling device provided in an embodiment of the present invention is shown, as follows: Figure 3 As shown, the pod scheduling device provided in this embodiment of the invention includes: a sequence acquisition module 310, a similarity acquisition module 320, a pre-selection module 330, and a selection module 340, wherein:

[0067] The sequence acquisition module 310 is used to acquire the time distribution sequence of the actual resource utilization rate of each node in the node cluster and the time distribution sequence of the resource demand of the pod to be scheduled.

[0068] The similarity acquisition module 320 is used to obtain the similarity between the time distribution sequence of the actual resource utilization rate of each node and the time distribution sequence of the resource demand of the pod to be scheduled;

[0069] The pre-selection module 330 is used to filter out pre-selected nodes that meet preset pre-selection conditions from the node cluster based on all similarities.

[0070] The optimization module 340 is used to obtain the score of each preselected node based on the similarity corresponding to each preselected node, and to obtain the node to be allocated to the pod to be scheduled from the preselected nodes based on the scores of each preselected node and a preset optimization strategy.

[0071] According to embodiments of the present invention, the pod scheduling device calculates the similarity between the actual resource utilization time distribution of the target node and the resource demand time distribution of the pods to be scheduled, and introduces sequence similarity judgment into the pre-selection process and the successful selection process of pod scheduling, thereby optimizing the pod scheduling process. This reduces pod resource contention caused by resource constraints and improves the utilization rate of node resources.

[0072] It should be noted that the specific implementation of the pod scheduling device in this embodiment of the invention is similar to the specific implementation of the pod scheduling method in this embodiment of the invention. Please refer to the description in the method section for details. In order to reduce redundancy, the details will not be repeated here.

[0073] Based on the same inventive concept, another embodiment of the present invention provides an electronic device, see [link to previous document]. Figure 4 The electronic device specifically includes the following components: processor 401, memory 402, communication interface 403, and communication bus 404;

[0074] The processor 401, memory 402, and communication interface 403 communicate with each other through the communication bus 404; the communication interface 403 is used to realize information transmission between the devices.

[0075] The processor 401 is used to call the computer program in the memory 402. When the processor executes the computer program, it implements all the steps of the above-described pod scheduling method. For example, when the processor executes the computer program, it implements the following steps: obtaining the time distribution sequence of the actual resource utilization rate of each node in the node cluster and the time distribution sequence of the resource demand of the pod to be scheduled; obtaining the similarity between the time distribution sequence of the actual resource utilization rate of each node and the time distribution sequence of the resource demand of the pod to be scheduled; based on all the similarities, selecting pre-selected nodes from the node cluster that meet the preset pre-selection conditions; obtaining the score of each pre-selected node based on the similarity corresponding to each pre-selected node, and obtaining the node to be allocated to the pod to be scheduled from the pre-selected nodes based on the scores of each pre-selected node and the preset optimization strategy.

[0076] Based on the same inventive concept, another embodiment of the present invention provides a non-transitory computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements all the steps of the above-described pod scheduling method. For example, when the processor executes the computer program, it implements the following steps: obtaining the time distribution sequence of the actual resource utilization rate of each node in the node cluster and the time distribution sequence of the resource demand of the pod to be scheduled; obtaining the similarity between the time distribution sequence of the actual resource utilization rate of each node and the time distribution sequence of the resource demand of the pod to be scheduled; based on all the similarities, selecting pre-selected nodes from the node cluster that meet the preset pre-selection conditions; obtaining the score of each pre-selected node based on the similarity corresponding to each pre-selected node, and obtaining the node to be allocated to the pod to be scheduled from the pre-selected nodes based on the scores of each pre-selected node and the preset optimization strategy.

[0077] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0078] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the embodiments of the present invention according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0079] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the indicator monitoring method described in various embodiments or some parts of embodiments.

[0080] Furthermore, in this invention, terms such as "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0081] Furthermore, in this invention, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0082] Furthermore, in the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A pod scheduling method, characterized in that, include: Obtain the actual resource utilization rate of each node in the node cluster within a predetermined time period, and serialize the actual resource utilization rate of each node in the node cluster within the predetermined time period to obtain the actual resource utilization rate sequence of each node. The peak time period is determined based on the actual resource utilization rate sequence of each node. The peak time and two or more adjacent time points are marked as 1, and the remaining time points are marked as 0, thus obtaining the time distribution sequence of the actual resource utilization rate of each node. Obtain the time distribution sequence of resource requirements of the pod to be scheduled, and the dimension, granularity and standardization processing method of the time distribution sequence of resource requirements of the pod to be scheduled are consistent with the time distribution sequence of the actual resource utilization of each node. Obtain the time distribution sequence of the actual resource utilization of each node and the time distribution sequence of the resource demand of the pod to be scheduled; Based on all similarities, select pre-selected nodes that meet the preset pre-selection conditions from the node cluster; Based on the similarity corresponding to each pre-selected node, a score is obtained for each pre-selected node. Based on the scores of each pre-selected node and a preset optimization strategy, the node to be allocated to the pod to be scheduled is obtained from the pre-selected nodes.

2. The pod scheduling method according to claim 1, characterized in that, The process of obtaining the time distribution sequence of resource requirements for the pod to be scheduled includes: Obtain historical running data of the Pod to be scheduled within a predetermined time period, so as to obtain the resource requirements of the Pod to be scheduled based on the historical running data of the Pod to be scheduled, and serialize the resource requirements of the Pod to be scheduled to obtain the resource requirement sequence of the Pod to be scheduled. The resource demand sequence of the pod to be scheduled is standardized to obtain the time distribution sequence of the resource demand of the pod to be scheduled.

3. The pod scheduling method according to claim 1 or 2, characterized in that, The process of selecting pre-selected nodes from the node cluster based on all similarities, meeting preset pre-selection criteria, includes: From the node cluster, select initial pre-selected nodes that meet the preset pre-selection conditions; Obtain nodes from the initial pre-selected nodes whose similarity is less than a preset threshold; The pre-selected nodes are obtained from the nodes whose similarity is less than a preset threshold in the initial pre-selected nodes.

4. The pod scheduling method according to claim 1 or 2, characterized in that, The process involves obtaining a score for each pre-selected node based on its similarity to each pre-selected node, and then, based on the scores of each pre-selected node and a preset optimization strategy, determining the node from which the pod to be scheduled will be assigned. This includes: The similarity between the preset value and each pre-selected node is calculated, and the difference is used as the score of each pre-selected node; The pre-selected nodes are filtered according to the optimization strategy to obtain the initial optimized nodes; Based on the score of the initial preferred node, the node to be assigned to the pod to be scheduled is obtained.

5. The pod scheduling method according to claim 1, characterized in that, The similarity scores obtained between the time distribution sequence of the actual resource utilization of each node and the time distribution sequence of the resource demand of the pod to be scheduled include: By matching the time distribution sequence of the actual resource utilization rate of each node with the time distribution sequence of the resource demand of the pod to be scheduled, the similarity between the time distribution sequence of the actual resource utilization rate of each node and the time distribution sequence of the resource demand of the pod to be scheduled is obtained.

6. The pod scheduling method according to claim 5, characterized in that, The similarity scores between the time distribution sequences of the actual resource utilization of each node and the time distribution sequences of the resource requirements of the pods to be scheduled are as follows: / , in, The time distribution sequence of the actual resource utilization of each node, the This is the time distribution sequence of the resource requirements of the pod to be scheduled.

7. A pod scheduling device, characterized in that, include: The sequence acquisition module is used to acquire the actual resource utilization rate of each node in the node cluster within a predetermined time period, and to serialize the actual resource utilization rate of each node in the node cluster within the predetermined time period to obtain the actual resource utilization rate sequence of each node. The peak time period is determined based on the actual resource utilization rate sequence of each node. The peak time and two or more adjacent time points are marked as 1, and the remaining time points are marked as 0, thus obtaining the time distribution sequence of the actual resource utilization rate of each node. The time distribution sequence of the resource demand of the pod to be scheduled is obtained. The dimension, granularity and standardization processing method of the time distribution sequence of the resource demand of the pod to be scheduled are consistent with the time distribution sequence of the actual resource utilization rate of each node. The similarity acquisition module is used to obtain the similarity between the time distribution sequence of the actual resource utilization rate of each node and the time distribution sequence of the resource demand of the pod to be scheduled; The pre-selection module is used to filter out pre-selected nodes that meet preset pre-selection conditions from the node cluster based on all similarities. The optimization module is used to obtain the score of each preselected node based on the similarity corresponding to each preselected node, and to obtain the node to be allocated to the pod to be scheduled from the preselected nodes based on the scores of each preselected node and a preset optimization strategy.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the pod scheduling method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the pod scheduling method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Container scheduling method based on time sequence prediction

    CN111045820A

  • Docker container deployment method, system and device and storage medium

    CN111190696A