A task scheduling method, device, equipment and readable storage medium

By clustering tasks and resources and predicting their performance, the allocation of tasks and resources is optimized, which solves the problems of inaccurate task allocation and low efficiency in traditional scheduling methods and achieves efficient and accurate task allocation and resource utilization.

CN114327811BActive Publication Date: 2025-09-16LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111401382.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2025-09-16
Estimated Expiration
2041-11-19

Smart Images

  • Figure CN114327811B_ABST
    Figure CN114327811B_ABST
Patent Text Reader

Abstract

The present application discloses a task scheduling method, device, equipment and readable storage medium. The present application will fully consider the task characteristics and resource characteristics, and can allocate a task to the most suitable idle module based on its task characteristics, while ensuring the optimal performance. By doing so for each task, the maximum total performance can be obtained, which not only realizes the reasonable allocation of computing resources and improves the accuracy and efficiency of task allocation, but also ensures the optimal performance when the task is actually executed, which is beneficial to the smooth operation of the current service system. Accordingly, the task scheduling device, equipment and readable storage medium provided by the present application also have the above-mentioned technical effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a task scheduling method, apparatus, device, and readable storage medium. Background Art

[0002] Currently, traditional scheduling methods fail to consider task and resource characteristics, resulting in excessive scheduling overhead and low scheduling accuracy. This reduces the accuracy and efficiency of task allocation and negatively impacts the normal operation of current service systems. For example, the scheduling process consumes a large number of resources, leading to a shortage of resources available for platform operation.

[0003] Therefore, how to improve the accuracy and efficiency of task allocation is a problem that those skilled in the art need to solve. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a task scheduling method, apparatus, device, and readable storage medium to improve the accuracy and efficiency of task allocation. The specific solution is as follows:

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

[0006] Determine a plurality of tasks to be processed and a plurality of idle resources available on a current service system;

[0007] clustering the plurality of tasks based on a task attribute of each task to obtain a plurality of task classes;

[0008] Clustering the plurality of idle resources based on the resource attribute of each idle resource to obtain a plurality of resource classes;

[0009] For each task, predict the performance of the task when executed on each idle resource, and calculate the optimal performance of any task class when executed on any resource class based on the performance;

[0010] Compare the number of task classes with the number of resource classes;

[0011] If the number of task classes is equal to the number of resource classes, then the multiple task classes are used as schedulable task classes, and the multiple resource classes are used as schedulable resource classes. Based on the optimal efficiency, a one-to-one mapping relationship is constructed between the schedulable task classes and the schedulable resource classes to obtain a scheduling result with the maximum sum of total efficiency.

[0012] Preferably, predicting, for each task, the performance obtained by executing the task on each idle resource includes:

[0013] For each task, group the task with each idle resource into a target group, and obtain multiple target groups equal to the total number of idle resources;

[0014] Determine the bandwidth utilization score, overhead score, energy consumption score, and execution time corresponding to each target group;

[0015] Based on the bandwidth utilization score, the overhead score, the energy consumption score, and the execution time, the performance obtained by executing the tasks in each target group on the idle resources in the target group is predicted.

[0016] Preferably, determining the bandwidth utilization score, overhead score, energy consumption score, and execution time corresponding to each target group; and predicting the performance obtained by executing tasks in each target group on idle resources in the target group based on the bandwidth utilization score, the overhead score, the energy consumption score, and the execution time, includes:

[0017] For each target group, the performance obtained by executing the tasks in the target group on the idle resources in the target group is predicted according to the performance calculation formula; the performance calculation formula is:

[0018]

[0019] Where BI(i,j) is the performance obtained by executing task i on idle resource j; task i and idle resource j form a target group;

[0020] The bandwidth utilization score corresponding to the target group constructed for task i and idle resource j; Score(i,j) represents the priority score of task i; P(i,j) represents the bandwidth used by task i to execute on idle resource j. It represents the sum of the bandwidth used by task i when executing on m idle resources, where m is the total number of idle resources.

[0021] The cost score corresponding to the target group constructed for task i and idle resource j; Cost(i,j) represents the computational cost of executing task i on idle resource j. represents the sum of the computational overhead of executing task i on m idle resources;

[0022] The energy consumption score corresponding to the target group constructed for task i and idle resource j; EC(i,j) represents the energy consumption of task i executed on idle resource j. It represents the sum of energy consumption of task i when executing on m idle resources;

[0023] DT(i,j) is the execution time corresponding to the target group constructed by task i and idle resource j.

[0024] Preferably, the calculation formula for the priority score of task i is:

[0025]

[0026] Among them, Score(i,j) represents the priority score of task i, priority(i) is the priority weight value of task i, and DT(i,j) is the execution time corresponding to the target group constructed by task i and idle resource j; among them, the priority weight value is determined based on the urgency and importance of task i.

[0027] Preferably, the calculating of the optimal performance obtained by executing any task class on any resource class based on the performance size includes:

[0028] Match any task class with any resource class, and calculate the maximum performance sum obtained by executing each task in the task class by each idle resource in the resource class, and determine the maximum performance sum as the optimal performance obtained by executing the task class on the resource class.

[0029] Preferably, the constructing of a one-to-one mapping relationship between the schedulable task class and the schedulable resource class based on the optimal efficiency to obtain a scheduling result with the maximum total efficiency includes:

[0030] Randomly select a task class from all currently schedulable task classes as the scheduling target;

[0031] Determining the optimal performance achieved by executing the scheduling target on each currently schedulable resource class;

[0032] Selecting a resource class corresponding to a maximum value from the various optimal efficiencies as standby resources, and constructing a mapping relationship between the scheduling target and the standby resources;

[0033] Delete the scheduling target from all currently schedulable task classes, delete the standby resource from all currently schedulable resource classes, and execute the random selection of a resource from all currently schedulable task classes.

[0034] The method comprises the following steps: taking a task class as a scheduling target; determining the optimal performance obtained by executing the scheduling target on each current schedulable resource class; selecting the resource class corresponding to the maximum value from the each optimal performance as the standby resource, and constructing a mapping relationship between the scheduling target and the standby resource, until a one-to-one mapping relationship is established between each schedulable task class and each schedulable resource class.

[0035] Preferably, the constructing of a one-to-one mapping relationship between the schedulable task class and the schedulable resource class based on the optimal efficiency to obtain a scheduling result with the maximum total efficiency includes:

[0036] A one-to-one mapping relationship between the schedulable task class and the schedulable resource class is constructed based on the optimal efficiency using a flowering tree algorithm to obtain the scheduling result.

[0037] Preferably, the multiple tasks and / or the multiple idle resources are clustered using a K-means algorithm.

[0038] Preferably, it also includes:

[0039] If the number of task classes is greater than the number of resource classes, selecting task classes equal to the number of resource classes from the multiple task classes as schedulable task classes, using the multiple resource classes as schedulable resource classes, and executing the step of constructing a one-to-one mapping relationship between the schedulable task classes and the schedulable resource classes based on the optimal efficiency to obtain a scheduling result with the maximum total efficiency;

[0040] If the number of task classes is less than the number of resource classes, resource classes equal to the number of task classes are selected from the multiple resource classes as schedulable resource classes, the multiple task classes are used as schedulable task classes, and the step of constructing a one-to-one mapping relationship between the schedulable task classes and the schedulable resource classes based on the optimal efficiency is executed to obtain a scheduling result with the maximum sum of total efficiency.

[0041] Preferably, task classes equal in number to the resource classes are randomly selected from the multiple task classes as schedulable task classes, and / or resource classes equal in number to the task classes are randomly selected from the multiple resource classes as schedulable resource classes.

[0042] Preferably, based on each optimal efficiency, task classes equal to the number of resource classes and capable of maximizing the sum of total efficiency are selected from the multiple task classes as schedulable task classes, and / or resource classes equal to the number of task classes and capable of maximizing the sum of total efficiency are selected from the multiple resource classes as schedulable resource classes based on each optimal efficiency.

[0043] Preferably, it also includes:

[0044] Preprocessing the to-be-processed data of the plurality of tasks respectively to obtain standard data corresponding to each task;

[0045] According to the scheduling result, the tasks and corresponding standard data included in each task class are sent to the corresponding resource class, so that each resource class runs the corresponding task.

[0046] Preferably, if the number of task classes is greater than the number of resource classes, the working status of each resource class is monitored in real time while each resource class is running the corresponding task;

[0047] If there is an idle resource class, the step of comparing the number of task classes and the number of resource classes is performed for the remaining task classes to be processed in the multiple task classes and the idle resource class to allocate the remaining task classes to the idle resource class.

[0048] In a second aspect, the present application provides a task scheduling device, comprising:

[0049] Determining resources, for determining a plurality of tasks to be processed and a plurality of idle resources available on a current service system;

[0050] A first clustering resource is used to cluster the plurality of tasks based on a task attribute of each task to obtain a plurality of task classes;

[0051] A second clustering resource is used to cluster the plurality of idle resources based on the resource attribute of each idle resource to obtain a plurality of resource classes;

[0052] Performance prediction resources are used to predict, for each task, the performance obtained by executing the task on each idle resource, and calculate the optimal performance obtained by executing any task class on any resource class based on the performance sizes;

[0053] Compare resources, used to compare the number of task classes with the number of resource classes;

[0054] Scheduling resources, for if the number of task classes is equal to the number of resource classes, taking the multiple task classes as schedulable task classes, taking the multiple resource classes as schedulable resource classes, and constructing a one-to-one mapping relationship between the schedulable task classes and the schedulable resource classes based on the optimal efficiency, to obtain a scheduling result with the maximum sum of total efficiency.

[0055] In a third aspect, the present application provides an electronic device, comprising:

[0056] memory for storing computer programs;

[0057] The processor is used to execute the computer program to implement the task scheduling method disclosed above.

[0058] In a fourth aspect, the present application provides a readable storage medium for storing a computer program, wherein the computer program implements the aforementioned disclosed task scheduling method when executed by a processor.

[0059] As can be seen from the above scheme, the present application provides a task scheduling method, comprising: determining a plurality of tasks to be processed and a plurality of idle resources available on a current service system; clustering the plurality of tasks based on the task attributes of each task to obtain a plurality of task classes; clustering the plurality of idle resources based on the resource attributes of each idle resource to obtain a plurality of resource classes; for each task, predicting the performance obtained by executing the task on each idle resource, and calculating the optimal performance obtained by executing any task class on any resource class based on the performance sizes; and comparing the number of task classes with the number of resource classes.

[0060] If the number of task classes is equal to the number of resource classes, then the multiple task classes are used as schedulable task classes, and the multiple resource classes are used as schedulable resource classes. Based on the optimal efficiency, a one-to-one mapping relationship is constructed between the schedulable task classes and the schedulable resource classes to obtain a scheduling result with the maximum sum of total efficiency.

[0061] It can be seen that the present application clusters each task according to its characteristics, clusters each idle resource according to its characteristics, and predicts the performance of each task on each idle resource, and calculates the optimal performance of any task class on any resource class based on the performance, and then matches each task class with each resource class one by one based on the predicted optimal performance, and makes the matching result obtain the maximum total performance sum, thereby determining the corresponding scheduling result. This solution fully considers the task characteristics and resource characteristics, and can allocate a task to the most suitable idle resource based on its task characteristics, while ensuring the optimal performance. By doing this for each task, the maximum total performance sum can be obtained, which not only realizes the reasonable allocation of computing resources, improves the accuracy and efficiency of task allocation, but also ensures the optimal performance when the task is actually executed, which is beneficial to the smooth operation of the current service system.

[0062] Correspondingly, a task scheduling device, equipment and readable storage medium provided by this application also have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0064] Figure 1 This is a flow chart of a task scheduling method disclosed in this application;

[0065] Figure 2This is a schematic diagram of a task scheduling device disclosed in this application;

[0066] Figure 3 A schematic diagram of an electronic device disclosed in this application;

[0067] Figure 4 A schematic diagram of a task scheduling system disclosed in this application;

[0068] Figure 5 A flowchart of a task scheduling solution disclosed in this application;

[0069] Figure 6 for Figure 5 Schematic diagram of functional modules in the task scheduling scheme shown;

[0070] Figure 7 This is a schematic diagram of a bipartite graph disclosed in this application. DETAILED DESCRIPTION

[0071] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0072] In recent years, the rapid development of emerging fields such as big data, artificial intelligence, mobile intelligence, wireless communication technology, and 5G has driven the simultaneous growth of cloud computing, edge computing, and related industries. Cloud computing (CC), as a new computing model, relies on virtualization technology to integrate various resources in a "cloud" format and provide high-quality services to network users. The core technology of cloud computing is resource management, including unified resource management, scheduling, and allocation.

[0073] Currently, improving the efficiency of computing resource utilization in cloud computing, enhancing the overall scalability and usability of the system, optimizing key performance indicators, and rationally allocating computing resources and scheduling and optimizing tasks in real time have become the focus of common attention in academia and industry. At the same time, resource allocation and task scheduling are crucial to achieving a high-quality cloud computing platform.

[0074] Task scheduling in cloud computing essentially involves mapping tasks to resources, effectively allocating tasks to appropriate computing resources. As a crucial component of cloud computing systems, the effectiveness of scheduling strategies directly impacts resource utilization, user experience, and service quality on the cloud platform.

[0075] Studying task scheduling has profound guiding significance for theoretical research. It also offers enormous potential for social and economic value in engineering practice and commercial applications. From a theoretical perspective, studying task scheduling helps researchers gain a deeper understanding of the inherent properties and characteristics of diverse tasks, providing a scientific theoretical basis for research related to cloud computing resource management and scheduling. From a practical application perspective, studying task scheduling can assist cloud computing platform operators in rationally allocating computing resources, improving service quality, and optimizing service efficiency. However, the design of efficient task scheduling algorithms is challenging due to the large scale of network users, the complexity of task types, and the diverse types of computing resources.

[0076] Existing cloud computing scheduling algorithms, such as the Min-Min and Max-Min algorithms, can easily lead to an imbalanced distribution of cloud tasks, resulting in uneven load, low resource utilization, and excessive task execution time overhead. Furthermore, traditional scheduling methods that prioritize task time struggle to meet the quality of service requirements of cloud computing users, while value-based scheduling methods ignore the temporal nature of task execution. With the increasing number of users on cloud computing platforms, improving service quality is imperative. High-quality service is primarily determined by the performance of the cloud computing platform's task scheduling (TS) strategy.

[0077] As can be seen, in the case of a service system such as a cloud computing platform, traditional scheduling methods fail to consider task characteristics and resource features, resulting in excessive scheduling overhead and low scheduling accuracy, which reduces the accuracy and efficiency of task allocation and negatively impacts the normal operation of the current service system. For example, the scheduling process consumes a large number of resources, resulting in a shortage of resources available for platform operation. To this end, this application provides a task scheduling solution that can improve the accuracy and efficiency of task allocation.

[0078] See also Figure 1 As shown, the embodiment of the present application discloses a task scheduling method, including:

[0079] S101: Determine a plurality of tasks to be processed and a plurality of idle resources available on a current service system.

[0080] In this embodiment, the multiple tasks to be processed can be any tasks, such as: an image recognition task, a training task of a machine learning model, etc.

[0081] The current service system can be a cloud computing platform, a distributed system, a sensor cluster, etc.

[0082] If the current service system is a cloud computing platform, the various resources are the numerous hardware modules included in the hardware platform of the cloud computing platform, such as: CPU module, GPU module, etc., then the idle resources described in this embodiment are: hardware modules in the hardware platform that are temporarily not executing any tasks.

[0083] If the current service system is a distributed system, then each resource is each node of the distributed system. The idle resources described in this embodiment are: device nodes that can execute tasks in the distributed system.

[0084] S102: Cluster multiple tasks based on the task attributes of each task to obtain multiple task classes.

[0085] S103: Cluster multiple idle resources based on the resource attributes of each idle resource to obtain multiple resource classes.

[0086] In this embodiment, S102 and S103 can be executed simultaneously or separately in any order. In addition, the methods of clustering multiple tasks and clustering multiple idle resources can be the same or different. Generally, task attributes can be: task type, execution time, etc. Task types can be divided according to the type of data that the task needs to process (such as text, image, etc.), or according to the amount of data that the task needs to process. Resource attributes can be: processor type and model (such as CPU / GPU), bandwidth limit size, memory limit size, etc.

[0087] In one specific embodiment, a K-means algorithm is used to cluster multiple tasks and / or multiple idle resources. The K-means algorithm is relatively simple, and clustering based on it can reduce scheduling overhead and improve scheduling and allocation efficiency. Of course, clustering based on similarity or distance can also be used.

[0088] S104 : For each task, predict the performance obtained by executing the task on each idle resource, and calculate the optimal performance obtained by executing any task class on any resource class based on the performance.

[0089] When predicting the performance of any task executed on each idle resource, we can comprehensively consider factors such as bandwidth utilization, overhead, energy consumption, and execution time when the task is executed by a certain idle resource, thereby improving the accuracy and rationality of the prediction.

[0090] Based on this, multiple performance values ​​can be calculated for each task, and these performance values ​​correspond to various idle resources. In other words, the number of idle resources corresponds to the number of performance values ​​for each task.

[0091] After estimating the performance of each task on each idle resource, we calculate the optimal performance achieved by executing it on each resource class for each task class. Considering that a task class can contain multiple tasks, and a resource class can contain multiple idle resources, when a task class corresponds to a resource class, there can be multiple possible relationships between each task and each idle resource. In this case, we select the relationships between each task and each idle resource under the condition that "the performance achieved by executing this task class on this resource class is optimal" and the corresponding relationships between each task and each idle resource under this condition are selected.

[0092] Based on this, multiple optimal efficiencies can be calculated for each task class, and these optimal efficiencies correspond to different resource classes. In other words, each task class has as many optimal efficiencies as there are resource classes.

[0093] In a specific embodiment, the optimal performance obtained by executing any task class on any resource class is calculated based on the performance size, including: matching any task class with any resource class, and calculating the maximum performance sum obtained by executing each task in the task class by each idle resource in the resource class, and determining the maximum performance sum as the optimal performance obtained by executing the task class on the resource class.

[0094] S105. Compare the number of task classes and the number of resource classes. If the number of task classes is equal to the number of resource classes, multiple task classes are used as schedulable task classes, and multiple resource classes are used as schedulable resource classes. Based on the optimal efficiency, a one-to-one mapping relationship between the schedulable task classes and the schedulable resource classes is constructed to obtain a scheduling result with the maximum total efficiency.

[0095] In this embodiment, when the number of task classes equals the number of resource classes, each task class can be directly mapped one-to-one with each resource class. However, how is this one-to-one mapping relationship determined? This embodiment uses the condition of "maximizing the sum of total efficiency after one-to-one mapping" as the final allocation and scheduling result.

[0096] To maximize the total efficiency after one-to-one mapping, we must ensure that the one-to-one mapping relationship determined each time is the most efficient among all available mapping relationships. Based on this, we can use the task class and resource class as matching objects and use the KM algorithm to solve for the maximum weighted matching, thereby obtaining an allocation and scheduling result that maximizes the total efficiency. Of course, we can also use the flower tree algorithm to obtain an allocation and scheduling result that maximizes the total efficiency.

[0097] In a specific implementation, a one-to-one mapping relationship between schedulable task classes and schedulable resource classes is constructed based on optimal efficiency to obtain a scheduling result with the maximum sum of total efficiency, including: using a flowering tree algorithm to construct a one-to-one mapping relationship between schedulable task classes and schedulable resource classes based on optimal efficiency to obtain a scheduling result.

[0098] It can be seen that this embodiment fully considers the task characteristics and resource features, and can allocate a task to the most suitable idle resources based on its task characteristics, while ensuring the optimal performance. By processing each task in this way, the maximum total performance sum can be obtained, which not only realizes the reasonable allocation of computing resources, improves the accuracy and efficiency of task allocation, but also ensures the optimal performance when the task is actually executed, which is beneficial to the smooth operation of the current service system.

[0099] Based on the above embodiments, it should be noted that, in a specific implementation manner, for each task, the performance size obtained by executing the task on each idle resource is predicted, including: for each task, forming a target group with the task and each idle resource respectively, to obtain a plurality of target groups equal to the total number of idle resources; determining the bandwidth utilization score, overhead score, energy consumption score and execution time corresponding to each target group; based on the bandwidth utilization score, overhead score, energy consumption score and execution time, predicting the performance size obtained by executing the tasks in each target group on the idle resources in the target group.

[0100] The method includes determining a bandwidth utilization score, a cost score, an energy consumption score, and an execution time corresponding to each target group; and predicting the performance of tasks in each target group when executed on idle resources in the target group based on the bandwidth utilization score, the cost score, the energy consumption score, and the execution time, including:

[0101] For each target group, the performance of the tasks in the target group when executed on the idle resources in the target group is predicted according to the performance calculation formula; the performance calculation formula is:

[0102]

[0103] Where BI(i, j) is the performance obtained by executing task i on idle resource j; task i and idle resource j form a target group;

[0104] The bandwidth utilization score corresponding to the target group constructed for task i and idle resource j; Score(i, j) represents the priority score of task i; P(i, j) represents the bandwidth used by task i to execute on idle resource j. It represents the sum of the bandwidth used by task i when executing on m idle resources, where m is the total number of idle resources.

[0105] The cost score corresponding to the target group constructed for task i and idle resource j; Cost(i, j) represents the computational cost of executing task i on idle resource j. represents the sum of the computational overhead of executing task i on m idle resources;

[0106] The energy consumption score corresponding to the target group constructed for task i and idle resource j; EC(i, j) represents the energy consumption of task i executed on idle resource j. It represents the sum of energy consumption of task i when executing on m idle resources;

[0107] DT(i, j) is the execution time corresponding to the target group constructed by task i and idle resource j.

[0108] The calculation formula for the priority score of task i is:

[0109]

[0110] Among them, Score(i, j) represents the priority score of task i, priority(i) is the priority weight value of task i, and DT(i, j) is the execution time corresponding to the target group constructed by task i and idle resource j; among them, the priority weight value is determined based on the urgency and importance of task i.

[0111] The urgency and importance of a task can be set manually by the user.

[0112] Based on the above embodiment, it should be noted that constructing a one-to-one mapping relationship between schedulable task classes and schedulable resource classes based on optimal efficiency to obtain a scheduling result with the maximum sum of total efficiency includes: randomly selecting a task class from all currently schedulable task classes as a scheduling target; determining the optimal efficiencies obtained by executing the scheduling target on each currently schedulable resource class; selecting the resource class corresponding to the maximum value from each optimal efficiency as a standby resource, and constructing a mapping relationship between the scheduling target and the standby resource; deleting the scheduling target from all currently schedulable task classes, deleting the standby resource from all currently schedulable resource classes, and executing the steps of randomly selecting a task class from all currently schedulable task classes as a scheduling target; determining the optimal efficiencies obtained by executing the scheduling target on each currently schedulable resource class; selecting the resource class corresponding to the maximum value from each optimal efficiency as a standby resource, and constructing a mapping relationship between the scheduling target and the standby resource, until a one-to-one mapping relationship is constructed between each schedulable task class and each schedulable resource class.

[0113] It should be noted that the above process can refer to the process of solving the maximum weight matching by the KM algorithm.

[0114] Based on the above embodiment, it should be noted that if the number of task classes is greater than the number of resource classes, task classes equal to the number of resource classes are selected from multiple task classes as schedulable task classes, multiple resource classes are used as schedulable resource classes, and a one-to-one mapping relationship between schedulable task classes and schedulable resource classes is constructed based on optimal efficiency to obtain a scheduling result with the maximum sum of total efficiency; if the number of task classes is less than the number of resource classes, resource classes equal to the number of task classes are selected from multiple resource classes as schedulable resource classes, multiple task classes are used as schedulable task classes, and a one-to-one mapping relationship between schedulable task classes and schedulable resource classes is constructed based on optimal efficiency to obtain a scheduling result with the maximum sum of total efficiency.

[0115] Among them, task classes equal to the number of resource classes are randomly selected from multiple task classes as schedulable task classes, and / or resource classes equal to the number of task classes are randomly selected from multiple resource classes as schedulable resource classes.

[0116] Among them, based on each optimal efficiency, task classes equal to the number of resource classes and capable of maximizing the sum of total efficiency are selected from multiple task classes as schedulable task classes, and / or resource classes equal to the number of task classes and capable of maximizing the sum of total efficiency are selected from multiple resource classes as schedulable resource classes based on each optimal efficiency.

[0117] As can be seen, when the number of task classes and resource classes is not equal, scheduling and allocation can still be performed based on the condition of "maximizing the sum of total efficiencies after one-to-one mapping." However, if the number of task classes is greater than the number of resource classes, there will still be remaining task classes to be processed after such allocation. In this case, scheduling and allocation will be performed based on the condition of "maximizing the sum of total efficiencies after one-to-one mapping." That is, a portion of the tasks will be executed first, and then when the resources have completed their tasks and are free again, the remaining task classes will be allocated to the currently free resources.

[0118] In a specific embodiment, the task execution process includes: pre-processing the to-be-processed data of multiple tasks respectively to obtain the standard data corresponding to each task; sending the tasks and corresponding standard data included in each task class to the corresponding resource class according to the scheduling results, so that each resource class runs the corresponding task.

[0119] If the number of task classes is greater than the number of resource classes, meaning there are remaining task classes to be processed, then in one specific implementation, the working status of each resource class is monitored in real time while each resource class is executing its corresponding task. If any idle resource classes are present, the number of task classes and the number of resource classes are compared for the remaining task classes to be processed and the idle resource classes within the multiple task classes, thereby allocating the remaining task classes to the idle resource classes. When allocating the remaining task classes to the idle resource classes, the condition of "maximizing the sum of the total efficiencies after one-to-one mapping" is still adhered to. For the specific process, please refer to the relevant description of the above embodiment.

[0120] A task scheduling device provided in an embodiment of the present application is introduced below. The task scheduling device described below and the task scheduling method described above can be referenced to each other.

[0121] See also Figure 2 As shown, the embodiment of the present application discloses a task scheduling device, including:

[0122] Determine resources 201, for determining a plurality of tasks to be processed and a plurality of idle resources available on the current service system;

[0123] A first clustering resource 202 is used to cluster multiple tasks based on the task attributes of each task to obtain multiple task classes;

[0124] The second clustering resource 203 is used to cluster multiple idle resources based on the resource attributes of each idle resource to obtain multiple resource classes;

[0125] The performance prediction resource 204 is used to predict the performance of each task when it is executed on each idle resource, and calculate the optimal performance of any task class when it is executed on any resource class based on the performance;

[0126] Compare resources 205, used to compare the number of task classes with the number of resource classes;

[0127] Scheduling resources 206 is used to, if the number of task classes is equal to the number of resource classes, use multiple task classes as schedulable task classes, use multiple resource classes as schedulable resource classes, and construct a one-to-one mapping relationship between schedulable task classes and schedulable resource classes based on optimal efficiency to obtain a scheduling result with the maximum sum of total efficiency.

[0128] In a specific embodiment, the performance prediction resources include:

[0129] a grouping unit for grouping each task and each idle resource into a target group, thereby obtaining a number of target groups equal to the total number of idle resources;

[0130] The determination and prediction unit is used to determine the bandwidth utilization score, overhead score, energy consumption score and execution time corresponding to each target group; based on the bandwidth utilization score, overhead score, energy consumption score and execution time, predict the performance of the tasks in each target group when executed on the idle resources in the target group.

[0131] In a specific implementation, the determination and prediction unit is specifically configured to:

[0132] For each target group, the performance of the tasks in the target group when executed on the idle resources in the target group is predicted according to the performance calculation formula; the performance calculation formula is:

[0133]

[0134] Where BI(i, j) is the performance obtained by executing task i on idle resource j; task i and idle resource j form a target group;

[0135] The bandwidth utilization score corresponding to the target group constructed for task i and idle resource j; Score(i, j) represents the priority score of task i; P(i, j) represents the bandwidth used by task i to execute on idle resource j. It represents the sum of the bandwidth used by task i when executing on m idle resources, where m is the total number of idle resources.

[0136] The cost score corresponding to the target group constructed for task i and idle resource j; Cost(i, j) represents the computational cost of executing task i on idle resource j. represents the sum of the computational overhead of executing task i on m idle resources;

[0137] The energy consumption score corresponding to the target group constructed for task i and idle resource j; EC′(i, j) represents the energy consumption of task i executed on idle resource j. It represents the sum of energy consumption of task i when executing on m idle resources;

[0138] DT(i,j) is the execution time corresponding to the target group constructed by task i and idle resource j.

[0139] In a specific implementation, the calculation formula for the priority score of task i is:

[0140]

[0141] Among them, Score(i,j) represents the priority score of task i, priority(i) is the priority weight value of task i, and DT(i,j) is the execution time corresponding to the target group constructed by task i and idle resource j; among them, the priority weight value is determined based on the urgency and importance of task i.

[0142] In a specific embodiment, the performance prediction resource is specifically used to:

[0143] Match any task class with any resource class, and calculate the maximum performance sum obtained by executing each task in the task class with each idle resource in the resource class, and determine the maximum performance sum as the optimal performance obtained by executing the task class on the resource class.

[0144] In a specific implementation, scheduling resources includes:

[0145] The selection unit is used to randomly select a task class from all currently schedulable task classes as the scheduling target;

[0146] A determination unit, configured to determine the optimal performance obtained by executing the scheduling target on each currently schedulable resource class;

[0147] A mapping unit is used to select the resource class corresponding to the maximum value from each optimal efficiency as the standby resource, and to establish a mapping relationship between the scheduling target and the standby resource;

[0148] Delete the scheduling target from all currently schedulable task classes, delete the standby resources from all currently schedulable resource classes, and execute the steps in the selection unit, determination unit, and mapping unit until a one-to-one mapping relationship is established between each schedulable task class and each schedulable resource class.

[0149] In a specific implementation, the scheduling resources are specifically used to:

[0150] The flowering tree algorithm is used to construct a one-to-one mapping relationship between schedulable task classes and schedulable resource classes based on optimal efficiency to obtain the scheduling result.

[0151] In a specific implementation, a K-means algorithm is used to cluster multiple tasks and / or multiple idle resources.

[0152] In a specific embodiment, it also includes:

[0153] The first selective resource scheduling step is configured to, if the number of task classes is greater than the number of resource classes, select task classes from multiple task classes that are equal to the number of resource classes as schedulable task classes, use multiple resource classes as schedulable resource classes, and perform a one-to-one mapping relationship between schedulable task classes and schedulable resource classes based on optimal efficiency to obtain a scheduling result with the maximum total efficiency;

[0154] The second selective scheduling resource is used to select resource classes equal to the number of task classes from multiple resource classes as schedulable resource classes if the number of task classes is less than the number of resource classes, use multiple task classes as schedulable task classes, and execute a one-to-one mapping relationship between schedulable task classes and schedulable resource classes based on optimal efficiency to obtain a scheduling result with the maximum sum of total efficiency.

[0155] In a specific embodiment, task classes equal to the number of resource classes are randomly selected from multiple task classes as schedulable task classes, and / or resource classes equal to the number of task classes are randomly selected from multiple resource classes as schedulable resource classes.

[0156] In a specific embodiment, based on each optimal performance, task classes equal to the number of resource classes and capable of maximizing the sum of total performance are selected from multiple task classes as schedulable task classes, and / or resource classes equal to the number of task classes and capable of maximizing the sum of total performance are selected from multiple resource classes as schedulable resource classes based on each optimal performance.

[0157] In a specific embodiment, it also includes:

[0158] Task execution resources are used to pre-process the pending data of multiple tasks separately to obtain the standard data corresponding to each task; according to the scheduling results, the tasks and corresponding standard data included in each task class are sent to the corresponding resource class to enable each resource class to run the corresponding task.

[0159] In a specific embodiment, it also includes:

[0160] Monitoring resources: If the number of task classes is greater than the number of resource classes, the working status of each resource class will be monitored in real time while each resource class is running the corresponding task;

[0161] Rescheduling resources is used to, if an idle resource class appears, perform a step of comparing the number of task classes and the number of resource classes for the remaining task classes to be processed and the idle resource classes in the plurality of task classes, so as to allocate the remaining task classes to be processed to the idle resource class.

[0162] Among them, for more specific working processes of various resources and units in this embodiment, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, and no further details will be given here.

[0163] It can be seen that this embodiment provides a task scheduling device, which fully considers the task characteristics and resource characteristics, and can allocate a task to the most suitable idle resources based on the task characteristics of a task, and at the same time ensure the optimal performance. By processing each task in this way, the maximum total performance sum can be obtained, which not only realizes the reasonable allocation of computing resources, improves the accuracy and efficiency of task allocation, but also ensures the optimal performance when the task is actually executed, which is beneficial to the smooth operation of the current service system.

[0164] An electronic device provided in an embodiment of the present application is introduced below. The electronic device described below and the task scheduling method and device described above can be referenced to each other.

[0165] See also Figure 3 As shown, the embodiment of the present application discloses an electronic device, including:

[0166] Memory 301, used for storing computer programs;

[0167] The processor 302 is configured to execute the computer program to implement the method disclosed in any of the above embodiments.

[0168] The following introduces a readable storage medium provided in an embodiment of the present application. The readable storage medium described below and the task scheduling method, device, and equipment described above can be referenced to each other.

[0169] A readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the task scheduling method disclosed in the aforementioned embodiment. The specific steps of the method can be referred to the corresponding contents disclosed in the aforementioned embodiment and will not be repeated here.

[0170] Based on the above, this application focuses on the load balancing of tasks and computing resources and its related application scenarios. It combines task scheduling with load balancing and designs an efficient scheduling solution that can be used for various service systems and meet task load balancing scenarios, which can improve the performance of service systems. Specifically, this application clusters and discovers the deep intrinsic connections between all tasks proposed by different users, integrates computing resources, and establishes accurate and reliable mapping rules between tasks and computing resources, thereby improving system resource management performance and overcoming the problem of uneven load between tasks and computing resources.

[0171] Taking the cloud computing platform as an example, this application allows the cloud computing platform to maximize the use of computing resources while minimizing time and other costs, and provide services that meet user needs in a friendly manner. Generally, a scheduling system based on cloud computing mainly consists of a user module, a cloud task module, and a computing resource module.

[0172] See Figure 4 The user module is composed of network users and is responsible for submitting various tasks to the cloud computing platform. The collection of these tasks constitutes the cloud task module. The cloud task module assigns different tasks to the corresponding computing resource modules through a scheduling method. After the computing resource module completes the execution of all tasks, it feeds back the results to the user.

[0173] based on Figure 4 The scheduling system shown can also be applied to existing scheduling algorithms. However, most existing scheduling algorithms are highly accurate for certain specific application scenarios, but are not applicable to other scenarios, resulting in low universality. Furthermore, existing scheduling algorithms are generally complex and have low scalability.

[0174] To this end, the following embodiments combine the core inventive concept of this application to design and implement a task scheduling solution for cloud computing platforms, which can effectively improve the accuracy of task scheduling, significantly reduce the time overhead of the algorithm, and enhance the scalability of the algorithm.

[0175] First, the scheme considers the attributes of the tasks to be scheduled and the inherent characteristics of computing resources, introduces a clustering algorithm, and proposes a clustering-matching task scheduling model (CMM).

[0176] This model is based on the different attributes of various tasks and the characteristics of computing resources. First, it uses a clustering algorithm to divide tasks and computing resources into different categories, so that tasks or computing resources in the same category have certain similarities and there are large differences between different categories. Secondly, it considers the relevant factors of task scheduling (such as latency, energy consumption, cost, etc.) and designs a comprehensive performance index, which describes the final performance ratio of each task being scheduled to the corresponding computing resources. Finally, the model uses the performance index as a weight and adopts maximum weight matching to implement task scheduling, and assigns various tasks to the corresponding computing resources. It can be seen that this embodiment aims to assign various tasks to the corresponding computing resources through the CMM model to achieve the goal of maximizing performance. At the same time, it can effectively improve the accuracy of task allocation, reduce complexity problems, and enhance scalability.

[0177] See Figure 5 , the solution provided in this embodiment includes the following steps:

[0178] (1) Task and resource clustering step: Clustering operations are performed on various tasks and all computing resources submitted by users to the cloud computing platform to obtain similar task clusters (i.e., task classes) and computing resource clusters (i.e., module classes).

[0179] The task and resource clustering step performs clustering operations on given tasks and resources. Its purpose is to integrate similar tasks or resources to improve task execution and resource utilization.

[0180] (2) Benefit index design steps: Comprehensively consider factors such as latency, urgency, energy consumption, and cost (storage, communication, computing overhead, etc.) of various tasks to design the final performance index, which serves as the key basis for subsequent task scheduling.

[0181] The benefit indicator design step comprehensively considers factors such as delay (Delay, the total time it takes for a task to be assigned to a certain computing resource and then fed back to the user after execution), urgency (Urgency, the urgency of a task execution), energy consumption (Energy Consumption, energy consumption and heat dissipation power consumption, etc. consumed by a task execution), cost (Cost, network communication, storage, computing, etc. overhead when a task is executed), and resource utilization during task allocation, to design the final benefit indicator (Benefit), and use this benefit indicator as the key basis for subsequent task scheduling implementation.

[0182] (3) Task scheduling implementation steps: Based on the clustering results of tasks and resources and performance indicators, the maximum weight matching algorithm is used to implement task scheduling and give the final task scheduling results.

[0183] In the task scheduling implementation phase, based on the task and resource clustering results and the final energy efficiency ratio output from the performance indicator design step, a corresponding algorithm for solving the maximum weight matching of bipartite graphs is used to establish mapping rules between the tasks to be scheduled and different computing resources, and generate task scheduling results.

[0184] Specifically, in combination with the above three steps, the functions that need to be implemented include: task and computing resource input module, preprocessing module, clustering algorithm module, performance indicator design module, task and resource matching module, and result and feedback module. Figure 6 .

[0185] (1) Tasks to be scheduled and computing resource input module: Obtain n tasks to be scheduled (task module) and m computing resources (computing resource module) as input of the entire process.

[0186] The task module is a collection of all tasks submitted by users of the cloud computing platform. Assume that there are n tasks waiting to be scheduled. The computing resource module is a general term for various computing resources on the cloud platform. Assume that there are m computing modules (such as CPU or GPU).

[0187] (2) Preprocessing module: denoises and preprocesses the raw data involved in the task module and converts it into the standard input format of the algorithm.

[0188] The preprocessing module performs data cleaning and other preprocessing on raw data. It's important to note that the effectiveness of data cleaning and noise removal plays a crucial role in the accuracy and performance of scheduling results. Because raw input data can contain noise and other issues, such as data formatting, it requires data cleaning and preprocessing. This preprocessing converts the raw data into the standard input format required by the scheduling plan, facilitating subsequent work.

[0189] (3) Clustering algorithm module: Apply the preprocessed task module and resource module to the clustering algorithm and generate different task clusters and computing resource clusters.

[0190] The clustering algorithm module mainly uses the K-means algorithm to implement clustering operations. The advantages of the K-means algorithm are simple operation and low computational complexity. The K-means algorithm performs clustering operations on n tasks or m computing modules, which can include the following key steps:

[0191] A. Given the number of clusters K, an appropriate positive integer K is selected based on experience as the number of clusters generated by the clustering result. In this embodiment, K refers to the number of clusters of task clustering or the number of clusters of computing resources.

[0192] B. Randomly select K points as the central nodes of the initialized K clusters.

[0193] C. Calculate the distance between each scheduling task or each computing resource and K center points.

[0194] Taking task clustering as an example, assuming that each task has Q attributes, then D(i, j) represents the Euclidean distance between task i and task j, and the Euclidean distance can be expressed as:

[0195]

[0196] Assume that the distance set from the scheduled task 1 to the K centers is calculated by the above formula as D1 = {D(1, C1), D(1, C2), ..., D(1, C K )}, where C1, C2, ..., C K They represent K centers respectively.

[0197] D. Based on the above, obtain the distance set of each task or each resource, and classify the task or computing resource into the category corresponding to the minimum value in the distance set.

[0198] For example: min D1 = {D(1, C1), D(1, C2), ..., D(1, C K )}=D(1, C1) means: Task 1 should be classified into cluster 1.

[0199] E. Recalculate the center point C′1, C′2, …, C′ of each cluster based on the latest clustering results K .

[0200] F. Repeat AE until all cluster centers between two adjacent iterations remain basically unchanged.

[0201] (4) Performance indicator design module: Determine the efficiency ratio of each task assigned to different computing resources.

[0202] The performance indicator design module comprehensively considers the following key factors when allocating tasks:

[0203] A. Delay Time: The total time it takes for task i to be assigned to computing resource j for execution and then fed back to the user, denoted as DT(i, j).

[0204] B. Urgency: The urgency of executing task i, denoted as U(i).

[0205] Importance: This refers to the importance of a task, denoted as I(i). Based on urgency and importance, a task's priority weight can be determined. Based on this, the following scoring table can be designed, as shown in Table 1.

[0206] Table 1

[0207] Urgent Not Urgent Important 4 3 Not Important 2 1

[0208] As shown in Table 1, if a task is both urgent and important, its priority weight is 4. If a task is not urgent but important, its priority weight is 3. If a task is urgent but not important, its priority weight is 2. If a task is neither urgent nor important, its priority weight is 1. Therefore, the priority weight of a task can be manually set based on its urgency and importance.

[0209] C. Define the priority weight value of task i as: priority(i) = U(i)⊙I(i), ⊙ represents the relationship between U(i) and I(i) and the priority score of task i is:

[0210]

[0211] D. Energy Consumption: The energy and heat dissipation consumed by task i when executing on computing resource j, denoted as EC(I, j).

[0212] E. Cost: The network communication, storage, and computation overhead of task i executed on computing resource j, denoted as Cost(I, j).

[0213] F. Resource Utilization Rate: The resource utilization rate of task i executed on computing resource j, denoted as Where P(i, j) represents the bandwidth used by task i to execute on computing resource j; P(i, j) represents the sum of the bandwidth used by task i to execute on m computing resources, where m is the total number of computing resources.

[0214] G. Benefit Index: The benefit generated after task i is scheduled to computing resource j for execution, denoted as BI(i, j).

[0215]

[0216] In particular, if Then BI(i, j)=0.

[0217] Based on the calculation method of the above performance index, the final performance of each task to be scheduled and assigned to each computing resource can be calculated in advance. This index takes into account both the utilization rate and energy consumption of computing resources, thereby improving the overall availability of the system.

[0218] These performance figures will serve as the basis for subsequent task scheduling.

[0219] (5) Task and resource matching module: Based on the principle of maximizing efficiency, different tasks are reasonably allocated and scheduled to the corresponding computing resources to complete the scheduling tasks.

[0220] The main goal of the task and resource matching module is to establish a mapping relationship between tasks and resources.

[0221] See Figure 7 In this embodiment, a bipartite graph G = (V, E) is used to abstractly represent the task cluster, resource cluster and the mapping relationship between them. Where V = XUY, X = {X1, X2, ..., X K} represents the set of task clusters, Y = {Y1, Y2, ..., Y K} represents the set of resource clusters, K is the number of clusters. e(i, j)∈E represents the task cluster X i Assigned to resource cluster Y j Above, W e(i,j) Indicates allocating task cluster Xi to resource cluster Y j The total performance obtained above.

[0222] Among them, any task cluster X i Assigned to resource cluster Y j The total performance obtained above is: Where j is Y j Any computing resource in X i Any task in .

[0223] That is, the total effectiveness of a task cluster is equal to the sum of the effectiveness of all tasks in the cluster.

[0224] based on Figure 7 For the bipartite graph shown in the figure, this embodiment uses the classic KM algorithm (which has low computational complexity) in graph theory to solve for the maximum weight matching result. The maximum weight matching result indicates the scheduling status of the task cluster. In other words, the maximum weight matching result corresponds to the task scheduling result with the best performance.

[0225] (6) The feedback module will provide feedback on the final scheduling task results.

[0226] It can be seen that this embodiment takes into account the inherent attributes of various tasks and the characteristics of computing resources, and classifies and integrates similar tasks or computing resources, thereby reducing the search space and resource selection range during task scheduling and improving the accuracy of resource selection; in addition, it gives accurate results of task scheduling based on performance indicators and the KM algorithm, balances scheduling accuracy and scheduling time, reduces the overhead of task and resource matching, improves the efficiency, performance, and scalability of task scheduling, and reduces scheduling complexity.

[0227] Of course, the scheduling method provided in this embodiment can also be applied to multi-agent systems, distributed computing systems, wireless sensor networks, etc.

[0228] References to "first," "second," "third," "fourth," and the like (if any) herein are intended to distinguish similar objects and are not necessarily intended to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, or apparatus.

[0229] It should be noted that the descriptions of "first", "second", etc. in this application are for descriptive purposes only and should not be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0230] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0231] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of readable storage medium known in the art.

[0232] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A task scheduling method, characterized in that: include: Determine a plurality of tasks to be processed and a plurality of idle resources available on a current service system; clustering the plurality of tasks based on a task attribute of each task to obtain a plurality of task classes; Clustering the plurality of idle resources based on resource attributes of each idle resource to obtain a plurality of resource classes; the resource attributes are: processor type and model, bandwidth limit size or memory limit size; For each task, the performance achieved by executing the task on each idle resource is predicted, and based on the performance, the optimal performance achieved by any task class executing on any resource class is calculated; wherein, when predicting the performance achieved by any task executing on each idle resource, the bandwidth utilization, overhead, energy consumption, and execution time of the task when executed on a particular idle resource are considered; Compare the number of task classes with the number of resource classes; If the number of task classes is equal to the number of resource classes, the multiple task classes are used as schedulable task classes, the multiple resource classes are used as schedulable resource classes, and a one-to-one mapping relationship between the schedulable task classes and the schedulable resource classes is established based on the optimal efficiency to obtain a scheduling result with the maximum total efficiency; The step of constructing a one-to-one mapping relationship between the schedulable task class and the schedulable resource class based on the optimal efficiency to obtain a scheduling result with the maximum total efficiency includes: Randomly select a task class from all currently schedulable task classes as the scheduling target; Determining the optimal performance achieved by executing the scheduling target on each currently schedulable resource class; Selecting a resource class corresponding to a maximum value from the various optimal efficiencies as standby resources, and constructing a mapping relationship between the scheduling target and the standby resources; The steps of deleting the scheduling target from all currently schedulable task classes, deleting the standby resource from all currently schedulable resource classes, and randomly selecting a task class from all currently schedulable task classes as the scheduling target; determining the optimal efficiencies obtained by executing the scheduling target on each currently schedulable resource class; selecting the resource class corresponding to the maximum value from each optimal efficiencies as the standby resource, and establishing a mapping relationship between the scheduling target and the standby resource, until a one-to-one mapping relationship is established between each schedulable task class and each schedulable resource class; Among them, when the number of task classes is not equal to the number of resource classes, scheduling and allocation are first performed based on the condition that the sum of total efficiency after one-to-one mapping is maximized. Subsequently, when the resources are idle again, the remaining task classes to be processed are allocated to the currently idle resources.

2. The task scheduling method according to claim 1, characterized in that: The step of predicting the performance of each task when executing the task on each idle resource includes: For each task, group the task with each idle resource into a target group, and obtain multiple target groups equal to the total number of idle resources; Determine the bandwidth utilization score, overhead score, energy consumption score, and execution time corresponding to each target group; Based on the bandwidth utilization score, the overhead score, the energy consumption score, and the execution time, the performance obtained by executing the tasks in each target group on the idle resources in the target group is predicted.

3. The task scheduling method according to claim 2, characterized in that: The step of determining a bandwidth utilization score, an overhead score, an energy consumption score, and an execution time corresponding to each target group; and predicting, based on the bandwidth utilization score, the overhead score, the energy consumption score, and the execution time, the performance of tasks in each target group when executed on idle resources in the target group, includes: For each target group, the performance obtained by executing the tasks in the target group on the idle resources in the target group is predicted according to the performance calculation formula; the performance calculation formula is: ; Where BI(i,j) is the performance obtained by executing task i on idle resource j; task i and idle resource j form a target group; The bandwidth utilization score corresponding to the target group constructed for task i and idle resource j; Score(i,j) represents the priority score of task i; P(i,j) represents the bandwidth used by task i to execute on idle resource j. It represents the sum of the bandwidth used by task i when executing on m idle resources, where m is the total number of idle resources. The cost score corresponding to the target group constructed for task i and idle resource j; Cost(i,j) represents the computational cost of executing task i on idle resource j. represents the sum of the computational overhead of executing task i on m idle resources; The energy consumption score corresponding to the target group constructed for task i and idle resource j; EC(i,j) represents the energy consumption of task i executed on idle resource j. It represents the sum of energy consumption of task i when executing on m idle resources; DT(i,j) is the execution time corresponding to the target group constructed by task i and idle resource j.

4. The task scheduling method according to claim 3, characterized in that: The calculation formula for the priority score of task i is: ; Among them, Score(i,j) represents the priority score of task i, priority(i) is the priority weight value of task i, and DT(i,j) is the execution time corresponding to the target group constructed by task i and idle resource j; among them, the priority weight value is determined based on the urgency and importance of task i.

5. The task scheduling method according to claim 3, characterized in that: The calculating, based on the performance size, the optimal performance obtained by executing any task class on any resource class includes: Match any task class with any resource class, and calculate the maximum performance sum obtained by executing each task in the task class by each idle resource in the resource class, and determine the maximum performance sum as the optimal performance obtained by executing the task class on the resource class.

6. The task scheduling method according to claim 5, characterized in that: The step of constructing a one-to-one mapping relationship between the schedulable task class and the schedulable resource class based on the optimal efficiency to obtain a scheduling result with the maximum total efficiency includes: A one-to-one mapping relationship between the schedulable task class and the schedulable resource class is constructed based on the optimal efficiency using a flowering tree algorithm to obtain the scheduling result.

7. The task scheduling method according to claim 1, characterized in that: The multiple tasks and / or the multiple idle resources are clustered using a K-means algorithm.

8. The task scheduling method according to any one of claims 1 to 7, characterized in that: Also includes: If the number of task classes is greater than the number of resource classes, selecting task classes equal to the number of resource classes from the multiple task classes as schedulable task classes, using the multiple resource classes as schedulable resource classes, and executing the step of constructing a one-to-one mapping relationship between the schedulable task classes and the schedulable resource classes based on the optimal efficiency to obtain a scheduling result with the maximum total efficiency; If the number of task classes is less than the number of resource classes, resource classes equal to the number of task classes are selected from the multiple resource classes as schedulable resource classes, the multiple task classes are used as schedulable task classes, and the step of constructing a one-to-one mapping relationship between the schedulable task classes and the schedulable resource classes based on the optimal efficiency is executed to obtain a scheduling result with the maximum sum of total efficiency.

9. The task scheduling method according to claim 8, characterized in that: Task classes equal in number to the resource classes are randomly selected from the multiple task classes as schedulable task classes, and / or resource classes equal in number to the task classes are randomly selected from the multiple resource classes as schedulable resource classes.

10. The task scheduling method according to claim 8, characterized in that: Based on each optimal performance, task classes equal to the number of resource classes and capable of maximizing the sum of total performance are selected from the multiple task classes as schedulable task classes, and / or resource classes equal to the number of task classes and capable of maximizing the sum of total performance are selected from the multiple resource classes as schedulable resource classes based on each optimal performance.

11. The task scheduling method according to claim 8, characterized in that: Also includes: Preprocessing the to-be-processed data of the plurality of tasks respectively to obtain standard data corresponding to each task; According to the scheduling result, the tasks and corresponding standard data included in each task class are sent to the corresponding resource class, so that each resource class runs the corresponding task.

12. The task scheduling method according to claim 11, characterized in that: If the number of task classes is greater than the number of resource classes, the working status of each resource class is monitored in real time while each resource class is running the corresponding task; If there is an idle resource class, the step of comparing the number of task classes and the number of resource classes is performed for the remaining task classes to be processed in the multiple task classes and the idle resource class to allocate the remaining task classes to the idle resource class.

13. A task scheduling device, characterized in that: include: Determining resources, for determining a plurality of tasks to be processed and a plurality of idle resources available on a current service system; A first clustering resource is used to cluster the plurality of tasks based on a task attribute of each task to obtain a plurality of task classes; A second clustering resource is used to cluster the plurality of idle resources based on resource attributes of each idle resource to obtain a plurality of resource classes; the resource attributes are: processor type and model, bandwidth limit size or memory limit size; Performance prediction resources are used to predict, for each task, the performance achieved by executing the task on each idle resource, and calculate, based on the performance, the optimal performance achieved by any task class executing on any resource class. When predicting the performance achieved by any task executing on each idle resource, the bandwidth utilization, overhead, energy consumption, and execution time of the task when executed on a particular idle resource are considered. Compare resources, used to compare the number of task classes with the number of resource classes; Scheduling resources, for, if the number of task classes is equal to the number of resource classes, using the multiple task classes as schedulable task classes and the multiple resource classes as schedulable resource classes, and establishing a one-to-one mapping relationship between the schedulable task classes and the schedulable resource classes based on the optimal efficiency, to obtain a scheduling result with the maximum total efficiency; The step of constructing a one-to-one mapping relationship between the schedulable task class and the schedulable resource class based on the optimal efficiency to obtain a scheduling result with the maximum total efficiency includes: Randomly select a task class from all currently schedulable task classes as the scheduling target; Determining the optimal performance achieved by executing the scheduling target on each currently schedulable resource class; Selecting a resource class corresponding to a maximum value from the various optimal efficiencies as standby resources, and constructing a mapping relationship between the scheduling target and the standby resources; The steps of deleting the scheduling target from all currently schedulable task classes, deleting the standby resource from all currently schedulable resource classes, and randomly selecting a task class from all currently schedulable task classes as the scheduling target; determining the optimal efficiencies obtained by executing the scheduling target on each currently schedulable resource class; selecting the resource class corresponding to the maximum value from each optimal efficiencies as the standby resource, and establishing a mapping relationship between the scheduling target and the standby resource, until a one-to-one mapping relationship is established between each schedulable task class and each schedulable resource class; Among them, when the number of task classes is not equal to the number of resource classes, scheduling and allocation are first performed based on the condition that the sum of total efficiency after one-to-one mapping is maximized. Subsequently, when the resources are idle again, the remaining task classes to be processed are allocated to the currently idle resources.

14. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the task scheduling method according to any one of claims 1 to 12.

15. A readable storage medium, characterized in that Used to store a computer program, wherein when the computer program is executed by a processor, the task scheduling method according to any one of claims 1 to 12 is implemented.

Citation Information

Patent Citations

  • Heterogeneous resource distributed computing platform batch task scheduling method and storage medium

    CN112181613A

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

    CN112948113A