Load-aware scheduling method based on deep learning
Through deep learning models, predict load changes and dynamically adjust resource allocation, the problem that traditional scheduling strategies are difficult to adapt to load changes is solved, computing resource utilization efficiency and system stability are improved, and it is suitable for a variety of cloud computing environments.
Patent Information
- Application Number
- CN202411083108.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-12-03
AI Technical Summary
Traditional static resource scheduling strategies are difficult to adapt to the dynamic changes in computing resource load, resulting in waste or insufficient resources. How to achieve accurate prediction and intelligent scheduling of system load has become an urgent problem.
Using a load-aware scheduling method based on deep learning, predict system load changes by building a recurrent neural network model, and dynamically adjust resource allocation based on the prediction results, including collecting historical load data, building deep learning models, training models to optimize loss functions, and formulating scheduling Strategy to increase or decrease resource allocation.
It realizes accurate prediction and intelligent scheduling of system load, improves the utilization efficiency of computing resources and system stability, has good universality and scalability, and is suitable for cloud computing environments of different scales and types.
Smart Images

Figure CN119065835A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computing resource scheduling methods, and in particular to a load-aware scheduling method and scheduling system based on deep learning. Background Art
[0002] With the rapid development of technologies such as cloud computing, big data, and the Internet of Things, the load of computing resources has become dynamic and changeable. Traditional static resource scheduling strategies are often difficult to adapt to such changes, which can easily lead to waste or shortage of resources. Therefore, how to accurately predict load changes and formulate efficient scheduling strategies based on them has become a problem that needs to be solved urgently. Summary of the invention
[0003] In order to solve the problem that traditional static resource scheduling strategies are difficult to adapt to the dynamic and changeable characteristics of computing resource loads, realize accurate prediction and intelligent scheduling of system loads, and improve the utilization efficiency of computing resources and the stability of the system, the present invention proposes a new load-aware scheduling method based on deep learning.
[0004] In general, the present invention designs a load-aware scheduling strategy based on deep learning, which predicts changes in system load through a deep learning model and intelligently adjusts resource allocation based on the prediction results. The method of the present invention has good versatility and scalability and can be applied to cloud computing environments of different scales and types. The construction of the model of the present invention, the algorithm formula for load prediction, and the specific implementation of the scheduling strategy will be described in detail below, and an implementation example on a Kubernetes cluster is provided to verify the effectiveness and feasibility of the method of the present invention.
[0005] Specifically, the present invention provides a load-aware scheduling method based on deep learning, which includes the following processes:
[0006] 1. Construction of Deep Learning Model and Load Forecasting
[0007] The present invention uses deep learning technology to construct a model for load prediction. The model uses a recurrent neural network (RNN) or its variants (such as LSTM, GRU, etc.) to capture the temporal dependency of load data.
[0008] Assume that the historical load data is a time series (X = x1, x2, ..., x T ), where x T represents the load value at time T. The goal of load forecasting is to predict the load value x at a future time T+k based on historical data. T+k .
[0009] The training process of a deep learning model can be expressed as optimizing the following loss function:
[0010]
[0011] Among them, L(θ) is the mean square error loss function, which is used to measure the deviation between the model prediction value and the actual load value; the data at k moments is a time window for model training, and the mean square error loss of the mean square error loss function L(θ) at k moments is calculated; f(X t:t+n-1 ; θ) represents the model according to the load sequence X with length n t:t+n-1 and model parameters θ to predict future load x t+n Function of; sequence X t:t+n-1 represents the load sequence with a length of n at time t. The uppercase X represents the load sequence, and the lowercase x represents each load. The sequence length is n. The load function f(X t:t+n-1 ; θ) uses the first n-1 loads at time t, so the subscript starts from t and ends at t+n-1, and the model parameter θ is a tensor.
[0012] Through optimization methods such as back propagation algorithm and gradient descent, the optimal solution of model parameter θ can be obtained to minimize the loss function L(θ). After training, the model can be used for load forecasting.
[0013] 2. Scheduling Strategy Formulation Based on Load Forecast Results
[0014] According to the load prediction results of the deep learning model, the present invention develops an intelligent scheduling strategy, which dynamically adjusts the allocation of resources according to factors such as predicted load, current resource utilization, and system resource limitations.
[0015] Assume that the resource utilization of the system at the current moment is R t , the resource adjustment thresholds are α and β (α<β), and the specific method of formulating the scheduling strategy is as follows:
[0016] 1. When forecasting load Higher than the current load x t And the current resource utilization R t When it is lower than the resource adjustment threshold α, it means that the future load will increase and the current resources are sufficient. At this time, the scheduler should increase resource allocation to meet the upcoming computing needs. The amount of resource increase can be calculated based on the predicted load increase and the availability of system resources.
[0017] 2. When predicting load Lower than the current load x t And the current resource utilization R tWhen it is higher than the resource adjustment threshold β, it means that the future load will decrease and the current resource utilization is high. At this time, the scheduler should reduce resource allocation to avoid resource waste. The amount of resource reduction can be determined based on the predicted load reduction and the importance of the currently running task.
[0018] 3. In other cases, keep the current resource allocation unchanged.
[0019] In a first aspect, the present invention provides a load-aware scheduling method based on deep learning, such as Figure 1 As shown, the method comprises the following steps:
[0020] S1. Collect historical load data from data sources, organize the collected historical load data in time series, generate a time series data set, and normalize it;
[0021] S2. Build a deep learning model for load forecasting, which uses a recurrent neural network or its variants to capture the temporal dependencies of load data;
[0022] S3. Use the deep learning model built in the previous step to predict the system load and predict the load value at a certain moment in the future based on the historical load data;
[0023] S4. Develop a scheduling strategy based on the load prediction results of the deep learning model, the current resource utilization, and the system resource constraints, and dynamically adjust resource allocation based on the strategy.
[0024] Furthermore, the historical load data collected in step S1 of the load-aware scheduling method based on deep learning of the present invention includes but is not limited to: CPU usage, memory occupancy, network bandwidth occupancy, and processing task queue length.
[0025] Furthermore, the recurrent neural network described in step S2 of the load-aware scheduling method based on deep learning of the present invention is RNN, and its variants include but are not limited to: LSTM (long short-term memory network) and GRU (gated recurrent unit).
[0026] Furthermore, in the load-aware scheduling method based on deep learning of the present invention, when LSTM is selected as the basic architecture of the deep learning model, the constructed deep learning model includes an input layer, multiple LSTM layers, a fully connected layer and an output layer, wherein:
[0027] The input layer receives a fixed-length sequence of historical payloads;
[0028] The LSTM layer is responsible for extracting features from the historical load sequence;
[0029] The fully connected layer maps the features in the historical load sequence to the predicted values;
[0030] The output layer outputs the load forecast value at a certain moment in the future.
[0031] Furthermore, the training process of the deep learning model constructed in step S2 of the load-aware scheduling method based on deep learning of the present invention is expressed as optimizing the following loss function:
[0032]
[0033] Among them, L(θ) is the mean square error (MSE) loss function, which is used to measure the deviation between the model prediction value and the actual load value; the data at k moments is a time window for model training, and the mean square error loss of the mean square error loss function L(θ) at k moments is calculated; f(X t:t+n-1 ; θ) represents the model according to the load sequence X with length n t:t+n-1 and model parameters θ to predict future load x t+n Function of; sequence X t:t+n-1 represents the load sequence with a length of n at time t. The uppercase X represents the load sequence, and the lowercase x represents each load. The sequence length is n. The load function f(X t:t+n-1 ; θ) uses the first n-1 loads at time t, so the subscript starts from t and ends at t+n-1, and the model parameter θ is a tensor;
[0034] The Adam optimizer is used to optimize the parameters, and the model weights are adjusted through the back propagation algorithm to obtain the optimal solution of the model parameter θ, so that the loss function L(θ) is minimized;
[0035] The preprocessed historical load data is divided into a training set and a validation set. The model is trained using the training set data, and the model performance is evaluated using the validation set data. The training is iterated until the model achieves stable performance on the validation set.
[0036] Furthermore, the current resource utilization described in step S4 of the load-aware scheduling method based on deep learning of the present invention includes but is not limited to: CPU utilization, memory utilization, and network bandwidth utilization;
[0037] The system resource limiting factor refers to a preset resource adjustment threshold.
[0038] Furthermore, the scheduling strategy formulated in step S4 of the load-aware scheduling method based on deep learning of the present invention is as follows:
[0039] (1) Increase resource allocation: When it is predicted that the load at a certain time in the future will be higher than the current load and the current resource utilization rate is lower than the lower limit of the resource adjustment threshold, the scheduling system starts the resource increase process and dynamically increases computing nodes or expands the resources of existing nodes based on the predicted load increase and the availability of system resources;
[0040] (2) Reduce resource allocation: When it is predicted that the load at a certain time in the future will be lower than the current load and the current resource utilization is higher than the upper limit of the resource adjustment threshold, the scheduling system starts the resource reduction process to reduce unnecessary resource usage based on the predicted load reduction and the importance of the currently running tasks (such as evaluating and migrating low-priority tasks to other nodes, shutting down idle nodes, and releasing underutilized CPU and memory resources).
[0041] (3) Maintaining the status quo: In other cases, that is, when the predicted load is close to the current load or the resource utilization is between the upper and lower limits of the resource adjustment threshold, the scheduling system maintains the current resource allocation unchanged, continues to monitor and prepares to make corresponding adjustments based on new prediction results or actual load changes.
[0042] In a second aspect, the present invention further provides a load-aware scheduling system based on deep learning. When the system is running, the steps of the load-aware scheduling method based on deep learning are implemented, such as Figure 2 As shown, the system includes:
[0043] Data collection module, used to collect system historical load data;
[0044] Deep learning model module, used to build and train deep learning models for system load prediction;
[0045] The scheduling decision module formulates resource scheduling strategies based on the prediction results of the deep learning model and the current resource utilization rate;
[0046] The execution module allocates and adjusts resources according to the resource scheduling strategy formulated by the scheduling decision module.
[0047] In addition, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the above-mentioned deep learning-based load-aware scheduling method are implemented.
[0048] In summary, the load-aware scheduling method based on deep learning in the present invention has the following advantages:
[0049] (1) The dynamic resource scheduling method of the present invention can well adapt to the dynamic and changeable characteristics of computing resource load, realize accurate prediction and intelligent scheduling of system load, and improve the utilization efficiency of computing resources and the stability of the system.
[0050] (2) The method of the present invention has good versatility and scalability and can be applied to cloud computing environments of different scales and types.
[0051] (3) The effectiveness and feasibility of the method of the present invention are fully verified through the implementation example on the Kubernetes cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the description of the present invention. Obviously, the following drawings are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0053] Figure 1 This is a flow chart for implementing the load-aware scheduling method based on deep learning of the present invention.
[0054] Figure 2 This is a schematic diagram of the composition architecture of the load-aware scheduling system based on deep learning of the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with specific embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, and the present invention can also be implemented or applied through other different specific implementation methods. The details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.
[0056] At the same time, it should be understood that the protection scope of the present invention is not limited to the specific embodiments described below; it should also be understood that the terms used in the embodiments of the present invention are for describing specific embodiments rather than for limiting the protection scope of the present invention.
[0057] Embodiment: A load-aware scheduling method based on deep learning (using Kubernetes cluster as an example)
[0058] 1. Scenario Description
[0059] This embodiment relates to a cloud video processing platform that integrates multiple services such as video transcoding, editing, and analysis to serve a large number of users and video content creators who are online at the same time. With the continuous increase in the number of users and video processing needs, the platform faces problems such as uneven resource allocation, performance bottlenecks during peak hours, and low resource utilization. In order to solve these problems, the present invention combines a deep learning model with an intelligent scheduling strategy and applies it to the resource management of the cloud video processing platform.
[0060] 2. Construction of Deep Learning Model and Load Forecasting
[0061] 1. Data collection and preprocessing
[0062] Data source: Collect historical load data from the monitoring system of the cloud video processing platform, including key indicators such as CPU usage, memory usage, network bandwidth usage, and video processing task queue length.
[0063] Data preprocessing: The collected data is organized into time series to generate a time series data set, and normalized to eliminate the impact of different dimensions on model training.
[0064] 2. Model selection and construction
[0065] Model selection: Given the time series characteristics of load data, LSTM (Long Short-Term Memory Network) is selected as the basic architecture of the deep learning model. LSTM can effectively capture the long-term dependencies in time series data and is suitable for load forecasting.
[0066] Model construction: Build an LSTM model that includes an input layer, multiple LSTM layers, a fully connected layer, and an output layer. The input layer receives a fixed-length historical load sequence, the LSTM layer is responsible for extracting features from the sequence, the fully connected layer maps the features to predicted values, and the output layer outputs the load prediction value at a certain moment in the future.
[0067] 3. Model training
[0068] Loss function: Mean square error (MSE) is used as the loss function to measure the deviation between the model prediction value and the actual load value.
[0069] Optimization algorithm: Use Adam optimizer for parameter optimization and adjust model weights through back propagation algorithm to minimize the loss function.
[0070] Training process: Divide the preprocessed historical load data into a training set and a validation set, use the training set data to train the model, and use the validation set data to evaluate the model performance. Iterate the training until the model achieves stable performance on the validation set.
[0071] 4. Model deployment
[0072] The trained LSTM model is deployed to the scheduling system of the cloud video processing platform as a load prediction component.
[0073] The core code of this part is as follows:
[0074] 1. Data preprocessing
[0075] function preprocessData(LoadHistory):
[0076] / / Preprocessing steps such as data normalization, division of training set and validation set
[0077] normalizedData = normalize(LoadHistory)
[0078] trainData, validData = splitData(normalizedData)
[0079] return trainData, validData
[0080] 2. Model Construction
[0081] function buildModel():
[0082] model = new LSTMModel()
[0083] model.addInputLayer(inputSize)
[0084] for _ in range(numLayers):
[0085] model.addLSTMLayer(hiddenSize)
[0086] model.addDenseLayer(outputSize)
[0087] model.compile(optimizer = 'adam', loss ='mse')
[0088] return model
[0089] 3. Model Training
[0090] function trainModel(model, trainData, validData):
[0091] model.fit(trainData.inputs, trainData.targets, epochs = numEpochs, validation_data = validData)
[0092] return model
[0093] 4. Model Prediction
[0094] function predictLoad(model, inputSequence):
[0095] predictedLoad=model.predict(inputSequence)
[0096] return predictedLoad
[0097] 5. Calling process
[0098] trainData,validData=preprocessData(LoadHistory)
[0099] model = buildModel()
[0100] trainedModel=trainModel(model,trainData,validData)
[0101] predictedFutureLoad=predictLoad(trainedModel,newInputSequence)
[0102] 3. Scheduling Strategy Development Based on Load Forecast Results
[0103] 1. Resource utilization monitoring
[0104] Monitor the resource utilization (CPU, memory, network bandwidth, etc.) of each node in the system in real time and compare it with the preset resource adjustment threshold (such as CPU utilization threshold L_low=50%, L_high=80%).
[0105] 2. Scheduling strategy implementation
[0106] (1) Increase resource allocation: When it is predicted that the load at a certain time in the future will be higher than the current load and the current resource utilization is lower than L_low, the scheduling system starts the resource increase process. Based on the predicted load increase and the availability of system resources, computing nodes are dynamically added or the resources of existing nodes are expanded (such as increasing the number of CPU cores, memory capacity, etc.) to meet the upcoming video processing needs.
[0107] Example: If 3:00 p.m. to 5:00 p.m. is predicted to be the peak period for video uploading, and the current resource utilization is less than 50%, then additional computing nodes are started in advance to ensure that the video processing tasks during the peak period can be successfully completed.
[0108] (2) Reduce resource allocation: When it is predicted that the future load will be lower than the current load and the current resource utilization is higher than L_high, the scheduling system starts the resource reduction process. According to the predicted load reduction and the importance of the current running task (such as giving priority to the video processing tasks of high-priority users), unnecessary resource usage is gradually reduced, such as shutting down idle nodes and releasing underutilized CPU and memory resources.
[0109] Example: If the demand for video processing is predicted to be low between 1am and 3am, and the current resource utilization is over 80%, evaluate and migrate low-priority tasks to other nodes, and shut down some idle nodes to save resources.
[0110] (3) Maintaining the status quo: In other cases, that is, when the predicted load is close to the current load or the resource utilization is between L_low and L_high, the scheduling system keeps the current resource allocation unchanged, continues to monitor and is ready to make corresponding adjustments based on new prediction results or actual load changes.
[0111] The core code of this part is as follows:
[0112] 1. Scheduling strategy implementation
[0113]
[0114] 2. Call prediction function and scheduling strategy
[0115] predictedFutureLoad=predictLoad(trainedModel,newInputSequence)
[0116] applySchedulingStrategy(predictedFutureLoad,currentResourceUtilization)
[0117] Through the implementation of the present invention, accurate prediction and intelligent scheduling of system load can be achieved, and the utilization efficiency of computing resources and the stability of the system can be improved. At the same time, the method of the present invention also has good versatility and scalability, and can be applied to cloud computing environments of different scales and types.
[0118] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any technician familiar with the profession can make some changes or modifications to the technical contents disclosed above without departing from the scope of the technical solution of the present invention to obtain equivalent embodiments of equivalent changes. However, any simple modification, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A load-aware scheduling method based on deep learning, characterized in that: The method comprises the following steps: S1. Collect historical load data from data sources, organize the collected historical load data in time series, generate a time series data set, and normalize it; S2. Build a deep learning model for load forecasting, which uses a recurrent neural network or its variants to capture the temporal dependencies of load data; S3. Use the deep learning model built in the previous step to predict the system load and predict the load value at a certain moment in the future based on the historical load data; S4. Develop a scheduling strategy based on the load prediction results of the deep learning model, the current resource utilization, and the system resource constraints, and dynamically adjust resource allocation based on the strategy.
2. The load-aware scheduling method based on deep learning according to claim 1 is characterized in that: The historical load data collected in step S1 includes: CPU usage, memory occupancy, network bandwidth occupancy, and processing task queue length.
3. The load-aware scheduling method based on deep learning according to claim 1 is characterized in that: The recurrent neural network described in step S2 is RNN, and its variants include: LSTM and GRU.
4. The load-aware scheduling method based on deep learning according to claim 3 is characterized in that: When LSTM is selected as the infrastructure of the deep learning model, the constructed deep learning model includes an input layer, multiple LSTM layers, a fully connected layer, and an output layer, where: The input layer receives a fixed-length sequence of historical payloads; The LSTM layer is responsible for extracting features from the historical load sequence; The fully connected layer maps the features in the historical load sequence to the predicted values; The output layer outputs the load forecast value at a certain moment in the future.
5. The load-aware scheduling method based on deep learning according to claim 1, characterized in that: The training process of the deep learning model constructed in step S2 is expressed as optimizing the following loss function: Among them, L(θ) is the mean square error loss function, which is used to measure the deviation between the model prediction value and the actual load value; the data at k moments is a time window for model training, and the mean square error loss of the mean square error loss function L(θ) at k moments is calculated; f(X t:t+n-1 ; θ) represents the model according to the load sequence X with length n t:t+n-1 and model parameters θ to predict future load x t+n Function of; sequence X t:t+n-1 represents the load sequence with a length of n at time t. The uppercase X represents the load sequence, and the lowercase x represents each load. The sequence length is n. The load function f(X t:t+n-1 ; θ) uses the first n-1 loads at time t, so the subscript starts from t and ends at t+n-1, and the model parameter θ is a tensor; The Adam optimizer is used to optimize the parameters, and the model weights are adjusted through the back propagation algorithm to obtain the optimal solution of the model parameter θ, so that the loss function L(θ) is minimized; The preprocessed historical load data is divided into a training set and a validation set. The model is trained using the training set data, and the model performance is evaluated using the validation set data. The training is iterated until the model achieves stable performance on the validation set.
6. The load-aware scheduling method based on deep learning according to claim 1, characterized in that: The current resource utilization described in step S4 includes: CPU utilization, memory utilization, and network bandwidth utilization; The system resource limiting factor refers to a preset resource adjustment threshold.
7. The load-aware scheduling method based on deep learning according to claim 1, characterized in that: The scheduling strategy formulated in step S4 is as follows: (1) Increase resource allocation: When it is predicted that the load at a certain time in the future will be higher than the current load and the current resource utilization rate is lower than the lower limit of the resource adjustment threshold, the scheduling system starts the resource increase process and dynamically increases computing nodes or expands the resources of existing nodes based on the predicted load increase and the availability of system resources; (2) Reduce resource allocation: When it is predicted that the load at a certain time in the future will be lower than the current load and the current resource utilization rate is higher than the upper limit of the resource adjustment threshold, the scheduling system starts the resource reduction process to reduce unnecessary resource usage based on the predicted load reduction and the importance of the current running task; (3) Maintaining the status quo: In other cases, that is, when the predicted load is close to the current load or the resource utilization is between the upper and lower limits of the resource adjustment threshold, the scheduling system maintains the current resource allocation unchanged, continues to monitor and prepares to make corresponding adjustments based on new prediction results or actual load changes.
8. A load-aware scheduling system based on deep learning, characterized in that: When the system is running, the steps of implementing the load-aware scheduling method based on deep learning according to any one of claims 1 to 7 are implemented, and the system includes: Data collection module, used to collect system historical load data; Deep learning model module, used to build and train deep learning models for system load prediction; The scheduling decision module formulates resource scheduling strategies based on the prediction results of the deep learning model and the current resource utilization rate; The execution module allocates and adjusts resources according to the resource scheduling strategy formulated by the scheduling decision module.
9. A computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of the deep learning-based load-aware scheduling method described in any one of claims 1 to 7.
Citation Information
Cited By
Method and system for expanding and shrinking capacity based on large model
CN119292796A
Heterogeneous resource intelligent allocation scheduling method and system based on deep learning
CN119883648A
Resource allocation method, storage medium, electronic equipment and program product
CN120066798A
PUCCH channel resource optimization method in 5G communication based on FPGA
CN120111674A
Resource scheduling method and system based on multi-dimensional load prediction
CN120256137A
