Unmanned ship task sequence determination method, device and equipment
By obtaining the status and obstacle information of unmanned boats, calculating the optimal path between task points and optimizing the task sequence using network models, the problem of safe navigation and shortest range of unmanned boats in complex environments is solved, and more efficient Task assignment and path planning.
Patent Information
- Application Number
- CN202411301685.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-01-10
AI Technical Summary
The existing unmanned boat mission allocation algorithm cannot take into account the problems of navigation safety and shortest range in complex environments, especially because the impact of obstacles is ignored, the real-time and energy consumption problems of algorithms in complex environments cannot be met.
By obtaining the status and obstacle information of unmanned boats, the optimal path between task points is calculated, the voyage matrix is constructed, and the task sequence optimization is used using preset network models. Combining the attention mechanism and gradient descent method, the optimal task sequence is determined. .
It realizes the optimal task allocation and path planning of unmanned boats in complex environments, ensures navigation safety and reduces the overall range, and improves the real-time performance and energy efficiency of the algorithm.
Smart Images

Figure CN119294631A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer information technology processing technology, and in particular to a method, device and equipment for determining a task sequence of an unmanned boat. Background Art
[0002] Unmanned surface vehicles (USVs) have attracted much attention due to their unmanned and intelligent characteristics, and have gradually been applied in military and civilian fields. In patrol, anti-mine, environmental monitoring, search and rescue and other tasks, task allocation is an important part of upper-level planning, and the quality of its planning directly affects the execution of the overall task.
[0003] The task allocation problem refers to solving the optimal path planning for multiple task points, which is generally described as the Traveling Salesman Problem (TSP) in optimization problems. The unmanned boat effectively allocates tasks and plans trajectories through the task allocation algorithm to ensure that each task point is visited in turn to minimize the total voyage. Existing task allocation algorithms include genetic algorithms, ant colony algorithms, neural network algorithms, etc. However, these algorithms rely on Euclidean distance as the calculation of the voyage cost between task points, and often ignore the impact of obstacles in the environment. Therefore, they need to be combined with path planning algorithms, which leads to the inability to meet the real-time requirements of the algorithm in complex environments and the inability to take into account energy consumption and safety issues in complex environments. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method, device and equipment for determining the task sequence of an unmanned boat, which can realize the optimal task allocation and path planning of the surface unmanned boat in a complex environment, and ensure navigation safety and the shortest voyage.
[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:
[0006] A method for determining an unmanned boat mission sequence, comprising:
[0007] Obtain the current state of the unmanned boat, surrounding obstacle information and at least two mission point information;
[0008] Obtaining a path between any two task points according to the obstacle information and at least two task point information;
[0009] According to the path between any two mission points, a range matrix is obtained;
[0010] According to the range matrix, unmanned boat task allocation processing is performed to obtain the optimal task sequence under the current state.
[0011] Optionally, obtaining a path between any two task points according to the obstacle information and the at least two task point information includes:
[0012] Establishing a spatial potential field according to the starting task point, the ending task point and the obstacle information, wherein the starting task point and the ending task point are any one of the multiple task points;
[0013] A path between a starting task point and an ending task point in the spatial potential field is determined.
[0014] Optionally, according to the range matrix, unmanned boat task allocation processing is performed to obtain the optimal task sequence under the current state, including:
[0015] Encode the flight matrix to obtain a first node encoding vector for each mission point;
[0016] Inputting the first node encoding vector into a first multi-head attention layer of a preset network model for attention calculation processing to obtain a second node encoding vector;
[0017] Inputting the second node encoding vector into a feedforward layer of a preset network model for linear transformation processing to obtain a third node encoding vector;
[0018] Obtaining a current state encoding vector according to the third node encoding vector and the first and last task points of the current task sequence;
[0019] Input the current state encoding vector and the third node encoding vector into the second multi-head attention layer of the preset network model for attention calculation processing to obtain a relevance vector and a fourth node encoding vector of each task point;
[0020] Input the correlation vector and the fourth node encoding vector of each task point into a single attention layer of a preset network model to perform correlation calculation, obtain the task point of this iteration, and put the task point into the optimal task sequence;
[0021] The current state encoding vector is calculated repeatedly to obtain the task points of each iteration, and the task points of each iteration are placed in the optimal task sequence until all task points are placed in the optimal task sequence to obtain the optimal task sequence in the current state.
[0022] Optionally, the range matrix is encoded to obtain a first node encoding vector of each mission point, including:
[0023] Encode the distances of each mission point in the range matrix with those of other mission points to obtain a distance vector of each mission point;
[0024] The distance vector of each task point is multiplied by a preset weight matrix to obtain a first node encoding vector of each task point.
[0025] Optionally, inputting the first node encoding vector into a first multi-head attention layer of a preset network model for attention calculation processing to obtain a second node encoding vector includes:
[0026] Multiplying the first node encoding vector with the preset q matrix, k matrix and v matrix respectively to obtain a q vector, a k vector and a v vector;
[0027] According to the q vector, k vector and v vector, an attention weight between any two nodes is obtained;
[0028] According to the attention weights between any two nodes, a second node encoding vector of each task point is obtained.
[0029] Optionally, obtaining a current state encoding vector according to the third node encoding vector and the first and last task points of the current task sequence includes:
[0030] Sum and average the third node encoding vectors of each task point to obtain the graph encoding vector;
[0031] The graph encoding vector is added to the v vectors of the first and last task points of the current task sequence to obtain the current state encoding vector.
[0032] Optionally, the correlation vector and the fourth node encoding vector of each task point are input into a single attention layer of a preset network model to perform correlation calculation to obtain the task point of this iteration, and the task point is placed in the optimal task sequence, including:
[0033] According to the correlation between the fourth node encoding vector of each task point and the correlation vector, the task point with the largest correlation is determined as the task point of this iteration;
[0034] Put the task points into the optimal task sequence.
[0035] The present invention also provides an unmanned boat task sequence determination device, comprising:
[0036] The acquisition module is used to obtain the current state of the unmanned boat, surrounding obstacle information and at least two mission point information;
[0037] The processing module is used to obtain a path between any two task points based on the obstacle information and at least two task point information; obtain a range matrix based on the path between the any two task points; and perform unmanned boat task allocation processing based on the range matrix to obtain an optimal task sequence under the current state.
[0038] The present invention also provides a computing device, comprising: a processor and a memory storing a computer program, wherein when the computer program is run by the processor, the method as described above is executed.
[0039] The present invention also provides a computer-readable storage medium storing instructions, which, when executed on a computer, enable the computer to execute the above method.
[0040] The above solution of the present invention includes at least the following beneficial effects:
[0041] The above scheme of the present invention obtains the current state of the unmanned boat, the surrounding obstacle information and at least two task point information; obtains the path between any two task points according to the obstacle information and at least two task point information; obtains the range matrix according to the path between any two task points; performs the unmanned boat task allocation processing according to the range matrix to obtain the optimal task sequence under the current state. The optimal task allocation and path planning of the surface unmanned boat in a complex environment can be achieved to ensure navigation safety and the shortest range. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a first flow chart of a method for determining a task sequence of an unmanned boat according to an embodiment of the present invention;
[0043] Figure 2 is a schematic diagram of unmanned boat task allocation according to an embodiment of the present invention;
[0044] Figure 3 is a second flow chart of the method for determining the task sequence of an unmanned boat according to an embodiment of the present invention;
[0045] Figure 4 is a schematic diagram of a spatial potential field and a path according to an embodiment of the present invention;
[0046] Figure 5 is a schematic diagram of layers of a network model according to an embodiment of the present invention;
[0047] Figure 6 is a schematic diagram of existing path planning and task allocation in an embodiment of the present invention;
[0048] Figure 7 is a task allocation diagram of an unmanned boat task sequence determination algorithm according to an embodiment of the present invention;
[0049] Figure 8 is a structural diagram of a device for determining a task sequence of an unmanned boat according to an embodiment of the present invention;
[0050] Description of reference numerals:
[0051] 21. Mission point; 22. Safe route; 23. Straight-line distance; 24. Straight route; 25. Curved route. DETAILED DESCRIPTION
[0052] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0053] like Figure 1 As shown, an embodiment of the present invention provides a method for determining an unmanned boat task sequence, comprising:
[0054] Step 11, obtaining the current state of the unmanned boat, surrounding obstacle information and at least two mission point information;
[0055] Step 12, obtaining a path between any two task points according to the obstacle information and at least two task point information;
[0056] Step 13, obtaining a flight matrix according to the path between any two mission points;
[0057] Step 14: perform unmanned boat task allocation processing according to the range matrix to obtain the optimal task sequence under the current state.
[0058] In this embodiment, the unmanned boat mission sequence determination method refers to the sequence of executing mission points and the method for determining the navigation route between mission points during the unmanned boat's mission at sea. Figure 2 As shown in the figure, there are five mission points 21 on the sea surface, and there are inaccessible obstacles between the five mission points 21. In this application, the execution order of the five mission points 21 in the figure and the safe route 22 between the five mission points 21 are determined. In the existing unmanned boat task allocation method, the shortest distance between the mission points is usually calculated by using the Euclidean distance. When there is obstacle information, the path planning algorithm is used to reallocate the route based on the Euclidean distance. Figure 2 As shown in FIG. 2 , the straight-line distances between the five task points are calculated based on the Euclidean distance 23, and then the path planning algorithm is used to avoid obstacles between two of the task points, and the originally planned straight route is changed to a curved route. This method of using the path planning algorithm to reallocate routes after task allocation does not consider the influence of obstacles during the initial allocation, which will result in the final allocated route not being optimal, and it is impossible to ensure navigation safety while achieving the shortest distance.
[0059] Based on the above analysis, the present application proposes a new method for determining the task sequence of an unmanned boat. The method first plans the optimal path between any two task points among all the task points. The range between each two task points is calculated according to the planned path. The range between all task points is represented by the range matrix method. The range matrix is input into a trained preset network model, and the preset network model outputs the optimal task sequence under the current task point and obstacle state. The preset network model is a neural network model that calculates the correlation between input elements and other elements based on the attention mechanism, and promotes information transmission through weighted processing, thereby enhancing the expression of encoded information in the input vector and improving the accuracy of the model output results.
[0060] like Figure 3 As shown, the unmanned boat task sequence determination algorithm process of the present application specifically includes: first input the unmanned boat state, surrounding obstacle information and at least two task point information, and the unmanned boat state is the initial position information of the unmanned boat. According to the input task point information and obstacle information, two task points are randomly selected to calculate the path between them, and the corresponding safe range is calculated according to the path. Traverse all task points until the corresponding safe range between any two task points is obtained, and output the range matrix between the task points. The range matrix is input into the pre-trained network model, and the model outputs the optimal task sequence. The pseudo code expression of the above process is shown in Table 1 below.
[0061] Table 1. Unmanned boat mission sequence determination algorithm
[0062]
[0063] Among them, the function ComputeT() is used to calculate the potential field of the current map, the function GD() solves the shortest route from the starting point to the end point in the potential field through the gradient descent method, and the function AM() inputs the distance matrix D into the trained self-attention model to obtain the optimal task sequence.
[0064] The above method of the present invention can realize task allocation and path planning at the same time, and the output allocation result can minimize the actual range of the USV while ensuring the safe navigation of the surface unmanned boat. The algorithm does not need to be combined with an additional planning algorithm, and has the advantages of improving calculation speed, reducing route length, reducing energy consumption and improving operation efficiency.
[0065] In an optional embodiment of the present invention, step 12 may include:
[0066] Step 121, establishing a spatial potential field according to the starting task point, the ending task point and the obstacle information, wherein the starting task point and the ending task point are any one of the multiple task points respectively;
[0067] Here, the spatial potential field is a potential field used to represent the time it takes for a starting point to reach all reachable points at a certain propagation speed. In the path planning problem, (x, y) represents the coordinates of the calculation point in the pose space, V(x, y) represents the propagation speed set by the interface function, and T(x, y) represents the time it takes for the interface function to reach the calculation point at a speed of V(x, y). When V(x, y) = 1, the equation represents the distance field in the computational domain. The pseudo code for establishing the spatial potential field based on the starting task point, the ending task point, and the obstacle information is shown in Table 2 below.
[0068] Table 2, spatial potential field
[0069]
[0070] The above algorithm inputs a planning starting point and a grid map M. Each grid in the map is used to store the arrival time. The concentrated obstacle grid is set to nan, that is, an unreachable point; the planning starting point is set to 0, and the remaining reachable points are initialized to infinity. At the same time, the arrival time of the points around the starting point is solved as the initial value, and the equations for the four points extending Δ distance in four directions of the (x, y) point area are solved as follows:
[0071] T1=min(T (x-Δx,y) ,T (x+Δx,y) )
[0072] T2=min(T (x,y-Δy) ,T (x,y+Δy) )
[0073]
[0074] Where V is the speed matrix, which represents the speed of each point in the map, and T is the time matrix, which represents the shortest time required to travel from the starting point to each point in the map according to the speed matrix V. T1 is the time T of the point with the shorter arrival time among the two points on the left and right of the point (x, y) at a distance Δ in the x direction, and T2 is the time T of the point with the shorter arrival time among the two points on the top and bottom of the point (x, y) at a distance Δ in the y direction. T (x,y) T is the shortest time required to travel from the starting point to the point (x, y) according to the velocity matrix V. T is continuously updated according to this formula (x,y) Until the potential field is constructed.
[0075] After completing the initialization work, the algorithm enters the iteration until the spatial potential field is established. The iteration process includes the movement of points between three sets: the known point set Known, the pilot set Trial, and the far point set Far. The known point set is used to store grids whose arrival time calculations have been completed; the pilot set is used to store grids that are being calculated; and the far point set is used to store grids that have not yet started calculations. In the initial state of the algorithm, only the starting point is saved in the known point set, and the rest of the points are stored in the far point set. As the iteration process proceeds, the points in the grid map gradually move from the far point set to the known point set via the pilot set. When the far point set is empty, it means that the spatial potential field is established.
[0076] Step 122, determining a path between a starting task point and an ending task point in the spatial potential field.
[0077] In this embodiment, in the spatial potential field, the gradient descent method is used to iterate continuously from the starting point along the direction of the fastest gradient descent to obtain a collision-free smooth path from the starting task point to the ending task point. The spatial potential field is as follows Figure 4 As shown, the circle is the schematic obstacle information, and the curve between the starting point and the end point is the path. The gradient descent method is an iterative algorithm for solving unconstrained optimization problems, and is particularly suitable for minimizing loss functions in the fields of machine learning and artificial intelligence. The core idea is to find the minimum value of the function by iteratively updating the model parameters and gradually reducing the value of the loss function along the negative gradient direction of the loss function.
[0078] In an optional embodiment of the present invention, step 14 may include:
[0079] Step 141, encoding the flight matrix to obtain the first node encoding vector of each mission point;
[0080] Specifically, step 141 may include:
[0081] Step 1411, encoding the distances of each mission point and other mission points in the flight range matrix to obtain a distance vector of each mission point;
[0082] Here, the flight matrix is as follows:
[0083]
[0084] The distance between each mission point and other mission points is encoded to obtain a distance vector, and the distance vector is used to represent the mission point. The distance vector of each mission point is as follows: Figure 5 D1, D2, D3 to D n As shown, each task point corresponds to a node, and n task points correspond to d1 to d n nodes. nRepresents the distance vector of the nth task point.
[0085] Step 1412, multiplying the distance vector of each task point by a preset weight matrix to obtain a first node coding vector of each task point.
[0086] Here, if Figure 5 As shown, the first node encoding vector is Figure 5 d1', d2', d3' to d n ', where d' n The first node encoding vector representing the nth task point. i =Wx i , where W is the preset weight matrix obtained after model training, x i is the distance vector.
[0087] Step 142, inputting the first node encoding vector into the first multi-head attention layer of the preset network model for attention calculation processing to obtain a second node encoding vector;
[0088] In this application, in order to obtain the correlation between task points and global information and the optimal task sequence, a multi-head attention mechanism is introduced, that is, multiple identical self-attention calculations are performed and then superimposed, which can greatly increase the expressive power of the model and increase the complexity.
[0089] Specifically, step 142 may include:
[0090] Step 1421, multiplying the first node code vector by the preset q matrix, k matrix and v matrix respectively to obtain a q vector, a k vector and a v vector;
[0091] Here, the query vector, key vector and value vector are solved by the first node encoding vector, which are represented as q i =W q a i , k i =W k a i 、v i =W v a i , where W q , W k and W v They are the q matrix, k matrix and v matrix obtained after model training.
[0092] Step 1422, obtaining the attention weight between any two nodes according to the q vector, the k vector and the v vector;
[0093] Here, the attention weight calculation formula is: where α ij is the attention weight between node i and node j, d represents the dimensions of q matrix and k matrix.
[0094] Step 1423, obtaining the second node encoding vector of each task point according to the attention weight between any two nodes.
[0095] Here, first, ij Normalized to get α i,j =softmax(α i,j ), then according to α i,j Get the relevance weight of element i The b i That is the second node encoding vector of the i-th task point.
[0096] Step 143, inputting the second node code vector into a feedforward layer of a preset network model for linear transformation processing to obtain a third node code vector;
[0097] Here, the feedforward layer mainly completes three operations:
[0098] 1. Linear transformation: The second node encoding vector of the input of the feedforward layer first undergoes a linear transformation to map the input to a high-dimensional space. This linear transformation is implemented by a weight matrix and a bias vector;
[0099] 2. Activation function: After the linear transformation, the input will pass through an activation function to increase the nonlinear expression ability of the model. The activation function described in this application is ReLU;
[0100] 3. Linear transformation and output: After the activation function, another linear transformation is performed to map the features of the high-dimensional space back to the original space to obtain the output of the feedforward layer.
[0101] The formula of the above process is FFN(x)=Relu(xW1+b1)W2+b2, where W1, b1, W2, b2 are parameters obtained by model training. The third node encoding vector corresponds to Figure 5 h1', h2', h3', h n '.
[0102] Step 144, obtaining a current state encoding vector according to the third node encoding vector and the first and last task points of the current task sequence;
[0103] Specifically, step 144 may include:
[0104] Step 1441, summing and averaging the third node coding vectors of each task point to obtain a graph coding vector;
[0105] Here, the vectors corresponding to all task points are averaged to obtain the graph encoding vector h representing the current map c '.
[0106] Step 1442, add the graph encoding vector and the v vectors of the first and last task points of the current task sequence to obtain the current state encoding vector.
[0107] Here, the graph encoding vector h c 'With the current task sequence head and tail v f ,v l Add together to get the current state encoding vector.
[0108] Step 145, inputting the current state encoding vector and the third node encoding vector into the second multi-head attention layer of the preset network model for attention calculation processing to obtain a relevance vector and a fourth node encoding vector of each task point;
[0109] Here, the current state encoding vector is processed with multi-head attention to all task points to obtain the corresponding correlation vector p c , the fourth node encoding vector corresponds to Figure 5 p1 to p n .
[0110] Step 146, inputting the correlation vector and the fourth node encoding vector of each task point into a single attention layer of a preset network model to perform correlation calculation, obtaining the task point of this iteration, and placing the task point into the optimal task sequence;
[0111] Specifically, step 146 may include:
[0112] Step 1461, according to the correlation between the fourth node encoding vector of each task point and the correlation vector, determine the task point with the largest correlation as the task point of this iteration; and put the task point into the optimal task sequence.
[0113] Here, a single attention layer is used to analyze all task points and the correlation vector p c Perform correlation calculation and take the maximum correlation task point n o Output.
[0114] Step 147, repeatedly calculate the current state encoding vector to obtain the task points of each iteration, and put the task points of each iteration into the optimal task sequence until all task points are put into the optimal task sequence to obtain the optimal task sequence in the current state.
[0115] Here, the task point outputted by each iteration is placed at the end of the optimal task sequence and does not participate in the next iteration calculation. The model calculation of a graph is terminated after running n times. Finally, the policy gradient reinforcement learning algorithm with rolling baseline is used to train the model.
[0116] like Figure 6 and Figure 7 As shown, the present application compares the advantages and disadvantages of the present invention and the traditional task allocation plus path planning method in a simulation environment. First, a 400 pixel by 400 pixel area is created in the simulation, which contains three irregularly shaped obstacles. A total of 20 random task points are set in the simulation area. Figure 6 The allocation result is obtained by using the self-organizing map (SOM) algorithm to allocate tasks and then plan the route through obstacles, with a total range of 1619.2 pixels. Figure 7 The distribution result in is obtained by the algorithm of the present invention, and the total flight distance is 1535.5 pixels. Figure 6 and Figure 7 It can be clearly observed that although both methods avoid obstacles, the algorithm assigns a straight route 24 when obstacles are not considered, and changes the straight route 24 that passes through the obstacles to a curved route 25 after obstacles are considered. However, it is obvious that Figure 7 The allocation method is obviously more reasonable, and the final path is shorter. Therefore, the surface unmanned boat task allocation method proposed in the present invention can not only complete the two tasks of task allocation and path planning at the same time, but also fully consider the influence of obstacles when allocating tasks, so that the final allocation result has a smaller distance cost and has practical value.
[0117] The above method of the present invention aims at the task allocation problem of the surface unmanned boat in the obstacle environment. First, the actual safety distance between the task points is calculated, and then the output safety distance matrix is input into the preset network structure to obtain the optimal task sequence of the unmanned boat. At the same time, the task allocation and path planning of the surface unmanned boat are realized, and the total range of the unmanned boat is minimized under the premise of ensuring navigation safety, which solves the problem that the traditional task allocation algorithm cannot take into account both energy consumption and safety requirements in the obstacle environment. It avoids the disadvantage of using Euclidean distance for task allocation in the traditional algorithm.
[0118] like Figure 8 As shown, the present invention also provides an unmanned boat task sequence determination device 80, comprising:
[0119] An acquisition module 81 is used to acquire the current state of the unmanned boat, surrounding obstacle information and at least two mission point information;
[0120] The processing module 82 is used to obtain the path between any two task points based on the obstacle information and at least two task point information; obtain the range matrix based on the path between any two task points; and perform unmanned boat task allocation processing based on the range matrix to obtain the optimal task sequence under the current state.
[0121] Optionally, obtaining a path between any two task points according to the obstacle information and the at least two task point information includes:
[0122] Establishing a spatial potential field according to the starting task point, the ending task point and the obstacle information, wherein the starting task point and the ending task point are any one of the multiple task points;
[0123] A path between a starting task point and an ending task point in the spatial potential field is determined.
[0124] Optionally, according to the range matrix, unmanned boat task allocation processing is performed to obtain the optimal task sequence under the current state, including:
[0125] Encode the flight matrix to obtain a first node encoding vector for each mission point;
[0126] Inputting the first node encoding vector into a first multi-head attention layer of a preset network model for attention calculation processing to obtain a second node encoding vector;
[0127] Inputting the second node encoding vector into a feedforward layer of a preset network model for linear transformation processing to obtain a third node encoding vector;
[0128] Obtaining a current state encoding vector according to the third node encoding vector and the first and last task points of the current task sequence;
[0129] Input the current state encoding vector and the third node encoding vector into the second multi-head attention layer of the preset network model for attention calculation processing to obtain a relevance vector and a fourth node encoding vector of each task point;
[0130] Input the correlation vector and the fourth node encoding vector of each task point into a single attention layer of a preset network model to perform correlation calculation, obtain the task point of this iteration, and put the task point into the optimal task sequence;
[0131] The current state encoding vector is calculated repeatedly to obtain the task points of each iteration, and the task points of each iteration are placed in the optimal task sequence until all task points are placed in the optimal task sequence to obtain the optimal task sequence in the current state.
[0132] Optionally, the range matrix is encoded to obtain a first node encoding vector of each mission point, including:
[0133] Encode the distances of each mission point in the range matrix with those of other mission points to obtain a distance vector of each mission point;
[0134] The distance vector of each task point is multiplied by a preset weight matrix to obtain a first node encoding vector of each task point.
[0135] Optionally, inputting the first node encoding vector into a first multi-head attention layer of a preset network model for attention calculation processing to obtain a second node encoding vector includes:
[0136] Multiplying the first node encoding vector with the preset q matrix, k matrix and v matrix respectively to obtain a q vector, a k vector and a v vector;
[0137] According to the q vector, k vector and v vector, an attention weight between any two nodes is obtained;
[0138] According to the attention weights between any two nodes, a second node encoding vector of each task point is obtained.
[0139] Optionally, obtaining a current state encoding vector according to the third node encoding vector and the first and last task points of the current task sequence includes:
[0140] Sum and average the third node encoding vectors of each task point to obtain the graph encoding vector;
[0141] The graph encoding vector is added to the v vectors of the first and last task points of the current task sequence to obtain the current state encoding vector.
[0142] Optionally, the correlation vector and the fourth node encoding vector of each task point are input into a single attention layer of a preset network model to perform correlation calculation to obtain the task point of this iteration, and the task point is placed in the optimal task sequence, including:
[0143] According to the correlation between the fourth node encoding vector of each task point and the correlation vector, the task point with the largest correlation is determined as the task point of this iteration;
[0144] Put the task points into the optimal task sequence.
[0145] It should be noted that the device is a device corresponding to the above method, and all implementation methods in the above method embodiments are applicable to the embodiments of the device and can achieve the same technical effects.
[0146] The embodiment of the present invention further provides a computing device, comprising: a processor, a memory storing a computer program, wherein when the computer program is executed by the processor, the method described above is executed. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0147] The present invention also provides a computer-readable storage medium storing instructions, which, when executed on a computer, enable the computer to execute the above method. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0148] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0149] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0150] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0151] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0152] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0153] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.
[0154] In addition, it should be noted that in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it is understood that all or any steps or components of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or a network of computing devices in hardware, firmware, software or a combination thereof, which can be achieved by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.
[0155] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general device. Therefore, the purpose of the present invention can also be achieved by simply providing a program product containing a program code that implements the method or device. That is to say, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order. Some steps can be performed in parallel or independently of each other.
[0156] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for determining an unmanned boat mission sequence, characterized in that: include: Obtain the current state of the unmanned boat, surrounding obstacle information and at least two mission point information; Obtaining a path between any two task points according to the obstacle information and at least two task point information; According to the path between any two mission points, a range matrix is obtained; According to the range matrix, unmanned boat task allocation processing is performed to obtain the optimal task sequence under the current state.
2. The method for determining the mission sequence of an unmanned boat according to claim 1, characterized in that: According to the obstacle information and at least two task point information, a path between any two task points is obtained, including: Establishing a spatial potential field according to the starting task point, the ending task point and the obstacle information, wherein the starting task point and the ending task point are any one of the multiple task points; A path between a starting task point and an ending task point in the spatial potential field is determined.
3. The method for determining the mission sequence of an unmanned boat according to claim 1, characterized in that: According to the range matrix, the unmanned boat task allocation process is performed to obtain the optimal task sequence under the current state, including: Encode the flight matrix to obtain a first node encoding vector for each mission point; Inputting the first node encoding vector into a first multi-head attention layer of a preset network model for attention calculation processing to obtain a second node encoding vector; Inputting the second node encoding vector into a feedforward layer of a preset network model for linear transformation processing to obtain a third node encoding vector; Obtaining a current state encoding vector according to the third node encoding vector and the first and last task points of the current task sequence; Input the current state encoding vector and the third node encoding vector into the second multi-head attention layer of the preset network model for attention calculation processing to obtain a relevance vector and a fourth node encoding vector of each task point; Input the correlation vector and the fourth node encoding vector of each task point into a single attention layer of a preset network model to perform correlation calculation, obtain the task point of this iteration, and put the task point into the optimal task sequence; The current state encoding vector is calculated repeatedly to obtain the task points of each iteration, and the task points of each iteration are placed in the optimal task sequence until all task points are placed in the optimal task sequence to obtain the optimal task sequence in the current state.
4. The method for determining the mission sequence of an unmanned boat according to claim 3, characterized in that: The range matrix is encoded to obtain the first node encoding vector of each mission point, including: Encode the distances of each mission point in the range matrix with those of other mission points to obtain a distance vector of each mission point; The distance vector of each task point is multiplied by a preset weight matrix to obtain a first node encoding vector of each task point.
5. The method for determining the mission sequence of an unmanned boat according to claim 3, characterized in that: Inputting the first node encoding vector into the first multi-head attention layer of the preset network model for attention calculation processing to obtain a second node encoding vector, including: Multiplying the first node encoding vector with the preset q matrix, k matrix and v matrix respectively to obtain a q vector, a k vector and a v vector; According to the q vector, k vector and v vector, an attention weight between any two nodes is obtained; According to the attention weights between any two nodes, a second node encoding vector of each task point is obtained.
6. The method for determining the mission sequence of an unmanned boat according to claim 3, characterized in that: According to the third node encoding vector and the first and last task points of the current task sequence, a current state encoding vector is obtained, including: Sum and average the third node encoding vectors of each task point to obtain the graph encoding vector; The graph encoding vector is added to the v vectors of the first and last task points of the current task sequence to obtain the current state encoding vector.
7. The method for determining the mission sequence of an unmanned boat according to claim 3, characterized in that: Inputting the correlation vector and the fourth node encoding vector of each task point into a single attention layer of a preset network model to perform correlation calculation, obtaining the task point of this iteration, and placing the task point into an optimal task sequence, including: According to the correlation between the fourth node encoding vector of each task point and the correlation vector, the task point with the largest correlation is determined as the task point of this iteration; Put the task points into the optimal task sequence.
8. An unmanned boat task sequence determination device, characterized in that: include: The acquisition module is used to obtain the current state of the unmanned boat, surrounding obstacle information and at least two mission point information; A processing module, used for obtaining a path between any two task points according to the obstacle information and at least two task point information; A range matrix is obtained according to the path between any two task points; and unmanned boat task allocation processing is performed according to the range matrix to obtain an optimal task sequence under the current state.
9. A computing device, characterized in that include: A processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the method according to any one of claims 1 to 7 is performed.
10. A computer-readable storage medium, characterized in that: Instructions are stored, and when the instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.