Path planning method, device and equipment and computer readable storage medium

By performing raster modeling of the target sea area and using a preset encoder and probabilistic generation model to generate feature vectors, the problem of insufficient flexibility of the path planning method for watercraft in complex environments is solved, and a more flexible and adaptable path planning is achieved.

CN116700291BActive Publication Date: 2026-06-26SHENZHEN UNIV +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN UNIV
Filing Date
2023-07-11
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing methods for planning the path of sea vehicles lack flexibility when facing complex marine environments. Traditional methods cannot generate optimal paths and are difficult to adapt to changes in different environments.

Method used

By performing raster modeling on the target sea area, generating feature vectors using a preset encoder and probabilistic generation model, and combining them with a preset sequence of control variables, a target path from the starting point to the end point is generated, improving the flexibility and adaptability of path planning.

Benefits of technology

It improves the flexibility and adaptability of path planning for sea vehicles, generates optimal paths that better meet actual needs, and enhances navigation capabilities in complex maritime environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116700291B_ABST
    Figure CN116700291B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a path planning method, device, equipment and computer readable storage medium, the method comprising: obtaining a current position of a vehicle and a target position, the current position and the target position are located in a target sea area; based on the information of the water vehicle and the environmental information of the target sea area, the target sea area is modeled by gridding to obtain the gridding information of the target sea area; the gridding information and a preset control variable sequence are converted into a path generation feature vector by a preset encoder, the preset control variable sequence is used to control the characteristics of the target path; the probability generation model is used as a decoder, and the target path starting from the current position and ending at the target position is generated based on the path generation feature vector. The present disclosure solves the problem of low flexibility of traditional sea path planning method by gridding modeling of the target sea area and introducing the preset control variable sequence to control the characteristics of the target path.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and in particular to a path planning method, apparatus, device, and computer-readable storage medium. Background Technology

[0002] The maritime environment is complex and unpredictable, making advance path planning crucial for seaplanes. Seaplane path planning involves charting a route from the current location to the target location within the entire target sea area. The goal is to enable seaplanes to avoid dangerous areas and efficiently reach their destination.

[0003] Currently, the most common method for high-accuracy path planning of watercraft is the shortest path algorithm. While shortest path algorithm-based path planning methods can quickly find the shortest path through algorithmic optimization, the shortest path is not necessarily the optimal path. Therefore, this method lacks flexibility when facing complex real-world environments. Summary of the Invention

[0004] To address the aforementioned technical problems, this disclosure provides a route planning method, apparatus, device, and computer-readable storage medium to improve the flexibility of route planning.

[0005] In a first aspect, embodiments of this disclosure provide a path planning method, including:

[0006] The current position and target position of the vehicle are obtained, both of which are located in the target sea area;

[0007] Based on the information of the sea vehicle and the environmental information of the target sea area, a raster model of the target sea area is performed to obtain the raster information of the target sea area.

[0008] The rasterized information and the preset control variable sequence are transformed into a path generation feature vector by a preset encoder. The preset control variable sequence is used to control the features of the target path.

[0009] Using a probabilistic generation model as a decoder, a target path is generated based on the path to generate a feature vector, starting from the current position and ending at the target position.

[0010] In some embodiments, the step of performing raster modeling on the target sea area based on information from the sea vehicle and environmental information of the target sea area to obtain rasterized information of the target sea area includes:

[0011] The target sea area is scaled according to the size of the watercraft, and the scaled target sea area is divided into a preset number of grids, where the side length of each grid is the distance traveled by the watercraft per unit time.

[0012] The environmental information of each grid is calculated based on the environmental information of the target sea area to obtain the rasterized information of the target sea area.

[0013] In some embodiments, the preset encoder includes a priori encoder and a transcoder;

[0014] The step of converting the rasterized information and the preset control variable sequence into a path generation feature vector through a priori encoder includes:

[0015] The rasterized information and the preset control variable sequence are input into a pre-trained prior encoder to obtain the control feature vector;

[0016] The control feature vector is transformed into a path generation feature vector through the transcoder.

[0017] In some embodiments, the preset control variable sequence includes at least one or more of the following control variables:

[0018] The control variables are: total path length, path smoothness, path risk, and path energy consumption.

[0019] In some embodiments, the step of converting the control feature vector into a path generation feature vector using the transcoder includes:

[0020] Obtain a random transformation sequence from the standard normal distribution;

[0021] The control feature vector is concatenated with the transformation sequence to obtain a concatenated vector;

[0022] The concatenated vector is input into the transcoder to obtain the output vector;

[0023] The output vector is segmented to obtain a path generation feature vector, the dimension of which is the same as that of the control feature vector.

[0024] In some embodiments, the step of using a probabilistic generation model as a decoder to generate a target path starting from the current position and ending at the target position based on the path-generating feature vector includes:

[0025] The original input data and the path-generated feature vector are input into the probability generation model for a first preset number of iterations to obtain the target data, wherein the original input data is randomly sampled from a standard normal distribution, and the size of the original input data is the same as the size of the rasterized information.

[0026] The target data is binarized to obtain the target path raster map corresponding to the target path.

[0027] In some embodiments, the step of inputting the original input data and the path-generated feature vector into the probability generation model for a first preset number of iterative calculations to obtain the target data includes:

[0028] During the first preset number of iterations, a second preset number of path entropy calculations are interspersed. Each path entropy calculation is used to input the historical data obtained from the previous iteration into the path entropy discriminator to calculate the path entropy, so that the parameters of the probability generation model are updated in the direction of the gradient of path entropy reduction. The second preset number is less than or equal to the first preset number. The path entropy is used to characterize the degree of dispersion of multiple pixels representing the target path in the target path raster map.

[0029] The next iteration is performed based on the updated probabilistic generation model with updated model parameters.

[0030] Secondly, embodiments of this disclosure provide a path planning apparatus, comprising:

[0031] The acquisition module is used to acquire the current position and target position of the vehicle, both of which are located in the target sea area;

[0032] The modeling module is used to perform raster modeling of the target sea area based on the information of the sea vehicle and the environmental information of the target sea area, so as to obtain the raster information of the target sea area.

[0033] The conversion module is used to convert the rasterized information and the preset control variable sequence into a path generation feature vector through a preset encoder. The preset control variable sequence is used to control the features of the target path.

[0034] The generation module is used as a decoder to generate a target path with the current position as the starting point and the target position as the ending point, based on the path and the probability generation model as the decoder.

[0035] Thirdly, embodiments of this disclosure provide an electronic device, including:

[0036] Memory;

[0037] Processor; and

[0038] Computer programs;

[0039] The computer program is stored in the memory and configured to be executed by the processor to implement the method as described in the first aspect.

[0040] Fourthly, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method described in the first aspect.

[0041] Fifthly, embodiments of this disclosure also provide a computer program product, which includes a computer program or instructions that, when executed by a processor, implement the path planning method as described above.

[0042] The path planning method, apparatus, device, and computer-readable storage medium provided in this disclosure solve the problem of low flexibility in traditional marine path planning methods by performing raster modeling of the target sea area and introducing a preset control variable sequence to control the characteristics of the target path. Attached Figure Description

[0043] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0044] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 A flowchart of the path planning method provided in this embodiment of the disclosure;

[0046] Figure 2 This is a schematic diagram of a priori encoder structure provided in an embodiment of the present disclosure;

[0047] Figure 3 A schematic diagram of rasterization modeling provided in an embodiment of this disclosure;

[0048] Figure 4 This is a schematic diagram of a static obstacle handling method provided in an embodiment of the present disclosure;

[0049] Figure 5 A schematic diagram of a steering scheme for a watercraft provided in an embodiment of this disclosure;

[0050] Figure 6 This is a schematic diagram of a priori encoder training process provided in an embodiment of the present disclosure;

[0051] Figure 7 This is a schematic diagram illustrating the acquisition of path generation feature vectors according to an embodiment of the present disclosure;

[0052] Figure 8 This is a schematic diagram of target data acquisition provided in an embodiment of the present disclosure;

[0053] Figure 9A schematic diagram of a probability generation model provided in an embodiment of this disclosure;

[0054] Figure 10 This is a schematic diagram of a target path raster provided in an embodiment of the present disclosure;

[0055] Figure 11 A schematic diagram of an iterative process provided in an embodiment of this disclosure;

[0056] Figure 12 This is a schematic diagram of the path planning device provided in an embodiment of the present disclosure;

[0057] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0058] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0059] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0060] The maritime environment is complex and unpredictable, and without advance planning of routes, surface vehicles can easily find themselves in danger. For unmanned vessels, due to the lack of human control and guidance during navigation, path planning technology becomes crucial for their intelligent control and directly impacts their level of intelligence. Surface vehicle path planning is the process of planning a route from the current position to the target position within the entire target sea area, with the aim of enabling the surface vehicle to avoid dangerous areas and efficiently reach the target location.

[0061] High-accuracy path planning methods for watercraft can be broadly categorized into three types: linear programming, shortest path algorithms, and deep learning. Linear programming methods aim to find the optimal path by maximizing or minimizing a linear function under linear constraints, often requiring solvers for optimization. The advantage of linear programming is its ability to find different paths based on varying constraints; however, it requires recalculating the linear function for each specific path planning problem, lacking generalization ability and struggling to define complex constraints. Shortest path algorithms can quickly find the shortest path through algorithmic optimization, but similarly lack generalization ability, requiring different modeling for different environments. Furthermore, the shortest path does not necessarily equate to the optimal path, lacking flexibility and proving ineffective in complex real-world scenarios. With the development of artificial intelligence, many deep learning-based methods have been proposed for path planning. Traditional deep learning path planning methods are based on autoregressive models, processing and predicting path information sequentially, exhibiting some generalization ability. However, autoregressive models are non-probabilistic, generating only one optimal path calculated by the neural network for a given starting and ending point, lacking flexibility.

[0062] Of the methods described above, linear programming requires redefining the optimal linear function and constraints for each path planning problem, resulting in poor generalization and low usability. Shortest path algorithms, while efficient, only find the shortest path, not the optimal one, lacking generalization and flexibility, and are difficult to handle complex environments, also resulting in low usability. Traditional deep learning path planning algorithms based on autoregressive models generate paths sequentially, failing to capture the overall characteristics of the path, leading to lower accuracy compared to linear programming and shortest path algorithms. Neural networks offer some generalization ability, but lacking a probabilistic model, they suffer from low flexibility and limited usability.

[0063] To address the aforementioned problems, this disclosure provides a path planning method, which will be described below with reference to specific embodiments.

[0064] Figure 1 This is a flowchart illustrating the path planning method provided in this embodiment. This method can be applied to any terminal device with data processing capabilities, such as smartphones, PDAs, tablets, wearable devices with displays, desktop computers, laptops, all-in-one computers, smart home devices, etc. It is understood that the path planning method provided in this embodiment can also be applied to other scenarios.

[0065] The following is about Figure 1 The path planning method shown is introduced below, and the specific steps of this method are as follows:

[0066] S101. Obtain the current position and target position of the sea vehicle, wherein both the current position and the target position are located in the target sea area.

[0067] Watercraft refer to all kinds of water transportation vehicles that can navigate or anchor in waterways for transportation or operations, including manually operated ships and unmanned ships.

[0068] For path planning of a watercraft, the first step is to determine the starting and ending points of the target path. Specifically, the current position of the watercraft can be taken as the starting point of the target path, and the target position of the watercraft can be taken as the ending point of the target position, thereby planning the target path (i.e., the target trajectory) for the watercraft to travel from the current position to the target position.

[0069] The current position of the watercraft can be obtained based on the positioning system onboard the vehicle, including but not limited to the Global Positioning System (GPS). The target position of the watercraft can be determined by specific data, and this disclosure does not limit this.

[0070] The target sea area is a sea area that includes both the current location and the target location. Optionally, the target sea area can be a rectangular sea area that includes the area that the vehicle may pass through as it travels from the current location to the target location.

[0071] S102. Based on the information of the sea vehicle and the environmental information of the target sea area, perform raster modeling on the target sea area to obtain the raster information of the target sea area.

[0072] The information to be obtained includes the information of the sea vehicle and the environmental information of the target sea area. The information of the sea vehicle includes at least the speed and size of the sea vehicle.

[0073] Environmental information for the target sea area includes information on water currents, water depth, and static obstacles (such as reefs and islands). Specifically, relevant observational information and digital elevation data are acquired through technologies such as atmospheric observation stations, hydrological observation stations, buoys, underwater moorings, tide gauge stations, and image acquisition and recognition. Water current information within the target sea area can be used to calculate the energy consumption of surface vessels, while water depth and static obstacle information can be used to calculate the safety of surface vessels during navigation.

[0074] Optionally, environmental information can also be obtained by simulating the target sea area using a physical numerical model.

[0075] In raster modeling, the environmental information of the target sea area is divided into several grids. Based on the environmental information of the target sea area within each grid region, it is determined whether the grid is suitable for navigation of sea vehicles. For example, for any given grid region, if there is a static obstacle within the grid region, and the entire area of ​​the grid is covered by the static obstacle, the grid is marked as an obstacle grid and is not suitable for navigation of sea vehicles.

[0076] Furthermore, based on the environmental information of the target sea area, it is also possible to determine the environmental information within each grid cell. For example, based on the water current velocity of the target sea area, the average water current velocity within each grid cell can be calculated as the water current velocity information for that grid cell; based on the water depth information of the target sea area, the average water depth within each grid cell can be calculated as the water depth information for that grid cell; based on the water current direction information of the target sea area, the average current direction within each grid cell can be calculated as the water current direction information for that grid cell, and so on.

[0077] After calculating or processing the information of each grid cell, the rasterized information of the target sea area is obtained.

[0078] S103. The rasterized information and the preset control variable sequence are converted into path generation feature vectors by a preset encoder.

[0079] The preset control variable sequence is used to control the characteristics of the target path. The characteristics of the target path can be determined according to actual needs, and the preset control variables can be further set.

[0080] Specifically, the characteristics of the target path may include the length of the target path, the smoothness of the target path, the safety of the target path, the energy consumption required for the watercraft to travel along the target path, etc., which are not limited in this disclosure.

[0081] The preset encoder includes a prior encoder and a transcoder. The prior encoder generates a control feature vector based on rasterization information and a preset control variable sequence. The transcoder converts the control feature vector into a path generation feature vector. That is, the rasterization information and the preset control variable sequence are input into the pre-trained prior encoder to obtain the control feature vector; the transcoder then converts the control feature vector into a path generation feature vector.

[0082] The prior encoder is a neural network model that incorporates an attention mechanism. Using rasterized information and a pre-defined sequence of control variables as input, the prior encoder outputs a feature vector, called the control feature vector. This control feature vector represents some characteristics of the control variables and the environment, constraining the features that the planned target path should possess.

[0083] Figure 2This is a schematic diagram of a priori encoder structure provided for an embodiment of this disclosure. In one possible implementation, such as... Figure 2 As shown, the prior encoder consists of an embedding layer, a convolutional layer, a linear layer, a cross-attention layer, a residual block, and another linear layer. A preset control variable sequence is input into the embedding layer, and rasterized information is input into the convolutional layer. After passing through the linear layer, the cross-attention layer introduces the dependency between the two, and then the control feature vector is obtained by sequentially passing through the residual block and the linear layer.

[0084] A transcoder is used to transform control feature vectors into path-generating feature vectors. In some embodiments, the encoder neural network of a Transformer model can be used as a transcoder, and the input and output parts of the model can be modified to enable the encoder to function independently of the Transformer structure.

[0085] S104. Using the probability generation model as a decoder, generate the target path based on the path by generating feature vectors.

[0086] Probabilistic generative models are an important class of models in probability statistics and machine learning, referring to a series of models used to randomly generate observable data.

[0087] Taking the Diffusion probabilistic generation model as an example, the process of generating a target path based on path-generated feature vectors can be divided into two parts: a forward process and a backward process. The forward process can be described as continuously adding random noise to the original data, while the backward process is the data generation process, which can generate data from random noise.

[0088] This embodiment of the disclosure obtains the current position and target position of the vehicle, both of which are located in the target sea area. Based on the information of the maritime vehicle and the environmental information of the target sea area, a raster model is performed on the target sea area to obtain raster information of the target sea area. A preset encoder is used to convert the raster information and a preset control variable sequence into a path generation feature vector, the preset control variable sequence being used to control the features of the target path. A probabilistic generation model is used as a decoder to generate a target path starting from the current position and ending at the target position based on the path generation feature vector. By performing raster modeling on the target sea area and introducing a preset control variable sequence to control the features of the target path, the problem of low flexibility in traditional maritime path planning methods is solved.

[0089] Based on the above embodiments, the step of performing raster modeling on the target sea area based on the information of the watercraft and the environmental information of the target sea area to obtain the raster information of the target sea area includes: scaling the target sea area according to the size of the watercraft, and dividing the scaled target sea area into a preset number of grids, wherein the side length of each grid is the distance traveled by the watercraft per unit time; calculating the environmental information of each grid according to the environmental information of the target sea area to obtain the raster information of the target sea area.

[0090] Considering the speed and size of the sea vehicle, a raster model of the target sea area is performed. Specifically, based on the actual size of the sea vehicle, it is treated as a point mass, and static obstacles within the target sea area are expanded or compressed.

[0091] Figure 3 This is a schematic diagram of a rasterization modeling method provided in an embodiment of this disclosure. Figure 3 As shown, in one possible implementation, assuming the original area of ​​the target sea area is H×W and the speed of the sea vehicle per unit time is V, the target sea area can be divided into... There are 12 grids, each of size V×V, and each grid has a unique coordinate identifier, for example... Figure 3 The bottom left corner grid is defined as (1,1), and the top right corner grid is defined as (n,m). The speed of the watercraft per unit time can be adjusted according to the time situation, but it is necessary to ensure that the heading of the watercraft remains almost unchanged per unit time.

[0092] Further, based on the environmental information of the target sea area, the environmental information of each grid is calculated to obtain the rasterized information of the target sea area. Optionally, based on the static obstacle information within the target sea area, it is determined whether each grid belongs to an obstacle grid. The outer rectangular frame of the static obstacle is taken as the actual size of the obstacle, and all grids located within the rectangular frame are obstacle grids.

[0093] Figure 4 This is a schematic diagram of a static obstacle handling method provided in an embodiment of this disclosure. Figure 4 As shown, when two static obstacles are close to each other, the distance between the outer frame lines of the two obstacles is calculated and compared with the actual size of the vehicle. If the distance is large, the obstacle mesh is reduced accordingly, and vice versa.

[0094] Based on the above embodiments, the preset control variable sequence includes at least one or more of the following control variables: total path length control variable, path smoothness control variable, path risk control variable, and path energy consumption control variable.

[0095] The preset encoder includes a prior encoder and a transcoder; the step of converting the rasterized information and the preset control variable sequence into a path generation feature vector through the prior encoder includes: inputting the rasterized information and the preset control variable sequence into a pre-trained prior encoder to obtain a control feature vector; and converting the control feature vector into a path generation feature vector through the transcoder.

[0096] Specifically, the preset control variable sequence includes the total path length control variable l, the path smoothness control variable s, the path risk control variable r, and the path energy consumption control variable e. These four variables can be set according to specific needs and directly affect the final path planning tendency.

[0097] In some embodiments, the values ​​of the four control variables are restricted as follows:

[0098] l, s, r, e∈[0, 1]

[0099] l + s + r + e = 1

[0100] The total path length control variable l constrains the total length of the target path. In a rasterized environment, the total length of the target path p in this embodiment of the disclosure is:

[0101]

[0102] Here, c(i,j) = 0 or 1, representing whether grid (i,j) is selected as a grid passed through by the target path. If grid (i,j) is selected as a grid passed through by the target path, i.e., (i,j)∈p, then c(i,j) = 1; otherwise, if grid (i,j) is not selected as a grid passed through by the target path, then c(i,j) = 0. The target path p is defined as the set of all grids where c(i,j) = 1. The closer l is to 1, the more the path planning tends to favor paths with shorter total lengths, i.e., the smaller the path L(p). When l = 0, it means that only the shortest path is considered during path planning, while when l = 0, it means that the total path length is not considered at all during path planning.

[0103] The path smoothness control variable 's' constrains the overall smoothness of the path. Since watercraft struggle to make large turns during navigation, it is necessary to constrain the turning angles within the target path. For example, Figure 5 This is a schematic diagram of a steering scheme for a watercraft provided in an embodiment of this disclosure, as shown below. Figure 5 As shown, the turning range of a watercraft is defined as a 90° range directly ahead, meaning the turning angle to the left and right is both within a 45° range. The overall smoothness of the target path p can be expressed as S(p) = ∑ i∈p θ iLet / L(p) represent this, where θ i θ represents the turning angle of a watercraft when passing between two adjacent grid cells. i =1 indicates a turning angle of 45°, θ i =0 indicates that the original driving direction is maintained. The closer s is to 1, the more the path planning tends to be a smoother overall path, that is, a path with a smaller S(p).

[0104] The path risk control variable *r* constrains the overall safety of the path. Watercraft have draft limitations when navigating; navigating shallow waters can easily lead to danger. The minimum safe water depth (d) for watercraft is defined. min = The maximum draft of the watercraft (d) vehicle ); Sufficient safe water depth (d) ample )=d min +Balanced water depth (UKC): Draft depth is related to the vessel itself. The margin of water depth can be a fixed value or set based on environmental factors, vessel characteristics, etc. In a grid environment, the overall safety of path p can be defined as:

[0105]

[0106] Where d(i,j) represents the average water depth of grid (i,j), and the clamp() function is used to restrict the values ​​in the function to the range [0,1]. The closer r is to 1, the more the path planning will favor safer paths, that is, paths with smaller R(p).

[0107] The path energy consumption control variable *e* constrains the total energy consumption of the path. The energy consumption of a watercraft is related to its travel time and the resistance of the unit area flow it experiences. The travel time depends on the actual travel speed, and the unit area resistance depends on the relative speed between the watercraft and the current. Let the actual travel speed of the watercraft be... The water flow velocity is As can be seen from the above embodiments, the size of a single grid is When a vehicle travels from one grid to the next, the travel time t can be divided into several parts depending on whether the direction is diagonal to the grid. And T. Relative velocity is the vector difference between the actual velocity and the flow velocity, denoted as T. The frictional resistance R per unit area experienced by a seaplane in a body of water f The calculation process is as follows:

[0108]

[0109] Where C f C is the coefficient of frictional resistance. rLet be the roughness subsidy coefficient, ρ be the water density, and S be the contact area between the watercraft and the water. In a grid environment, the total energy consumption of path p is denoted as:

[0110]

[0111] Where ε is the energy consumption parameter. The closer e is to 1, the more the path planning will favor paths with lower energy consumption, that is, paths with smaller E(p).

[0112] The embodiments disclosed herein further improve the flexibility of path planning for watercraft by introducing a preset sequence of control variables to constrain the characteristics of the target path during the path planning process.

[0113] Based on the above embodiments, the prior encoder needs to be trained. Specifically, the prior encoder is trained using a contrastive learning approach. In contrastive learning, an additional encoder called the path encoder is introduced, and the prior encoder and the path encoder are trained simultaneously.

[0114] Figure 6 This is a schematic diagram illustrating a priori encoder training process provided in an embodiment of this disclosure. Figure 6 As shown, suppose a training batch has b samples. For the prior encoder, there are b sets of control variable sequences and corresponding grid environments. For the path encoder, there are b paths and grid environments corresponding to the b sets of control variables. Taking four samples as an example, the training process for this batch is as follows: The prior encoder transforms the b sets of control variable sequences (l1, s1, r1, e1), (l2, s2, r2, e2), (l3, s3, r3, e3), (l4, s4, r4, e4) and grid environments into control feature vectors {v}. control},For example Figure 5 The v shown c_1 v c_2 v c_3 v c_4 The path encoder transforms b paths P1, P2, P3, P4 and the raster environment into path feature vectors {v}. path},For example Figure 5 The v shown p_1 v p_2 v p_3 v p_4 Calculate the cosine similarity between all control feature vectors and path feature vectors:

[0115]

[0116] Arrange all similarities into a b×b matrix, where the similarity between the corresponding control feature vector and path feature vector is on the main diagonal; calculate the loss by combining the similarity matrix with the matrix whose main diagonal elements are 1 and the rest are -1, backpropagate the gradient, and optimize the parameters of the prior encoder.

[0117] Furthermore, the rasterized information and the preset control variable sequence are input into a pre-trained prior encoder to obtain the control feature vector.

[0118] Based on the above embodiments, the step of converting the control feature vector into a path generation feature vector through the transcoder includes: obtaining a random transformation sequence from a standard normal distribution; concatenating the control feature vector with the transformation sequence to obtain a concatenated vector; inputting the concatenated vector into the transcoder to obtain an output vector; and segmenting the output vector to obtain a path generation feature vector, wherein the dimension of the path generation feature vector is the same as that of the control feature vector.

[0119] In some embodiments, the encoder neural network of the Transformer model is used as a transcoder, and the input and output parts of the model are modified so that the encoder can function independently of the Transformer structure. Figure 7 This is a schematic diagram illustrating a path generation feature vector acquisition method provided in an embodiment of this disclosure. For example... Figure 7 As shown, let the control feature vector v control The dimension is (dim) n ,1), the dimension of the path-generated feature vector is (dim m ,1),

[0120] Then, a random transformation sequence g is generated from the standard normal distribution N(0,1), and the dimension of g is (dim m 1). Control feature vector v control Concatenating it with g yields the concatenated vector, specifically v. control With 'g' preceding 'g' and 'g' following 'g', the resulting dimension is (dim) n +dim m The concatenated vector v of 1) joint , will v joint The input vector is fed into the encoder of the Transformer to obtain the output vector v. out Its dimension is (dim n +dim m ,1), v out According to dim n +dim m Divide the dimensions and take the latter half (dim). m The dimensional data is used as a path to generate feature vectors.

[0121] Based on the above embodiments, the step of using the probability generation model as a decoder to generate a target path with the current position as the starting point and the target position as the ending point based on the path generation feature vector includes: inputting the original input data and the path generation feature vector into the probability generation model for a first preset number of iterations to obtain target data, wherein the original input data is randomly sampled from a standard normal distribution, and the size of the original input data is the same as the size of the raster information; and performing binarization processing on the target data to obtain a target path raster map corresponding to the target path.

[0122] The process involves inputting the original input data and the path generation feature vector into the probabilistic generation model for a first preset number of iterations to obtain the target data. This includes: interspersing a second preset number of path entropy calculations during the first preset number of iterations. Each path entropy calculation uses historical data obtained from the previous iteration to be fed into a path entropy discriminator to calculate the path entropy, so that the parameters of the probabilistic generation model are updated in the direction of decreasing path entropy. The second preset number of iterations is less than or equal to the first preset number of iterations. The path entropy is used to characterize the dispersion of multiple pixels representing the target path in the target path raster image. Based on the updated probabilistic generation model parameters, the next iteration is performed.

[0123] The following uses the Diffusion probabilistic generation model as an example to describe the above steps. As mentioned in the above embodiment, the Diffusion probabilistic generation model consists of two parts: a forward process and a backward process. The forward process can be described as continuously adding random noise to the original data. After adding noise at time t, the distribution of the data is as follows: in{ t} is a predefined sequence that monotonically decreases with time t, z t The noise is a standard normally distributed noise. The data distribution at time t can be directly deduced from the original data x0. in It follows a standard normal distribution.

[0124] The reverse process is the data generation process, which can generate raw data from random noise. The distribution of data at time t-1 can be deduced from the data at time t-1. in:

[0125]

[0126]

[0127]

[0128] In this embodiment, a neural network is used to predict x0 and z in the reverse process. t . Figure 8 This is a schematic diagram illustrating target data acquisition as provided in an embodiment of this disclosure. Figure 8 As shown, by calculating the weighted average This can make the model more stable. To reduce model size and improve efficiency, predict z... t Neural network 1 is a subnetwork of neural network 2 that predicts x0, z t It is essentially the output of intermediate variables in the process of predicting x0.

[0129] Suppose there are T time points in total. At time t, the input data is x. t Path-generated feature vector v generate Given a predefined sequence of parameters { t Under the premise of}, generate data x at time t-1. t-1 The process is as follows: x0 and z are calculated using a neural network. t ;Pick Calculated In normal distribution Random sampling is performed to obtain x. t-1 .

[0130] The above process is iterated T times until the target data x0 is generated at t=1. The original input data x of the model... T Random samples can be taken from a standard normal distribution, with a size consistent with the raster environment of n×m. The final data x0 is binarized, where 1 represents the path and 0 represents everything else, to obtain the target path raster map. Various neural networks can be used for the internal structure of the Diffusion model; this disclosure does not limit the specific implementation.

[0131] Figure 9 This is a schematic diagram of a probability generation model provided in an embodiment of this disclosure. For example... Figure 9 As shown, this structure is a composite network structure based on U-Net and ResNet with added attention mechanism, and also includes convolutional layers, linear layers, cross attention, residual blocks, and linear layers.

[0132] The Diffusion model exhibits significant randomness throughout the generation process; therefore, a path entropy discriminator is introduced. This discriminator operates during the training phase to guide the generation process in a direction that reduces path entropy, thereby accelerating convergence and reducing the number of iterations. Path entropy is defined as the dispersion of multiple pixels in the binarized target path raster image; that is, how many grids representing the target path in the target path raster image resemble the path.

[0133] Figure 10 This is a schematic diagram of a target path raster map provided in an embodiment of this disclosure. Figure 10 As shown, in a binary image, assuming 1 represents a black pixel and 0 represents a white pixel, the lower the path entropy, the more the image composed of black pixels resembles a path; the higher the path entropy, the more chaotic the distribution of black pixels.

[0134] Figure 11 This is a schematic diagram of an iterative process provided for an embodiment of this disclosure. For example... Figure 11 As shown, at time t, the output x of the Diffusion model t-1 Before iterating at time t-1, the path entropy PE(x) is calculated by the path entropy discriminator. t-1 Then, through backpropagation, the model parameters are updated in the direction of the gradient that reduces path entropy, and then the generation iteration at time t-1 is performed again. The application of the path entropy discriminator is flexible; it can be introduced at every time step or every few iterations.

[0135] In some embodiments, path entropy can be measured by determining the clustering of black pixels in a binary image. A cluster of connected black pixels is defined as PE = (number of clusters - 1) / total number of black pixels. The path entropy discriminator can also use a neural network; a pre-trained discriminator is better able to determine the magnitude of path entropy.

[0136] The embodiments of this disclosure are based on a path planning method for watercraft using a heuristic network structure and a probabilistic generative model. The method focuses on two main aspects: the generalization and flexibility of the model. While maintaining high accuracy, it comprehensively optimizes and improves existing path planning methods for watercraft, thereby enhancing the usability of the model.

[0137] Figure 12 This is a schematic diagram of the structure of a path planning device provided in an embodiment of this disclosure. The path planning device can be a terminal device as described in the above embodiments, or it can be a component or assembly within the terminal device. The path planning device provided in this disclosure can execute the processing flow provided in the path planning method embodiments, such as... Figure 12As shown, the path planning device 120 includes: an acquisition module 121, a modeling module 122, a conversion module 123, and a generation module 124; wherein, the acquisition module 121 is used to acquire the current position and target position of the vehicle, both of which are located in the target sea area; the modeling module 122 is used to perform raster modeling on the target sea area based on the information of the watercraft and the environmental information of the target sea area to obtain raster information of the target sea area; the conversion module 123 is used to convert the raster information and a preset control variable sequence into a path generation feature vector through a preset encoder, wherein the preset control variable sequence is used to control the features of the target path; the generation module 124 is used to use a probabilistic generation model as a decoder to generate a target path with the current position as the starting point and the target position as the ending point based on the path generation feature vector.

[0138] Optionally, the modeling module 122 includes a scaling unit 1221 and a first calculation unit 1222; the scaling unit 1221 is used to scale the target sea area according to the size of the watercraft and divide the scaled target sea area into a preset number of grids, wherein the side length of each grid is the distance traveled by the watercraft per unit time; the first calculation unit 1222 is used to calculate the environmental information of each grid according to the environmental information of the target sea area to obtain the rasterized information of the target sea area.

[0139] Optionally, the preset encoder includes a prior encoder and a transcoder; the conversion module 123 includes an input unit 1231 and a conversion unit 1232; the input unit 1231 is used to input the rasterized information and the preset control variable sequence into the pre-trained prior encoder to obtain a control feature vector; the conversion unit 1232 is used to convert the control feature vector into a path generation feature vector through the transcoder.

[0140] Optionally, the preset control variable sequence includes at least one or more of the following control variables: total path length control variable, path smoothness control variable, path risk control variable, and path energy consumption control variable.

[0141] Optionally, the transformation unit 1232 is used to obtain a random transformation sequence from a standard normal distribution; concatenate the control feature vector with the transformation sequence to obtain a concatenated vector; input the concatenated vector into the transcoder to obtain an output vector; and segment the output vector to obtain a path generation feature vector, wherein the dimension of the path generation feature vector is the same as that of the control feature vector.

[0142] Optionally, the generation module 124 includes a second calculation unit 1241 and a processing unit 1242; the second calculation unit 1241 is used to input the original input data and the path generation feature vector into the probability generation model for a first preset number of iterations to obtain target data, wherein the original input data is randomly sampled from a standard normal distribution, and the size of the original input data is the same as the size of the raster information; the processing unit 1242 is used to perform binarization processing on the target data to obtain a target path raster map corresponding to the target path.

[0143] Optionally, the second calculation unit 1241 is used to intersperse path entropy calculations for a second preset number of times during the first preset number of iterations. Each path entropy calculation is used to send the historical data obtained from the previous iteration to the path entropy discriminator to calculate the path entropy, so that the probability generation model parameters are updated in the direction of decreasing path entropy gradient. The second preset number of times is less than or equal to the first preset number of times. The path entropy is used to characterize the dispersion of multiple pixels representing the target path in the target path raster. The next iteration calculation is performed based on the probability generation model updated with model parameters.

[0144] Figure 12 The path planning device shown in the embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and will not be described again here.

[0145] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. The electronic device can be an upgradeable device as described in the above embodiments. The electronic device provided in this disclosure can execute the processing flow provided in the path planning method embodiments, such as… Figure 13 As shown, the electronic device 130 includes: a memory 131, a processor 132, a computer program, and a communication interface 133; wherein the computer program is stored in the memory 131 and is configured to be executed by the processor 132 using the path planning method described above.

[0146] In addition, this disclosure also provides a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the path planning method described in the above embodiments.

[0147] Furthermore, this disclosure also provides a computer program product, which includes a computer program or instructions that, when executed by a processor, implement the path planning method described above.

[0148] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0149] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A path planning method, characterized in that, The method includes: The current position and target position of the vehicle are obtained, both of which are located in the target sea area; Based on the information of the sea vehicle and the environmental information of the target sea area, a raster model of the target sea area is performed to obtain the raster information of the target sea area. The rasterized information and the preset control variable sequence are transformed into a path generation feature vector by a preset encoder. The preset control variable sequence is used to control the features of the target path. The preset encoder includes a prior encoder and a transcoder. The preset control variable sequence includes at least one or more of the following control variables: total path length control variable, path smoothness control variable, path risk control variable, and path energy consumption control variable. Using a probabilistic generation model as a decoder, a target path is generated based on the path to generate a feature vector, starting from the current position and ending at the target position. The step of converting the rasterized information and the preset control variable sequence into a path generation feature vector through a preset encoder includes: The rasterized information and the preset control variable sequence are input into a pre-trained prior encoder to obtain the control feature vector; The control feature vector is transformed into a path generation feature vector through the transcoder. The step of converting the control feature vector into a path generation feature vector using the transcoder includes: Obtain a random transformation sequence from the standard normal distribution; The control feature vector is concatenated with the transformation sequence to obtain a concatenated vector; The concatenated vector is input into the transcoder to obtain the output vector; The output vector is segmented to obtain a path generation feature vector, the dimension of which is the same as that of the control feature vector. The step of using a probabilistic generation model as a decoder to generate a target path starting from the current position and ending at the target position based on the path feature vector includes: The original input data and the path-generated feature vector are input into the probability generation model for a first preset number of iterations to obtain the target data, wherein the original input data is randomly sampled from a standard normal distribution, and the size of the original input data is the same as the size of the rasterized information. The target data is binarized to obtain the target path raster map corresponding to the target path.

2. The method according to claim 1, characterized in that, Based on the information from the sea vehicle and the environmental information of the target sea area, a raster model of the target sea area is performed to obtain raster information of the target sea area, including: The target sea area is scaled according to the size of the watercraft, and the scaled target sea area is divided into a preset number of grids, where the side length of each grid is the distance traveled by the watercraft per unit time. The environmental information of each grid is calculated based on the environmental information of the target sea area to obtain the rasterized information of the target sea area.

3. The method according to claim 1, characterized in that, The step of inputting the original input data and the path-generated feature vector into the probability generation model for a first preset number of iterations to obtain the target data includes: During the first preset number of iterations, a second preset number of path entropy calculations are interspersed. Each path entropy calculation is used to input the historical data obtained from the previous iteration into the path entropy discriminator to calculate the path entropy, so that the parameters of the probability generation model are updated in the direction of the gradient of path entropy reduction. The second preset number is less than or equal to the first preset number. The path entropy is used to characterize the degree of dispersion of multiple pixels representing the target path in the target path raster map. The next iteration is performed based on the updated probabilistic generation model with updated model parameters.

4. A path planning device, characterized in that, include: The acquisition module is used to acquire the current position and target position of the vehicle, both of which are located in the target sea area; The modeling module is used to perform raster modeling of the target sea area based on the information of the sea vehicle and the environmental information of the target sea area, so as to obtain the raster information of the target sea area. The conversion module is used to convert the rasterized information and the preset control variable sequence into a path generation feature vector through a preset encoder. The preset control variable sequence is used to control the features of the target path. The preset encoder includes a prior encoder and a transcoder. The preset control variable sequence includes at least one or more of the following control variables: total path length control variable, path smoothness control variable, path risk control variable, and path energy consumption control variable. The generation module is used to use the probability generation model as a decoder to generate a target path with the current position as the starting point and the target position as the ending point based on the path feature vector. The conversion module includes an input unit and a conversion unit; The input unit is used to input the rasterized information and the preset control variable sequence into a pre-trained prior encoder to obtain a control feature vector. The conversion unit is used to convert the control feature vector into a path generation feature vector through the transcoder; The transformation unit is further configured to obtain a random transformation sequence from a standard normal distribution; and to concatenate the control feature vector with the transformation sequence to obtain a concatenated vector. The concatenated vector is input into the transcoder to obtain the output vector; The output vector is segmented to obtain a path generation feature vector, the dimension of which is the same as that of the control feature vector. The generation module includes a second computing unit and a processing unit; The second calculation unit is used to input the original input data and the path-generated feature vector into the probability generation model for a first preset number of iterations to obtain the target data, wherein the original input data is randomly sampled from a standard normal distribution, and the size of the original input data is the same as the size of the rasterized information. The processing unit is used to perform binarization processing on the target data to obtain a target path raster map corresponding to the target path.

5. An electronic device, characterized in that, include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and configured to be executed by the processor to implement the method as described in any one of claims 1-3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-3.