Time-varying workload scheduling method based on priority and resource awareness
By employing a priority- and resource-aware time-varying workload scheduling method, which captures cluster state using a classifier and a parallel graph attention layer, and combines it with a reinforcement learning policy network, the method addresses the problem of low scheduling efficiency in existing methods, achieving more efficient resource utilization and improved returns.
Patent Information
- Application Number
- CN202411010621.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2044-07-26
AI Technical Summary
Existing time-varying workload scheduling methods based on reinforcement learning rely on first-come, first-served or preset priorities during scheduling, ignoring the current state of resource utilization within the server cluster. This results in low scheduling efficiency and an inability to accurately predict future cluster state changes, making it difficult to find better solutions.
A priority- and resource-aware time-varying workload scheduling method is adopted. Priority queues are generated by classifiers, server cluster states are extracted by parallel graph attention layers and gated recurrent units, scheduling decisions are made by reinforcement learning policy networks, and a baseline training method is introduced to improve scheduling efficiency and resource utilization.
This maximizes cluster resource utilization, reduces resource fragmentation, lowers the number of servers and workload wait time, and increases the revenue of cloud service providers.
Smart Images

Figure CN119088539B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of time-varying workload scheduling, in particular to a time-varying workload scheduling method based on priority and resource awareness. BACKGROUND
[0002] Nowadays, many enterprises are migrating their user-generated workloads, such as web requests, application tasks, and data processing jobs, to cloud server clusters to provide services. Cloud Service Providers (CSPs) manage the operation of cloud server clusters, provide users with pay-as-you-go access to cloud resources, and save costs, improve service reliability, and improve service performance for enterprises. Workloads dynamically arrive and leave the cloud server cluster in an online manner, and their resource requirements change dynamically over time. The scheduler considers the time-varying resource requirements of the workloads and the current status of the server cluster, and then allocates the workloads to the designated servers for processing according to its scheduling strategy, striving to achieve excellent results on key indicators such as cluster resource utilization. This process is called time-varying workload scheduling. Due to the heterogeneity of cloud servers and the scattered distribution of available resources, as well as the time-varying nature of workloads, the solution to the time-varying workload scheduling problem has certain complexity.
[0003] Currently, precise algorithms, heuristic algorithms, and learning-based methods are commonly used to solve the time-varying workload scheduling problem. Precise algorithms aim to find the optimal solution, but due to the computational demand, they are usually not suitable for large-scale clusters. Heuristic algorithms are either constructed based on empirical rules or natural phenomena mechanisms, or utilize prior knowledge to model the cluster environment and workload resource requirements to design scheduling strategies, which excessively rely on manual settings, resulting in a lack of interaction with dynamic environments. Learning-based methods can automatically learn scheduling strategies from a large amount of historical data, among which Reinforcement Learning (RL) can continuously interact with dynamic cluster environments, enabling the scheduler to explore various decisions and optimize the strategy through reward signals, making it the preferred method for developing adaptive workload scheduling frameworks. However, existing RL-based methods often rely on first-come-first-served or pre-set priorities when scheduling, which ignores the current state of resource utilization within the server cluster, limits the scheduler's choice of scheduling order, and hinders the discovery of better solutions and the improvement of scheduling efficiency. Another important challenge is that these methods lack sufficient awareness of the temporal utilization of multi-dimensional resources within the cluster, making it difficult to accurately predict future changes in cluster state, leading to potential convergence to suboptimal solutions. Therefore, how to design a time-varying workload scheduling algorithm that effectively utilizes priority and resource awareness has become a challenge. SUMMARY
[0004] The purpose of the present application is to provide a priority and resource-aware time-varying workload scheduling method, comprising the following steps:
[0005] 1) Obtain the cloud server cluster state and the workload set W to be scheduled;
[0006] 2) Determine whether the workload set W is successfully scheduled, if yes, go to step 20), otherwise, go to step 3);
[0007] 3) Determine whether the preset time step threshold T is reached, if yes, go to step 14), otherwise, go to step 4);
[0008] 4) Use the classifier f c to classify the current workload w i and assign a label c i to it;
[0009] 5) Use the queue scorer to evaluate the workloads in W and obtain the score
[0010] 6) Construct a priority queue state matrix S Q ∈Z K×(1+D) , where the first column of the priority queue state matrix S Q ∈Z K×(1+D) is the assigned label, and the other D columns represent the required resources of the workload;
[0011] 7) Use the parallel graph attention layer and the gated recurrent unit to extract the hidden state S C of the server cluster;
[0012] 8) Connect the hidden state S C of the server cluster and the priority queue state matrix S Q to form the final state S t at time step t;
[0013] 9) Input the final state S t into the reinforcement learning-based policy network to output the scheduling action A t ;
[0014] 10) Determine whether the scheduling action is valid, if yes, go to step 11), otherwise, go to step 13);
[0015] 11) Schedule the workload at the head of the priority queue to the server designated by the action A t ;
[0016] 12) Transfer the final state S t to the state S of the cluster environment according to Generate reward R t The scheduling process is treated as a trajectory e=1, and (S) is recorded. t A t ,R t ) tuple, return to step 5);
[0017] 13) Increment the time step by 1, and put all new workload requests that will be sent to the cluster into W, then return to step 3).
[0018] 14) Determine if the preset number of training iterations has been reached. If yes, proceed to step 19; otherwise, proceed to step 15.
[0019] 15) Initialize the cloud server cluster status and workload requests, keeping them consistent with step 2);
[0020] 16) Conduct multiple simulation experiments and record the corresponding trajectories e = 2, ..., N;
[0021] 17) Calculate the gradients of all trajectories and sum them to update the network weights of the policy network and the parallel graph attention layer;
[0022] 18) Increment the iteration count by 1 and return to step 14).
[0023] 19) Initialize the time step to 1, then return to step 2).
[0024] 20) All workloads have been successfully scheduled. End. If new workload requests arrive at the cluster, return to step 1).
[0025] Furthermore, the cloud server cluster consists of J servers, denoted as {s1,...,s...} j ,...,s J};
[0026] Each server has D resource dimensions;
[0027] For each server s j The resource capacity along the resource dimension d is heterogeneous, denoted as c. j,d ;
[0028] At time step t, the amount of available resources on resource dimension d of the server is represented as follows:
[0029] Furthermore, the workload set W that needs to be scheduled contains workloads w i The time-varying resource requirement of ∈W is defined as in This represents the number of resources requested across D dimensions at the l-th execution time step. irepresents the execution time step.
[0030] Further, the classifier f c is constructed as follows:
[0031] a1) Collect a set of historical workloads from cluster historical traces;
[0032] a2) Calculate the distance metric between different workloads using dynamic time warping algorithm;
[0033] wherein the distance metric between workloads w i and w g is calculated as follows:
[0034]
[0035] wherein the parameter is the time-varying resource demand of workload w i and w g ; the parameter is the minimum distance metric between time-varying resource demands ; the parameter is the minimum distance metric between time-varying resource demands ; the parameter is the minimum distance metric between time-varying resource demands ; the parameter is the minimum distance metric between time-varying resource demands ; the parameter is the time-varying resource demand;
[0036] a3) According to the distance metric, the workloads are clustered using density-based clustering algorithm to generate C equivalence classes; wherein the density-connected workloads form an equivalence class;
[0037] a4) Take the workloads and the corresponding class labels as training data to train the classifier f c .
[0038] Further, the method for generating C equivalence classes is as follows:
[0039] For workload w i , if it contains at least minPts workloads within the neighborhood, then the workload w i is a core point;
[0040] If the workload w i is a core point and then it is considered that the path from w i to w g is directly density reachable; ∈ is a preset distance threshold;
[0041] Given a core point w i ,w g ,w e , if the paths from w i to w g and from w g to w e are directly density reachable, then the path from w i to w e is density reachable;
[0042] If a core point makes the paths from w g to w i and from w g to w e density reachable, then w i and w e are defined as density connected.
[0043] Further, the score q i of a workload w i is given as follows:
[0044]
[0045] where α1, α2, α3 are constants that control the importance of different components to the score; denotes the available amount of resource of server s j in resource dimension d at time step t; denotes the amount of resource requested by workload w i in resource dimension d at the 1st execution time step; t denotes the current time step; t i denotes the amount of resource requested by workload w i in resource dimension d at time step t i to arrive at the cluster; N ci denotes the number of workloads belonging to class c i currently running in the cluster; Ι()=0,1 is an indicator function; B(t) denotes the servers running in the cluster at time step t.
[0046] Further, the step of extracting the hidden state S C of the server cluster using a parallel graph attention layer and a gated recurrent unit comprises:
[0047] b1) extracting advanced features v j from the resource usage time series of each server s j using one-dimensional convolution, i.e.
[0048] v j =conv(o j ) (4)
[0049] wherein the argument M is the number of historical time steps read by the server, horizontal pixels denotes the resource utilization state within the server s j ; conv() denotes a convolution operation;
[0050] b2) capturing the relationship between adjacent nodes in the high-level feature V = [v1,..., v j ,..., v J ] by using a dimension-oriented parallel graph attention layer to obtain a dimension graph attention state h feat ;
[0051] capturing the time sequence dependency in the high-level feature by using a time-oriented parallel graph attention layer to obtain a time sequence graph attention state h time ;
[0052] wherein the dimension graph attention state h feat is as follows:
[0053] h feat = [h 1 ,..., h j ,..., h J ] (5)
[0054]
[0055] In the formula, sigma denotes an s-shaped activation function, alpha jg is an attention score, denotes the adjacent node set of node j; h j is the attention state of node j; v g is the high-level feature;
[0056] The attention score alpha jg is as follows:
[0057]
[0058]
[0059] In the formula, LeakeyReLU denotes an activation function; omega denotes a weight argument; v j , v g are high-level features; e jg is an intermediate argument; the intermediate argument
[0060] The time sequence graph attention state h time is as follows:
[0061] h time = [h 1 ,..., hm ..., h M ](9)
[0062]
[0063] where a mp is the attention score;
[0064] b3) concatenating the dimension-wise attention states h feat , the temporal attention state h time to obtain a feature matrix; then, inputting the feature matrix into a gated recurrent unit to obtain a hidden state S C of the server cluster, i.e.,
[0065]
[0066] where GRU denotes a gated recurrent unit.
[0067] Further, the action space of the scheduling action A t is A t = j indicates that the first workload in the priority queue is assigned to the j-th server; indicates the “invalid” action, indicating that the scheduler refuses to schedule this workload in the current time step.
[0068] Further, the reward R t = -P C -P U -P W ;
[0069] where the resource contention penalty P C is given as follows:
[0070]
[0071] where K c is a constant determining the weight of the resource contention penalty;
[0072] where the contention score C j (s r ,d) related to the server s j in the resource dimension d is given as follows:
[0073]
[0074] where s j,W denotes the set of workloads running on the server s j , and r i,d is a vector indicating the resource demand of the workload w j running on the server s iResource usage time series along d; r g,d Representing workload w g Resource usage time series along d;
[0075] Penalty P for underutilization U As follows:
[0076]
[0077] Where constant term K u is a scale coefficient;
[0078] Penalty P for latency W As follows:
[0079] P W = K w *|W|(15)
[0080] Where K w is a constant; |W| represents the total number of workloads to be scheduled within the cluster.
[0081] Further, the step of calculating all trajectory gradients comprises:
[0082] c1) constructing a trajectory expression, i.e.
[0083]
[0084] In the formula, trace e represents a trajectory; represents a time step T e corresponding state, action, reward;
[0085] c2) calculating the cumulative reward of each step in all trajectories, i.e.
[0086]
[0087] Where γ is a decay factor for calculating the cumulative reward. Time step x = t, …, T e ; represents the reward corresponding to time step x;
[0088] c3) calculating the baseline z t according to the cumulative reward of each step in all trajectories, i.e.
[0089]
[0090] In the formula, N is the number of trajectories;
[0091] c4) calculating the gradient Δθ of all trajectories according to the baseline, i.e.
[0092]
[0093] In the formula, a is a learning rate.
[0094] The technical effect of the present application is self-evident, and the present application solves the problem of time-varying workload scheduling. The present application generates a priority queue for the incoming workload by introducing a pre-trained classifier and a queue scorer, fully utilizes the priority queue to guide the efficiency of the reinforcement learning to solve the problem of time-varying workload scheduling; in order to better perform cluster resource perception, a parallel GAT layer is proposed, which can effectively capture the dimension and time characteristics of the cluster and accurately predict the change of the future cluster state; in addition, a reinforcement learning strategy network training method with a baseline is introduced, which enhances the training stability and improves the training efficiency. The present application can maximize the cluster resource utilization rate while minimizing the cluster resource fragmentation rate, the number of servers used, the workload waiting time, better meet the needs of users and bring higher benefits to CSPs. BRIEF DESCRIPTION OF DRAWINGS
[0095] Figure 1 The total algorithm flowchart for time-varying workload scheduling. DETAILED DESCRIPTION
[0096] The present application will be further described below in conjunction with the embodiments, but should not be understood as limiting the above-mentioned subject matter of the present application to only the following embodiments. Various substitutions and modifications can be made according to ordinary technical knowledge and conventional means in the art without departing from the above-mentioned technical idea of the present application, and all should be included in the protection scope of the present application.
[0097] Example 1:
[0098] Referring to Figure 1 , the time-varying workload scheduling method based on priority and resource perception includes the following steps:
[0099] 1) Obtain the cloud server cluster state and the workload set W that needs to be scheduled;
[0100] 2) Determine whether the workload set W is successfully scheduled, if yes, go to step 20), otherwise, go to step 3);
[0101] 3) Determine whether the preset time step threshold T is reached, if yes, go to step 14), otherwise, go to step 4);
[0102] 4) Use the classifier f c to assign a label c i to the current workload w i ;
[0103] 5) Use a queue scorer to evaluate the workload in W and obtain a workload score.
[0104] 6) Construct a priority queue state matrix S using the top K workloads with the highest scores. Q ∈Z k×(1+D) ; where, priority queue state matrix S Q ∈Z K×(1+D) The first column is the assigned label, and the other D columns represent the resources required for the workload;
[0105] 7) Extract the hidden state S of the server cluster using a parallel graph attention layer and gated recurrent units. C ;
[0106] 8) Hidden state S of the connected server cluster C Priority queue state matrix S Q The final state S is formed at time step t. t ;
[0107] 9) Set the final state S t The input is fed into a reinforcement learning-based policy network, and the output is a scheduling action A. t ;
[0108] 10) Determine if the scheduling action is valid. If it is, proceed to step 11); otherwise, proceed to step 13.
[0109] 11) Schedule the workload at the head of the priority queue to action A. t In the specified server;
[0110] 12) Set the final state S t Transfer to Cluster environment based on Generate reward R t The scheduling process is treated as a trajectory e=1, and (S) is recorded. t A t ,R t ) tuple, return to step 5);
[0111] 13) Increment the time step by 1, and put all new workload requests that will be sent to the cluster into W, then return to step 3).
[0112] 14) Determine if the preset number of training iterations has been reached. If yes, proceed to step 19; otherwise, proceed to step 15.
[0113] 15) Initialize the cloud server cluster status and workload requests, keeping them consistent with step 2);
[0114] 16) Conduct multiple simulation experiments and record the corresponding trajectories e = 2, ..., N;
[0115] 17) Calculate all trajectory gradients and add all gradients to update network weights for policy network and parallel graph attention layers;
[0116] 18) Increase iteration number by 1 and return to step 14).
[0117] 19) Initialize time step as 1 and return to step 2).
[0118] 20) All workloads have been successfully scheduled, end. If there is a new workload request to the cluster, return to step 1).
[0119] The cloud server cluster includes J servers, denoted as {s1,...,s j ,...,s J};
[0120] Each server has D resource dimensions;
[0121] For each server s j , the resource capacity in resource dimension d is heterogeneous, denoted as c j,d ;
[0122] At time step t, the available resource amount of the server in resource dimension d is denoted as
[0123] The time-varying resource requirement of workload w i ∈W in the set of workloads W to be scheduled is defined as wherein represents the number of resources requested across D dimensions at the lth execution time step. n i represents the execution time step.
[0124] The construction steps of the classifier f c are as follows:
[0125] a1) Collect a set of historical workloads from the cluster historical trajectory;
[0126] a2) Calculate the distance measure between different workloads using the dynamic time warping algorithm;
[0127] wherein the distance measure d i between workloads w g and w i is as follows:
[0128]
[0129] wherein the parameter is the workload w i and wg time-varying resource demand; a minimum distance metric between the time-varying resource demands a minimum distance metric between the time-varying resource demands a minimum distance metric between the time-varying resource demands a minimum distance metric between the time-varying resource demands a minimum distance metric between the time-varying resource demands a minimum distance metric between the time-varying resource demands a minimum distance metric between the time-varying resource demands a minimum distance metric between the time-varying resource demands time-varying resource demand;
[0130] a3) clustering the workloads using a density-based clustering algorithm according to the distance metric, to generate C equivalence classes; wherein workloads that are density-connected form an equivalence class;
[0131] a4) training a classifier f using the workloads and corresponding class labels as training data c .
[0132] The method of generating C equivalence classes is as follows:
[0133] For a workload w i , if it contains at least minPts workloads within its neighborhood, then the workload w i is a core point;
[0134] If the workload w i is a core point and then the path from w i to w g is directly density-reachable; ∈ is a preset distance threshold;
[0135] Given core points w i , w g , w e , if the paths from w i to w g and from w g to w e are both directly density-reachable, then the path from w i to w e is density-reachable;
[0136] If a core point makes the paths from w g to w i , w h to w e density-reachable, then w i and w e are defined as density-connected.
[0137] The score q of a workload w i i As follows:
[0138]
[0139] where a1, a2, a3 are constants that control the importance of different components to the score; denotes the number of servers s j available in resource dimension d at time step t; denotes the number of servers s i requested in resource dimension d at the first execution time step; t denotes the current time step; t i denotes the number of servers s i requested in resource dimension d at time step t i arriving at the cluster; denotes the number of workloads belonging to class c i currently running in the cluster; I() = 0, 1 is an indicator function; B(t) denotes the number of servers currently running in the cluster at time step t.
[0140] The steps of extracting the hidden state S C of the server cluster using a parallel graph attention layer and a gated recurrent unit include:
[0141] b1) extracting advanced features v j from the resource usage time series of each server s j , i.e.:
[0142] v j = conv(o j ) (4)
[0143] where the parameter M is the number of historical time steps read by the server; the horizontal pixel denotes the resource utilization state within the server s j ; and conv() denotes a convolution operation;
[0144] b2) capturing the relationship between adjacent nodes in the advanced features V = [v1,..., v j ,..., v J ] using a dimension-oriented parallel graph attention layer to obtain a dimension graph attention state h feat ;
[0145] capturing the time series dependency in the advanced features using a time-oriented parallel graph attention layer to obtain a time series graph attention state h time ;
[0146] where the dimension graph attention state h feat is as follows:
[0147] h feat ,...,h 1 ,...,h j ,...,h J ](5)
[0148]
[0149] where σ denotes an s-type activation function, α jg is an attention score, denotes a set of neighboring nodes of node j; h j is an attention state of node j; v g is a high-level feature;
[0150] The attention score α jg is as follows:
[0151]
[0152] where LeakeyReLU denotes an activation function; ω denotes a weight parameter; v j , v g is a high-level feature; e jg is an intermediate parameter; the intermediate parameter
[0153] The time-series attention state h time is as follows:
[0154] h time ,...,h 1 ,...,h m ,...,h M ](9)
[0155]
[0156] where α mp is an attention score;
[0157] b3) The connection dimension graph attention state h feat and the time-series attention state h time are combined to obtain a feature matrix; then, the feature matrix is input into a gated recurrent unit to obtain a hidden state S C of the server cluster, i.e.:
[0158]
[0159] where GRU denotes a gated recurrent unit.
[0160] The action space of the scheduling action A t is A t= j denotes assigning the first workload in the priority queue to the jth server; denotes the "invalid" action, indicating that the scheduler refuses to schedule this workload in the current time step.
[0161] reward R t = -P C -P U -P W ;
[0162] where resource contention penalty P C is given by:
[0163]
[0164] where K c is a constant determining the weight of the resource contention penalty;
[0165] where contention score C j (s r ,d) associated with server s j across resource dimension d is given by:
[0166]
[0167] where s j,W denotes the set of workloads running on server s j , r i,d is a vector representing the time series of resource usage of workload w j along dimension d on server s i ; r g,d denotes the time series of resource usage of workload w g along dimension d;
[0168] under-utilization penalty P U is given by:
[0169]
[0170] where constant term K u is a scaling coefficient;
[0171] latency penalty P W is given by:
[0172] P W = K w *|W|(15)
[0173] where K w is a constant; |W| denotes the total number of workloads to be scheduled within the cluster.
[0174] The step of calculating all trajectory gradients comprises:
[0175] c1) constructing trajectory expressions, i.e.,
[0176]
[0177] where trace e denotes a trajectory; denotes a time step T e corresponding state, action, reward;
[0178] c2) calculating the cumulative reward of each step in all trajectories, i.e.,
[0179]
[0180] where γ is a decay factor for calculating the cumulative reward. The time step x = t, …, T e ; denotes the reward corresponding to the time step x;
[0181] c3) calculating the baseline z t according to the cumulative reward of each step in all trajectories, i.e.,
[0182]
[0183] where N is the number of trajectories;
[0184] c4) calculating the gradient Δθ of all trajectories according to the baseline, i.e.,
[0185]
[0186] where α is the learning rate.
[0187] Embodiment 2:
[0188] The priority and resource-aware time-varying workload scheduling method comprises the following steps:
[0189] 1) obtaining the cloud server cluster state and the workload set W to be scheduled;
[0190] 2) determining whether the workload set W is successfully scheduled, if yes, entering step 20), otherwise, entering step 3);
[0191] 3) determining whether the preset time step threshold T is reached, if yes, entering step 14), otherwise, entering step 4);
[0192] 4) using the classifier f c to assign a label c i to the current workload w i ;
[0193] 5) Use a queue scorer to evaluate the workload in W and obtain a workload score.
[0194] 6) Construct a priority queue state matrix S using the top K workloads with the highest scores. Q ∈Z K×(1+D) ; where, priority queue state matrix S Q ∈Z K×(1+D) The first column is the assigned label, and the other D columns represent the resources required for the workload;
[0195] 7) Extract the hidden state S of the server cluster using a parallel graph attention layer and gated recurrent units. C ;
[0196] 8) Hidden state S of the connected server cluster C Priority queue state matrix S Q The final state S is formed at time step t. t ;
[0197] 9) Set the final state S t The input is fed into a reinforcement learning-based policy network, and the output is a scheduling action A. t ;
[0198] 10) Determine if the scheduling action is valid. If it is, proceed to step 11); otherwise, proceed to step 13.
[0199] 11) Schedule the workload at the head of the priority queue to action A. t In the specified server;
[0200] 12) Set the final state S t Transfer to Cluster environment based on Generate reward R t The scheduling process is treated as a trajectory e=1, and (S) is recorded. t A t ,R t ) tuple, return to step 5);
[0201] 13) Increment the time step by 1, and put all new workload requests that will be sent to the cluster into W, then return to step 3).
[0202] 14) Determine if the preset number of training iterations has been reached. If yes, proceed to step 19; otherwise, proceed to step 15.
[0203] 15) Initialize the cloud server cluster status and workload requests, keeping them consistent with step 2);
[0204] 16) Conduct multiple simulation experiments and record the corresponding trajectories e = 2, ..., N;
[0205] 17) Calculate all trajectory gradients and add all gradients to update network weights for policy network and parallel graph attention layers;
[0206] 18) Iteration number plus 1, return to step 14).
[0207] 19) Initialize time step as 1, return to step 2).
[0208] 20) All workloads have been successfully scheduled, end. If there is a new workload request to the cluster, return to step 1).
[0209] Embodiment 3:
[0210] The time-varying workload scheduling method based on priority and resource perception, the technical content is the same as embodiment 2, further, the cloud server cluster includes J servers, denoted as {s1,...,s j ,...,s J};
[0211] Each server has D resource dimensions;
[0212] For each server s j , the resource capacity in the resource dimension d is heterogeneous, denoted as c j,d ;
[0213] At time step t, the available resource amount of the server in the resource dimension d is represented as
[0214] Embodiment 4:
[0215] The time-varying workload scheduling method based on priority and resource perception, the technical content is the same as any one of embodiments 2-3, further, the time-varying resource demand of the workload w i ∈W in the set of workloads W to be scheduled is defined as wherein represents the number of resources requested across D dimensions at the lth execution time step.
[0216] Embodiment 5:
[0217] The time-varying workload scheduling method based on priority and resource perception, the technical content is the same as any one of embodiments 2-4, further, the construction steps of the classifier f c are as follows:
[0218] a1) Collect a set of historical workloads from the cluster historical trajectory;
[0219] a2) Calculate the distance measure between different workloads using the dynamic time warping algorithm;
[0220] where w i is the distance metric between workloads w g .
[0221]
[0222] where, is the time-varying resource requirement of workload w i and w g .
[0223] a3) clustering workloads using density-based clustering algorithm according to the distance metric, generating C equivalence classes; wherein density-connected workloads form an equivalence class;
[0224] a4) training a classifier f c using workloads and corresponding class labels as training data.
[0225] Embodiment 6:
[0226] The time-varying workload scheduling method based on priority and resource awareness, the technical content of any one of embodiments 2-5, further, the method for generating C equivalence classes is:
[0227] For workload w i , if it contains at least minPts workloads within the neighborhood, then workload w i is a core point;
[0228] If workload w i is a core point and then the path from w i to w g is directly density reachable; ∈ is a preset distance threshold;
[0229] Given core points w i , w g , w e , if the paths from w i to w g and from w g to w e are both directly density reachable, then the path from w i to w e is density reachable;
[0230] If a core point makes the paths from w g to w i and w g to w e density reachable, then w i and w eis defined as density connected.
[0231] Embodiment 7:
[0232] The priority and resource-aware time-varying workload scheduling method according to any one of embodiments 2-6, further, the score q of the workload w i is calculated as follows: i
[0233]
[0234] wherein a1, a2, a3 are constants, controlling the importance of different components to the score; denotes the available resource amount of resource dimension d at time step t; j for server s denotes the resource amount requested by workload w i in resource dimension d at the first execution time step; t denotes the current time step; t i denotes the resource amount requested by workload w i at time step t i arriving at the cluster; denotes the number of workloads belonging to class c i currently running in the cluster; I() = 0, 1 is an indicator function; B(t) denotes the servers running in the cluster at time step t.
[0235] Embodiment 8:
[0236] The priority and resource-aware time-varying workload scheduling method according to any one of embodiments 2-7, further, the step of extracting the hidden state S C of the server cluster includes:
[0237] b1) extracting advanced features v j from the resource usage time series of each server s j , i.e.
[0238] v j = conv(o j ) (4)
[0239] wherein M is the number of historical time steps read by the server; horizontal pixels denote the resource utilization state within server s j ;
[0240] b2) capturing advanced features V = [v1,..., v j ,..., v J The relationship between adjacent nodes is obtained, and a dimensional graph attention state h feat ;
[0241] The time sequence dependency in the high-level feature is captured by using a time-oriented parallel graph attention layer, and a time sequence graph attention state h time ;
[0242] The dimensional graph attention state h feat is as follows:
[0243] h feat = [h 1 ,...,h j ,...,h J ](5)
[0244]
[0245] In the formula, σ represents an s-type activation function, and α jg is an attention score, represents a set of adjacent nodes of node j;
[0246] The attention score α jg is as follows:
[0247]
[0248]
[0249] The time sequence graph attention state h time is as follows:
[0250] h time = [h 1 ,...,h m ,...,h M ](9)
[0251]
[0252] In the formula, α mp is an attention score;
[0253] b3) connecting the dimensional graph attention state h feat and the time sequence graph attention state h time to obtain a feature matrix; then, inputting the feature matrix into a gated recurrent unit to obtain a hidden state S C of the server cluster, that is:
[0254]
[0255] In the formula, GRU represents a gated recurrent unit.
[0256] Example 9:
[0257] The time-varying workload scheduling method based on priority and resource awareness, the technical content of any one of embodiments 2-8, further, the scheduling action A t The action space is A t = j indicates that the first workload in the priority queue is assigned to the jth server; Indicates an "invalid" action, indicating that the scheduler refuses to schedule this workload in the current time step.
[0258] Example 10:
[0259] The time-varying workload scheduling method based on priority and resource awareness, the technical content of any one of embodiments 2-9, further, the reward R t = -P C -P U -P W ;
[0260] Where, the resource contention penalty P C As follows:
[0261]
[0262] In the formula, K c is a constant, which determines the weight of the resource contention penalty;
[0263] Where, the contention score C j (s r ,d) related to server s j in the cross-resource dimension d is as follows:
[0264]
[0265] Where, s j,W represents the set of workloads running on server s j , r i,d is a vector representing the resource usage time series of workload w j on server s i along d;
[0266] The underutilization penalty P U As follows:
[0267]
[0268] Where, the constant term K u is a scale coefficient;
[0269] The latency penalty P W As follows:
[0270] P W = K w |W|(15)
[0271] where K w is a constant; |W| represents the total number of workloads to be scheduled within the cluster.
[0272] Embodiment 11:
[0273] The time-varying workload scheduling method based on priority and resource awareness, the technical content of any one of embodiments 2-10, further, the step of calculating all trajectory gradients comprises:
[0274] c1) constructing a trajectory expression, that is:
[0275]
[0276] c2) calculating the cumulative reward of each step in all trajectories, that is:
[0277]
[0278] where γ is a decay factor for calculating the cumulative reward.
[0279] c3) calculating the baseline according to the cumulative reward of each step in all trajectories, that is:
[0280]
[0281] c4) calculating the gradient of all trajectories according to the baseline, that is:
[0282]
[0283] where α is the learning rate.
[0284] Embodiment 12:
[0285] The time-varying workload scheduling method based on priority and resource awareness, the steps are as follows:
[0286] 1) Obtain the cloud server cluster state and the workload W to be scheduled as input. The cloud server cluster {s1,...,s j ,...,s J} represents a cluster composed of J servers, each server has D resource dimensions such as CPU, memory, etc. For each server s j , the resource capacity in resource dimension d is heterogeneous, denoted as c j,d ; at time step t, the available resource amount in resource dimension d is denoted as For the workload w arriving at the cluster at time step t i i ∈W, it requests n i The execution time step, the corresponding time-varying resource demand can be defined as where represents the number of resources requested across D dimensions at the lth execution time step.
[0287] 2) Determine whether W has been successfully scheduled, if yes, go to step 23), otherwise go to step 3).
[0288] 3) Determine whether the preset time step threshold T is reached, if yes, go to step 14), otherwise go to step 4).
[0289] 4) Use a classifier f c The equivalent class mapping of the workloads in W helps the scheduler to distinguish and learn the resource usage characteristics between different workloads according to the generated class labels.
[0290] 4.1) In order to train f c offline, a set of workloads is collected from the historical trajectories of the cluster. Then, the distance metric between workloads is calculated using the Dynamic Time Warping (DTW) algorithm. The distance metric between workloads w i and w g is calculated as follows:
[0291]
[0292] The recursive formula of the calculation is as follows:
[0293]
[0294] where
[0295] 4.2) Then, the Density-Based Spatial Clustering of Applications with Noise (DBSCAN) algorithm is applied to generate C equivalent classes. The algorithm requires two parameters: ∈ and minPts. For each workload w i , if it contains at least minPts workloads in its ∈ neighborhood, it is designated as a core point. First, if w i is a core point and , it is considered that the path from w i to w g is directly density reachable. Second, given core points w i , w g , w e , if from wi to w g and from w g to w e are directly density reachable, then the path from w i to w e is considered density reachable. Third, if a core point makes w g to w i and w g to w e density reachable, then w i and w e are defined as density connected. Finally, all density connected points form an equivalence class. After the equivalence classes are established, all workloads and their respective class labels are used as training data for the classifier f c .
[0296] 4.3) In the scheduling process, the classifier f c receives a new workload and assigns a label c i to generate a refined representation of the workload:
[0297]
[0298] where
[0299] 5) At each time step t, a queue scorer is used to evaluate the workloads in W and rank each workload based on four key parameters: the dominant resource available on all servers in the cluster, the dominant resource required by the workload, the class to which the workload is assigned, and the waiting time. The score q i of a workload w i is computed as follows:
[0300]
[0301] The first term in the equation indicates whether the resource dimension d with the most free resources in the cluster corresponds to the dominant resource required by the workload. If a match is established, the indicator function Ι() returns a value of 1, otherwise 0, B(t) represents the servers that are running in the cluster at time step t. The variable N ci represents the number of workloads belonging to class c i that are currently running in the cluster.
[0302] 6) The top K workloads with the highest scores are selected and a priority queue state matrix S Q ∈ Z K×(1+D) is constructed, where the first column is the assigned label and the subsequent D columns represent the required resources of the top scoring workloads.
[0303] 7) In order to effectively perceive the dimensionality and temporal characteristics of resources in the server, a parallel graph attention (GAT) layer was designed, and the features of each server were treated as a node in the graph.
[0304] 7.1) First, one-dimensional convolution is used to extract data from each server s. j Extracting high-level features v from resource usage time series j :
[0305] v j =conv(o j ),
[0306] in M is the number of historical time steps that the server can read, in horizontal pixels. Indicates server s j The state of resource utilization within the area.
[0307] 7.2) Then V = [v1,...,v j ,...,v J Processed by two GAT layers, the dimension-oriented GAT layer treats it as a complete graph, where each node represents a single server feature v. j Each edge represents a relationship between corresponding servers. In this way, graph attention operations can be used to precisely capture the relationships between adjacent nodes. Specifically, each node v... j Given an ordered vector v j =[v j,1 ,...,v j,m ,...,v j,M The diagram shows that there are J nodes in total, and the resulting attention state of the dimensional graph is:
[0308] h feat =[h 1 ,...,h j ,...,h J ],
[0309]
[0310] Where σ represents the sigmoid activation function, α jg It is the attention score, which measures the contribution of node g to node j. Let represent the set of neighboring nodes of node j. Attention score α. jg It can be calculated as:
[0311]
[0312] 7.3) Meanwhile, a time-oriented GAT layer is utilized to capture the temporal dependency in the time series. Specifically, a node v m = [v m,1 ,...,v m,j ,...,v m,J ] represents a feature vector at time step m, whose neighboring nodes contain all other time steps within the current sliding window. All nodes are modeled by a fully connected self-attention operation:
[0313] h time = [h 1 ,...,h m ,...,h M ],
[0314]
[0315] The computation of a mp is similar to the dimension-oriented GAT layer.
[0316] 7.4) Finally, the outputs from the two parallel GAT layers are concatenated to obtain a M x 3J matrix, where each row represents a 3J-dimensional feature vector at each time step. Then, the matrix is input into a Gated Recurrent Unit (GRU) layer, which is designed to capture the main sequential patterns. The output of the GRU layer represents the hidden state S C of the server cluster:
[0317]
[0318] 8) The state S C of the cluster and the state S Q of the priority queue are concatenated to form the final state S t at time step t.
[0319] 9) The reinforcement learning-based policy network receives the final state S t as input and generates a scheduling action A t according to its own policy. The action space is A t = j represents assigning the first workload in the priority queue to the jth server; represents the "invalid" action, indicating that the scheduler refuses to schedule the workload at the current time step.
[0320] 10) Determine whether the scheduling action is valid. If it is, go to step 11); otherwise, go to step 13).
[0321] 11) Schedule the workload at the head of the priority queue to action A t the designated server.
[0322] 12) Final state S t transition to The cluster environment according to generate a reward R t which consists of three parts:
[0323] 12.1) Resource contention penalty:
[0324]
[0325] Specifically, C r (s j ,d) represents the contention score associated with server s j across resource dimension d, which is calculated as:
[0326]
[0327] where W j,W denotes the set of workloads running on server s j , r i,d is a vector representing the time series of resource usage of workload w j along d on server s i . K c is a constant determining the weight of the resource contention penalty.
[0328] 12.2) Underutilization penalty:
[0329]
[0330] where the constant term K u serves as a scaling factor, which is exponential here.
[0331] 12.3) Latency penalty:
[0332] P W = K w *|W|.
[0333] K w is a constant and |W| represents the total number of workloads waiting to be scheduled within the cluster.
[0334] Finally, the reward R t can be represented as: R t = -P C -P U -P W . The scheduling process is considered as a trajectory e = 1, and the following is recorded (S t , At ,R t (Original, return to step 5).
[0335] 13) Increment the time step by 1, and put all newly incoming workload requests into W, then return to step 3).
[0336] 14) Determine if the preset number of training iterations has been reached. If yes, proceed to step 22); otherwise, proceed to step 15.
[0337] 15) Initialize the cloud server cluster status and workload requests to be consistent with those in step 2).
[0338] 16) Conduct multiple simulation experiments and record the corresponding trajectories e = 2, ..., N, where each trajectory is represented as:
[0339]
[0340] 17) Calculate the cumulative reward for each step across all trajectories:
[0341]
[0342] Where γ is the decay factor, used to calculate the cumulative reward.
[0343] 18) Calculate the baseline based on the cumulative reward for each step across all trajectories:
[0344]
[0345] 19) Calculate the gradient of all trajectories based on the baseline:
[0346]
[0347] 20) Sum all the gradients obtained and update the network weights of the policy network and the parallel GAT layer.
[0348] 21) Increment the iteration count by 1, then return to step 14).
[0349] 22) Initialize the time step to 1, then return to step 2).
[0350] 23) All workloads have been successfully scheduled. End. If new workload requests arrive at the cluster, return to step 1).
Claims
1. A time-varying workload scheduling method based on priority and resource awareness, characterized in that, Includes the following steps: 1) Obtain the cloud server cluster status and the set of workloads W that need to be scheduled; 2) Determine whether the workload set W has been successfully scheduled. If yes, proceed to step 20); otherwise, proceed to step 3. 3) Determine whether the preset time step threshold T has been reached. If yes, proceed to step 14); otherwise, proceed to step 4. 4) Using classifier f c For the current workload w i Assign label c i ; 5) Use a queue scorer to evaluate the workload in W and obtain a workload score. 6) Construct a priority queue state matrix S using the top K workloads with the highest scores. Q ∈Z K×(1+D) ; where, priority queue state matrix S Q ∈Z K×(1+D) The first column is the assigned label, and the other D columns represent the resources required for the workload; 7) Extract the hidden state S of the server cluster using a parallel graph attention layer and gated recurrent units. C ; 8) Hidden state S of the connected server cluster C Priority queue state matrix S Q The final state S is formed at time step t. t ; 9) Set the final state S t The input is fed into a reinforcement learning-based policy network, and the output is a scheduling action A. t ; 10) Determine if the scheduling action is valid. If it is, proceed to step 11); otherwise, proceed to step 13. 11) Schedule the workload at the head of the priority queue to action A. t In the specified server; 12) Set the final state S t Transfer to Cluster environment based on Generate reward R t The scheduling process is treated as a trajectory e=1, and (S) is recorded. t A t ,R t ) tuple, return to step 5); 13) Increment the time step by 1, and put all new workload requests that will be sent to the cluster into W, then return to step 3); 14) Determine whether the preset number of training iterations has been reached. If yes, proceed to step 19); otherwise, proceed to step 15. 15) Initialize the cloud server cluster status and workload requests, keeping them consistent with step 2); 16) Conduct multiple simulation experiments and record the corresponding trajectories e = 2, ..., N; 17) Calculate the gradients of all trajectories and sum them to update the network weights of the policy network and the parallel graph attention layer; 18) Increment the iteration count by 1, then return to step 14); 19) Initialize the time step to 1, then return to step 2); 20) All workloads have been successfully scheduled, end; if new workload requests arrive at the cluster, return to step 1).
2. The time-varying workload scheduling method based on priority and resource awareness according to claim 1, characterized in that, The cloud server cluster consists of J servers, denoted as {s1,...,s...} j ,...,s J }; Each server has D resource dimensions; For each server s j The resource capacity along the resource dimension d is heterogeneous, denoted as c. j,d ; At time step t, the amount of available resources on resource dimension d of the server is represented as follows:
3. The time-varying workload scheduling method based on priority and resource awareness according to claim 1, characterized in that, The workload set W that needs to be scheduled contains workloads w i The time-varying resource requirement of ∈W is defined as in This represents the number of resources requested across D dimensions at the l-th execution time step; n i Indicates the execution time step.
4. The time-varying workload scheduling method based on priority and resource awareness according to claim 1, characterized in that, Classifier f c The construction steps are as follows: 1) Collect a set of historical workloads from the cluster's historical trajectory; 2) Calculate the distance metric between different workloads using the dynamic time warping algorithm; Among them, workload w i and w g Distance metric between As shown below: Among them, parameters For workload w i and w g Time-varying resource requirements; For time-varying resource demand The minimum distance metric between them; For time-varying resource demand The minimum distance metric between them; For time-varying resource demand The minimum distance metric between them; For time-varying resource demand The minimum distance metric between them; For time-varying resource demands; 3) Based on the distance metric, the workloads are clustered using a density-based clustering algorithm to generate C equivalence classes; where workloads that are density-connected form an equivalence class. 4) Using workload and corresponding class labels as training data, a classifier f is trained. c .
5. The time-varying workload scheduling method based on priority and resource awareness according to claim 4, characterized in that, The method for generating the C equivalence class is as follows: For workload w i If its neighborhood contains at least minPts workloads, then the workload w i As a core point; If the workload w i It is the core point and Then it is believed that from w i to w g The path is directly density-reachable; ∈ is a preset distance threshold; Given the core point w i ,w g ,w e If w i to w g and from w g to w e If all paths are directly density-reachable, then w i to w e The path is density-reachable; If a core point makes from w g to w i w g to w e If density is achievable, then w i and w e It is defined as density connected.
6. The time-varying workload scheduling method based on priority and resource awareness according to claim 1, characterized in that... Workload w i The fraction q i As shown below: In the formula, α1, α2, and α3 are constants that control the importance of different components to the fraction; This indicates that at time step t, server s j The amount of available resources in resource dimension d; Indicates workload w i The number of resources requested in resource dimension d at the first execution time step; t represents the current time step; t i Indicates workload w i At time step t i Arrive at the cluster; This indicates that the class currently running in the cluster belongs to c. i The number of workloads; I() = 0, 1 is the indicator function; B(t) represents the servers running in the cluster at time step t.
7. The time-varying workload scheduling method based on priority and resource awareness according to claim 1, characterized in that, Extracting the hidden state S of the server cluster using a parallel graph attention layer and gated recurrent units. C The steps include: 1) Utilize one-dimensional convolution from each server s j Extracting high-level features v from resource usage time series j ,Right now: v j =conv(o j ) (4) Among them, parameters M is the number of historical time steps read by the server, in horizontal pixels. Indicates server s j The resource utilization status within; conv() represents the convolution operation; 2) Capture high-level features V = [v1,...,v] using a dimension-oriented parallel graph attention layer. j ,...,v J The relationship between adjacent nodes in the graph is used to obtain the attention state h of the dimensional graph. feat ; Temporal dependencies in high-level features are captured using a time-oriented parallel graph attention layer, resulting in the temporal graph attention state h. time ; Among them, the attention state h of the dimension graph feat As shown below: h feat =[h 1 ,...,h j ,...,h J ](5) In the formula, σ represents the sigmoid activation function, and α jg It is the attention score. Represents the set of neighboring nodes of node j; h j Let v be the attention state of node j; g Advanced features; Attention score α jg As shown below: In the formula, LeakeyReLU represents the activation function; ω represents the weight parameter; v j v g For advanced features; e jg Intermediate parameter; intermediate parameter Timing diagram attention state h time As shown below: h time =[h 1 ,...,h m ,...,h M ](9) In the formula, α mp Attention score; 3) Connection dimension graph attention state h feat Attention state h in sequence diagram time The feature matrix is obtained; then, the feature matrix is input into the gated loop unit to obtain the hidden state S of the server cluster. C ,Right now: In the formula, GRU represents a gated loop unit.
8. The time-varying workload scheduling method based on priority and resource awareness according to claim 1, characterized in that, Scheduling action A t The action space is A t =j means that the first workload in the priority queue is assigned to the j-th server; This indicates an "invalid" action, meaning the scheduler refuses to schedule the workload in the current time step.
9. The time-varying workload scheduling method based on priority and resource awareness according to claim 1, characterized in that, Reward R t =-P C -P U -P W ; Among them, resource contention penalty P C As shown below: In the formula, K c This is a constant that determines the weight of the resource contention penalty; Among them, the cross-resource dimension d and server s j The relevant competition score C r (s j ,d) is shown below: Among them, s j,W Indicates in server s j The set of workloads running on r i,d Indicates server s j On workload w i Resource usage time series along d; r g,d Indicates workload w g Resource usage time series along d; Punish P for Insufficiency U As shown below: Among them, the constant term K u This is the scaling factor; Waiting time penalty P W As shown below: P W =K w *|W|(15) Among them, K w It is a constant; |W| represents the total number of workloads to be scheduled within the cluster.
10. The time-varying workload scheduling method based on priority and resource awareness according to claim 1, characterized in that, The steps for calculating the gradients of all trajectories include: 1) Construct the trajectory expression, that is: In the formula, trace e Represents the trajectory; Indicates the time step T e Corresponding status, action, and reward; 2) Calculate the cumulative reward for each step in all trajectories. Right now: Where γ is the decay factor; the time step x = t, ..., T e ; This represents the reward corresponding to time step x. 3) Calculate the baseline z based on the cumulative reward for each step across all trajectories. t ,Right now: In the formula, N is the number of trajectories; 4) Calculate the gradient Δθ of all trajectories based on the baseline, i.e.: In the formula, α is the learning rate.
Citation Information
Patent Citations
Docker cloud platform based dynamic-priority-queue-feedback load-balanced resource scheduling method
CN106790726A
Adaptive configuration method for short-time variable big data job cluster scheduling
CN110737529A