Task scheduling method and device, storage medium and computer device

CN117632461BActive Publication Date: 2026-09-11TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210993594.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-18
Publication Date
2026-09-11
Estimated Expiration
2042-08-18

AI Technical Summary

Technical Problem

然而,在相关技术中,由于任务调度系统单一的任务调度方法,导致任务调度的效率低下,并且任务调度容易失败

Benefits of technology

[0011]本申请提供的一种任务调度方法,可以获取目标任务和集群组,该集群组包括多个集群,以及获取每个集群的资源状态信息,并基于每个集群的资源状态信息进行资源整合,计算得到集群组的全局资源空闲量,进一步地,将全局资源空闲量与资源阈值范围进行比对,根据比对结果确定目标任务对应的调度策略,并根据调度策略对目标任务执行任务下发。如此,通过计算得到的全局资源空闲量可以反映出集群组的资源状态,由于,任务执行时所需的资源与集群组的资源状态存在关系,因此可以利用全局资源空闲量与资源阈值范围的比较结果为目标任务针对性地确定出适配的任务调度策略,从而提高任务调度的效率和成功率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117632461B_ABST
    Figure CN117632461B_ABST
Patent Text Reader

Abstract

The application discloses a task scheduling method, which comprises the following steps: obtaining a target task and a cluster group, wherein the cluster group comprises a plurality of clusters; obtaining resource state information of each cluster; performing resource integration based on the resource state information of each cluster, and calculating a global resource idle amount of the cluster group; comparing the global resource idle amount with a resource threshold range, and determining a scheduling strategy corresponding to the target task according to a comparison result; and performing task distribution on the target task according to the scheduling strategy. The application applies cloud computing technology, obtains a global resource idle amount of a cluster group based on resource state information of a plurality of clusters in a network, and determines an adaptive scheduling strategy for a target task according to a comparison result of the global resource idle amount and a resource threshold range, so that the efficiency and success rate of task scheduling can be effectively improved under a multi-cloud cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and more specifically, to a task scheduling method, apparatus, storage medium, and computer equipment. Background Technology

[0002] Cloud computing is a computing model that distributes computing tasks across a resource pool composed of a large number of computers, enabling various application systems to obtain computing power, storage space, and information services according to their own business needs. The "cloud" refers to a collection of various types of resources existing on a cluster of servers in a cloud data center. A platform that provides computing, networking, and storage capabilities based on hardware and software resources is typically called a cloud platform.

[0003] Kubernetes (K8s) is a container orchestration engine used to manage containerized applications across multiple hosts in a cloud platform. It supports automated deployment, massive scalability, and application containerization management. A Kubernetes cluster is a group of nodes running containerized applications, allowing for the development, movement, and management of applications, and enabling containers to run across multiple machines and environments, without being limited to a specific operating system.

[0004] In a multi-cloud Kubernetes environment, when multiple tasks are submitted to the task scheduling system, the system needs to distribute these tasks to different Kubernetes clusters so that each cluster can execute the assigned tasks. However, in related technologies, the single task scheduling method of the task scheduling system leads to low scheduling efficiency and a high failure rate. Summary of the Invention

[0005] This application provides a task scheduling method, apparatus, storage medium, and computer device. The aim is to improve the efficiency and success rate of task scheduling.

[0006] On the one hand, embodiments of this application provide a task scheduling method, which includes: obtaining a target task and a cluster group, the cluster group including multiple clusters; obtaining resource status information of each cluster; integrating resources based on the resource status information of each cluster to calculate the global resource idle amount of the cluster group; comparing the global resource idle amount with a resource threshold range, and determining the scheduling strategy corresponding to the target task based on the comparison result; and issuing task execution to the target task according to the scheduling strategy.

[0007] On the other hand, embodiments of this application also provide a task scheduling device, which includes: a first acquisition module for acquiring a target task and a cluster group, the cluster group including multiple clusters; a second acquisition module for acquiring resource status information of each cluster; a resource calculation module for integrating resources based on the resource status information of each cluster and calculating the global resource idle amount of the cluster group; a strategy determination module for comparing the global resource idle amount with a resource threshold range and determining the scheduling strategy corresponding to the target task based on the comparison result; and a task delivery module for delivering the task to the target task according to the scheduling strategy.

[0008] On the other hand, embodiments of this application also provide a computer-readable storage medium storing program code, wherein the above-described task scheduling method is executed when the program code is run by a processor.

[0009] On the other hand, embodiments of this application also provide a computer device, which includes a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are invoked by the processor, the above-described task scheduling method is executed.

[0010] On the other hand, embodiments of this application also provide a computer program product or computer program, which includes computer instructions stored in a storage medium. A processor of a computer device reads the computer instructions from the storage medium and executes the computer instructions, causing the computer to perform the steps in the task scheduling method described above.

[0011] This application provides a task scheduling method that can acquire a target task and a cluster group (including multiple clusters), obtain resource status information for each cluster, integrate resources based on the resource status information of each cluster, calculate the global resource idle amount of the cluster group, further compare the global resource idle amount with a resource threshold range, determine the scheduling strategy corresponding to the target task based on the comparison result, and issue the task to be executed according to the scheduling strategy. Thus, the calculated global resource idle amount reflects the resource status of the cluster group. Since the resources required for task execution are related to the resource status of the cluster group, the comparison result of the global resource idle amount and the resource threshold range can be used to determine a suitable task scheduling strategy for the target task, thereby improving the efficiency and success rate of task scheduling. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This paper illustrates a schematic diagram of the structure of a multi-cloud Kubernetes cluster provided in an embodiment of this application.

[0014] Figure 2 A system architecture diagram of a task scheduling method provided in an embodiment of this application is shown.

[0015] Figure 3 A flowchart illustrating a task scheduling method provided in an embodiment of this application is shown.

[0016] Figure 4 A flowchart illustrating another task scheduling method provided in an embodiment of this application is shown.

[0017] Figure 5 The illustration shows a scenario diagram of a cloud computing service provided in an embodiment of this application.

[0018] Figure 6 This illustration shows a real-time status diagram of a task provided in an embodiment of this application.

[0019] Figure 7 A flowchart of a task calculation method provided in an embodiment of this application is shown.

[0020] Figure 8 A flowchart illustrating a task creation and distribution method provided in an embodiment of this application is shown.

[0021] Figure 9 This illustration shows a schematic diagram of a task status update provided in an embodiment of this application.

[0022] Figure 10 This illustration shows a schematic diagram of a task information statistics method provided in an embodiment of this application.

[0023] Figure 11 A block diagram of a task scheduling device provided in an embodiment of this application is shown.

[0024] Figure 12 This is a block diagram of a computer device provided in an embodiment of this application.

[0025] Figure 13 This is a block diagram of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation

[0026] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0027] To enable those skilled in the art to better understand the solutions of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0028] like Figure 1 As shown, Figure 1 This diagram illustrates the architecture of a multi-cloud Kubernetes cluster. The multi-cloud Kubernetes cluster consists of three Kubernetes clusters. Kubernetes cluster 1 (Cluster1) comprises one master node and two worker nodes. The master node and worker nodes can be physical computers or virtual machines, depending on the cluster.

[0029] The master node uses the monitor system to obtain and control the cluster's state, such as which applications are running and their corresponding container images. Worker nodes are used to run these applications, performing tasks assigned by the master node; these can be virtual machines or physical computers.

[0030] To meet the needs of different business operations and reduce latency in client applications, enterprises, acting as servers, typically deploy numerous Kubernetes clusters in on-premises data centers and across multiple public clouds. This allows them to build multi-cloud Kubernetes clusters for efficient cloud computing of a large number of different tasks. To ensure the effective utilization of multi-cloud Kubernetes clusters, a task scheduling system is typically used to schedule multiple tasks to be computed, thus assigning each task to a specific Kubernetes cluster.

[0031] However, in related technologies, the algorithms used by task scheduling systems to schedule multiple tasks are relatively simple, resulting in low scheduling efficiency for multiple tasks. Furthermore, the overall scheduling success rate of tasks is easily affected by the simplicity of the algorithm. For example, in a multi-cluster environment consisting of multiple Kubernetes clusters, if the resource requirements of a task exceed those of any single Kubernetes cluster, the task will not be able to run on any cluster, leading to task scheduling failure and the task not being distributed to any cluster for execution.

[0032] To address the aforementioned issues, the inventors, through research, proposed a task scheduling method as provided in this application. This method acquires a target task and a cluster group, obtains the resource status information of each cluster, integrates resources based on the resource status information of each cluster, calculates the global resource idle amount of the cluster group, further compares the global resource idle amount with a resource threshold range, determines the scheduling strategy corresponding to the target task based on the comparison result, and issues the task execution to the target task according to the scheduling strategy. Therefore, by comparing the global resource idle amount with the resource threshold range, a suitable scheduling strategy can be determined for the task, thereby effectively scheduling the task. Even when the resource requirements of a task exceed those of any single Kubernetes cluster, a corresponding scheduling strategy can be accurately determined for the task, preventing the task from failing to execute.

[0033] The system architecture diagram of the task scheduling method involved in this application will be introduced below.

[0034] like Figure 2 The diagram illustrates a system architecture for a task scheduling method provided in this application. The system includes a cluster management module 310, a task scheduling module 320, and a task management module 330. The cluster management module 310 acquires resources from a multi-cloud Kubernetes cluster in real time and integrates the resource information from each Kubernetes cluster to obtain the overall resource information of the multi-cloud Kubernetes cluster. It then provides this overall resource information to other modules through a RESTful interface. Simultaneously, when other models request resource information from the cluster management module 310 via the RESTful interface, the log unit records this request.

[0035] The task scheduling module 320 determines the scheduling strategy for the target task based on the overall resource information of the multi-cloud Kubernetes cluster obtained from the cluster management module 310. Specifically, the scheduling strategy may include round-robin scheduling, greedy scheduling, lossy scheduling, split scheduling, preemptive scheduling, and priority scheduling. The task management module 330 distributes the target task according to the scheduling strategy determined by the task scheduling module 320. The task management module 330 may include a task distribution unit, a task storage unit, and a task display unit. The task storage unit can be used to store the created tasks and their associated configuration files (e.g., YAML files). The task display unit can be used to display the running status of the task on the Kubernetes cluster.

[0036] For example, in a multi-task scheduling application scenario, the client can store multiple created tasks in a task storage unit for cloud computing. These multiple tasks can include at least neural network model training tasks or information security authentication tasks, etc., without limitation. As a server providing cloud computing services, the system can obtain real-time resource information of the multi-cloud Kubernetes cluster through the cluster management module 310. After obtaining the target task, the task scheduling module 320 can determine the corresponding scheduling strategy for the target task based on the overall resource information. Then, the task management module 330 can distribute the task according to the scheduling strategy and obtain and display the task status of the target task in real time.

[0037] It is worth noting that, Figure 2 This is merely a system architecture diagram of a task scheduling method provided in this application embodiment. The system architecture and application scenarios described in this application embodiment are for the purpose of more clearly illustrating the technical solutions of this application embodiment and do not constitute a limitation on the technical solutions provided in this application embodiment. As those skilled in the art will know, with the evolution of system architecture and the emergence of new application scenarios, the technical solutions provided in this application embodiment are also applicable to similar technical problems.

[0038] Please see Figure 3 , Figure 3 A flowchart illustrating a task scheduling method according to an embodiment of this application is shown. In a specific embodiment, the task scheduling method is applied to, for example... Figure 11 The task scheduling device 500 and the computer device 600 equipped with the task scheduling device 500 are shown. Figure 12 ).

[0039] The following will use a computer device as an example to illustrate the specific process of this embodiment. It is understood that the computer device used in this embodiment can be a server or a terminal, etc. The server can be 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 terminal can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein. The task scheduling method specifically includes the following steps:

[0040] Step S110: Obtain the target task and cluster group.

[0041] When multiple tasks are submitted to a scheduling system, if all task scheduling algorithms use the same scheduling method, task scheduling failures are likely to occur. Considering that in a real-world multi-cloud Kubernetes cluster environment, the efficient and accurate execution of tasks is greatly influenced by how rationally the overall remaining resources of multiple Kubernetes clusters are utilized, balancing the overall remaining resources of multiple Kubernetes clusters is crucial for the resources required to execute tasks. Therefore, this application innovatively proposes determining a scheduling strategy specifically for tasks requiring scheduling based on the overall remaining resources of multiple Kubernetes clusters, in order to better execute tasks in a multi-cloud Kubernetes cluster environment.

[0042] In this context, a cluster group refers to a combination of multiple Kubernetes clusters. Each Kubernetes cluster in a cluster group can be used to execute different tasks or subtasks. It's important to note that each Kubernetes cluster in a cluster group can be deployed in different cloud environments, and the clusters in a cluster group can execute the same type of task or different types of tasks. The target task refers to the task selected from multiple created tasks that will be scheduled. Task creation can be based on task parameters input by the task creator.

[0043] Optionally, task parameters may include at least the number of pods required for the task, the number of central processing unit (CPU) cores, the size of random access memory (RAM) space, the size of read-only memory (ROM) space, the task completion time, scheduling parameters (e.g., lossy scheduling, split scheduling, or preemptive scheduling), priority, and waiting time.

[0044] It's important to note that container groups in the task parameters are the most important and fundamental component of a Kubernetes cluster. A container group is the smallest deployment unit, a collection of containers that runs on worker nodes within the Kubernetes cluster. Since the number of container groups can affect task execution efficiency, it's a significant factor influencing the resources required for task execution. Task parameters can be used to generate configuration files (YAML files). After successful task creation, the task's identity document (ID) can be stored in the database as a queue-like data structure, along with the corresponding task information.

[0045] As one implementation method, when scheduling tasks, the task marker at the head of the queue in the database can be obtained, and the task corresponding to that marker can be used as the target task. Furthermore, a cluster group consisting of Kubernetes clusters in multiple different cloud environments can be obtained. For example, the server providing cloud computing services has deployed Kubernetes clusters in region A: Cluster 11 and Cluster 12 A Kubernetes cluster, Cluster, was deployed in region B. 21 Cluster 22 and Cluster 23 Among them, Cluster 11 Cluster 21 and Cluster 23 They are all used to handle the same type of task, such as training neural network models. Therefore, Cluster... 11 Cluster 21 and Cluster 23 They can form a cluster group.

[0046] Step S120: Obtain resource status information for each cluster.

[0047] The resource status information can include details such as the number of CPU cores, memory size, and disk space size of each node in a Kubernetes cluster, which are used to determine the node's storage and computing resources. This is not limited to these details. For example, a Kubernetes cluster (Cluster) 11 It consists of one master node and two worker nodes (Node1 and Node2). 11 The resource status information can be composed of the number of CPU cores, memory space size, and disk space size of Master, Node1, and Node2.

[0048] As one implementation method, a resource acquisition component can be used to obtain the resource status information of each cluster in real time. Specifically, a resource acquisition component can be installed on each Kubernetes cluster, and the resource status information of each cluster can be obtained through the application programming interface (API) provided by the resource acquisition component. Optionally, the resource acquisition component may include at least acquisition components such as Prometheus, Grafana, and Metrics.

[0049] Step S130: Based on the resource status information of each cluster, perform resource integration and calculate the global resource idle amount of the cluster group.

[0050] Since balancing the overall remaining resources of the cluster group is crucial for the successful deployment and execution of the target task, a scalar quantity reflecting the overall remaining resources of the cluster group, i.e., the global resource idle amount, is needed. This global resource idle amount can be expressed as a percentage. It can be calculated from the resource status information of each cluster in the cluster group. For example, the average value of all resource status information can be calculated based on the resource status information of each cluster, and the average value can be used as the global resource idle amount of the cluster group. Alternatively, the global resource idle amount can be calculated using system sampling. Optionally, considering the differences in hardware configuration among the clusters, the weight of each cluster can be determined based on the differences in resource status information caused by the cluster hardware configuration, and a weighted average method can be used to calculate the global resource idle amount of the cluster group.

[0051] In some embodiments, the step of integrating resources based on the resource status information of each cluster and calculating the global resource free volume of the cluster group may include:

[0052] (1) Process the resource status information of each cluster in the cluster group to obtain the cluster resource information corresponding to each cluster.

[0053] (2) Integrate the cluster resource information of each cluster and calculate the global resource idle amount of the cluster group.

[0054] Since the resource acquisition component may obtain duplicate or erroneous resource status information for each cluster from the underlying layer, data processing can be performed on the resource status information to obtain processed cluster resource information for each cluster. This results in a more accurate global resource availability for the generated cluster group. Resource integration refers to the selection, configuration, and merging of cluster resource information from different clusters, ensuring that the integrated cluster resource information has a holistic nature. For example, a weighted average calculation of all resource status information can be performed.

[0055] For example, the Flask platform can be used to process the resource status information of each Kubernetes cluster, thereby removing noise and filling in missing values ​​in the resource status information to obtain the cluster resource information corresponding to each Kubernetes cluster. Then, a weighted average calculation is performed on the cluster resource information of each Kubernetes cluster to characterize the overall resource status of the Kubernetes cluster group, obtain the global resource idle amount of the Kubernetes cluster group, and also obtain the global resource usage of the Kubernetes cluster group.

[0056] Step S140: Compare the global available resources with the resource threshold range, and determine the scheduling strategy corresponding to the target task based on the comparison result.

[0057] Considering that different types of tasks require different resources when executed on a cluster, in a multi-cloud Kubernetes cluster environment, the scheduling strategy corresponding to the target task can be determined by leveraging the global resource availability of the cluster group to ensure reasonable and efficient task execution.

[0058] Optionally, the scheduling strategy can be determined by comparing the global resource idle amount with the resource threshold range. The resource threshold range is used to determine which scheduling strategy can be executed on the target task based on the global resource idle amount of the cluster group. The resource threshold range provided in this embodiment is [10%, 90%]. The resource threshold range can be determined according to the hardware configuration and business requirements of the cluster group in the actual application scenario, and is not limited here.

[0059] In some embodiments, the step of determining the scheduling strategy corresponding to the target task based on the comparison results may include:

[0060] (1) When the global idle resources are greater than the resource threshold range, determine the first scheduling strategy.

[0061] The first scheduling strategy is used to perform round-robin scheduling or greedy scheduling on the target task. When the global resource idle amount is relatively large, for example, when the global resource idle amount is 96.365%, which is greater than the resource threshold range [10%, 90%], it means that each cluster in the cluster group has sufficient storage and computing resources to execute the target task. Therefore, the first scheduling strategy can be used to distribute the target task, thereby making full use of the currently idle computing and storage resources of the cluster group. Round-robin scheduling means that each cluster in the cluster group takes turns receiving the distributed task. Greedy scheduling means that each time, the cluster with the largest resource idle amount in the cluster group is selected to distribute the task.

[0062] As one implementation method, when the global resource idle amount of the Kubernetes cluster group is obtained, the global resource idle amount can be compared with the resource threshold range. If the comparison result is that the global resource idle amount is greater than the resource threshold range, the scheduling strategy corresponding to the target task is determined to be round-robin scheduling or greedy scheduling. Optionally, when both round-robin scheduling and greedy scheduling can be performed on the target task, the scheduling strategy of the target task can be set to round-robin scheduling by default.

[0063] (2) When the global resource idle amount is within the resource threshold range, obtain the target task information of the target task, and determine the second scheduling strategy based on the target task information.

[0064] When the global resource idle rate is within the resource threshold range (e.g., 69.517%, falling within the threshold range [10%, 90%]), the cluster's storage and computing resources are insufficient to meet the resource requirements of multiple tasks simultaneously submitted to the scheduling system. Therefore, a scheduling strategy can be determined for each task that reasonably utilizes the cluster's currently idle computing and storage resources to ensure successful task deployment.

[0065] The second scheduling strategy is used to perform split scheduling or lossy scheduling on the target task. The purpose of split scheduling and lossy scheduling is to reduce the resource requirements required when the target task is executed. For example, split scheduling splits the target task into multiple subtasks, so that the resource requirements of each subtask are much lower than those of the target task. Lossy scheduling reduces the number of Pods while ensuring that the target task can be executed successfully, thereby also reducing the resource requirements of the original task.

[0066] The target task information is generated based on user-inputted task parameters. These parameters can be used to generate configuration files and determine the task's position in the task queue. The target task information includes scheduling parameters, which determine the appropriate scheduling strategy for the target task, such as whether the target task can be split-scheduled, lossy, or preempted.

[0067] Optionally, when creating a task, the task priority and waiting time of the new task can be obtained based on the task information. The position of the task marker in the task queue is then determined based on the task priority and waiting time. This task queue stores task markers, allowing high-priority tasks and those with longer waiting times to run first, thereby improving the efficiency and fairness of task scheduling. For example, the task marker of the target task can be obtained from the head of the task queue, and then the target task information can be obtained based on the task marker. Further, a second scheduling strategy is determined based on the target task information.

[0068] As one implementation, the step of determining the second scheduling strategy based on the target task information may include:

[0069] (2.1) Obtain scheduling priority.

[0070] (2.2) Based on the scheduling parameters and scheduling priority, determine the second scheduling strategy for the target task.

[0071] To ensure that the target task can be executed efficiently on the cluster, scheduling priorities can be set for split scheduling and lossy scheduling. In this embodiment, the scheduling priority of split scheduling is greater than that of lossy scheduling.

[0072] Optionally, when the scheduling parameters match split scheduling and lossy scheduling, split scheduling is selected as the second scheduling strategy for the target task based on the scheduling priority; when the scheduling parameters match split scheduling, split scheduling is selected as the second scheduling strategy for the target task; when the scheduling parameters match lossy scheduling, lossy scheduling is selected as the second scheduling strategy for the target task. Split scheduling involves dividing the target task into multiple subtasks and distributing these subtasks to different Kubernetes clusters for execution. Lossy scheduling reduces the number of container groups associated with the target task.

[0073] (3) When the global resource idle amount is less than the resource threshold range, determine the third scheduling strategy.

[0074] The third scheduling strategy is used to perform preemptive scheduling on the target task. Optionally, the global resource idle amount is compared with the resource threshold range. If the comparison result shows that the global resource idle amount is less than the resource threshold range (e.g., the global resource idle amount is 4.953%, which is less than the resource threshold range [10%, 90%]), and if the scheduling parameters of the target task match preemptive scheduling, then preemptive scheduling can be performed on the target task, thereby freeing up computing and storage resources in the cluster group for executing the target task. Specifically, tasks that are already running in the Kubernetes cluster group and have shorter running times than other tasks can be terminated, as can tasks with the lowest priority in the Kubernetes cluster group.

[0075] Step S150: Distribute the task to the target task according to the scheduling strategy.

[0076] Task deployment refers to the process of deploying target tasks to Kubernetes cluster groups according to scheduling policies, so that the Kubernetes clusters can efficiently execute target tasks based on the scheduling policies.

[0077] As one implementation method, the target task can be assigned based on round-robin scheduling or greedy scheduling. Optionally, the target task can be deployed to a Kubernetes cluster that has not been round-robind, based on the sequence number of each Kubernetes cluster in the Kubernetes cluster group. Alternatively, the target task can be deployed to the cluster in the cluster group with the largest amount of idle resources.

[0078] As another implementation method, the target task can be executed and the task can be dispatched according to the split scheduling. Specifically, the target task is split according to the global resource idle amount to obtain a preset number of target sub-tasks. Further, the target cluster corresponding to each target sub-task is determined, and the task can be dispatched to each target sub-task. Each target sub-task is dispatched to the corresponding target cluster.

[0079] For example, the target task can be broken down into multiple target subtasks, with the preset number being equal to the number of Kubernetes clusters in the Kubernetes cluster group. Each target subtask is identical to the target task except for having a different number of container groups and a different task tag.

[0080] Optionally, the ratio of the number of container groups between target subtasks is the same as the ratio of the amount of available resources among Kubernetes clusters in a Kubernetes cluster group. For example, if the ratio of available resources between Cluster1 and Cluster2 in a Kubernetes cluster group is 1:2, and the number of container groups for the target task is 3, when the target task is split into two target subtasks (subtask 1 and subtask 2), the ratio of the number of container groups between subtask 1 and subtask 2 is also 1:2, thus determining that subtask 1 has 1 container group and subtask 2 has 2 container groups.

[0081] In this embodiment of the application, when the global resource idle amount is within the resource threshold range, the task is split into multiple sub-tasks and the multiple sub-tasks are distributed to each Kubernetes cluster in the cluster group for execution, so that the remaining resources among the Kubernetes clusters are relatively balanced, thereby improving the resource utilization of the multi-cloud Kubernetes cluster and reducing the generation of cluster group resource fragmentation.

[0082] As another implementation method, task delivery for the target task can be based on lossy scheduling. Specifically, a preset lossy ratio of the target task can be obtained, and the number of container groups corresponding to the target task can be determined based on the preset lossy ratio and the global resource idle amount. Then, task delivery for the target task can be based on the number of container groups corresponding to the target task.

[0083] The preset lossy ratio refers to the ratio of the number of container groups reduced from the target task to the original number of container groups in the target task. When creating a task, the task administrator sets the preset lossy ratio in the task parameters. During the lossy scheduling of the target task, the number of container groups to be subtracted from the target task can be determined according to the preset lossy ratio. Furthermore, if the global resource availability still meets the resource requirements for executing the target task after reducing the number of container groups, the target task will be assigned to the cluster group; otherwise, the task assignment will fail.

[0084] In this embodiment of the application, the target task is assigned to the execution task through lossy scheduling, which reduces the resource requirements of the target task, i.e. the number of container groups, without affecting the execution of the target task, thereby enabling the target task to run normally and improving the overall scheduling success rate of the task.

[0085] As another implementation, task execution can be based on preemptive scheduling. Specifically, the execution time of tasks running in the cluster group can be determined, and then tasks can be sorted in ascending order according to their execution time. Tasks are terminated sequentially from the head to the tail of the sorted list until the global resource availability meets the resource requirements of the target task. Optionally, tasks with lower priority can be terminated first, or tasks with lower priority and shorter execution time can be terminated first.

[0086] In this embodiment of the application, for tasks that can be preemptively scheduled, when the resources of the cluster group cannot meet the resource requirements for executing the target task, some running tasks are terminated according to the task priority and task running time to free up resources for the running of high-priority tasks.

[0087] In this embodiment, a target task and a cluster group (including multiple clusters) can be obtained. Resource status information for each cluster is acquired, and resources are integrated based on this information to calculate the global available resource amount for the cluster group. Furthermore, the global available resource amount is compared with a resource threshold range. Based on the comparison result, a scheduling strategy corresponding to the target task is determined, and the task is executed according to the scheduling strategy. Thus, the comparison result between the calculated global available resource amount and the resource threshold range reflects the resource status of the cluster group. By utilizing the global available resource amount, a suitable task scheduling strategy is determined for the target task, thereby improving the efficiency and success rate of task scheduling.

[0088] Based on the methods described in the above embodiments, the following examples will provide further detailed explanations.

[0089] The task scheduling method provided in this embodiment specifically relates to cloud computing task scheduling technology. The following description will take the integration of a task scheduling device into a computer device as an example, and will focus on… Figure 4 The process shown combines Figure 5 The application scenarios shown are described in detail. This computer device can be a server or a terminal device, etc. Please refer to [link / reference]. Figure 4 , Figure 4 This application illustrates another task scheduling method provided by an embodiment of the present application. In a specific embodiment, this task scheduling method can be applied to, for example... Figure 5 In the cloud computing service scenario shown.

[0090] A cloud computing service provider offers a cloud computing service platform, which may include a server (400) and a client. Users can submit multiple tasks to be processed to the cloud computing platform through the client, such as the neural network training task in this embodiment. When the cloud computing platform receives multiple tasks submitted by the client, it can perform cloud computing on these tasks through the server (400).

[0091] The server 400 includes multiple servers for cloud computing and a task scheduling system to control the operation of these servers. These servers can be deployed in different regions, and each server can host multiple Kubernetes clusters. The task scheduling system can be installed on a laptop 420 and provides a task management interface 410 to offer a visual interface for task administrators.

[0092] To improve task processing efficiency, a Kubernetes cluster group, i.e., a multi-cloud Kubernetes cluster, can be built based on multiple Kubernetes clusters. Optionally, the cloud computing service scenario provided in this application can build a dedicated virtual Kubernetes cluster group for processing model training tasks based on Kubernetes clusters on servers in different regions (cloud environments). Alternatively, a Kubernetes cluster group can be built for Kubernetes clusters on the same server; this is not limited here. The task scheduling method may specifically include the following steps:

[0093] Step S210: The computer device acquires the target task and cluster group.

[0094] The cloud computing platform receives multiple neural network training tasks {task1, task2, ..., task...} from different users. n After}, n>0 & n∈N * Task administrators can input the task parameters required for each task execution through the task management interface 410. These parameters may include the number of Pods, the number of CPU cores, the amount of memory space, the amount of disk space, the task completion time, scheduling parameters (lossy scheduling, split scheduling, or preemptive scheduling), priority, and waiting time.

[0095] The task scheduling system can record task parameters in the form of task configs, generate task templates based on the task configs, and store the task templates in a database on disk, which can be SQLite3. Based on the task parameters of each training task, the task scheduling system can generate a corresponding YAML file for each training task. Each YAML file is located in a local directory and is used to distribute training tasks.

[0096] Optionally, when generating the task template, a task identifier, i.e., a task ID, can be generated for the training task. The task ID for each training task is then saved to a task queue Q constructed from a Redis database. task It is worth noting that the training task needs to be inserted into the task queue Q according to its priority and waiting time. task In the meantime, the task queue waits for the task scheduling system to schedule the task. The task waiting time refers to the time in task queue Q. task The waiting time for training tasks that are in a waiting-for-scheduling state.

[0097] If only task priority is considered, the task queue Q is... task When a new high-priority training task is input, it is inserted before low-priority tasks, potentially causing low-priority tasks to remain unscheduled for extended periods. However, by considering both task priority and waiting time, if a low-priority task has already waited a long time, even if a high-priority task arrives, it cannot be prioritized, thus allowing the low-priority task to be scheduled. This ensures that high-priority tasks run first while preventing starvation for low-priority tasks, thereby improving the efficiency and fairness of task scheduling.

[0098] For example, task queue Q task The priority and waiting time of the new training task input are known. The task scheduling system can then use the task queue Q... task The queue position where the task ID of a training task should be inserted is calculated based on the task priority and waiting time of the training tasks currently awaiting scheduling. For example, a queue position score is calculated for the task ID based on the task priority and waiting time; the higher the queue position score, the higher the task ID is in task queue Q. task In the task queue, the closer a task is to the head, the higher its priority for scheduling. If the input training task has a very low priority and its waiting time is zero, its task ID will be inserted into the task queue Q. task The back of the line.

[0099] As one implementation method, when scheduling tasks, the task scheduling system can obtain the task queue Q. task The task ID at the head of the queue is used as the target task, and the corresponding training task is used as the target task. Furthermore, Kubernetes cluster groups composed of multiple Kubernetes clusters in different cloud environments are obtained.

[0100] Step S220: The computer device obtains the resource status information of each cluster.

[0101] As one implementation, computer devices can install resource acquisition components, such as Prometheus, Grafana, and Metrics, on each Kubernetes cluster. The task scheduling system can then use the RESTful interface provided by the resource acquisition component to obtain the resource status information of each cluster in real time in the configured JSON format.

[0102] Specifically, the JSON format includes the time, number of CPU cores, CPU utilization, and number of available CPU cores for each cluster's resource status information. For example, when obtaining the number of available CPU cores, one can first determine the available nodes in a cluster, and then determine the number of available CPU cores for those nodes.

[0103] Step S230: The computer equipment integrates resources based on the resource status information of each cluster and calculates the global resource idle amount of the cluster group.

[0104] Since the overall remaining resources of the cluster group are crucial to the successful deployment and execution of tasks, it is necessary to obtain a scalar quantity that reflects the overall remaining resources of the cluster group, i.e., the global resource idle amount. This global resource idle amount can be calculated from the resource status information of each cluster in the cluster group.

[0105] In some embodiments, the step of calculating the global resource free volume of the cluster group by integrating resources based on the resource status information of each cluster may include:

[0106] (1) The computer equipment processes the resource status information of each cluster in the cluster group to obtain the cluster resource information corresponding to each cluster.

[0107] (2) The computer equipment integrates the cluster resource information of each cluster and calculates the global resource idle amount of the cluster group.

[0108] As one implementation, computer devices can install the Flask platform, allowing the task scheduling system to utilize the RESTful interface provided by the Flask platform to obtain the global resource availability of the cluster group. Specifically, the Flask platform can process the resource status information of each Kubernetes cluster obtained from the Prometheus resource acquisition component to obtain the cluster resource information corresponding to each Kubernetes cluster.

[0109] Furthermore, the task scheduling system calculates the average value of the cluster resource information for each Kubernetes cluster to characterize the overall resource status of the Kubernetes cluster group and obtain the global resource idle amount for the Kubernetes cluster group. For example, the average value of the cluster resource information obtained for each Kubernetes cluster is calculated, and then the average value of all resource status information is used as the global resource idle amount for the cluster group.

[0110] Step S240: The computer device compares the global available resources with the resource threshold range, and determines the scheduling strategy corresponding to the target task based on the comparison result.

[0111] In this embodiment of the application, when a computer device obtains the global resource idle amount of a cluster group, it can determine the scheduling strategy corresponding to the target task based on the global resource idle amount. For example, the task scheduling system can determine the scheduling strategy by comparing the global resource idle amount with a resource threshold range. The comparison result can include the global resource idle amount being greater than the resource threshold range, the global resource idle amount being within the resource threshold range, or the global resource idle amount being less than the resource threshold range. The resource threshold range obtained by the task scheduling system can be [10%, 90%].

[0112] In some embodiments, the step of comparing the global available resources with a resource threshold range and determining the scheduling strategy corresponding to the target task based on the comparison result may include:

[0113] (1) When the global idle resources are greater than the resource threshold range, the computer device determines the first scheduling strategy.

[0114] The first scheduling strategy is used to perform round-robin scheduling or greedy scheduling on the target task.

[0115] As one implementation method, the task scheduling system can compare the global resource idle amount with a resource threshold range. For example, when the global resource idle amount is 94.351%, the global resource idle amount of the task scheduling system is greater than the resource threshold range [10%, 90%], thereby determining that the scheduling strategy corresponding to the target task can be round-robin scheduling or greedy scheduling. Furthermore, if the task scheduling system determines that the target task can be scheduled using round-robin scheduling or greedy scheduling based on the scheduling parameters of the target task, then the default scheduling strategy corresponding to the target task is round-robin scheduling.

[0116] (2) When the global resource idle amount is within the resource threshold range, the computer device obtains the target task information of the target task and determines the second scheduling strategy based on the target task information.

[0117] The second scheduling strategy is used to perform split scheduling or lossy scheduling on the target task. The task scheduling system can compare the global resource idle amount with the resource threshold range. For example, when the global resource idle amount is 78.739%, the global resource idle amount of the task scheduling system is within the resource threshold range [10%, 90%], thus determining that the scheduling strategy corresponding to the target task can be split scheduling or lossy scheduling. Furthermore, the task scheduling system also needs to obtain the target task information and, based on the target task information, finally determine which type of second scheduling strategy the target task should use.

[0118] As one implementation, the step of the computer device determining a second scheduling strategy based on target task information may include:

[0119] (2.1) Computer devices obtain scheduling priorities.

[0120] (2.2) The computer device determines the second scheduling strategy for the target task based on the scheduling parameters and scheduling priority.

[0121] For example, the task scheduling system can retrieve target task information from the SQLite3 database based on the target task's task tag. This target task information includes the target task's scheduling priority and scheduling parameters. Optionally, when the scheduling parameters match split scheduling and lossy scheduling, the task scheduling system can select split scheduling as the target task's second scheduling strategy based on the scheduling priority.

[0122] When the scheduling parameters match split scheduling, the task scheduling system can select split scheduling as the second scheduling strategy for the target task. When the scheduling parameters match lossy scheduling, the task scheduling system can select lossy scheduling as the second scheduling strategy for the target task.

[0123] (3) When the global idle resources of the computer equipment are less than the resource threshold range, the third scheduling strategy is determined.

[0124] The third scheduling strategy is used to preemptively schedule the target task.

[0125] As one implementation method, the task scheduling system can compare the global resource idle amount with the resource threshold range. For example, when the global resource idle amount is 6.186%, the task scheduling system can determine that the scheduling strategy corresponding to the target task can be preemptive scheduling if the global resource idle amount is less than the resource threshold range [10%, 90%].

[0126] Step S250: The computer device issues the target task execution task according to the scheduling strategy.

[0127] When a computer device determines the scheduling policy corresponding to a target task based on the global resource availability, it can issue the target task execution task according to the scheduling policy, thereby deploying the target task to the cluster group according to the scheduling policy, and then the Kubernetes cluster of the cluster group can execute the target task.

[0128] As one implementation method, task assignment can be performed on the target task based on round-robin scheduling or greedy scheduling.

[0129] Optionally, the cloud computing service platform provides a Kubernetes cluster group {Cluster1, Cluster2, ..., Cluster} containing m Kubernetes clusters. m}, m>0 & m∈N * When the task scheduling system determines that the scheduling policy for the target task is round-robin scheduling, it can distribute the target task to a Kubernetes cluster that has not yet been round-robined. For example, if the Kubernetes clusters in the current Kubernetes cluster group have already been round-robined with Clust... 31 Therefore, the task scheduling system can distribute the target task to the Cluster. 32 superior.

[0130] Optionally, the task scheduling system can obtain the resource idle amount of each Kubernetes cluster in the Kubernetes cluster group and determine the Kubernetes cluster with the largest resource idle amount. Then, the task scheduling system can distribute the target task to that Kubernetes cluster.

[0131] As another implementation, the task scheduling system can distribute task execution based on split scheduling. Specifically, the task scheduling system can split the target task into w target subtasks. If there are m Kubernetes clusters in the Kubernetes cluster group, then w = m. The task scheduling system also needs to ensure that the ratio of the number of container groups among the target subtasks is the same as the ratio of the available resources among the Kubernetes clusters in the Kubernetes cluster group.

[0132] For example, a Kubernetes cluster group contains two Kubernetes clusters: Cluster1 and Cluster2. The ratio of idle resources between Cluster1 and Cluster2 in the Kubernetes cluster group is 1:2, and the target task has 3 container groups. The task scheduling system can split the target task into two subtasks, thus determining that subtask 1 has 1 container group and subtask 2 has 2 container groups.

[0133] As another implementation, the task scheduling system can distribute tasks to the target task based on lossy scheduling. Specifically, the task scheduling system obtains a preset loss ratio for the target task, which is set by the task administrator when creating the task. The preset loss ratio, LossRate, represents the number of Pods that the target task reduces. remove The number of Pods in the original container group of the target task raw The ratio, LossRate, can be expressed as:

[0134]

[0135] Furthermore, the task scheduling system can base its scheduling on a preset loss ratio (LossRate) and the number of pods in the original container group of the target task. raw Delete the Pod for the target task remove If a container group is deleted, the Pod will be removed. remove If, after creating a container group, the global available resources still meet the resource requirements for executing the target task, the target task will be distributed to the cluster group; otherwise, the task distribution will fail.

[0136] For example, the original number of container groups (Pods) for the target task. raw =200, when performing lossy scheduling on the target task, if LossRate=20%, then the Pod for the target task will be deleted. remove =200 × 20% = 40 container groups. At this time, the target task has 160 container groups. If the global resource availability meets the requirement of 160 container groups, the target task scheduling will succeed; otherwise, the task scheduling will fail.

[0137] As another implementation, the task scheduling system can assign tasks to the target task based on preemptive scheduling. Specifically, the task scheduling system can determine the execution time of tasks running in the cluster group, and then sort them in ascending order according to their execution time. Tasks with the shortest execution time are terminated sequentially from the head to the tail of the sort, until the global resource availability meets the resource requirements of the target task. Optionally, tasks with lower priority can also be terminated first.

[0138] It's important to note that the reason for terminating the shortest-running tasks is that terminating them at the beginning minimizes the loss of resources. Terminating tasks that have been running for a long time would result in a relatively larger loss. Since lower-priority tasks also consume cluster resources, they can also be terminated first. The fewer tasks terminated, the better, provided that the global resource availability meets the resource needs of the target task.

[0139] Step S260: The computer device obtains the execution status information of the target task.

[0140] The execution status information includes at least the task runtime, the number of container groups, and the task scheduling policy.

[0141] As one implementation method, after the task scheduling system distributes the target task to the Kubernetes cluster group according to the scheduling strategy, it can obtain the execution status information of the target task from the Kubernetes cluster group in real time and store the execution status information in a database, such as an SQLite3 database.

[0142] Step S270: The computer device sends the execution status information to the administrator so that the administrator can display the execution status information of the target task.

[0143] In this embodiment of the application, the administrator can be the task administrator of the task scheduling system or the user corresponding to the client of the cloud computing service platform.

[0144] As one implementation, the task scheduling system can retrieve execution status information from the SQLite3 database and display it as a status diagram through the task management interface 410. Please refer to [link / reference]. Figure 6 , Figure 6 A real-time task status graph is shown, which is displayed in the task management interface 410. It includes the status number of different training tasks, scheduling policy, cluster, number of running Pods, total number of Pods, running time, completion time, current status, creation time, start time, and end time.

[0145] Please see Figure 7 , Figure 7 A flowchart of a task computation is shown. For example, a cloud computing platform can receive multiple neural network training tasks {task1, task2, ..., task...} from different users. n Please refer to the following: Figure 8 The flowchart shown illustrates the task creation and distribution process. Task administrators can input the task parameters required for each task execution through the task management interface 410. These parameters may include the number of Pods, the number of CPU cores, the amount of memory space, the amount of disk space, the task completion time, scheduling parameters (lossy scheduling, split scheduling, or preemptive scheduling), priority, and waiting time.

[0146] The task scheduling system can record task parameters in the form of task configs, generate task templates based on the task configs, and store the task templates in an SQLite3 database on disk. When generating task templates, the task scheduling system can generate task expectations based on the task configs. These expectations represent the expected final state the task can achieve. Furthermore, based on these expectations, a task identifier (task ID) is generated for each training task. The task scheduling system then saves the task ID of each training task to a task queue Q constructed from a Redis database. task middle.

[0147] The task scheduling system can read the task queue Q from the Redis database in real time. task The multi-cluster scheduler of the task scheduling system can obtain the task queue Q. task The task ID at the head of the queue is used as the target task, and the training task corresponding to the task ID is used as the target task. Furthermore, the task scheduling system can find the target task template and target task information from the database based on the task ID, and then determine the scheduling strategy of the target task based on the target task information, and issue the target task according to the scheduling strategy.

[0148] Thus, the task scheduling system schedules the training tasks {task1, task2, ..., task...} of multiple neural networks. n After being deployed to a multi-cloud Kubernetes cluster, the cluster executes multiple training tasks. The task scheduling system, through its resource acquisition component, retrieves the latest task status of each training task from the cluster in real time. It then processes this status data to obtain the execution status information for each task, and subsequently updates this information, i.e., the task status, in the SQLite3 database. The task scheduling system can utilize a status update module and an information statistics module to process the task status.

[0149] Specifically, the state update module can acquire and process the latest execution state data for different training tasks. For example, please refer to [link to relevant documentation]. Figure 9 , Figure 9 A schematic diagram of a task status update is shown. For example... Figure 9As shown, the state update module can obtain the latest execution state data for different training tasks based on the Kubernetes library provided by the Python programming language. This latest state data includes information such as state number, scheduling policy, cluster, number of running Pods, total number of Pods, elapsed running time, completion time, current state, creation time, start time, end time, and progress. Since this latest state data may contain noise or missing values, it can be processed to obtain clean, usable task state data, which is then updated in the database storing the state data.

[0150] Furthermore, the information statistics module can perform information statistics and processing based on the task status data obtained after the task status is updated. Please refer to [link / reference]. Figure 10 , Figure 10 A schematic diagram of task information statistics is shown. For example... Figure 10 As shown, the information statistics module can obtain task status indicators from the task scheduling system, which are the status indicators of the task status information that the user inputs and needs to display, such as status number, scheduling policy, cluster, number of running Pods, total number of Pods, running time, completion time, current status, creation time, start time, and end time.

[0151] Furthermore, the information statistics module can also process information based on the task status data and task status indicators stored in the status update module, and use the task status data that matches the task status indicators as the execution status information for display. Then, the execution status information is updated in the database so that the display module can obtain the execution status information from the database and display the execution status information of each training task on the real-time task status graph in the task management interface 410.

[0152] In this embodiment, a target task and a cluster group (including multiple clusters) can be obtained. Resource status information for each cluster is acquired, and resources are integrated based on this information to calculate the global available resource amount for the cluster group. Further, the global available resource amount is compared with a resource threshold range. Based on the comparison result, a scheduling strategy corresponding to the target task is determined, and the task is executed according to the scheduling strategy. Further, the execution status information of the target task is acquired and sent to the management unit for display. Thus, the comparison result between the calculated global available resource amount and the resource threshold range reflects the resource status of the cluster group, and the global available resource amount is used to determine a suitable task scheduling strategy for the target task, thereby improving the efficiency and success rate of task scheduling.

[0153] Please see Figure 11The diagram illustrates a structural block diagram of a task scheduling device 500 provided in an embodiment of this application. The task scheduling device 500 includes: a first acquisition module 510, used to acquire a target task and a cluster group, the cluster group including multiple clusters; a second acquisition module 520, used to acquire resource status information of each cluster; a resource calculation module 530, used to perform resource integration based on the resource status information of each cluster and calculate the global resource idle amount of the cluster group; a strategy determination module 540, used to compare the global resource idle amount with a resource threshold range and determine the scheduling strategy corresponding to the target task based on the comparison result; and a task delivery module 550, used to execute task delivery for the target task according to the scheduling strategy.

[0154] In some embodiments, the strategy determination module 540 may include: a first scheduling unit, configured to determine a first scheduling strategy when the global resource idle amount is greater than a resource threshold range, the first scheduling strategy being used to perform round-robin scheduling or greedy scheduling on the target task; a second scheduling unit, configured to obtain target task information of the target task when the global resource idle amount is within the resource threshold range, and determine a second scheduling strategy based on the target task information, the second scheduling strategy being used to perform split scheduling or lossy scheduling on the target task; and a third scheduling unit, configured to determine a third scheduling strategy when the global resource idle amount is less than a resource threshold range, the third scheduling strategy being used to perform preemptive scheduling on the target task.

[0155] In some embodiments, the target task information includes scheduling parameters, which are used to determine the scheduling strategy matching the target task. The second scheduling unit may include: an acquisition subunit, used to acquire the scheduling priority, wherein the scheduling priority of split scheduling is greater than the scheduling priority of lossy scheduling; and a determination subunit, used to determine the second scheduling strategy of the target task based on the scheduling parameters and the scheduling priority.

[0156] In some embodiments, the determining sub-unit may be specifically used for: when the scheduling parameters match split scheduling and lossy scheduling, selecting split scheduling as the second scheduling strategy for the target task based on the scheduling priority; when the scheduling parameters match split scheduling, selecting split scheduling as the second scheduling strategy for the target task; and when the scheduling parameters match lossy scheduling, selecting lossy scheduling as the second scheduling strategy for the target task.

[0157] In some embodiments, when the scheduling strategy is split scheduling, the task distribution module 550 can be specifically used to: split the target task according to the global resource idle amount to obtain a preset number of target subtasks; determine the target cluster corresponding to each target subtask, and perform task distribution for each target subtask, distributing each target subtask to the corresponding target cluster; wherein, each target subtask is associated with a corresponding number of container groups, and the number of container groups is determined by the remaining resources of the target cluster corresponding to each target subtask.

[0158] In some embodiments, when the scheduling strategy is lossy scheduling, the task distribution module 550 can be specifically used to: obtain a preset lossy ratio value for the target task; determine the number of container groups corresponding to the target task based on the preset lossy ratio value and the global resource idle amount; and perform task distribution for the target task according to the number of container groups corresponding to the target task.

[0159] In some embodiments, the resource calculation module 530 may be specifically used to: process the resource status information of each cluster in the cluster group to obtain the cluster resource information corresponding to each cluster; and integrate resources based on the cluster resource information of each cluster to calculate the global resource idle amount of the cluster group.

[0160] In some embodiments, the second scheduling unit may be specifically used to: obtain the task tag of the target task from the head position of the task queue; obtain the target task information of the target task based on the task tag; wherein the target task information is generated based on the task parameters input by the user, the task parameters are used to generate the configuration file, and to determine the queue position of the task in the task queue.

[0161] In some embodiments, the task scheduling device 500 may further include: a third acquisition module, used to acquire the execution status information of the target task, the execution status information including at least the task runtime, the number of container groups and the task scheduling strategy; and an information sending module, used to send the execution status information to the administrator so that the administrator can display the execution status information of the target task.

[0162] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0163] In the several embodiments provided in this application, the coupling between modules can be electrical, mechanical, or other forms of coupling.

[0164] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0165] The solution provided in this application can acquire a target task and a cluster group, which includes multiple clusters, and obtain the resource status information of each cluster. Based on the resource status information of each cluster, resources are integrated to calculate the global resource idle amount of the cluster group. Furthermore, the global resource idle amount is compared with a resource threshold range. Based on the comparison result, a scheduling strategy corresponding to the target task is determined, and the task is executed according to the scheduling strategy. In this way, the comparison result of the calculated global resource idle amount with the resource threshold range reflects the resource status of the cluster group. By utilizing the global resource idle amount, a suitable task scheduling strategy is determined for the target task, thereby improving the efficiency and success rate of task scheduling.

[0166] like Figure 12 As shown in the figure, this application embodiment also provides a computer device 600, which includes a processor 610, a memory 620, a power supply 630, and an input unit 640. The memory 620 stores computer program instructions. When the computer program instructions are called by the processor 610, they can execute various method steps provided in the above embodiments. Those skilled in the art will understand that the structure of the computer device shown in the figures does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0167] The processor 610 may include one or more processing cores. The processor 610 connects to various parts of the entire battery management system using various interfaces and lines. It executes instructions, programs, code sets, or instruction sets stored in the memory 620, calls data stored in the memory 620, performs various functions and processes data within the battery management system, and performs various functions and processes data within the computer device, thereby providing overall control of the computer device. Optionally, the processor 610 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 610 may integrate one or more of the following: a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), and a modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 610 and may be implemented separately using a communication chip.

[0168] The memory 620 may include random access memory (RAM) or read-only memory (ROM). The memory 620 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 620 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), instructions for implementing the various method embodiments described below, etc. The data storage area may also store data created during the use of the computer device (such as phonebook and audio / video data). Accordingly, the memory 620 may also include a memory controller to provide the processor 610 with access to the memory 620.

[0169] The power supply 630 can be logically connected to the processor 610 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 630 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0170] The input unit 640 can be used to receive input digital or character information, and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0171] Although not shown, the computer device 600 may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 610 in the computer device loads the executable files corresponding to the processes of one or more applications into the memory 620 according to the following instructions, and the processor 610 runs the applications stored in the memory 620, thereby implementing the various method steps provided in the foregoing embodiments.

[0172] like Figure 13 As shown, this application embodiment also provides a computer-readable storage medium 700, which stores computer program instructions 610, which can be called by a processor to execute the methods described in the above embodiments.

[0173] Computer-readable storage media can be electronic storage devices such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, computer-readable storage media include non-volatile computer-readable storage medium. Computer-readable storage medium 700 has storage space for program code that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code can be compressed, for example, in a suitable form.

[0174] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations of the above embodiments.

[0175] The above are merely preferred embodiments of this application and are not intended to limit this application in any way. Although this application has disclosed preferred embodiments as above, it is not intended to limit this application. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the technical solution of this application. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of this application without departing from the scope of the technical solution of this application shall still fall within the scope of the technical solution of this application.

Claims

1. A task scheduling method, characterized in that, The method includes: Obtain the target task and cluster group, wherein the cluster group includes multiple clusters; Obtain resource status information for each cluster; Based on the resource status information of each cluster, resources are integrated to calculate the global resource idle amount of the cluster group; The global resource idle amount is compared with the resource threshold range, and the scheduling strategy corresponding to the target task is determined based on the comparison result. The target task is executed and task dispatched according to the scheduling strategy; The step of comparing the global resource idle amount with the resource threshold range and determining the scheduling strategy corresponding to the target task based on the comparison result includes: When the global resource idle amount is greater than the resource threshold range, a first scheduling strategy is determined. This first scheduling strategy is used to perform round-robin scheduling or greedy scheduling on the target task; or... When the global resource idle amount is within the resource threshold range, the target task information of the target task is obtained, and a second scheduling strategy is determined based on the target task information. The second scheduling strategy is used to perform split scheduling or lossy scheduling on the target task; or... When the global resource idle amount is less than the resource threshold range, a third scheduling strategy is determined, which is used to perform preemptive scheduling on the target task.

2. The method according to claim 1, characterized in that, The target task information includes scheduling parameters, which are used to determine the scheduling strategy matching the target task. The step of determining a second scheduling strategy based on the target task information includes: Obtain the scheduling priority, wherein the scheduling priority of the split scheduling is greater than the scheduling priority of the lossy scheduling; Based on the scheduling parameters and the scheduling priority, a second scheduling strategy for the target task is determined.

3. The method according to claim 2, characterized in that, The step of determining the second scheduling strategy for the target task based on the scheduling parameters and the scheduling priority includes: When the scheduling parameters match split scheduling and lossy scheduling, the split scheduling is selected as the second scheduling strategy for the target task according to the scheduling priority. When the scheduling parameters match split scheduling, the split scheduling is selected as the second scheduling strategy for the target task; When the scheduling parameters match lossy scheduling, the lossy scheduling is selected as the second scheduling strategy for the target task.

4. The method according to claim 1, characterized in that, When the scheduling strategy is split scheduling, the step of issuing task execution to the target task according to the scheduling strategy includes: The target task is split into a preset number of target subtasks based on the global resource availability. Determine the target cluster corresponding to each target subtask, and execute task distribution for each target subtask, distributing each target subtask to the corresponding target cluster; Each target subtask is associated with a corresponding number of container groups, the number of container groups being determined by the remaining resources of the target cluster corresponding to each target subtask.

5. The method according to claim 1, characterized in that, When the scheduling policy is lossy scheduling, the step of issuing the task to the target task according to the scheduling policy includes: Obtain the preset loss ratio value of the target task; Based on the preset loss ratio and the global resource idle amount, determine the number of container groups corresponding to the target task; Based on the number of container groups corresponding to the target task, the task is executed and issued.

6. The method according to claim 1, characterized in that, The process of integrating resources based on the resource status information of each cluster to calculate the global resource idle amount of the cluster group includes: The resource status information of each cluster in the cluster group is processed to obtain the cluster resource information corresponding to each cluster. Based on the cluster resource information of each cluster, resources are integrated to calculate the global resource idle amount of the cluster group.

7. The method according to claim 1, characterized in that, The step of obtaining the target task information of the target task includes: Obtain the task tag of the target task from the head of the task queue; Based on the task marker, obtain the target task information of the target task; The target task information is generated based on task parameters input by the user. These task parameters are used to generate a configuration file and determine the task's queue position in the task queue.

8. The method according to claim 1, characterized in that, After the task is dispatched to the target task according to the scheduling policy, the method further includes: Obtain the execution status information of the target task, which includes at least the task runtime, the number of container groups, and the task scheduling strategy; The execution status information is sent to the administrator so that the administrator can display the execution status information of the target task.

9. A task scheduling device, characterized in that, The device includes: The first acquisition module is used to acquire the target task and the cluster group, wherein the cluster group includes multiple clusters; The second acquisition module is used to acquire resource status information for each cluster; The resource calculation module is used to integrate resources based on the resource status information of each cluster and calculate the global resource idle amount of the cluster group. The strategy determination module is used to compare the global resource idle amount with the resource threshold range, and determine the scheduling strategy corresponding to the target task based on the comparison result; The task distribution module is used to distribute tasks to the target task according to the scheduling strategy. The strategy determination unit includes a first scheduling unit, a second scheduling unit, or a third scheduling unit; The first scheduling unit is used to determine a first scheduling strategy when the global resource idle amount is greater than the resource threshold range. The first scheduling strategy is used to perform round-robin scheduling or greedy scheduling on the target task. The second scheduling unit is used to obtain the target task information of the target task when the global resource idle amount is within the resource threshold range, and to determine a second scheduling strategy based on the target task information. The second scheduling strategy is used to perform split scheduling or lossy scheduling on the target task. The third scheduling unit is used to determine a third scheduling strategy when the global resource idle amount is less than the resource threshold range. The third scheduling strategy is used to perform preemptive scheduling on the target task.

10. The apparatus according to claim 9, characterized in that, The target task information includes scheduling parameters, which are used to determine the scheduling strategy matching the target task. The strategy determination module includes: Obtain a sub-unit for obtaining scheduling priority, wherein the scheduling priority of the split scheduling is greater than the scheduling priority of the lossy scheduling; A determination subunit is used to determine a second scheduling strategy for the target task based on the scheduling parameters and the scheduling priority.

11. The apparatus according to claim 10, characterized in that, The determining subunit is used for: When the scheduling parameters match split scheduling and lossy scheduling, the split scheduling is selected as the second scheduling strategy for the target task according to the scheduling priority. When the scheduling parameters match split scheduling, the split scheduling is selected as the second scheduling strategy for the target task; When the scheduling parameters match lossy scheduling, the lossy scheduling is selected as the second scheduling strategy for the target task.

12. The apparatus according to claim 9, characterized in that, When the scheduling strategy is split scheduling, the task distribution module is configured as follows: The target task is split into a preset number of target subtasks based on the global resource availability. Determine the target cluster corresponding to each target subtask, and execute task distribution for each target subtask, distributing each target subtask to the corresponding target cluster; Each target subtask is associated with a corresponding number of container groups, the number of container groups being determined by the remaining resources of the target cluster corresponding to each target subtask.

13. The apparatus according to claim 9, characterized in that, When the scheduling strategy is lossy scheduling, the task distribution module is configured as follows: Obtain the preset loss ratio value of the target task; Based on the preset loss ratio and the global resource idle amount, determine the number of container groups corresponding to the target task; Based on the number of container groups corresponding to the target task, the task is executed and issued.

14. The apparatus according to claim 9, characterized in that, The resource computing module is configured as follows: The resource status information of each cluster in the cluster group is processed to obtain the cluster resource information corresponding to each cluster. Based on the cluster resource information of each cluster, resources are integrated to calculate the global resource idle amount of the cluster group.

15. The apparatus according to claim 9, characterized in that, The strategy determination module is also used for: Obtain the task tag of the target task from the head of the task queue; Based on the task marker, obtain the target task information of the target task; The target task information is generated based on task parameters input by the user. These task parameters are used to generate a configuration file and determine the task's queue position in the task queue.

16. The apparatus according to claim 9, characterized in that, The task scheduling device further includes: The third acquisition module is used to acquire the execution status information of the target task, which includes at least the task runtime, the number of container groups, and the task scheduling strategy. The information sending module is used to send the execution status information to the administrator so that the administrator can display the execution status information of the target task.

17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code that can be invoked by a processor to execute the method as described in any one of claims 1 to 8.

18. A computer device, characterized in that, include: Memory; One or more processors are coupled to the memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to perform the method as described in any one of claims 1 to 8.

19. A computer program product, characterized in that, The computer program product includes computer instructions stored in a storage medium; a processor of a computer device reads the computer instructions from the storage medium and executes the computer instructions, causing the computer to perform the method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Task Processing Method and Virtual Machine

    US20150277993A1

  • Preemptive scheduling based resource sharing use method, system and

    WO2020000944A1