Container scheduling method and device, computer equipment and readable storage medium

By using multi-dimensional key-value tables and multi-threaded processing techniques in big data clusters, the target nodes are determined for container scheduling, and the inefficiency of schedulers in the prior art is solved, and the performance and resource utilization of the cluster are improved.

CN119621332APending Publication Date: 2025-03-14CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411727146.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

When scheduling containers, existing big data cluster schedulers have high conflict rates and low efficiency, resulting in performance impact.

Method used

A container scheduling method is provided, by determining multiple container scheduling requests in the queue to be dispatched, a multi-dimensional key value table of the node cluster is obtained, and a target node is determined in the node cluster for scheduling according to the resource request amount and multi-dimensional key value table of the container.

Benefits of technology

It significantly improves the scheduler's throughput and scheduling speed, reduces the time for memory replication and resource matching, and improves the overall cluster's response speed and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621332A_ABST
    Figure CN119621332A_ABST
Patent Text Reader

Abstract

The invention relates to a container scheduling method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: determining a to-be-scheduled queue, and selecting a plurality of container scheduling requests from the to-be-scheduled queue; obtaining a multi-dimensional key value table corresponding to the node cluster; the multi-dimensional key value table comprises a key value table with a plurality of priorities, and different priorities correspond to different resource types; for each container scheduling request, determining a target node corresponding to the container scheduling request in a node cluster according to the resource request quantity and the multi-dimensional key value table carried by the container scheduling request; and scheduling the container corresponding to the container scheduling request to the target node. By adopting the method, the scheduling speed can be improved, the utilization rate of node resources can be better balanced, and resource waste is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a container scheduling method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] With the explosive growth of data in the information age, especially driven by technologies such as the Internet, the Internet of Things, social media, and mobile devices, the speed and scale of data generation far exceeds the processing capabilities of traditional data processing systems. This requires more efficient technologies and methods to meet these challenges, so cluster technology came into being. It connects multiple computer nodes together to form a unified system to provide higher computing power, storage capacity, and reliability. The scheduling architecture is crucial to maintaining and optimizing the cluster environment, which directly affects the performance of the cluster, resource utilization, service availability, and user experience.

[0003] However, in the existing scheduling architecture, the scheduler only allocates nodes to one container at a time, and each time the allocation process is executed, a snapshot of all nodes is obtained and then pre-selected. In the pre-selection process, the container's requested resources are compared with all nodes each time to screen out nodes that meet the requirements. In this process, each snapshot of all nodes is obtained, which is a copy process. When the cluster is large and the number of nodes is large, the memory copy time is long, which will have a significant impact on performance. In addition, the calculation process of resource matching for all nodes each time will also take a long time when the number of nodes is large, reducing the overall performance. Therefore, there is an urgent need for a container scheduling method that can solve the problems of high scheduling conflict rate and low efficiency of the current big data cluster scheduler. Summary of the invention

[0004] Based on this, it is necessary to provide a container scheduling method, device, computer equipment, computer-readable storage medium and computer program product that can solve the problems of high scheduling conflict rate and low efficiency of current big data cluster schedulers in response to the above technical problems.

[0005] In a first aspect, the present application provides a container scheduling method, comprising:

[0006] Determine a queue to be scheduled, and select multiple container scheduling requests from the queue to be scheduled;

[0007] Obtain a multidimensional key-value table corresponding to the node cluster; the multidimensional key-value table includes a key-value table of multiple priorities, different priorities correspond to different resource types, and for each priority, the key in the key-value pair in the priority is the remaining resource amount of the node under the corresponding resource type, and the value in the key-value pair in the priority is the node identifier in the node cluster;

[0008] For each container scheduling request, according to the resource request amount carried by the container scheduling request and the multidimensional key value table, determine the target node corresponding to the container scheduling request in the node cluster;

[0009] The container corresponding to the targeted container scheduling request is scheduled to the target node.

[0010] In one embodiment, the selecting a plurality of container scheduling requests from the to-be-scheduled queue includes:

[0011] Determine the number of container scheduling requests in the queue to be scheduled; obtain a preset take-out number, and compare the number of container scheduling requests with the preset take-out number; if the number of container scheduling requests is less than the preset take-out number, select all container scheduling requests from the queue to be scheduled; if the number of container scheduling requests is greater than or equal to the preset take-out number, select the preset take-out number of container scheduling requests from the queue to be scheduled.

[0012] In one embodiment, the resource request amount carried by the container scheduling request includes resource request amounts under different resource types; and determining, in the node cluster, a target node corresponding to the container scheduling request according to the resource request amount carried by the container scheduling request and the multidimensional key-value table, includes:

[0013] In the first round of the process of determining the target node through multiple rounds of iterations, determine the resource type corresponding to the first priority in the multidimensional key-value table, and determine the candidate node corresponding to the first round based on the resource request amount under the resource type corresponding to the first priority carried by the targeted container scheduling request and the key value table of the first priority in the multidimensional key-value table; in the current round other than the first round of the process of determining the target node through multiple rounds of iterations, determine the current priority corresponding to the current round, and determine the resource type corresponding to the current priority in the multidimensional key-value table, and determine the candidate node corresponding to the current round from the candidate nodes corresponding to the previous round based on the resource request amount under the resource type corresponding to the current priority carried by the targeted container scheduling request and the key value table of the current priority in the multidimensional key-value table; and determine the target node corresponding to the targeted container scheduling request based on the candidate node corresponding to the last round.

[0014] In one of the embodiments, determining the candidate node corresponding to the current round from the candidate nodes corresponding to the previous round according to the resource request amount under the resource type corresponding to the current priority carried by the targeted container scheduling request and the key value table of the current priority in the multidimensional key value table includes:

[0015] Determine a target key-value table of the current priority pointed to by the candidate node corresponding to the previous round; search the target key-value table of the current priority for a first target key-value pair whose key is the resource request amount under the resource type corresponding to the current priority carried by the targeted container scheduling request; determine the candidate node corresponding to the current round based on the value in each of the first target key-value pairs.

[0016] In one of the embodiments, for each container scheduling request, a target node corresponding to the container scheduling request is determined in a node cluster through multithreading and according to the resource request amount carried by the container scheduling request and the multidimensional key-value table.

[0017] In one embodiment, before selecting a plurality of container scheduling requests from the to-be-scheduled queue, the method further includes:

[0018] Determine the remaining amount of resources for each node in the node cluster under each resource type; determine the priority corresponding to each resource type according to the priority of each resource type; generate a multidimensional key-value table according to the remaining amount of resources for each node in the node cluster under each resource type and the priority corresponding to each resource type.

[0019] In a second aspect, the present application also provides a container scheduling device, including:

[0020] A selection module, used to determine a queue to be scheduled, and select multiple container scheduling requests from the queue to be scheduled;

[0021] An acquisition module is used to acquire a multidimensional key-value table corresponding to a node cluster; the multidimensional key-value table includes a key-value table of multiple priorities, where different priorities correspond to different resource types, and for each priority, the key in the key-value pair in the priority is the remaining resource amount of the node under the corresponding resource type, and the value in the key-value pair in the priority is the node identifier in the node cluster;

[0022] A determination module, configured to determine, for each container scheduling request, a target node corresponding to the container scheduling request in the node cluster according to the resource request amount carried by the container scheduling request and the multidimensional key-value table;

[0023] The scheduling module is used to schedule the container corresponding to the container scheduling request to the target node.

[0024] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0025] Determine a queue to be scheduled, and select multiple container scheduling requests from the queue to be scheduled;

[0026] Obtain a multidimensional key-value table corresponding to the node cluster; the multidimensional key-value table includes a key-value table of multiple priorities, different priorities correspond to different resource types, and for each priority, the key in the key-value pair in the priority is the remaining resource amount of the node under the corresponding resource type, and the value in the key-value pair in the priority is the node identifier in the node cluster;

[0027] For each container scheduling request, according to the resource request amount carried by the container scheduling request and the multidimensional key value table, determine the target node corresponding to the container scheduling request in the node cluster;

[0028] The container corresponding to the targeted container scheduling request is scheduled to the target node.

[0029] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0030] Determine a queue to be scheduled, and select multiple container scheduling requests from the queue to be scheduled;

[0031] Obtain a multidimensional key-value table corresponding to the node cluster; the multidimensional key-value table includes a key-value table of multiple priorities, different priorities correspond to different resource types, and for each priority, the key in the key-value pair in the priority is the remaining resource amount of the node under the corresponding resource type, and the value in the key-value pair in the priority is the node identifier in the node cluster;

[0032] For each container scheduling request, according to the resource request amount carried by the container scheduling request and the multidimensional key value table, determine the target node corresponding to the container scheduling request in the node cluster;

[0033] The container corresponding to the targeted container scheduling request is scheduled to the target node.

[0034] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0035] Determine a queue to be scheduled, and select multiple container scheduling requests from the queue to be scheduled;

[0036] Obtain a multidimensional key-value table corresponding to the node cluster; the multidimensional key-value table includes a key-value table of multiple priorities, different priorities correspond to different resource types, and for each priority, the key in the key-value pair in the priority is the remaining resource amount of the node under the corresponding resource type, and the value in the key-value pair in the priority is the node identifier in the node cluster;

[0037] For each container scheduling request, according to the resource request amount carried by the container scheduling request and the multidimensional key value table, determine the target node corresponding to the container scheduling request in the node cluster;

[0038] The container corresponding to the targeted container scheduling request is scheduled to the target node.

[0039] The above-mentioned container scheduling method, apparatus, computer device, computer-readable storage medium and computer program product determine a queue to be scheduled and select multiple container scheduling requests from the queue to be scheduled; different from the traditional method of processing only one container at a time, by processing multiple container requests at a time, the throughput of the scheduler can be significantly improved, the scheduling speed of the container can be accelerated, and the response speed of the overall cluster can be improved.

[0040] Get the multidimensional key-value table corresponding to the node cluster; the multidimensional key-value table includes key-value tables of multiple priorities, different priorities correspond to different resource types, and for each priority, the key in the key-value pair in the priority is the remaining resource amount of the node under the corresponding resource type, and the value in the key-value pair in the priority is the node identifier in the node cluster; the resource types and remaining resource amounts are classified and stored. Through this structured storage method, the qualified nodes can be quickly located, avoiding the time-consuming operation of traversing the nodes in full. And each time a batch of container scheduling requests are processed, the same cache can be used, which greatly reduces the time overhead in the scheduling process.

[0041] For each container scheduling request, the target node corresponding to the container scheduling request is determined in the node cluster according to the resource request amount carried by the container scheduling request and the multidimensional key value table; through the multidimensional key value table, the scheduler can quickly and accurately find the node that meets the container resource request, ensuring that each container can be assigned to a suitable node to run. By quickly querying and selecting nodes, the utilization of node resources can be better balanced, avoiding excessive concentration of certain node resources, and improving the overall resource utilization of the cluster.

[0042] The container corresponding to the container scheduling request is scheduled to the target node. By directly allocating the container to the target node, the delay in the intermediate link is reduced and the scheduling efficiency is improved. Through the multi-threaded processing and multi-level cache architecture in the above steps, the time for memory copying and resource matching is reduced, and the scheduling speed is significantly improved. Through fast query and multi-threaded screening of nodes, the utilization of node resources is better balanced and resource waste is avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 An application environment diagram of a container scheduling method in an embodiment;

[0045] Figure 2 It is a flowchart of a container scheduling method in one embodiment;

[0046] Figure 3 A schematic diagram of the overall architecture of a container scheduling method in one embodiment;

[0047] Figure 4 A schematic diagram of a multi-level architecture cache of a container scheduling method in one embodiment;

[0048] Figure 5 It is a flowchart of a container scheduling method in another embodiment;

[0049] Figure 6 is a structural block diagram of a container scheduling device in one embodiment;

[0050] Figure 7 is a structural block diagram of a container scheduling device in another embodiment;

[0051] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

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

[0053] The container scheduling method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the scheduler 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 is used to generate a container scheduling request and send the container scheduling request to the scheduler 102, so that the scheduler 102 schedules the container corresponding to the container scheduling request to the target node. Among them, the scheduler 102 refers to the specific executor responsible for container scheduling. After receiving the container scheduling request from the API Server, it stores these container scheduling requests in the queue to be scheduled. Before each scheduling, the scheduler obtains the image of all nodes in the current cluster (that is, the resource status snapshot of the node), and then selects the appropriate node to run the container according to the resource request of the container and the resource situation of the node. Server 104 refers to the API Server, which is the brain of the cluster. It can be understood as a central command center, and all operation requests (such as creating, deleting, and updating resources) must be processed through this center. The API Server is responsible for receiving these requests, verifying their legitimacy, and forwarding them to other components in the cluster for execution.

[0054] In an exemplary embodiment, Figure 2 As shown, a container scheduling method is provided, which is applied to Figure 1 The scheduler 102 in FIG. 1 is taken as an example to illustrate the method, which includes the following steps 202 to 208. Among them:

[0055] Step 202: determine a queue to be scheduled, and select multiple container scheduling requests from the queue to be scheduled.

[0056] The queue to be scheduled refers to a queue containing all containers waiting to be scheduled. In a cluster, when a user submits a new container or an existing container needs to be rescheduled, these containers will be placed in the queue to be scheduled. The scheduler will take out containers from this queue one by one for scheduling. It can be understood that the queue to be scheduled is a buffer for storing all containers waiting to be scheduled. The scheduler takes out containers from this queue in order or by priority for processing.

[0057] A container scheduling request refers to the resource request information carried by each container to be scheduled. For example, this information includes the amount of CPU, memory and other resources required by the container. The scheduler decides which node to allocate the container to based on this information.

[0058] Specifically, first the scheduler receives multiple container requests from the API Server. Understandably, these requests may come from containers manually created by users, or containers that need to be rescheduled for some reason. The received container requests are stored in the queue to be scheduled. The queue to be scheduled is a first-in-first-out queue that stores all containers waiting to be scheduled. The scheduler periodically checks the status of the queue to be scheduled to ensure that the container requests in the queue are up to date and that no containers that need to be scheduled are missed.

[0059] The scheduler then determines a batch size based on the current system load and configuration parameters. This batch size determines the number of containers that are taken out of the queue to be scheduled each time. The scheduler takes the specified number of containers from the head of the queue to be scheduled. For example, if the number of containers in the queue to be scheduled is less than the batch size, all the containers to be scheduled are taken out. For example, assuming the batch size is 10 and there are 15 containers in the queue to be scheduled, the scheduler will take out the first 10 containers for processing. The scheduler stores the taken out containers in a temporary list and prepares for the next scheduling operation.

[0060] Step 204, obtain the multidimensional key-value table corresponding to the node cluster; the multidimensional key-value table includes key-value tables of multiple priorities, different priorities correspond to different resource types, and for each priority, the key in the key-value pair in the corresponding priority is the remaining resource amount of the node under the corresponding resource type, and the value in the key-value pair in the corresponding priority is the node identifier in the node cluster.

[0061] The node cluster refers to the collection of all nodes that make up the cluster. Each node is an independent computing resource, which can be a physical machine or a virtual machine, used to run containerized applications.

[0062] A multidimensional key-value table refers to a data structure used to store and organize node resource information. It includes key-value tables with multiple priorities, each of which corresponds to a different type of resource. Through this structure, nodes that meet specific resource requests can be quickly queried. Optionally, the structural features of the multidimensional key-value table include multi-level cache and priority sequence. First, the multidimensional key-value table is a multi-level cache architecture that can reduce the frequent replication of node images during each scheduling, thereby reducing memory consumption. Secondly, for each resource (such as CPU and memory), when creating a key-value table or index, a priority queue will be created accordingly, and all key values ​​will be stored in the priority queue for subsequent query use.

[0063] Resource types refer to the different types of resources that can be provided on a node, including but not limited to: CPU (central processing unit resources), memory resources, storage resources, network bandwidth, etc.

[0064] The remaining resource amount refers to the amount of resources that are not currently being used by a node under a certain resource type. For example, if the total CPU resource of a node is 4 cores and 2 cores are currently being used, the remaining resource amount is 2 cores.

[0065] A node ID is an identifier that uniquely identifies each node in a cluster. It can be the node's name, IP address, or other unique identifier. Through the node ID, you can quickly locate a specific node.

[0066] Specifically, first obtain a snapshot of the node status, including the scheduler obtaining a snapshot of the resource status of all nodes in the current cluster from the API Server, including the current usage and remaining resource amount of each node's CPU, memory and other resources. Then create a key-value table, including rounding down the remaining resource amount of each resource type of the node to a key value. For example, node A has 127.3 CPUs remaining, which is rounded down to 127, and node C has 127.1 CPUs remaining, which is rounded down to 127. Finally, create a priority queue, including creating a priority queue for each resource type and storing all key values ​​in the priority queue. For example, the CPU priority queue is [127, 128], and the memory priority queue is [2, 2.5, 3].

[0067] Step 206 : For each container scheduling request, according to the resource request amount and the multi-dimensional key value table carried by the container scheduling request, determine the target node corresponding to the container scheduling request in the node cluster.

[0068] The resource request refers to the resource requirements that each container puts forward to the cluster when it is created. These requirements include but are not limited to the number of CPU cores and memory size. When scheduling containers, the scheduler will select the appropriate node based on these resource requests to ensure that the container can obtain enough resources to run normally.

[0069] The target node refers to the node selected by the scheduler in the node cluster that can meet the resource requirements of the container based on the resource request amount of the container and the multi-dimensional key-value table. The scheduler schedules the container to run on the target node to ensure that the container can obtain the required resources.

[0070] Specifically, first, the resource request amount is extracted from each container taken out from the queue to be scheduled. The resource request amount can be the resource demand of a certain resource type, such as the number of CPU cores and memory size.

[0071] Then, based on the resource request amount of the container for a certain resource type, query the priority queue of the resource type to find a set of nodes that may meet the resource request amount of the resource type. And in the found set of nodes of the resource type, based on the resource request amount of the container for a certain resource type, query the priority queue of the resource type to further filter out the nodes that meet the resource requirements of the resource type. For example, based on the CPU resource request amount of the container, query the CPU priority queue to find a set of nodes that may meet the CPU requirements. In the found set of CPU nodes, based on the memory resource request amount of the container, query the memory priority queue to further filter out the nodes that meet the memory requirements.

[0072] Finally, a node that satisfies all resource requests is selected from the query results. Optionally, if multiple nodes meet the conditions, the best node can be selected (for example, based on the node's comprehensive resource utilization, network latency, and other factors).

[0073] Step 208: Schedule the container corresponding to the targeted container scheduling request to the target node.

[0074] Specifically, in the previous step, the target node that satisfies the container's resource request has been determined through the multidimensional key-value table and priority queue. First, the remaining resources of the target node are subtracted from the container's resource request to ensure that the resource information of the target node is kept up to date. The target node is marked as "in use" or "allocated" to prevent other containers from being scheduled to the same node and causing insufficient resources.

[0075] The scheduler then sends the scheduling instructions to the kubelet component (node ​​agent component) on the target node. After receiving the scheduling instructions, the kubelet component on the target node is responsible for the actual container creation and management to ensure that the container can obtain the resources it requests. Understandably, the kubelet component is a core component in the Kubernetes cluster and runs on each node. Its main responsibility is to ensure that the container runs correctly on the node and maintains communication with the master node to report the status and health of the node. The cluster in this application can be a Kubernetes cluster. Kubernetes is an open source container orchestration platform that aims to automate the deployment, expansion and management of containerized applications. It is also a cluster resource scheduling system that provides a powerful, flexible and scalable operating platform for various large-scale scenarios, making the deployment, management and expansion of applications more efficient and reliable. With Kubernetes, developers and operation and maintenance teams can manage and automate the life cycle of containers in a declarative configuration, thereby simplifying complex infrastructure management tasks and improving the reliability and scalability of applications.

[0076] Finally, the scheduler records the scheduling results to the API Server, updates the container status information, including the allocated node information and resource usage, and removes the successfully scheduled containers from the queue to be scheduled, ensuring that all containers in the queue are in the waiting-to-be-scheduled state.

[0077] In one of the embodiments, the number of container scheduling requests in the queue to be scheduled is determined; a preset take-out number is obtained, and the number of container scheduling requests is compared with the preset take-out number; when the number of container scheduling requests is less than the preset take-out number, all container scheduling requests are selected from the queue to be scheduled; when the number of container scheduling requests is greater than or equal to the preset take-out number, the preset take-out number of container scheduling requests is selected from the queue to be scheduled.

[0078] The preset number of containers to be taken out refers to the upper limit of the number of containers that the scheduler takes out from the queue to be scheduled at each time. This number is preset by the system configuration in order to avoid overloading the system by processing too many containers at once while processing containers in batches.

[0079] Specifically, the scheduler first obtains all containers to be scheduled from the queue to be scheduled and counts their number. For example, there are 5 containers in the queue to be scheduled. Then the scheduler reads the preset take-out quantity from the configuration. For example, the preset take-out quantity is 3. Next, the number of containers in the queue to be scheduled is compared with the preset take-out quantity. For example, the number of containers in the queue to be scheduled is 5, and the preset take-out quantity is 3.

[0080] If the number of containers in the queue to be scheduled is less than the preset take-out quantity, all containers in the queue to be scheduled are selected for processing. For example, if there are 2 containers in the queue to be scheduled and the preset take-out quantity is 3, all 2 containers are selected. If the number of containers in the queue to be scheduled is greater than or equal to the preset take-out quantity, the preset take-out quantity of containers is selected from the queue to be scheduled for processing. For example, if there are 5 containers in the queue to be scheduled and the preset take-out quantity is 3, the first 3 containers are selected.

[0081] By presetting the number of retrievals, the scheduler can process multiple containers at a time instead of just one container at a time. This significantly improves the throughput of the scheduler and reduces scheduling delays. Batch processing reduces resource consumption at each scheduling, especially reducing the number of requests to the API Server and frequent queries on node status, thereby reducing the overall load of the system. And further, by presetting the number of retrievals, it ensures that resource consumption at each scheduling is within a controllable range, avoiding resource overload.

[0082] In one of the embodiments, in the first round of a process of iteratively determining a target node in multiple rounds, the resource type corresponding to the first priority in the multidimensional key-value table is determined, and the candidate node corresponding to the first round is determined based on the resource request amount under the resource type corresponding to the first priority carried by the targeted container scheduling request and the key value table of the first priority in the multidimensional key-value table; in the current round other than the first round of a process of iteratively determining a target node in multiple rounds, the current priority corresponding to the current round is determined, and the resource type corresponding to the current priority in the multidimensional key-value table is determined, and the candidate node corresponding to the current round is determined from the candidate nodes corresponding to the previous round based on the resource request amount under the resource type corresponding to the current priority carried by the targeted container scheduling request and the key value table of the current priority in the multidimensional key-value table; and based on the candidate nodes corresponding to the last round, the target node corresponding to the targeted container scheduling request is determined.

[0083] Priority refers to the priority order of different resource types in the multidimensional key-value table. Priority is used to determine which resource type's resource request is processed first during multiple rounds of iterations. Usually, resource types with higher priorities are processed first.

[0084] Candidate nodes refer to the set of nodes that meet resource requests in each round of iteration, based on the resource request amount and key value table corresponding to the current priority. The set of candidate nodes is gradually reduced in each round of iteration, and the target node is finally determined.

[0085] The key-value table refers to a part of the multidimensional key-value table, which is used to store and organize the resource information of the node. Each key-value table corresponds to a resource type, the key is the remaining resource amount of the node under the resource type, and the value is the node identifier (node ​​ID).

[0086] Specifically, the first round of iterations is performed, including determining the resource type corresponding to the first priority in the multidimensional key-value table in the first round of multiple iterations. Usually, the first priority may be CPU or memory. For example, assume that the first priority is CPU. According to the resource request amount under the resource type corresponding to the first priority carried by the targeted container scheduling request, query the key value table of the first priority in the multidimensional key-value table to determine the candidate node corresponding to the first round. For example, assuming that container A requests 1CPU, query the CPU key value table to find all nodes with remaining CPU resources greater than or equal to 1. From the query results, determine the set of candidate nodes corresponding to the first round. For example, assuming that the query result is [node A, node C], the set of candidate nodes for the first round is [node A, node C].

[0087] Then, subsequent rounds of iterations are performed, including determining the current priority corresponding to the current round in the current round other than the first round in the multi-round iteration process. For example, assume that the priority of the current round is memory. According to the resource request amount under the resource type corresponding to the current priority carried by the targeted container scheduling request, query the key value table of the current priority in the multidimensional key value table, and determine the candidate node corresponding to the current round from the candidate nodes corresponding to the previous round. For example, assuming that container A requests 2GB of memory, query the memory key value table, and find all nodes with remaining memory resources greater than or equal to 2GB from the candidate node set [node A, node C] of the previous round. And determine the candidate node set corresponding to the current round from the query results. For example, assuming that the query result is [node A], the candidate node set for the current round is [node A].

[0088] Finally, the target node is finally determined, including in the last round of multiple iterations, determining the candidate node set corresponding to the last round. For example, assuming that the candidate node set of the last round is [node A]. According to the candidate node corresponding to the last round, the target node corresponding to the container scheduling request is determined. For example, node A is selected as the target node.

[0089] Through multiple rounds of iterations, the resource matching process is broken down into multiple steps, and each step only processes one type of resource, reducing the complexity of each query. In addition, each round gradually narrows the set of candidate nodes and finally determines the target node, improving query efficiency. Priority processing ensures that key resources (such as CPU and memory) are matched first, improving the accuracy of resource matching. Each round only queries the key-value table of the current priority, avoiding loading all resource information at once, further reducing memory usage.

[0090] In one of the embodiments, a target key-value table of the current priority pointed to by the candidate node corresponding to the previous round is determined; a first target key-value pair whose key is the resource request amount under the resource type corresponding to the current priority carried by the targeted container scheduling request is searched from the target key-value table of the current priority; and the candidate node corresponding to the current round is determined based on the value in each first target key-value pair.

[0091] The target key-value table refers to the key-value table corresponding to the current priority in the multi-round iteration process. This key-value table is used to store and organize the remaining resources and node identifiers of the node under the current priority resource type. The key is the remaining resources of the node under the resource type, and the value is the node identifier (node ​​ID).

[0092] The first target key-value pair refers to a key-value pair in the target key-value table of the current priority, where the key is the resource request amount under the resource type corresponding to the current priority carried by the container scheduling request. This key-value pair is used to determine the candidate nodes of the current round.

[0093] Specifically, first determine the current priority resource type corresponding to the current round. For example, assume that the current priority is memory. From the iteration result of the previous round, obtain the candidate node set of the previous round. For example, assume that the candidate node set of the previous round is [node A, node C]. Determine the target key value table of the current priority pointed to by the candidate node set of the previous round. For example, assume that the current priority is memory, and the target key value table is the memory key value table.

[0094] Then, from the container scheduling request of the current round, obtain the resource request amount under the resource type corresponding to the current priority. For example, suppose container A requests 2GB of memory. From the target key-value table of the current priority, search for the key-value pair of the resource request amount under the resource type corresponding to the current priority carried by the container scheduling request. For example, suppose the memory key-value table is:

[0095] 2: [Node A]

[0096] 2.5: [Node C]

[0097] 3: [Node B]

[0098] At this time, the key-value pair with the key of 2GB is searched in the memory key-value table, and the result is (2, node A). From the query result, the first target key-value pair is determined. For example, the first target key-value pair is (2, node A).

[0099] Finally, the node identifier is extracted from the first target key-value pair. For example, node A is extracted from (2, node A). And according to the node identifier in the first target key-value pair, the candidate node set of the current round is determined. For example, the candidate node set of the current round is [node A].

[0100] By directly using the candidate node set of the previous round, unnecessary query operations are reduced and query efficiency is improved. By determining the target key-value table of the current priority, each query is ensured to focus on the current resource type, avoiding interference between resource types. By searching for key-value pairs with the resource request amount as the key, the node that best meets the resource request is ensured to be found. The key-value pair structure makes the search operation very fast and improves query efficiency. Each round gradually narrows the candidate node set to ensure that the final selected node is the best. Through multiple rounds of iteration, the waste of resources caused by misjudgment of a single resource type is reduced.

[0101] Optionally, when the target key-value pair is not found, a second target key-value pair with a key greater than the resource request amount under the resource type corresponding to the current priority carried by the targeted container scheduling request and a value being the targeted candidate node is determined from the key-value pairs of the current priority in the multidimensional key-value table; and the candidate node corresponding to the current round is determined based on the values ​​in each second target key-value pair.

[0102] Specifically, from the target key-value table of the current priority, search for the first target key-value pair whose key is the resource request amount under the resource type corresponding to the current priority carried by the container scheduling request. For example, assuming that container A requests 2GB of memory, query the memory key-value table to search for the key-value pair with the key of 2GB. If no key-value pair with the key of 2GB is found, proceed to the next step.

[0103] Then, from the container scheduling request of the current round, obtain the resource request amount under the resource type corresponding to the current priority. For example, suppose container A requests 2GB of memory. From the key-value table of the current priority, find the key-value pair with a key greater than 2GB. For example, suppose the memory key-value table is:

[0104] 2: [Node A]

[0105] 2.5: [Node C]

[0106] 3: [Node B]

[0107] At this time, we search for key-value pairs with keys greater than 2GB, and the results are (2.5, node C) and (3, node B). From the query results, we determine the key-value pairs whose keys are greater than 2GB and whose values ​​are the candidate nodes we are targeting. For example, assuming that the candidate node set in the previous round is [node A, node C], the second target key-value pair is (2.5, node C).

[0108] Finally, the node identifier is extracted from the second target key-value pair. For example, node C is extracted from (2.5, node C). And according to the node identifier in the second target key-value pair, the candidate node set of the current round is determined. For example, the candidate node set of the current round is [node C].

[0109] When a fully matched key-value pair is not found, a key-value pair with a key greater than the resource request is searched to ensure that a node that can meet the resource request is found, thus avoiding resource waste. Even if there is no fully matched node, a node with slightly more resources can be found to ensure that resources are effectively utilized and reduce scheduling failures.

[0110] In one of the embodiments, for each container scheduling request, a target node corresponding to the container scheduling request is determined in a node cluster through multithreading and according to a resource request amount and a multidimensional key value table carried by the container scheduling request.

[0111] Multithreading refers to the use of multithreading technology by the scheduler to process multiple container scheduling requests in parallel. Each thread is responsible for processing one or more container scheduling requests, thereby improving the concurrency and efficiency of scheduling.

[0112] Specifically, first create a thread pool containing multiple threads. The size of the thread pool can be adjusted according to system resources and the expected number of concurrent requests. For example, suppose a thread pool containing 4 threads is created.

[0113] The container scheduling requests are then assigned to different threads. Each thread is responsible for processing one or more container scheduling requests. For example, suppose there are currently 4 container scheduling requests (container A, container B, container C, container D), and they are assigned to 4 threads: thread 1 processes container A, thread 2 processes container B, thread 3 processes container C, and thread 4 processes container D.

[0114] Next, each thread obtains the resource request amount from the container scheduling request it is responsible for. For example, suppose container A requests 1CPU and 2GB of memory. Each thread queries the multidimensional key value table based on the resource request amount carried by the container scheduling request it is responsible for, and determines the candidate node. For example, suppose the multidimensional key value table is:

[0115] CPU key value table

[0116] 1: [Node A, Node C]

[0117] 2: [Node B]

[0118] Memory key value table

[0119] 2: [Node A]

[0120] 2.5: [Node C]

[0121] 3: [Node B]

[0122] Thread 1 queries the CPU key value table and finds the key-value pair (1, [node A, node C]) with key 1, then queries the memory key value table and finds the key-value pair (2, [node A]) with key 2. Similarly, threads 2, 3, and 4 query the corresponding key value tables in a similar manner.

[0123] Then each thread screens out candidate nodes that meet the resource request based on the query results. For example, thread 1 determines that the candidate node is [Node A]. Thread 2, thread 3, and thread 4 similarly determine their respective candidate nodes. Optionally, if a fully matched key-value pair is not found, a key-value pair with a key greater than the resource request amount is searched. For example, assuming that container B requests 2.5GB of memory, but a key-value pair with a key of 2.5 is not found in the memory key-value table, a key-value pair (3, [Node B]) with a key greater than 2.5 is searched, and the candidate node is determined to be [Node B]. It can be understood that in the process of searching for key-value pairs with a key greater than 2.5, more threads are allocated to querying key-value pairs closer to 2.5. For example, if a key-value pair with a key of 2.5 is not found in the memory key-value table, the number of threads arranged for querying a key-value pair with a key of 3 in the memory key-value table is greater than the number of threads used to query a key-value pair with a key of 3.5 in the memory key-value table. By allocating more threads to query key-value pairs that are closer to the resource request amount, the closest candidate node can be found faster and the query range can be reduced. Key-value pairs that are closer to the resource request amount are more likely to be the final candidate nodes, so querying these key-value pairs first can quickly locate the target node.

[0124] Finally, the processing results of each thread are summarized to determine the target node corresponding to each container scheduling request. The final determined target node is returned to the scheduler to complete the scheduling task. For example, the summary results are as follows: the target node of container A is node A, the target node of container B is node B, the target node of container C is node C, and the target node of container D is node D.

[0125] Since multithreading allows the scheduler to process multiple container scheduling requests at the same time, the concurrency of scheduling is significantly improved. Through parallel processing, the waiting time for each request is reduced, and the overall scheduling speed is improved. Through multithreading, the scheduling process is ensured to be completed quickly, reducing the user's waiting time. It is ensured that each container can obtain sufficient resources, improving user satisfaction.

[0126] In one of the embodiments, the remaining amount of resources for each node in the node cluster under each resource type is determined; based on the priority of each resource type, the priority corresponding to each resource type is determined; and based on the remaining amount of resources for each node in the node cluster under each resource type and the priority corresponding to each resource type, a multidimensional key-value table is generated.

[0127] Specifically, first collect information about each node in the node cluster, including but not limited to resource types such as CPU, memory, storage, network bandwidth, etc. For example, suppose there are three nodes in the node cluster (node ​​A, node B, node C), and the resource information of each node is: node A: 10CPU, 20GB memory, 100GB storage, node B: 8CPU, 15GB memory, 80GB storage, node C: 12CPU, 25GB memory, 120GB storage.

[0128] Then calculate the remaining resources of each node under each resource type. The remaining resources can be calculated by the following formula: Remaining resources = total resources - allocated resources. For example, suppose the current resource allocation is: Node A: 5CPU, 10GB memory, 50GB storage allocated, Node B: 4CPU, 7GB memory, 40GB storage allocated, Node C: 6CPU, 12GB memory, 60GB storage allocated. The remaining resources are calculated as: Node A: 5CPU, 10GB memory, 50GB storage, Node B: 4CPU, 8GB memory, 40GB storage, Node C: 6CPU, 13GB memory, 60GB storage.

[0129] Next, determine the priority of each resource type. For example, CPU priority is 1, memory priority is 2, storage priority is 3, and network bandwidth priority is 4.

[0130] Finally, create a multidimensional key-value table to store the remaining resources of each node under each resource type. For example, create a dictionary structure to represent the multidimensional key-value table. Fill the multidimensional key-value table according to the remaining resources of each node under each resource type. For example, fill the CPU key-value table, fill the memory key-value table, fill the storage key-value table, and fill the network bandwidth key-value table. Integrate all key-value tables into a multidimensional key-value table for subsequent scheduling queries.

[0131] By pre-generating a multi-dimensional key-value table, the computational overhead of each scheduling is reduced, and the system response speed is improved. The multi-dimensional key-value table provides an efficient query method, which can quickly find nodes that meet resource requests and improve scheduling efficiency. And by setting the priority of resource types, it can ensure that key resources (such as CPU and memory) are given priority in the scheduling process, improving the accuracy of scheduling.

[0132] In one embodiment, reference Figure 3First, multi-threaded processing of application requests includes: After the scheduler receives container requests from the API-Server, it puts these requests into the queue to be scheduled. Unlike the traditional scheduler that only processes the first container in the queue each time, the new scheduling scheme is designed to process multiple container requests each time. Specifically, the scheduler will take out up to max (BatchSize, size of the queue to be scheduled) containers from the head of the queue to be scheduled for scheduling, where BatchSize is the preset maximum batch processing number, and the size of the queue to be scheduled is the number of containers in the current queue.

[0133] Then the node information storage based on physical finiteness includes: before each scheduling, the scheduler will obtain the mirror information of all resource nodes in the current cluster. This information is no longer stored in a simple array form, but is stored and sorted through a multidimensional key-value table. The key of the key-value table is usually the remaining amount of a certain resource of the node (such as CPU, memory), which is rounded down as the key value to form a node set. For each resource, a priority queue is created to store all possible key values ​​for subsequent quick queries.

[0134] Next, selecting a node set according to the application request includes: the scheduler obtains the resource request amount of the container selected in step S101. According to the resource request amount of the container, the cache established in S102 is queried to find a node set that fully meets the resource request. This process is completed in constant time because an efficient index has been established through the key-value table. The query stops until a certain number of nodes are met, which can reduce unnecessary resource consumption.

[0135] Finally, multi-threaded node selection includes: After determining the possible node set, the scheduler uses multi-threading technology to process these nodes in parallel to further speed up the node selection process. Each thread is responsible for processing a part of the nodes, ensuring efficient scheduling performance even in a large-scale cluster environment. In order to ensure that the node resource utilization is roughly the same, the scheduler will randomly select different key values ​​for processing based on the optional key value range.

[0136] In one embodiment, reference Figure 4 ,First, the scheduler takes multiple containers from the queue to be scheduled and obtains the resource request amount (such as 1CPU, 2GB memory) of each container.

[0137] Then the scheduler first queries the priority queue of the CPU resources to see if there is a key value of 1 (indicating 1 CPU thread). If there is a key value of 1, it queries the node set corresponding to the key value 1 from the cache to obtain all nodes with remaining CPU resources equal to 1.

[0138] Next, for all nodes with remaining CPU resources equal to 1, query the priority queue of memory resources to find out whether there is a key value of 2 (indicating 2GB of memory). If there is a key value of 2, query the node set corresponding to the key value 2 from the cache to obtain all nodes with remaining memory resources equal to 2GB. If there is no key value 2, query the priority queue for a key value greater than 2 and filter the queried nodes.

[0139] Finally, multi-threading technology is used to process the selected node set in parallel, with each thread responsible for processing a portion of the nodes. For example, one thread processes all nodes with a key value of 1, and another thread processes all nodes with a key value of 2. Multi-threading can significantly reduce processing latency and further reduce scheduling time. The multi-level cache architecture shows how to efficiently manage and query node information.

[0140] Optionally, during the processing, the scheduler will randomly select different key values ​​according to the optional key value range to ensure that the resource utilization of each node is roughly the same. This can avoid excessive concentration of resources on certain nodes and improve the resource utilization of the overall cluster.

[0141] By constructing the multidimensional key-value table and priority queue, the scheduler can quickly find a set of nodes that meet resource requests in a constant time, thus significantly improving scheduling efficiency and performance. The introduction of multithreading technology further accelerates the node screening process and ensures efficient scheduling in a large-scale cluster environment.

[0142] In an exemplary embodiment, Figure 5 As shown, it includes steps 502 to 510. Among them:

[0143] Step 502, determining the remaining amount of resources of each node in the node cluster under each resource type; determining the priority corresponding to each resource type according to the priority of each resource type; generating a multidimensional key-value table according to the remaining amount of resources of each node in the node cluster under each resource type and the priority corresponding to each resource type;

[0144] Step 504, determine the queue to be scheduled, and determine the number of container scheduling requests in the queue to be scheduled; obtain a preset take-out number, and compare the number of container scheduling requests with the preset take-out number; if the number of container scheduling requests is less than the preset take-out number, select all container scheduling requests from the queue to be scheduled; if the number of container scheduling requests is greater than or equal to the preset take-out number, select the preset take-out number of container scheduling requests from the queue to be scheduled;

[0145] Step 506, obtaining a multidimensional key-value table corresponding to the node cluster; the multidimensional key-value table includes a key-value table of multiple priorities, where different priorities correspond to different resource types, and for each priority, the key in the key-value pair in the priority is the remaining resource amount of the node under the corresponding resource type, and the value in the key-value pair in the priority is the node identifier in the node cluster;

[0146] Step 508, for each container scheduling request, in the first round of the process of iteratively determining the target node in multiple rounds, determine the resource type corresponding to the first priority in the multidimensional key-value table, and determine the candidate node corresponding to the first round according to the resource request amount under the resource type corresponding to the first priority carried by the targeted container scheduling request and the key value table of the first priority in the multidimensional key-value table; in the current round other than the first round of the process of iteratively determining the target node in multiple rounds, determine the current priority corresponding to the current round, determine the resource type corresponding to the current priority in the multidimensional key-value table, and determine the target key-value table of the current priority pointed to by the candidate node corresponding to the previous round; search the target key-value table of the current priority for the first target key-value pair whose key is the resource request amount under the resource type corresponding to the current priority carried by the targeted container scheduling request; determine the candidate node corresponding to the current round according to the value in each first target key-value pair; determine the target node corresponding to the targeted container scheduling request according to the candidate node corresponding to the last round;

[0147] Step 510: Schedule the container corresponding to the targeted container scheduling request to the target node.

[0148] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0149] Based on the same inventive concept, the embodiment of the present application also provides a container scheduling device for implementing the container scheduling method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more container scheduling device embodiments provided below can refer to the limitations of the container scheduling method above, and will not be repeated here.

[0150] In an exemplary embodiment, Figure 6 As shown, a container scheduling device 600 is provided, including: a selection module 602, an acquisition module 604, a determination module 606 and a scheduling module 608, wherein:

[0151] A selection module 602 is used to determine a queue to be scheduled and select multiple container scheduling requests from the queue to be scheduled;

[0152] The acquisition module 604 is used to acquire the multidimensional key-value table corresponding to the node cluster; the multidimensional key-value table includes a key-value table of multiple priorities, where different priorities correspond to different resource types, and for each priority, the key in the key-value pair in the priority is the remaining resource amount of the node under the corresponding resource type, and the value in the key-value pair in the priority is the node identifier in the node cluster;

[0153] A determination module 606 is used to determine, for each container scheduling request, a target node corresponding to the container scheduling request in the node cluster according to the resource request amount and the multidimensional key value table carried by the container scheduling request;

[0154] The scheduling module 608 is used to schedule the container corresponding to the targeted container scheduling request to the target node.

[0155] In one embodiment, the selection module 602 is used to determine the number of container scheduling requests in the queue to be scheduled; obtain a preset take-out number, and compare the number of container scheduling requests with the preset take-out number; when the number of container scheduling requests is less than the preset take-out number, select all container scheduling requests from the queue to be scheduled; when the number of container scheduling requests is greater than or equal to the preset take-out number, select the preset take-out number of container scheduling requests from the queue to be scheduled.

[0156] In one embodiment, the determination module 606 is used to determine the resource type corresponding to the first priority in the multi-dimensional key-value table in the first round of the process of iteratively determining the target node in multiple rounds, and determine the candidate node corresponding to the first round based on the resource request amount under the resource type corresponding to the first priority carried by the container scheduling request and the key value table of the first priority in the multi-dimensional key-value table; in the current round other than the first round of the process of iteratively determining the target node in multiple rounds, determine the current priority corresponding to the current round, and determine the resource type corresponding to the current priority in the multi-dimensional key-value table, and determine the candidate node corresponding to the current round from the candidate nodes corresponding to the previous round based on the resource request amount under the resource type corresponding to the current priority carried by the container scheduling request and the key value table of the current priority in the multi-dimensional key-value table; determine the target node corresponding to the container scheduling request based on the candidate node corresponding to the last round.

[0157] In one embodiment, the determination module 606 is used to determine the target key-value table of the current priority pointed to by the candidate node corresponding to the previous round; search the target key-value table of the current priority for the first target key-value pair whose key is the resource request amount under the resource type corresponding to the current priority carried by the targeted container scheduling request; and determine the candidate node corresponding to the current round based on the value in each first target key-value pair.

[0158] In one of the embodiments, the container scheduling device also includes a multi-thread module 610, which is used to determine, for each container scheduling request, a target node corresponding to the container scheduling request in the node cluster through multi-threading and based on the resource request amount and multi-dimensional key value table carried by the container scheduling request.

[0159] In one of the embodiments, the container scheduling device also includes a generation module 612, which is used to determine the remaining resource amount of each node in the node cluster under each resource type; determine the priority corresponding to each resource type according to the priority of each resource type; and generate a multidimensional key-value table according to the remaining resource amount of each node in the node cluster under each resource type and the priority corresponding to each resource type.

[0160] In another embodiment, if Figure 7 As shown, Figure 7 It is a structural block diagram of a container scheduling device 600 in another embodiment, including: a selection module 602, an acquisition module 604, a determination module 606 and a scheduling module 608. Among them, the container scheduling device 600 also includes a multi-threading module 610 and a generation module 612. The multi-threading module 610 is used to determine the target node corresponding to the container scheduling request in the node cluster through multi-threading and according to the resource request amount and multi-dimensional key value table carried by the container scheduling request. The generation module 612 is used to determine the remaining resource amount of each node in the node cluster under each resource type; determine the priority corresponding to each resource type according to the priority of each resource type; generate a multi-dimensional key value table according to the remaining resource amount of each node in the node cluster under each resource type and the priority corresponding to each resource type.

[0161] Each module in the above container scheduling device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0162] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to container scheduling. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a container scheduling method is implemented.

[0163] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0164] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0165] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0166] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0167] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0168] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0169] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0170] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A container scheduling method, characterized in that: The method comprises: Determine a queue to be scheduled, and select multiple container scheduling requests from the queue to be scheduled; Obtain a multidimensional key-value table corresponding to the node cluster; the multidimensional key-value table includes a key-value table of multiple priorities, different priorities correspond to different resource types, and for each priority, the key in the key-value pair in the priority is the remaining resource amount of the node under the corresponding resource type, and the value in the key-value pair in the priority is the node identifier in the node cluster; For each container scheduling request, according to the resource request amount carried by the container scheduling request and the multidimensional key value table, determine the target node corresponding to the container scheduling request in the node cluster; The container corresponding to the targeted container scheduling request is scheduled to the target node.

2. The method according to claim 1, characterized in that The selecting a plurality of container scheduling requests from the to-be-scheduled queue includes: Determine the number of container scheduling requests in the queue to be scheduled; Obtaining a preset take-out quantity, and comparing the quantity of the container scheduling request with the preset take-out quantity; When the number of the container scheduling requests is less than the preset number of take-out requests, selecting all container scheduling requests from the queue to be scheduled; When the number of the container scheduling requests is greater than or equal to the preset fetching number, the container scheduling requests of the preset fetching number are selected from the queue to be scheduled.

3. The method according to claim 1, characterized in that: The resource request amount carried in the container scheduling request includes resource request amounts under different resource types; The determining, in the node cluster, a target node corresponding to the container scheduling request according to the resource request amount carried by the container scheduling request and the multidimensional key value table includes: In the first round of the process of iteratively determining the target node in multiple rounds, determine the resource type corresponding to the first priority in the multidimensional key-value table, and determine the candidate node corresponding to the first round according to the resource request amount under the resource type corresponding to the first priority carried by the targeted container scheduling request and the key value table of the first priority in the multidimensional key-value table; In the process of iteratively determining the target node in multiple rounds, in the current round other than the first round, determine the current priority corresponding to the current round, and determine the resource type corresponding to the current priority in the multidimensional key-value table, and determine the candidate node corresponding to the current round from the candidate nodes corresponding to the previous round according to the resource request amount under the resource type corresponding to the current priority carried by the targeted container scheduling request and the key value table of the current priority in the multidimensional key-value table; According to the candidate nodes corresponding to the last round, the target node corresponding to the container scheduling request is determined.

4. The method according to claim 3, characterized in that The determining, according to the resource request amount under the resource type corresponding to the current priority carried by the targeted container scheduling request and the key value table of the current priority in the multidimensional key value table, the candidate node corresponding to the previous round is determined, including: Determine the target key value table of the current priority pointed to by the candidate node corresponding to the previous round; Searching, from the target key-value table of the current priority, for a first target key-value pair whose key is the resource request amount under the resource type corresponding to the current priority carried in the targeted container scheduling request; The candidate nodes corresponding to the current round are determined according to the values ​​in each of the first target key-value pairs.

5. The method according to claim 1, characterized in that The method further comprises: For each container scheduling request, a target node corresponding to the container scheduling request is determined in the node cluster through multithreading and according to the resource request amount carried by the container scheduling request and the multidimensional key value table.

6. The method according to claim 1, characterized in that Before selecting a plurality of container scheduling requests from the to-be-scheduled queue, the method further includes: Determine the remaining resources of each node in the node cluster under each resource type; Determine the priority level of each resource type according to the priority level of each resource type; A multidimensional key-value table is generated according to the remaining resource amount of each node in the node cluster under each resource type and the priority corresponding to each resource type.

7. A container scheduling device, characterized in that: The device comprises: A selection module, used to determine a queue to be scheduled, and select multiple container scheduling requests from the queue to be scheduled; An acquisition module is used to acquire a multidimensional key-value table corresponding to a node cluster; the multidimensional key-value table includes a key-value table of multiple priorities, where different priorities correspond to different resource types, and for each priority, the key in the key-value pair in the priority is the remaining resource amount of the node under the corresponding resource type, and the value in the key-value pair in the priority is the node identifier in the node cluster; A determination module, configured to determine, for each container scheduling request, a target node corresponding to the container scheduling request in the node cluster according to the resource request amount carried by the container scheduling request and the multidimensional key-value table; The scheduling module is used to schedule the container corresponding to the container scheduling request to the target node.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.