Serial scheduling method for environment part reusable test tasks

Through graph embedding module, node embedding module and pointer network module, combined with reinforcement learning algorithm, local optimal problems in complex task scheduling are solved, and task scheduling methods of global optimal solutions and efficient calculations are realized, which are suitable for large-scale tasks.

CN118916141APending Publication Date: 2024-11-08NO 8511 RES INST OF CASIC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411079245.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The existing technology is difficult to find global optimal solutions in complex task scheduling scenarios. Heuristic algorithms such as greedy algorithms, simulated annealing algorithms and 2-opt neighborhood search are prone to local optimality, and have high computational complexity, making it difficult to cope with large-scale tasks. .

Method used

The graph embedding module, node embedding module and pointer network module are adopted. The graph embedding module is based on the graph neural network to capture the task graph structure, and the node embedding module improves the feature representation based on the long and short-term memory network. The pointer network module calculates the task selection probability through the attention mechanism and generates The optimal task execution sequence is combined with reinforcement learning algorithm optimization model.

Benefits of technology

Effectively capture the global dependence between tasks, avoid local optimal solutions, dynamically adjust the task order to minimize the total execution time, have high computing efficiency, and adapt to dynamically changing task requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916141A_ABST
    Figure CN118916141A_ABST
Patent Text Reader

Abstract

The invention discloses a serial scheduling method for environment part reusable test tasks. The serial scheduling method at least comprises a graph embedding module, a node embedding module and a pointer network module, the graph embedding module is responsible for capturing the relation between nodes in a task graph structure based on a graph neural network and providing sufficient global feature information for subsequent scheduling; the node embedding module is used for embedding nodes into high-dimensional hidden variables based on a long short-term memory network, so that the representation capability of the model is improved, and richer local node feature information is provided for the subsequent pointer network module; the pointer network module calculates the probability that each task is selected through an attention mechanism based on the Ptr-Net sequence-to-sequence neural network, so that the optimal task execution sequence is generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of task scheduling technology, specifically relating to a serial scheduling method for environmentally reusable experimental tasks. Background Technology

[0002] 1. Traditional optimization methods

[0003] Combinatorial optimization problems have long attracted extensive research and solutions. Traditional solution methods mainly include branch and bound and various heuristic and exact algorithms from the field of Operational Research (OR). Branch and bound finds the optimal solution by systematically decomposing the problem space, but its high computational complexity makes it difficult to apply to large-scale problems. Furthermore, specialized solvers like Concorde, while performing excellently on small-scale problems, fall short when faced with dynamic requirements and large-scale tasks.

[0004] 2. Heuristic Algorithms

[0005] Heuristic algorithms play a crucial role in task scheduling problems, particularly by providing efficient approximate solutions to alleviate computational complexity. However, these methods also have limitations, especially in their global optimization capabilities. Greedy algorithms, simulated annealing, and 2-opt neighborhood search are some commonly used heuristic algorithms.

[0006] A greedy algorithm is an algorithm that progressively builds a solution, choosing the most advantageous option at each step in order to eventually reach the globally optimal solution. In task scheduling, a greedy algorithm can select the task with the shortest current switching time based on the task transition time. This method is simple, computationally fast, and suitable for handling small-scale and low-complexity task scheduling problems. However, greedy algorithms lack a global perspective, are prone to getting trapped in local optima, and cannot guarantee reaching the globally optimal solution. Therefore, their performance is not ideal in complex task scheduling scenarios.

[0007] Simulated annealing is a probabilistic optimization algorithm inspired by the annealing process in physics. This algorithm escapes local optima and gradually approaches the global optimum by randomly selecting new solutions in the search space and accepting inferior solutions with a certain probability. Specifically, simulated annealing first selects an initial solution and sets an initial temperature. At each temperature, a neighborhood solution is randomly selected. If the neighborhood solution is better than the current solution, it is accepted; if it is worse, it is accepted with a certain probability, which decreases as the temperature decreases. By gradually decreasing the temperature until a stopping condition is reached, simulated annealing can achieve global optimization to a large extent. However, this algorithm has a long computation time and complex parameter tuning, especially the control of temperature decrease, which has a significant impact on the algorithm's performance.

[0008] 2-opt neighborhood search is a heuristic algorithm based on local optimization, primarily used for optimizing path planning problems. Its basic idea is to find a better task execution order by swapping the positions of two tasks in a path. In task scheduling, 2-opt neighborhood search starts with an initial task sequence. In each iteration, a new task sequence is generated by swapping the positions of two tasks in the current sequence. Then, the total execution time of the new task sequence is calculated. If the new sequence is better, the current sequence is replaced, and this process is repeated until no further improvement is possible. Although the 2-opt neighborhood search algorithm is simple and easy to implement, and can optimize task execution order to some extent, it is prone to getting trapped in local optima and is highly dependent on the initial solution, failing to guarantee a globally optimal solution.

[0009] It is evident that although heuristic algorithms offer some solutions to the task scheduling problem, their effectiveness in complex scenarios is not ideal due to the lack of a global perspective and full utilization of complex task relationships. Summary of the Invention

[0010] This invention addresses the problems existing in the prior art by providing a serial scheduling method for reusable experimental tasks in the environment. It includes at least a graph embedding module, a node embedding module, and a pointer network module. The graph embedding module, based on a graph neural network (GNN), is responsible for capturing the relationships between nodes in the task graph structure, providing sufficient global feature information for the subsequent pointer network module. The node embedding module, based on a long short-term memory network (LSTM), embeds nodes into high-dimensional hidden variables, improving the model's representational ability and providing richer local node feature information for the subsequent pointer network module. The pointer network module, based on a Ptr-Net sequence-to-sequence (seq2seq) neural network, calculates the probability of each task being selected through an attention mechanism, thereby generating the optimal task execution order. This invention employs the GAPN model to capture the global dependencies between tasks and dynamically adjusts the task selection order through an attention mechanism, minimizing the total execution time based on task similarity and differences in switching time.

[0011] To achieve the above objectives, the technical solution adopted by the present invention is: a serial scheduling method for reusable experimental tasks in an environment-oriented manner, comprising at least a graph embedding module, a node embedding module, and a pointer network module.

[0012] The graph embedding module is based on a graph neural network (GNN) and is responsible for capturing the connections between nodes in the task graph structure, providing sufficient global feature information for subsequent scheduling.

[0013] The node embedding module is based on a Long Short-Term Memory (LSTM) network, which embeds nodes into high-dimensional hidden variables to improve the model's representation ability and provide richer local node feature information for the subsequent pointer network module.

[0014] The pointer network module is based on the Ptr-Net sequence-to-sequence (seq2seq) neural network. It calculates the probability of each task being selected through an attention mechanism, thereby generating the optimal task execution order.

[0015] The serial scheduling method for reusable experimental tasks in the environment-oriented part includes the following steps:

[0016] S1: Obtain the association information graph and feature vector of the task, and input them into the graph embedding module and node embedding module respectively;

[0017] S2: The graph embedding module extracts the embedding representation for each task. These embedding representations contain the features of the task and its relationship with other tasks. All node vectors are concatenated into a single input vector. in, To represent the features and graph relationships of a single node task, a multi-layer GNN structure is used to encode the graph structure into the model network, so as to map more features of the graph to a high-dimensional space, and send these global graph structure features to the pointer network module.

[0018] S3: The node embedding module embeds nodes into high-dimensional hidden variables, connects them to a Long Short-Term Memory (LSTM) network to encode the current node, selectively remembers important information and forgets unimportant information for long task sequence inputs, and finally sends the node embedding features to the pointer network module.

[0019] S4: After receiving the outputs from the graph embedding and node embedding modules, the pointer network module calculates the probability of each task being selected through an attention mechanism. It dynamically adjusts the task selection order based on the similarity between tasks to ensure the shortest total execution time. Based on the pointer network (Ptr-Net), sampling decoding is used during training, while greedy decoding is used during inference. Reinforcement learning algorithms are combined to optimize the model during training. The pointer network is a special form of Seq2seq network. Building upon the attention mechanism, it creates a network whose output is a pointer to the input elements, capable of generating variable-size output sequences. Because the length of the pointer network's output sequence depends on the input sequence, this overcomes the limitation of traditional sequence-to-sequence (seq2seq) models requiring a fixed sequence length. The network is trained using the Actor-Critic algorithm. The Actor network generates the task execution order, and the Critic network evaluates the effectiveness of the current strategy and guides the adjustment of the Actor network through feedback signals.

[0020] Compared to existing technologies: Compared to traditional heuristic algorithms, the GAPN model can capture global dependencies between tasks, avoiding getting trapped in local optima. Through a holistic understanding of the graph structure, the model can better optimize task scheduling order, ensuring optimal solutions are found even under complex task relationships. Ptr-Net dynamically adjusts the task selection order through an attention mechanism, optimizing task scheduling. This attention mechanism allows the model to flexibly adjust the task execution order based on task similarity and differences in switching time, thereby minimizing the total execution time.

[0021] Furthermore, neural network-based algorithms typically have high computational efficiency. Once trained, the model usually runs quickly during the inference phase, enabling it to rapidly generate task execution sequences and adapt to dynamically changing task requirements. Attached Figure Description

[0022] Figure 1 This is a flowchart of large-scale task serial scheduling.

[0023] Figure 2This is a schematic diagram of the graph structure representation of task sequence dependencies in this invention.

[0024] Figure 3 This is a comparison chart of the sequential execution time performance of the method of the present invention.

[0025] Figure 4 This is a comparison chart of the single-run time performance of the algorithm of the present invention. Detailed Implementation

[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0027] Example 1

[0028] A serial scheduling method for reusable experimental tasks in an environment-oriented manner, such as... Figure 1 As shown, it includes at least a graph embedding module, a node embedding module, and a pointer network module, which are responsible for capturing the connections between nodes in the task graph structure, embedding the nodes into high-dimensional hidden variables, calculating the probability of each task being selected through an attention mechanism, and thus generating the optimal task execution order.

[0029] The graph embedding module, based on a graph neural network (GNN), is responsible for capturing the connections between nodes in the task graph structure, providing sufficient global feature information for subsequent scheduling. The node embedding module, based on a long short-term memory network (LSTM), embeds nodes into high-dimensional hidden variables, improving the model's representational ability and providing richer local node feature information for the subsequent pointer network module. The pointer network module, based on a Ptr-Net sequence-to-sequence (seq2seq) neural network, calculates the probability of each task being selected through an attention mechanism, thereby generating the optimal task execution order. This invention has a simple structure and is easy to use. It first extracts the global and local node features of the task, and then uses Ptr-Net for sorting and output. It is particularly suitable for the special characteristics of large-scale task sequence serial processing applications, greatly reducing the time consumed by task serial processing, meeting practical needs, and is suitable for widespread application.

[0030] Example 2

[0031] A serial scheduling method for reusable experimental tasks in an environment-oriented manner comprises a graph embedding module, a node embedding module, and a pointer network module, each responsible for capturing the relationships between nodes in the task graph structure, embedding nodes into high-dimensional hidden variables, and calculating the probability of each task being selected through an attention mechanism. The scheduling method specifically includes the following steps:

[0032] Step S1: First, model the task scheduling problem as a completely undirected graph, where each node represents a task, and the weight D(i, j) of the edge between two nodes i and j represents the environment switching time between the two tasks. The structure of the model is as follows: Figure 2 As shown, the task's associated information graph and feature vectors are obtained and then input into the graph embedding module and node embedding module, respectively.

[0033] Step S2: The graph embedding module treats tasks as nodes in a graph, and the switching time between tasks as edge weights between nodes. Through the graph neural network, an embedding representation of each task can be extracted. These embedding representations contain the task's features and its relationships with other tasks. All node vectors are concatenated into a single input vector. Graph Neural Networks (GNNs) are used to encode all nodes. A GNN consists of L embedding layers, employing a multi-layer GNN structure to encode the graph structure into the model network. This allows for mapping more features of the graph into a high-dimensional space, preserving as much information and structure as possible from the original graph. The l-th graph embedding layer... It can be represented as follows:

[0034]

[0035] Here, φ is a trainable parameter, Θ is a trainable matrix, and N represents the regularization weights. Through graph encoding, GAPN can effectively capture the global features of nodes, providing sufficient feature information for path planning.

[0036] Step S3: The node embedding module enables the model to learn node features, thereby better understanding node attributes and states. Adding node embedding in addition to graph embedding helps extract important information about nodes, including relationships between nodes, features, and dynamic changes, thus providing richer input for subsequent modules. By embedding nodes into high-dimensional hidden variables, the model can better capture complex relationships and features between nodes, improving the model's representational ability. The obtained graph embedding vectors are then fed into a Long Short-Term Memory (LSTM) network to encode the current node. LSTM can selectively remember important information and forget unimportant information, thus better handling long sequence inputs.

[0037] Assume node i has m attributes Embedding vector of node i The calculation is as follows:

[0038]

[0039] in Both b are trainable parameters. The activation function relu(·) is defined as: relu(x) = max(x, 0); k represents the current attribute index.

[0040] Step S4: After obtaining the embedding representations of the nodes, the execution order of the tasks is generated using a pointer network. Ptr-Net is a sequence-to-sequence (seq2seq) model that uses an attention mechanism to calculate the probability of each task being selected, thereby generating the optimal task execution order.

[0041] Pointer networks can dynamically adjust the selection order of tasks based on their similarity, ensuring the shortest total execution time. When sorting to the j-th node, if the i-th node has not yet appeared in the strategy sequence, the pointer... Represented as:

[0042]

[0043] Where v represents the task position vector, T represents the transpose, W1 represents the unselected task weight matrix, W2 represents the selected task weight matrix, and o i Indicates that no task vector was selected, q i This indicates that a task vector has been selected. A novel masking scheme is used to accelerate the training phase, ensure the feasibility of the output sequence, and eliminate infeasible solutions. If node s i If a node has already been visited, it will be masked, and its pointer will be set to -∞. Finally, the probabilities on the candidate nodes are normalized using the softmax function, calculated as follows:

[0044]

[0045] Based on the probability of each task being selected GAPN can determine which node to select as the final output node. Generally, there are two decoding modes: sampling decoding and greedy decoding. In sampling decoding mode, the model selects the node based on probability sampling; while in greedy decoding mode, the model directly selects the node with the highest probability. This invention uses sampling decoding during training and greedy decoding during inference.

[0046] During training, we incorporate reinforcement learning algorithms to optimize the model. Reinforcement learning helps the model gradually improve its policy as it explores the task execution order, enabling it to find the global optimum. We use the Actor-Critic algorithm for training: the Actor network generates the task execution order, the Critic network evaluates the effectiveness of the current policy, and the feedback signals guide the Actor network's adjustments.

[0047] Example 3

[0048] The serial scheduling method for reusable experimental tasks in the environment-oriented part is implemented by deploying it on a machine that supports a Python environment and then calling it. The configurations, i.e., the environment, are as follows:

[0049] Program environment configuration: This program requires Python 3.8 and its required dependencies are PyTorch, pyg, and torchrl. These dependencies can be installed via pip.

[0050] Input task feature information and task dependency graph: Write the task feature information and task dependency relationship table into a JSON file according to a specific format, and use it as input parameters to call the program file.

[0051] Output: The algorithm scheduling result is an ordered list of tasks organized in a specific order, returned in JSON format.

[0052] Compared to traditional heuristic algorithms, the GAPN model can capture global dependencies between tasks, avoiding getting trapped in local optima. Through a holistic understanding of the graph structure, the model can better optimize task scheduling order, ensuring optimal solutions are found even with complex task relationships. Ptr-Net dynamically adjusts the task selection order through an attention mechanism, optimizing task scheduling. This attention mechanism allows the model to flexibly adjust the task execution order based on task similarity and differences in switching time, thereby minimizing the total execution time.

[0053] Furthermore, neural network-based algorithms typically have high computational efficiency. Once trained, the model usually runs quickly during the inference phase, enabling it to rapidly generate task execution sequences and adapt to dynamically changing task requirements.

[0054] Performance comparison of GAPN and the heuristic algorithm 2opt neighborhood search: Figure 3 , Figure 4 As shown.

[0055] It should be noted that the above content merely illustrates the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. For those skilled in the art, various improvements and modifications can be made without departing from the principle of the present invention, and all such improvements and modifications fall within the scope of protection of the claims of the present invention.

Claims

1. A serial scheduling method for reusable test tasks in the environment. It is characterized in that At least including a graph embedding module, a node embedding module and a pointer network module; The graph embedding module is based on a graph neural network and is responsible for capturing the connections between nodes in the task graph structure, providing sufficient global feature information for subsequent scheduling; The node embedding module is based on the long short-term memory network, embeds the nodes into high-dimensional hidden variables, improves the representation ability of the model, and provides richer local node feature information for the subsequent pointer network module; The pointer network module is based on the Ptr-Net sequence-to-sequence neural network, and calculates the probability of each task being selected through the attention mechanism, thereby generating the optimal task execution order.

2. The serial scheduling method for partially reusable test tasks oriented to the environment according to claim 1, It is characterized in that The steps include: S1: Obtain the task's associated information graph and feature vector, and input them into the graph embedding module and node embedding module respectively; S2: The graph embedding module extracts the embedding representation of each task and sends it to the pointer network module; S3: The node embedding module embeds the node into a high-dimensional hidden variable, connects to the long short-term memory network to encode the current node, selectively remembers important information and forgets unimportant information for the long task sequence input, and finally sends the node's embedded features to the pointer network module; S4: After the pointer network module receives the output results of the graph embedding module and the node embedding module, it calculates the probability of each task being selected through the attention mechanism, and dynamically adjusts the selection order of tasks according to the similarity between tasks to ensure the shortest total execution time.

3. The serial scheduling method for partially reusable test tasks oriented to the environment according to claim 2, It is characterized in that In S2, the graph embedding module extracts the embedding representation of each task and sends it to the pointer network module as follows: The above embedding representation contains the characteristics of the task and its relationship with other tasks. All node vectors are concatenated into an input vector in, Representing the features and graph relationships of a single node task, a multi-layer GNN structure is used to encode the graph structure into the model network, so as to map more features of the graph into a high-dimensional space and send these global structural features of the graph to the pointer network module.

4. The serial scheduling method for partially reusable test tasks oriented to the environment according to claim 3, It is characterized in that In S4, the pointer network uses sampling decoding during training and greedy decoding during inference. The reinforcement learning algorithm is used to optimize the model during training.

5. The serial scheduling method for partially reusable test tasks oriented to the environment according to claim 4, It is characterized in that The pointer network is a special form of Seq2seq network. Based on the attention mechanism, it creates a network whose output is a pointer to the input element, which can generate output sequences of variable size.

6. The serial scheduling method for partially reusable test tasks oriented to the environment according to claim 5, It is characterized in that The pointer network is trained using the Actor-Critic algorithm. The Actor network generates the task execution order, and the Critic network evaluates the quality of the current strategy and guides the adjustment of the Actor network through feedback signals.