Resource scheduling method and device, electronic equipment, storage medium and program product
By acquiring and predicting cluster resource usage information, and using deep learning models to determine the containers to be scheduled and the target cluster, the problem of cluster resource waste is solved, and balanced resource utilization is achieved.
Patent Information
- Application Number
- CN202511050268.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-11
AI Technical Summary
Existing cluster resource scheduling methods cannot predict dynamic changes in resources, resulting in wasted resources on some computing nodes and low overall resource utilization.
By acquiring cluster resource usage information, performing prediction and feature extraction, and using deep learning models to determine the containers to be scheduled and their target clusters, dynamic scheduling of containers is achieved.
This improved the utilization rate of cluster resources, avoided the idleness of some cluster resources, and achieved balanced utilization of resources.
Smart Images

Figure CN120929259A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a resource scheduling method, apparatus, electronic device, storage medium, and program product. Background Technology
[0002] Clustering is used to organize multiple physical or virtual hosts (nodes) into a single entity, coordinating the deployment and scheduling of containers through a unified management tool. Containers are a resource isolation technology that can be used to encapsulate applications (such as medical or financial applications) and their dependencies in an isolated environment, ensuring the stable operation of service instances in different environments. Currently, existing cluster resource scheduling methods typically achieve cluster resource scheduling based on static allocation requests to multiple clusters. This approach cannot predict dynamic changes in resources, easily leading to wasted resources on some compute nodes across multiple clusters and resulting in low overall resource utilization across multiple clusters. Summary of the Invention
[0003] The main objective of this application is to provide a resource scheduling method, apparatus, electronic device, storage medium, and program product, which aims to improve the resource utilization of multiple clusters.
[0004] To achieve the above objectives, a first aspect of this application proposes a resource scheduling method applied to a cluster system, the cluster system including multiple clusters, each cluster being used to host multiple containers, the method comprising:
[0005] First resource usage information corresponding to multiple clusters is obtained. The first resource usage information corresponding to each cluster is determined based on the second resource usage information corresponding to multiple containers carried by each cluster. The second resource usage information corresponding to each container is used to indicate the resources used by each container during runtime.
[0006] For each cluster, predictions are made based on the second resource usage information corresponding to the multiple containers carried by the cluster, to obtain the predicted resource usage information corresponding to the multiple containers.
[0007] Based on the predicted resource usage information corresponding to each of the multiple containers, determine the containers to be scheduled among the multiple containers;
[0008] Based on the predicted resource usage information corresponding to the container to be scheduled and the first resource usage information corresponding to the multiple clusters respectively, the identifier of the target cluster corresponding to the container to be scheduled is determined.
[0009] Based on the identifier of the target cluster corresponding to the container to be scheduled, the configuration information of the container to be scheduled is transmitted to the target cluster so as to deploy the container to be scheduled in the target cluster.
[0010] In some embodiments, the first resource usage information includes total resource information; determining the container to be scheduled among the plurality of containers based on the predicted resource usage information corresponding to the plurality of containers includes:
[0011] Based on the predicted resource usage information corresponding to each of the multiple containers, the predicted load information of the cluster is determined;
[0012] If the predicted load information is greater than the load threshold, then multiple containers are filtered according to the predicted load information and the load threshold to obtain the container to be scheduled; the load threshold is determined based on the total resource information, and the predicted resource usage information corresponding to the container to be scheduled is greater than or equal to the difference between the predicted load information and the load threshold.
[0013] In some embodiments, the first resource usage information corresponding to the plurality of clusters includes the remaining resource information corresponding to the plurality of clusters, and the remaining resource information corresponding to the plurality of clusters is determined based on the total resource information corresponding to the plurality of clusters and the predicted load information corresponding to the plurality of clusters.
[0014] The step of determining the identifier of the target cluster corresponding to the container to be scheduled based on the predicted resource usage information corresponding to the container to be scheduled and the first resource usage information corresponding to the multiple clusters respectively includes:
[0015] Clusters whose remaining resource information is greater than the predicted resource usage information corresponding to the container to be scheduled are selected as candidate clusters.
[0016] The target cluster corresponding to the container to be scheduled is determined from the candidate clusters, and the identifier of the target cluster corresponding to the container to be scheduled is obtained.
[0017] In some embodiments, the number of candidate clusters is multiple, and determining the target cluster corresponding to the container to be scheduled from the candidate clusters includes:
[0018] The remaining resource information corresponding to each of the multiple candidate clusters is subjected to a first preset processing to obtain the remaining resource scores corresponding to each of the multiple candidate clusters. The first preset processing is to match the remaining resource information corresponding to each of the multiple candidate clusters with a first relation, or to input the remaining resource information corresponding to each of the multiple candidate clusters into a pre-trained first scoring model. The first relation includes multiple preset remaining resource information and the remaining resource score corresponding to each preset resource information. The first scoring model adopts a deep learning model, and the remaining resource score corresponding to each candidate cluster is used to characterize the sufficiency of remaining resources of each candidate cluster.
[0019] Based on the remaining resource scores corresponding to the multiple candidate clusters, the target cluster corresponding to the container to be scheduled among the candidate clusters is determined.
[0020] In some embodiments, determining the target cluster corresponding to the container to be scheduled among the candidate clusters based on the remaining resource scores corresponding to the plurality of candidate clusters includes:
[0021] Obtain the distance between each of the candidate clusters and the cluster where the container to be scheduled is deployed, as well as the container migration success rate of each of the candidate clusters within a historical time period;
[0022] The distances between the candidate clusters and the clusters deployed by the container to be scheduled are processed by a second preset process to obtain distance scores corresponding to the candidate clusters. The second preset process is to match the distances between the candidate clusters and the clusters deployed by the container to be scheduled with a second relationship, or to input the distances between the candidate clusters and the clusters deployed by the container to be scheduled into a pre-trained second scoring model. The second relationship includes multiple preset distances and distance scores corresponding to each preset distance. The second scoring model adopts a deep learning model.
[0023] A third preset processing is performed on the container migration success rates of the multiple candidate clusters within a historical time period to obtain migration success rate scores for each candidate cluster. The third preset processing involves matching the container migration success rates of the multiple candidate clusters within a historical time period with a third relationship, or inputting the container migration success rates of the multiple candidate clusters within a historical time period into a pre-trained third scoring model. The third relationship includes multiple preset migration success rates and migration success rate scores corresponding to each migration success rate. The third scoring model adopts a deep learning model, and the migration success rate score corresponding to each candidate cluster is used to characterize the success rate of deploying the scheduled container to each candidate cluster.
[0024] The total score for each candidate cluster is obtained by weighted summation based on the remaining resource score, the first weight corresponding to the remaining resource score, the distance score, the second weight corresponding to the distance score, the migration success rate score, and the third weight corresponding to the migration success rate score for each candidate cluster.
[0025] The candidate cluster corresponding to the maximum total score is taken as the target cluster corresponding to the container to be scheduled.
[0026] In some embodiments, the step of predicting resource usage information for each of the multiple containers carried by the cluster based on the second resource usage information for each container includes:
[0027] Feature extraction processing is performed on the second resource usage information corresponding to the multiple containers respectively to obtain the resource usage features corresponding to the multiple containers respectively;
[0028] The resource usage features corresponding to the multiple containers are respectively input into the resource usage prediction model to obtain the predicted resource usage information corresponding to the multiple containers. The resource usage prediction model adopts a long short-term memory network model.
[0029] To achieve the above objectives, a second aspect of this application provides a resource scheduling apparatus applied to a cluster system, the cluster system including multiple clusters, each cluster being used to host multiple containers, the apparatus comprising:
[0030] The acquisition module is used to acquire first resource usage information corresponding to multiple clusters respectively. The first resource usage information corresponding to each cluster is determined according to the second resource usage information corresponding to multiple containers carried by each cluster. The second resource usage information corresponding to each container is used to indicate the resources used by each container during runtime.
[0031] The prediction module is used to predict the resource usage information corresponding to the multiple containers carried by the cluster for each cluster.
[0032] The first determining module is used to determine the container to be scheduled among the multiple containers based on the predicted resource usage information corresponding to the multiple containers respectively;
[0033] The second determining module is used to determine the identifier of the target cluster corresponding to the container to be scheduled based on the predicted resource usage information corresponding to the container to be scheduled and the first resource usage information corresponding to the multiple clusters respectively.
[0034] The transmission module is used to transmit the configuration information of the container to be scheduled to the target cluster according to the identifier of the target cluster corresponding to the container to be scheduled, so as to deploy the container to be scheduled in the target cluster.
[0035] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the resource scheduling method described in the first aspect.
[0036] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the resource scheduling method described in the first aspect.
[0037] To achieve the above objectives, a fifth aspect of the present application provides a computer program product in which, when the instructions in the computer program product are executed by an electronic device, the electronic device performs the resource scheduling method as described in the first aspect above.
[0038] The resource scheduling method, apparatus, electronic device, storage medium, and program product proposed in this application acquire first resource usage information corresponding to multiple clusters. The first resource usage information for each cluster is determined based on second resource usage information corresponding to multiple containers hosted by that cluster. Then, for each cluster, prediction is made based on the second resource usage information corresponding to the multiple containers hosted by the cluster to obtain predicted resource usage information for each container. Next, based on the predicted resource usage information for each container, the containers to be scheduled are identified. Then, based on the predicted resource usage information for the containers to be scheduled and the first resource usage information corresponding to the multiple clusters, the identifier of the target cluster corresponding to the containers to be scheduled is determined. Finally, based on the identifier of the target cluster corresponding to the containers to be scheduled, the configuration information of the containers to be scheduled is transmitted to the target cluster for deployment. By predicting the resource usage information corresponding to multiple containers, the above steps can pre-schedule containers to clusters with abundant resources, avoiding resource idleness in some clusters while resource strain in others, thereby achieving balanced utilization of resources across multiple clusters and improving overall resource utilization. Attached Figure Description
[0039] Figure 1 This is a flowchart of the resource scheduling method provided in the embodiments of this application;
[0040] Figure 2 yes Figure 1 The flowchart of step S103 in the process;
[0041] Figure 3 yes Figure 1 The flowchart of step S104 in the process;
[0042] Figure 4 yes Figure 3 The flowchart of step S302 in the text;
[0043] Figure 5 This is a schematic diagram of the structure of the resource scheduling device provided in the embodiments of this application;
[0044] Figure 6 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0046] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0048] First, let's analyze some of the terms used in this application:
[0049] A cluster is a system composed of multiple computers (or servers). These computers are connected via a network and can work together to complete specific tasks. Logically, a cluster is viewed as a single computing resource, which can provide greater processing power, higher availability, and better scalability than a single device.
[0050] Containers: A lightweight virtualization technology used to package applications and their dependencies (such as libraries, configuration files, runtime environments, etc.) so that they can run consistently in any environment that supports a container engine (such as physical machines, virtual machines, cloud servers).
[0051] Resources: refers to the various hardware or software elements that support system operation and application deployment. They are the foundation for completing computing tasks and can usually be divided into hardware resources (such as memory, storage, network bandwidth, or central processing unit) and software resources.
[0052] Based on this, embodiments of this application provide a resource scheduling method, apparatus, electronic device, storage medium, and program product, aiming to improve the resource utilization of multiple clusters.
[0053] The resource scheduling method, apparatus, electronic device, storage medium, and program product provided in this application are specifically described through the following embodiments. First, the resource scheduling method in the embodiments of this application is described.
[0054] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0055] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0056] The resource scheduling method provided in this application relates to the field of artificial intelligence technology. The resource scheduling method provided in this application can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the resource scheduling method, but is not limited to the above forms.
[0057] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0058] Figure 1This is a flowchart of the resource scheduling method provided in an embodiment of this application. Please refer to [link / reference]. Figure 1 This application provides a resource scheduling method applied to a cluster system, wherein the cluster system includes multiple clusters, and each cluster is used to host multiple containers. Figure 1 The method may include, but is not limited to, steps S101 to S105.
[0059] Step S101: Obtain first resource usage information corresponding to the multiple clusters respectively. The first resource usage information corresponding to each cluster is determined according to the second resource usage information corresponding to the multiple containers carried by each cluster. The second resource usage information corresponding to each container is used to indicate the resources used by each container during runtime.
[0060] Step S102: For each cluster, predict the resource usage information corresponding to the multiple containers carried by the cluster based on the second resource usage information respectively, and obtain the predicted resource usage information corresponding to the multiple containers respectively.
[0061] Step S103: Based on the predicted resource usage information corresponding to the multiple containers, determine the containers to be scheduled among the multiple containers;
[0062] Step S104: Determine the identifier of the target cluster corresponding to the container to be scheduled based on the predicted resource usage information corresponding to the container to be scheduled and the first resource usage information corresponding to the multiple clusters respectively.
[0063] Step S105: Based on the identifier of the target cluster corresponding to the container to be scheduled, transmit the configuration information of the container to be scheduled to the target cluster, so as to deploy the container to be scheduled in the target cluster.
[0064] The resource scheduling method provided in this application is applied to a cluster system. Using this method, resources can be scheduled across multiple clusters within the system to balance the load and improve resource utilization. Each cluster hosts multiple containers. Containers can be used to encapsulate financial applications and their dependencies. By starting a container encapsulating a financial application and its dependencies, at least one container instance can be generated to provide financial services to relevant objects through the operation of the container instance. Alternatively, containers can be used to encapsulate medical applications and their dependencies. By starting a container encapsulating a medical application and its dependencies, at least one container instance can be generated to provide medical services to relevant objects through the operation of the container instance.
[0065] Specifically, for each cluster, second resource usage information corresponding to each of the multiple containers hosted by the cluster can be obtained, such as at least one of Central Processing Unit (CPU) usage, memory usage, network I / O, or disk I / O. Network I / O refers to the rate at which containers send and receive data through a network interface (such as a network card). Disk I / O refers to the rate at which containers read and write data to storage devices (such as local disks or mounted storage devices). Then, based on the second resource usage information corresponding to each of the multiple containers hosted by the cluster, the first resource usage information corresponding to the cluster can be determined. For example, when the second resource usage information corresponding to each of the multiple containers hosted by the cluster includes CPU usage, the CPU usage of each container can be added together to obtain the CPU load corresponding to the cluster; in this case, the first resource usage information corresponding to the cluster includes the CPU load corresponding to the cluster. When the second resource usage information corresponding to each of the multiple containers hosted by the cluster includes memory usage, the memory usage of each container can be added together to obtain the memory load corresponding to the cluster; in this case, the first resource usage information corresponding to the cluster includes the memory load corresponding to the cluster. When the second resource usage information for multiple containers hosted in the cluster includes network I / O, the network I / O for each container can be summed to obtain the network I / O load for the cluster. In this case, the first resource usage information for the cluster includes the network I / O load. Similarly, when the second resource usage information for multiple containers hosted in the cluster includes disk I / O, the disk I / O for each container can be summed to obtain the disk I / O load for the cluster. In this case, the first resource usage information for the cluster includes the disk I / O load.
[0066] Subsequently, for each cluster, predictions are made based on the second resource usage information corresponding to the multiple containers hosted by the cluster, resulting in predicted resource usage information for each container. For example, the second resource usage information for each container can be input into a pre-trained Long Short-Term Memory (LSTM) network model. The LTM network model processes this information to obtain the predicted resource usage information for each container output by the model. Alternatively, the second resource usage information for each container can be matched with multiple historical resource usage information in a preset relationship, and the predicted resource usage information corresponding to the successfully matched historical information can be used as the predicted resource usage information for each container. The preset relationship includes multiple historical resource usage information and the predicted resource usage information corresponding to each historical information.
[0067] After obtaining the predicted resource usage information for each of the multiple containers, the containers to be scheduled can be determined based on this information. For example, containers with predicted resource usage exceeding a preset value can be designated as scheduled containers. For instance, if the predicted resource usage information includes predicted memory usage, then containers with predicted memory usage exceeding a preset memory usage can be designated as scheduled containers. Here, the number of scheduled containers can be one or more. Then, based on the predicted resource usage information for the scheduled containers and the first resource usage information for each of the multiple clusters, the identifier of the target cluster corresponding to the scheduled containers can be determined. In other words, based on the predicted resource usage information for the scheduled containers and the first resource usage information for each of the multiple clusters, clusters with sufficient resources to support the operation of the scheduled containers can be selected from multiple clusters; these are the target clusters. Each cluster has a corresponding identifier. The identifier can be in the form of numbers or letters, etc., without restriction, as long as it can distinguish different clusters. Therefore, after determining the target cluster from multiple clusters, the identifier of the target cluster can be obtained. Thus, based on the identifier of the target cluster corresponding to the container to be scheduled, the configuration information of the container to be scheduled is transmitted to the target cluster to create the container in the target cluster. The configuration information of the container to be scheduled is then restored in the created container, enabling the deployment of the container to be scheduled in the target cluster. In one instance, during the transmission of the configuration information of the container to be scheduled, the communication protocol between multiple clusters can be optimized, for example, by fixing metadata (such as cluster identifiers, application programming interface versions, etc.) to reduce redundant data transmission. Alternatively, the configuration information of the container to be scheduled can be compressed to improve the transmission rate. Furthermore, direct routing can be used for information transmission between multiple clusters to reduce the number of times configuration information is forwarded. This reduces communication latency between multiple clusters.
[0068] After scheduling the container to be scheduled is completed, the container to be scheduled can be deleted from the source cluster (i.e., the cluster in which the container to be scheduled is deployed) to release the computing resources of the source cluster.
[0069] Steps S101 to S105 of this embodiment involve obtaining first resource usage information corresponding to multiple clusters, wherein the first resource usage information corresponding to each cluster is determined based on the second resource usage information corresponding to multiple containers carried by each cluster. Then, for each cluster, prediction is made based on the second resource usage information corresponding to the multiple containers carried by the cluster to obtain predicted resource usage information corresponding to multiple containers. Next, based on the predicted resource usage information corresponding to the multiple containers, the containers to be scheduled among the multiple containers are determined. Then, based on the predicted resource usage information corresponding to the containers to be scheduled and the first resource usage information corresponding to the multiple clusters, the identifier of the target cluster corresponding to the containers to be scheduled is determined. Finally, based on the identifier of the target cluster corresponding to the containers to be scheduled, the configuration information of the containers to be scheduled is transmitted to the target cluster to deploy the containers to be scheduled on the target cluster. By predicting the resource usage information corresponding to multiple containers, the above steps can pre-schedule containers to clusters with abundant resources, avoiding some clusters having idle resources while others are experiencing resource shortages, thereby achieving balanced utilization of resources across multiple clusters and improving overall resource utilization.
[0070] In some embodiments, the step of predicting resource usage information for each of the multiple containers carried by the cluster based on the second resource usage information for each container includes:
[0071] Feature extraction processing is performed on the second resource usage information corresponding to the multiple containers respectively to obtain the resource usage features corresponding to the multiple containers respectively;
[0072] The resource usage features corresponding to the multiple containers are respectively input into the resource usage prediction model to obtain the predicted resource usage information corresponding to the multiple containers. The resource usage prediction model adopts a long short-term memory network model.
[0073] Based on the second resource usage information corresponding to multiple containers hosted in the cluster, predicted resource usage information for each container can be obtained. Specifically, feature extraction processing can be performed on the second resource usage information corresponding to each container to obtain resource usage features for each container. For example, an algorithm such as a sliding window statistical algorithm can be used to perform feature extraction processing on the second resource usage information corresponding to each container to obtain resource usage features for each container. Alternatively, deep learning models such as recurrent neural networks or convolutional neural networks can be used to perform feature extraction processing on the second resource usage information corresponding to each container to obtain resource usage features for each container. Subsequently, the resource usage features corresponding to each container can be input into a pre-trained resource usage prediction model. The resource usage prediction model processes the input resource usage features corresponding to each container to obtain predicted resource usage information for each container. Here, the resource usage prediction model adopts a long short-term memory network model.
[0074] In some embodiments, the resource usage prediction model can be trained using the sample resource usage information corresponding to the sample container and the corresponding first sample label. Specifically, the sample resource usage information can be input into the resource usage prediction model to obtain the sample predicted resource usage information output by the resource usage prediction model. Subsequently, a first loss value can be calculated based on the sample predicted resource usage information and the first sample label, and the model parameters of the resource usage prediction model can be updated based on the first loss value. Multiple rounds can be performed according to the aforementioned training process until the number of rounds reaches a first preset number of rounds, or the first loss value is less than the first preset loss value, thus completing the training of the resource usage prediction model. The first preset number of rounds and the first preset loss value can be set according to the actual situation.
[0075] Compared to using secondary resource usage information for subsequent prediction processes, resource usage characteristics can more concisely reflect relevant data features and contain less noise. Therefore, it can not only reduce the computational load of the resource usage prediction model and improve its computational efficiency, but also reduce the interference of noise on the resource usage prediction model and improve the accuracy of predicting resource usage information.
[0076] Figure 2 yes Figure 1 Please refer to the flowchart for step S103 in the previous section. Figure 2 In some embodiments, the first resource usage information includes total resource information; determining the container to be scheduled among the plurality of containers based on the predicted resource usage information corresponding to the plurality of containers includes:
[0077] Step S201: Determine the predicted load information of the cluster based on the predicted resource usage information corresponding to each of the multiple containers.
[0078] Step S202: If the predicted load information is greater than the load threshold, then multiple containers are filtered according to the predicted load information and the load threshold to obtain the container to be scheduled; the load threshold is determined based on the total resource information, and the predicted resource usage information corresponding to the container to be scheduled is greater than or equal to the difference between the predicted load information and the load threshold.
[0079] The first resource usage information includes total resource information. Total resource information indicates the total resource capacity of the cluster, such as total CPU capacity, total available memory, or total disk throughput. Based on the total resource information, load thresholds can be determined. For example, if the total resource information indicates total CPU capacity, the total CPU capacity indicated by the total resource information can be multiplied by a first preset ratio to obtain the CPU load threshold. If the total resource information indicates total available memory, the total available memory indicated by the total resource information can be multiplied by a second preset ratio to obtain the memory load threshold. If the total resource information indicates total disk throughput, the total disk throughput indicated by the total resource information can be multiplied by a third preset ratio to obtain the disk I / O load threshold. The first, second, and third preset ratios can all be set according to actual conditions; they can be the same or different values.
[0080] Based on the predicted resource usage information corresponding to multiple containers, the predicted load information of the cluster can be determined. For example, when the predicted resource usage information for multiple containers includes predicted CPU utilization, the predicted CPU utilization for each container can be added together to obtain the predicted CPU load of the cluster. Here, the predicted load information includes the predicted CPU load. Subsequently, the predicted load information can be compared with a load threshold. If the predicted load information is greater than the load threshold, then containers to be scheduled can be further selected from the multiple containers hosted by the cluster based on the predicted resource usage information for each container. That is, containers whose predicted resource usage information is greater than or equal to the difference between the predicted load information and the load threshold are selected as containers to be scheduled. In one example, if there are no containers among the multiple containers hosted by the cluster whose predicted resource usage information is greater than or equal to the difference between the predicted load information and the load threshold, then the predicted resource usage information for each container can be sorted in descending order to obtain a sequence of predicted resource usage information. Multiple containers with the highest predicted resource usage information in the sequence are selected, and the containers corresponding to these containers are selected as containers to be scheduled. At this point, the sum of the predicted resource usage information for multiple prioritized containers should be greater than or equal to the difference between the predicted load information and the load threshold. Alternatively, multiple containers with functional relationships can be selected as containers to be scheduled. Similarly, the sum of the predicted resource usage information for each of the multiple functionally related containers should be greater than or equal to the difference between the predicted load information and the load threshold. These steps can filter out containers to be scheduled from the multiple containers hosted by the cluster, enabling subsequent scheduling of these containers and achieving balanced utilization of cluster resources.
[0081] Figure 3 yes Figure 1 Please refer to the flowchart for step S104 in the previous section. Figure 3 In some embodiments, the first resource usage information corresponding to each of the plurality of clusters includes the remaining resource information corresponding to each of the plurality of clusters, which is determined based on the total resource information corresponding to each of the plurality of clusters and the predicted load information corresponding to each of the plurality of clusters.
[0082] The step of determining the identifier of the target cluster corresponding to the container to be scheduled based on the predicted resource usage information corresponding to the container to be scheduled and the first resource usage information corresponding to the multiple clusters respectively includes:
[0083] Step S301: Select clusters whose remaining resource information is greater than the predicted resource usage information corresponding to the container to be scheduled as candidate clusters.
[0084] Step S302: Determine the target cluster corresponding to the container to be scheduled from the candidate clusters, and obtain the identifier of the target cluster corresponding to the container to be scheduled.
[0085] The initial resource usage information for each cluster includes the remaining resource information for each cluster. This remaining resource information can be determined based on the total resource information for each cluster and the predicted load information for each cluster. It's important to understand that this remaining resource information represents the predicted remaining resources for each cluster at a future point in time, rather than the actual remaining resources for each cluster at present.
[0086] Based on the remaining resource information corresponding to multiple clusters and the predicted resource usage information for the container to be scheduled, the identifier of the target cluster for the container to be scheduled can be determined. Specifically, clusters with remaining resource information greater than the predicted resource usage information for the container to be scheduled can be selected as candidate clusters. For example, if the remaining resource information for multiple clusters includes remaining CPU capacity, and the predicted resource usage information for the container to be scheduled includes predicted CPU utilization, then clusters with remaining CPU capacity greater than the predicted CPU utilization for the container to be scheduled can be selected as candidate clusters.
[0087] Then, the target cluster corresponding to the container to be scheduled can be determined from the candidate clusters, and the identifier of the target cluster corresponding to the container to be scheduled can be obtained. For example, it can be determined whether the basic environment such as the operating system kernel version and network plugins of the source cluster and the candidate cluster are consistent, so as to avoid the failure of the container to be scheduled to start after scheduling due to differences in underlying dependencies. In addition, it can also be determined whether the security policy of the candidate cluster (such as whether it allows communication on the ports required by the container) is compatible with the running requirements of the container to be scheduled. In this way, the candidate cluster with the same basic environment as the source cluster and compatible with the running requirements of the container to be scheduled can be selected as the target cluster corresponding to the container to be scheduled. Alternatively, when there are multiple candidate clusters, the remaining resource scores of each candidate cluster can be determined based on the remaining resource information of each candidate cluster, and then the candidate cluster with the largest remaining resource score can be selected as the target cluster corresponding to the container to be scheduled. In this way, the cluster with abundant resources (i.e., the target cluster) can be determined from multiple clusters for subsequent scheduling of the cluster to be scheduled.
[0088] Figure 4 yes Figure 3 Please refer to the flowchart for step S302 in the original text. Figure 4 In some embodiments, the number of candidate clusters is multiple, and determining the target cluster corresponding to the container to be scheduled from the candidate clusters includes:
[0089] Step S401: Perform a first preset processing on the remaining resource information corresponding to each of the multiple candidate clusters to obtain the remaining resource scores corresponding to each of the multiple candidate clusters. The first preset processing is to match the remaining resource information corresponding to each of the multiple candidate clusters with a first relationship, or to input the remaining resource information corresponding to each of the multiple candidate clusters into a pre-trained first scoring model. The first relationship includes multiple preset remaining resource information and the remaining resource score corresponding to each preset resource information. The first scoring model adopts a deep learning model, and the remaining resource score corresponding to each candidate cluster is used to characterize the sufficiency of remaining resources of each candidate cluster.
[0090] Step S402: Based on the remaining resource scores corresponding to the multiple candidate clusters, determine the target cluster corresponding to the container to be scheduled among the candidate clusters.
[0091] When there are multiple candidate clusters, the target cluster corresponding to the container to be scheduled can be determined from among the candidate clusters. Specifically, the remaining resource information corresponding to each of the multiple candidate clusters can be subjected to a first preset processing to obtain the remaining resource scores corresponding to each candidate cluster. The remaining resource score for each candidate cluster is used to characterize the sufficiency of remaining resources for each candidate cluster. The first preset processing involves matching the remaining resource information corresponding to each of the multiple candidate clusters with a first relation, which includes multiple preset remaining resource information and the remaining resource score corresponding to each preset resource information. Alternatively, the first preset processing can also involve inputting the remaining resource information corresponding to each of the multiple candidate clusters into a pre-trained first scoring model. Here, the first scoring model uses a deep learning model. The first scoring model can be trained using the sample remaining resource information of the sample clusters and the corresponding second sample labels. Specifically, the sample remaining resource information can be input into the first scoring model to obtain the sample remaining resource scores output by the first scoring model. Subsequently, a second loss value can be calculated based on the sample remaining resource scores and the second sample labels, and the model parameters of the first scoring model can be updated based on the second loss value. The training process described above can be repeated for multiple rounds until the second preset round is reached, or the second loss value is less than the second preset loss value, thus completing the training of the first scoring model. Both the second preset round and the second preset loss value can be set according to the actual situation.
[0092] Then, the candidate cluster with the highest remaining resource score can be selected as the target cluster for the container to be scheduled. In one example, if multiple candidate clusters have the same maximum remaining resource score, it can be further determined whether the basic environment of these candidate clusters with the same remaining resource score is consistent with the source cluster, and whether the security policies of these candidate clusters are compatible with the operational requirements of the container to be scheduled. The candidate cluster with the same basic environment as the source cluster and compatible with the operational requirements of the container to be scheduled can be selected as the target cluster. In this way, a cluster with abundant resources can be identified from multiple clusters for subsequent scheduling.
[0093] In some embodiments, determining the target cluster corresponding to the container to be scheduled among the candidate clusters based on the remaining resource scores corresponding to the plurality of candidate clusters includes:
[0094] Obtain the distance between each of the candidate clusters and the cluster where the container to be scheduled is deployed, as well as the container migration success rate of each of the candidate clusters within a historical time period;
[0095] The distances between the candidate clusters and the clusters deployed by the container to be scheduled are processed by a second preset process to obtain distance scores corresponding to the candidate clusters. The second preset process is to match the distances between the candidate clusters and the clusters deployed by the container to be scheduled with a second relationship, or to input the distances between the candidate clusters and the clusters deployed by the container to be scheduled into a pre-trained second scoring model. The second relationship includes multiple preset distances and distance scores corresponding to each preset distance. The second scoring model adopts a deep learning model.
[0096] A third preset processing is performed on the container migration success rates of the multiple candidate clusters within a historical time period to obtain migration success rate scores for each candidate cluster. The third preset processing involves matching the container migration success rates of the multiple candidate clusters within a historical time period with a third relationship, or inputting the container migration success rates of the multiple candidate clusters within a historical time period into a pre-trained third scoring model. The third relationship includes multiple preset migration success rates and migration success rate scores corresponding to each migration success rate. The third scoring model adopts a deep learning model, and the migration success rate score corresponding to each candidate cluster is used to characterize the success rate of deploying the scheduled container to each candidate cluster.
[0097] The total score for each candidate cluster is obtained by weighted summation based on the remaining resource score, the first weight corresponding to the remaining resource score, the distance score, the second weight corresponding to the distance score, the migration success rate score, and the third weight corresponding to the migration success rate score for each candidate cluster.
[0098] The candidate cluster corresponding to the maximum total score is taken as the target cluster corresponding to the container to be scheduled.
[0099] Based on the remaining resource scores of multiple candidate clusters, the target cluster corresponding to the container to be scheduled can be determined. Specifically, to reduce the impact of physical distance between clusters on the transmission of configuration information of the container to be scheduled, and to reduce the risk of cross-cluster scheduling of the container to be scheduled, ensuring the migration stability of the container to be scheduled, the target cluster can be determined by comprehensively considering the distances between each candidate cluster and the cluster where the container to be scheduled is deployed, as well as the container migration success rate of each candidate cluster within a historical time period. In this process, firstly, the distances between each candidate cluster and the cluster where the container to be scheduled is deployed, as well as the container migration success rate of each candidate cluster within a historical time period, can be obtained. The container migration success rate refers to the success rate of migrating containers to candidate clusters within a historical time period.
[0100] Then, a second preset processing is performed on the distances between the multiple candidate clusters and the clusters where the scheduled container is deployed, resulting in distance scores for each candidate cluster. A third preset processing is performed on the container migration success rates of the multiple candidate clusters within a historical time period, resulting in migration success rate scores for each candidate cluster. Here, the distance score for each candidate cluster characterizes the transmission latency of the configuration information of the scheduled container. The second preset processing can be achieved by matching the distances between the multiple candidate clusters and the clusters where the scheduled container is deployed with a second relationship, which includes multiple preset distances and the distance score for each preset distance. Alternatively, the second preset processing can be achieved by inputting the distances between the multiple candidate clusters and the clusters where the scheduled container is deployed into a pre-trained second scoring model, which employs a deep learning model. The migration success rate score for each candidate cluster characterizes the success rate of deploying the scheduled container on each candidate cluster. The third preset processing can be achieved by matching the container migration success rates of the multiple candidate clusters within a historical time period with a third relationship, which includes multiple preset migration success rates and the migration success rate score for each migration success rate. Alternatively, the third pre-processing could involve inputting the container migration success rates of multiple candidate clusters within a historical time period into a pre-trained third scoring model, which employs a deep learning model.
[0101] Subsequently, a weighted sum is calculated based on the remaining resource scores, the first weight corresponding to the remaining resource scores, the distance scores, the second weight corresponding to the distance scores, the migration success rate scores, and the third weight corresponding to the migration success rate scores of the candidate clusters. This yields the total score for each candidate cluster. The first, second, and third weights can be adjusted according to actual circumstances. The candidate cluster with the highest total score is then selected as the target cluster for the container to be scheduled. Furthermore, if multiple candidate clusters have the same total score, and all have the highest total score, it is further determined whether the basic environment of these clusters matches the source cluster, and whether their security policies are compatible with the operational requirements of the container to be scheduled. The candidate cluster with the same basic environment and compatible with the operational requirements of the container is then selected as the target cluster. This process identifies resource-rich clusters from among the multiple clusters for subsequent scheduling.
[0102] In one example, the second and third scoring models can be pre-trained separately. Specifically, the second scoring model can be trained using sample distance and the corresponding third sample label. Sample distance refers to the distance between the candidate cluster and the cluster where the scheduled container is deployed. Specifically, the sample distance can be input into the second scoring model to obtain its output sample distance score. Then, a third loss value can be calculated based on the sample distance score and the third sample label, and the model parameters of the second scoring model can be updated accordingly. This training process can be repeated multiple times until the third preset number of rounds is reached, or the third loss value is less than the third preset loss value, completing the training of the second scoring model. Both the third preset number of rounds and the third preset loss value can be set according to actual conditions. Furthermore, the third scoring model can be trained using the sample container migration success rate and the corresponding fourth sample label. Specifically, the sample container migration success rate can be input into the third scoring model to obtain its output sample migration success rate score. Then, a fourth loss value can be calculated based on the sample migration success rate score and the fourth sample label, and the model parameters of the third scoring model can be updated accordingly. The training process described above can be repeated for multiple rounds until the fourth preset round is reached, or the fourth loss value is less than the fourth preset loss value, thus completing the training of the third scoring model. The fourth preset round and the fourth preset loss value can be set according to the actual situation.
[0103] Figure 5 This is a schematic diagram of the resource scheduling device provided in the embodiments of this application. Please refer to it. Figure 5 This application also provides a resource scheduling device 500, which can implement the above-described resource scheduling method. The resource scheduling device 500 is applied to a cluster system, the cluster system including multiple clusters, each cluster being used to host multiple containers. The device 500 includes:
[0104] The acquisition module 501 is used to acquire first resource usage information corresponding to multiple clusters respectively. The first resource usage information corresponding to each cluster is determined according to the second resource usage information corresponding to multiple containers carried by each cluster. The second resource usage information corresponding to each container is used to indicate the resources used by each container during runtime.
[0105] Prediction module 502 is used to predict resource usage information for each of the clusters based on the second resource usage information corresponding to the multiple containers carried by the cluster.
[0106] The first determining module 503 is used to determine the container to be scheduled among the multiple containers based on the predicted resource usage information corresponding to the multiple containers respectively.
[0107] The second determining module 504 is used to determine the identifier of the target cluster corresponding to the container to be scheduled based on the predicted resource usage information corresponding to the container to be scheduled and the first resource usage information corresponding to the multiple clusters respectively.
[0108] The transmission module 505 is used to transmit the configuration information of the container to be scheduled to the target cluster according to the identifier of the target cluster corresponding to the container to be scheduled, so as to deploy the container to be scheduled in the target cluster.
[0109] In some embodiments, the first determining module 503 includes:
[0110] The third determining submodule is used to determine the predicted load information of the cluster based on the predicted resource usage information corresponding to the multiple containers respectively.
[0111] The filtering submodule is used to filter multiple containers based on the predicted load information and the load threshold if the predicted load information is greater than the load threshold, thereby obtaining the container to be scheduled; the load threshold is determined based on the total resource information, and the predicted resource usage information corresponding to the container to be scheduled is greater than or equal to the difference between the predicted load information and the load threshold.
[0112] In some embodiments, the second determining module 504 includes:
[0113] The first determining submodule is used to select clusters whose remaining resource information is greater than the predicted resource usage information corresponding to the container to be scheduled as candidate clusters.
[0114] The second determining submodule is used to determine the target cluster corresponding to the container to be scheduled from the candidate clusters, and to obtain the identifier of the target cluster corresponding to the container to be scheduled.
[0115] In some embodiments, the second determining submodule includes:
[0116] The processing unit is configured to perform a first preset processing on the remaining resource information corresponding to the multiple candidate clusters respectively, to obtain the remaining resource scores corresponding to the multiple candidate clusters respectively; the first preset processing is to match the remaining resource information corresponding to the multiple candidate clusters respectively with a first relation, or to input the remaining resource information corresponding to the multiple candidate clusters respectively into a pre-trained first scoring model, the first relation includes multiple preset remaining resource information and the remaining resource score corresponding to each preset resource information, the first scoring model adopts a deep learning model, and the remaining resource score corresponding to each candidate cluster is used to characterize the sufficiency of remaining resources of each candidate cluster;
[0117] The determining unit is used to determine the target cluster corresponding to the container to be scheduled among the candidate clusters based on the remaining resource scores corresponding to the multiple candidate clusters.
[0118] In some embodiments, the determining unit includes:
[0119] The acquisition subunit is used to acquire the distance between the multiple candidate clusters and the cluster where the container to be scheduled is deployed, as well as the container migration success rate of the multiple candidate clusters within a historical time period.
[0120] The first processing subunit is used to perform a second preset processing on the distances between the multiple candidate clusters and the clusters deployed by the container to be scheduled, respectively, to obtain distance scores corresponding to the multiple candidate clusters; the second preset processing is to match the distances between the multiple candidate clusters and the clusters deployed by the container to be scheduled with a second relationship, or to input the distances between the multiple candidate clusters and the clusters deployed by the container to be scheduled into a pre-trained second scoring model, the second relationship including multiple preset distances and distance scores corresponding to each preset distance, the second scoring model adopting a deep learning model;
[0121] The second processing subunit is used to perform a third preset processing on the container migration success rates of the multiple candidate clusters within a historical time period to obtain migration success rate scores for the multiple candidate clusters. The third preset processing is to match the container migration success rates of the multiple candidate clusters within a historical time period with a third relationship, or to input the container migration success rates of the multiple candidate clusters within a historical time period into a pre-trained third scoring model. The third relationship includes multiple preset migration success rates and migration success rate scores corresponding to each migration success rate. The third scoring model adopts a deep learning model, and the migration success rate score corresponding to each candidate cluster is used to characterize the success rate of deploying the scheduled container to each candidate cluster.
[0122] The calculation subunit is used to perform a weighted summation calculation based on the remaining resource scores, the first weight corresponding to the remaining resource scores, the distance scores, the second weight corresponding to the distance scores, the migration success rate scores, and the third weight corresponding to the migration success rate scores of the multiple candidate clusters, to obtain the total score corresponding to each of the multiple candidate clusters.
[0123] A sub-unit is determined to select the candidate cluster corresponding to the maximum total score as the target cluster corresponding to the container to be scheduled.
[0124] In some embodiments, the prediction module 502 includes:
[0125] The extraction submodule is used to perform feature extraction processing on the second resource usage information corresponding to the multiple containers respectively, to obtain the resource usage features corresponding to the multiple containers respectively;
[0126] The prediction submodule is used to input the resource usage features corresponding to the multiple containers into the resource usage prediction model to obtain the predicted resource usage information corresponding to the multiple containers. The resource usage prediction model adopts a long short-term memory network model.
[0127] For a detailed description of the resource scheduling device 500, please refer to the specific embodiments of the resource scheduling method described above, which will not be repeated here.
[0128] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the resource scheduling method described above. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0129] Figure 6 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Please refer to it. Figure 6 Electronic devices include:
[0130] The processor 601 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0131] The memory 602 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 602 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 602 and is called and executed by the processor 601 using the resource scheduling method of the embodiments of this application.
[0132] The input / output interface 603 is used to implement information input and output;
[0133] The communication interface 604 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0134] Bus 605 transmits information between various components of the device (e.g., processor 601, memory 602, input / output interface 603, and communication interface 604);
[0135] The processor 601, memory 602, input / output interface 603, and communication interface 604 are connected to each other within the device via bus 605.
[0136] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described resource scheduling method.
[0137] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0138] This application also provides a computer program product, wherein when the instructions in the computer program product are executed by an electronic device, the electronic device implements any of the resource scheduling methods described in the above embodiments.
[0139] The resource scheduling method, apparatus, electronic device, storage medium, and program product provided in this application obtain first resource usage information corresponding to multiple clusters. The first resource usage information for each cluster is determined based on second resource usage information corresponding to multiple containers hosted by each cluster. Then, for each cluster, prediction is made based on the second resource usage information corresponding to the multiple containers hosted by the cluster to obtain predicted resource usage information for each container. Next, based on the predicted resource usage information for each container, a container to be scheduled among the multiple containers is determined. Then, based on the predicted resource usage information for the container to be scheduled and the first resource usage information corresponding to the multiple clusters, the identifier of the target cluster corresponding to the container to be scheduled is determined. Finally, based on the identifier of the target cluster corresponding to the container to be scheduled, the configuration information of the container to be scheduled is transmitted to the target cluster for deployment of the container to be scheduled on the target cluster. By predicting the resource usage information corresponding to multiple containers, the above steps can pre-schedule containers to clusters with abundant resources, avoiding idle resources in some clusters while resource shortages in others, thereby achieving balanced utilization of resources across multiple clusters and improving overall resource utilization.
[0140] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0141] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0142] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0143] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0144] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0145] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0146] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0147] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0148] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0149] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0150] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A resource scheduling method, characterized in that, Applied to a cluster system, the cluster system comprising multiple clusters, each cluster being used to host multiple containers, the method includes: First resource usage information corresponding to multiple clusters is obtained. The first resource usage information corresponding to each cluster is determined based on the second resource usage information corresponding to multiple containers carried by each cluster. The second resource usage information corresponding to each container is used to indicate the resources used by each container during runtime. For each cluster, predictions are made based on the second resource usage information corresponding to the multiple containers carried by the cluster, to obtain the predicted resource usage information corresponding to the multiple containers. Based on the predicted resource usage information corresponding to each of the multiple containers, determine the containers to be scheduled among the multiple containers; Based on the predicted resource usage information corresponding to the container to be scheduled and the first resource usage information corresponding to the multiple clusters respectively, the identifier of the target cluster corresponding to the container to be scheduled is determined. Based on the identifier of the target cluster corresponding to the container to be scheduled, the configuration information of the container to be scheduled is transmitted to the target cluster so as to deploy the container to be scheduled in the target cluster.
2. The method according to claim 1, characterized in that, The first resource usage information includes total resource information; the step of determining the container to be scheduled among the multiple containers based on the predicted resource usage information corresponding to each of the multiple containers includes: Based on the predicted resource usage information corresponding to each of the multiple containers, the predicted load information of the cluster is determined; If the predicted load information is greater than the load threshold, then multiple containers are filtered according to the predicted load information and the load threshold to obtain the container to be scheduled; the load threshold is determined based on the total resource information, and the predicted resource usage information corresponding to the container to be scheduled is greater than or equal to the difference between the predicted load information and the load threshold.
3. The method according to claim 2, characterized in that, The first resource usage information corresponding to each of the multiple clusters includes the remaining resource information corresponding to each of the multiple clusters, and the remaining resource information corresponding to each of the multiple clusters is determined based on the total resource information corresponding to each of the multiple clusters and the predicted load information corresponding to each of the multiple clusters. The step of determining the identifier of the target cluster corresponding to the container to be scheduled based on the predicted resource usage information corresponding to the container to be scheduled and the first resource usage information corresponding to the multiple clusters respectively includes: Clusters whose remaining resource information is greater than the predicted resource usage information corresponding to the container to be scheduled are selected as candidate clusters. The target cluster corresponding to the container to be scheduled is determined from the candidate clusters, and the identifier of the target cluster corresponding to the container to be scheduled is obtained.
4. The method according to claim 3, characterized in that, The number of candidate clusters is multiple, and the step of determining the target cluster corresponding to the container to be scheduled from the candidate clusters includes: The remaining resource information corresponding to each of the multiple candidate clusters is subjected to a first preset processing to obtain the remaining resource scores corresponding to each of the multiple candidate clusters. The first preset processing is to match the remaining resource information corresponding to each of the multiple candidate clusters with a first relation, or to input the remaining resource information corresponding to each of the multiple candidate clusters into a pre-trained first scoring model. The first relation includes multiple preset remaining resource information and the remaining resource score corresponding to each preset resource information. The first scoring model adopts a deep learning model, and the remaining resource score corresponding to each candidate cluster is used to characterize the sufficiency of remaining resources of each candidate cluster. Based on the remaining resource scores corresponding to the multiple candidate clusters, the target cluster corresponding to the container to be scheduled among the candidate clusters is determined.
5. The method according to claim 4, characterized in that, The step of determining the target cluster corresponding to the container to be scheduled among the candidate clusters based on the remaining resource scores corresponding to the multiple candidate clusters includes: Obtain the distance between each of the candidate clusters and the cluster where the container to be scheduled is deployed, as well as the container migration success rate of each of the candidate clusters within a historical time period; The distances between the candidate clusters and the clusters deployed by the container to be scheduled are processed by a second preset process to obtain distance scores corresponding to the candidate clusters. The second preset process is to match the distances between the candidate clusters and the clusters deployed by the container to be scheduled with a second relationship, or to input the distances between the candidate clusters and the clusters deployed by the container to be scheduled into a pre-trained second scoring model. The second relationship includes multiple preset distances and distance scores corresponding to each preset distance. The second scoring model adopts a deep learning model. A third preset processing is performed on the container migration success rates of the multiple candidate clusters within a historical time period to obtain migration success rate scores for each candidate cluster. The third preset processing involves matching the container migration success rates of the multiple candidate clusters within a historical time period with a third relationship, or inputting the container migration success rates of the multiple candidate clusters within a historical time period into a pre-trained third scoring model. The third relationship includes multiple preset migration success rates and migration success rate scores corresponding to each migration success rate. The third scoring model adopts a deep learning model, and the migration success rate score corresponding to each candidate cluster is used to characterize the success rate of deploying the scheduled container to each candidate cluster. The total score for each candidate cluster is obtained by weighted summation based on the remaining resource score, the first weight corresponding to the remaining resource score, the distance score, the second weight corresponding to the distance score, the migration success rate score, and the third weight corresponding to the migration success rate score for each candidate cluster. The candidate cluster corresponding to the maximum total score is taken as the target cluster corresponding to the container to be scheduled.
6. The method according to claim 1, characterized in that, The step of predicting resource usage information for each of the multiple containers carried by the cluster based on the second resource usage information for each container includes: Feature extraction processing is performed on the second resource usage information corresponding to the multiple containers respectively to obtain the resource usage features corresponding to the multiple containers respectively; The resource usage features corresponding to the multiple containers are respectively input into the resource usage prediction model to obtain the predicted resource usage information corresponding to the multiple containers. The resource usage prediction model adopts a long short-term memory network model.
7. A resource scheduling device, characterized in that, Applied to a cluster system, the cluster system comprising multiple clusters, each cluster being used to host multiple containers, the device includes: The acquisition module is used to acquire first resource usage information corresponding to multiple clusters respectively. The first resource usage information corresponding to each cluster is determined according to the second resource usage information corresponding to multiple containers carried by each cluster. The second resource usage information corresponding to each container is used to indicate the resources used by each container during runtime. The prediction module is used to predict the resource usage information corresponding to the multiple containers carried by the cluster for each cluster. The first determining module is used to determine the container to be scheduled among the multiple containers based on the predicted resource usage information corresponding to the multiple containers respectively; The second determining module is used to determine the identifier of the target cluster corresponding to the container to be scheduled based on the predicted resource usage information corresponding to the container to be scheduled and the first resource usage information corresponding to the multiple clusters respectively. The transmission module is used to transmit the configuration information of the container to be scheduled to the target cluster according to the identifier of the target cluster corresponding to the container to be scheduled, so as to deploy the container to be scheduled in the target cluster.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the resource scheduling method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the resource scheduling method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, When the instructions in the computer program product are executed by an electronic device, the electronic device performs the resource scheduling method as described in any one of claims 1 to 6.