Cloud edge computing task scheduling method based on reinforcement learning

By adopting a task scheduling method based on reinforcement learning in the cloud edge computing environment, and using the attention mechanism and A3C-IW algorithm to optimize resource allocation, the problems of long response time, high energy consumption, and low resource utilization are solved and more efficient is achieved. resource utilization and service quality assurance.

CN118740835AActive Publication Date: 2024-10-01HENAN UNIV OF SCI & TECH

Patent Information

Application Number
CN202410926128.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-10-01
Estimated Expiration
2044-07-11

AI Technical Summary

Technical Problem

Existing cloud edge computing resource scheduling methods have limitations in the problems of long response time, high energy consumption, and low resource utilization, especially in dynamic cloud edge computing environments where it is difficult to ensure service quality.

Method used

Adopting a cloud edge computing task scheduling method based on reinforcement learning, through distributed deployment of reinforcement learning models, combined with the LSTM network of the attention mechanism and the improved A3C-IW reinforcement learning algorithm, a global optimal resource scheduling strategy is generated, and resource allocation is optimized to minimize Optimize response time and energy consumption while improving resource utilization.

Benefits of technology

It can effectively minimize response time and energy consumption while ensuring service quality, improve the utilization of cloud-edge resources, and adapt to the dynamically changing cloud-edge collaboration environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740835A_ABST
    Figure CN118740835A_ABST
Patent Text Reader

Abstract

The invention relates to a cloud-edge computing task scheduling method based on reinforcement learning in the technical field of combinatorial optimization in computer science, and the method comprises the steps: building a server queue and a task queue, building a system model based on a cloud-edge computing task scheduling optimization target, constructing an LSTM network model architecture based on an attention mechanism, and carrying out the optimization of a cloud-edge computing task. And according to attention weights of different tasks, outputting probability distribution of resource allocation, and then adopting an improved A3C-IW reinforcement learning algorithm and using an asynchronous strategy gradient method to obtain a task scheduling decision. And defining a reward function R of each step of reinforcement learning, and obtaining an optimal calculation task scheduling strategy for different reward task scheduling strategies. According to the method, the resource utilization rate and the service quality of the cloud side system are effectively balanced by using reinforcement learning, the response time and the energy consumption are minimized, and the method can better adapt to calculation task scheduling in a cloud side collaborative environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of combinatorial optimization technology in computer science, and in particular to a cloud-edge computing task scheduling method based on reinforcement learning. Background Art

[0002] With the development of wireless communication technology and Internet of Things technology, intelligent manufacturing has higher requirements for performance indicators such as latency, energy consumption and throughput in the production process. Although traditional cloud computing has powerful computing, storage, network and other resources, it still produces uncontrollable service delays in the face of surging data traffic, and the centralized processing model is difficult to meet users' high performance requirements. Edge computing places resources closer to the terminal and provides computing, storage and communication capabilities at the edge of the network. However, the storage capacity of edge devices is small, and the processors equipped are usually weak in computing power. Therefore, edge computing has low latency but limited resources. Cloud-edge collaboration can effectively improve resource service capabilities and service quality by combining the advantages of cloud computing and edge computing paradigms, and make reasonable cloud-edge computing resource allocation, which has broad development prospects.

[0003] In the context of the Internet of Things, performing cloud-edge computing resource scheduling can optimize resource utilization, reduce latency, and save energy. However, due to factors such as the different states, types, and sizes of tasks, coupled with the heterogeneity and location dispersion of cloud-edge computing resources, and the diversity of performance and stability requirements of different applications, resource scheduling in cloud-edge environments is challenging.

[0004] Some existing studies on cloud-edge computing resource scheduling use heuristic algorithms to find approximate optimal solutions by simulating natural phenomena or biological behaviors in cloud-edge resource scheduling, but the solution process may be affected by the initial parameters and easily lead to only local optimal solutions. Some studies have explored the application of machine learning algorithms, but they may require a large amount of labeled data and have difficulty handling dynamically changing environments. There may also be some limitations, such as the lack of simultaneous optimization of energy consumption and response time. Others use reinforcement learning algorithms such as the DQL (Deep Q-Learning, DQL) algorithm, but DQL usually requires a lot of time for interaction to learn effective strategies. Although these methods have been widely adopted, they may still not guarantee the required quality of service, especially in dynamic cloud-edge computing environments where task response time is critical. How to solve the problems of long average response time, high energy consumption, and low resource utilization in existing task scheduling is a problem that needs to be solved at present.

[0005] To solve the problems of long average response time, high energy consumption, and low resource utilization in existing task scheduling, we designed a cloud-edge computing task scheduling method based on reinforcement learning. By deploying the reinforcement learning model in a distributed manner, the cloud server and the edge server cooperate to perform task scheduling and generate a globally optimal resource scheduling strategy. The core of this strategy is to minimize the response time and energy consumption as much as possible while ensuring that the quality of service (QoS) is satisfied, and improve the utilization rate of cloud-edge resources. Summary of the Invention

[0006] To overcome the deficiencies in the background art, the present invention discloses a cloud-edge computing task scheduling method based on reinforcement learning.

[0007] To achieve the above invention objectives, the present invention first establishes a server queue and a task queue, builds a system model based on the cloud-edge computing task scheduling optimization objective, constructs an LSTM (Long Short-Term Memory) network model architecture based on the attention mechanism, outputs the probability distribution of resource allocation according to the attention weights of different tasks, and then adopts the improved A3C-IW (Asynchronous Advantage Actor-Critic with Importance Weights) reinforcement learning algorithm, uses the asynchronous policy gradient method to obtain the task scheduling decision. Define the reward return function for each step of reinforcement learning , and obtain the optimal computing task scheduling strategy for different reward return task scheduling strategies. The specific technical solutions are as follows:

[0008] A cloud-edge computing task based on reinforcement learning includes the following steps:

[0009] Step 1: Assign n independent computing tasks to m server computing resources for processing, and m < n; where the task set , the parameters of the task are: ;

[0010] In the formula, is the task size, is the expected memory required to process the task, is the expected bandwidth required to process the task;

[0011] The server set , the parameters of the server are: ;

[0012] In the formula, represents the processing capacity of the server, Indicates the available memory of the server. Indicates the available bandwidth of the server;

[0013] Divide the task's execution time into scheduling intervals of equal duration and number the scheduling intervals according to the order in which they occur: ;

[0014] Step 2: Establish an LSTM neural network model based on the attention mechanism, introduce the attention mechanism at the input end of the LSTM neural network model, map the parameters of different servers and tasks into attention vectors, and adjust the writing ratio of different parameters to memory cells through the weighted superposition of attention vectors;

[0015] Step 3: Establish an improved reinforcement learning algorithm A3C-IW model, add importance weights to the A3C algorithm model, and obtain the improved algorithm A3C-IW model. The A3C-IW model includes a main network and several threads with local networks. The threads independently interact with the environment to obtain experience data. The main network receives data uploaded by each local network, takes the current state as the input of the network, and outputs the policy function and value function of the current state.

[0016] Among them, the importance weight is used to update the policy network parameters by introducing a weight factor in the gradient update and multiplying it with the policy gradient;

[0017] Step 4: Apply the A3C-IW algorithm based on the output of the LSTM neural network model to perform strategy learning and optimization, and distribute the task probability distribution , and the probability distribution generated by the Actor network is weighted to obtain the final scheduling strategy .

[0018] Preferably, the attention weight is calculated using the attention mechanism and weighted with the input feature to form a weighted feature as the input of the LSTM. for:

[0019] In the formula, Represents the input features, positioned as ( , ), represents the feature vector of the server, The feature vector representing the task, and are the learnable weight matrices and bias vectors;

[0020] Then the attention weight With input features weighting;

[0021] In the formula, Represents element-wise multiplication;

[0022] Finally, the weighted features As the input of the LSTM neural network model;

[0023] Among them, the output of the LSTM neural network model is: ;

[0024] Convert y into a probability distribution:

[0025] In the formula, Represents each allocation strategy probability.

[0026] Preferably, the A3C-IW algorithm model has the following two operations:

[0027] W1: directly assign the parameters of the main network to the local network;

[0028] W2: Use the gradients in each thread to update the parameters of the main network;

[0029] After each thread interacts with the environment to obtain a certain amount of data, the gradient of the neural network loss function in the thread is calculated and the main network is updated.

[0030] Preferably, the A3C-IW algorithm model outputs the state value function V of the input state S through the Critic network in the main network, and outputs the corresponding strategy function π through the Actor network in the main network.

[0031] Preferably, define the benefit reward function for each step of reinforcement learning As a measure of model parameter updates;

[0032] in, Represents the sum of response time and energy consumption of each scheduling strategy;

[0033] definition : ; .

[0034] Preferably, define the maximum completion time calculation formula:

[0035] In the formula, is the time required to upload the task. is the task running time;

[0036] in, ,

[0037] In the formula, is the task size, is the bandwidth expected to be required for processing the task, d is the interference of the task during transmission, Indicates the processing capacity of the server; f i ∈ [ 0 , f i max ] Indicates the frequency of the server CPU. It is the maximum CPU frequency that the server can achieve;

[0038] The constraints are: , i=1,2,…n; j=1,2,…m; .

[0039] Preferably, the energy consumption calculation formula is defined as: ,

[0040] In the formula, is the power of the server to process computing tasks, is a power factor, which is a constant that depends on the CPU model;

[0041] The constraints are: .

[0042] Preferably, the method for updating the Actor network is: in each policy function process generated by the Actor network, modeling it as a Markov decision process: (S, A, P, R, γ);

[0043] Among them, S is the state space, A is the action space, expressed as , Indicates scheduling task i to server j for calculation, P is the state transition probability, R is the reward function, and γ is the discount factor;

[0044] Among them, γ=1 means that future rewards are of the same value as current rewards, and γ < 1 means that future rewards will be discounted over time.

[0045] In the action space A and state space S, given the current state , the agent performs an action , According to the scheduling strategy Random sampling is performed, and the environment will give rewards and the new state .

[0046] Preferably, the method for updating the Critic network is to update the parameters by minimizing the loss function and calculating the TD target of the temporal difference method as the estimate of the state value function made by the target value network at time t+1:

[0047] In the formula, is the estimate of the state value function made by the state value network at time t+1, and are all estimates of the state value function, since Based on real observed rewards , so fixed , is the parameter of the value network, update , so that Closer ;

[0048] Define the loss function: L ( oh ) ≜ 1 2 [ v ( s t ; oh ) − y ⌢ t ] 2

[0049] set up , the gradient of the loss function is: ;

[0050] The TD error using the temporal difference method represents the difference between the value network prediction value and the actual value. The TD error is defined as ;

[0051] Do a gradient descent update :

[0052] In the formula, is the learning rate.

[0053] Preferably, the updating method of the policy network is: according to the Bellman formula, the action value function is obtained: Q π ( s t , a t ) = E S t + 1 ∼ p ( ⋅ | s t , a t ) [ R t + c ⋅ v ( s t + 1 ; oh ) ]

[0054] According to the policy gradient theorem, by Perform a Monte Carlo approximation to obtain an unbiased estimate of the stochastic policy gradient: g ( s t , a t ; i ) = [ Q π ( s t , a t ) − v ( s t ; oh ) ] ⋅∇ i ln π ( a t | s t ; i ) = [ E S t + 1 [ R t + c ⋅ v ( s t + 1 ; oh ) ] − v ( s t ; oh ) ] ⋅∇ i ln π ( a t | s t ; i )

[0055] In the formula, is the action-value function, is the state value function, is the gradient of the policy;

[0056] Agent performs actions After that, the environment gives a new state and rewards ;use and Making a Monte Carlo approximation to the above expectation, we get: g ˜ ( s t , a t ; i ) ≜ [ R t + c ⋅ v ( s t + 1 ; oh ) − v ( s t ; oh ) ] ⋅∇ i ln π ( a t | s t ; i )

[0057] According to the TD target and TD error, Written as: ;

[0058] In the formula, yes Approximation of

[0059] The advantage function is smoothed using exponential moving average Smoothing is performed and then normalized to make its range between [0, 1] to obtain the processed advantage function ;

[0060] The advantage function is used as the importance weight and multiplied by the policy gradient to update the policy network parameters. Update policy network parameters :

[0061] In the formula, is the learning rate.

[0062] Due to the adoption of the above-mentioned technical solution, the present invention has the following beneficial effects:

[0063] 1. Through distributed deployment of reinforcement learning models, cloud servers and edge servers collaborate to schedule tasks and generate a global optimal resource scheduling strategy. The core of this strategy is to minimize response time and energy consumption as much as possible while ensuring service quality, and to improve the utilization of cloud-edge resources.

[0064] 2. Established server queues and task queues, established a system model based on the cloud-edge computing task scheduling optimization goal, constructed an LSTM network model architecture based on the attention mechanism, output the probability distribution of resource allocation according to the attention weights of different tasks, and then adopted the improved A3C-IW reinforcement learning algorithm and the asynchronous policy gradient method to obtain task scheduling decisions and define the reward function for each step of reinforcement learning. , for task scheduling strategies with different reward returns, the optimal computing task scheduling strategy is obtained. The present invention effectively balances the resource utilization and service quality of the cloud-edge system by using reinforcement learning, minimizes response time and energy consumption, and can better adapt to computing task scheduling in a cloud-edge collaborative environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 is a flow chart of the present invention;

[0066] Figure 2 It is a system framework diagram of the present invention;

[0067] Figure 3 A3C-IW algorithm structure framework diagram of the present invention;

[0068] Figure 4 This is the Actor-Critic network structure diagram in the present invention. DETAILED DESCRIPTION

[0069] The present invention can be explained in detail through the following embodiments. The purpose of disclosing the present invention is to protect all technical improvements within the scope of the present invention. In the description of the present invention, it should be understood that if there are terms such as "upper", "lower", "front", "back", "left", "right", etc. indicating directions or positional relationships, they only correspond to the drawings of the present application and are for the convenience of describing the present invention; it should be understood that if there are terms such as "end", "side", "end portion", "lateral", "lateral", "transverse", "longitudinal", etc. indicating directions or positional relationships, they only correspond to the length and width of the corresponding components, that is, the "end portion" indicates the head and tail areas in the length direction of the corresponding component, and the "side portion" indicates the head and tail areas in the width direction of the corresponding component; this is for the convenience of describing the present invention and is not to indicate or imply that the device or element referred to must have a specific direction.

[0070] A cloud-edge computing task scheduling method based on reinforcement learning. Aiming at the task scenario, we designed to divide the entire intelligent manufacturing system into multiple independent and autonomous schedulers. The scheduler is a system that dynamically allocates tasks to edge and cloud servers. Each scheduler contains several cloud servers, edge servers and terminal devices.

[0071] like Figure 2 As shown, first, the task information is uploaded from the production terminal to the cloud database, and then synchronized to the edge server. The task information includes task attributes and task requirements, etc. The database stores all information, including server resource information and task information. The cloud formulates resource allocation strategies based on the global resource status and task requirements, and the edge server formulates local resource allocation strategies based on the local server status and task requirements. The cloud and edge regularly synchronize task information, server status, and scheduling decisions to ensure data consistency; the cloud and edge communicate through wireless networks.

[0072] First, the problem is described and the relevant mathematical symbols are explained as follows:

[0073] Defined as the i-th scheduling interval;

[0074] Defined as the number of servers;

[0075] is defined as the number of computing tasks;

[0076] is defined as the start and end times of the i-th scheduling interval;

[0077] is defined as the i-th task in the task set;

[0078] is defined as the task size;

[0079] is defined as the expected memory required to process the task expected;

[0080] is defined as the expected bandwidth required to process the task expected;

[0081] is defined as the j-th server in the server set;

[0082] is defined as the processing capacity of the server;

[0083] is defined as the server available memory;

[0084] is defined as the server available bandwidth;

[0085] , is defined as the feature vector containing server parameters and task parameters;

[0086] is defined as scheduling the i-th task to the j-th server;

[0087] is defined as the optimal scheduling strategy.

[0088] includes the following steps:

[0089] Step 1: Assign n independent computing tasks to m server computing resources for processing, where m < n; among them, the task set , represents the i-th task, and the parameters of the task are: ;

[0090] In the formula, is the task size, is the expected memory required to process the task, The expected bandwidth required to process the task;

[0091] Server Collection , Indicates the jth server, the server parameters for: ;

[0092] In the formula, Indicates the processing power of the server, that is, the number of cores of the server's central processing unit (CPU). More cores means that the server can process multiple tasks in parallel. Indicates the available memory of the server. Indicates the available bandwidth of the server;

[0093] In the model considered, time is discrete, and the execution time of a task is divided into scheduling intervals of equal duration, and the scheduling intervals are numbered according to the order in which they occur: ; That is, the i-th scheduling interval is displayed as , it from time starts and continues until the next interval begins, i.e. .

[0094] Step 2: Establish an LSTM (Long Short-Term Memory Network, LSTM) neural network model based on the attention mechanism, introduce the attention mechanism at the input end of the LSTM neural network model, map the parameters of different servers and tasks into attention vectors, and adjust the writing ratio of different parameters to memory units through the weighted superposition of attention vectors;

[0095] As required, the input of the LSTM neural network model is , which consists of the server parameters, including the number of CPU cores, available memory size, and available bandwidth size. All these server parameters are represented in a feature vector as follows: ,Task Including parameters such as task size, required memory, and required bandwidth, the feature vector of the task is expressed as ,therefore, Defined as ( , ) as the input of the model. The parameters of different servers and tasks are mapped to attention vectors, and the writing ratio of different parameters to memory cells is adjusted through the weighted superposition of attention vectors.

[0096] Furthermore, an attention mechanism is introduced at the input end of LSTM to calculate the attention weight and weight it with the input features to form a weighted feature as the input of LSTM. The formula is as follows:

[0097] In the formula, represents the input features, and are the learnable weight matrices and bias vectors.

[0098] Then the attention weight Weighted with input feature x:

[0099] in Represents element multiplication, and finally the weighted features As the input of the LSTM model.

[0100] The output of the LSTM model is represented as:

[0101] Convert y into a probability distribution:

[0102] is a matrix representing each allocation strategy The probability of assigning the i-th task to the j-th task.

[0103] Specifically, the main function of the LSTM neural network model is to solve the gradient vanishing or gradient exploding problems encountered by traditional RNN (Recurrent Neural Network) when processing long sequence data. When processing sequences, the LSTM neural network model uses the same weight to process each element in the sequence, which may cause the model to be unable to distinguish which parts are more important to the current task. The introduction of the attention mechanism is to enable the LSTM neural network model to process sequence data more flexibly, especially when processing time steps with different importance. By introducing the attention mechanism, the LSTM neural network model can dynamically focus on the most important part of the current task, allowing LSTM to dynamically allocate attention weights, thereby improving the performance and accuracy of the model, and being able to better handle complex sequence data in practical applications.

[0104] Step 3: Establish an improved reinforcement learning algorithm A3C-IM model, add importance weights to the A3C model, and obtain the improved algorithm A3C-IW (A3C with Importance Weights), as shown in Figure 3As shown, the A3C-IW model includes a main network and several threads with local networks. The threads independently interact with the environment to obtain experience data, that is, the threads do not interfere with each other and run independently; the main network receives the data uploaded by each local network, takes the current state as the input of the network, and outputs the policy function and value function of the current state;

[0105] Among them, the importance weight is used to update the policy network parameters by introducing a weight factor in the gradient update and multiplying it with the policy gradient, thereby reducing the non-stationarity of the policy update, improving the sample efficiency, and improving the convergence of the algorithm;

[0106] Among them, the A3C-IW model has two operations, one is to directly assign the parameters of the main network to the local network, and the other is to use the gradients in each thread to update the parameters of the main network. After each thread interacts with the environment to a certain amount of data, it calculates the gradient of the neural network loss function in its own thread, but these gradients do not update the neural network in its own thread, but update the main network. In other words: n threads will independently use the accumulated gradients to update the network model parameters of the main network part. At regular intervals, the thread will update the parameters of its own neural network to the parameters of the main network, thereby guiding subsequent environmental interactions.

[0107] Further, such as Figure 4 As shown, the A3C-IW algorithm model outputs the state value function V through the Critic network in the main network and outputs the corresponding strategy function π through the Actor network in the main network.

[0108] Step 4: Apply the A3C-IW algorithm based on the output of the LSTM model to perform strategy learning and optimization and distribute the task probability , and the probability distribution generated by the Actor network is weighted to obtain the final scheduling strategy ;

[0109] That is to say, the Critic network (value network) is used to calculate the state value function after the current state executes the action, and the action with high state value is selected.

[0110] On the whole, if Figure 1 As shown in the figure, we first obtain the feature vectors containing server and task information, and perform feature weighting with the attention weights obtained through the attention mechanism as the input of the LSTM model. The LSTM model outputs the probability distribution of all scheduling strategies. Based on the output of the LSTM model, we apply the reinforcement learning algorithm to obtain the optimal scheduling strategy. .

[0111] Furthermore, the expected model is optimized to reduce the loss in each interval, thereby reducing the cumulative loss: define the benefit reward function for each step of reinforcement learning As a measure of model parameter updates;

[0112] in, Represents the sum of response time and energy consumption of each scheduling strategy;

[0113] definition : ; ;

[0114] Depending on the task characteristics, different hyperparameter values ​​a and b may be required. The following are the definitions of completion time and energy consumption.

[0115] Define the maximum completion time (MCT) calculation formula:

[0116] In the formula, is the time required to upload the task. is the task running time;

[0117] in, ,

[0118] In the formula, is the task size, is the bandwidth expected to be required for processing the task, d is the interference of the task during transmission, Indicates the processing power of the server, that is, the number of cores of the server CPU. f i ∈ [ 0 , f i max ] Indicates the frequency of the server CPU. It is the maximum CPU frequency that the server can achieve;

[0119] Define the energy consumption (EC) calculation formula: ,

[0120] In the formula, is the power of the server to process computing tasks, is a power factor, a constant that depends on the CPU model.

[0121] This can be described as:

[0122] The constraints are: , i=1,2,…n, indicating that the task memory processed cannot exceed the server memory; j=1,2,…m, indicating that the bandwidth required for processing the task cannot exceed the server bandwidth; , indicating that the CPU frequency allocated by the server to process tasks cannot exceed the maximum CPU frequency; , which means that when the server dispatches a task to an edge server for processing, the power used to process the computing task cannot exceed the maximum power.

[0123] Furthermore, the task scheduling algorithm based on A3C-IW reinforcement learning includes a global Actor-Critic network and several threads. Each thread is a complete AC network, including the Actor network, the Critic network and a local environment. They can run in parallel and interact with the local environment for learning. The Actor model is used to generate scheduling decisions, while the Critic model is used to evaluate the value function of the state. The update of the neural network model is mainly divided into the update of the policy network and the value network. That is, the policy network and the value network are trained by updating the parameters.

[0124] For each scheduling decision process generated by the Actor network, it is modeled as a Markov decision process: (S, A, P, R, γ); S is the state space, which contains all possible states. In cloud-edge server scheduling, the state includes the current state of the server and the server where the task is located; A is the action space, which includes all possible actions. In the scheduling process, the action includes the task scheduling decision, which is expressed as:

[0125] In the formula, Indicates that task i is scheduled to server j for calculation; P is the state transition probability, which is the probability that the system state will transfer to a new state after taking a specific action. These probabilities depend on the current state and the action taken; R is the reward function, and the Loss value will be obtained after taking an action in the current state. ; γ is a discount factor used to calculate the cumulative return of future rewards. γ=1 means that future rewards are the same as current rewards, while γ < 1 means that future rewards will be discounted over time.

[0126] In the action space A and state space S, given the current state , the agent performs an action , According to the scheduling strategy The environment will give rewards and the new state .

[0127] For the value network, the parameters are updated by minimizing the loss function and calculating the TD (temporal difference) target of the temporal difference method as the target value network's estimate of the state value function at time t+1:

[0128] In the formula, is the estimate of the state value function made by the state value network at time t+1, and are all estimates of the state value function, since Partially based on real observed rewards , so fixed , is the parameter of the value network, update , so that Closer

[0129] Define the loss function: L ( oh ) ≜ 1 2 [ v ( s t ; oh ) − y ⌢ t ] 2

[0130] set up , the gradient of the loss function is:

[0131] The TD error (TD-error) using the time series difference method represents the difference between the value network prediction value and the actual value. The TD error is defined as . Do a round of gradient descent update :

[0132] In the formula, is the learning rate.

[0133] Such an expected model update can make the value network's prediction Closer to the target value .

[0134] For the policy network, policy gradient is used to update the parameters: According to the Bellman formula, the action value function is obtained: Q π ( s t , a t ) = E S t + 1 ∼ p ( ⋅ | s t , a t ) [ R t + c ⋅ v ( s t + 1 ; oh ) ]

[0135] According to the policy gradient theorem, by Perform a Monte Carlo approximation to obtain an unbiased estimate of the stochastic policy gradient: g ( s t , a t ; i ) = [ Q π ( s t , a t ) − v ( s t ; oh ) ] ⋅∇ i ln π ( a t | s t ; i ) = [ E S t + 1 [ R t + c ⋅ v ( s t + 1 ; oh ) ] − v ( s t ; oh ) ] ⋅∇ i ln π ( a t | s t ; i )

[0136] In the formula, is the action-value function, is the state value function, is the gradient of the policy.

[0137] When the agent performs an action Afterwards, the environment gives a new state and rewards ;use and Making a Monte Carlo approximation to the above expectation, we get: g ˜ ( s t , a t ; i ) ≜ [ R t + c ⋅ v ( s t + 1 ; oh ) − v ( s t ; oh ) ] ⋅∇ i ln π ( a t | s t ; i )

[0138] According to the TD target and TD error defined above, we can Written as:

[0139] yes It is an approximation of , so it is also an approximation of the policy gradient.

[0140] The advantage function measures the additional expected return of taking an action relative to taking a random policy. It helps us evaluate the quality of an action and guides the learning process.

[0141] Advantage function calculation formula:

[0142] Since the advantage function depends on multiple random factors and has a large variance, directly multiplying it with the gradient will lead to unstable parameter updates. Therefore, it is necessary to use the exponential moving average method to smooth the advantage function and then normalize it to make it between [0, 1] to avoid gradient explosion or gradient disappearance problems. The processed advantage function is obtained. .

[0143] The advantage function obtained in this way is used as the importance weight and multiplied by the policy gradient to update the policy network parameters. Update policy network parameters :

[0144] in is the learning rate. Using the advantage function can reduce the variance of the policy gradient estimate, improve learning efficiency, and speed up the convergence of the loss.

[0145] It should be noted that the A3C-IW algorithm is an asynchronous reinforcement learning algorithm combined with the Actor-Critic method. Compared with Actor-Critic, it adds an advantage function to calculate the gradient of the policy network to guide the update of the network. It uses the asynchronous policy gradient method to adapt to dynamically changing environments.

[0146] Adding a target network to the A3C-IW algorithm to calculate the target value helps to better estimate the value function. Use the target network to calculate the TD target and denote the target network as , the structure is the same as the value network structure, but the parameters are different.

[0147] The following summarizes the training process of the A3C-IW algorithm:

[0148] Initializing the network: Value network , policy network , target network

[0149] Initialize network parameters: , , , discount factor , learning rate ,

[0150] Input: state space S, scheduling interval N, time step step = 0, maximum time step

[0151] Output: Optimal scheduling decision for tasks

[0152] Start the loop:

[0153] Step 1: Observe the current state , make decisions based on the policy network: , and perform actions ;

[0154] Step 2: Observe rewards from the environment and the new state , calculate the advantage function

[0155] ;

[0156] Step 3: Based on the policy information output by the LSTM network model, use the value network to calculate the state value function of the current state;

[0157] Step 4: Combine the policy network to generate task scheduling strategy ;

[0158] Step 5: Select the optimal strategy based on the optimization target Loss ;

[0159] :

[0160] Step 6: Let the value network give Evaluate: ;

[0161] Step 7: Let the target network give Evaluate: ;

[0162] Step 8: Calculate TD target and TD error: , ;

[0163] Step 9: Update the value network: ;

[0164] Step 10. Update the policy network: ;

[0165] Step 11:

[0166]

[0167] Step 12: End the loop;

[0168] Step 13: The algorithm ends.

[0169] The parts of the present invention that are not described in detail are prior art. It is obvious to those skilled in the art that the present invention is not limited to the details of the above-mentioned exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic characteristics of the present invention; therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive, and it is intended that all changes that fall within the meaning and scope of equivalent elements are included in the present invention.

Claims

1. A cloud-edge computing task scheduling method based on reinforcement learning, characterized in that: The following steps are involved: Step 1: Allocate n independent computing tasks to m server computing resources for processing, where m < n; among them, the task set , the parameters of the task are: ; In the formula, is the task size, The expected memory required for processing tasks, The expected bandwidth required to process the task; Server Collection , server parameters for: ; In the formula, Indicates the processing power of the server. Indicates the available memory of the server. Indicates the available bandwidth of the server; Divide the task's execution time into scheduling intervals of equal duration and number the scheduling intervals according to the order in which they occur: ; Step 2: Establish an LSTM neural network model based on the attention mechanism, introduce the attention mechanism at the input end of the LSTM neural network model, map the parameters of different servers and tasks into attention vectors, and adjust the writing ratio of different parameters to memory cells through the weighted superposition of attention vectors; Step 3: Establish an improved reinforcement learning algorithm A3C-IW model, add importance weights to the A3C algorithm model, and obtain the improved algorithm A3C-IW model. The A3C-IW model includes a main network and several threads with local networks. The threads independently interact with the environment to obtain experience data. The main network receives data uploaded by each local network, takes the current state as the input of the network, and outputs the policy function and value function of the current state. Among them, the importance weight is used to update the policy network parameters by introducing a weight factor in the gradient update and multiplying it with the policy gradient; Step 4: Apply the A3C-IW algorithm based on the output of the LSTM neural network model to perform strategy learning and optimization, and distribute the task probability distribution , and the probability distribution generated by the Actor network is weighted to obtain the final scheduling strategy .

2. The cloud-edge computing task scheduling method based on reinforcement learning according to claim 1 is characterized in that: The attention weight is calculated using the attention mechanism and weighted with the input features to form a weighted feature as the input of LSTM. for: In the formula, Represents the input features, positioned as ( , ), represents the feature vector of the server, The feature vector representing the task, and are the learnable weight matrices and bias vectors; Then the attention weight With input features weighting; In the formula, Represents element-wise multiplication; Finally, the weighted features As input to the LSTM neural network model; Among them, the output of the LSTM neural network model is: ; Convert y into a probability distribution: In the formula, Represents each allocation strategy probability.

3. The cloud-edge computing task scheduling method based on reinforcement learning according to claim 1 is characterized in that: The A3C-IW algorithm model has the following two operations: W1: directly assign the parameters of the main network to the local network; W2: Use the gradients in each thread to update the parameters of the main network; After each thread interacts with the environment to obtain a certain amount of data, the gradient of the neural network loss function in the thread is calculated and the main network is updated.

4. The cloud-edge computing task scheduling method based on reinforcement learning according to claim 3 is characterized in that: The A3C-IW algorithm model outputs the state value function V through the Critic network in the main network and outputs the corresponding strategy function π through the Actor network in the main network.

5. The cloud-edge computing task scheduling method based on reinforcement learning according to claim 1 is characterized in that: Define the benefit reward function for each step of reinforcement learning As a measure of model parameter updates; in, Represents the sum of response time and energy consumption of each scheduling strategy; definition : ; .

6. The cloud-edge computing task scheduling method based on reinforcement learning according to claim 5 is characterized in that: Define the maximum completion time calculation formula: In the formula, is the time required to upload the task. is the task running time; in, , In the formula, is the task size, is the bandwidth expected to be required for processing the task, d is the interference of the task during transmission, Indicates the processing capacity of the server; Indicates the frequency of the server CPU. It is the maximum CPU frequency that the server can achieve; The constraints are: , i=1,2,…n; j=1,2,…m; .

7. The cloud-edge computing task scheduling method based on reinforcement learning according to claim 5 is characterized in that: Define the energy consumption calculation formula: , In the formula, is the power of the server to process computing tasks, is a power factor, which is a constant that depends on the CPU model; The constraints are: .

8. The cloud-edge computing task scheduling method based on reinforcement learning according to claim 4 is characterized in that: The method for updating the Actor network is as follows: in each policy function generated by the Actor network, it is modeled as a Markov decision process: (S, A, P, R, γ); Among them, S is the state space, A is the action space, expressed as , Indicates scheduling task i to server j for calculation, P is the state transition probability, R is the reward function, and γ is the discount factor; Among them, γ=1 means that future rewards are of the same value as current rewards, and γ < 1 means that future rewards will be discounted over time. In the action space A and state space S, given the current state , the agent performs an action , According to the scheduling strategy Random sampling is performed, and the environment will give rewards and the new state .

9. The cloud-edge computing task scheduling method based on reinforcement learning according to claim 8 is characterized in that: The method for updating the Critic network is to update the parameters by minimizing the loss function and calculating the TD target of the temporal difference method as the target value network's estimate of the state value function at time t+1: In the formula, is the estimate of the state value function made by the state value network at time t+1, and are all estimates of the state value function, since Based on real observed rewards , so fixed , is the parameter of the value network, update , so that Closer ; Define the loss function: set up , the gradient of the loss function is: ; The TD error using the temporal difference method represents the difference between the value network prediction value and the actual value. The TD error is defined as ; Do a gradient descent update : In the formula, is the learning rate.

10. The cloud-edge computing task scheduling method based on reinforcement learning according to claim 1 is characterized in that: The update method for the policy network is: According to the Bellman formula, the action value function is obtained: According to the policy gradient theorem, by Perform a Monte Carlo approximation to obtain an unbiased estimate of the stochastic policy gradient: In the formula, is the action-value function, is the state value function, is the gradient of the policy; Agent performs actions After that, the environment gives a new state and rewards ; use and Applying Monte Carlo approximation to the above expectation, we get: According to the TD target and TD error, Written as: ; In the formula, yes Approximation of The advantage function is smoothed using exponential moving average Smoothing is performed and then normalized to make its range between [0, 1] to obtain the processed advantage function ; The advantage function is used as the importance weight and multiplied by the policy gradient to update the policy network parameters. Update policy network parameters : In the formula, is the learning rate.

Citation Information

Patent Citations

  • Robust target tracking method and system based on hierarchical decision network

    CN112802061A

  • Cloud data center adaptive efficient resource allocation method based on deep reinforcement learning

    CN114691363A

  • Multi-agent deep reinforcement learning training method based on PPO

    CN116306979A

  • Frequency hopping interference resource allocation method based on asynchronous deep reinforcement learning algorithm

    CN117792431A

  • Heterogeneous computing power-oriented multi-policy intelligent scheduling method and apparatus

    WO2024060571A1

Cited By

  • Self-adaptive scheduling method and system for computing power hardware resources under cloud edge collaborative system

    CN119292795A

  • A method and system for adaptively scheduling computing hardware resources in a cloud-edge collaborative system

    CN119292795B

  • Cloud computing task scheduling optimization method based on deep reinforcement learning

    CN119718595A

  • Additive manufacturing workshop scheduling method based on safety reinforcement learning

    CN119849842A

  • A scheduling method for additive manufacturing workshops based on safety reinforcement learning

    CN119849842B