Resource scheduling method and system, resource model training method and device and medium

By receiving the scheduling request of the target Pod in a multi-cloud environment and determining the target node based on the cluster resource information, the problems of complex resource management and inefficient resource utilization in Kubernetes cluster management and application deployment are solved, and dynamic application deployment and efficient implementation are achieved Resource utilization.

CN119415242APending Publication Date: 2025-02-11青岛聚看云科技有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410720204.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

In multi-cloud environments, Kubernetes cluster management and application deployment have problems such as complex resource management, inefficient resource utilization, and difficulty in achieving reliability and high availability.

Method used

By receiving the scheduling request of the target Pod, the target node in the target cluster is determined based on the cluster resource information of multiple clusters at the current moment. The target node can meet the scheduling needs within the preset time period and return the scheduling result to indicate the target Pod scheduling location.

Benefits of technology

Dynamic application deployment is realized to ensure that the target node meets the operation needs of the target Pod within the preset time period, and improves resource utilization and operation and maintenance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415242A_ABST
    Figure CN119415242A_ABST
Patent Text Reader

Abstract

The invention relates to a resource scheduling method and system, a resource model training method, equipment and a medium, and the method comprises the steps: receiving a scheduling request of a target Pod, the scheduling request carrying a scheduling demand corresponding to the target Pod, and the scheduling demand being used for indicating a resource use demand and / or a service quality demand of the target Pod; determining a target node in the target cluster based on the cluster resource information of the plurality of clusters at the current moment; the target cluster is one of the plurality of clusters; the target node is a node which is used as a running environment and can meet the scheduling requirement in a preset time period after the current moment; and returning a scheduling result, wherein the scheduling result is used for indicating that the target Pod is scheduled to the target node for operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the computer field, and more specifically, to a resource scheduling method, system, resource model training method, device and medium. Background Art

[0002] In recent years, with the widespread application of Kubernetes in enterprise-level container applications, the problems of Kubernetes cluster management and application deployment in multi-cloud environments have become increasingly prominent. The main manifestations are: multi-cloud resource management is complicated, Kubernetes clusters of different cloud providers are quite different, and there is a lack of a unified management platform, which brings huge challenges to operation and maintenance; inefficient resource utilization, lack of intelligent resource scheduling and cost management methods, resulting in low resource utilization and high operating costs; reliability and high availability, the availability of a single Kubernetes cluster is limited, and it is difficult to achieve high-availability deployment across clouds.

[0003] In response to the above industry pain points, some related Kubernetes multi-cluster management solutions, such as ClusterAPI and Multi-Cluster Management, provide basic multi-cluster orchestration and resource management functions, but mainly provide static resource allocation functions. They cannot dynamically optimize application deployment according to cluster performance and lack intelligent scheduling, which may lead to low resource utilization. Summary of the invention

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present application provide a resource scheduling method, system, resource model training method, device and medium.

[0005] In a first aspect, an embodiment of the present application provides a resource scheduling method, including:

[0006] Receive a scheduling request of a target Pod, the scheduling request carries a scheduling requirement corresponding to the target Pod, and the scheduling requirement is used to indicate a resource usage requirement and / or a service quality requirement of the target Pod;

[0007] Based on the cluster resource information of multiple clusters at the current moment, determine a target node in the target cluster; the target cluster is one of the multiple clusters; the target node is a node that can meet the scheduling requirement as an operating environment within a preset time period after the current moment;

[0008] Returns the scheduling result, which is used to indicate that the target Pod is scheduled to run on the target node.

[0009] In some embodiments of the present application, the determining of the target node in the target cluster based on the cluster resource information of the multiple clusters at the current moment includes:

[0010] Based on the cluster resource information of the multiple clusters and the scheduling requirement, a plurality of node scores are determined through a global resource usage model, each node score being used to indicate a matching score of a node in a cluster as an operating environment and the scheduling requirement within the preset time period;

[0011] Based on the multiple node scores, the target node is determined, and the node score corresponding to the target node is greater than or equal to the node score threshold.

[0012] In some embodiments of the present application, the cluster resource information of the multiple clusters includes cluster-level resource information and node-level resource information of the multiple clusters; the multiple node scores are determined based on the cluster resource information of the multiple clusters and the scheduling requirements through a global resource usage model, including:

[0013] Based on the cluster-level resource information of the multiple clusters and the scheduling requirement, a plurality of cluster scores are determined through the global resource usage model, each cluster score being used to indicate a matching score of a cluster as an operating environment and the scheduling requirement within the preset time period;

[0014] Based on the multiple cluster scores, determining at least one candidate cluster from the multiple clusters, wherein the cluster score corresponding to each candidate cluster is greater than or equal to a cluster score threshold;

[0015] The plurality of node scores are determined based on the node-level resource information of the at least one candidate cluster through the global resource usage model.

[0016] In some embodiments of the present application, determining the target node based on the multiple node scores includes:

[0017] When there is a target node score among the multiple node scores, determining a node corresponding to the target node score as the target node;

[0018] In the case that there are multiple target node scores among the multiple node scores, the node with the lowest system load after a preset time period among the nodes corresponding to the multiple target node scores is determined as the target node.

[0019] In some embodiments of the present application, when the scheduling request also carries a high availability policy requirement, the target node is a node that meets the high availability scheduling policy requirement;

[0020] In the case where the scheduling request also carries an affinity rule requirement, the target node is a node that satisfies the affinity rule requirement;

[0021] In the case where the scheduling request also carries an anti-affinity rule requirement, the target node is a node that meets the anti-affinity rule requirement;

[0022] In the case where the scheduling request also carries a resource utilization maximization policy requirement, the target node is a node that meets the resource utilization maximization policy requirement.

[0023] In a second aspect, an embodiment of the present application provides a resource scheduling system, including: a plurality of clusters, a plurality of cluster agents corresponding one-to-one to the plurality of clusters, an intelligent scheduling controller, and a cluster interface server;

[0024] The cluster interface server is configured to: receive a target Pod creation request sent by a user or a control device, and based on the creation request, send a scheduling request to the intelligent scheduling controller, wherein the scheduling request carries a scheduling requirement corresponding to the target Pod, and the scheduling requirement is used to indicate a resource usage requirement and / or a service quality requirement of the target Pod;

[0025] The intelligent scheduling controller is configured to: receive the scheduling request;

[0026] receiving cluster resource information of the multiple clusters at the current moment sent by the multiple cluster agents;

[0027] Based on the cluster resource information of the multiple clusters, determine a target node in the target cluster; the target cluster is one of the multiple clusters; the target node is a node that can meet the scheduling requirement as an operating environment within a preset time period after the current moment;

[0028] Return the scheduling result to the cluster interface server, where the scheduling result is used to indicate that the target Pod is scheduled to run on the target node;

[0029] The cluster interface server is further configured to: schedule the target Pod to run on the target node based on the scheduling result.

[0030] In a third aspect, an embodiment of the present application provides a resource model training method, including:

[0031] Build a global resource usage model, which is used to determine multiple node scores based on cluster resource information of multiple clusters and the scheduling requirements of the Pod to be scheduled. Each node score is used to indicate a node in a cluster as a matching score of the operating environment and the scheduling requirements of the Pod to be scheduled within a corresponding preset time period;

[0032] Acquire training data, where the training data includes multiple pieces of sample data, each piece of sample data includes historical resource information of multiple clusters, scheduling requirements of historical Pods, and historical scheduling results of the historical Pods; the scheduling requirements are used to indicate resource usage requirements and / or service quality requirements of the historical Pods, and the historical scheduling results are used to indicate that the historical Pods are scheduled to run on historical nodes, where the historical nodes are nodes in one of the multiple clusters;

[0033] Based on the training data, the global resource usage model is trained so that among multiple node scores obtained by the trained global resource usage model, the node score corresponding to the historical scheduling result is greater than or equal to a node score threshold.

[0034] In a fourth aspect, an embodiment of the present application provides a resource scheduling device, including:

[0035] a memory configured to store a computer program;

[0036] The processor is configured to, when calling a computer program, enable the resource scheduling device to implement the resource scheduling method described in the first aspect.

[0037] In a fifth aspect, an embodiment of the present application provides a resource model training device, including:

[0038] a memory configured to store a computer program;

[0039] The processor is configured to enable the resource model training device to implement the resource model training method described in the third aspect when calling the computer program.

[0040] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising: a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the resource scheduling method as shown in the first aspect, or the resource model training method as shown in the third aspect.

[0041] In the seventh aspect, an embodiment of the present application provides a computer program product, including: when the computer program product runs on a computer, the computer implements the resource scheduling method as shown in the first aspect, or the resource model training method as shown in the third aspect.

[0042] The technical solution provided by the embodiment of the present application has the following advantages compared with the related art: In the embodiment of the present application, a scheduling request of a target Pod is received, and the scheduling request carries the scheduling requirements corresponding to the target Pod, and the scheduling requirements are used to indicate the resource usage requirements and / or service quality requirements of the target Pod; based on the cluster resource information of multiple clusters at the current moment, the target node in the target cluster is determined; the target cluster is one of the multiple clusters; the target node is a node that can meet the scheduling requirements as an operating environment within a preset time period after the current moment; the scheduling result is returned, and the scheduling result is used to indicate that the target Pod is scheduled to run on the target node. The solution of the present application, based on the cluster resource information of multiple clusters at the current moment, determines the node that can meet the scheduling requirements as an operating environment within a preset time period after the current moment as a target node, so that dynamic application deployment is achieved by predicting cluster performance, ensuring that the target node can meet the operating requirements of the target Pod within the preset time period, realizing intelligent scheduling, and improving resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the implementation methods in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technology descriptions. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.

[0044] Figure 1 One of the schematic diagrams of Pod scheduling according to some embodiments is shown;

[0045] Figure 2 One of the flowcharts of the resource scheduling method according to some embodiments is shown;

[0046] Figure 3 A second flow chart of a resource scheduling method according to some embodiments is shown;

[0047] Figure 4 A third flowchart of a resource scheduling method according to some embodiments is shown;

[0048] Figure 5 A fourth flowchart of a resource scheduling method according to some embodiments is shown;

[0049] Figure 6 A second schematic diagram of Pod scheduling according to some embodiments is shown;

[0050] Figure 7 A fifth flowchart of a resource scheduling method according to some embodiments is shown;

[0051] Figure 8A schematic diagram of a process of a resource model training method according to some embodiments is shown;

[0052] Fig. 9 A schematic diagram of the structure of a resource scheduling device according to some embodiments is shown;

[0053] Fig.10 A hardware schematic diagram of a device according to some embodiments is shown. DETAILED DESCRIPTION

[0054] In order to make the purpose and implementation method of the present application clearer, the exemplary implementation method of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0055] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.

[0056] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.

[0057] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.

[0058] Next, some of the terms and related technologies involved in this application are explained to facilitate understanding by those skilled in the art.

[0059] Container cloud cluster: In the embodiments of this application, Kubernetes is taken as an example, commonly referred to as k8s, which is an open source container cluster management system for automatically deploying, scaling and managing containerized applications. The system builds a container scheduling service based on the container runtime interface (Container Runtime Interface, CRI) (such as the open source application container engine (Docker), container storage interface (Container Storage Interface, CSI), etc.). Kubernetes can automatically select a working container in a container cluster for use. It aims to provide "a platform for automatic deployment, scaling and running application containers across host clusters." It supports a range of container tools, including Docker, CRI-O, etc.

[0060] Node: A node is a server in Kubernetes. A node represents a host device (physical machine).

[0061] Pod, in Kubernetes, is the smallest unit (basic scheduling unit) that can be created and deployed. It is an application instance in the Kubernetes cluster and is used to provide services. In the Kubernetes cluster, pod is the basis of all business types and the smallest unit level managed by Kubernetes. It is a combination of one or more containers, each of which runs an application. Kubernetes directly manages pods, not containers. For example, in the native Kubernetes design, a group of containers with similar functions form a pod, that is, each pod runs multiple containers. Alternatively, each pod can be customized to correspond to a container one by one, that is, only one container runs in each pod. Two important features of pods are network: each pod is assigned a unique Internet Protocol (IP) address for interconnection between networks. Each container in the pod shares the network namespace, including IP addresses and network ports. Containers in the same pod can communicate with each other on the local host. When containers in the pod need to communicate with entities outside the pod, they need to use shared network resources such as ports.

[0062] Kubernetes API Server is one of the trusted components of Kubernetes. It is the central controller in the Kubernetes cluster, also known as the cluster interface server, responsible for managing all API objects.

[0063] In cloud platform cluster environments, such as container cloud clusters based on Kubernetes, as enterprises move deeper into the cloud, more and more applications are deployed on Kubernetes clusters across multiple cloud providers. How to effectively manage and schedule these resources scattered across different cloud environments has become a key challenge facing enterprises. In addition, due to the lack of a global perspective, it is difficult to reasonably plan and schedule applications when deploying services on these Kubernetes clusters, resulting in low resource utilization and high operating costs. These problems have led to an urgent need for a unified management and scheduling solution based on Kubernetes to address the complexity of container infrastructure and resource utilization efficiency in multi-cloud environments. At present, the industry has already seen some solutions for Kubernetes multi-cluster management, such as Cluster API, Multi-Cluster Management, etc. Figure 1 As shown in the figure, these solutions provide some basic multi-cluster orchestration and resource management capabilities, but the current scheduling only provides static resource allocation functions and cannot dynamically optimize application deployment based on cluster performance.

[0064] In order to solve the above technical problems, the embodiment of the present application provides a resource scheduling method, by receiving a scheduling request of a target Pod, the scheduling request carries the scheduling requirements corresponding to the target Pod, and the scheduling requirements are used to indicate the resource usage requirements and / or service quality requirements of the target Pod; based on the cluster resource information of multiple clusters at the current moment, the target node in the target cluster is determined; the target cluster is one of the multiple clusters; the target node is a node that can meet the scheduling requirements as an operating environment within a preset time period after the current moment; the scheduling result is returned, and the scheduling result is used to indicate that the target Pod is scheduled to run on the target node. In this way, based on the cluster resource information of multiple clusters at the current moment, the node that can meet the scheduling requirements as an operating environment within the preset time period after the current moment is determined as the target node, so that dynamic application deployment is achieved by predicting cluster performance, ensuring that the target node can meet the operating requirements of the target Pod within the preset time period, realizing intelligent scheduling, and improving resource utilization.

[0065] The execution subject of the resource scheduling method provided in the embodiment of the present application can be a server or an electronic device, or a functional module or functional entity in the server or electronic device that can implement the resource scheduling method, which is not limited here. In the embodiment of the present application, the server or electronic device that can implement the resource scheduling method provided in the present application can be a device in one of the multiple clusters, or a controller separately set outside the multiple clusters, which can be determined according to the actual situation, which is not limited here.

[0066] Figure 2This is a flowchart of the steps of implementing a resource scheduling method according to one or more embodiments of the present invention. The resource scheduling method may include the following S201 to S203.

[0067] S201. Receive a scheduling request from a target Pod.

[0068] The scheduling request carries the scheduling requirement corresponding to the target Pod, and the scheduling requirement is used to indicate the resource usage requirement and / or service quality requirement of the target Pod.

[0069] The scheduling request may be generated based on a target Pod creation request sent by a user or a control device. The target Pod creation request may be obtained by the user or the control device based on an application deployment requirement or a service deployment requirement.

[0070] Among them, resource usage requirements may include at least one of the following: CPU usage requirements, memory usage requirements, disk usage requirements, network usage requirements, GPU and other hardware usage requirements; resource usage requirements may also include other feasible usage requirements, which can be determined based on actual conditions and are not limited here.

[0071] Among them, the service quality requirements may include any of the following: the normal operation of the service must be guaranteed, the normal operation of the service is guaranteed with the best efforts, and the normal operation of the service is not guaranteed.

[0072] Among them, the normal operation of the service must be guaranteed. Specifically, the node must allocate the resources (CPU resources, memory resources, disk resources, network resources, GPU and other hardware resources) needed by the target Pod at any time to ensure that the resources will not be preempted by other Pods.

[0073] Among them, making every effort to ensure the normal operation of the service specifically means that the node must make every effort to allocate the resources (CPU resources, memory resources, disk resources, network resources) required by the target Pod at any time, and make every effort to ensure that the resources will not be preempted by other Pods.

[0074] Among them, not guaranteeing the normal operation of the service specifically means that it is sufficient to ensure that the task of the target Pod is successfully executed once at any time. If the target Pod is an offline task, it does not need to be guaranteed to be able to operate normally all the time like an online business.

[0075] Among them, in addition to carrying the scheduling requirements, the scheduling request may also carry other scheduling information, which can be determined based on actual conditions and is not limited here.

[0076] S202: Determine a target node in a target cluster based on cluster resource information of multiple clusters at a current moment.

[0077] The target cluster is one of the multiple clusters; the target node is a node whose operating environment can meet the scheduling requirement within a preset time period after the current moment.

[0078] The target cluster is a cluster among multiple clusters whose operating environment can meet the scheduling requirements within a preset time period after the current moment.

[0079] The cluster resource information of a cluster includes the overall resource capacity of the cluster at the current moment, the current resource usage (CPU resources, memory resources, disk resources, network resources, GPU and other hardware resources), service quality, node status and other dynamic information. The node status can include the resource requirements of all Pods running on the node.

[0080] In some embodiments of the present application, each node of each cluster can be continuously monitored to obtain cluster resource information of multiple clusters in real time. Exemplarily, in an embodiment of the present application, each node of a cluster can be monitored by a cluster agent of a cluster to obtain cluster resource information of the cluster in real time.

[0081] In some embodiments of the present application, a complete cluster topology model can be constructed based on the cluster information obtained through monitoring, and dynamic information such as resource usage data and node status of each cluster can be continuously collected and updated to obtain cluster resource information of multiple clusters.

[0082] In some embodiments of the present application, the preset time period can be a preset time period or a time period related to scheduling requirements. It can be determined based on actual conditions and is not limited here.

[0083] In some embodiments of the present application, the start time of the preset time period may be the current time or a time after the current time, and the specific start time may be determined according to actual conditions and is not limited here.

[0084] In some embodiments of the present application, the target node may be a node among multiple clusters whose operating environment best matches the scheduling requirements within a preset time period; it may also be one of multiple nodes among multiple clusters whose operating environment matches the scheduling requirements within a preset time period; it may also be the first node among multiple clusters determined to match the operating environment with the scheduling requirements within a preset time period; the specific details may be determined based on actual conditions and are not limited here.

[0085] In some embodiments of the present application, based on cluster resource information of multiple clusters, each node of the multiple clusters can be traversed to evaluate the resource usage of the nodes within a preset time period, and determine the nodes that can serve as the operating environment to meet the scheduling requirements.

[0086] In some embodiments of the present application, based on cluster resource information and scheduling requirements of multiple clusters, a global resource usage model can be used to predict nodes that can meet the scheduling requirements as an operating environment within a preset time period.

[0087] S203. Return the scheduling result.

[0088] The scheduling result is used to indicate that the target Pod is scheduled to run on the target node.

[0089] Based on the cluster resource information of multiple clusters at the current moment, the resource usage and load of each node in each cluster at the current moment can be determined. If the scheduling result of the target Pod is determined only based on the resource usage and load of each node in each cluster at the current moment, the Pod to which the target Pod is scheduled may have less resource usage and lower system load at the current moment, but in the future, the resource usage may suddenly increase and the system load may increase (for example, the node may have offline tasks), resulting in poor node performance and failure to meet the resource usage requirements and / or service quality requirements of the target Pod, causing the application or service corresponding to the target Pod to fail to operate normally.

[0090] Therefore, in an embodiment of the present application, by predicting the resource occupancy and system load of each node in each cluster within a preset time period, it is determined that the node can always provide resource guarantee and / or server guarantee for the target Pod as the operating environment within the preset time period, so as to ensure that the application or service corresponding to the target Pod can operate normally.

[0091] In an embodiment of the present application, based on the cluster resource information of multiple clusters at the current moment, the node whose operating environment can meet the scheduling requirements within a preset time period after the current moment is determined as the target node. In this way, dynamic application deployment is achieved by predicting cluster performance, ensuring that the target node can meet the operating requirements of the target Pod within the preset time period, realizing intelligent scheduling, and improving resource utilization.

[0092] In some embodiments of the present application, Figure 2 ,like Figure 3 As shown, the above S202 can be specifically implemented through the following S202a and S202b.

[0093] S202a: Based on the cluster resource information of the multiple clusters and the scheduling requirement, multiple node scores are determined through a global resource usage model.

[0094] Each node score is used to indicate a node in a cluster as a matching score between the operating environment and the scheduling requirement within the preset time period.

[0095] It can be understood that the higher the node score corresponding to a node is, the higher the matching degree between the node as an operating environment and the scheduling requirements within the preset time period is.

[0096] The global resource usage model is a pre-trained model. The specific training process is described in the following resource model training method, which will not be described here.

[0097] S202b: Determine the target node based on the multiple node scores.

[0098] Among them, the node score corresponding to the target node is greater than or equal to the node score threshold.

[0099] In some embodiments of the present application, the node scoring threshold may be preset or determined in real time, and may be determined specifically based on actual conditions, which is not limited here.

[0100] In some embodiments of the present application, when the node score threshold is obtained in real time, the node score threshold can be the maximum value of multiple node scores, or the minimum value of multiple largest node scores. The specific value can be determined according to actual conditions and is not limited here.

[0101] In an embodiment of the present application, a global resource usage model is used to predict the nodes that can meet the scheduling requirements as an operating environment within a preset time period, which can improve the processing speed. Moreover, by evaluating and predicting the usage of overall resources, potential resource bottlenecks, load hotspots and other problems can be identified, and the target nodes can be determined more accurately, thereby improving processing efficiency.

[0102] In some embodiments of the present application, the cluster resource information of the multiple clusters includes cluster-level resource information and node-level resource information of the multiple clusters; Figure 3 ,like Figure 4 As shown, the above S202a can be specifically implemented through the following S202a1 to S202a3.

[0103] S202a1 : Based on the cluster-level resource information of the multiple clusters and the scheduling requirement, multiple cluster scores are determined through the global resource usage model.

[0104] Each cluster score is used to indicate a matching score between a cluster as an operating environment and the scheduling requirement within the preset time period.

[0105] It can be understood that the higher the cluster score corresponding to a cluster is, the higher the matching degree between the cluster as an operating environment and the scheduling requirements within the preset time period is.

[0106] S202a2: Determine at least one candidate cluster from the multiple clusters based on the multiple cluster scores.

[0107] Among them, the cluster score corresponding to each candidate cluster is greater than or equal to the cluster score threshold.

[0108] In some embodiments of the present application, the cluster scoring threshold may be preset or determined in real time, and may be specifically determined according to actual conditions, which is not limited here.

[0109] In some embodiments of the present application, when the cluster score threshold is obtained in real time, the cluster score threshold can be the maximum value of multiple cluster scores, or the minimum value of multiple largest cluster scores. The specific value can be determined according to actual conditions and is not limited here.

[0110] In some embodiments of the present application, at least one candidate cluster may be one or more candidate clusters. For example, at least one candidate cluster may be one or more clusters with the highest cluster score, which may be determined based on a cluster score threshold.

[0111] S202a3: Based on the node-level resource information of the at least one candidate cluster, determine the multiple node scores through the global resource usage model.

[0112] In an embodiment of the present application, cluster resource information of multiple clusters is divided into cluster-level resource information and node-level resource information, and then based on the cluster-level resource information of the multiple clusters and the scheduling requirements, at least one candidate cluster is first determined through the global resource usage model, and then based on the node-level resource information of the at least one candidate cluster, the target node is determined from the at least one candidate cluster through the global resource usage model, thereby improving the efficiency of determining the target node.

[0113] In some embodiments of the present application, Figure 3 ,like Figure 5 As shown, the above S202b can be specifically implemented through the following S202b1 and S202b2.

[0114] S202b1. When there is a target node score among the multiple node scores, determine a node corresponding to the target node score as the target node.

[0115] It can be understood that in this case, if the node scoring threshold is preset, the target node score is the only one among the multiple node scores that is greater than or equal to the node scoring threshold; if the node scoring threshold is obtained in real time, the target node score is the maximum value among the multiple node scores (corresponding to the above S202b, that is, determining the node corresponding to the maximum value among the multiple node scores as the target node, that is, the target node is the optimal node (the most suitable node) for the target Pod, and the target cluster is the optimal cluster (the most suitable cluster) for the target Pod).

[0116] S202b2: When there are multiple target node scores among the multiple node scores, determine the node with the lowest system load after a preset period of time among the nodes corresponding to the multiple target node scores as the target node.

[0117] The preset duration can be determined according to actual conditions and is not limited here. For example, the preset duration can be 0, or it can be the duration from the current time to the start time of the preset time period.

[0118] It can be understood that when the node scores of multiple nodes are similar, that is, when multiple nodes have a high degree of match with the scheduling requirements, the optimal node in the optimal cluster can be selected based on the node load. In this way, the target Pod can be scheduled to a node with a lower system load and relatively idle after the preset time, so that the target Pod can achieve the best effect after the business volume increases after the preset time.

[0119] In some embodiments of the present application, when the scheduling request also carries a high availability policy requirement, the target node is a node that meets the high availability scheduling policy requirement;

[0120] In the case where the scheduling request also carries an affinity rule requirement, the target node is a node that satisfies the affinity rule requirement;

[0121] In the case where the scheduling request also carries an anti-affinity rule requirement, the target node is a node that meets the anti-affinity rule requirement;

[0122] In the case where the scheduling request also carries a resource utilization maximization policy requirement, the target node is a node that meets the resource utilization maximization policy requirement.

[0123] Among them, the affinity rule requires that the Pod of the specified business be scheduled to the same node, and the anti-affinity rule requires that the Pod of the specified business not be scheduled to the same node.

[0124] Among them, the high availability scheduling strategy requires that the Pod cannot be scheduled to the same node as other Pods of the same business. If a business needs to deploy multiple Pods, multiple Pods cannot be deployed on the same node, but must be deployed on different nodes (they can be deployed in the same cluster) to avoid multiple Pods being affected if one node has a problem.

[0125] The resource utilization maximization strategy requirement may be to select a node with low node resource utilization for deployment, improve the resource utilization of the node, increase the CPU memory usage of the node, and improve resource utilization; it may also be that the node resources allocated to the same business are limited, and multiple Pods of the business are deployed on the same node to improve the resource utilization of the node; it may also be that Pods of different businesses need to interact with each other, so Pods of different businesses are scheduled to the same node, and the network for interaction between Pods is from this node to this node, and there is no need to access the business across nodes, which can save network resource bandwidth, thereby improving the resource utilization of the node.

[0126] In the embodiment of the present application, by treating multiple clusters as a unified resource pool and integrating multiple scheduling strategies and / or constraint rules, intelligent global resource orchestration and continuous optimization are achieved.

[0127] like Figure 6 As shown, an embodiment of the present application provides a resource scheduling system, including: multiple clusters 601, multiple cluster agents 602 corresponding to the multiple clusters 601, an intelligent scheduling controller 603, and a cluster interface server 604 (i.e., a Kubernetes API Server). Among them, the cluster interface server is configured to: receive a creation request for a target Pod sent by a user or a control device, and based on the creation request, send a scheduling request to the intelligent scheduling controller, the scheduling request carries a scheduling requirement corresponding to the target Pod, and the scheduling requirement is used to indicate the resource usage requirement and / or service quality requirement of the target Pod; the intelligent scheduling controller is configured to: receive the scheduling request; receive cluster resource information of the multiple clusters at the current moment sent by the multiple cluster agents; determine the target node in the target cluster based on the cluster resource information of the multiple clusters; the target cluster is one of the multiple clusters; the target node is a node that can meet the scheduling requirement as an operating environment within a preset time period after the current moment; return a scheduling result to the cluster interface server, the scheduling result is used to indicate that the target Pod is scheduled to run on the target node; the cluster interface server is also configured to: schedule the target Pod to run on the target node based on the scheduling result.

[0128] For example, Figure 7 As shown, it is a flowchart of implementing the resource scheduling method provided by the present application through the resource scheduling system provided by the present application, which specifically includes the following S701 to S706.

[0129] S701. The cluster interface server receives a request to create a target Pod sent by a user or a control device.

[0130] When a user or other controller (control device) sends a request to the Kubernetes API Server to create a new Pod, a new scheduling process is triggered.

[0131] S702: The cluster interface server sends a scheduling request to the intelligent scheduling controller based on the creation request.

[0132] The scheduling request carries the scheduling requirement corresponding to the target Pod, and the scheduling requirement is used to indicate the resource usage requirement and / or service quality requirement of the target Pod.

[0133] Accordingly, the intelligent scheduling controller receives the scheduling request.

[0134] S703: The intelligent scheduling controller receives cluster resource information of the multiple clusters at the current moment sent by the multiple cluster agents.

[0135] In each cluster, an agent is deployed to continuously collect resource usage data, node status and other information of the cluster, and report this monitoring data to the intelligent scheduling controller through a secure channel.

[0136] The monitoring data receiving module of the intelligent scheduling controller obtains the reported data from each cluster agent and aggregates it into a centralized data storage system to build a global view (cluster topology model), that is, the cluster resource information of multiple clusters.

[0137] S704: The intelligent scheduling controller determines a target node in a target cluster based on cluster resource information of the multiple clusters.

[0138] The target cluster is one of the multiple clusters; the target node is a node whose operating environment can meet the scheduling requirement within a preset time period after the current moment.

[0139] The intelligent scheduling controller can build a global resource usage model, and then train the global resource usage model based on the historical cluster resource information, historical Pods, and historical scheduling results of historical Pods of each cluster. Then, based on the trained global resource usage model, it analyzes and predicts whether each node of each cluster can meet the scheduling requirements of the target Pod when used as the operating environment of the target Pod, or whether it can meet the scheduling requirements and scheduling strategies (or constraint rules) of the target Pod, so as to determine the most suitable cluster for deploying the target Pod and make the appropriate node as the target operating environment. If the scores of multiple clusters are similar, they can be further screened according to additional rules (such as load conditions, etc.).

[0140] S705. The intelligent scheduling controller returns the scheduling result to the cluster interface server.

[0141] The information of the target node in the target cluster is written into the scheduling result of the Pod. The Kubernetes API Server obtains the result and schedules the Pod to run on the node of the corresponding cluster.

[0142] The scheduling result is used to indicate that the target Pod is scheduled to run on the target node.

[0143] S706: The cluster interface server schedules the target Pod to run on the target node based on the scheduling result.

[0144] In an embodiment of the present application, when a new Pod needs to be scheduled, the intelligent scheduling controller will evaluate the resource status of all nodes in all clusters based on the global resource usage model, and combine the scheduling requirements (scheduling requirements and scheduling strategies (or constraints)) (such as high availability, affinity, anti-affinity, etc.) to make intelligent cross-cluster scheduling decisions and schedule the Pod to run on the node of the most suitable cluster.

[0145] Through the above global resource scheduling and management, the intelligent scheduling controller provided by the embodiment of the present application can greatly improve the resource utilization, availability and operation and maintenance efficiency in a multi-cluster environment, while meeting the service quality requirements of the application. It provides strong support for enterprises to build hybrid cloud or multi-cloud architecture and realize unified orchestration of cross-cloud resources.

[0146] In the embodiment of the present application, comprehensive monitoring and dynamic evaluation of the cluster are achieved to provide a basis for scheduling decisions, improve the overall resource utilization of the enterprise in multi-cluster scenarios, and ensure that all resources are fully utilized. When deploying services, the optimal cluster node is selected for deployment according to the controller. Through the above innovative measures, this solution can better meet the resource management and application deployment needs of enterprises in a multi-cloud Kubernetes environment, and make up for the shortcomings of existing technical solutions.

[0147] like Figure 8 As shown, a flow chart of a resource model training method is provided for an embodiment of the present application. The resource model training method specifically includes the following S801 to S803.

[0148] S801. Build a global resource usage model.

[0149] The global resource usage model is used to determine multiple node scores based on cluster resource information of multiple clusters and the scheduling requirements of the Pod to be scheduled, and each node score is used to indicate a node in a cluster as a matching score of the operating environment and the scheduling requirements of the Pod to be scheduled within a corresponding preset time period;

[0150] S802: Obtain training data.

[0151] Among them, the training data includes multiple sample data, each sample data includes historical resource information of multiple clusters, scheduling requirements of historical Pods, and historical scheduling results of the historical Pods; the scheduling requirements are used to indicate the resource usage requirements and / or service quality requirements of the historical Pods, and the historical scheduling results are used to indicate that the historical Pods are scheduled to run on a historical node, and the historical node is a node in one of the multiple clusters.

[0152] S803: Based on the training data, the global resource usage model is trained so that among the multiple node scores obtained by the trained global resource usage model, the node score corresponding to the historical scheduling result is greater than or equal to a node score threshold.

[0153] In the embodiments of the present application, the specific model building process and model training process can refer to the relevant technology and will not be described in detail here.

[0154] In an embodiment of the present application, a global resource usage model is used to predict the nodes that can meet the scheduling requirements as an operating environment within a preset time period, which can improve the processing speed. Moreover, by evaluating and predicting the usage of overall resources, potential resource bottlenecks, load hotspots and other problems can be identified, and the target nodes can be determined more accurately, thereby improving processing efficiency.

[0155] Fig. 9 The structure diagram of the resource scheduling device shown in the embodiment of the present disclosure is as follows: Fig. 9 As shown, the device includes: a receiving module 901, which is used to receive a scheduling request of a target Pod, the scheduling request carries a scheduling requirement corresponding to the target Pod, and the scheduling requirement is used to indicate the resource usage requirement and / or service quality requirement of the target Pod; a determining module 902, which is used to determine a target node in a target cluster based on cluster resource information of multiple clusters at the current moment; the target cluster is one of the multiple clusters; the target node is a node that can meet the scheduling requirement as an operating environment within a preset time period after the current moment; a returning module 903, which is used to return a scheduling result, and the scheduling result is used to indicate that the target Pod is scheduled to run on the target node.

[0156] In some embodiments of the present application, the determination module 902 is specifically used to determine multiple node scores based on the cluster resource information of the multiple clusters and the scheduling requirements through a global resource usage model, each node score is used to indicate a node in a cluster as a matching score between the operating environment and the scheduling requirements within the preset time period; based on the multiple node scores, the target node is determined, and the node score corresponding to the target node is greater than or equal to the node score threshold.

[0157] In some embodiments of the present application, the cluster resource information of the multiple clusters includes cluster-level resource information and node-level resource information of the multiple clusters; the determination module 902 is specifically used to determine multiple cluster scores based on the cluster-level resource information of the multiple clusters and the scheduling requirements through the global resource usage model, each cluster score is used to indicate a matching score of a cluster as an operating environment and the scheduling requirements within the preset time period; based on the multiple cluster scores, at least one candidate cluster is determined from the multiple clusters, and the cluster score corresponding to each candidate cluster is greater than or equal to a cluster score threshold; based on the node-level resource information of the at least one candidate cluster, the multiple node scores are determined through the global resource usage model.

[0158] In some embodiments of the present application, the determination module 902 is specifically used to, when there is a target node score among the multiple node scores, determine the node corresponding to the one target node score as the target node; when there are multiple target node scores among the multiple node scores, determine the node with the lowest system load after a preset period of time among the nodes corresponding to the multiple target node scores as the target node.

[0159] In some embodiments of the present application, when the scheduling request also carries a high availability policy requirement, the target node is a node that meets the high availability scheduling policy requirement; when the scheduling request also carries an affinity rule requirement, the target node is a node that meets the affinity rule requirement; when the scheduling request also carries an anti-affinity rule requirement, the target node is a node that meets the anti-affinity rule requirement; when the scheduling request also carries a resource utilization maximization policy requirement, the target node is a node that meets the resource utilization maximization policy requirement.

[0160] In the embodiment of the present application, each module of the resource scheduling device can implement the resource scheduling method provided by the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0161] like Fig.10As shown, an embodiment of the present application further provides a device 1000. When the device 1000 is a resource scheduling device, the device 1000 includes: a processor 1001, a memory 1002, and a computer program stored on the memory 1002 and executable on the processor 1001. When the computer program is executed by the processor 1001, the various processes performed by the resource scheduling method described above are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here. When the device 1000 is a resource model training device, the device 1000 includes: a processor 1001, a memory 1002, and a computer program stored on the memory 1002 and executable on the processor 1001. When the computer program is executed by the processor 1001, the various processes performed by the resource model training method described above are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0162] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the various processes executed by the above-mentioned resource scheduling method, or the various processes executed by the above-mentioned resource model training method, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0163] The computer readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0164] The present invention provides a computer program product, comprising: when the computer program product is run on a computer, the computer is enabled to implement the above-mentioned resource scheduling method or the above-mentioned resource model training method.

[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

[0166] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.

Claims

1. A resource scheduling method, characterized in that: include: Receive a scheduling request of a target Pod, the scheduling request carrying a scheduling requirement corresponding to the target Pod, the scheduling requirement being used to indicate a resource usage requirement and / or a quality of service requirement of the target Pod; Determine a target node in a target cluster based on cluster resource information of multiple clusters at the current moment; The target cluster is one of the multiple clusters; The target node is a node whose operating environment can meet the scheduling requirements within a preset time period after the current moment; Returns a scheduling result, where the scheduling result is used to indicate that the target Pod is scheduled to run on the target node.

2. The method according to claim 1, characterized in that The determining of the target node in the target cluster based on the cluster resource information of the multiple clusters at the current moment includes: Based on the cluster resource information of the multiple clusters and the scheduling requirements, a plurality of node scores are determined through a global resource usage model, each node score being used to indicate a matching score of a node in a cluster as an operating environment and the scheduling requirements within the preset time period; The target node is determined based on the multiple node scores, and the node score corresponding to the target node is greater than or equal to a node score threshold.

3. The method according to claim 2, characterized in that The cluster resource information of the multiple clusters includes cluster-level resource information and node-level resource information of the multiple clusters; the determining of multiple node scores based on the cluster resource information of the multiple clusters and the scheduling requirements through a global resource usage model includes: Based on the cluster-level resource information of the multiple clusters and the scheduling requirements, a plurality of cluster scores are determined through the global resource usage model, each cluster score being used to indicate a matching score of a cluster as an operating environment and the scheduling requirements within the preset time period; Based on the multiple cluster scores, determining at least one candidate cluster from the multiple clusters, the cluster score corresponding to each candidate cluster being greater than or equal to a cluster score threshold; The plurality of node scores are determined based on the node-level resource information of the at least one candidate cluster and through the global resource usage model.

4. The method according to claim 2, characterized in that: The step of determining the target node based on the multiple node scores includes: In the case where there is one target node score among the multiple node scores, determining a node corresponding to the one target node score as the target node; In the case that there are multiple target node scores among the multiple node scores, a node with the lowest system load after a preset time period among the nodes corresponding to the multiple target node scores is determined as the target node.

5. The method according to any one of claims 1 to 4, characterized in that In the case where the scheduling request also carries a high availability policy requirement, the target node is a node that meets the high availability scheduling policy requirement; In the case where the scheduling request also carries affinity rule requirements, the target node is a node that meets the affinity rule requirements; In the case where the scheduling request also carries an anti-affinity rule requirement, the target node is a node that meets the anti-affinity rule requirement; In the case where the scheduling request also carries a resource utilization maximization policy requirement, the target node is a node that meets the resource utilization maximization policy requirement.

6. A resource scheduling system, characterized in that: include: A plurality of clusters, a plurality of cluster agents corresponding to the plurality of clusters one by one, an intelligent scheduling controller, and a cluster interface server; The cluster interface server is configured to: receive a creation request of a target Pod sent by a user or a control device, and based on the creation request, send a scheduling request to the intelligent scheduling controller, wherein the scheduling request carries a scheduling requirement corresponding to the target Pod, and the scheduling requirement is used to indicate a resource usage requirement and / or a service quality requirement of the target Pod; The intelligent scheduling controller is configured to: receive the scheduling request; receiving cluster resource information of the multiple clusters at a current moment sent by the multiple cluster agents; Determining a target node in a target cluster based on cluster resource information of the multiple clusters; The target cluster is one of the multiple clusters; The target node is a node whose operating environment can meet the scheduling requirements within a preset time period after the current moment; Returning a scheduling result to the cluster interface server, where the scheduling result is used to indicate that the target Pod is scheduled to run on the target node; The cluster interface server is further configured to: schedule the target Pod to run on the target node based on the scheduling result.

7. A resource model training method, characterized in that: include: Construct a global resource usage model, wherein the global resource usage model is used to determine multiple node scores based on cluster resource information of multiple clusters and the scheduling requirements of the Pod to be scheduled, and each node score is used to indicate a matching score of a node in a cluster as an operating environment and the scheduling requirements of the Pod to be scheduled within a corresponding preset time period; Acquire training data, where the training data includes multiple sample data, each sample data includes historical resource information of multiple clusters, scheduling requirements of historical Pods, and historical scheduling results of the historical Pods; the scheduling requirements are used to indicate resource usage requirements and / or service quality requirements of the historical Pods, and the historical scheduling results are used to indicate that the historical Pods are scheduled to run on historical nodes, where the historical nodes are nodes in one of the multiple clusters; Based on the training data, the global resource usage model is trained so that among the multiple node scores obtained by the trained global resource usage model, the node score corresponding to the historical scheduling result is greater than or equal to a node score threshold.

8. A resource scheduling device, characterized in that: include: a memory configured to store a computer program; The processor is configured to enable the resource scheduling device to implement the resource scheduling method according to any one of claims 1 to 5 when calling a computer program.

9. A resource model training device, characterized in that: include: a memory configured to store a computer program; The processor is configured to enable the resource model training device to implement the resource model training method described in claim 7 when calling the computer program.

10. A computer-readable storage medium, characterized in that: include: A computer program is stored on a computer-readable storage medium, and when the computer program is executed by a processor, the resource scheduling method as described in any one of claims 1 to 5, or the resource model training method as described in claim 7 is implemented.

Citation Information

Cited By

  • Request scheduling method and system, electronic device and storage medium

    WO2026184170A1