A cost-aware resource scheduling method and system

By establishing a resource scheduling model and task sorting algorithm, the problem of low resource utilization efficiency was solved, achieving efficient task allocation and server scaling, reducing costs and improving task execution efficiency.

CN119987970BActive Publication Date: 2025-10-28SUN YAT SEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510103288.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-10-28
Estimated Expiration
2045-01-22

AI Technical Summary

Technical Problem

Existing technologies suffer from low resource utilization and task execution efficiency, making it difficult to efficiently schedule tasks in dynamically changing computing resource environments, leading to improper allocation and waste of computing resources.

Method used

A resource scheduling model is established, and the final resource scheduling scheme is obtained by optimizing the problem transformation and task sorting algorithms, so as to achieve efficient task allocation and elastic scaling of the server.

Benefits of technology

It improves resource utilization, reduces the rental cost of the task platform, solves the NP-hard problem in polynomial time, ensures an upper bound on the distance between the approximate solution and the optimal solution, and improves task execution efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987970B_ABST
    Figure CN119987970B_ABST
Patent Text Reader

Abstract

The present invention discloses a cost-aware resource scheduling method and system. The method specifically includes the following steps: establishing a resource scheduling model and obtaining a first optimization problem based on the resource scheduling model; transforming the first optimization problem into a second optimization problem; obtaining a server set, a task set, and a matrix of estimated completion times for all tasks for all servers; and using a task sorting algorithm to sort the tasks in the task set to obtain a task sequence; solving the second optimization problem based on the task sequence S and the matrix E of estimated completion times for all tasks in the server set and task set for all servers to obtain a final resource scheduling solution. This method achieves high resource utilization efficiency and task execution efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of resource scheduling, and more specifically, to a cost-aware resource scheduling method and system. Background Technology

[0002] With the rapid development of artificial intelligence, AI tasks pose a significant computational challenge to traditional computing resources. To improve computing efficiency and reduce the cost of holding computing resources, numerous task platforms have emerged to provide services to users. These platforms purchase substantial computing resources and offer paid computing services. However, task loads are highly complex; insufficient computing resources can cause delays, while excessive resources lead to waste when idle. Therefore, task platforms typically rent computing resources from third-party service providers, dynamically scaling the rental scale as needed. Besides dynamically controlling the rental scale, tasks within the task platform also need to be rationally allocated to appropriate computing resources. This improves resource utilization, reduces average task completion time, and lowers maximum completion time within a fixed resource scale, while also providing better support for the rational scaling of computing resources.

[0003] Because third-party service providers offer a wide variety of computing resources with varying performance and prices, it is difficult to determine the optimal scheduling decision. Different tasks have different characteristics and different execution time sensitivities, making it difficult to meet the diverse needs of multiple tasks in terms of execution time, resulting in low task execution efficiency. Due to the complexity of the scheduling problem, existing solutions mainly focus on heuristic and reinforcement learning schemes, which are time-consuming and cannot adapt well to the dynamic arrival of tasks, resulting in low resource utilization efficiency.

[0004] Existing technologies disclose a multi-rate data distribution method in wireless networks based on network coding. This method employs a dual coding graph approach, comprehensively considering inter-link correlation, packet lifetime, and expected transmission time to construct the coding graph, enabling the algorithm to be applied in correlated network environments. A greedy algorithm is used to reduce the solution problem from NP-hard to linear. Before each round of distribution, vertices that are certain to time out and those with low latency sensitivity are removed, allowing vertices that meet latency requirements but have high latency sensitivity a higher chance of transmission. Furthermore, mathematical methods are applied to describe the construction of the dual coding graph, and the complexity of the optimal algorithm is found to be an NP-hard problem. Therefore, a link-dependent awareness multi-rate dual coding algorithm (LMPC) is proposed, which determines the coding strategy and transmission rate by balancing transmission delay and packet lifetime. However, this method does not dynamically adjust the allocation strategy according to the constantly changing resource state; it only allocates resources to a specific number of resources, resulting in low resource utilization efficiency. Summary of the Invention

[0005] This invention addresses the shortcomings of existing technologies, namely low resource utilization efficiency and low task execution efficiency, by providing a cost-aware resource scheduling method and system that achieves high resource utilization efficiency and high task execution efficiency.

[0006] The primary objective of this invention is to solve the aforementioned technical problems. The technical solution of this invention is as follows:

[0007] A cost-aware resource scheduling method, comprising:

[0008] S1: Establish a resource scheduling model and derive the first optimization problem based on the resource scheduling model;

[0009] S2: Based on the first optimization problem, transform it into a second optimization problem;

[0010] S3: Get server set Task Collection For all tasks against the estimated completion time matrix E of all servers, the task set is sorted using a task ranking algorithm. The tasks in the sequence are sorted to obtain the task sequence S;

[0011] S4: Based on the task sequence S and the server set Task Collection For all tasks, based on the estimated completion time matrix E of all servers, solve the second optimization problem to obtain the final resource scheduling scheme.

[0012] Furthermore, the first optimization problem is as follows:

[0013]

[0014] X represents the allocation scheme matrix, X i,j =1 indicates that task j is executed on server i. Represents a set of servers. Let j represent the task set, i represent the task number, and P represent the server number. i e represents the cost of renting the i-th server per unit time. i,j This indicates the execution time of task j on server i, m j M represents the resource requirement of the j-th task. i w represents the total resources of the i-th server. j G represents the waiting time for the j-th task. i,j d represents the time required for task j to be scheduled to server i. j This represents the time constraint for the j-th task.

[0015] Furthermore, the second optimization problem is as follows:

[0016]

[0017]

[0018] λ represents the importance parameter of total server cost, I j Let X represent the intermediate computational cost of task j, and let X represent the allocation scheme matrix. i,j =1 indicates that task j is executed on server i. Represents a set of tasks. Let P represent the set of servers, j represent the task number, i represent the server number, and P represent the server set. i e represents the cost of renting the i-th server per unit time. i,j This indicates the execution time of task j on server i, m j M represents the resource requirement of the j-th task. i w represents the total resources of the i-th server. j G represents the waiting time for the j-th task. i,j d represents the time required for task j to be scheduled to server i. j This represents the time constraint for the j-th task.

[0019] Furthermore, the task sorting algorithm includes:

[0020] S301: In the task set Select one task from the list as the first task;

[0021] S302: Calculate the first task and server set The score of each server is used as the lowest score for the first task.

[0022] S303: Put the first score of the first task, the corresponding server, and the first task into the first set;

[0023] S304: In the task set Select another task from the set as the new first task, and repeat steps S302 to S303 until the set of tasks is complete. All tasks were selected.

[0024] S305: Sort the first task in ascending order according to the first score of the first task to obtain the task sequence S.

[0025] Further, in step S4, solving the second optimization problem includes:

[0026] S401: In the task set Select one task from the list as the second task;

[0027] S402: Extract the server corresponding to the second task from the task sequence S and use it as the first server;

[0028] S403: Determine whether the first server has been rented; if the first server has been rented, proceed to step S404; if the first server has not been rented, proceed to step S405.

[0029] S404: Determine the remaining resource conditions and time constraints of the first server and the second task; if both conditions are met, assign the second task to the first server; proceed to step S407.

[0030] S405: Determine the time constraints between the first server and the second task; if the time constraints are met, rent the first server and assign the second task to the first server; proceed to step S407.

[0031] S406: Execute server-unassigned algorithm;

[0032] S407: Select Task Set Another task in the process is treated as a new second task. Repeat steps S402 to S406 until the task set is complete. All tasks are selected, resulting in the final resource scheduling scheme.

[0033] Furthermore, the server does not assign an algorithm, including:

[0034] S40601: In the server set The rented servers that meet the resource availability and time constraints of the second task are selected to form the second set;

[0035] S40602: Calculate the score of the second task and each server in the second set, and select the server with the highest score as the second server;

[0036] S40603: Assign the second task to the second server.

[0037] Furthermore, the time constraint includes:

[0038] g i,j +e i,j +w j ≤d j

[0039] w j G represents the waiting time for the j-th task. i,j E represents the time required for task j to be scheduled to server i. i,j This indicates the execution time of task j on server i, dj This represents the time constraint for the j-th task.

[0040] Furthermore, the remaining resource conditions include:

[0041] m j ≤M i

[0042] m j M represents the resource requirement of the j-th task. i This represents the total resources of the i-th server.

[0043] Furthermore, in step S302 or step S40602, the formula for calculating the fraction is as follows:

[0044]

[0045] P i This represents the cost of renting the i-th server per unit time. C represents the estimated completion time of the j-th task on the i-th server. i,j This represents the total cost of processing the j-th task on the i-th server;

[0046]

[0047] C i,j Let m represent the total cost of processing the j-th task on the i-th server. j S represents the resource requirement of the j-th task. i,j This represents the score of the j-th task processed on the i-th server.

[0048] A cost-aware resource scheduling system, comprising:

[0049] First optimization problem module: Establish a resource scheduling model and derive the first optimization problem based on the resource scheduling model;

[0050] Second optimization problem module: Based on the first optimization problem, transform and establish the second optimization problem;

[0051] Sorting module: Retrieves the server set Task Collection For all tasks against the estimated completion time matrix E of all servers, the task set is sorted using a task ranking algorithm. The tasks in the sequence are sorted to obtain the task sequence S;

[0052] Solving module: Based on the task sequence S and the server set Task Collection For all tasks, based on the estimated completion time matrix E of all servers, solve the second optimization problem to obtain the final resource scheduling scheme.

[0053] Compared with the prior art, the present invention has the following beneficial effects:

[0054] This invention uses a sorting algorithm to prioritize tasks, allowing high-return tasks to be scheduled as quickly as possible. By transforming the task into a second optimization problem, the problem is simplified, converting the hard constraint of task time into a soft constraint. Solving this second optimization problem allows for the solution of an NP-hard problem in polynomial time, and the distance between the approximate algorithm's solution and the optimal solution has an upper bound, ensuring that the algorithm obtains a valuable solution even under worst-case input conditions. Attached Figure Description

[0055] Figure 1 A flowchart of a cost-aware resource scheduling method provided in Example 1.

[0056] Figure 2 A flowchart of the task sorting algorithm provided in Example 1.

[0057] Figure 3 A flowchart of the task sorting algorithm provided in Example 1.

[0058] Figure 4 The flowchart is for the server-unassigned algorithm provided in Example 1.

[0059] Figure 5 A bar chart showing the rental cost in a real cluster task online submission scenario provided in Example 1.

[0060] Figure 6 A bar chart showing the rental cost of the task in the scenario where the task is uniformly submitted at the beginning of the scheduling cycle, as provided in Example 1.

[0061] Figure 7 A bar chart showing the rental cost in a task submission scenario with a deadline requirement, as provided in Example 1.

[0062] Figure 8 This is a bar chart showing the average task completion time in the real cluster task online submission scenario provided in Example 1.

[0063] Figure 9 A bar chart showing the average task completion time in the scenario where tasks are uniformly submitted at the beginning of the scheduling cycle, as provided in Example 1.

[0064] Figure 10 This is a bar chart showing the average task completion time in the task submission scenario with a deadline requirement provided in Example 1.

[0065] Figure 11 This is a bar chart showing the maximum span of task completion in the real cluster task online submission scenario provided in Example 1.

[0066] Figure 12 A bar chart showing the maximum span of task completion in the scenario where tasks are uniformly submitted at the beginning of the scheduling cycle, as provided in Example 1.

[0067] Figure 13 This is a bar chart showing the maximum span of task completion in the task submission scenario with a deadline requirement provided in Example 1.

[0068] Figure 14 Line graph of cluster deadline miss rate provided in Example 1.

[0069] Figure 15 This is a structural diagram of the AI ​​model training task platform provided in Example 2.

[0070] Figure 16 This is a structural diagram of the resource crowdsourcing platform provided in Example 3. Detailed Implementation

[0071] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this patent.

[0072] To better illustrate this embodiment, some parts in the accompanying drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions;

[0073] It will be understood by those skilled in the art that certain well-known structures and their descriptions may be omitted in the accompanying drawings.

[0074] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0075] Example 1

[0076] like Figure 1 As shown, a cost-aware resource scheduling method includes:

[0077] S1: Establish a resource scheduling model and derive the first optimization problem based on the resource scheduling model;

[0078] S2: Based on the first optimization problem, transform it into a second optimization problem;

[0079] S3: Get server set Task Collection For all tasks against the estimated completion time matrix E of all servers, the task set is sorted using a task ranking algorithm. The tasks in the sequence are sorted to obtain the task sequence S;

[0080] S4: Based on the task sequence S and the server set Task Collection For all tasks, based on the estimated completion time matrix E of all servers, solve the second optimization problem to obtain the final resource scheduling scheme.

[0081] It should be noted that the resource scheduling method mentioned in this invention will be referred to as the CRS algorithm below.

[0082] Furthermore, the first optimization problem is as follows:

[0083]

[0084] X represents the allocation scheme matrix, X i,j =1 indicates that task j is executed on server i. Represents a set of servers. Let j represent the task set, i represent the task number, and P represent the server number. i e represents the cost of renting the i-th server per unit time. i,j This indicates the execution time of task j on server i, m j M represents the resource requirement of the j-th task. i w represents the total resources of the i-th server. j G represents the waiting time for the j-th task. i,j d represents the time required for task j to be scheduled to server i. j This represents the time constraint for the j-th task.

[0085] The total cost of renting server i for the platform is: C i (t)=P i (t)·T i ,in t represents time.

[0086] Constraint (1b) requires that each task can only be assigned to one server, constraint (1c) ensures that each task can be assigned according to the remaining resources, constraint (1d) ensures that the task can be completed before the time constraint, and constraint (1e) ensures that this problem is an integer linear programming problem.

[0087] Directly solving the first optimization problem is difficult because: First, the total rented resources of the task platform are limited. First, the constraints (1d) make it difficult to meet the time constraints of each task. Second, when the task platform serves a large number of tasks and rents servers, the solution complexity of integer linear programming problems is very expensive because integer linear programming is a well-known NP-hard problem. Third, the problem... The constraint (1d) requires the execution time of task j on server i, which cannot be accurately known in advance.

[0088] Furthermore, the second optimization problem is as follows:

[0089]

[0090] λ represents the importance parameter of total server cost, I j Let X represent the intermediate computational cost of task j, and let X represent the allocation scheme matrix. i,j =1 indicates that task j is executed on server i. Represents a set of tasks. Let P represent the set of servers, j represent the task number, i represent the server number, and P represent the server set. i e represents the cost of renting the i-th server per unit time. i,j This indicates the execution time of task j on server i, m j M represents the resource requirement of the j-th task. i w represents the total resources of the i-th server. j G represents the waiting time for the j-th task. i,j d represents the time required for task j to be scheduled to server i. j This represents the time constraint for the j-th task.

[0091] It should be noted that the following algorithms are all designed to process tasks at a specific moment in time. Tasks within a given time period can be processed simply by continuously executing them in a loop.

[0092] It should be noted that in this invention, the ← symbol represents the meaning of assignment, equivalent to the = symbol.

[0093] Furthermore, such as Figure 2 As shown, the task sorting algorithm includes:

[0094] S301: In the task set Select one task from the list as the first task;

[0095] S302: Calculate the first task and server set The score of each server is used as the lowest score for the first task.

[0096] S303: Put the first score of the first task, the corresponding server, and the first task into the first set;

[0097] S304: In the task set Select another task from the set as the new first task, and repeat steps S302 to S303 until the set of tasks is complete. All tasks were selected.

[0098] S305: Sort the first task in ascending order according to the first score of the first task to obtain the task sequence S.

[0099] The pseudocode for the task sorting algorithm is as follows:

[0100] enter:

[0101] The estimated task completion time matrix E for all tasks currently awaiting scheduling across all servers.

[0102] The set of all tasks waiting to be scheduled

[0103] The collection of all leased servers

[0104] Output:

[0105] The sequence S after rearranging all tasks waiting to be scheduled

[0106]

[0107]

[0108] Furthermore, such as Figure 3 As shown, in step S4, solving the second optimization problem includes:

[0109] S401: In the task set Select one task from the list as the second task;

[0110] S402: Extract the server corresponding to the second task from the task sequence S and use it as the first server;

[0111] S403: Determine whether the first server has been rented; if the first server has been rented, proceed to step S404; if the first server has not been rented, proceed to step S405.

[0112] S404: Determine the remaining resource conditions and time constraints of the first server and the second task; if both conditions are met, assign the second task to the first server; proceed to step S407.

[0113] S405: Determine the time constraints between the first server and the second task; if the time constraints are met, rent the first server and assign the second task to the first server; proceed to step S407.

[0114] S406: Execute server-unassigned algorithm;

[0115] S407: Select Task Set Another task in the process is treated as a new second task. Repeat steps S402 to S406 until the task set is complete. All tasks are selected, resulting in the final resource scheduling scheme.

[0116] Furthermore, such as Figure 4 As shown, the server does not assign an algorithm, including:

[0117] S40601: In the server set The rented servers that meet the resource availability and time constraints of the second task are selected to form the second set;

[0118] S40602: Calculate the score of the second task and each server in the second set, and select the server with the highest score as the second server;

[0119] S40603: Assign the second task to the second server.

[0120] This algorithm greedily selects suitable resources for tasks based on a task sorting algorithm. When server resources are insufficient to meet the demand, this algorithm will automatically perform elastic scaling of the server.

[0121] The pseudocode for solving the second optimization problem is as follows:

[0122] enter:

[0123] The estimated task completion time matrix E for all tasks currently awaiting scheduling across all servers.

[0124] The set of all tasks waiting to be scheduled and the task sequence S obtained after the task sorting algorithm

[0125] The collection of all leased servers

[0126] Output:

[0127] The actual scheduling scheme, i.e.

[0128]

[0129]

[0130] The core idea of ​​this algorithm is to first consider assigning each task j to the optimal server (Best) for scheduling. j If Best jIf the constraints on resource request and remaining amount (corresponding to constraint (2c)) and execution time constraint (corresponding to constraint (2d)) can be satisfied, then task j should be assigned to Best first. j Up. When Best j When it's not rented, keep it in a rented state as much as possible. If Best j If both constraints cannot be satisfied, then select the Cand server with the highest allocation value from the currently rented servers that satisfy both constraints. j The allocation process will proceed. If all servers are unable to provide service, task j cannot be allocated at the current time t and will proceed to the next scheduling cycle for allocation.

[0131] Furthermore, the time constraint includes:

[0132] g i,j +e i,j +w j ≤d j

[0133] w j G represents the waiting time for the j-th task. i,j E represents the time required for task j to be scheduled to server i. i,j This indicates the execution time of task j on server i, d j This represents the time constraint for the j-th task.

[0134] Furthermore, the remaining resource conditions include:

[0135] m j ≤M i

[0136] m j M represents the resource requirement of the j-th task. i This represents the total resources of the i-th server.

[0137] Furthermore, in step S302 or step S40602, the formula for calculating the fraction is as follows:

[0138]

[0139] P i This represents the cost of renting the i-th server per unit time. C represents the estimated completion time of the j-th task on the i-th server. i,j This represents the total cost of processing the j-th task on the i-th server;

[0140]

[0141] C i,jLet m represent the total cost of processing the j-th task on the i-th server. j This represents the resource requirement of the j-th task. All tasks currently awaiting scheduling are for all servers. The estimated task completion time matrix can be represented as E, S. i,j This represents the score of the j-th task processed on the i-th server.

[0142] A cost-aware resource scheduling system, comprising:

[0143] First optimization problem module: Establish a resource scheduling model and derive the first optimization problem based on the resource scheduling model;

[0144] Second optimization problem module: Based on the first optimization problem, transform and establish the second optimization problem;

[0145] Sorting module: Retrieves the server set Task Collection For all tasks against the estimated completion time matrix E of all servers, the task set is sorted using a task ranking algorithm. The tasks in the sequence are sorted to obtain the task sequence S;

[0146] Solving module: Based on the task sequence S and the server set Task Collection For all tasks, based on the estimated completion time matrix E of all servers, solve the second optimization problem to obtain the final resource scheduling scheme.

[0147] The algorithm for solving the second optimization problem has a theoretically guaranteed upper bound on its performance, which is proven below:

[0148] In approximation algorithms, there is a definition regarding the approximation ratio. The approximation ratio is defined as the ratio between the approximate solution obtained by the approximation algorithm and the theoretically achievable optimal solution; that is, the difference between the performance upper bound of the approximate solution and the optimal solution. Let B represent an NP problem maximizing an objective function, and A represent an approximate solution obtained by an approximation algorithm for solving problem B. Then, for every instance of the NP problem B, we can obtain the formula:

[0149]

[0150] In the above formula, OPT(L) is the optimal solution to an instance L of the NP problem B, and correspondingly, A(L) is the approximate solution obtained by approximation algorithm A for that instance. Therefore, we define R as... A Defined as the approximation ratio of approximation algorithm A, i.e.:

[0151]

[0152] Where R A If is a bounded constant greater than 1 and less than positive infinity, then the approximation algorithm A is an algorithm with a constant approximation ratio.

[0153] The elastic cloud resource AI task scheduling problem proposed in this invention is a problem of minimizing the cost of renting cloud servers. Therefore, according to the definition of the above approximation ratio, the optimization objective of this invention is transformed into a reciprocal form, that is, the problem to be solved is transformed into a problem of maximizing the objective, which makes it easier to derive the approximation ratio.

[0154] Define C i,j Let $\frac{ ... This indicates that as the cost of renting server i to run task j increases, V... i,j The value of will decrease, which aligns with the principle of maximizing the objective function. Therefore, the optimization objective at this point is . The goal is to maximize V as much as possible, meaning that the approximate solution obtained by the algorithm should be close to the theoretically optimal solution.

[0155] To facilitate the proof, we relax the conditions. First, we assume that all cloud servers in the current task scheduling problem have the same total resources, and that the resource requests required by the tasks submitted by users are also the same. In a real production environment, this assumption is reasonable. For example, when users submit the same type of task within the same time period, such as a deep learning inference task for image generation using a large model, each task consumes the same amount of resources, and the GPU memory on medium-sized cloud servers provided by cloud service providers is often a uniform 32GB. Therefore, based on these assumptions, we can obtain the following formula:

[0156]

[0157] Let A represent the problem proposed in this invention. An approximation algorithm with a polynomial-time approximation solution after removing the deadline constraint, and the approximation ratio of this approximation algorithm is R. A =c, where c is a constant. Furthermore, we define A′ as an approximate algorithm for solving the Bin Packing Problem, based on A. We define an instance I of the Bin Packing Problem as follows: the volume of each item j is U. j Each box has a capacity of O and satisfies condition U. j ≤O,

[0158] In the scenario described in this invention, the resource request quantity corresponding to the user-submitted task is m.j =V j =U j The maximum resource limit for each server is the same as the maximum capacity for each box, i.e., M = 0. Let: U = ∑ j U j Example I: Solving Problem Using Approximation Algorithm A k Where k represents the number of servers in the platform, then when the first number k1 is obtained, it can satisfy... Then, based on the idea of ​​First-Fit-Decreasing (FFD), the remaining items are packed into k2 boxes. Therefore, A′ uses a total of k1+k2 boxes when solving the packing problem. Since A′ is based on the approximate algorithm obtained by A in the packing problem, and the problem proposed in this invention and the packing problem can also be correlated according to the above content, A′ is obviously also an approximate algorithm with a polynomial-time approximate solution.

[0159] Suppose that the optimal solution obtained by solving instance I is obtained by using only k * A single box can hold all goods with a total volume of U. According to the above definition, then... Therefore: Therefore, based on the above derivation, we can obtain k. * ≥k1. Since the total number of boxes in this problem is k, let k = k * +k ′ Then we can get k ′ ≤k2. Therefore, the total volume of items in the k2 boxes used in the above FFD algorithm is ≤k2. Let's assume that the minimum number of items needed to fill k2 boxes is l. * It takes several boxes to fill the container, and it is easy to see that k2 > l * Therefore, we can obtain: Furthermore, Based on the references, we assume that in l * The volume of the items packed into each of the subsequent boxes shall not exceed [a certain value]. Then the first l * The volume of items packed into each of the boxes will be greater than [a certain value]. Therefore, we can conclude that:

[0160]

[0161] Since, in the scenario described in this invention, at least two servers will be available for rental scheduling, therefore there must be... Furthermore, if there exists This will make That is, A′, as an approximate algorithm for solving the bin packing problem, has an approximation ratio that can be obtained. However, this has been proven impossible by other works unless P = NP. Therefore, in the scenario of the present invention, the cost incurred when the performance of the solution obtained by the approximate algorithm CRS proposed by the present invention is the best will be as follows:

[0162] Therefore, according to the above derivation, it can be obtained that in the problem solved by the present invention Among them, the approximation ratio of the approximate solution that the approximate algorithm can obtain, that is, the cost incurred, is at least greater than or equal to times the optimal solution. Next, we prove the upper bound of the cost required when the algorithm CRS proposed by the present invention is solved, that is, the maximum multiple of the cost obtained by the theoretical optimal solution. First, we set F as the set of tasks to be scheduled obtained from a feasible solution obtained by the algorithm CRS proposed by the present invention, and assume that Z is any subset of the set of tasks submitted by the user. Then, we assume that there is: m(F)≥∑ i∈I M i . This means that the resources in all servers will be occupied by all tasks in the set F. Otherwise, if this assumption does not hold, it means that the server resources in the cluster are very sufficient and can run all tasks submitted by the users, which will result in the performance of all algorithms being very close. F is the set of tasks to be scheduled. Let F = {j1, j2,..., j l}, and there is k ≤ l. Therefore, the present invention makes F k = {j1, j2,..., j k} represent the first k tasks selected and scheduled by the algorithm CRS. Therefore, according to the greedy idea based on cost optimization in CRS, it can be obtained that:

[0163]

[0164] where z ∈ Z\F k-1 represents the remaining task set after removing the tasks in F k-1 from the set of tasks to be scheduled submitted. According to the definition of cost performance in the CRS algorithm, we can obtain the following conclusion:

[0165]

[0166] In addition, we assume that V(Z) > V(F l ), otherwise the CRS algorithm proposed by us can produce optimal performance in any case, which is unreasonable. Under such an assumption, there must be m(j k ) < m(Z). Otherwise, the following inequality will occur:

[0167]

[0168] Therefore, it can be obtained that V(Z) ≤ V(F k)≤V(F l This leads to a contradiction with the assumptions already made in this invention.

[0169] After further transformation of the inequality, we can obtain From the above definitions of sets Z and F, we can obtain: Therefore, we can further obtain Based on the previous assumptions, the set of tasks to be scheduled obtained by CRS satisfies the condition. Therefore, relative to the optimal solution, m(F) ≥ m(OPT). If the set of tasks to be scheduled obtained from CRS satisfies... This means that all submitted tasks have been scheduled, i.e. At this point, the resource usage of the tasks in the solution set is the same as the memory usage of the tasks in the optimal solution set. Therefore:

[0170]

[0171] Finally, since the cost obtained by the CRS algorithm was defined as V at the beginning of this section for ease of proof, it can now be converted back to obtain...

[0172] Therefore, it can be concluded that the CRS algorithm maintains the following performance limits under all circumstances:

[0173]

[0174] Compared with existing technologies, the algorithm proposed in this invention achieves optimal performance in terms of average task execution time and average task waiting time across all tasks. Simultaneously, the algorithm effectively reduces the cost of renting resources on the task platform and significantly improves the overall resource utilization rate of the rented resources.

[0175] The dataset used for testing in this invention is data collected by Alibaba Cloud from its actual production clusters based on the "Alibaba Cluster Tracking Program." This publicly available dataset is widely used in research on the characteristics of modern internet data centers and workloads.

[0176] The following metrics were used to evaluate the algorithm performance in this embodiment:

[0177] ① Economic Cost: In the problem scenario of this invention, enterprises run user-submitted tasks by renting servers from cloud service providers. Therefore, enterprises need to pay cloud service providers based on the pricing of the rented servers and the rental period. Thus, the most important optimization objective of this invention is to minimize the economic cost incurred by enterprises in renting servers. An excellent scheduling strategy can minimize the economic cost incurred by enterprises while meeting the task requirements submitted by users as much as possible. Therefore, the enterprise cost incurred in scheduling all tasks is used as an indicator for evaluation.

[0178] ② Average Task Completion Time: In a real production cluster, each user submits a task with specified information at a defined time. If there are sufficient computing resources in the cluster at that time, the task will be scheduled to run on a server. If no resources are available, the task will be placed in a waiting queue for delayed scheduling. Furthermore, the execution time of a task is related to the performance of the server on which it runs; better performance results in a shorter execution time. Therefore, task completion time represents the time from task submission to scheduling completion. A shorter average task completion time means better fulfillment of user needs; hence, average task completion time is used as an evaluation metric.

[0179] ③ Maximum Task Completion Span (Makespan): The maximum task completion span represents the sum of the completion times of all user-submitted tasks within a cluster. It is the time from the first task submitted to the cluster to the completion time of the last completed task. When cluster resources are utilized efficiently, the Makespan required to complete all tasks will decrease; therefore, the maximum task completion span (Makespan) is used as an evaluation metric.

[0180] ④ On-time Completion Rate: When users specify a deadline for submitted tasks, it is necessary to minimize the number of tasks not completed before the deadline, thereby reducing the user's QoE loss. Therefore, when designing the scheduling algorithm, in addition to considering the economic cost of renting cloud servers and task completion time, the user-specified deadline for each task must be taken into account. We define the on-time completion rate as the ratio of the number of tasks not completed before the deadline in the cluster to the total number of tasks running in the cluster, and use this as an evaluation metric.

[0181] In this embodiment, the following algorithm is used as the comparison algorithm:

[0182] ① Kubernetes Default Scheduling Algorithm: In Kubernetes, a widely used infrastructure in various cloud computing platforms, researchers designed a built-in default scheduling algorithm to rationally allocate tasks submitted to the Kubernetes cluster to nodes with different resources. In the Kubernetes scheduler, whenever a task is submitted, a corresponding pod is created. Then, according to its defined pre-selection strategy, it first traverses all nodes in the cluster to obtain all nodes that meet the pod's resource requirements. Next, for these selected nodes, a scoring mechanism is used to score the resources on all nodes, typically based on remaining resources and whether a similar node has been recently scheduled. The nodes are then prioritized according to their scores, and finally, the node with the highest priority is selected for scheduling.

[0183] ②Tetris Algorithm: This algorithm is a resource scheduling strategy commonly used in cloud computing platforms, aiming to maximize cluster resource utilization and system performance. Inspired by the block organization mechanism in the game Tetris, the Tetris algorithm dynamically adjusts the location and number of tasks on servers in the cluster based on the current resource status of the servers and the resource requirements of the submitted tasks, thereby maximizing cluster resource utilization. Furthermore, based on the concept of load balancing, the algorithm strives to balance the resource utilization of different servers in the cluster, preventing tasks from being overly concentrated on certain servers, thus improving the overall performance of the cluster.

[0184] ③Tiresias Algorithm: This is a scheduling algorithm proposed by Microsoft Research in 2019 for clusters in its Azure cloud computing platform. The algorithm first proposes an offline heuristic scheduling strategy based on the workload, resource utilization, and computational resource requirements of different servers in the cluster. It can quickly handle most task scheduling scenarios in the cluster. Furthermore, it utilizes historical task execution data and workload changes in the cluster to prioritize different tasks and servers, dynamically adjusting the scheduling strategy to better adapt to different scenarios and needs.

[0185] ④ Earliest Deadline First (EDF) Algorithm: This is a commonly used scheduling algorithm for real-time tasks with deadlines in a cluster. EDF dynamically makes scheduling decisions based on the task's real-time status and deadline. When a new task arrives or a task completes, the system re-evaluates the task queue and reorders it to ensure that tasks are always scheduled according to the earliest deadline. It guarantees that tasks will complete before their deadlines, making it suitable for real-time systems with strict requirements on task response time and latency.

[0186] ⑤ Moore's Algorithm: This algorithm first designs a scheduling strategy based on the earliest deadline, then checks its feasibility. If the scheduling can ensure that each task meets its deadline, it is considered feasible. If the scheduling strategy is infeasible, it will repeatedly remove the largest task with a computational requirement greater than the tasks that cannot meet their deadlines until the scheduling strategy becomes feasible. Finally, the algorithm schedules the previously removed tasks according to the idea of ​​random scheduling.

[0187] like Figures 5 to 14 As shown, the algorithm's results are tested and analyzed based on three different task submission scenarios:

[0188] ① Real-world cluster task online submission scenario: In this scenario, test analysis is conducted based on the data of tasks submitted and run within a day in the dataset. During the day, tasks may be submitted and scheduled at every minute, i.e., at time slot t. In this scenario, tasks have no deadline constraints, which is similar to tasks submitted in a typical cloud computing cluster.

[0189] ② Simulated task submission scenario at the beginning of the cycle: As experimental results show, in real cluster task online submission scenarios, the performance of the algorithm, especially the maximum span of task completion, is affected by the last submitted task, i.e., the long tail effect. Therefore, simulated tasks are submitted uniformly at the beginning of the scheduling cycle.

[0190] ③ Online task submission scenario with deadline requirements: In this scenario, the deadline for each task is set based on the task QoS field of the dataset, and it is necessary to test the on-time completion rate of tasks obtained by each algorithm.

[0191] Furthermore, in real-world cloud server rental scenarios, the number of cloud servers available for rent in the same region from a cloud service provider typically changes with market demand, and a sufficient number of cloud servers cannot always be provided. Therefore, the experiment simulates the following three scenarios regarding the number of cloud servers available for rent:

[0192] ①100%: The cloud service provider's resource pool has sufficient cloud servers available for rent in this scenario. In the experimental scenario of this invention, there are 4 cloud servers of each of the 5 types available for rent.

[0193] ②75%: In this scenario, some other users in the cloud service provider's resource pool are competing for the rental cloud server. In the experimental scenario of this invention, there are 3 rental servers for each of the 5 types of cloud servers.

[0194] ③50%: In this scenario, the cloud service provider's resource pool has a large number of users renting cloud servers, so the number available for rent is relatively small. In the experimental scenario of this invention, there are 2 cloud servers of each of the 5 types available for rent.

[0195] Example 2

[0196] Based on the cost-aware resource scheduling method described in Embodiment 1, this embodiment employs the same cost-aware resource scheduling method as Embodiment 1. For example... Figure 15 As shown, this is an AI model training task platform that can be used to rent GPU computing power from third-party cloud platforms.

[0197] The platform needs to determine the number and duration of GPU servers to rent based on the load of user-submitted tasks. In this case, the platform can model the servers described in this invention as GPU servers and modify the relevant data structures to meet the needs of the computing platform. The platform can also model the tasks described in this invention as AI model training tasks entering the computing platform. During scheduling, the platform can integrate the cost-aware task allocation and dynamic resource scaling mechanism of this invention to improve resource utilization and reduce rental costs.

[0198] Example 3

[0199] Based on the cost-aware resource scheduling method described in Embodiment 1, this embodiment employs the same cost-aware resource scheduling method as Embodiment 1. For example... Figure 16 As shown, this is a resource crowdsourcing platform that can be used for idle computing power in society.

[0200] The platform needs to determine the quantity and timing of crowdsourced computing power collection based on the workload of user-submitted tasks, while also considering whether to rent computing power from third-party cloud platforms. In this case, the platform can model the server of this invention as the collected computing power resource and modify the relevant data structure to meet the needs of the crowdsourcing platform. The platform can also model the tasks of this invention as tasks entering the computing platform. During scheduling, the platform can integrate the cost-aware task allocation and dynamic resource scaling mechanism of this invention to improve resource utilization, reduce unnecessary occupation of social computing power, and minimize intrusion.

[0201] The same or similar labels correspond to the same or similar parts;

[0202] The terms used to describe positional relationships in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this patent.

[0203] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.

Claims

1. A cost-aware resource scheduling method, characterized in that, include: S1: Establish a resource scheduling model and derive the first optimization problem based on the resource scheduling model; S2: Based on the first optimization problem, transform it into a second optimization problem; S3: Get server set Task Set Estimated completion time matrix for all tasks across all servers Using task sorting algorithms to sort task sets Sort the tasks in the list to obtain a task sequence. ; S4: According to the task sequence Server collection Task Set Estimated completion time matrix for all tasks across all servers Solve the second optimization problem to obtain the final resource scheduling scheme; The first optimization problem is as follows: (1c) , (1d) The second optimization problem is as follows: (2c) , (2d) This indicates the importance of the total server cost. This represents the intermediate computational cost of task j. Represents the allocation scheme matrix. This indicates that task j is executed on server i. Represents a set of tasks. Let j represent the set of servers, j represent the task number, and i represent the server number. This represents the cost of renting the i-th server per unit time. This indicates the time during which task j is executed on server i. This represents the resource requirement of the j-th task. This represents the total resources of the i-th server. This represents the waiting time for the j-th task. This represents the time required for task j to be scheduled to server i. This represents the time constraint for the j-th task.

2. The cost-aware resource scheduling method according to claim 1, characterized in that, The task sorting algorithm includes: S301: In the task set Select one task from the list as the first task; S302: Calculate the first task and server set The score of each server is used as the lowest score for the first task. S303: Put the first score of the first task, the corresponding server, and the first task into the first set; S304: In the task set Select another task from the set as the new first task, and repeat steps S302 to S303 until the set of tasks is complete. All tasks were selected. S305: Sort the first set in ascending order based on the first score of the first task to obtain the task sequence. .

3. The cost-aware resource scheduling method according to claim 1, characterized in that, In step S4, the second optimization problem is solved, including: S401: In the task set Select one task from the list as the second task; S402: In the task sequence Extract the server corresponding to the second task and use it as the first server; S403: Determine whether the first server has been rented; if the first server has been rented, proceed to step S404; if the first server has not been rented, proceed to step S405. S404: Determine the remaining resource conditions and time constraints of the first server and the second task; if both conditions are met, assign the second task to the first server; proceed to step S407. S405: Determine the time constraints between the first server and the second task; if the time constraints are met, rent the first server and assign the second task to the first server; proceed to step S407. S406: Execute server-unassigned algorithm; S407: Select Task Set Another task in the process is treated as a new second task. Repeat steps S402 to S406 until the task set is complete. All tasks are selected, resulting in the final resource scheduling scheme.

4. The cost-aware resource scheduling method according to claim 3, characterized in that, The server has not assigned an algorithm, including: S40601: In the server set The rented servers that meet the resource availability and time constraints of the second task are selected to form the second set; S40602: Calculate the score of the second task and each server in the second set, and select the server with the highest score as the second server; S40603: Assign the second task to the second server.

5. A cost-aware resource scheduling method according to claim 3 or 4, characterized in that, The time constraints include: This represents the waiting time for the j-th task. This represents the time required for task j to be scheduled to server i. This indicates the time during which task j is executed on server i. This represents the time constraint for the j-th task.

6. A cost-aware resource scheduling method according to claim 3 or 4, characterized in that, The remaining resource conditions include: This represents the resource requirement of the j-th task. This represents the total resources of the i-th server.

7. The cost-aware resource scheduling method according to claim 2, characterized in that, In step S302, the formula for calculating the fraction is as follows: This represents the cost of renting the i-th server per unit time. This represents the estimated time for the j-th task to complete on the i-th server. This represents the total cost of processing the j-th task on the i-th server; This represents the total cost of processing the j-th task on the i-th server. This represents the resource requirement of the j-th task. This represents the score of the j-th task processed on the i-th server.

8. The cost-aware resource scheduling method according to claim 4, characterized in that, In step S40602, the formula for calculating the fraction is as follows: This represents the cost of renting the i-th server per unit time. This represents the estimated time for the j-th task to complete on the i-th server. This represents the total cost of processing the j-th task on the i-th server; This represents the total cost of processing the j-th task on the i-th server. This represents the resource requirement of the j-th task. This represents the score of the j-th task processed on the i-th server.

9. A cost-aware resource scheduling system, applied to the scheduling method according to any one of claims 1 to 8, characterized in that, include: First optimization problem module: Establish a resource scheduling model and derive the first optimization problem based on the resource scheduling model; Second optimization problem module: Based on the first optimization problem, transform and establish the second optimization problem; Sorting module: Retrieves the server set Task Set Estimated completion time matrix for all tasks across all servers Using task sorting algorithms to sort task sets Sort the tasks in the list to obtain a task sequence. ; Solving module: Based on the task sequence Server collection Task Set Estimated completion time matrix for all tasks across all servers Solve the second optimization problem to obtain the final resource scheduling scheme.

Citation Information

Patent Citations

  • Task scheduling algorithm for cost perception under cloud environment

    CN107992359A

  • Computing power scheduling method and system of AI server cluster

    CN118626224A