Task planning method and device, electronic equipment and readable medium

Through the combination of non-negative matrix decomposition and neural network model, the tasks to be planned are allocated one after another, which solves the time planning problem under multiple constraints, improves the solution speed and accuracy, and enhances the robustness and anti-interference ability of the model.

CN118536698AActive Publication Date: 2024-08-23BEIJING AEROSPACE CHENXIN TECH CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202410515295.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-26
Publication Date
2024-08-23
Estimated Expiration
2044-04-26

AI Technical Summary

Technical Problem

When dealing with time planning problems with multiple constraints and a large number of tasks, it is difficult for the existing technology to meet the requirements of solution speed and solution accuracy at the same time.

Method used

The non-negative matrix decomposition method is used to reduce the dimensionality of the time constraint matrix, combined with the neural network model and the roulette algorithm, to allocate tasks to be planned for the execution sequence one by one, and optimize the parameters of the task planning model.

Benefits of technology

It improves the speed and accuracy of solving time planning problems, enhances the robustness and anti-interference ability of the model, and saves computing resources and storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118536698A
    Figure CN118536698A
Patent Text Reader

Abstract

Embodiments of the invention provide a task planning method and apparatus, an electronic device and a readable medium. The method comprises the steps of obtaining a time constraint matrix and an execution time matrix of a to-be-planned task; elements in the time constraint matrix are related to a limited time interval between any two tasks to be planned; elements in the execution time matrix are related to limited execution time of the to-be-planned task; performing dimension reduction on the time constraint matrix based on a non-negative matrix factorization method to obtain a dimension-reduced matrix; and inputting the dimension reduction matrix and the execution time matrix into a preset task planning model, and distributing a corresponding to-be-planned task for at least one preset execution sequence, thereby providing a scheme for solving a task planning problem based on the task planning model, realizing the solving of the task planning problem under a plurality of constraint conditions, and improving the task planning efficiency. And the solving speed and the solving precision of the time planning of the task are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a task planning method, a task planning device, an electronic device and a computer-readable medium. Background Art

[0002] The time planning problem refers to planning the execution order of multiple tasks. The time planning problem is also called the task planning problem. The time planning problem is one of the main contents of operations research. It provides decision support for task planners by integrating mathematics and computer science. The difficulty of solving the time planning problem is usually related to the constraints of the time planning problem and the number of tasks contained in the time planning problem. When dealing with time planning problems with many constraints and a large number of tasks, the existing technology cannot simultaneously meet the requirements of solving speed and accuracy of time planning problems. Summary of the invention

[0003] Embodiments of the present invention provide a task planning method, device, electronic device and computer-readable storage medium to solve the problem that when dealing with time planning problems with many constraints and a large number of tasks, the existing technology cannot simultaneously meet the requirements of solution speed and solution accuracy of the time planning problem.

[0004] An embodiment of the present invention discloses a task planning method, the method comprising:

[0005] Obtaining a time constraint matrix and an execution time matrix of the tasks to be planned; the elements in the time constraint matrix are related to the limited time intervals between any two of the tasks to be planned; the elements in the execution time matrix are related to the limited execution times of the tasks to be planned;

[0006] Reducing the dimension of the time constraint matrix based on a non-negative matrix factorization method to obtain a reduced dimension matrix;

[0007] The dimension reduction matrix and the execution time matrix are input into a preset task planning model, and corresponding tasks to be planned are allocated to at least one preset execution order.

[0008] Optionally, the step of inputting the dimension reduction matrix and the execution time matrix into a preset task planning model and assigning corresponding tasks to be planned to at least one preset execution order comprises:

[0009] Traversing the execution order, and tracing back the currently traversed execution order by a preset number of orders to obtain a target execution order;

[0010] Based on the time constraint matrix, a backtracking constraint matrix corresponding to the execution order of the current traversal is obtained; the elements in the backtracking constraint matrix are related to the limited time interval corresponding to the execution order of the current traversal; the limited time interval corresponding to the execution order of the current traversal is the limited time interval between the task corresponding to any execution order between the execution order of the current traversal and the target execution order and all the tasks;

[0011] The backtracking constraint matrix, the tasks corresponding to the previous execution order of the currently traversed execution order, the dimension reduction matrix and the execution time matrix are input into the task planning model to allocate corresponding tasks to be planned for the currently traversed execution order.

[0012] Optionally, the task planning model includes a structure encoder, a sequence encoder and a decoder; the step of inputting the backtracking constraint matrix, the task corresponding to the previous execution order of the currently traversed execution order, the dimension reduction matrix and the execution time matrix into the task planning model, and allocating the corresponding task to be planned for the currently traversed execution order includes:

[0013] Inputting the backtracking constraint matrix, the dimension reduction matrix and the execution time matrix into the structure encoder to obtain a first vector;

[0014] Inputting the task corresponding to the previous execution order of the currently traversed execution order into the sequential encoder to obtain a second vector;

[0015] The first vector and the second vector are input into the decoder to obtain the tasks to be planned corresponding to the execution order of the current traversal.

[0016] Optionally, the step of reducing the dimension of the time constraint matrix based on a non-negative matrix decomposition method to obtain a reduced dimension matrix comprises:

[0017] Based on the non-negative matrix factorization method, the dimension of the time constraint matrix is ​​reduced to obtain a basis matrix and a coefficient matrix;

[0018] When the relationship between the base matrix, the coefficient matrix and the time constraint matrix satisfies a preset accuracy condition, the coefficient matrix is ​​used as the dimension reduction matrix.

[0019] Optionally, the step of inputting the backtracking constraint matrix, the dimension reduction matrix and the execution time matrix into the structure encoder to obtain a first vector comprises:

[0020] Encoding the backtracking constraint matrix, the dimension reduction matrix, and the execution time matrix to obtain a first eigenvector, a second eigenvector, and a third eigenvector;

[0021] Concatenate the first feature vector, the second feature vector and the third feature vector to obtain a fused feature vector;

[0022] The fused feature vector is mapped into a vector having the same dimension as the first feature vector to obtain the first vector.

[0023] Optionally, the tasks to be planned corresponding to the execution order of the current traversal are obtained by the decoder based on an attention mechanism.

[0024] Optionally, the method further comprises:

[0025] Input the dimension reduction matrix and the execution time matrix into a preset neural network model to obtain the probability corresponding to the execution order; the probability is the probability of taking any of the tasks to be planned as the task to be planned corresponding to the execution order;

[0026] Calculate the first time used by the neural network model to allocate corresponding tasks to be planned to all the execution orders using a roulette algorithm based on the probability;

[0027] Calculate the second time used by the neural network model to allocate corresponding tasks to be planned to all the execution orders based on the maximum probability corresponding to the execution order;

[0028] The model parameters of the neural network model are updated based on the first time and the second time to obtain the task planning model.

[0029] The embodiment of the present invention further discloses a task planning device, the device comprising:

[0030] A matrix acquisition module, used to acquire a time constraint matrix and an execution time matrix of the tasks to be planned; the elements in the time constraint matrix are related to the limited time intervals between any two tasks to be planned; the elements in the execution time matrix are related to the limited execution times of the tasks to be planned;

[0031] A dimension reduction matrix obtaining module is used to reduce the dimension of the time constraint matrix based on a non-negative matrix decomposition method to obtain a dimension reduction matrix;

[0032] The matrix input module is used to input the dimension reduction matrix and the execution time matrix into a preset task planning model, and allocate corresponding tasks to be planned for at least one preset execution order.

[0033] Optionally, the matrix input module includes:

[0034] A traversal submodule, used to traverse the execution order, and trace back the currently traversed execution order by a preset number of orders to obtain a target execution order;

[0035] A backtracking constraint matrix acquisition submodule is used to acquire a backtracking constraint matrix corresponding to the execution order of the current traversal based on the time constraint matrix; the elements in the backtracking constraint matrix are related to the limited time interval corresponding to the execution order of the current traversal; the limited time interval corresponding to the execution order of the current traversal is the limited time interval between the task corresponding to any execution order between the execution order of the current traversal and the target execution order and all the tasks;

[0036] The input submodule is used to input the backtracking constraint matrix, the task corresponding to the previous execution order of the currently traversed execution order, the dimension reduction matrix and the execution time matrix into the task planning model to assign corresponding tasks to be planned for the currently traversed execution order.

[0037] Optionally, the task planning model includes a structural encoder, a sequential encoder and a decoder; the input submodule includes:

[0038] A first vector obtaining unit, used for inputting the backtracking constraint matrix, the dimension reduction matrix and the execution time matrix into the structure encoder to obtain a first vector;

[0039] A second vector obtaining unit, configured to input the task corresponding to the previous execution order of the currently traversed execution order into the sequential encoder to obtain a second vector;

[0040] The to-be-planned task obtaining unit is used to input the first vector and the second vector into the decoder to obtain the to-be-planned task corresponding to the currently traversed execution order.

[0041] Optionally, the dimension reduction matrix obtaining module includes:

[0042] A dimensionality reduction submodule, used for reducing the dimensionality of the time constraint matrix based on a non-negative matrix factorization method to obtain a base matrix and a coefficient matrix;

[0043] The dimension reduction matrix is ​​used as a submodule, and is used to use the coefficient matrix as the dimension reduction matrix when the relationship between the base matrix, the coefficient matrix and the time constraint matrix meets the preset accuracy condition.

[0044] Optionally, the first vector obtaining unit includes:

[0045] An encoding subunit, used for encoding the backtracking constraint matrix, the dimension reduction matrix and the execution time matrix to obtain a first eigenvector, a second eigenvector and a third eigenvector respectively;

[0046] A concatenation subunit, configured to concatenate the first feature vector, the second feature vector and the third feature vector to obtain a fused feature vector;

[0047] A mapping subunit is used to map the fused feature vector into a vector with the same dimension as the first feature vector to obtain the first vector.

[0048] Optionally, the tasks to be planned corresponding to the execution order of the current traversal are obtained by the decoder based on an attention mechanism.

[0049] Optionally, the device further comprises:

[0050] An input module, used to input the dimension reduction matrix and the execution time matrix into a preset neural network model to obtain the probability corresponding to the execution order; the probability is the probability of taking any of the tasks to be planned as the task to be planned corresponding to the execution order;

[0051] A first time calculation module, used for calculating the first time used by the neural network model to allocate corresponding tasks to be planned to all the execution orders using a roulette algorithm based on the probability;

[0052] A second time calculation module, used to calculate the second time used by the neural network model to allocate corresponding tasks to be planned to all the execution orders based on the maximum probability corresponding to the execution order;

[0053] A model parameter updating module is used to update the model parameters of the neural network model based on the first time and the second time to obtain the task planning model.

[0054] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0055] The memory is used to store computer programs;

[0056] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.

[0057] The embodiment of the present invention further discloses one or more computer-readable media on which instructions are stored. When executed by one or more processors, the processors are enabled to execute the method described in the embodiment of the present invention.

[0058] The embodiments of the present invention include the following advantages:

[0059] In an embodiment of the present invention, a time constraint matrix and an execution time matrix of a task to be planned are obtained; the elements in the time constraint matrix are related to the limited time interval between any two tasks to be planned; the elements in the execution time matrix are related to the limited execution time of the task to be planned; the time constraint matrix is ​​reduced in dimension based on the non-negative matrix decomposition method to obtain a reduced dimension matrix; the reduced dimension matrix and the execution time matrix are input into a preset task planning model, and the corresponding task to be planned is assigned to at least one preset execution order, providing a solution to the task planning problem based on the task planning model, realizing the solution of the task planning problem under multiple constraints, and improving the solution speed and solution accuracy of the task time planning. At the same time, the time constraint matrix is ​​reduced in dimension, the noise mixed in the data set is removed, the generalization performance of the task planning model in processing task planning problems of different scales is improved, the task planning model has stronger robustness, and the anti-interference ability of the task planning model in the face of various random noises, abnormal situations and attacks is improved, and the task planning problem is solved based on the reduced dimension matrix of the time constraint matrix, which saves storage space and computer resources and improves the calculation speed of the task planning model. In addition, the task planning model assigns corresponding tasks to be planned to the execution order one by one, that is, determines the execution order of the tasks to be planned one by one, avoiding deciding the execution order of all tasks to be planned at one time. The dimension of the optional action space is extremely high, which brings great difficulties to the establishment and training process of the task planning model. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 is a flowchart of the steps of a task planning method provided in an embodiment of the present invention;

[0061] Figure 2 is a schematic diagram of a structural encoder provided by an embodiment of the present invention;

[0062] Figure 3 is a schematic diagram of a task planning model provided by an embodiment of the present invention;

[0063] Figure 4 is a structural block diagram of a task planning device provided in an embodiment of the present invention;

[0064] Figure 5 is a block diagram of an electronic device provided in an embodiment of the present invention;

[0065] Figure 6 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0066] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0067] To facilitate understanding of the technical solutions and technical effects of the embodiments of the present invention, the prior art of the present invention is briefly described below.

[0068] The time planning problem refers to planning the execution order of multiple tasks. The time planning problem is also called the task planning problem. The time planning problem is one of the main contents of operations research. It provides decision support for task planners by integrating mathematics and computer science. As a typical discrete space optimization problem, the purpose of time planning is to find a configuration solution that meets the optimization goal in the candidate solution space. Reasonable time planning can not only improve efficiency, but also significantly reduce costs, which is especially important for tasks with strong time sensitivity.

[0069] In time planning problems, when multiple tasks are involved, there are often multiple possible solutions. These different solutions differ in the order in which the tasks are performed, and some tasks may even be performed simultaneously. In order to determine the best solution, we need to calculate the total task execution time of each solution and take the solution with the shortest total task execution time as the target solution. As the number of tasks involved in the time planning problem increases, the difficulty of finding the solution with the shortest total task execution time increases exponentially.

[0070] The difficulty of time planning problems is not only related to the number of tasks, but also to the number of constraints of time planning problems. In the military and civilian fields, there are a large number of problems involving time planning, which are often accompanied by multiple constraints. For example, time planning problems in the fields of air defense firepower deployment, combat resource allocation, material allocation, traffic control, quantitative investment strategy formulation, and production process management usually involve multiple constraints and huge task scales, which put forward high requirements on solution accuracy and solution speed.

[0071] The current methods for dealing with time planning problems still face the problem of not being able to meet both the speed and accuracy of solutions when faced with multiple constraints and large-scale time planning problems. Common methods for dealing with time planning problems mainly include mathematical programming methods and heuristic algorithms. The practical application of mathematical programming methods is limited to smaller-scale time planning problems, usually with no more than 50 tasks. When solving time planning problems, heuristic algorithms often take explicit methods to sequentially construct solutions, and most of these heuristic algorithms rely on the expertise of domain experts to design. This type of algorithm cannot ensure the optimal solution to the problem, but it can usually provide a feasible solution close to the optimal in a short time. However, for large-scale time planning problems, heuristic algorithms still require a lot of solution time.

[0072] Reference Figure 1, shows a flowchart of a task planning method provided in an embodiment of the present invention, which may specifically include the following steps:

[0073] Step 101, obtaining a time constraint matrix and an execution time matrix of the tasks to be planned; the elements in the time constraint matrix are related to the limited time intervals between any two tasks to be planned; the elements in the execution time matrix are related to the limited execution times of the tasks to be planned;

[0074] In an embodiment of the present invention, when planning at least one task to be planned and determining the execution order of the tasks to be planned, it is necessary to first obtain a time constraint matrix and an execution time matrix of the tasks to be planned. The elements in the time constraint matrix are related to the limited time intervals between any two tasks to be planned, and the elements in the execution time matrix are related to the limited execution times of all tasks to be planned.

[0075] In the embodiment of the present invention, the limited time interval refers to the limited time interval between the start times of any two tasks to be planned, and the limited execution time refers to the limited time period in which the start time of the task to be planned must be. It should be emphasized that the start time of the task to be planned is the time when the task to be planned starts to be executed, not the time when it is ready to be executed. Specifically, if the task to be planned is the take-off of an airplane, the start time of the task to be planned is the time when the airplane takes off, not the time when the flight starts to accelerate on the runway.

[0076] In a specific example, the task planning involves three tasks, A, B, and C. If the limited execution time of task A is from 1:00 p.m. to 10:00 p.m., which can be represented by a matrix of [1, 10], the limited execution time of task B is from 0:00 p.m. to 8:00 p.m., which can be represented by a matrix of [0, 8], and the limited execution time of task C is from 5:00 p.m. to 12:00 a.m., which can be represented by a matrix of [5, 12], then the execution time matrix T of the task is w for:

[0077]

[0078] The time constraint matrix X of the task planning is:

[0079]

[0080] The elements in the time constraint matrix represent the limited time interval between the start time of the task represented by the row and the start time of the task represented by the column, and the start time of the task represented by the row is before the start time of the task represented by the column. If the first row and the first column of the time constraint matrix represent task A, the second row and the second column represent task B, and the third row and the third column represent task C, then the elements in the first row and the first column represent that the limited time interval between tasks A and A is 0 hours, and the elements in the first row and the second column represent that the limited time interval between tasks A and B is 1 hour, and so on, it can be known that the limited time interval between any two tasks among tasks A, B and C.

[0081] Step 102, reducing the dimension of the time constraint matrix based on a non-negative matrix factorization method to obtain a reduced dimension matrix;

[0082] In an embodiment of the present invention, the non-negative matrix decomposition method can represent the non-negative matrix as the product of two low-dimensional non-negative matrices, thereby achieving dimensionality reduction of data and feature extraction. The time constraint matrix in the embodiment of the present invention is a non-negative matrix, so the non-negative matrix decomposition method can be used to reduce the dimensionality of the time constraint matrix, and a base matrix and a coefficient matrix can be found for the time constraint matrix, so that the product of the base matrix and the coefficient matrix is ​​approximately equal to the time constraint matrix. It should be noted that the base matrix and the coefficient matrix are also non-negative matrices.

[0083] The weighted sum of all column vectors in the basis matrix is ​​the column vector in the time constraint matrix, and the weight coefficient is the element of the column vector corresponding to the coefficient matrix. Replacing the time constraint matrix with the coefficient matrix can achieve dimensionality reduction of the time constraint matrix and obtain a dimensionality reduction matrix of the data features of the time constraint matrix.

[0084] Step 103: input the dimension reduction matrix and the execution time matrix into a preset task planning model, and allocate corresponding tasks to be planned for at least one preset execution order.

[0085] In an embodiment of the present invention, by inputting the dimension reduction matrix and the execution time matrix of the time constraint matrix into the preset task planning model, it is possible to allocate the corresponding tasks to be planned one by one according to the preset execution order, and obtain the execution order of the tasks to be planned. It should be noted that the number of preset execution orders is the same as the number of tasks to be planned. Since the elements in the time constraint matrix are related to the limited time interval between any two tasks to be planned, and the elements in the execution time matrix are related to the limited execution time of all tasks to be planned, therefore, when the dimension reduction matrix and the execution time matrix of the time constraint matrix are input into the preset task planning model, it is equivalent to also inputting all the models to be planned into the task planning model.

[0086] In a specific example, the task planning involves three tasks to be planned, namely, task A, task B, and task C. The preset execution orders include 1, 2, and 3, and the constraints of the task planning include a time constraint matrix and an execution time matrix. After reducing the dimension of the time constraint matrix based on the non-negative matrix decomposition method to obtain a reduced dimension matrix, the reduced dimension matrix and the execution time matrix are input into the preset task planning model, and it is possible to allocate task A to execution order 1, task C to execution order 2, and task B to execution order 3. Then, the execution order of the tasks to be planned is task A, task C, and task B.

[0087] In an embodiment of the present invention, a time constraint matrix and an execution time matrix of a task to be planned are obtained; the elements in the time constraint matrix are related to the limited time interval between any two tasks to be planned; the elements in the execution time matrix are related to the limited execution time of the task to be planned; the time constraint matrix is ​​reduced in dimension based on the non-negative matrix decomposition method to obtain a reduced dimension matrix; the reduced dimension matrix and the execution time matrix are input into a preset task planning model, and the corresponding task to be planned is assigned to at least one preset execution order, providing a solution to the task planning problem based on the task planning model, realizing the solution of the task planning problem under multiple constraints, and improving the solution speed and solution accuracy of the task time planning. At the same time, the time constraint matrix is ​​reduced in dimension, the noise mixed in the data set is removed, the generalization performance of the task planning model in processing task planning problems of different scales is improved, the task planning model has stronger robustness, and the anti-interference ability of the task planning model in the face of various random noises, abnormal situations and attacks is improved, and the task planning problem is solved based on the reduced dimension matrix of the time constraint matrix, which saves storage space and computer resources and improves the calculation speed of the task planning model. In addition, the task planning model assigns corresponding tasks to be planned to the execution order one by one, that is, determines the execution order of the tasks to be planned one by one, avoiding deciding the execution order of all tasks to be planned at one time. The dimension of the optional action space is extremely high, which brings great difficulties to the establishment and training process of the task planning model.

[0088] Further, in any of the above embodiments, step 103 includes:

[0089] Sub-step S11, traversing the execution order, and tracing back the currently traversed execution order by a preset number of orders to obtain a target execution order;

[0090] Sub-step S12, based on the time constraint matrix, obtaining a backtracking constraint matrix corresponding to the execution order of the current traversal; the elements in the backtracking constraint matrix are related to the limited time interval corresponding to the execution order of the current traversal; the limited time interval corresponding to the execution order of the current traversal is the limited time interval between the task corresponding to any execution order between the execution order of the current traversal and the target execution order and all the tasks;

[0091] Sub-step S13, input the backtracking constraint matrix, the task corresponding to the previous execution order of the currently traversed execution order, the dimensionality reduction matrix and the execution time matrix into the task planning model, and assign corresponding tasks to be planned for the currently traversed execution order.

[0092] In the embodiment of the present invention, the execution order is traversed to allocate corresponding tasks to be planned to the currently traversed execution order one by one.

[0093] There may be associations between different tasks to be planned, that is, the execution of different tasks to be planned may affect each other. In order to avoid the execution of tasks with a determined execution order affecting the execution of tasks to be planned with an undetermined execution order, when assigning corresponding tasks to be planned to the currently traversed execution order, the currently traversed execution order is traced back a preset number of times to obtain the target execution order, and based on the time constraint matrix, the backtracking constraint matrix corresponding to the currently traversed execution order is obtained. It should be noted that the stronger the association between tasks, the greater the amount of backtracking required.

[0094] Since the elements in the time constraint matrix are related to the limited time intervals between any two tasks to be planned, and the elements in the backtracking constraint matrix corresponding to the currently traversed execution order are related to the limited time intervals between the tasks corresponding to any execution order between the currently traversed execution order and the target execution order and all tasks, the backtracking constraint matrix corresponding to the currently traversed execution order can be obtained based on the time constraint matrix.

[0095] In a specific example, the tasks to be planned include Task A and Task B. The limited time interval between Task A and Task B can be expressed as T(A,B), that is, the minimum time interval between the start time of Task A and the start time of Task B is T(A,B). A , the start time of task B is T B , when task A is executed first and task B is executed later, T B -T A≥T(A,B). If the limited time interval between task B and task A is expressed as T(B,A), and T(A,B)≠T(B,A), it means that the limited time interval between task A and task B is related to the execution order of task A and task B, and there is a relationship between task A and task B, which is equivalent to adding a constraint condition to the solution of the task planning problem, that is, the solution of the task planning problem needs to ensure that the execution of related tasks cannot affect each other.

[0096] In an embodiment of the present invention, when assigning corresponding tasks to be planned for the currently traversed execution order, the backtracking constraint matrix corresponding to the currently traversed execution order, the tasks corresponding to the previous execution order of the currently traversed execution order, the dimensionality reduction matrix of the time constraint matrix, and the execution time matrix are input into the task planning model, so as to achieve the assignment of corresponding tasks to be planned for the currently traversed execution order.

[0097] In an embodiment of the present invention, when a corresponding task to be planned is assigned to a certain execution order, the backtracking constraint matrix corresponding to the execution order is input into the task planning model, ensuring that the execution of the tasks to be planned with related relationships will not affect each other, ensuring the smooth progress of the planned tasks.

[0098] Further, in any of the above embodiments, the task planning model includes a structure encoder, a sequential encoder and a decoder; sub-step S13 includes:

[0099] Sub-step S21, inputting the backtracking constraint matrix, the dimension reduction matrix and the execution time matrix into the structure encoder to obtain a first vector;

[0100] Sub-step S22, inputting the task corresponding to the previous execution order of the currently traversed execution order into the sequential encoder to obtain a second vector;

[0101] Sub-step S23, inputting the first vector and the second vector into the decoder to obtain the tasks to be planned corresponding to the execution order of the current traversal.

[0102] In an embodiment of the present invention, the task planning model may include a structural encoder, a sequential encoder, and a decoder.

[0103] The execution order is traversed to realize the allocation of corresponding tasks to be planned for the currently traversed execution order one by one. When the corresponding tasks to be planned are allocated for the currently traversed execution order, the backtracking constraint matrix, the dimension reduction matrix of the time constraint matrix and the execution time matrix corresponding to the currently traversed execution order are input into the structure encoder to obtain the first vector, and the tasks corresponding to the previous execution order of the currently traversed execution order are input into the sequence encoder to obtain the second vector. Then the first vector and the second vector are input into the decoder to obtain the tasks to be planned corresponding to the currently traversed execution order.

[0104] In the embodiment of the present invention, the sequential encoder uses a long short-term memory network (LSTM) for sequential encoding. The long short-term memory network can introduce a "gating" mechanism to achieve modeling of sequence data by selectively remembering and forgetting past information. Specifically, the process of sequential encoding can be expressed as:

[0105]

[0106] Where W is the trainable parameter matrix in the preset neural network model, which is implemented using a linear neural network layer, b is the linear neural network layer bias, σ and tanh represent the activation functions used by the corresponding neural network layer, and t is the execution order of the current traversal. t-1 The task number of the previous execution order of the currently traversed execution order. Each time the sequential encoder assigns the corresponding task to be planned to the currently traversed execution order, it inputs the number of the task corresponding to the previous execution order x t-1 , output o t The second vector is used as the input of the decoder part and outputs C t and h t Passed to the LSTM part which assigns the tasks to be planned for the execution order of the next traversal.

[0107] Further, in any of the above embodiments, step 102 includes:

[0108] Sub-step S31, reducing the dimension of the time constraint matrix based on non-negative matrix factorization to obtain a base matrix and a coefficient matrix;

[0109] Sub-step S32, when the relationship between the base matrix, the coefficient matrix and the time constraint matrix satisfies a preset accuracy condition, using the coefficient matrix as the dimension reduction matrix.

[0110] In an embodiment of the present invention, the time constraint matrix can be decomposed into two fixed-width base matrices and a coefficient matrix based on a non-negative matrix decomposition method. When the product of the base matrix and the coefficient matrix is ​​approximately equal to the time constraint matrix, the coefficient matrix is ​​used as a dimension reduction matrix of the time constraint matrix. It should be noted that the task planning model obtained by training the neural network model with a fixed-width dimension reduction matrix can handle problems of different scales; at the same time, the model training speed and problem solving speed can be improved by using the dimension reduction matrix for model training and problem solving.

[0111] In the embodiment of the present invention, if the time constraint matrix X∈R n×n , that is, the time constraint matrix is ​​a matrix with n rows and n columns. If the non-negative matrix decomposition method is used to reduce the dimension of the time constraint matrix, the base matrix W∈Rn×k , coefficient matrix H∈R k×n , then by transposing the matrix H, we can get the basis matrix and coefficient matrix with a fixed width of k columns.

[0112] Specifically, the time constraint matrix can be iteratively solved according to the non-negative matrix decomposition formula until the relationship between the basis matrix, the coefficient matrix and the time constraint matrix meets the preset accuracy conditions, and the coefficient matrix is ​​used as the dimension reduction matrix of the time constraint matrix.

[0113] Preset accuracy conditions:

[0114] ||XW k H k || 2 <∈

[0115] The formula for non-negative matrix decomposition is:

[0116]

[0117]

[0118] Among them, X is the time constraint matrix, W is the basis matrix, H is the coefficient matrix, and ∈ is the preset threshold. The non-negative matrix factorization method is generally performed in an iterative solution manner. k , W k They represent the basis matrix W and coefficient matrix H obtained after iterating to the kth round, respectively. represents the element in the i-th row and a-th column of the basis matrix W obtained at the k-th iteration, represents the element in the bth row and jth column of the coefficient matrix H obtained when iterating to the kth round. Therefore, the preset accuracy condition between the base matrix, the coefficient matrix and the time constraint matrix is: the square of the modulus of the difference between the time constraint matrix and the product of the base matrix W and the coefficient matrix H obtained when iterating to the kth round is less than the preset threshold. If the relationship between the base matrix, the coefficient matrix and the time constraint matrix meets the preset accuracy condition, it means that the product of the base matrix and the coefficient matrix is ​​approximately equal to the time constraint matrix.

[0119] Further, in any of the above embodiments, sub-step S21 includes:

[0120] Sub-step S41, respectively encoding the backtracking constraint matrix, the dimension reduction matrix and the execution time matrix to obtain a first eigenvector, a second eigenvector and a third eigenvector;

[0121] Sub-step S42, concatenating the first feature vector, the second feature vector and the third feature vector to obtain a fused feature vector;

[0122] Sub-step S43, mapping the fused feature vector into a vector with the same dimension as the first feature vector to obtain the first vector.

[0123] In an embodiment of the present invention, the task planning model may include a structure encoder. The execution order is traversed to achieve the allocation of corresponding tasks to be planned for the currently traversed execution order one by one. When determining the tasks to be planned corresponding to the currently traversed execution order, the backtracking constraint matrix, the dimension reduction matrix of the time constraint matrix, and the execution time matrix corresponding to the currently traversed execution order can be input into the structure encoder to obtain a first vector.

[0124] Reference Figure 2 , showing a schematic diagram of a structural encoder provided by an embodiment of the present invention.

[0125] Figure 2 The i in the equation is the execution order of the current traversal, H is the coefficient matrix obtained by reducing the dimension of the time constraint matrix, and T w is an execution time matrix with n rows and 2 columns. Transposing the coefficient matrix H yields a transposed matrix H* with n rows and h columns. i b The backtracking constraint matrix of n rows and b columns corresponding to the currently traversed execution order i is obtained. Specifically, the currently traversed execution order i is traced back by b orders to obtain the target execution order, and based on the time constraint matrix, the backtracking constraint matrix corresponding to the currently traversed execution order i is obtained. The elements in the backtracking constraint matrix are related to the limited time intervals between the tasks corresponding to any execution order between the currently traversed execution order and the target execution order and all the tasks.

[0126] S i b Encode to obtain the first eigenvector v1 corresponding to the backtracking constraint matrix, v1 is a matrix with n rows and h columns; encode H* to obtain the second eigenvector v2 corresponding to the transposed matrix of the coefficient matrix, v2 is a matrix with n rows and h columns; encode T w Encode to obtain the third eigenvector v3 corresponding to the execution time matrix, v3 is a matrix with n rows and h columns. It should be noted that the first eigenvector v1∈R h , the second eigenvector v2∈R h , the third eigenvector v3∈R h , R represents a set of real numbers, that is, the dimensions of the first eigenvector, the second eigenvector, and the third eigenvector are the same, and they are all h-dimensional vector spaces on real numbers.

[0127] The first eigenvector, the second eigenvector and the third eigenvector are concatenated on the same dimension to obtain a fused eigenvector v, and the fused eigenvector v = [v1, v2, v3] ∈ R 3h, that is, the fused feature vector v is a 3h-dimensional vector space on real numbers. Map the fused feature vector to obtain a first vector r with the same dimensions as the first feature vector, the second feature vector, and the third feature vector, that is, r is an h-dimensional vector space on real numbers, r∈R h . It should be noted that the first vector r is a matrix of n rows and h columns. The encoding and mapping processes in the embodiments of the present invention are implemented using a linear neural network layer with a Leaky ReLU activation function. The Leaky ReLU function is a new neural network unit activation function that can improve the performance of deep neural networks, improve the problems of gradient disappearance and jitter, and better fit the model.

[0128] Furthermore, in any of the above embodiments, the tasks to be planned corresponding to the execution order of the current traversal are obtained by the decoder based on the attention mechanism.

[0129] In an embodiment of the present invention, the first vector of the structure encoder and the second vector of the sequence encoder are input into the decoder to assign corresponding tasks to be planned for the execution order of the current traversal. In an embodiment of the present invention, a pointer network can be used as the decoder part of the task planning model. The pointer network generates a new attention vector for each decision of the decoder to adjust the attention based on the input content. The pointer network generates a probability distribution for the input elements for each decision of the decoder. In an embodiment of the present invention, the pointer network can generate the probability of using any task to be planned as the task to be planned corresponding to the execution order of the current traversal.

[0130] The decoder obtains the tasks to be planned corresponding to the execution order of the current traversal based on the attention mechanism. The attention mechanism can select a small part of useful information from a large amount of input information for key processing and ignore other information, so that the task planning model focuses on a specific part of the input sequence during decoding, rather than relying solely on the input of the decoder. The calculation method of the attention mechanism is: calculate the attention distribution on the input sequence of all decoders, then calculate the weighted weight of the input sequence based on the attention distribution, and use the weighted weight to calculate and obtain the tasks to be planned corresponding to the execution order of the current traversal.

[0131] In the embodiment of the present invention, the weight u calculated by directly using the input sequence of the decoder is used as a pointer to the output sequence:

[0132]

[0133] p i =softmax(u i )

[0134] The first vector r and the second vector q input to the decoder are the vectors output by the structure encoder and the sequential encoder respectively. The jth component of the weight vector representing the i-th execution order, where j refers to the task to be planned assigned to the i-th execution order, v, W r and W q is the parameter matrix that can be trained in the preset neural network model, and tanh is the corresponding neural network activation function. i Perform softmax normalization to obtain the probability P of taking any task to be planned as the task to be planned corresponding to the execution order i of the current traversal i . Among them, softmax is a mathematical function used to convert a set of arbitrary real numbers into real numbers representing probability distribution.

[0135] F is a set of tasks with a determined execution order. For tasks with a determined execution order, their weights are is set to -∞, so that the probability obtained after softmax normalization is 0.

[0136] In an embodiment of the present invention, the neural attention mechanism in the pointer network provides a solution for processing output dictionaries of variable sizes, thereby effectively coping with various combinatorial optimization problems.

[0137] Furthermore, in any of the above embodiments, the method further includes:

[0138] Sub-step S51, inputting the dimension reduction matrix and the execution time matrix into a preset neural network model to obtain the probability corresponding to the execution order; the probability is the probability of taking any of the tasks to be planned as the task to be planned corresponding to the execution order;

[0139] Sub-step S52, calculating the first time used by the neural network model to allocate corresponding tasks to be planned to all the execution orders using a roulette algorithm based on the probability;

[0140] Sub-step S53, calculating the second time used by the neural network model to allocate corresponding tasks to be planned to all the execution orders based on the maximum probability corresponding to the execution order;

[0141] Sub-step S54, updating the model parameters of the neural network model based on the first time and the second time to obtain the task planning model.

[0142] In an embodiment of the present invention, the task planning model is obtained by training a preset neural network model. The training process of the task planning model can be as follows: the dimension reduction matrix and the execution time matrix of the time constraint matrix are input into the preset neural network model, and the neural network model can output the probability of taking any task to be planned as a task to be planned corresponding to a certain execution order. Since the elements in the time constraint matrix are related to the limited time interval between any two tasks to be planned, and the elements in the execution time matrix are related to the limited execution time of all tasks to be planned, therefore, when the dimension reduction matrix and the execution time matrix of the time constraint matrix are input into the preset neural network model, it is equivalent to inputting all the models to be planned into the neural network model.

[0143] The computational neural network model is based on the probability of taking any task to be planned as a task to be planned corresponding to a certain execution order, and uses the roulette algorithm to allocate the first time required for each execution order to the corresponding task to be planned one by one. Among them, the probability of each task to be planned being selected in the roulette algorithm is proportional to its fitness function value, and the fitness function value of the task to be planned is the probability of taking any task to be planned as a task to be planned corresponding to a certain execution order.

[0144] The neural network model is calculated to allocate the second time required for the corresponding task to be planned to each execution order one by one based on the maximum probability corresponding to the execution order, and the model parameters of the neural network model are updated based on the first time and the second time to optimize the neural network model to obtain a task planning model.

[0145] In the embodiment of the present invention, the optimization goal of the neural network model is to execute all the tasks to be planned in the shortest possible time while satisfying the given constraints; that is, to execute the first task from time 0 and make the time c of executing the last task n At first, it can be expressed as:

[0146] min{c n}

[0147] stc k+1 -c k ≥T(H k ,H k+1 )

[0148] T s ≤c k ≤T e

[0149] Among them, C k+1 Indicates the task to be planned H k+1 The start time of C k Indicates the task to be planned H k The start time, T(H k ,Hk+1 ) represents the task to be planned H k And the task to be planned H k+1 The time interval between the scheduled tasks H k The start time of C k Need to be in T s -T e within the time frame.

[0150] In a specific example, a deep reinforcement learning algorithm with self-supervised policy gradient (REINFORCE with Self-critical) is used to train the constructed neural network model M(θ).

[0151] Deep reinforcement learning is a method that uses deep neural networks to learn through continuous interaction and trial and error between the agent and the environment, aiming to learn a method that maximizes the cumulative expected return of the task. The training method of deep reinforcement learning effectively alleviates the high dependence on data in the training process of deep neural network models. Most deep reinforcement learning methods provide an end-to-end solution, that is, the trained model allows the agent to make decisions directly based on the current state and the interaction information with the environment. Therefore, unlike traditional heuristic algorithms, deep reinforcement learning methods can automatically search for a heuristic algorithm by training the agent, thereby significantly improving the solution efficiency without sacrificing the solution accuracy when dealing with time planning problems.

[0152] During the training process, the neural network model can output the probability p of taking any task to be planned as the task to be planned corresponding to the execution order. i , and use the probability roulette algorithm to assign the corresponding task X to be planned for the execution order of the current traversal i , and record the logarithmic probability of the sampling point After completing all the execution order decisions, we get the strategy function π θ (a i |s i ), calculate the cumulative time of the neural network model using the roulette algorithm As a bonus, we use the same neural network model with the same parameters and the same input conditions again, and output the probability The maximum value of the sample is the execution order of the current traversal to allocate the corresponding tasks to be planned After completing all the execution order decisions, we get the strategy function And calculate the output probability of the neural network model The cumulative time of the maximum value sampling method

[0153] For the network parameter θ of the neural network model, the optimization direction is to make the probability p of the neural network model selecting the policy function π with higher reward greater. Define the policy function π as the objective function J(θ), and the policy gradient of J(θ) can be expressed as:

[0154]

[0155] This policy gradient is used as the loss function of the neural network model for back propagation to update the network parameters θ of the neural network model, and iterative training is performed to obtain the optimal strategy, which is the task planning model. Specifically, the algorithm of the training process of the neural network model is as follows:

[0156]

[0157]

[0158] Where j represents the task to be planned, and the preset threshold value in the preset accuracy condition satisfied by the relationship between the matrix reduction time base matrix, the coefficient matrix and the time constraint matrix is ​​∈=10 -2 , the number of backtracking orders of the current traversal execution order during structure encoding is b=5, the hidden layer dimension is h=128, and the number of tasks to be planned in training is n=50.

[0159] The model training uses the Adam (adaptive moment estimation) optimizer for gradient descent, with an initial learning rate of 10 -3 , the decay rate of the learning rate is 0.96. The training process includes 100 epochs, each epoch updates the training data and performs matrix dimensionality reduction, and the batch size of a set of training data is 384; each epoch has 100 steps, and a validation is performed every 20 steps to evaluate the current model performance and save the optimal model parameters. Among them, epoch means that all samples in the training batch in the training data set are trained 100 times, and batch_size indicates the number of samples in each training batch.

[0160] In the embodiment of the present invention, during the training and testing process of the neural network model, the hidden layer dimension h is set to 128. Under the same conditions, the test is conducted to compare the deep reinforcement learning method (DRL) proposed in the embodiment of the present invention with the greedy strategy-based method (Greedy) and the method using genetic algorithm (GA) commonly used to solve time planning problems. The results are shown in the following table:

[0161]

[0162]

[0163] Among them, n represents the number of tasks to be planned. As can be seen from the table, the deep reinforcement learning method greatly improves the solution speed under limited accuracy loss and realizes the function of fast time planning.

[0164] In the example of using a mission planning model provided by the present invention, when using helicopters to rescue injured people in natural disasters such as earthquakes, multiple helicopters at the same take-off point need to take off within the corresponding limited execution time, and the take-off time of any two helicopters needs to be no less than the limited time interval to reduce the risk of collision between helicopters during flight. At the same time, the helicopter needs to complete the flight mission in the shortest possible time, that is, minimize the take-off time of the last helicopter to improve the rescue efficiency of the helicopter.

[0165] The helicopter takeoff planning task involves three rescue helicopters that take off from the same takeoff point. The three helicopters are helicopter A, helicopter B, and helicopter C. If S is used to represent the set of tasks to be planned, S i represents the task to be planned, C i Indicates the task to be planned S i The starting time of the helicopter is , where i = 1, 2, 3, then S1 represents the take-off mission of helicopter A, S2 represents the take-off mission of helicopter B, S3 represents the take-off mission of helicopter C, C1 represents the take-off time of helicopter A, C2 represents the take-off time of helicopter B, and C3 represents the take-off time of helicopter C. Moreover, the constraints of the helicopter take-off planning task include that the three helicopters need to take off at the corresponding limited execution time, and the take-off time of any two helicopters is not less than the limited time interval.

[0166] If the take-off time of helicopter A is required to be between 1pm and 10pm, the take-off time of helicopter B is required to be between 0pm and 8pm, and the take-off time of helicopter C is required to be between 5pm and 12am, then the limited execution time of the take-off missions of the three helicopters is:

[0167] <![CDATA[Task S to be planned i > A B C Limit execution time [1,10] [0,8] [5,12]

[0168] Based on the limited execution time of the takeoff mission of the three helicopters, the execution time matrix T of the mission planning can be obtained: w :

[0169] The time constraint matrix X obtained based on the limited time interval between the take-off tasks of any two helicopters among the three helicopters is:

[0170]

[0171] The elements in the time constraint matrix represent the limited time interval between the start time of the task represented by the row and the start time of the task represented by the column, and the start time of the task represented by the row is before the start time of the task represented by the column.

[0172] According to the non-negative matrix decomposition method, the time constraint matrix X is iteratively decomposed, and the preset threshold ∈=0.01 is set to obtain the base matrix W and the coefficient matrix H. In this example, the width of the matrix after dimensionality reduction and the hidden layer dimension h of the neural network are both set to 2. Among them, H is:

[0173]

[0174] Input the coefficient matrix and the execution time matrix into the task planning model to obtain the execution order of the three tasks to be planned: A, B, C, that is, the take-off task of helicopter A is assigned to execution order 1, the take-off task of helicopter B is assigned to execution order 2, and the take-off task of helicopter C is assigned to execution order 3.

[0175] Based on the time constraint matrix and execution time matrix, the execution time of each task is obtained as follows:

[0176] C=[1,2,7]

[0177] That is, the take-off time of helicopter A is 1 pm, the take-off time of helicopter B is 2 pm, and the take-off time of helicopter C is 7 pm.

[0178] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0179] Reference Figure 3 , showing a schematic diagram of a task planning model provided by an embodiment of the present invention.

[0180] Figure 3 The task planning model in includes Encoder and Decoder, where the encoder includes a structural encoder and a sequential encoder. Figure 3 X(n,n) represents the time constraint matrix of the task to be planned with n rows and n columns, W(n,h) represents the basis matrix with n rows and h columns, H(h,n) represents the coefficient matrix with h rows and n columns, and T w represents the execution time matrix of the tasks to be planned, i represents the execution order of the current traversal, S iIndicates the tasks to be planned corresponding to the execution order of the current traversal, S i-1 Indicates the tasks corresponding to the previous execution order of the currently traversed execution order, r is the first vector, and q is the second vector.

[0181] Based on NMF (Nonnegative Matrix Factorization), the time constraint matrix of the task to be planned is decomposed into a base matrix and a coefficient matrix, and the product of the base matrix and the coefficient matrix is ​​approximately equal to the time constraint matrix. Among them, the coefficient matrix is ​​the dimension reduction matrix of the time constraint matrix.

[0182] The current traversal execution order is traced back a preset number of orders to obtain the target execution order, and based on the time constraint matrix, the backtracking constraint matrix corresponding to the current traversal execution order is obtained. The elements in the backtracking constraint matrix are related to the limited time intervals between the tasks corresponding to any execution order between the current traversal execution order and the target execution order and all tasks.

[0183] The backtracking constraint matrix corresponding to the current traversal execution order, the dimension reduction matrix of the time constraint matrix and the execution time matrix are input into the structure encoder to obtain the first vector r.

[0184] The tasks corresponding to the previous execution order of the currently traversed execution order and h i-1 , c i-1 Input the sequential encoder to get the second vector q, h i and c i Inputting the first vector r and the second vector q into the decoder can obtain the probability P corresponding to the execution order of the current traversal i , based on P i The tasks S to be planned corresponding to the current traversal order can be obtained i .

[0185] Reference Figure 4 , shows a structural block diagram of a task planning device provided in an embodiment of the present invention, which may specifically include the following modules:

[0186] The matrix acquisition module 401 is used to acquire the time constraint matrix and the execution time matrix of the tasks to be planned; the elements in the time constraint matrix are related to the limited time interval between any two tasks to be planned; the elements in the execution time matrix are related to the limited execution time of the tasks to be planned;

[0187] A reduced dimension matrix obtaining module 402 is used to reduce the dimension of the time constraint matrix based on a non-negative matrix factorization method to obtain a reduced dimension matrix;

[0188] The matrix input module 403 is used to input the dimension reduction matrix and the execution time matrix into a preset task planning model, and allocate corresponding tasks to be planned for at least one preset execution order.

[0189] In an optional embodiment of the present invention, the matrix input module includes:

[0190] A traversal submodule, used to traverse the execution order, and trace back the currently traversed execution order by a preset number of orders to obtain a target execution order;

[0191] A backtracking constraint matrix acquisition submodule is used to acquire a backtracking constraint matrix corresponding to the execution order of the current traversal based on the time constraint matrix; the elements in the backtracking constraint matrix are related to the limited time interval corresponding to the execution order of the current traversal; the limited time interval corresponding to the execution order of the current traversal is the limited time interval between the task corresponding to any execution order between the execution order of the current traversal and the target execution order and all the tasks;

[0192] The input submodule is used to input the backtracking constraint matrix, the task corresponding to the previous execution order of the currently traversed execution order, the dimension reduction matrix and the execution time matrix into the task planning model to assign corresponding tasks to be planned for the currently traversed execution order.

[0193] In an optional embodiment of the present invention, the task planning model includes a structure encoder, a sequence encoder and a decoder; the input submodule includes:

[0194] A first vector obtaining unit, used for inputting the backtracking constraint matrix, the dimension reduction matrix and the execution time matrix into the structure encoder to obtain a first vector;

[0195] A second vector obtaining unit, configured to input the task corresponding to the previous execution order of the currently traversed execution order into the sequential encoder to obtain a second vector;

[0196] The to-be-planned task obtaining unit is used to input the first vector and the second vector into the decoder to obtain the to-be-planned task corresponding to the currently traversed execution order.

[0197] In an optional embodiment of the present invention, the dimension reduction matrix obtaining module includes:

[0198] A dimensionality reduction submodule, used for reducing the dimensionality of the time constraint matrix based on a non-negative matrix factorization method to obtain a base matrix and a coefficient matrix;

[0199] The dimension reduction matrix is ​​used as a submodule, and is used to use the coefficient matrix as the dimension reduction matrix when the relationship between the base matrix, the coefficient matrix and the time constraint matrix meets the preset accuracy condition.

[0200] In an optional embodiment of the present invention, the first vector obtaining unit includes:

[0201] An encoding subunit, used for encoding the backtracking constraint matrix, the dimension reduction matrix and the execution time matrix to obtain a first eigenvector, a second eigenvector and a third eigenvector respectively;

[0202] A concatenation subunit, configured to concatenate the first feature vector, the second feature vector and the third feature vector to obtain a fused feature vector;

[0203] A mapping subunit is used to map the fused feature vector into a vector with the same dimension as the first feature vector to obtain the first vector.

[0204] In an optional embodiment of the present invention, the tasks to be planned corresponding to the execution order of the current traversal are obtained by the decoder based on an attention mechanism.

[0205] In an optional embodiment of the present invention, the device further comprises:

[0206] An input module, used to input the dimension reduction matrix and the execution time matrix into a preset neural network model to obtain the probability corresponding to the execution order; the probability is the probability of taking any of the tasks to be planned as the task to be planned corresponding to the execution order;

[0207] A first time calculation module, used for calculating the first time used by the neural network model to allocate corresponding tasks to be planned to all the execution orders using a roulette algorithm based on the probability;

[0208] A second time calculation module, used to calculate the second time used by the neural network model to allocate corresponding tasks to be planned to all the execution orders based on the maximum probability corresponding to the execution order;

[0209] A model parameter updating module is used to update the model parameters of the neural network model based on the first time and the second time to obtain the task planning model.

[0210] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0211] In addition, an embodiment of the present invention further provides an electronic device, such as Figure 5As shown, it includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.

[0212] Memory 503, used for storing computer programs;

[0213] The processor 501 is used to execute the program stored in the memory 503, and implements the following steps:

[0214] Obtaining a time constraint matrix and an execution time matrix of the tasks to be planned; the elements in the time constraint matrix are related to the limited time intervals between any two of the tasks to be planned; the elements in the execution time matrix are related to the limited execution times of the tasks to be planned;

[0215] Reducing the dimension of the time constraint matrix based on a non-negative matrix factorization method to obtain a reduced dimension matrix;

[0216] The dimension reduction matrix and the execution time matrix are input into a preset task planning model, and corresponding tasks to be planned are allocated to at least one preset execution order.

[0217] In an optional embodiment of the present invention, the step of inputting the dimension reduction matrix and the execution time matrix into a preset task planning model and assigning corresponding tasks to be planned to at least one preset execution order includes:

[0218] Traversing the execution order, and tracing back the currently traversed execution order by a preset number of orders to obtain a target execution order;

[0219] Based on the time constraint matrix, a backtracking constraint matrix corresponding to the execution order of the current traversal is obtained; the elements in the backtracking constraint matrix are related to the limited time interval corresponding to the execution order of the current traversal; the limited time interval corresponding to the execution order of the current traversal is the limited time interval between the task corresponding to any execution order between the execution order of the current traversal and the target execution order and all the tasks;

[0220] The backtracking constraint matrix, the tasks corresponding to the previous execution order of the currently traversed execution order, the dimension reduction matrix and the execution time matrix are input into the task planning model to allocate corresponding tasks to be planned for the currently traversed execution order.

[0221] In an optional embodiment of the present invention, the task planning model includes a structure encoder, a sequence encoder and a decoder; the step of inputting the backtracking constraint matrix, the task corresponding to the previous execution order of the currently traversed execution order, the dimension reduction matrix and the execution time matrix into the task planning model, and allocating the corresponding task to be planned for the currently traversed execution order includes:

[0222] Inputting the backtracking constraint matrix, the dimension reduction matrix and the execution time matrix into the structure encoder to obtain a first vector;

[0223] Inputting the task corresponding to the previous execution order of the currently traversed execution order into the sequential encoder to obtain a second vector;

[0224] The first vector and the second vector are input into the decoder to obtain the tasks to be planned corresponding to the execution order of the current traversal.

[0225] In an optional embodiment of the present invention, the step of reducing the dimension of the time constraint matrix based on the non-negative matrix decomposition method to obtain the reduced dimension matrix includes:

[0226] Based on the non-negative matrix factorization method, the dimension of the time constraint matrix is ​​reduced to obtain a basis matrix and a coefficient matrix;

[0227] When the relationship between the base matrix, the coefficient matrix and the time constraint matrix satisfies a preset accuracy condition, the coefficient matrix is ​​used as the dimension reduction matrix.

[0228] In an optional embodiment of the present invention, the step of inputting the backtracking constraint matrix, the dimension reduction matrix and the execution time matrix into the structure encoder to obtain the first vector includes:

[0229] Encoding the backtracking constraint matrix, the dimension reduction matrix, and the execution time matrix to obtain a first eigenvector, a second eigenvector, and a third eigenvector;

[0230] Concatenate the first feature vector, the second feature vector and the third feature vector to obtain a fused feature vector;

[0231] The fused feature vector is mapped into a vector having the same dimension as the first feature vector to obtain the first vector.

[0232] In an optional embodiment of the present invention, the tasks to be planned corresponding to the execution order of the current traversal are obtained by the decoder based on an attention mechanism.

[0233] In an optional embodiment of the present invention, the method further includes:

[0234] Input the dimension reduction matrix and the execution time matrix into a preset neural network model to obtain the probability corresponding to the execution order; the probability is the probability of taking any of the tasks to be planned as the task to be planned corresponding to the execution order;

[0235] Calculate the first time used by the neural network model to allocate corresponding tasks to be planned to all the execution orders using a roulette algorithm based on the probability;

[0236] Calculate the second time used by the neural network model to allocate corresponding tasks to be planned to all the execution orders based on the maximum probability corresponding to the execution order;

[0237] The model parameters of the neural network model are updated based on the first time and the second time to obtain the task planning model.

[0238] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0239] The communication interface is used for communication between the above terminal and other devices.

[0240] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0241] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0242] like Figure 6 As shown, in another embodiment provided by the present invention, a computer-readable storage medium 601 is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the task planning method described in the above embodiment.

[0243] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the task planning method described in the above embodiment.

[0244] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0245] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0246] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0247] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A task planning method, characterized in that: The method comprises: Obtaining a time constraint matrix and an execution time matrix of the tasks to be planned; the elements in the time constraint matrix are related to the limited time intervals between any two of the tasks to be planned; the elements in the execution time matrix are related to the limited execution times of the tasks to be planned; Reducing the dimension of the time constraint matrix based on a non-negative matrix factorization method to obtain a reduced dimension matrix; The dimension reduction matrix and the execution time matrix are input into a preset task planning model, and corresponding tasks to be planned are allocated to at least one preset execution order.

2. The method according to claim 1, characterized in that The step of inputting the dimension reduction matrix and the execution time matrix into a preset task planning model and assigning corresponding tasks to be planned to at least one preset execution order comprises: Traversing the execution order, and tracing back the currently traversed execution order by a preset number of orders to obtain a target execution order; Based on the time constraint matrix, a backtracking constraint matrix corresponding to the execution order of the current traversal is obtained; the elements in the backtracking constraint matrix are related to the limited time interval corresponding to the execution order of the current traversal; the limited time interval corresponding to the execution order of the current traversal is the limited time interval between the task corresponding to any execution order between the execution order of the current traversal and the target execution order and all the tasks; The backtracking constraint matrix, the tasks corresponding to the previous execution order of the currently traversed execution order, the dimension reduction matrix and the execution time matrix are input into the task planning model to allocate corresponding tasks to be planned for the currently traversed execution order.

3. The method according to claim 2, characterized in that The task planning model includes a structure encoder, a sequence encoder and a decoder; the step of inputting the backtracking constraint matrix, the task corresponding to the previous execution order of the currently traversed execution order, the dimension reduction matrix and the execution time matrix into the task planning model, and allocating the corresponding task to be planned for the currently traversed execution order includes: Inputting the backtracking constraint matrix, the dimension reduction matrix and the execution time matrix into the structure encoder to obtain a first vector; Inputting the task corresponding to the previous execution order of the currently traversed execution order into the sequential encoder to obtain a second vector; The first vector and the second vector are input into the decoder to obtain the tasks to be planned corresponding to the execution order of the current traversal.

4. The method according to claim 1, characterized in that: The step of reducing the dimension of the time constraint matrix based on the non-negative matrix decomposition method to obtain the reduced dimension matrix comprises: Based on the non-negative matrix factorization method, the dimension of the time constraint matrix is ​​reduced to obtain a basis matrix and a coefficient matrix; When the relationship between the base matrix, the coefficient matrix and the time constraint matrix satisfies a preset accuracy condition, the coefficient matrix is ​​used as the dimension reduction matrix.

5. The method according to claim 3, characterized in that: The step of inputting the backtracking constraint matrix, the dimension reduction matrix and the execution time matrix into the structure encoder to obtain a first vector comprises: Encoding the backtracking constraint matrix, the dimension reduction matrix, and the execution time matrix to obtain a first eigenvector, a second eigenvector, and a third eigenvector; Concatenate the first feature vector, the second feature vector and the third feature vector to obtain a fused feature vector; The fused feature vector is mapped into a vector having the same dimension as the first feature vector to obtain the first vector.

6. The method according to claim 3, characterized in that The tasks to be planned corresponding to the execution order of the current traversal are obtained by the decoder based on the attention mechanism.

7. The method according to claim 1, characterized in that The method further comprises: Input the dimension reduction matrix and the execution time matrix into a preset neural network model to obtain the probability corresponding to the execution order; the probability is the probability of taking any of the tasks to be planned as the task to be planned corresponding to the execution order; Calculate the first time used by the neural network model to allocate corresponding tasks to be planned to all the execution orders using a roulette algorithm based on the probability; Calculate the second time used by the neural network model to allocate corresponding tasks to be planned to all the execution orders based on the maximum probability corresponding to the execution order; The model parameters of the neural network model are updated based on the first time and the second time to obtain the task planning model.

8. A task planning device, characterized in that: The device comprises: A matrix acquisition module, used to acquire a time constraint matrix and an execution time matrix of the tasks to be planned; the elements in the time constraint matrix are related to the limited time interval between any two tasks to be planned; the elements in the execution time matrix are related to the limited execution time of the tasks to be planned; A dimension reduction matrix obtaining module is used to reduce the dimension of the time constraint matrix based on a non-negative matrix decomposition method to obtain a dimension reduction matrix; The matrix input module is used to input the dimension reduction matrix and the execution time matrix into a preset task planning model, and allocate corresponding tasks to be planned for at least one preset execution order.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 7 when executing the program stored in the memory.

10. One or more computer-readable media having instructions stored thereon, which when executed by one or more processors cause the processors to perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Satellite imaging task planning method and device, electronic equipment and storage medium

    CN112529317A

  • Time redundancy heuristic planning method, device and equipment for space station operation tasks

    CN113283789A

  • Data processing method and device

    CN115220882A

  • Maintenance work order space-time scheduling optimization method and related device

    CN115660138A

  • Task time logic constraint inference method and device based on constraint hierarchical network

    CN116011792A