A control system task cloud scheduling method based on deep reinforcement learning

Through deep reinforcement learning methods, neural networks are used to predict the CPU requirements of computing tasks and optimize scheduling strategies, solving the problem of low resource utilization in cloud computing environments and achieving efficient task scheduling, which is suitable for complex control system tasks.

CN117931443BActive Publication Date: 2024-10-18JIANGNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410099179.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-24
Publication Date
2024-10-18
Estimated Expiration
2044-01-24

AI Technical Summary

Technical Problem

In a cloud computing environment, how to efficiently utilize server resources to handle complex computing tasks in the control system under specified working hours and a limited number of CPU cores? The existing binning algorithm cannot provide the optimal solution, resulting in resource utilization Not high.

Method used

A control system task cloud scheduling method based on deep reinforcement learning is used to predict the running time of computing tasks under different numbers of CPU cores through neural networks. The task scheduling problem is formulated as a two-dimensional binning problem, a Markov decision model is established, and Double DQN and ε-greedy methods are used to optimize task scheduling strategies, design efficient reward functions and reduce action spaces to achieve more efficient resource utilization.

Benefits of technology

It implements a fast and performance-guaranteed task scheduling strategy in cloud servers, improves resource utilization, is suitable for task scheduling problems in control systems with large action spaces, and is universal and practical.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117931443B_ABST
    Figure CN117931443B_ABST
Patent Text Reader

Abstract

The present invention discloses a control system task cloud scheduling method based on deep reinforcement learning, which relates to the field of task scheduling optimization. The method includes: predicting the running time required for computing tasks in the control system under different numbers of CPU cores through experimental tests and neural networks; expressing the task scheduling problem as a two-dimensional packing problem; establishing a Markov decision model for the packing problem, designing a reasonable reward function according to the two-dimensional packing process and reducing the action space in the decision-making process; using the Double DQN method in deep reinforcement learning to solve the packing problem and output the optimal packing strategy. The present invention solves the scheduling problem of control system tasks when the cloud server specifies the working hours and the number of CPU cores, and proposes a deep reinforcement learning method for reducing the action space based on the characteristics of the two-dimensional packing problem itself, which can shorten the training time of the model while ensuring resource utilization, and has universality and practicality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of task scheduling optimization, and in particular to a control system task cloud scheduling method based on deep reinforcement learning. Background Art

[0002] Control science and technology plays a vital role in the technological progress of mankind, providing a theoretical basis and convenience for the automation of many industrial sectors, such as PID control and fuzzy control. When these control systems or methods are applied to specific problems or scenarios, computing resources are required to assist in solving controller problems, including using basic mathematical operations or complex matrix operations to calculate controller parameters. When these computing tasks are run on different models of CPUs or different numbers of CPU cores, the time required will vary. As the computational complexity of tasks in control system controller solvers continues to increase, the required CPU resources will also increase accordingly, resulting in longer computing time. Therefore, the processing power of local processor CPUs can no longer meet the current needs of solving complex problems. Therefore, the carrier for calculating various complex problems has gradually shifted from local processors to cloud computing. Cloud computing is an Internet-based computing model that allows individuals and enterprises to access and use computing resources through remote servers. It provides network and computing resources in the form of services, the so-called cloud services, which users can rent to meet their needs. Among cloud services, Infrastructure as a Service (IaaS) is a popular basic service solution. Leading cloud service providers such as AWS, Azure, Alibaba Cloud, and Huawei Cloud usually provide virtual machines (VMs) to meet users' computing needs (CPU and memory). In cloud computing, cloud service providers use multi-NUMA (non-uniform memory access) architecture to provide large-capacity VMs with large memory and CPU resources. Each server has multiple NUMAs, and each NUMA contains multiple CPU cores and memory space. The number of CPU cores in each server is limited. For a virtual machine creation request, the service provider selects a certain number of cores and memory so that the virtual machine can be created on one NUMA or across NUMAs of the server without exceeding the total number of CPU cores. When users have different requirements for virtual machines, such as CPU requirements ranging from 2 cores to 64 cores, the server will create virtual machines with the corresponding number of CPU cores to process user tasks. The time required for virtual machines with different cores to process computing tasks varies. After receiving the user's virtual machine request, the cloud service provider creates virtual machines according to the server's schedule and assigns user tasks to virtual machines in the server in different time periods. In cloud computing, how to arrange time periods to create virtual machines for task processing becomes a task scheduling problem to be solved.

[0003] Since the number of CPU cores in the server is limited and the working hours per day are limited, there are two constraints in this task planning problem: duration and number of CPU cores. With these constraints, the task scheduling problem can be described as a two-dimensional bin packing problem (BPP). Our goal is to effectively utilize server resources according to the CPU requirements of the task within the server working time. This task scheduling problem is solved by solving this two-dimensional BPP. Most existing bin packing algorithms use heuristic algorithms to solve this combinatorial optimization problem. Although these methods play an important role in balancing space utilization and efficiency, these methods often fail to provide optimal solutions. Therefore, how to obtain more efficient resource utilization under the specified duration and number of CPU cores is an urgent problem to be solved. Summary of the invention

[0004] In view of the above problems and technical requirements, the inventors have proposed a control system task cloud scheduling method based on deep reinforcement learning to solve the scheduling problem of control system tasks under the condition of specified working time and total number of CPU cores. The technical solution of the present invention is as follows:

[0005] A control system task cloud scheduling method based on deep reinforcement learning includes the following steps:

[0006] Through experimental tests and neural network prediction, the running time required for computing tasks in the control system under different numbers of CPU cores is stored in the task sequence according to the number of CPU cores and running time corresponding to each computing task.

[0007] Under the constraints of the working time and the total number of CPU cores specified by the cloud server, the scheduling problem of the task sequence is formulated as a two-dimensional packing problem;

[0008] A Markov decision model is established for the two-dimensional packing problem, and the corresponding state space, action space and reward function are set;

[0009] In the two-dimensional packing process, the current state observed at each time step is input into the Q network in Double DQN. The Q network outputs the benefit value of taking actions in this state, and obtains the optimal scheduling strategy through the ε-greedy method.

[0010] The further technical solution is to use experimental tests and neural network prediction to estimate the running time required for computing tasks in the control system under different numbers of CPU cores, including:

[0011] The computational task is to solve the linear quadratic optimal controller in the infinite time case in the control system, and to establish a linear time-invariant state space model for each linear quadratic optimal controller;

[0012] The CPU running time required to solve the linear quadratic optimal controller with different state dimensions and coefficient matrices under different numbers of CPU cores is collected through experimental methods;

[0013] The coefficient matrix is ​​extracted, and the experimental data are divided into four categories according to the running time and the number of CPU cores and labeled accordingly. A neural network model is introduced, and the coefficient matrix features are used as the model input. The model is trained using a labeled data set so that the model can predict the number of CPU cores and running time corresponding to different linear quadratic optimal controllers.

[0014] A further technical solution is to establish a linear time-invariant state space model for each linear quadratic optimal controller, including:

[0015] The linear time-invariant state space model is:

[0016]

[0017] In the formula, is the system state vector at time t, is the control input vector at time t, t∈[0,∞); and are the coefficient matrices of the system respectively;

[0018] In the design of the optimal controller, given the quadratic cost function:

[0019]

[0020] In the formula, and is a semi-positive definite matrix. The cost function J is minimized by designing a state feedback controller u(t) = -Kx(t) to solve the optimal control strategy. The state feedback matrix K is obtained by solving ARE and is expressed as:

[0021]

[0022] Where P0 is the matrix to be determined of ARE.

[0023] A further technical solution is to formulate the scheduling problem of task sequences as a two-dimensional packing problem, including:

[0024] A resource schedule of the cloud server is created based on the total number of CPU cores and working hours of the cloud server, and the resource schedule is regarded as a finite two-dimensional container; when the cloud server receives a computing task, a virtual machine is created based on the number of CPU cores and running time corresponding to the task, and the two-dimensional container is used to schedule the virtual machine that executes the computing task; in this process, the task sequence is regarded as a rectangular sequence, and the scheduling problem of the task sequence is expressed as a two-dimensional packing problem of packing the rectangular sequence into the two-dimensional container. The goal of the two-dimensional packing problem is to maximize the filling density of the rectangular sequence in the finite two-dimensional container;

[0025] Among them, the task sequence obeys a uniform distribution, and each task is arranged in order.

[0026] A further technical solution is to use a two-dimensional array to represent the two-dimensional container used for packing, where the unoccupied space during packing is represented by 0 and the occupied space is represented by 1. At the time step i, four features are used to represent the current state s of the system i , denoted as s i =(H,U,P,G), where:

[0027] H is the abbreviation of Height, which means the sum of the heights of the elements in each column that are 1 in the current state;

[0028] U is the abbreviation of Unevenness, which means the sum of the height differences between the elements of two adjacent columns that are 1 in the current state;

[0029] P is the abbreviation of Perfect lines, which means the number of rows where all elements are 1 in the current state;

[0030] G is the abbreviation of Gaps, which indicates the number of holes with zero elements between the occupied spaces in the current state.

[0031] Its further technical solution is that the method further comprises:

[0032] In the two-dimensional packing process, the size of the action space is reduced by deleting invalid actions in each state. When there is no valid action in the action space of a state, the state is the terminal state.

[0033] Its further technical solution is that at the current state s of the i-th time step i Each action will produce a different subsequent state s i+1 , for these actions that lead to different results a i , the following reward function is defined:

[0034]

[0035] In the formula, represents the size of the cluster, Indicates the compactness of the cluster, L new Indicates the number of newly formed Perfect lines, K w Indicates a constant multiple of the box width;

[0036] The interpretation of is as follows: if an element is connected to another element horizontally or vertically, they belong to the same cluster;

[0037] The interpretation is as follows: At time step i, action a was taken i , generating a new cluster c i , the cluster size is Introducing a new variable It means that it can surround the cluster c i The size of the smallest rectangle of the cluster is defined as:

[0038]

[0039] Its further technical solution is to input the current state observed at each time step into the Q network in Double DQN, and the Q network outputs the benefit value of taking actions in this state, including:

[0040] During the learning process of the agent, it observes the current state s at each time step i. i and strategy π, perform an action a i , and evaluate the policy π according to the action-value function:

[0041]

[0042] In the formula, G i represents the cumulative return at each time step i, r i+k+1 represents the reward obtained at step i+k+1, k represents the k time steps after the i-th time step, and γ represents the discount factor; by maximizing the action-value function of the overall strategy, the action-value function Q in the optimal state is obtained * (s i ,a i ), expressed as:

[0043]

[0044] Using the Q network Q in Double DQN θ (s i ,a i ) and the target network Q θ- (s i ,ai ) to fit the action-value function and update the network parameters θ and θ - To approach the optimal Q * (s i ,a i );

[0045] The Q network Q in Double DQN θ (s i ,a i ) and the target network Q θ- (s i ,a i ) consists of three fully connected layers to i Next, perform action a i The next state s obtained i+1 As the input of the Q network at time step i+1, the generated state-action pair (s i+1 ,a i+1 ) is used as the output of the Q network at time step i+1, and the two network parameters θ and θ are updated. - .

[0046] Its further technical solution is that the method further comprises:

[0047] In the process of network parameter update, the target network Q θ- (s i ,a i ) parameter θ - Will use soft update to replicate Q network Q θ (s i ,a i ) parameter θ, the update formula of parameter θ is:

[0048]

[0049] θ - The soft update formula is:

[0050] θ - =(1-τ)θ - +τθ;

[0051] Where τ represents the soft update rate.

[0052] A further technical solution is to obtain the optimal scheduling strategy through the ε-greedy method, including:

[0053] The agent takes actions using the ε-greedy method, expressed as:

[0054]

[0055] In the formula, a i represents the action performed by the agent at time step i, selecting the action with the highest benefit with probability 1-ε, and selecting a random action in other cases; Q θ (s i ,a i ) represents the action-value function fitted by Double DQN, Represents the action space.

[0056] The beneficial technical effects of the present invention are:

[0057] The present invention proposes a scheduling method based on the scheduling of tasks in a control system in a cloud server. A neural network is used to predict the computing resources required to design a state feedback controller for different linear quadratic problems, and then these computing resources are planned in the cloud server using the proposed scheduling method. The scheduling method is based on Double DQN in deep reinforcement learning. According to the study of the packing process, a more efficient reward function is designed and the action space in the MDP (Markov decision model) is reduced, so that the method provides a fast and performance-guaranteed feasible strategy for the task scheduling problem of a control system with a large action space, making the present invention more universal and practical. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is a schematic diagram of the control system task cloud scheduling problem provided in this application.

[0059] Figure 2 This is a schematic diagram of the computing resources required for the neural network predicted linear quadratic optimal controller provided in this application.

[0060] Figure 3 It is a neural network classification performance diagram provided by this application.

[0061] Figure 4 This is a schematic diagram of packing state feature extraction provided by this application.

[0062] Figure 5 This is a schematic diagram of the Double DQN training process provided by this application.

[0063] Figure 6 It is the performance diagram of the Double DQN packing process provided by this application. DETAILED DESCRIPTION

[0064] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings.

[0065] This application provides a control system task cloud scheduling method based on deep reinforcement learning. The schematic diagram of solving the task scheduling problem is as follows: Figure 1As shown, the method specifically comprises the following steps:

[0066] Step 1: Use experimental tests and neural networks to predict the running time required for computing tasks in the control system under different numbers of CPU cores.

[0067] In this embodiment, the calculation task is to solve the linear quadratic optimal controller in the infinite time situation in the control system as an example, Figure 2 As shown, this step specifically includes the following sub-steps:

[0068] Step 1.1: Establish a linear time-invariant state space model for each linear quadratic optimal controller. Exemplarily, different linear quadratic optimal controllers may correspond to different state dimensions and coefficient matrices.

[0069] Step 1.2: Experimentally collect the CPU running time required to solve the linear quadratic optimal controller with different state dimensions and coefficient matrices under different numbers of CPU cores.

[0070] Step 1.3: Extract features based on the characteristics of the coefficient matrix, and divide the experimental data into four categories according to the running time and the number of CPU cores and label them accordingly. Introduce a neural network model, use the coefficient matrix features as model input, and use the label data set to train the model so that the model can predict the number of CPU cores and running time corresponding to different linear quadratic optimal controllers, and pass the number of CPU cores and running time corresponding to each computing task to the scheduler as a task sequence.

[0071] Step 2: Under the constraints of the working time and the total number of CPU cores of the cloud server, the scheduling problem of the task sequence is expressed as a two-dimensional packing problem.

[0072] Step 3: Establish a Markov decision model for the two-dimensional packing problem and set the corresponding state space, action space and reward function; in the two-dimensional packing process, reduce the size of the action space by deleting invalid actions in each state.

[0073] Step 4: In the two-dimensional packing process, the current state observed at each time step is input into the Q network in Double DQN (Deep Q-Network). The Q network outputs the benefit value of taking actions in this state, and obtains the optimal scheduling (i.e., packing) strategy through the ε-greedy method.

[0074] The specific implementation process of each step is introduced in detail below.

[0075] In step 1.1, consider the linear time-invariant state space model as:

[0076]

[0077] In the formula, is the system state vector at time t, is the control input vector at time t, t∈[0,∞); and are the coefficient matrices of the system respectively. In the design of the optimal controller, in order to meet the system stability and specific performance indicators, the optimal control strategy is solved and the quadratic cost function is given as:

[0078]

[0079] In the formula, and is a semi-positive definite matrix, and the cost function J is minimized by designing a state feedback controller u(t)=-Kx(t) to solve the optimal control strategy. The state feedback matrix K is obtained by solving the ARE (Algebraic Riccati Equation), and the expression is:

[0080]

[0081] Where P0 is the matrix to be determined of ARE. The main process of solving the state feedback controller lies in the calculation of ARE.

[0082] In step 1.2, this embodiment uses a Python program to solve the state feedback matrix K, and uses coefficient matrices A and B of different dimensions as program input and calculations. During the experiment, different frequencies of a single-core CPU are used to simulate different numbers of CPU cores, so the time module in Python is used to measure the actual CPU running time at different frequencies of a single-core CPU. For the dimensions n and m of matrices A and B, n ranges from 1 to 10, and m ranges from 1 to 6. For 60 kinds of random matrices A and B, 100 are taken for each, and a total of 6000 are taken as matrix data. These data are respectively calculated and measured for CPU running time at two different core frequencies of 1.93GHz and 2.2GHz, and 12,000 sets of data are obtained.

[0083] In step 1.3, if Figure 2 As shown, the experimental data of step 1.2 is divided into (u l ,t l )、(u s ,t l )、(u l ,t s )、(u s ,t s ) four categories, the labels are 0, 1, 2, 3, where u lIndicates that a large number of CPU cores are used (i.e., a single core with high frequency in the experiment), u s represents the number of CPU cores used is small (i.e., single-core low frequency in the experiment), t l Indicates that the CPU runs for a long time, t s Indicates that the CPU running time is short. In order to meet the generalization requirements, a neural network model is introduced to extract features from the coefficient matrix as (n,m,|A|,||A|| F ,||B|| F ,c), where |A| is the determinant of the coefficient matrix A, ||A|| F and ||B|| F is the Frobenius norm of matrices A and B, and c is the number of active CPU cores. These features are used as model inputs, and the four categories are used as model outputs. Exemplarily, the model consists of an input layer with 6 input nodes, three hidden layers with 32 nodes in each layer, and an output layer with 4 nodes.

[0084] The label and feature datasets are input into the neural network model for training, using a learning rate of 1e -3 The Adam optimizer was used, the number of training rounds was 12000, and the final classification result was 93%. The classification confusion matrix is ​​shown in the figure below. Figure 3 As shown in the figure, each row of the confusion matrix represents the actual category, and each column represents the predicted category. Taking the first row as an example, the actual category label is 0. From the predicted labels in the column direction, there are 261 instances predicted as 0, 1 instance predicted as 1, 40 instances predicted as 2, and 0 instances predicted as 3. In other words, among the 302 instances with the actual label of 0, 261 are correctly classified and 41 are incorrectly classified, and the same applies to the remaining rows.

[0085] In step 2, according to the task scheduling problem to be solved in this application, a resource time table is set up to pre-plan the task requests of users. Assume that the server of the cloud service provider contains W0 CPU cores and the server works H0 hours per day. This will create a resource time table with a vertical axis length of H0 and a horizontal axis length of W0. Users can choose from different types of virtual machines created by the cloud server, and these virtual machines have different numbers of CPU cores. The total number of CPU cores of all concurrently created virtual machines cannot exceed the total number of CPU cores W0 of the cloud server. Different users can choose different virtual machine types and pass their respective computing tasks to the cloud service provider to form a task sequence through the neural network model described in step 1. Within the time interval of 0 to H0, the cloud server can receive the computing tasks in the task sequence. Under the specified virtual machine type, each computing task requires a different processing time. For each task in the sequence, determine the required number of CPU cores w (0 < w < W0) and the corresponding processing time h (0 < h < H0), and assume that the task sequence follows a uniform distribution, and the tasks in the task sequence must be arranged in order.

[0086] Next, regard the resource time table as a finite two-dimensional container, which is used to schedule the virtual machines (i.e., specific time periods and numbers of CPU cores) for executing computing tasks, where the number of CPU cores is the horizontal axis and time is the vertical axis. When the cloud server receives a computing task, a virtual machine is created according to the number of CPU cores and the running time corresponding to the task, and it is scheduled onto this container. Each created virtual machine occupies a certain number of CPU cores and a certain length of time. During this process, regard the task sequence as a rectangle sequence, then the scheduling problem of the task sequence is expressed as a two-dimensional bin-packing problem of packing the rectangle sequence into a two-dimensional container. The goal of the two-dimensional bin-packing problem is to maximize the packing density of the rectangle sequence in the finite two-dimensional container. In this problem, each item in the rectangle sequence cannot be rotated because the length and width represent different meanings. Each rectangular item is placed in order, and the length h i and width w i of the i-th rectangular item respectively satisfy 0 < h i < H0 and 0 < w i < W0. In this scenario, the goal is to maximize the resource utilization rate before the end of the sequence.

[0087] In step 3, the Markov decision model (MDP) can be understood as that at each time step i, the stochastic process is in a certain state s i , and the agent can choose an available action a i under the state s i . After the next time step i + 1, the stochastic process will randomly transition to a new state s i+1 , providing the corresponding feedback / reward to the agent The chosen action affects the random process to enter a new state s i+1 Specifically, the new state s i+1 By the state transfer function P ai (s i ,s i+1 ). Therefore, the next state s i+1 Depends on the current state i and the agent's action a i However, given s i and a i , which is conditionally independent of all previous states and actions. From this, we can infer that the MDP consists of four main elements, which are combined into four elements: Indicates that represents the finite set of states that the system can occupy, represents the set of available actions, represents the state transfer matrix, represents the reward function. In the unpacking problem, when the distribution of the task sequence is unknown, is unknown. However, in this embodiment, it is assumed that the task sequence obeys a uniform distribution. is known, which defines the transition probability between all state pairs. To optimize the algorithm, there is no systematic introduction here

[0088] The state is defined as follows: a two-dimensional square container is represented by a two-dimensional array of H0×W0. When packing, the unoccupied space is represented by "0", the occupied space is represented by "1", and the items to be placed are represented by h i × i The two-dimensional array representation of , where all elements are "1". At time step i, the state of the system is determined by the current placement of the square container, and this embodiment uses four features to represent the current state of the system s i , denoted as s i =(H,U,P,G), such as Figure 4 As shown in the figure, H is the abbreviation of Height, which means the sum of the heights of the elements in each column that are 1 in the current state; U is the abbreviation of Unevenness, which means the degree of unevenness in the placement process, that is, the sum of the height differences of the elements in two adjacent columns that are 1 in the current state; P is the abbreviation of Perfect lines, which means the number of rows where all the elements are 1 in the current state; G is the abbreviation of Gaps, which means the number of holes where the elements are 0 between the occupied spaces in the current state, that is, checking whether there are gaps between the elements in each column.

[0089] The definition and simplification of the action space are as follows: In each state, the agent can perform a total of H0×W0 actions, where each action corresponds to the coordinates of each element in the H0×W0 matrix, and each coordinate corresponds to the upper left corner of the rectangular object to be placed. Therefore, not every action is valid, because some actions may result in stacking on occupied cells or placing items outside the boundaries of the container, making such operations infeasible. Therefore, in order to shorten the training time of the model and improve resource utilization, the action space can be pruned according to the current container state, retaining only valid actions. When there are no valid actions in the action space of a state, the state is the terminal state.

[0090] The reward function is defined as follows: In the process of packing, in order to improve space utilization, it is preferred to place the subsequently arrived items near the previously placed items, preferably without leaving any gaps. When a gap appears in a row of the box and there happens to be an item that can fill the gap, filling the gap has a higher priority than placing it near the previously placed item. Based on this packing experience, the following reward function is set. At the current state s at the i-th time step i Each action will produce a different subsequent state s i+1 , for these actions that lead to different results a i , the following reward function is defined

[0091]

[0092] In the formula, represents the size of the cluster, Indicates the compactness of the cluster, L new Indicates the number of newly formed Perfect lines, K w Indicates a constant multiple of the box width. According to this reward function, for each position, the reward value of the corresponding action is related to the size of the cluster formed and the number of newly formed Perfect lines. In other words, it can be understood that the more compact the layout, the more Perfect lines are generated, and the more rewards are obtained. Using this reward method for layout can improve overall resource utilization.

[0093] is explained as follows: an element belongs to the same cluster if it is connected to another element horizontally or vertically. The interpretation is as follows: At time step i, action a was taken i , generating a new cluster c i , the cluster size is Introducing a new variable It means that it can surround the cluster c iThe size of the smallest rectangle of the cluster is defined as:

[0094]

[0095] New Perfect lines(L new ) is explained as follows: It refers to the number of new Perfect lines generated by the current action, and the calculation method is to subtract the number of Perfect lines in the previous state from the number of Perfect lines in the current state.

[0096] In step 4, as the agent learns, it calculates the current state s based on the state it observes at each time step i. i and strategy π, perform an action a i , and evaluate the strategy π according to the action-value function (hereinafter referred to as Q function):

[0097]

[0098] In the formula, G i represents the cumulative return at each time step i; r i+k+1 represents the reward obtained at step i+k+1, which can be obtained by formula (4); k represents the k time steps after the i-th time step, ranging from 0 to infinity; γ represents the discount factor, ranging from 0 to 1. By maximizing the action-value function of the overall strategy, the action-value function Q in the optimal state is obtained * (s i ,a i ), expressed as:

[0099]

[0100] The update of the Q function requires iterative calculation to approach the optimal Q * (s i ,a i ), the scheme is called Q-learning. The Deep Q-learning algorithm (DQN) uses a deep neural network (including Q network Q θ (s i ,a i ) and the target network Q θ -(s i ,a i )) to fit the Q function, where θ and θ - are the parameters of the Q network and the target network. Figure 5As shown in the figure, in the current environment, the agent takes action according to the current state, and then the environment gives the agent feedback on the reward value of the action and the next state after the action is executed. Then the agent takes action according to the next state fed back by the environment, and the cycle continues. θ (s i ,a i ) and the target network Q θ -(s i ,a i ) consists of three fully connected layers to i Next, perform action a i The next state s obtained i+1 As the input of the Q network at time step i+1, the generated state-action pair (s i+1 ,a i+1 ) is used as the output of the Q network at time step i+1, and the Q network Q is updated θ (s i ,a i ) parameters θ and the target network Q θ- (s i ,a i ) parameter θ - The experience library in the figure refers to the use of strategy π to interact with the environment multiple times, and all the data generated by the interaction is placed in a data buffer (that is, the experience library). The data in the experience library is the data in a certain state s before. i , take a valid action a i , got the reward r i , enter state s i+1 , which is a tuple of four elements (s i ,a i ,r i ,s i+1 ), the old data will be discarded only when the buffer is full. After having the experience library, when training the Q function each time, a batch of experience is randomly sampled from the experience library, and the Q function is updated based on these experiences, which is the sampling process.

[0101] In the process of network parameter update, the target network Q θ -(s i ,a i ) parameter θ - Will use soft update to replicate Q network Q θ (s i ,a i ), where the update formula of parameter θ is:

[0102]

[0103] θ - The soft update formula is:

[0104] θ - =(1-τ)θ - +τθ (9)

[0105] Where D represents the experience base, and τ represents the soft update rate. The method of sampling Double DQN in this embodiment can train the network more stably and improve the overestimation problem of state-action pairs.

[0106] Considering the exploration-exploitation dilemma, the agent takes action using the ε-greedy method to obtain the optimal scheduling strategy. The ε-greedy method is expressed as:

[0107]

[0108] The ε-greedy strategy is to choose the action with the highest benefit with a probability of 1-ε, and choose a random action in other cases, where ε∈(0,1). The specific process is: the agent performs this action, that is, puts the received rectangular object into the container (box), thereby obtaining a reward r from the environment i At the same time, the Q network in Double DQN calculates the Q function value of the state-action pair and updates the parameters θ of the Q network and the parameters θ of the target network. - Compared with the original Double DQN algorithm, this application improves the - The update form of adopts the soft update technology, as shown in formula (9). The soft update technology helps to reduce the fluctuation of the network training process. The training diagram of the whole process is as follows Figure 5 As shown in the figure, the results of the 10×10 size box packing experiment are as follows Figure 6 As shown in the figure, with the increase of training steps, the packing efficiency is greatly improved and finally stabilized at around 0.94.

[0109] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0110] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0111] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0112] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0113] The above is only a preferred embodiment of the present application, and the present invention is not limited to the above embodiments. It is understood that other improvements and changes directly derived or associated by those skilled in the art without departing from the spirit and concept of the present invention should be considered to be included in the protection scope of the present invention.

Claims

1. A control system task cloud scheduling method based on deep reinforcement learning, characterized in that: The method comprises: Through experimental tests and neural network prediction, the running time required for computing tasks in the control system under different numbers of CPU cores is stored in the task sequence according to the number of CPU cores and running time corresponding to each computing task. Under the constraints of the working time and the total number of CPU cores specified by the cloud server, the scheduling problem of the task sequence is expressed as a two-dimensional packing problem, including: creating a resource schedule of the cloud server according to the total number of CPU cores and working time of the cloud server, and treating the resource schedule as a finite two-dimensional container; when the cloud server receives a computing task, a virtual machine is created according to the number of CPU cores and running time corresponding to the task, and the two-dimensional container is used to schedule the virtual machine that executes the computing task; in this process, the task sequence is regarded as a rectangular sequence, and the scheduling problem of the task sequence is expressed as a two-dimensional packing problem of packing the rectangular sequence into the two-dimensional container, and the goal of the two-dimensional packing problem is to maximize the filling density of the rectangular sequence in a finite two-dimensional container; wherein, the task sequence obeys a uniform distribution, and the tasks are arranged in order according to the sequence of precedence; A Markov decision model is established for the two-dimensional packing problem, and the corresponding state space, action space and reward function are set, wherein the state space refers to the state set of the box after each rectangular sequence is packed into the two-dimensional container, and the action space refers to the state set of the box after each state s i The total number of actions that the agent can perform is a i Different subsequent states will occur s i+1 , providing the corresponding reward function for the agent ; In the two-dimensional binning process, the current state observed at each time step is input into the Double DQN Q Network, the Q The network outputs the reward value for taking actions in this state, including: During the learning process of the agent, it will i Observed current state s i and strategies π , perform an action a i , and the strategy is adjusted according to the action-value function π To conduct an assessment: ; In the formula, G i Represents each time step i The cumulative reward of r i+k+1 Indicates the step length i+k+ The reward for 1 hour, k Indicates that from i After the start of the time step k time steps, γ Represents the discount factor; by maximizing the action-value function of the overall strategy, the action-value function in the optimal state is obtained , expressed as: ; Using Double DQN Q network and target network To fit the action-value function, and update the network parameters θ and θ - To approach the optimal ; The Double DQN Q network and target network The hidden layers of are composed of three fully connected layers. s i Next action a i The next state obtained s i+1 As time step i +1 Q The input of the network is the generated state-action pairs ( s i+1 , a i+1 ) as the action-value function value of the time step i +1 Q The output of the network and update the two network parameters θ and θ - ; pass ε - greedy The method obtains the optimal scheduling strategy, including: the agent adopts ε - greedy Methods take actions, expressed as: ; In the formula, a i Indicates the time step i The action performed by the agent is expressed as 1- ε The probability of choosing the action with the largest reward is , and choosing a random action in other cases; represents the action-value function fitted by the Double DQN, Denotes the action space.

2. The control system task cloud scheduling method based on deep reinforcement learning according to claim 1 is characterized in that: The experimental test and neural network prediction of the running time required for the computing tasks in the control system under different numbers of CPU cores include: The computing task is to solve the linear quadratic optimal controller under infinite time conditions in the control system, and to establish a linear time-invariant state space model for each linear quadratic optimal controller; The CPU running time required to solve the linear quadratic optimal controller with different state dimensions and coefficient matrices under different numbers of CPU cores is collected through experimental methods; Feature extraction is performed on the coefficient matrix, and the experimental data is divided into four categories according to the length of running time and the number of CPU cores and labeled accordingly; a neural network model is introduced, the coefficient matrix features are used as model input, and the model is trained using a labeled data set, so that the model can predict the number of CPU cores and running time corresponding to different linear quadratic optimal controllers.

3. The control system task cloud scheduling method based on deep reinforcement learning according to claim 2 is characterized in that: A linear time-invariant state space model is established for each of the linear quadratic optimal controllers, including: The linear time-invariant state space model is: ; In the formula, yes t The system state vector at time , yes t The control input vector at time , t ∈[0,∞); and are the coefficient matrices of the system respectively; In the design of the optimal controller, given the quadratic cost function: ; In the formula, and is a semi-positive definite matrix, by designing a state feedback controller To minimize the cost function J , to solve the optimal control strategy; where the state feedback matrix By solving ARE, the expression is: ; In the formula P 0 is the matrix to be determined of ARE.

4. The control system task cloud scheduling method based on deep reinforcement learning according to claim 1 is characterized in that: A two-dimensional array is used to represent the two-dimensional container used for packing, where the unoccupied space during packing is represented by 0 and the occupied space is represented by 1. i When , four characteristics are used to represent the current state of the system s i , denoted as s i =( H , U , P , G ),in: H It is the abbreviation of Height, which means the sum of the heights of the elements in each column that are 1 in the current state; U It is the abbreviation of Unevenness, which means the sum of the height differences between the elements of two adjacent columns that are 1 in the current state; P It is the abbreviation of Perfect lines, which means the number of rows where all elements are 1 in the current state; G It is the abbreviation of Gaps, which indicates the number of holes with zero elements between the occupied spaces in the current state.

5. The control system task cloud scheduling method based on deep reinforcement learning according to claim 1 is characterized in that: The method further comprises: In the two-dimensional packing process, the size of the action space is reduced by deleting invalid actions in each state. When there is no valid action in the action space of a state, the state is the terminal state.

6. The control system task cloud scheduling method based on deep reinforcement learning according to claim 4 is characterized in that: In the i The current state of the time step s i Each action will produce a different subsequent state. s i+1 , for these actions that lead to different results a i , the following reward function is defined: ; In the formula, represents the size of the cluster, Indicates the compactness of the cluster. Indicates the number of newly formed Perfect lines. Indicates a constant multiple of the box width; The interpretation of is as follows: if an element is connected to another element horizontally or vertically, they belong to the same cluster; The interpretation is as follows: at the time step i When action was taken a i , resulting in a new cluster c i , the cluster size is ; Introduce a new variable , which means that it can surround the cluster c i The size of the smallest rectangle of the cluster is defined as: 。 7. The control system task cloud scheduling method based on deep reinforcement learning according to claim 1 is characterized in that: The method further comprises: During the network parameter update process, the target network Parameters θ - A soft update will be used to replicate the Q network Parameters θ , the parameters θ The update formula is: ; Said θ - The soft update formula is: ; In the formula τ Indicates the soft update rate.

Citation Information

Patent Citations

  • Intelligent agent training method, cross-domain heterogeneous environment task scheduling method and related device

    CN114757352A

  • Product quality real-time prediction, regulation and control method and system based on process dynamic mode

    CN115204492A