Container scheduling method, device, and computer facility

Optimistic concurrency control in container scheduling ensures efficient parallel pod allocation, enhancing speed without compromising quality by matching version numbers of candidate nodes and pods.

JP2025533598APending Publication Date: 2025-10-07JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
JP2025518011
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-09-26
Filing Date
2023-05-12
Publication Date
2025-10-07

AI Technical Summary

Technical Problem

Existing container scheduling technologies improve scheduling speed at the cost of reducing scheduling quality, necessitating a method to enhance speed without compromising quality.

Method used

A method and device that utilize optimistic concurrency control to perform parallel pod scheduling by matching version numbers of candidate nodes with scheduled pods, ensuring efficient resource allocation and scheduling speed.

Benefits of technology

The method enables parallel pod scheduling using multiple threads, improving cluster scheduling speed without affecting scheduling quality or requiring user operational changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025533598000001_ABST
    Figure 2025533598000001_ABST
Patent Text Reader

Abstract

The container scheduling method includes the steps of: obtaining N container pods to be scheduled from a queue to be scheduled; recording a current corresponding first version number of each schedulable node in the cluster; traversing second attribute information of each node based on first attribute information of each pod to be scheduled to determine a candidate node corresponding to each pod to be scheduled and a second version number corresponding to the candidate node; and, if the second version number corresponding to a candidate node corresponding to a given pod matches the recorded first version number, performing a scheduling process on the given pod using the candidate node.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS This application is based on and claims priority from a Chinese patent application having application number 202211174579.4 and filing date September 26, 2022, the entire disclosure of which is incorporated herein by reference.

[0002] Technical Field The present disclosure relates to the field of computer technology, and more particularly to a method, apparatus and computer facility for scheduling containers. [Background technology]

[0003] With the rapid development of computer technology, clusters are becoming increasingly widespread. Typically, in offline / online mixed systems or offline tasks, service computations require scheduling a large number of container pods in a short period of time. Related technologies use a scoring policy with pruning to schedule a large number of pods in a short period of time. While this improves scheduling speed, it can also impact scheduling quality. Therefore, how to improve cluster scheduling speed without impacting cluster scheduling quality is of great importance. Summary of the Invention [Problem to be solved by the invention]

[0004] The present disclosure aims to solve, at least to some extent, one of the technical problems in the related art. [Means for solving the problem]

[0005] An embodiment of a first aspect of the present disclosure provides a method for scheduling a container, the method comprising: obtaining N container pods to be scheduled from a queue to be scheduled, where N is any integer greater than 1; recording a current corresponding first version number of each schedulable node in the cluster; Based on the first attribute information of each of the pods to be scheduled, traverse the second attribute information of each of the nodes to determine a candidate node corresponding to each of the pods to be scheduled and a second version number corresponding to the candidate node; If a second version number corresponding to a candidate node corresponding to a given pod matches the recorded first version number, the step of performing a scheduling process for the given pod using the candidate node is included.

[0006] An embodiment of a second aspect of the present disclosure provides a container scheduling device, comprising: a fetching module for fetching N scheduled container pods from a scheduled queue, where N is any integer greater than 1; a recording module for recording a current corresponding first version number of each schedulable node in the cluster; a traversal module for traversing second attribute information of each of the nodes based on first attribute information of each of the pods to be scheduled, and determining a candidate node corresponding to each of the pods to be scheduled and a second version number corresponding to the candidate node; and a processing module for performing a scheduling process for the given pod using the candidate node if a second version number corresponding to the given pod matches the recorded first version number.

[0007] An embodiment of a third aspect of the present disclosure provides a computer facility, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein when the processor executes the program, a method for scheduling a container according to an embodiment of the first aspect of the present disclosure is realized.

[0008] An embodiment of a fourth aspect of the present disclosure provides a non-transitory computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, realizing a method for scheduling a container according to an embodiment of the first aspect of the present disclosure.

[0009] An embodiment of a fifth aspect of the present disclosure provides a computer program product, which, when executed by an instruction processor in the computer program product, performs the method for scheduling a container according to the embodiment of the first aspect of the present disclosure.

[0010] The container scheduling method, apparatus, computer equipment, and storage medium disclosed herein first acquire N container pods to be scheduled from a queue to be scheduled, then record the current corresponding first version number of each schedulable node in the cluster, and traverse the second attribute information of each node based on the first attribute information of each pod to be scheduled to determine a candidate node corresponding to each pod to be scheduled and a second version number corresponding to the candidate node. If the second version number corresponding to a candidate node corresponding to a pod matches the recorded first version number, the candidate node can be used to schedule the pod. After acquiring the N pods to be scheduled and their corresponding candidate nodes, the version numbers of the candidate nodes are checked, and if the two version numbers of the candidate node match, the candidate node is used to schedule the pod. In other words, optimistic concurrency control is used to enable pod scheduling to be performed in parallel using multiple threads, thereby improving the cluster scheduling speed without affecting the quality of cluster scheduling.

[0011] Additional aspects and advantages of the disclosure will be set forth in part in the description that follows, and in part will be obvious from the description, or may be learned by practice of the disclosure.

[0012] BRIEF DESCRIPTION OF THE DRAWINGS The above and / or additional aspects and advantages of the present disclosure will become apparent and easier to understand from the following description of the embodiments with reference to the drawings. [Brief explanation of the drawings]

[0013] [Figure 1] 1 is a schematic flowchart of a method for scheduling a container according to an embodiment of the present disclosure. [Figure 2] 1 is a schematic flowchart of a method for scheduling a container according to an embodiment of the present disclosure. [Figure 3] FIG. 1 is a schematic diagram of a container scheduling process according to one embodiment of the present disclosure. [Figure 4] 1 is a schematic configuration diagram of a container scheduling device according to an embodiment of the present disclosure. [Figure 5] FIG. 1 shows a block diagram of an exemplary computing device suitable for practicing embodiments of the present disclosure. DETAILED DESCRIPTION OF THE INVENTION

[0014]

[0033] The following detailed description of the embodiments of the present disclosure is provided below, and examples of the aforementioned embodiments are shown in the drawings, and the same or similar reference numerals always refer to the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the drawings are illustrative and are intended to help interpret the present disclosure, but should not be construed as limiting the present disclosure.

[0015] Hereinafter, a container scheduling method, apparatus, computer equipment, and storage medium according to embodiments of the present disclosure will be described with reference to the accompanying drawings.

[0016] The embodiments of the present disclosure are described as an example in which the container scheduling method is implemented in a container scheduling device, and the container scheduling device can be applied to any computer equipment, so that the computer equipment can perform the container scheduling function.

[0017] Here, the computer equipment may be a personal computer (abbreviated as PC), a cloud equipment, a mobile equipment, etc., and the mobile equipment may be a hardware equipment having various operating systems, touch screens and / or displays, such as a mobile phone, a tablet, a personal digital assistant, a wearable device, an in-vehicle equipment, etc.

[0018] FIG. 1 is a schematic flowchart of a method for scheduling a container according to an embodiment of the present disclosure.

[0019] As shown in FIG. 1, the container scheduling method may include the following steps:

[0020] In step 101, N container pods to be scheduled are obtained from the queue to be scheduled, where N is any integer greater than 1.

[0021] Here, the queue to be scheduled may include one or more pods, and the queue to be scheduled may be a queue in a container cluster management system (kubernetes, k8s), or a queue in any other cluster, and the present disclosure is not limited thereto.

[0022] Furthermore, a pod may be the smallest scheduling unit in a cluster and may include one or more containers, etc., and the present disclosure is not limited thereto.

[0023] Furthermore, N may be a preset numerical value, for example, 3, 5, 10, etc., or may be adjusted as necessary, and the present disclosure is not limited thereto.

[0024] Scheduling may also be understood as binding a pod to a node and allocating an internet protocol address (IP) address, central processing unit (CPU) resources, memory resources, etc. to the pod, and the present disclosure is not limited thereto.

[0025] In some embodiments, N pods to be scheduled obtained from the scheduling queue may be scheduled by different threads. For example, thread 1 schedules pod 1, thread 2 schedules pod 2, thread 3 schedules pod 3, etc. This allows the embodiments of the present disclosure to achieve multi-threaded parallel pod scheduling, providing conditions for improving the speed of pod scheduling.

[0026] In step 102, the current corresponding first version number of each schedulable node node in the cluster is recorded.

[0027] Here, a schedulable node may be a node that can fulfill the scheduling request of a pod in one cluster, and the present disclosure is not limited thereto.

[0028] The version number may also be the value of a specific field in a node and may be used to indicate state information of the node. For example, by analyzing a specific field in node1, it may be determined that the first version number of node1 is "1," or by analyzing a specific field in node2, it may be determined that the first version number of node2 is "0," and the present disclosure is not limited thereto.

[0029] Therefore, in an embodiment of the present disclosure, a first version number corresponding to the schedulable node (node) can be determined and recorded by analyzing a specific field in the schedulable node (node), and the present disclosure is not limited thereto.

[0030] In step 103, based on the first attribute information of each pod to be scheduled, the second attribute information of each node is traversed to determine a candidate node corresponding to each pod to be scheduled and a second version number corresponding to the candidate node.

[0031] Here, the first attribute information of the pod may be information such as the target amount of resources required for the pod, and the second attribute information of the node may be information such as the amount of resources that the node can currently provide, and this disclosure is not limited to this.

[0032] Furthermore, the number of candidate nodes corresponding to any one pod to be scheduled may be one or more, and the present disclosure does not limit this.

[0033] For example, after determining first attribute information of each pod to be scheduled and second attribute information of each node, each pod to be scheduled may be compared with each node based on the first attribute information and the second attribute information. For example, if the target resource amount of pod1 to be scheduled is X, the available resource amount of node1 is Y, and Y is greater than X, node1 may be determined as the candidate node corresponding to pod1 to be scheduled. Or, if the target resource amount of pod2 to be scheduled is X, the available resource amount of node2 is Y, and the available resource amount of node3 is Z, and Y and Z are both greater than X, node2 and node3 may be determined as the candidate nodes corresponding to pod2 to be scheduled.

[0034] Note that the above examples are merely illustrative and do not limit the first attribute information of the pod to be scheduled, the second attribute information of the node, and the candidate nodes in the embodiments of the present disclosure.

[0035] After determining the candidate node corresponding to the pod to be scheduled, a specific field in the candidate node can be analyzed to determine the corresponding second version number, and the description will be omitted here.

[0036] In step 104, if the second version number corresponding to the candidate node corresponding to the given pod matches the recorded first version number, the candidate node is used to perform a scheduling process for the given pod.

[0037] It can be understood that if the second version number corresponding to a candidate node corresponding to any pod is the same as and matches the recorded first version number, the second version number corresponding to the candidate node can be considered to match the recorded first version number.

[0038] For example, if the second version number corresponding to a candidate node corresponding to any pod is "1" and the first version number recorded in the candidate node is also "1", this indicates that the candidate node is currently available, and the candidate node can be used to perform scheduling processing, etc. for the any pod; this disclosure is not limited to this.

[0039] In some embodiments, after performing a scheduling process for a given pod using the candidate node, the second version number of the candidate node corresponding to the given pod may be updated.

[0040] Here, there are various ways to update the second version number of the candidate node. For example, the updated version number can be obtained by adding 1 to the second version number, or the second version number can be updated according to a specific rule, and the present disclosure is not limited thereto.

[0041] For example, if the second version number corresponding to a candidate node corresponding to a given pod is "0" and the first version number recorded in the candidate node is also "0", the candidate node can be used to perform a scheduling process on the given pod, and the second version number of the candidate node can be updated, for example, to "1", and the present disclosure is not limited thereto.

[0042] As a result, in the embodiments of the present disclosure, optimistic concurrency control enables pod scheduling to be performed in parallel using multiple threads, thereby improving the scheduling speed of pod clusters without affecting the quality of cluster scheduling or requiring users to change their usage methods.

[0043] In an embodiment of the present disclosure, N container pods to be scheduled are first obtained from the scheduling queue, and then the current corresponding first version number of each schedulable node in the cluster is recorded. Based on the first attribute information of each schedulable pod, the second attribute information of each node is traversed to determine a candidate node corresponding to each schedulable pod and a second version number corresponding to the candidate node. If the second version number corresponding to a candidate node corresponding to a given pod matches the recorded first version number, the candidate node can be used to perform scheduling for that pod. Thus, after obtaining the N pods to be scheduled and their corresponding candidate nodes, the version numbers of the candidate nodes can be checked. If the two version numbers of the candidate node corresponding to a given pod match, the candidate node can be used to perform scheduling for that pod. That is, optimistic concurrency control enables pod scheduling to be performed in parallel using multiple threads, thereby improving the cluster scheduling speed without affecting the quality of cluster scheduling.

[0044] FIG. 2 is a schematic flowchart of a method for scheduling a container according to an embodiment of the present disclosure.

[0045] As shown in FIG. 2, the container scheduling method may include the following steps:

[0046] In step 201, the N pods with the highest priority in the queue to be scheduled are determined as pods to be scheduled.

[0047] Here, the priority of a pod may be determined based on the type of task pending processing, for example, a high priority may be determined for computationally intensive tasks, and a low priority may be determined for normal tasks, although this disclosure is not limited thereto.

[0048] Furthermore, N may be a preset number, for example, 3, 5, 10, etc., and the present disclosure is not limited thereto.

[0049] For example, when the value of N is 3, if there are a total of seven pods to be scheduled in the queue to be scheduled, where pod1 and pod3 are high priority, pod4 is medium priority, and pod2, pod5, pod6, and pod7 are all low priority, then pod1, pod3, and pod4 can be determined as the pods to be scheduled, and the present disclosure is not limited thereto.

[0050] In some embodiments, the N pods with the longest waiting times in the queue to be scheduled may be determined as the pod to be scheduled.

[0051] Here, the waiting time may be the time during which a pod enters a queue to be scheduled and waits for scheduling.

[0052] For example, pod1 enters the queue to be scheduled at 09:01, pod2 enters the queue to be scheduled at 09:03, pod3 enters the queue to be scheduled at 09:05, pod4 enters the queue to be scheduled at 09:07, and pod5 enters the queue to be scheduled at 09:08. If the value of N is 4, assuming that the current time is 09:10, the waiting time of pod1 is 9 minutes, the waiting time of pod2 is 7 minutes, the waiting time of pod3 is 5 minutes, the waiting time of pod4 is 3 minutes, and the waiting time of pod5 is 2 minutes, in this case, pod1, pod2, pod3, and pod4 can be determined as the pods to be scheduled, and the present disclosure is not limited thereto.

[0053] In step 202, N container pods to be scheduled are obtained from the queue to be scheduled, where N is any integer greater than 1.

[0054] In step 203, the current corresponding first version number of each schedulable node node in the cluster is recorded.

[0055] For the specific content and implementation methods of step 202 and step 203, refer to the descriptions of the other embodiments of the present disclosure, and the description will be omitted here.

[0056] In step 204, the first attribute information of each pod to be scheduled is analyzed to determine the target resource amount required for each pod to be scheduled.

[0057] Here, the first attribute information may represent the attribute characteristics of the pod to be scheduled, such as the amount of resources required to schedule the pod, the number of CPU cores, network bandwidth, video card, hard disk, etc., and the present disclosure is not limited thereto.

[0058] In addition, the target resource amount required for each scheduled pod can be determined by analyzing the first attribute information of each scheduled pod in any adoptable manner, and the present disclosure is not limited thereto.

[0059] In step 205, the second attribute information of each node is analyzed to determine the amount of available resources for each node.

[0060] Here, the second attribute information may represent the attribute characteristics of the node, such as the amount of resources that the node can provide, the number of CPU cores, the network bandwidth, the video card, the hard disk, etc., and the present disclosure is not limited thereto.

[0061] In addition, by analyzing the second attribute information of each node using any applicable method, the amount of resources that each node can provide, the amount of calculation that each node can provide, etc. can be determined, and this disclosure is not limited to this.

[0062] In step 206, if the available resource amount of any node is greater than the target resource amount of the pod to be scheduled, the node is determined as a candidate node corresponding to the pod to be scheduled.

[0063] For example, if the target resource amount of pod1 to be scheduled is X, the available resource amount of node1 is Y, and Y is greater than X, node1 can be determined as the candidate node corresponding to pod1 to be scheduled.

[0064] Alternatively, if the number of CPU cores of pod1 to be scheduled is 12, the number of CPU cores of node1 is 13, and the number of CPU cores of node2 is 10, then 13 is greater than 12, and node1 can be determined as the candidate node corresponding to pod1 to be scheduled.

[0065] Note that the above examples are merely illustrative and do not limit the first attribute information of the pod to be scheduled, the second attribute information of the node, and the candidate nodes in the embodiments of the present disclosure.

[0066] In step 207, if the second version number corresponding to the candidate node corresponding to the given pod matches the recorded first version number, the candidate node is used to perform a scheduling process for the given pod.

[0067] In step 208, the second version number of the candidate node corresponding to any pod is updated.

[0068] For the specific content and implementation methods of step 207 and step 208, refer to the descriptions of the other embodiments of the present disclosure, and the description will be omitted here.

[0069] In step 209, if the number of candidate nodes corresponding to any pod is one and the second version number corresponding to the candidate node does not match the recorded first version number, the any pod is placed at the end of the queue to be scheduled.

[0070] In some embodiments, a compare and swap policy (CAS) can verify a match between the second version number corresponding to the candidate node and the recorded first version number.

[0071] Here, the CAS operation is an optimistic concurrency control policy, which generally refers to maintaining an optimistic attitude, where concurrent execution processes are assumed to have no conflicts with shared data, and only check whether a conflict occurs with the shared data when modifying the data. If no other threads are modifying the shared data at the time of modification, the modification is successful.

[0072] Thus, if the second version number corresponding to any candidate node matches the recorded first version number, it is assumed that no other thread has modified the candidate node, and the candidate node can be bound to the corresponding pod. If the second version number corresponding to any candidate node does not match the recorded first version number, it is assumed that another thread has modified the candidate node, i.e., the candidate node may already be occupied and may not be able to provide the resources required by the pod, and the pod cannot be bound to the candidate node. In this case, the pod can be returned to the tail of the scheduling queue to await scheduling.

[0073] For example, if the candidate node corresponding to any pod1 is node1, the second version number of node1 can be determined by analyzing a specific field in node1, and may be, for example, "1." If the first version number recorded in node1 is "0," which does not match the second version number "1" corresponding to node1, it may indicate that node1 may have been modified and pod1 may not be able to be scheduled. In this case, pod1 may be returned to the tail position of the queue to be scheduled.

[0074] Alternatively, if the candidate nodes corresponding to pod1 and pod2 are both node1 and the recorded first version number of node1 is "0," for example, first obtain the current second version number of node1 corresponding to pod1. If it is "0," it matches the recorded first version number "0," and pod1 and node1 can be bound. Node1 can then be used to perform scheduling for pod1, and the second version number of node1 can be updated, for example, to "1." Then, for pod2, node1 can be analyzed to obtain the current second version number "1," which does not match the recorded first version number "0," and pod2 can be placed at the end of the scheduling queue.

[0075] Note that the above example is merely an illustrative explanation and does not limit the second version number and the first version number of the candidate node in the embodiment of the present disclosure.

[0076] In step 210, the waiting time for any pod to be scheduled to be placed in the queue is updated.

[0077] When a pod is relocated to a queue to be scheduled, the waiting time of the pod in the queue to be scheduled can be updated at this time.

[0078] For example, the waiting time of pod1 before it is relocated to the queue to be scheduled is T1, and after pod1 is relocated to the tail position of the queue to be scheduled, its waiting time can continue to be determined based on T1. For example, if pod1's first waiting time in the queue to be scheduled is T1, and it is relocated to the tail position of the queue to be scheduled at time t0, and the current time is time t1, then pod1's waiting time at the current time is T1+(t1-t0), although the present disclosure is not limited to this.

[0079] Thus, in an embodiment of the present disclosure, after obtaining N pods to be scheduled, a candidate node corresponding to each pod to be scheduled can be determined, and then the second version number and the first version number of each candidate node can be matched. If the second version number and the first version number match, the pod corresponding to the candidate node is scheduled; if the first version number and the second version number do not match, the pod corresponding to the candidate node is returned to the scheduling queue. This allows pod scheduling to be performed in parallel using multiple threads through optimistic concurrency control, improving the cluster scheduling speed without affecting the quality of cluster scheduling or requiring users to change the scheduling method.

[0080] The container scheduling method according to the present disclosure can be applied to any container scheduling case.

[0081] The container scheduling process according to the present disclosure will now be described with reference to FIG.

[0082] It can be understood that in the case of multi-threading, each thread can schedule one pod correspondingly. As shown in Figure 3, first, N pods to be scheduled can be obtained from the scheduling queue, where pod1 is scheduled by thread 1, pod2 is scheduled by thread 2, ..., podN is scheduled by thread N. Then, a group of nodes with sufficient resources in the cluster can be filtered and selected, and the first version number of each node can be recorded.

[0083] Then, based on the first attribute information of each pod to be scheduled, the second attribute information of each node is traversed to determine a candidate node corresponding to each pod to be scheduled. The second version number of each candidate node is then checked to determine whether the second version number of each candidate node matches the first version number, i.e., whether the version number of the candidate node has changed. If the second version number of any candidate node matches the first version number and has not changed, the second version number of the candidate node is updated and the corresponding pod is bound to the node. If the second version number of any candidate node does not match the first version number and has changed, the corresponding pod is returned to the queue to be scheduled.

[0084] For example, if the second version number of candidate node1 does not match the first version number, pod1 corresponding to candidate node1 is relocated to the queue to be scheduled. If the second version number of candidate node1 matches the first version number, the second version number corresponding to candidate node1 is updated, pod1 corresponding to candidate node1 is bound to candidate node1, and scheduling processing is performed for pod1 using candidate node1, and scheduling of pod1 is completed.

[0085] For the remaining pods to be scheduled, the scheduling process of pod 1 to be scheduled can be referred to, and the explanation will be omitted here.

[0086] It should be noted that the above example is merely an illustrative explanation and does not limit the container scheduling process etc. in the embodiments of the present disclosure.

[0087] In an embodiment of the present disclosure, first, the N highest-priority pods in the scheduling queue are determined as the scheduling target pods. Then, N container pods to be scheduled are acquired from the scheduling queue, the current corresponding first version number of each schedulable node in the cluster is recorded, and first attribute information of each scheduling target pod is analyzed to determine the target resource amount for each scheduling target pod. Then, second attribute information of each node is analyzed to determine the available resource amount for each node. If the available resource amount of a node is greater than the target resource amount of the scheduling target pod, the node is determined as a candidate node corresponding to the scheduling target pod. If the second version number corresponding to the candidate node corresponding to the scheduling target pod matches the recorded first version number, the candidate node is used to schedule the scheduling target pod, and the second version number of the candidate node corresponding to the scheduling target pod is updated. Alternatively, if there is only one candidate node corresponding to the scheduling target pod and the second version number corresponding to the candidate node does not match the recorded first version number, the scheduling target pod is placed at the end of the scheduling target queue, and the waiting time for the scheduling target pod to be placed in the scheduling target queue is updated. In this way, after obtaining N pods to be scheduled and their corresponding candidate nodes, the version numbers of the candidate nodes can be checked. If the version numbers of the candidate nodes match, the candidate nodes can be used to perform scheduling for the pods. If the version number of the candidate nodes changes, the pods corresponding to the candidate nodes can be placed in the queue to be scheduled. In other words, optimistic concurrency control enables pod scheduling to be performed in parallel using multiple threads, which improves the cluster scheduling speed without affecting the quality of cluster scheduling or requiring changes to the user's operation method.

[0088] To achieve the above embodiment, the present disclosure further provides a container scheduling device.

[0089] FIG. 4 is a schematic configuration diagram of a container scheduling device according to an embodiment of the present disclosure. As shown in FIG. 4 , the container scheduling apparatus 100 may include an acquisition module 110 , a recording module 120 , a traversal module 130 , and a processing module 140 .

[0090] Here, the acquisition module 110 is used to acquire N scheduled container pods from the scheduled queue, where N is any integer greater than 1.

[0091] The recording module 120 is used to record the current corresponding first version number of each schedulable node (node) in the cluster.

[0092] The traversal module 130 is used to traverse the second attribute information of each of the nodes based on the first attribute information of each of the pods to be scheduled, and determine a candidate node corresponding to each of the pods to be scheduled and a second version number corresponding to the candidate node.

[0093] The processing module 140 is used to perform a scheduling process for a given pod using a candidate node if the second version number corresponding to the given pod matches the recorded first version number.

[0094] In some embodiments, the processing module 140 further comprises: It is used to update the second version number of the candidate node corresponding to the arbitrary pod.

[0095] In some embodiments, the processing module 140 further comprises: If the number of candidate nodes corresponding to a given pod is one and the second version number corresponding to the candidate node does not match the recorded first version number, place the given pod at the tail position of the scheduling target queue; This is used to update the waiting time of the given pod in the queue to be scheduled.

[0096] In some embodiments, the traverse module 130 specifically includes: Analyzing first attribute information of each of the pods to be scheduled to determine a target resource amount required for each of the pods to be scheduled; Analyzing second attribute information of each of the nodes to determine the amount of available resources of each of the nodes; If the available resource amount of a given node is greater than the target resource amount of the pod to be scheduled, the given node is used to determine the given node as a candidate node corresponding to the pod to be scheduled.

[0097] In some embodiments, the acquisition module 110 specifically: Determine the N pods with the longest waiting times in the queue to be scheduled as the pods to be scheduled, or This is used to determine the N pods with the highest priority in the queue to be scheduled as the pods to be scheduled.

[0098] The functions and specific implementation principles of the above modules in the embodiments of the present disclosure can be referred to in the embodiments of the above methods, and the description will be omitted here.

[0099] A container scheduling device according to an embodiment of the present disclosure first acquires N container pods to be scheduled from a queue to be scheduled, then records the current corresponding first version number of each schedulable node in the cluster, and traverses the second attribute information of each node based on the first attribute information of each pod to be scheduled to determine a candidate node corresponding to each pod to be scheduled and a second version number corresponding to the candidate node. If the second version number corresponding to a candidate node corresponding to a pod matches the recorded first version number, the candidate node can be used to perform scheduling for the pod. Thus, after acquiring the N pods to be scheduled and their corresponding candidate nodes, the version numbers of the candidate nodes are checked, and if the two version numbers of the candidate node match, the candidate node is used to perform scheduling for the pod. In other words, optimistic concurrency control enables pod scheduling to be performed in parallel using multiple threads, thereby improving the cluster scheduling speed without affecting the quality of cluster scheduling.

[0100] To realize the above embodiment, the present disclosure further provides a computer device including a memory, a processor, and a computer program stored in the memory and executable by the processor, which, when executed by the processor, realizes the container scheduling method according to the above embodiment of the present disclosure.

[0101] To realize the above embodiment, the present disclosure further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, realizes the container scheduling method according to the above embodiment of the present disclosure.

[0102] To realize the above embodiment, the present disclosure further provides a computer program product, which, when instructions in the computer program product are executed by a processor, performs the container scheduling method according to the above embodiment of the present disclosure.

[0103] 5 shows a block diagram of an exemplary computer system suitable for implementing embodiments of the present disclosure. The computer system 12 shown in FIG. 5 is merely an example and is not intended to limit the functionality and scope of use of embodiments of the present disclosure.

[0104] 5, computer equipment 12 is represented in the form of a general-purpose computing facility. Components of computer equipment 12 may include, but are not limited to, one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including system memory 28 and processing units 16).

[0105] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a number of bus structures, including, but not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0106] The computer equipment 12 typically includes a variety of computer system readable media, which may be any available media that can be accessed by the computer equipment 12 and includes both volatile and nonvolatile media, removable and non-removable media.

[0107] Memory 28 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer equipment 12 may also include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be configured to read from and write to non-removable, non-volatile magnetic media (not shown in FIG. 5, but commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, non-volatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from and writing to a removable, non-volatile optical disk (e.g., a Compact Disc Read Only Memory (CD-ROM), a Digital Video Disc Read Only Memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) program module configured to perform the functions of each embodiment of the present disclosure.

[0108] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or any combination thereof, may comprise an implementation of a network environment. The program modules 42 typically perform the functions and / or methods of the embodiments described in this disclosure.

[0109] The computer equipment 12 may communicate with one or more external equipment 14 (e.g., a keyboard, a pointing device, a display 24, etc.), with one or more equipment that allows a user to interact with the computer equipment 12, and / or with any equipment (e.g., a network card, a modem, etc.) that allows the computer equipment 12 to communicate with one or more other computing devices. Such communication may occur via an input / output (I / O) interface 22. The computer equipment 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer equipment 12 via a bus 18. It should be understood that other hardware and / or software modules, not shown, may be used in combination with the computer equipment 12, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, magnetic tape drives, and data backup storage systems.

[0110] The processing unit 16 executes programs stored in the system memory 28 to perform various functional applications and data processing, for example, to implement the methods mentioned in the above embodiments.

[0111] The technical solution of the present disclosure first obtains N container pods to be scheduled from a queue to be scheduled, then records the first version number currently corresponding to each schedulable node in the cluster, and traverses the second attribute information of each node based on the first attribute information of each pod to be scheduled to determine a candidate node corresponding to each pod to be scheduled and a second version number corresponding to the candidate node. If the second version number corresponding to a candidate node corresponding to a pod matches the recorded first version number, the candidate node can be used to perform scheduling for the pod. In this way, after obtaining the N pods to be scheduled and their corresponding candidate nodes, the version numbers of the candidate nodes can be checked, and if the two version numbers of the candidate node match, the candidate node can be used to perform scheduling for the pod. In other words, optimistic concurrency control enables pod scheduling to be performed in parallel using multiple threads, thereby improving the cluster scheduling speed without affecting the quality of cluster scheduling.

[0112] In the description herein, references to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" mean that the specific features, structures, materials, or characteristics described with reference to the embodiment or example are included in at least one embodiment or example of the present disclosure. In the present specification, exemplary descriptions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in an appropriate manner in any one or more embodiments or examples. Furthermore, if not mutually inconsistent, those skilled in the art may combine and combine different embodiments or examples described herein, and features of different embodiments or examples.

[0113] Additionally, the terms "first" and "second" are for descriptive purposes only and should not be understood as indicating or implying relative importance or the number of technical features being shown. Thus, a feature qualified with "first" or "second" can explicitly or implicitly include at least one of the feature. In the description of this disclosure, "plurality" means at least two, e.g., two, three, etc., unless otherwise specified.

[0114] Any process or method description illustrated in a flowchart or otherwise herein may be understood to represent a module, segment, or portion of code comprising one or more executable instructions for implementing customized logical functions or process steps, and the scope of the preferred embodiments of the present disclosure includes other implementations, including performing functions not necessarily in the order shown or discussed herein, but in an essentially concurrent manner or in reverse order based on such functions, as should be understood by those skilled in the art to which the embodiments of the present disclosure pertain.

[0115] The logic and / or steps depicted in a flowchart or otherwise described herein may be considered, for example, as an ordered list of executable instructions for implementing logical functions, and may specifically be embodied on any computer-readable medium for use with or in combination with an instruction execution system, device, or facility (e.g., a computer-based system, a processor-including system, or other system capable of obtaining instructions from and executing instructions on an instruction execution system, device, or facility). As used herein, a "computer-readable medium" may be any device that can contain, store, communicate, propagate, or transmit a program for use with or in combination with an instruction execution system, device, or facility. More specific examples (non-exhaustive list) of computer-readable media include an electrical connection having one or more wires (electrical devices), a portable computer disk cartridge (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disc read-only memory (CD-ROM). The computer readable medium may also be paper or other suitable medium on which the program may be printed, and the program may be obtained electronically, for example by optically scanning the paper or other medium and then edited, interpreted, or processed in any other suitable manner as required, and then stored in computer memory.

[0116] It should be understood that each part of the present disclosure may be realized by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods may be realized by software or firmware stored in a memory and executed by an appropriate instruction execution system. For example, when realized by hardware, as in other embodiments, the hardware may be realized by any one or combination of technologies well known in the art, such as a discrete logic circuit having logic gate circuits for implementing logic functions on data signals, an application specific integrated circuit having appropriate combinational logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0117] As can be understood by those skilled in the art, all or some of the steps included in the method for implementing the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it will include one or a combination of the steps of the method embodiments.

[0118] Furthermore, each functional unit in each embodiment of the present disclosure may be integrated into one processing module, each unit may exist physically alone, or two or more units may be integrated into one module. The integrated module may be realized in the form of hardware or in the form of a software functional module. When the integrated module is realized in the form of a software functional module and sold or used as an independent product, it may be stored in a computer-readable storage medium.

[0119] The aforementioned storage medium may be a read-only memory, a magnetic or optical disk, etc. Although the embodiments of the present disclosure have been shown and described above, the above embodiments are illustrative and should not be construed as limiting the present disclosure, and it should be understood that those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present disclosure.

Claims

1. 1. A method for scheduling a container, comprising: obtaining N scheduled container pods from a scheduled queue, where N is any integer greater than 1; recording a current corresponding first version number of each schedulable node in the cluster; Traversing second attribute information of each of the nodes based on first attribute information of each of the pods to be scheduled, and determining candidate nodes corresponding to each of the pods to be scheduled and second version numbers corresponding to the candidate nodes; If a second version number corresponding to a candidate node corresponding to a given pod matches the recorded first version number, performing a scheduling process for the given pod using the candidate node. How containers are scheduled.

2. If a second version number corresponding to a candidate node corresponding to the arbitrary pod matches the recorded first version number, after performing a scheduling process for the arbitrary pod using the candidate node, and further comprising updating a second version number of the candidate node corresponding to the arbitrary pod. The method of claim 1 .

3. After the step of traversing the second attribute information of each of the nodes to determine a candidate node corresponding to each of the pods to be scheduled and a second version number corresponding to the candidate node, If the number of candidate nodes corresponding to a given pod is one and the second version number corresponding to the candidate node does not match the recorded first version number, placing the given pod at the tail position of the scheduling target queue; updating a waiting time for the given pod to be placed in the scheduled queue.

3. A method for scheduling containers according to claim 1 or 2.

4. The step of determining a candidate node corresponding to each of the pods to be scheduled and a second version number corresponding to the candidate node by traversing second attribute information of each of the nodes based on first attribute information of each of the pods to be scheduled, includes: Analyzing first attribute information of each of the pods to be scheduled and determining a target resource amount required for each of the pods to be scheduled; Analyzing second attribute information of each of the nodes to determine an amount of available resources for each of the nodes; If the available resource amount of any node is greater than the target resource amount of the pod to be scheduled, determining the any node as a candidate node corresponding to the pod to be scheduled. A method for scheduling containers according to any one of claims 1 to 3.

5. The step of acquiring N container pods to be scheduled from the queue to be scheduled includes: determining the N pods with the longest waiting time in the queue to be scheduled as the pod to be scheduled; or determining the N pods with the highest priority in the queue to be scheduled as the pod to be scheduled. A method for scheduling containers according to any one of claims 1 to 4.

6. A container scheduling device, comprising: a fetching module for fetching N scheduled container pods from a scheduled queue, where N is any integer greater than 1; a recording module for recording a current corresponding first version number of each schedulable node in the cluster; a traversing module for traversing second attribute information of each of the nodes based on first attribute information of each of the pods to be scheduled, to determine candidate nodes corresponding to each of the pods to be scheduled and second version numbers corresponding to the candidate nodes; a processing module for performing a scheduling process for the arbitrary pod using the candidate node when a second version number corresponding to the candidate node corresponding to the arbitrary pod matches the recorded first version number. Container scheduling device.

7. The processing module further comprises: Used to update the second version number of the candidate node corresponding to the given pod The container scheduling device according to claim 6.

8. The processing module further comprises: If the number of candidate nodes corresponding to a given pod is one and the second version number corresponding to the candidate node does not match the recorded first version number, place the given pod at the tail position of the scheduling target queue; Used to update the waiting time for the given pod to be placed in the scheduled queue. The container scheduling device according to claim 6 or 7.

9. The traverse module specifically comprises: Analyzing first attribute information of each of the pods to be scheduled to determine a target resource amount required for each of the pods to be scheduled; Analyzing second attribute information of each of the nodes to determine an available resource amount of each of the nodes; If the available resource amount of a node is greater than the target resource amount of the pod to be scheduled, the node is determined as a candidate node corresponding to the pod to be scheduled. The container scheduling device according to any one of claims 6 to 8.

10. The acquisition module specifically includes: Determine the N pods with the longest waiting time in the queue to be scheduled as the pod to be scheduled; or Used to determine the N highest priority pods in the queue to be scheduled as the pod to be scheduled. The container scheduling device according to any one of claims 6 to 9.

11. 1. A computer facility comprising: a memory, a processor, and a computer program stored in the memory and executable by the processor; When the processor executes the computer program, the method for scheduling containers according to any one of claims 1 to 5 is realized. Computer facilities.

12. A computer-readable storage medium on which a computer program is stored, When the computer program is executed by a processor, the method for scheduling containers according to any one of claims 1 to 5 is realized. A computer-readable storage medium.

13. 1. A computer program product comprising: including computer programs, When the computer program is executed by a processor, the method for scheduling containers according to any one of claims 1 to 5 is realized. Computer program computer program product.

Citation Information

Patent Citations

  • Cluster resource scheduling method, device and equipment and storage medium

    CN110727512A

  • Unit scheduling method and device

    CN112783613A

  • Container cluster scheduling method and device, electronic equipment and storage medium

    CN113821328A

  • Unit and method for schedule control

    JP1996016410A

  • Dynamic migration of a group of containers

    JP2020536319A