Two-stage workflow scheduling method and system based on deep reinforcement learning

Through the two-stage workflow scheduling method of deep reinforcement learning and residual network, the local optimal problem of the workflow scheduling algorithm in cloud computing in complex environments is solved, and the resource utilization and efficiency, adaptability and versatility are improved.

CN118519752BActive Publication Date: 2024-10-01SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410971556.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-10-01
Estimated Expiration
2044-07-19

AI Technical Summary

Technical Problem

Existing cloud computing workflow scheduling algorithms are difficult to achieve global optimal solutions when dealing with complex and dynamic environments, are prone to falling into local optima, lack versatility, and are difficult to adapt to multi-objective optimization and constraints, resulting in low resource utilization and efficiency. .

Method used

A two-stage workflow scheduling method based on deep reinforcement learning is used, combined with the residual network, to select priority tasks according to task attributes and urgency through the task selection stage, and consider task dependencies and resource availability in the resource allocation stage, and use the TD2QN algorithm to dynamically schedule , optimize resource allocation.

Benefits of technology

It improves resource utilization, reduces resource usage costs, significantly improves workflow scheduling efficiency and performance in cloud computing environments, can better adapt to complex environments, avoid local optimal solutions, and has higher versatility and adaptability. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118519752B_ABST
    Figure CN118519752B_ABST
Patent Text Reader

Abstract

The present invention relates to a two-stage workflow scheduling method and system based on deep reinforcement learning, and belongs to the technical field of deep reinforcement learning. It includes: 1) constructing a workflow pool according to the workflow and data transmission information provided by the user, and initializing the state and number of tasks of each workflow; 2) looping through each workflow using the TD2QN algorithm, and adding the entry task to the ready queue; dynamically selecting the tasks entering the ready task queue using the TD2QN algorithm, and allocating appropriate computing resources to the tasks, thereby maximizing the efficiency and performance of the entire workflow; 3) when the workflow is successfully completed, generating and returning detailed information about the completed workflow, and providing users with comprehensive scheduling results and performance evaluation. The present invention comprehensively considers cost and communication time, and improves system efficiency and performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a two-stage workflow scheduling method and system based on deep reinforcement learning, and belongs to the technical field of deep reinforcement learning. Background Art

[0002] With the rapid development of cloud computing technology, heterogeneous cloud environments have become one of the main platforms for large-scale data processing, deep learning, and scientific computing. Under the construction of elastic cloud architecture, how to effectively respond to diverse computing business needs has become an urgent and challenging task. Workflows are usually presented in the form of directed acyclic graphs, carrying massive computing tasks, and have been widely used with the continuous growth of complex computing needs in various application fields. Its essence is to schedule multiple interdependent subtasks to service resources for execution to meet the relevant service quality constraints defined by users and complete the execution of all subtasks under predefined objective functions. Although the cloud computing environment provides large-scale computing resources to ensure the stability of computing services, however, in terms of processing resource-intensive tasks and heterogeneous workflow computing needs, the optimization and adaptation problems between computing services still need to be solved.

[0003] Workflow scheduling is a complex challenge that involves optimal allocation of resources and scheduling of tasks in a network. The importance of this problem lies not only in its wide application in practical scenarios, but also in its criticality. However, as it is proven to be an NP-hard problem, finding its optimal solution is an extremely difficult task. First, in cloud computing environments, the attributes of tasks and user requirements are diverse and changeable, showing a high degree of flexibility. Different tasks have different degrees of dependence on various types of resources, and users' requirements for these resources may also change over time. Second, in cloud computing environments, the limited nature of resources determines the need to configure them in a highly efficient manner to meet user needs to the greatest extent and provide high-quality and high-performance services. At the same time, resource competition and conflict are common phenomena. Multiple tasks or users may compete for the same resources at the same time, which may lead to resource contention and increased execution delays. Therefore, it is crucial to develop an effective resource allocation and scheduling strategy to coordinate resource contention and ensure fair allocation and optimal utilization of resources.

[0004] In order to achieve efficient task scheduling, researchers have proposed various novel research methods. Existing cloud computing task scheduling methods are generally divided into the following categories: 1) Traditional static scheduling methods: Traditional static scheduling methods include shortest job first (SJF) scheduling, earliest deadline first (EDF) scheduling and static polling scheduling, etc. The essence of these methods is to predetermine the execution order of tasks and resource allocation schemes before the arrival of tasks based on known task and resource attributes. These methods do not consider the changes in task or resource status during the scheduling process, that is, the arrival time, execution time, resource availability, etc. of the tasks are all known, so they have limited processing capabilities for dynamic environments or complex task dependencies. 2) Multi-objective evolutionary algorithms: Multi-objective evolutionary algorithms include traditional multi-objective linear programming, decision tree-based methods, decomposition-based techniques, and non-dominated sorting genetic algorithms. Although these methods can effectively handle multi-objective optimization problems and find balanced solutions between different objectives, they usually require a lot of computing resources and time to search for multiple non-dominated solutions, and may converge to local optimal solutions, resulting in insufficient diversity of solutions. 3) Heuristic scheduling algorithms: This type of algorithms includes greedy algorithms, genetic algorithms, simulated annealing algorithms, ant colony algorithms, and particle swarm algorithms. These algorithms quickly find satisfactory solutions by utilizing heuristic rules or strategies without guaranteeing global optimality. They are suitable for solving various scheduling challenges in cloud environments, such as task allocation and resource management, but their performance depends heavily on the appropriate heuristic parameter selection and problem-specific characteristics.

[0005] With the rapid development of machine learning, reinforcement learning has emerged as an important branch of machine learning, which aims to enable intelligent agents to learn optimal strategies through interaction with the environment to maximize expected long-term rewards. Reinforcement learning has been widely used in various fields, including scheduling, chess, and robotics. In the field of scheduling, reinforcement learning has been successfully applied to problems such as job shop scheduling, logistics distribution, and resource scheduling. Deep reinforcement learning combines the perception ability of deep learning with the decision-making ability of reinforcement learning, and can handle larger and more complex state spaces and action spaces. By extracting useful experience from the data generated during the search process, deep reinforcement learning can more effectively use this experience in the subsequent search process to make better decisions.

[0006] In summary, with the expansion of the scale of cloud environment clusters and the increase in the number of service users, the resource heterogeneity and user job types in the cloud environment have also increased. In heterogeneous cloud environments, task scheduling plays a vital role in optimizing resource utilization and improving job execution efficiency. Existing scheduling algorithms have made some progress in workflow scheduling optimization, but there are still some problems to be solved. First, although multiple optimization objectives are considered, such as completion time, cost, energy consumption, and resource utilization, these objectives conflict in practical applications and need to be better balanced. At the same time, this method usually relies on heuristic rules or static strategies. When dealing with complex environments and large-scale task scheduling problems, it may lack the ability to adapt to dynamic environments, be difficult to achieve global optimization, and have limited ability to handle complex relationships between tasks. There is a problem of being easily trapped in local optimal solutions, resulting in the inability to find global optimal solutions. Therefore, more accurate optimization algorithms need to be further studied to overcome this limitation. In addition, some algorithms may be too focused on specific scenarios or problem types, lack generality, and are difficult to apply to other scenarios or problems. Further exploration is still needed in solving multi-objective optimization and constraint processing to achieve high quality and high efficiency of task scheduling solutions. Summary of the invention

[0007] In view of the shortcomings of the existing technology, the present invention proposes a two-stage workflow scheduling method based on deep reinforcement learning;

[0008] This paper proposes a scheduling algorithm (TD2QN) based on two-stage deep reinforcement learning and residual network. In the task selection stage, the agent selects the tasks that need to be executed first according to the attributes of the task and the urgency of weighing the execution of the task and its subtasks. In the resource allocation stage, the dependencies between tasks and the availability of resources are considered to reasonably allocate tasks to virtual execution. At the same time, the residual network is introduced as the structure of the neural network to improve the performance and stability of the model, so as to better adapt to the complex workflow environment, improve resource utilization and reduce resource usage costs.

[0009] The present invention also proposes a two-stage workflow scheduling system based on deep reinforcement learning.

[0010] The technical solution of the present invention is:

[0011] A two-stage workflow scheduling method based on deep reinforcement learning, including:

[0012] 1) Build a workflow pool based on the workflow and data transmission information (data source, data target, data volume, etc.) provided by the user, and initialize the status and number of tasks of each workflow;

[0013] 2) Use the TD2QN algorithm to loop through each workflow and add the entry task to the ready queue;

[0014] The tasks that enter the ready task queue are dynamically selected using the TD2QN algorithm, and appropriate computing resources are allocated to the tasks to maximize the efficiency and performance of the entire workflow; including:

[0015] In the task selection phase, the agent selects the tasks that need to be executed first based on the attributes of the tasks and the urgency of the tasks and their subtasks.

[0016] In the resource allocation phase, the dependencies between tasks and the availability of resources are considered, and tasks are reasonably allocated to virtual machines for execution;

[0017] After the task is completed, the available time of the virtual machine is updated and a check is made as to whether subsequent tasks can be added to the ready queue;

[0018] 3) When a workflow is successfully completed, detailed information about the completed workflow is generated and returned, providing users with comprehensive scheduling results and performance evaluation.

[0019] Preferably, according to the present invention, the workflow is modeled as a directed acyclic graph DAG, wherein each node represents a task to be completed, and the directed edges between the nodes represent the dependencies between the tasks;

[0020] A directed acyclic graph DAG is represented as a tuple: , where the set of all tasks is represents, n represents the number of tasks, express The tasks; Represents the constraint relationship between tasks; if the task and tasks If they are arranged on different processors, the communication cost between them is greater than zero. Conversely, if they are arranged on the same processor, the communication cost between them is zero. For the task The amount of data; if the task and tasks There is an edge between , then at the edge Starting point tasks For the task Precursor tasks, tasks The set of all predecessor tasks is recorded as , the task at the edge endpoint For the task The successor task, task The set of all successor tasks of is denoted as ; In a directed acyclic graph, a task without any predecessor is called an entry task, denoted by At the same time, the task without any successor is called the exit task, denoted by .

[0021] Preferably, according to the present invention, in the task selection stage, the action space covers the selectable actions in the current state, and the action vector A is defined as: ;

[0022] The state space refers to the set of various states that the environment may be in; the state space S is defined as the decision space of the agent determined by the ready task queue information, which is formally expressed as: ;in, Represents a subtask in the ready task list. Indicates unfinished tasks in the current workflow. Representation Task , The dependencies between them;

[0023] The value of the immediate reward represents the reward function , after selecting the task, calculate from the current state to the next state;

[0024] ;

[0025] in, Represents actions in state space The urgency characteristic value of the corresponding task;

[0026] ;

[0027] in, Indicates the urgency of the subsequent task; A vector representing the dependent features of the subsequent task in the state space, Indicates action The successor task of the corresponding task depends on the characteristic value;

[0028] ;

[0029] in, is a weight parameter used to balance the impact of the current task urgency and the subsequent task urgency on the reward value; is the reward function;

[0030] The agent selects the priority tasks in the state space according to the dependent feature values ​​of the subsequent tasks, monitors the task status in real time and dynamically adjusts the selection strategy.

[0031] Preferably, according to the present invention, the resources include m virtual machines of different types, namely VM instances; the cloud resources are represented as a four-tuple: ,in, , is a set of VM instances, , is the type of VM, , is the computing power of the VM, is the unit price of the VM cycle.

[0032] Preferably, according to the present invention, in the resource allocation stage, resource allocation is achieved through a resource scheduling model;

[0033] The factors to be considered in implementing resource scheduling are as follows:

[0034] Data transfer time: Task and tasks Data transfer time between Defined as:

[0035] ;

[0036] in, It is a data center and The transmission rate between is the amount of data transferred between the two tasks;

[0037] Subtask execution time: Subtask execution time It is related to the amount of data in the task and the computing power of the instance and is defined as:

[0038] ;

[0039] in, For the task The amount of data, For example computing power;

[0040] The start and end time of the subtask;

[0041] The earliest start time of the subtask Defined as:

[0042] ;

[0043] in, is the arrival time of the entry task, To allocate on the instance The set of subtasks on For the task A collection of predecessor tasks with dependencies;

[0044] is the end time of the task, defined as:

[0045] ;

[0046] Subtask execution cost: Subtask execution cost Defined as:

[0047] ;

[0048] in, For virtual machines The cycle time, For virtual machines The unit price of the cycle.

[0049] Preferably, according to the present invention, the resource scheduling model includes a deep Q network, namely DQN;

[0050] The goal of a deep Q-network is to learn an approximate value function , where S is the state, a is the action, and θ is the neural network parameter; the structure of DQN is as follows:

[0051] ;

[0052] in, is a true value function;

[0053] The goal of DQN is to minimize the following loss function:

[0054] ;

[0055] in, is the loss function, is the expected value, is the next state reward value, is the target Q value, defined as follows:

[0056] ;

[0057] in, For instant rewards, is the discount factor, the next state All possible actions The corresponding maximum value.

[0058] Preferably, according to the present invention, the resource scheduling model further includes a residual network;

[0059] The residual network builds a deep network through residual blocks; the residual block includes multiple convolutional layers and batch normalization layers, as well as a residual connection; the residual block is divided into a basic residual block and a bottleneck residual block; the basic residual block includes two convolutional layers, and the bottleneck residual block includes a 1x1 convolutional layer, a 3x3 convolutional layer, and a 1x1 convolutional layer;

[0060] The output of the residual block is expressed as:

[0061] ;

[0062] in, For input, represents the residual learning function, Represents the weight parameters inside the residual block.

[0063] Preferably, according to the present invention, in the resource allocation stage, the dependencies between tasks and the availability of resources are considered, and tasks are reasonably allocated to virtual machines for execution; including:

[0064] The priority tasks selected in the task selection stage are allocated to appropriate virtual machines (VMs) based on the comprehensive reward function, i.e. the dependent eigenvalues ​​of the subsequent tasks. The resource usage is monitored in real time, and the resource allocation strategy is adjusted dynamically. The intelligent agent continuously monitors the task status and makes reasonable use of resources and load balancing based on the latest resource and task information.

[0065] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a two-stage workflow scheduling method based on deep reinforcement learning are implemented.

[0066] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a two-stage workflow scheduling method based on deep reinforcement learning.

[0067] A two-stage workflow scheduling system based on deep reinforcement learning, including:

[0068] The workflow construction and initialization module is configured to: construct a workflow pool according to the workflow and data transmission information provided by the user, and initialize the state and task quantity of each workflow;

[0069] The task selection module is configured as follows: the agent selects the tasks that need to be executed first according to the attributes of the tasks and the urgency of the execution of the tasks and their subtasks;

[0070] The resource allocation module is configured to consider the dependencies between tasks and the availability of resources and reasonably allocate tasks to virtual machines for execution.

[0071] The beneficial effects of the present invention are:

[0072] The present invention proposes a two-stage workflow scheduling method and system based on deep reinforcement learning, which has the following beneficial effects:

[0073] 1) Aiming at the workflow scheduling problem in cloud computing, a workflow scheduling method based on two-stage deep reinforcement learning is proposed. First, the agent determines the priority tasks according to the task attributes and urgency trade-offs. Secondly, in the resource allocation stage, the task dependencies and resource availability are considered, and the tasks are reasonably allocated to virtual machines for execution, taking into account the cost and communication time to improve the system efficiency and performance.

[0074] 2) When introducing the detailed design and implementation of the method of the present invention, states, actions and rewards are defined for the scheduling decision points in the workflow scheduling problem so that the agent can learn from the environment and make corresponding scheduling decisions. At the same time, the idea of ​​residual network is cited to improve the training ability of the model.

[0075] 3) To verify the effectiveness of the proposed method, the proposed method was compared with some other advanced scheduling methods. Through a series of experiments conducted in real workflows, the proposed method performed better in scheduling workflows of different scales and forms. These experimental results show that the workflow scheduling method based on two-stage deep reinforcement learning has significant performance advantages in solving scheduling problems in complex cloud computing environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 This is a schematic diagram of the cloud workflow scheduling system architecture;

[0077] Figure 2 It is a flowchart of a two-stage workflow scheduling method based on deep reinforcement learning of the present invention;

[0078] Figure 3 Directed acyclic graph formed to model workflow;

[0079] Figure 4 This is the architecture diagram of the residual network;

[0080] Figure 5 Scheduling flow chart for deep reinforcement learning workflow;

[0081] Figure 6 It is the directed acyclic graph of the actual workflow Montage;

[0082] Figure 7 Directed acyclic graph for real-world workflow Epigenomics;

[0083] Figure 8 Directed acyclic graph for the actual workflow LIGO;

[0084] Fig. 9 It is the directed acyclic graph of the real workflow CyberShake;

[0085] Fig.10 It is the directed acyclic graph of the real workflow Sipht;

[0086] Fig.11 This is a schematic diagram of the completion time under different numbers of workflows;

[0087] Fig.12 This is a diagram of the completion time under different numbers of tasks;

[0088] Fig.13 This is an indication of the completion time for different types of tasks. Figure 1 ;

[0089] Fig.14 This is an indication of the completion time for different types of tasks. Figure 2 ;

[0090] Fig.15 It is a schematic diagram of the cost under different numbers of workflows;

[0091] Fig.16 This is a schematic diagram of the cost under different numbers of tasks;

[0092] Fig.17 This is an illustration of the cost of different types of tasks. Figure 1 ;

[0093] Fig.18 This is an illustration of the cost of different types of tasks. Figure 2 . DETAILED DESCRIPTION

[0094] The present invention will be further defined below in conjunction with the accompanying drawings and embodiments, but is not limited thereto.

[0095] Example 1

[0096] A two-stage workflow scheduling method based on deep reinforcement learning, such as Figure 2 As shown, including:

[0097] 1) Build a workflow pool based on the workflow and data transmission information (data source, data target, data volume, etc.) provided by the user, and initialize the status and number of tasks of each workflow;

[0098] 2) Use the TD2QN algorithm to loop through each workflow and add the entry task to the ready queue to prepare for subsequent scheduling.

[0099] The tasks that enter the ready task queue are dynamically selected using the TD2QN algorithm, and appropriate computing resources are allocated to the tasks to maximize the efficiency and performance of the entire workflow; including:

[0100] In the task selection phase, the agent selects the tasks that need to be executed first based on the attributes of the tasks and the urgency of the tasks and their subtasks.

[0101] In the resource allocation phase, the dependencies between tasks and the availability of resources are considered, and tasks are reasonably allocated to virtual machines for execution;

[0102] After the task is completed, the available time of the virtual machine is updated and a check is made as to whether subsequent tasks can be added to the ready queue, so as to achieve smooth workflow execution.

[0103] 3) When a workflow is successfully completed, detailed information about the completed workflow is generated and returned, providing users with comprehensive scheduling results and performance evaluation.

[0104] Example 2

[0105] The difference between the two-stage workflow scheduling method based on deep reinforcement learning described in Example 1 is that:

[0106] In the workflow scheduling problem, the workflow is modeled as a directed acyclic graph (DAG), where each node represents a task to be completed, and the directed edges between nodes represent the dependencies between tasks (data exchange). In this model, some subtasks can be executed in parallel, that is, at the same time, while other subtasks must wait for other subtasks to be completed before they can be executed. This is determined by the dependencies between tasks, such as Figure 3 shown.

[0107] A directed acyclic graph DAG is represented as a tuple: , where the set of all tasks is represents, n represents the number of tasks, express The tasks; Represents the constraint relationship between tasks; if the task and tasks If they are arranged on different processors, the communication cost between them is greater than zero. Conversely, if they are arranged on the same processor, the communication cost between them is zero. For the task The amount of data; if the task and tasks There is an edge between , then at the edge Starting point tasks For the task Precursor tasks, tasks The set of all predecessor tasks is recorded as , the task at the edge endpoint For the task The successor task, task The set of all successor tasks of is denoted as ; In a directed acyclic graph, a task without any predecessor is called an entry task, denoted by At the same time, the task without any successor is called the exit task, denoted by .

[0108] Given that the subtasks in a workflow may have parallelism and dependencies, as well as the parallelism of these subtasks, the execution order of these tasks must be considered to reasonably allocate resources to minimize the total execution time and cost of the workflow. Therefore, in the task selection stage, the action space covers the actions that can be selected in the current state, and selecting the best action in the task preprocessing queue is a decision-making process. Since each task ID is defined as an action, the action vector A is defined as: ;

[0109] The state space describes the state of the environment. Specifically, the state space refers to the set of various states that the environment may be in; in the current state, the agent needs to select a task from the preprocessing queue to execute. The selection and execution of the task will lead to the change of the state of the environment, thereby obtaining the next state. In the present invention, the state space S is defined as the decision space of the agent jointly determined by the ready task queue information, which is formally expressed as: ;in, Represents a subtask in the ready task list. Indicates unfinished tasks in the current workflow. Representation Task , The dependencies between them;

[0110] Reinforcement learning calculates the optimal actions and strategies based on the feedback of the reward function through continuous interaction with the environment. Therefore, the definition of the reward function is crucial to the entire learning process. The value of the immediate reward represents the reward function , after selecting the task, calculate from the current state to the next state;

[0111] ;

[0112] in, Indicates the urgency of the subsequent task; A vector representing the dependent features of the subsequent task in the state space, Indicates action The successor task of the corresponding task depends on the characteristic value;

[0113] ;

[0114] in, is a weight parameter used to balance the impact of the current task urgency and the subsequent task urgency on the reward value; is the reward function;

[0115] ;

[0116] in, Represents actions in state space The urgency characteristic value of the corresponding task;

[0117] In summary, in the task selection stage, the agent calculates the immediate reward and the urgency reward of the subsequent task by analyzing the priority, deadline, dependency and other attributes of the task, and combines them into a comprehensive reward function. The agent selects the priority task in the state space according to the dependency eigenvalues ​​of the subsequent task, monitors the task status in real time and dynamically adjusts the selection strategy to ensure efficient and timely completion of the task.

[0118] Example 3

[0119] The difference between the two-stage workflow scheduling method based on deep reinforcement learning described in Example 2 is that:

[0120] Resources include m virtual machines of different types, i.e. VM instances; cloud resources are represented as a four-tuple: ,in, , is a set of VM instances, , is the type of VM, , is the computing power of the VM, is the unit price of the VM cycle.

[0121] In the resource allocation stage, resource allocation is achieved through the resource scheduling model;

[0122] Workflow is a combination of parallel structure and sequential structure. Each task in a workflow can only be assigned to one VM, and a server can only execute one task at a time. When two tasks with dependencies are assigned to different VMs, a series of costs are generated. The factors to consider in implementing resource scheduling are as follows:

[0123] Data transfer time: Assigning subtasks of a given task to VMs in different data centers will increase the transmission delay. When calculating the task execution time, the transmission rate between different data centers must be considered. When subtasks are assigned to the same data center, the transmission rate can be ignored. The data transfer time between tasks in different data centers is determined by the amount of data transferred and the transmission rate. Therefore, the task and tasks Data transfer time between Defined as:

[0124] ;

[0125] in, It is a data center and The transmission rate between is the amount of data transferred between the two tasks;

[0126] Subtask execution time: Subtask execution time It is related to the amount of data in the task and the computing power of the instance and is defined as:

[0127] ;

[0128] in, For the task The amount of data, For example computing power;

[0129] The start and end time of the subtask;

[0130] The earliest start time of a subtask is subject to multiple factors: first, it is limited by the earliest available time of the virtual machine (VM); second, it is affected by the earliest completion time of the parent task; and finally, if there are dependent tasks, it is also affected by the completion time of their data transmission. Defined as:

[0131] ;

[0132] in, is the arrival time of the entry task, To allocate on the instance The set of subtasks on For the task A collection of predecessor tasks with dependencies;

[0133] is the end time of the task, defined as:

[0134] ;

[0135] Subtask execution cost: Subtask execution cost It is determined based on the running time of the computing task on the virtual machine and the cycle price of the virtual machine. Defined as:

[0136] ;

[0137] in, For virtual machines The cycle time, For virtual machines The unit price of the cycle.

[0138] The resource scheduling model includes the deep Q network, namely DQN;

[0139] Deep Q network, or DQN, is a reinforcement learning algorithm based on value iteration. The goal of deep Q network is to learn an approximate value function. , where S is the state, a is the action, and is the neural network parameter; in traditional Q learning, when the state and action space are discrete and relatively small, a Q table can be used to store the Q value corresponding to each state action. However, when the state and action space are continuous and high-dimensional, the use of Q tables becomes impractical. DQN solves this problem by using a neural network to approximate the value function. The structure of DQN is shown below:

[0140] ;

[0141] in, is the real value function; the advantage of DQN is the introduction of the target network (TargetNet) and the experience replay pool. The target network and the evaluation network (MainNet) have the same structure, but different parameters. The parameters of the target network is the parameter from some time ago, and the parameter θ of the evaluation network is the current parameter. The purpose of this is to reduce the sample correlation in training and increase the stability of the algorithm.

[0142] The goal of DQN is to minimize the following loss function:

[0143] ;

[0144] in, is the loss function, is the expected value, is the next state reward value, is the target Q value, defined as follows:

[0145] ;

[0146] in, For instant rewards, is the discount factor, the next state All possible actions The corresponding maximum value.

[0147] The target Q value is calculated using the target network, which keeps the target Q value constant over a certain period of time, thereby reducing the variance during training.

[0148] The resource scheduling model also includes residual networks;

[0149] Residual Networks is a deep neural network structure that aims to solve the problems of gradient disappearance and gradient explosion in deep learning. It uses skip connections and residual learning mechanisms to allow the network to effectively learn residual information during training, making it easier to train very deep networks.

[0150] like Figure 4 As shown in the figure, the residual network builds a deep network through residual blocks; the residual block includes multiple convolutional layers and batch normalization layers, as well as a residual connection; the residual connection allows the network to skip a certain number of layers and pass the input directly to the subsequent layers, so that the network can learn residual mapping. The residual block is divided into a basic residual block and a bottleneck residual block; the basic residual block includes two convolutional layers, and the bottleneck residual block includes a 1x1 convolutional layer, a 3x3 convolutional layer, and a 1x1 convolutional layer; to reduce the number of parameters and the amount of calculation.

[0151] The output of the residual block is expressed as:

[0152] ;

[0153] in, For input, represents the residual learning function, Represents the weight parameters inside the residual block.

[0154] In the resource allocation phase, the dependencies between tasks and the availability of resources are considered, and tasks are reasonably allocated to virtual machines for execution; this includes:

[0155] like Figure 5As shown in the figure, the two-stage workflow scheduling model based on deep reinforcement learning analyzes task attributes, calculates the comprehensive reward function, and selects priority tasks in the task selection stage; in the resource allocation stage, it monitors resource usage in real time, makes resource allocation decisions based on the resource scheduling model, and dynamically adjusts the resource allocation strategy to ensure efficient utilization of resources and timely completion of tasks.

[0156] In the resource allocation phase, the priority tasks selected in the task selection phase are allocated to appropriate virtual machines (VMs) based on the comprehensive reward function, i.e., the dependent eigenvalues ​​of the subsequent tasks obtained. The resource usage is monitored in real time, and the resource allocation strategy is adjusted dynamically to ensure efficient resource utilization and timely completion of tasks. The agent continuously monitors the task status, and makes reasonable use of resources and load balancing based on the latest resource and task information, optimizing system performance and response time.

[0157] The present invention defines the action selection of deep reinforcement learning as the selection instance, i.e. , the state space is defined as At the same time, according to the optimization goal, the reward function is defined as minimizing the sum of the time difference and cost between the next state and the current state:

[0158] ,in, is the weight parameter;

[0159] Table 1 Decision algorithm table based on TD2QN method;

[0160]

[0161]

[0162] This code implements a decision-making algorithm based on deep reinforcement learning. The input of the algorithm includes the task queue (Que) and the currently available virtual machine list (vm_list), and the output is the parameter θ of the neural network. The algorithm first initializes parameters such as the learning rate α, discount factor γ, random selection probability ε, learning frequency f, memory buffer size Δ, and replay period σ. Then, the algorithm randomly initializes the parameters θ and θ' of the evaluation Q network and the target Q network. Next, the algorithm enters a loop of multiple episodes. In each episode, the state space S is first initialized. Then, in each time step, an action is randomly selected with a probability of ε according to the strategy, and the action corresponding to the optimal value is selected with a probability of 1-ε. After executing the action, observe the reward and the next state, and store this information in the replay memory. If the current task is the last task, the target Set as current reward Otherwise, the predicted output of the next state is calculated by the neural network optimized by the residual network, and the target value is calculated by combining the discount factor and the maximum Q value of the next state Finally, the algorithm calculates the loss and uses gradient descent to update the parameters θ of the evaluation Q network and the parameters θ' of the target Q network.

[0163] In heterogeneous workflow scheduling, the fusion of deep reinforcement learning and residual networks has significant necessity and superiority. First, heterogeneous workflows involve multiple types of tasks and resources, where the execution time and resource requirements of each task may be highly different, so traditional scheduling methods often find it difficult to effectively adapt to this complexity. In addition, the workflow scheduling problem is usually a highly dynamic environment that requires real-time decision-making and adjustment to cope with resource changes and changing task requirements. Deep reinforcement learning provides a flexible method to learn complex strategies from historical observations and take corresponding actions based on the current state of the environment. However, deep reinforcement learning models often have complex nonlinear and high-dimensional state spaces, which leads to instability and convergence difficulties in traditional deep learning models during training. Therefore, the present invention introduces the idea of ​​residual networks. By introducing residual connections, the network can better capture and learn the relationship between complex states, while alleviating the problems of gradient vanishing and gradient exploding, thereby improving the stability and training effect of the deep reinforcement learning model. In addition, the residual network also has better gradient fluidity, which enables the network to better process deep features and information, thereby improving the generalization ability and performance of the model. Workflow frameworks based on deep reinforcement learning and residual networks such as Figure 4 shown.

[0164] Table 2 Specific implementation algorithm of the two-stage workflow scheduling method based on deep reinforcement learning;

[0165]

[0166] The algorithm describes a method based on two-stage workflow scheduling. First, it reads the workflow and data transfer information input by the user, adds them to the workflow pool, and initializes the completion status of the workflow and the number of remaining tasks of the current workflow (lines 1-3). Subsequently, each workflow is traversed and the entry task of the workflow is added to the task ready queue (lines 4-6). For all tasks in the ready list, the TD2QN algorithm is used to select tasks and match them with appropriate virtual machines, put them into the task execution list of the virtual machine, estimate their execution time, and estimate the latest available time of the virtual machine. After the task is completed, the task is deleted from the execution list of the virtual machine and the remaining tasks of the workflow, and it is checked whether the successor task can be added to the ready queue. Finally, when the workflow is completed, the completed workflow information is calculated and returned.

[0167] In this embodiment, different types and numbers of workflows are used to display the results.

[0168] The workflows used in this embodiment cover scientific applications similar to the real world, including Montage, Epigenomics, LIGO, CyberShake, Sipht, etc. These workflows have their own unique characteristics and have been widely used in workflow scheduling algorithms. Figure 6 It is the directed acyclic graph of the actual workflow Montage; Figure 7 Directed acyclic graph for real-world workflow Epigenomics; Figure 8 Directed acyclic graph for the actual workflow LIGO; Fig. 9 It is the directed acyclic graph of the real workflow CyberShake; Fig.10 It is a directed acyclic graph of the actual workflow Sipht.

[0169] This embodiment uses six different types of virtual machines for experimental configuration. These configurations are determined based on the general configurations provided by Amazon EC, specifically m3.medium, m3.large, m3.xlarge, m4.2xlarge, m4.4xlarge, and m4.10xlarge. The processing speed, memory, and price parameters of these virtual machines are detailed in Table 3.

[0170] Table 3 Parameters of virtual machine processing speed, memory and price;

[0171]

[0172] The evaluation indicators are as follows:

[0173] 1) makespan: Use the average time spent by S workflows to express:

[0174] ;

[0175] in, The completion time for each workflow.

[0176] 2) cost: The average cost of S workflows is used to represent:

[0177] ;

[0178] in, The cost for each workflow to complete.

[0179] 3) Resource utilization:

[0180] ;

[0181] in, is the usage time of the instance, The lease time of the instance.

[0182] The experimental results are as follows:

[0183] 1) Number of different workflows:

[0184] In the first experiment, the performance of the proposed method under different numbers of workflows is systematically evaluated. This example introduces 1, 5, 10, and 15 workflows into the experimental environment at an arrival rate of 0.1 / 60, and shows the experimental results. Fig.11 As shown in the figure, compared with other algorithms, TD2QN shows relatively stable and less execution time under different numbers of workflows, which shows that compared with LB-HEFT, GA-GWO and DQN algorithms, this algorithm may show excellent performance in task scheduling of various scales, and has certain robustness to changes in the number of workflows, effectively improving the efficiency of task scheduling, especially in large-scale task scheduling scenarios. For example, when 15 workflows are input into the environment, the execution time of the TD2QN algorithm is about 18%~27% higher than that of other methods.

[0185] In addition, from Fig.15 It can be observed that the execution cost of the TD2QN algorithm is reduced by 25% to 28% at each number of workflows, which further confirms that the algorithm has good adaptability in processing scenarios with a large number of workflows and high task complexity.

[0186] 2) Different number of tasks:

[0187] In order to further evaluate the performance of different scheduling algorithms under different scales of task numbers, this example selected 50, 100, 500 and 1000 Epigenomics type tasks as samples, and conducted a detailed exploration of algorithms such as LB-HEFT, GA-GWO, DQN and TD2QN in terms of execution time and scheduling cost. Specifically, the study found that the TD2QN algorithm showed significant advantages under all numbers of tasks, and its average time cost and scheduling cost were significantly lower than other algorithms. In terms of time cost, compared with traditional scheduling algorithms such as LB-HEFT and GA-GWO, this algorithm exhibits a faster task execution speed, which is particularly significant when the number of tasks reaches 1000. Fig.12Compared with the LB-HEFT algorithm, the time cost of this algorithm is reduced by about 9.0%, which shows its higher task parallelism and more effective resource scheduling strategy; compared with the DQN algorithm, the time cost of this algorithm is reduced by about 5.7%, which shows its more efficient task scheduling and resource allocation strategy. In terms of scheduling cost, the TD2QN algorithm also shows obvious advantages, such as Fig.16 As shown in the figure, its average scheduling cost is low, which reflects its high efficiency in resource utilization. In addition, the TD2QN algorithm can save about 18%-28% of the cost when facing a large number of tasks. In summary, the experimental results clearly show the excellent performance of the TD2QN algorithm in large-scale task scheduling scenarios. Its efficient task execution speed and optimized resource utilization make it an ideal choice for processing complex tasks and large-scale workloads.

[0188] 3) Different task types:

[0189] In order to explore the performance of the algorithm proposed in this paper in different types of tasks, the study selected five scientific workflows, namely Montage, Epigenomics, LIGO, CyberShake and Sipht, as research objects, and input 1,000 tasks into each workflow for experimental research.

[0190] according to Fig.13 , Fig.14 and Fig.17 , Fig.18 The data show that TD2Q exhibits superior performance in most workflow types, effectively shortening task completion time and reducing costs. Specifically, in the LIGO and Montage workflow types, TD2Q reduced task completion time by 19.74% and 8.8% respectively relative to LB-HEFT, and in the sipht and Epigenomics workflow types, TD2Q reduced costs by 2.7% and 21.9% respectively relative to GA-GWO. In the sipht and Montage workflow types, TD2Q reduced task completion time by 15.8% and 5.4% and costs by 18.6% and 3.8% respectively relative to the DQN algorithm. TD2Q has a clear advantage in balancing task completion time and cost.

[0191] 4) Utilization rate:

[0192] According to the data in Table 4, it can be observed that the performance of the TD2QN algorithm is relatively stable under different numbers of workflows and shows optimized resource utilization. In particular, when dealing with large-scale workflows, the TD2QN algorithm can achieve a performance improvement of between 0.6% and 10%, which makes it an ideal choice for handling complex tasks and large-scale workloads.

[0193] Table 4 Resource utilization under different workflow scales:

[0194]

[0195] In the embodiment, a new heterogeneous cloud resource scheduling method TD2QN based on deep reinforcement learning and residual network ideas is proposed to cope with challenging workflow scheduling problems. The algorithm of the present invention shows significant superiority in the scheduling of various types of workflows. Compared with advanced algorithms such as LB-HEFT, GA-GWO and DQN, the algorithm of the present invention performs better in terms of cost saving and improving resource utilization in workflow scheduling of different scales and forms. Especially in the scheduling of large-scale workflows, the execution time of the TD2QN algorithm is reduced by 25% to 28%, while saving about 18% to 28% of the cost, and increasing resource utilization by 0.6% to 10.5%.

[0196] The simulation results of the real-world scientific workflow dataset according to the present invention show that compared with advanced algorithms such as LB-HEFT, GA-GWO and DQN, the method of the present invention is superior in terms of cost saving and resource utilization in workflow scheduling of different scales and forms. When facing large-scale workflows, the execution time of the algorithm is reduced by 25% to 28%, while saving about 18% to 28% of the cost and improving resource utilization by 0.6% to 10.5%. It provides a feasible solution to the workflow scheduling problem in heterogeneous cloud environments.

[0197] Example 4

[0198] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the two-stage workflow scheduling method based on deep reinforcement learning described in any one of Examples 1-3 are implemented.

[0199] Example 5

[0200] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the two-stage workflow scheduling method based on deep reinforcement learning described in any one of Examples 1-3.

[0201] Example 6

[0202] A two-stage workflow scheduling system based on deep reinforcement learning, such as Figure 1 As shown, including:

[0203] The workflow construction and initialization module is configured to: construct a workflow pool according to the workflow and data transmission information provided by the user, and initialize the state and task quantity of each workflow;

[0204] The task selection module is configured as follows: the agent selects the tasks that need to be executed first according to the attributes of the tasks and the urgency of the execution of the tasks and their subtasks;

[0205] The resource allocation module is configured to consider the dependencies between tasks and the availability of resources and reasonably allocate tasks to virtual machines for execution.

Claims

1. A two-stage workflow scheduling method based on deep reinforcement learning, characterized in that: include: 1) Build a workflow pool based on the workflow and data transmission information provided by the user, and initialize the state and number of tasks of each workflow; 2) Use the TD2QN algorithm to loop through each workflow and add the entry task to the ready queue; The tasks that enter the ready task queue are dynamically selected using the TD2QN algorithm, and appropriate computing resources are allocated to the tasks to maximize the efficiency and performance of the entire workflow; including: In the task selection phase, the agent selects the tasks that need to be executed first based on the attributes of the tasks and the urgency of the tasks and their subtasks. In the resource allocation phase, the dependencies between tasks and the availability of resources are considered, and tasks are reasonably allocated to virtual machines for execution; After the task is completed, the available time of the virtual machine is updated and a check is made as to whether subsequent tasks can be added to the ready queue; 3) When the workflow is successfully completed, detailed information about the completed workflow is generated and returned, providing users with comprehensive scheduling results and performance evaluation; In the task selection phase, the action space covers the selectable actions in the current state, and the action vector A is defined as: A = {1, 2, ..., n}; The state space refers to the set of various states that the environment may be in. The state space S is defined as the decision space of the agent determined by the ready task queue information, which is formally expressed as: S = {Que, Rem, D(v i , v j )}; where Que=[v1,v2......v n ] represents the subtask in the ready task list, Rem = [v1, v2...v s ] indicates unfinished tasks in the current workflow, D(v i , v j ) represents task v i , v j The dependencies between them; The value of the immediate reward represents the reward function r urgency (s, a), calculates from the current state to the next state after selecting the task; Among them, s a Represents the urgency characteristic value of the task corresponding to action a in the state space; Among them, r succ_urgency (s, a) indicates the urgency of the subsequent task; s n+a:n+n The vector representing the dependent features of the subsequent task in the state space, s n+a Indicates the subsequent task dependency feature value of the task corresponding to action a; reward(s,a)=(1-α)r urgency (s,a)+αr succ_urgency (s,a) Among them, α is a weight parameter used to balance the impact of the urgency of the current task and the urgency of the subsequent task on the reward value; reward(s, a) is the reward function; The agent selects the priority tasks in the state space according to the dependent feature values ​​of the subsequent tasks, monitors the task status in real time and dynamically adjusts the selection strategy.

2. The two-stage workflow scheduling method based on deep reinforcement learning according to claim 1 is characterized in that: The workflow is modeled as a directed acyclic graph (DAG), where each node represents a task to be completed and the directed edges between nodes represent the dependencies between tasks. A directed acyclic graph DAG is represented as a tuple: G =<V,E> , where the set of all tasks is V = {v i |i∈n}, n represents the number of tasks, v i represents the i-th task in V; E = {e ij |1≤i≤n, 1≤j≤n} represents the constraint relationship between tasks; if task v i and task v j If they are arranged on different processors, the communication cost between them is greater than zero. On the contrary, if they are arranged on the same processor, the communication cost between them is zero. i ) is task v i The amount of data; if the task v i and task v j There is an edge e between ij , then at the edge ij Starting point task v i For task v j The predecessor task, task v j The set of all predecessor tasks is recorded as pred(v j ), task v at the end of the edge j For task v i The successor task, task v i The set of all successor tasks of is denoted as succ(v i ); In a directed acyclic graph, a task without any predecessor is called an entry task, denoted by v entry At the same time, the task without any successor is called the exit task, denoted by v exit .

3. The two-stage workflow scheduling method based on deep reinforcement learning according to claim 1 is characterized in that: Resources include m virtual machines of different types, i.e. VM instances; cloud resources are represented as a four-tuple:<M,T,H,P> , where M = {m i |1≤i≤m}, is a set of VM instances, T={t i |1≤i≤m}, is the type of VM, H={h i |1≤i≤m}, is the computing power of the VM, P={p i |1≤i≤m} is the period unit price of VM.

4. The two-stage workflow scheduling method based on deep reinforcement learning according to claim 1 is characterized in that: In the resource allocation stage, resource allocation is achieved through the resource scheduling model; The factors to be considered in implementing resource scheduling are as follows: Data transfer time: Task v i and task v j Data transmission time T t Defined as: Among them, B mn Data Center L m and L n The transmission rate between ij is the amount of data transferred between the two tasks; Subtask execution time: Subtask execution time E t (v i , m k ) is related to the amount of data in the task and the computing power of the instance, and is defined as: Among them, d(v i ) is task v i The amount of data, h k For instance m k computing power; The start and end time of the subtask; Set the earliest start time of the subtask ST(v i , m k ) is defined as: Among them, t(v entry ) is the arrival time of the entry task, All(m k ) is allocated in instance m k The set of subtasks on pred(v i ) is the same as task v i A collection of predecessor tasks with dependencies; FT(v p , m k ) is the end time of the task, defined as: FT(v i ,m k )=ST(v i ,m k )+E t (v i ,m k ) Subtask execution cost: Subtask execution cost E C (v i ) is defined as: Among them, CT (m k ) is the virtual machine m k The cycle time, p k For virtual machine m k The unit price of the cycle.

5. The two-stage workflow scheduling method based on deep reinforcement learning according to claim 4 is characterized in that: The resource scheduling model includes the deep Q network, namely DQN; The goal of the deep Q network is to learn an approximate value function Q(s, a; θ), where s is the state, a is the action, and θ is the neural network parameter; the structure of DQN is as follows: Q(s, a; θ)≈Q*(s, a) Among them, Q*(s, a) is the true value function.

6. The two-stage workflow scheduling method based on deep reinforcement learning according to claim 5 is characterized in that: The goal of DQN is to minimize the following loss function: L(θ)=E s,a,r,s′ [(y i -Q(s,a;θ)) 2 ]] Among them, L(θ) is the loss function, E s,a,r,s′ is the expected value, Q(s, a; θ) is the reward value of the next state, and y i is the target Q value, defined as follows: Among them, r i is the immediate reward, γ is the discount factor, and the next state s t+1 Under this condition, the maximum Q value corresponding to all possible actions a′.

7. The two-stage workflow scheduling method based on deep reinforcement learning according to claim 4 is characterized in that: The resource scheduling model also includes residual networks; The residual network builds a deep network through residual blocks; the residual block includes multiple convolutional layers and batch normalization layers, as well as a residual connection; the residual block is divided into a basic residual block and a bottleneck residual block; the basic residual block includes two convolutional layers, and the bottleneck residual block includes a 1x1 convolutional layer, a 3x3 convolutional layer, and a 1x1 convolutional layer; The output of the residual block is expressed as: Where x is the input, represents the residual learning function, {W i } represents the weight parameters inside the residual block.

8. The two-stage workflow scheduling method based on deep reinforcement learning according to any one of claims 1 to 7, characterized in that: In the resource allocation phase, the dependencies between tasks and the availability of resources are considered, and tasks are reasonably allocated to virtual machines for execution; include: The priority tasks selected in the task selection stage are allocated to appropriate virtual machines (VMs) based on the comprehensive reward function, i.e. the dependent eigenvalues ​​of the subsequent tasks. The resource usage is monitored in real time, and the resource allocation strategy is adjusted dynamically. The intelligent agent continuously monitors the task status and makes reasonable use of resources and load balancing based on the latest resource and task information.

9. A two-stage workflow scheduling system based on deep reinforcement learning, characterized by: include: The workflow construction and initialization module is configured to: construct a workflow pool according to the workflow and data transmission information provided by the user, and initialize the state and task quantity of each workflow; The task selection module is configured as follows: the agent selects the tasks that need to be executed first according to the attributes of the tasks and the urgency of the execution of the tasks and their subtasks; The resource allocation module is configured to: consider the dependencies between tasks and the availability of resources, and reasonably allocate tasks to virtual machines for execution; In the task selection phase, the action space covers the selectable actions in the current state, and the action vector A is defined as: A = {1, 2, ..., n}; The state space refers to the set of various states that the environment may be in; the state space S is defined as the decision space of the agent determined by the ready task queue information, which is formally expressed as: S = {Que, Rem, D(v i , v j )}; where Que=[v1,v2......v n ] represents the subtask in the ready task list, Rem = [v1, v2...v s ] indicates unfinished tasks in the current workflow, D(v i , v j ) represents task v i , v j The dependencies between them; The value of the immediate reward represents the reward function r urgency (s, a), calculates from the current state to the next state after selecting the task; Among them, s a Represents the urgency characteristic value of the task corresponding to action a in the state space; Among them, r succurgency (s, a) indicates the urgency of the subsequent task; s n+a:n+n The vector representing the dependent features of the subsequent task in the state space, s n+a Indicates the subsequent task dependency feature value of the task corresponding to action a; reward(s,a)=(1-α)r urgency (s,a)+αr succ_urgency (s,a) Among them, α is a weight parameter used to balance the impact of the urgency of the current task and the urgency of the subsequent task on the reward value; reward(s, a) is the reward function; The agent selects the priority tasks in the state space according to the dependent feature values ​​of the subsequent tasks, monitors the task status in real time and dynamically adjusts the selection strategy.