Ant colony unmanned ship path planning method based on improved pheromone updating strategy

By processing electronic nautical charts in grayscale and rasterization, and combining improved pheromone update strategies and heuristic functions, the path planning problem of traditional ant colony algorithms in complex marine environments was solved, enabling efficient and safe navigation of unmanned vessels.

CN121933018APending Publication Date: 2026-04-28NANTONG SHIPPING COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANTONG SHIPPING COLLEGE
Filing Date
2026-02-05
Publication Date
2026-04-28

Smart Images

  • Figure CN121933018A_ABST
    Figure CN121933018A_ABST
Patent Text Reader

Abstract

The invention relates to an ant colony unmanned ship path planning method based on an improved pheromone updating strategy. The method comprises the following steps: graying and rasterizing an electronic chart of a target area, and expanding obstacles to construct a rasterized environment map packet; setting basic parameters, potential field parameters and constraint conditions of the ant colony to obtain an initial parameter set; generating a path quality dynamic weight and potential field pheromone increment combined improved pheromone updating rule, and constructing a potential field guided improved heuristic function; and carrying out ant colony iterative search, path screening and smoothing processing to generate an optimal path. According to the method, an improved pheromone updating strategy combining the path quality dynamic weight and the potential field pheromone increment is introduced, and an improved heuristic function guided by the potential field is fused, so that the convergence speed and the global optimization capacity of the algorithm are improved, and the safety, the smoothness and the performability of path planning are further enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer technology, and in particular relates to a path planning method for unmanned surface vessels based on an improved pheromone update strategy. Background Technology

[0002] Unmanned surface vehicles (USVs), as intelligent platforms capable of autonomous navigation and diverse missions in marine environments, integrate technologies from multiple disciplines such as intelligent control, marine engineering, and artificial intelligence. They have broad application prospects in civilian sectors (cargo transportation, island resupply, water sampling, maritime search and rescue) and military sectors (water reconnaissance, mine detection), providing a safe alternative to manual labor in hazardous environments for marine development and shipping. my country attaches great importance to the development of the intelligent ship industry, issuing policy documents such as the "Intelligent Ship Specification" and the "Intelligent Ship Development Action Plan (2019-2021)," establishing unmanned ship test sites, and promoting the continuous advancement of unmanned ship technology. Path planning technology, as a core indicator for measuring the intelligence level of USVs, directly determines their ability to complete missions safely and efficiently, and has become a key research focus.

[0003] Currently, path planning techniques are mainly divided into global path planning and local path planning. Commonly used global path planning algorithms include ant colony optimization, A* algorithm, and Dijkstra's algorithm, while local path planning algorithms include artificial potential field method, particle swarm optimization, and fuzzy logic algorithm. To balance the applicability of global planning with the real-time performance of local obstacle avoidance, some studies have integrated ant colony optimization with artificial potential field method to form potential field ant colony optimization. However, the traditional potential field ant colony optimization still has significant drawbacks in practical applications: On the one hand, the traditional ant colony optimization relies on the pheromone positive feedback mechanism. In the initial stage, the pheromone concentration is uniform, and the ant path selection is blind, resulting in slow convergence speed and a tendency to get trapped in local optima due to the dominance of distance heuristic factors. On the other hand, the repulsive potential field function of the traditional artificial potential field method is poorly designed. When the target point is within the range of the obstacle's repulsive force, the repulsive force increases as the USV approaches the target, potentially exceeding the gravitational force and causing the target to become unreachable or the path to stagnate. Furthermore, existing navigation environment modeling methods lack adaptability in grid granularity selection, fail to fully consider the impact of obstacle proportions on planning accuracy and efficiency, and do not incorporate actual navigation factors such as USV size, draft, and wind, waves, and currents, resulting in insufficient path safety and adaptability. These issues severely limit the navigation performance of USVs in complex marine environments, making it difficult to meet the practical application requirements for path planning that demands "short paths, high safety, fast convergence, and stable reliability." Therefore, there is an urgent need to improve and optimize existing potential field ant colony algorithms and environmental modeling methods. Summary of the Invention

[0004] Therefore, it is necessary to provide an ant colony unmanned surface vessel path planning method based on an improved pheromone update strategy to address the above-mentioned technical problems. This method aims to improve the convergence speed and path search efficiency of the path planning algorithm, enhance the global optimality and target reachability of the path planning, and improve the adaptability of the planned path to complex marine environments, navigation safety, and the stability and reliability of the algorithm under different obstacle distribution scenarios.

[0005] Firstly, this application provides a path planning method for unmanned surface vessels (USVs) based on an improved pheromone update strategy, including:

[0006] S1. The electronic chart of the target navigation area is converted to grayscale to obtain a grayscale electronic chart; the grayscale electronic chart is then rasterized to obtain a rasterized parameter set, and combined with the grayscale electronic chart to obtain a rasterized environment map package including the rasterized parameter set and the grayscale electronic chart; wherein, the rasterized parameter set includes raster granularity, raster matrix, raster coordinate set of expanded obstacles, passable raster set, starting point raster coordinates, and ending point raster coordinates;

[0007] S2. Based on the grid granularity and the coordinate set of the expanded obstacle grid in the rasterized environment map package, obtain the maximum turning angle of the unmanned surface vessel; based on the grid granularity, the coordinate set of the expanded obstacle grid and the maximum turning angle, set the basic parameters of the ant colony, the potential field parameters, the potential field influence coefficient and the constraints to obtain the initial parameter set; among which, the basic parameters of the ant colony include the ant colony size, the initial concentration of pheromones, the pheromone evaporation factor, the pheromone intensity, the pheromone heuristic factor and the distance heuristic factor, the potential field parameters include the gravitational potential field coefficient, the repulsive potential field coefficient, the obstacle influence distance and the optimization parameters, and the constraints include the minimum obstacle avoidance safe distance and the maximum turning angle;

[0008] S3. Based on the grid coordinate set of the expanded obstacle, the grid coordinates of the starting point and the grid coordinates of the ending point in the gridded environment map package, and combined with the initial parameter set, calculate the dynamic weight of the path quality and the increment of the potential field pheromone, and generate an improved pheromone update rule.

[0009] S4. Based on the set of grid coordinates of the expanded obstacle, the starting grid coordinates, and the ending grid coordinates in the rasterized environment map package, and combined with the potential field parameters in the initial parameter set, construct an improved heuristic function.

[0010] S5. Based on the raster matrix and passable raster set in the rasterized environment map package, and the basic parameters of the ant colony in the initial parameter set, combined with the improved pheromone update rule and improved heuristic function, perform ant colony path search iteration, record the path of each ant and the corresponding path length and the average obstacle avoidance safe distance, and obtain the path set.

[0011] S6. Based on the constraints in the initial parameter set, filter the path set to obtain the filtered paths; smooth the filtered paths to obtain the optimal path.

[0012] In one embodiment, the electronic chart of the target navigation area is converted to grayscale to obtain a grayscale electronic chart; the grayscale electronic chart is then rasterized to obtain a rasterization parameter set, including:

[0013] The electronic nautical chart of the target navigation area is imported by UTM universal transverse projection. The imported electronic nautical chart is then grayscaled to highlight the grayscale difference between obstacles and passable areas in the imported electronic nautical chart, thus obtaining a grayscale electronic nautical chart.

[0014] Obstacle identification is performed on grayscale electronic nautical charts, the pixel coordinates of obstacles are extracted, and the area ratio of each obstacle in the grayscale electronic nautical chart is calculated to obtain the obstacle ratio.

[0015] Set the maximum and minimum grid lengths, and adaptively calculate the grid granularity based on the proportion of obstacles using a preset grid granularity formula;

[0016] According to the grid granularity, the grayscale electronic nautical chart is divided into grids to generate a grid matrix. Grids in the grid matrix that correspond to obstacles are marked as impassable grids, and grids in the grid matrix that do not correspond to obstacles are marked as initially passable grids.

[0017] Based on the preset size of the unmanned vessel and the preset safety distance requirements, the impassable grids in the grid matrix are expanded to increase the grid coverage of the obstacles and generate a set of expanded obstacle grid coordinates.

[0018] Based on the grid matrix and the grid coordinate set of the inflated obstacle, the initial passable grids covered by the inflated obstacle are removed to obtain the passable grid set;

[0019] Based on the navigation mission requirements of the unmanned vessel, the starting grid coordinates and the ending grid coordinates are marked in the passable grid set.

[0020] By integrating grid granularity, grid matrix, expanded obstacle grid coordinate set, passable grid set, starting grid coordinates, and ending grid coordinates, a grid parameter set is obtained.

[0021] In one embodiment, based on the set of puffed obstacle grid coordinates, the starting grid coordinates, and the ending grid coordinates in the rasterized environment map package, combined with the initial parameter set, the path quality dynamic weight and potential field pheromone increment are calculated to generate an improved pheromone update rule, including:

[0022] Based on the minimum obstacle avoidance safe distance in the initial parameter set, set the maximum obstacle avoidance safe distance;

[0023] Based on the set of puffed obstacle grid coordinates in the rasterized environment map package, the shortest distance between the path of a single ant and each puffed obstacle grid is calculated, and the average of the shortest distances is taken as the average obstacle avoidance safe distance of the path of a single ant.

[0024] Based on the average obstacle avoidance safe distance, the minimum obstacle avoidance safe distance, and the maximum obstacle avoidance safe distance, the dynamic weight of path quality is calculated using the dynamic weight calculation formula for path quality.

[0025] Based on the starting and ending grid coordinates in the rasterized environment map package, and the current grid coordinates, the gravitational potential field coefficients in the initial parameter set are used to calculate the gravitational force of the current grid on the ant.

[0026] Based on the set of puffed obstacle grid coordinates in the rasterized environment map package and the current grid coordinates, combined with the repulsive potential field coefficient, obstacle influence distance and optimization parameters in the initial parameter set, the improved repulsive force of the current grid on the ant is calculated.

[0027] The gravitational force and the improved repulsive force are vector synthesized to obtain the potential field force on the ant at the current grid. Based on the potential field force, the starting grid coordinates and the ending grid coordinates, the potential field pheromone increment is calculated using the potential field pheromone increment calculation formula.

[0028] Based on the grid granularity in the rasterized environment map package and the path of a single ant, the number of grids traversed by the path of a single ant and the spacing between adjacent grids are counted to obtain the length of the path of a single ant.

[0029] Based on the pheromone evaporation factor, pheromone intensity, and ant colony size in the initial parameter set, a global pheromone update formula is constructed by combining the dynamic weight of path quality, the potential field pheromone increment, and the path length of a single ant. The improved pheromone update rule is generated by integrating the dynamic weight calculation formula of path quality, the potential field pheromone increment calculation formula, and the global pheromone update formula.

[0030] In one embodiment, an improved heuristic function is constructed based on the set of puffed obstacle grid coordinates, the starting grid coordinates, and the ending grid coordinates in the rasterized environment map package, combined with the potential field parameters in the initial parameter set, including:

[0031] Based on the raster granularity in the rasterized environment map package, calculate the Euclidean distance from the current raster to the next candidate raster, and calculate the distance heuristic factor based on the Euclidean distance;

[0032] Based on the rasterized environment map package, the current raster coordinates and the endpoint raster coordinates are obtained, and the gravitational potential field is calculated by combining the gravitational potential field coefficients in the initial parameter set.

[0033] Calculate the center coordinates of each obstacle based on the expanded obstacle grid coordinate set in the rasterized environment map package;

[0034] Based on the current grid coordinates, the center coordinates of the obstacles, and the repulsive potential field coefficients in the initial parameter set, the obstacle influence distance, and the optimization parameters, the improved repulsive potential field is calculated.

[0035] By combining the gravitational potential field and the improved repulsive potential field, the total potential field is obtained; based on the total potential field, the potential field heuristic factor is calculated using a preset formula for calculating the potential field heuristic factor.

[0036] An improved heuristic function is constructed by fusing distance heuristic factors and potential field heuristic factors.

[0037] In one embodiment, based on the raster matrix and traversable raster set in the rasterized environment map package, and the ant colony's basic parameters in the initial parameter set, combined with the improved pheromone update rule and improved heuristic function, an ant colony path search iteration is performed. The path of each ant and its corresponding path length and average obstacle avoidance safe distance are recorded to obtain a path set, including:

[0038] S51. Based on the ant colony size and initial pheromone concentration in the initial parameter set, place each ant at the starting grid coordinates in the rasterized environment map package, clear the taboo table for each ant, and initialize the pheromone concentration between grids in the h-th iteration to the initial pheromone concentration; where h is a positive integer.

[0039] S52. Set the maximum number of iterations, the threshold for the path length change rate, and the preset number of iterations to continuously meet the conditions;

[0040] S53. Based on the pheromone concentration between each grid in the h-th iteration and the improved heuristic function, combined with the pheromone heuristic factor and distance heuristic factor in the initial parameter set, the state transition probability of the ant from the current grid to the next grid is calculated by the preset state transition formula; the next candidate grid is the grid in the rasterized environment map package that is not included in the taboo table of the accessible grid set.

[0041] S54. Select the next grid cell according to the state transition probability, add the coordinates of the next grid cell to the tabu list, and update the coordinates of the ant's current grid cell.

[0042] S55. Repeat steps S53-S54 until the ant reaches the endpoint grid coordinates in the rasterized environment map package, and record the ant's path.

[0043] S56. Based on the grid granularity in the rasterized environment map package, calculate the number of grids traversed by the ant's path, and combine the grid granularity to obtain the ant's path length.

[0044] S57. Based on the coordinate set of the puffed obstacle grid in the rasterized environment map package, calculate the shortest distance between the ant's path and each puffed obstacle grid, and take the mean of the shortest distance to obtain the mean obstacle avoidance safe distance corresponding to the ant's path.

[0045] S58. According to the improved pheromone update rule, update the pheromone concentration between each adjacent grid on the ant's path to obtain the pheromone concentration between each grid in the (h+1)th iteration.

[0046] S59. Repeat steps S53-S58 until each ant completes a path search from the starting grid coordinates to the ending grid coordinates, then end the current iteration. Obtain and select the optimal path length for the current iteration based on the path length of each ant. If the current iteration is the first iteration, record the optimal path length of the current iteration without calculating the path length change rate. If the current iteration is not the first iteration, calculate the change rate between the optimal path length of the current iteration and the optimal path length of the previous iteration. If the change rate is less than the path length change rate threshold, accumulate the number of iterations that continuously meet the condition. If the change rate is greater than or equal to the path length change rate threshold, reset the accumulated number of iterations that continuously meet the condition.

[0047] S60. Update h to h+1. Repeat steps S53-S59 until the number of iterations reaches the maximum number of iterations, or the cumulative number of iterations that continuously meet the conditions reaches the preset number of iterations that continuously meet the conditions. Stop the iteration and obtain the path of each ant, the corresponding path length, and the average obstacle avoidance safe distance during the iteration process to form a path set.

[0048] In one embodiment, the path set is filtered according to the constraints in the initial parameter set to obtain the filtered paths; the filtered paths are then smoothed to obtain the optimal path, including:

[0049] Extract the average path length and obstacle avoidance safe distance of each path in the path set;

[0050] Based on the coordinate sequence of each path, the heading change angle between adjacent grids is calculated, and the heading change angles are integrated according to the path travel order to obtain the turning angle sequence corresponding to each path.

[0051] Based on the minimum obstacle avoidance safe distance in the initial parameter set, paths with an average obstacle avoidance safe distance greater than or equal to the minimum obstacle avoidance safe distance are selected from the path set to obtain the first candidate path set;

[0052] Based on the maximum steering angle in the initial parameter set, the steering angle sequence of each path in the first candidate path set is traversed, and paths whose steering angles are all less than or equal to the maximum steering angle are selected from the first candidate path set to obtain the second candidate path set.

[0053] Compare the path lengths of each path in the second candidate path set, and select the path with the shortest path length in the second candidate path set as the initial optimal path.

[0054] Extract the inflection point coordinates of the initial optimal path and use these coordinates as the control vertices of the B-spline curve.

[0055] Define the order and node vectors of the B-spline curve, and construct the B-spline curve equation based on the control vertices, order, and node vectors; solve the B-spline curve equation to obtain the smoothed path coordinate sequence.

[0056] Based on the raster matrix and the set of traversable rasters in the rasterized environment map package, it is verified whether all the rasters corresponding to the smoothed path coordinate sequence are traversable rasters. If the verification is successful, the path corresponding to the smoothed path coordinate sequence is taken as the optimal path.

[0057] Secondly, this application also provides an ant colony unmanned surface vessel path planning system based on an improved pheromone update strategy, comprising:

[0058] The environment modeling module is used to perform grayscale processing on the electronic nautical chart of the target navigation area to obtain a grayscale electronic nautical chart; to perform rasterization processing on the grayscale electronic nautical chart to obtain a rasterization parameter set; and to combine the grayscale electronic nautical chart to obtain a rasterization environment map package including the rasterization parameter set and the grayscale electronic nautical chart; wherein, the rasterization parameter set includes raster granularity, raster matrix, raster coordinate set of expanded obstacles, navigable raster set, starting point raster coordinates, and ending point raster coordinates;

[0059] The constraint initialization module is used to obtain the maximum turning angle of the unmanned surface vessel based on the grid granularity and the coordinate set of the expanded obstacle grid in the rasterized environment map package. Based on the grid granularity, the coordinate set of the expanded obstacle grid, and the maximum turning angle, it sets the basic parameters of the ant colony, the potential field parameters, the potential field influence coefficient, and the constraint conditions to obtain the initial parameter set. Among them, the basic parameters of the ant colony include the ant colony size, the initial concentration of pheromones, the pheromone evaporation factor, the pheromone intensity, the pheromone heuristic factor, and the distance heuristic factor; the potential field parameters include the gravitational potential field coefficient, the repulsive potential field coefficient, the obstacle influence distance, and the optimization parameters; and the constraint conditions include the minimum obstacle avoidance safe distance and the maximum turning angle.

[0060] The pheromone rule module is used to calculate the dynamic weight of path quality and the potential field pheromone increment based on the set of puffed obstacle grid coordinates, the starting grid coordinates, and the ending grid coordinates in the rasterized environment map package, combined with the initial parameter set, to generate improved pheromone update rules.

[0061] The heuristic function module is used to construct an improved heuristic function based on the set of puffed obstacle grid coordinates, the starting grid coordinates, and the ending grid coordinates in the rasterized environment map package, combined with the potential field parameters in the initial parameter set.

[0062] The iterative search module is used to perform ant colony path search iteration based on the raster matrix and passable raster set in the rasterized environment map package, the ant colony basic parameters in the initial parameter set, and the improved pheromone update rule and improved heuristic function. It records the path of each ant and the corresponding path length and the average obstacle avoidance safe distance to obtain the path set.

[0063] The path optimization module is used to filter the path set according to the constraints in the initial parameter set to obtain the filtered path; and to smooth the filtered path to obtain the optimal path.

[0064] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the first aspect.

[0065] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the first aspect.

[0066] The aforementioned ant colony unmanned surface vessel (USV) path planning method based on an improved pheromone update strategy first generates a rasterized environmental map package by grayscale and rasterization of electronic nautical charts, laying the environmental foundation for subsequent path planning. Second, an initial parameter set is adapted based on the environmental map package to ensure that the ant colony and potential field parameters closely match the actual navigation scenario, supporting efficient algorithm operation. Subsequently, an improved pheromone update rule is generated by calculating the dynamic weight of path quality and the potential field pheromone increment, addressing the slow convergence speed of traditional algorithms. Simultaneously, an improved heuristic function is constructed by combining potential field parameters, effectively overcoming the problems of local optima and target oscillation. Based on the improved rules and function, ant colony path search iterations are performed to obtain a path set, ensuring path diversity and feasibility. Finally, the optimal path is obtained through constraint filtering and smoothing, meeting the USV's requirements for short paths and high safety, effectively solving the drawback of unreachable targets in traditional potential field ant colony algorithms. Attached Figure Description

[0067] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0068] Figure 1 A flowchart of an ant colony unmanned surface vessel path planning method based on an improved pheromone update strategy is provided as an exemplary embodiment of the present invention.

[0069] Figure 2 A flowchart of a method for obtaining a rasterization parameter set is provided as an exemplary embodiment of the present invention;

[0070] Figure 3 This is a schematic diagram of an ant colony unmanned surface vessel path planning system based on an improved pheromone update strategy, provided as an exemplary embodiment of the present invention. Detailed Implementation

[0071] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0072] In one embodiment, such as Figure 1 As shown, an ant colony unmanned surface vessel (USV) path planning method based on an improved pheromone update strategy is provided. This embodiment illustrates the method by applying it to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0073] S101. The electronic chart of the target navigation area is converted to grayscale to obtain a grayscale electronic chart; the grayscale electronic chart is rasterized to obtain a rasterized parameter set, and combined with the grayscale electronic chart to obtain a rasterized environment map package including the rasterized parameter set and the grayscale electronic chart; wherein, the rasterized parameter set includes raster granularity, raster matrix, raster coordinate set of expanded obstacles, passable raster set, starting point raster coordinates and ending point raster coordinates.

[0074] Specifically, electronic nautical charts, as the core data source for the navigation environment of unmanned vessels, contain rich hydrographic and geographic information such as coastlines, islands, shoals, and obstacles. However, the original charts are continuous images and cannot be directly recognized and processed by ant colony algorithms. Therefore, environmental information can be discretized and structured first through grayscale and rasterization processing. Illustratively, grayscale processing of electronic nautical charts can eliminate the interference of redundant color information on path search and reduce the complexity of subsequent calculations. Then, rasterization processing is performed on this basis, which can discretize the continuous geographic space into a standardized grid structure, generating a rasterized parameter set including raster granularity, raster matrix, expanded obstacle raster coordinate set, navigable raster set, starting point raster coordinates, and ending point raster coordinates. A rasterized environmental map package can be constructed by combining the grayscale electronic nautical chart. An adaptive strategy can be used to dynamically adjust the raster granularity based on the obstacle area ratio. For example, a larger raster is used in areas with dense obstacles to reduce computational load, while a smaller raster is used in open waters to ensure path accuracy. In addition, to address the safety margin requirements caused by environmental factors such as the size of the unmanned vessel, its draft, and wind, waves, and currents, the obstacle grid is expanded. By extending the boundary of the obstacle, a safety buffer zone is formed to ensure that the planned path meets the actual safe navigation distance requirements, thereby solving the problem of the disconnect between the environmental model and the physical characteristics of the vessel in the traditional grid method.

[0075] S102. Based on the grid granularity and the expanded obstacle grid coordinate set in the rasterized environment map package, obtain the maximum turning angle of the unmanned vessel; based on the grid granularity, the expanded obstacle grid coordinate set and the maximum turning angle, set the ant colony basic parameters, potential field parameters, potential field influence coefficient and constraints to obtain the initial parameter set; among which, the ant colony basic parameters include ant colony size, initial pheromone concentration, pheromone evaporation factor, pheromone intensity, pheromone heuristic factor and distance heuristic factor, the potential field parameters include gravitational potential field coefficient, repulsive potential field coefficient, obstacle influence distance and optimization parameters, and the constraints include minimum obstacle avoidance safe distance and maximum turning angle.

[0076] Specifically, the grid granularity determines the smallest moving unit of the unmanned surface vessel (USV) in a discrete environment, while the expanded obstacle grid coordinate set reflects the distribution density and spacing of obstacles. Both together determine the USV's turning requirements in the current environment. Therefore, after completing environmental modeling, the maximum turning angle of the USV can be calculated based on the grid granularity and expanded obstacle grid coordinate set in the rasterized environment map package. This angle is dynamically determined according to the grid size and obstacle distribution density, reflecting the USV's maneuverability limit in a specific grid environment. The ant colony's basic parameters directly affect the search efficiency and convergence speed of the ant colony algorithm. The ant colony size can be set according to the size of the grid matrix; the more grids there are, the larger the ant colony size can be to ensure comprehensive search coverage and avoid missing optimal paths. The initial pheromone concentration can be set to a fixed constant to ensure uniform pheromone concentration across paths in the initial state, avoiding blind searching caused by initial bias. The pheromone evaporation factor ρ ranges from [0,1] and is used to balance pheromone accumulation and evaporation. An excessively large ρ will cause pheromone evaporation to be too rapid, making it difficult to form effective positive feedback; an excessively small ρ will lead to excessive pheromone accumulation and a local optimum. The pheromone intensity Q is a constant used to quantify the relationship between ant path length and pheromone increment; the shorter the path, the greater the pheromone increment. The pheromone heuristic factor α and the distance heuristic factor β are used to adjust the weights of pheromone concentration and distance factors in ant state transitions, respectively. A larger α indicates that ants are more inclined to choose paths with higher pheromone concentrations, while a larger β indicates that ants are more inclined to choose shorter paths.

[0077] Furthermore, the potential field parameters determine the strength of the gravitational and repulsive fields, thus affecting the search direction of the ant colony algorithm. The gravitational potential field coefficient ζ can be used to adjust the magnitude of the gravitational force exerted by the target point on the unmanned vessel (UAV), ensuring sufficient gravity to guide the UAV towards the target point while avoiding excessive gravity that could lead to delayed obstacle avoidance. The repulsive potential field coefficient η can be used to adjust the magnitude of the repulsive force exerted by obstacles on the UAV, ensuring the repulsive force effectively pushes the UAV away from obstacles while avoiding excessive repulsive force that could render the target unreachable. The obstacle influence distance d, typically taken as the system-set CPA threshold, is used to define the range of the repulsive field. For example, when the distance between the UAV and the obstacle is greater than d, the repulsive force is zero to avoid unnecessary interference with path planning. The optimization parameter n can be used to subsequently improve the construction of the repulsive potential field function, ensuring that the repulsive force near the target point is reasonable and solving the target unreachability problem. Constraints can include the minimum obstacle avoidance safety distance and the maximum turning angle to ensure that the planning results meet the kinematic constraints of the UAV. For example, the minimum obstacle avoidance safety distance in the constraints can be set based on the size of the unmanned vessel, its draft, and the influence of wind, waves, and currents, ensuring that the unmanned vessel always maintains a sufficient safety distance from obstacles. Meanwhile, the maximum turning angle, as a constraint for path selection, ensures that the planned path conforms to the actual maneuverability of the unmanned vessel. This parameter initialization process, by coupling environmental characteristics with algorithm parameters, further solves the problems of fixed parameters and lack of environmental adaptability in traditional algorithms.

[0078] S103. Based on the rasterized environment map package, the raster coordinates of the expanded obstacle, the starting point raster coordinates, and the ending point raster coordinates, combined with the initial parameter set, calculate the dynamic weight of path quality and the potential field pheromone increment, and generate an improved pheromone update rule.

[0079] Indicatively, the dynamic weight of path quality can be calculated based on the average path length and obstacle avoidance safety distance, allowing high-quality paths to receive higher pheromone gain weights. The potential field pheromone increment can be calculated by integrating the effects of gravitational and repulsive potential fields, creating a potential field gradient to guide the pheromone distribution from the starting point to the destination, thus addressing the problem of blind searching in the initial stage of traditional ant colony algorithms. Finally, combining the calculation logic of the dynamic weight of path quality and the potential field pheromone increment, an improved pheromone update rule can be generated. This improved rule, by introducing path quality evaluation and potential field guidance into the traditional pheromone volatilization and deposition mechanism, effectively solves the problem of blind searching caused by the uniform pheromone distribution in the early stage of traditional ant colony algorithms, accelerating the convergence speed of the algorithm.

[0080] S104. Based on the set of grid coordinates of the expanded obstacle, the starting grid coordinates, and the ending grid coordinates in the rasterized environment map package, and combined with the potential field parameters in the initial parameter set, construct an improved heuristic function.

[0081] Specifically, the improved heuristic function, based on the traditional distance heuristic factor, can modify the transition probability by introducing a potential field parameter. This allows the ant to consider not only the distance to the target when choosing a path, but also the combined effects of the repulsive force field of the obstacle and the gravitational field of the target. This guides the ant to avoid areas with dense obstacles and move towards the target point, overcoming the defect of traditional algorithms that rely solely on the distance heuristic factor and are prone to getting trapped in local optima.

[0082] S105. Based on the raster matrix and passable raster set in the rasterized environment map package, and the basic parameters of the ant colony in the initial parameter set, combined with the improved pheromone update rule and improved heuristic function, perform ant colony path search iteration, record the path of each ant and the corresponding path length and the average obstacle avoidance safe distance, and obtain the path set.

[0083] Specifically, during the ant colony's pathfinding iteration, ants can select the next grid node based on the state transition probability, which is determined by the pheromone concentration generated by the improved pheromone update rule and the improved heuristic function. By recording the paths constructed by each ant during this process, along with their corresponding path lengths and average obstacle avoidance safe distances, a path set can be formed. This iterative process achieves a balance between global exploration and local development through the synergistic effect of the pheromone positive feedback mechanism and potential field guidance.

[0084] S106. Based on the constraints in the initial parameter set, the path set is filtered to obtain the filtered paths; the filtered paths are then smoothed to obtain the optimal path.

[0085] Specifically, the path set can be filtered based on the constraints in the initial parameter set. For example, infeasible paths that do not meet the minimum obstacle avoidance safety distance and maximum turning angle constraints can be eliminated, resulting in a filtered path. This filtered path can then be smoothed to eliminate redundant turning points and sawtooth fluctuations, generating an optimal path that satisfies the kinematic constraints of the unmanned vessel. This process further ensures that the planned path is not only topologically optimal but also feasible and smooth at the physical execution level, significantly improving the navigation safety and control stability of the unmanned vessel in complex marine environments.

[0086] The aforementioned method first performs grayscale and rasterization processing on the electronic nautical chart and introduces an obstacle inflation mechanism, solving the problem of disconnect between environmental modeling and ship physical characteristics in existing technologies. Secondly, it dynamically obtains the maximum steering angle based on raster features and sets a multi-constraint initial parameter set, effectively addressing the issues of fixed parameters and lack of kinematic constraints in traditional algorithms, enhancing the algorithm's adaptability to complex environments. Furthermore, by introducing an improved pheromone update strategy that incorporates dynamic weights for path quality and incremental pheromone in the potential field, it further improves the convergence speed and mitigates the initial search blindness. Moreover, by utilizing an improved heuristic function that fuses potential field parameters, the path selection mechanism is optimized, overcoming the shortcomings of easily getting trapped in local optima and unreachable targets. Finally, through constraint filtering and smoothing, the optimal path satisfying the ship's kinematic constraints can be obtained. This method significantly improves the convergence efficiency, global optimality, and navigation safety of path planning, providing reliable technical support for intelligent navigation of unmanned vessels in complex marine environments.

[0087] In one embodiment, such as Figure 2 As shown, the electronic nautical chart of the target navigation area is converted to grayscale to obtain a grayscale electronic nautical chart; the grayscale electronic nautical chart is then rasterized to obtain a rasterization parameter set, including:

[0088] S201: Import the electronic chart of the target navigation area through UTM universal transverse projection, perform grayscale processing on the imported electronic chart to highlight the grayscale difference between obstacles and passable areas in the imported electronic chart, and obtain a grayscale electronic chart; perform obstacle identification on the grayscale electronic chart, extract the pixel coordinates of the obstacles, calculate the area ratio of each obstacle in the grayscale electronic chart, and obtain the obstacle ratio.

[0089] S202: Set the maximum and minimum grid lengths, and adaptively calculate the grid granularity based on the proportion of obstacles using a preset grid granularity formula; according to the grid granularity, rasterize the grayscale electronic nautical chart to generate a grid matrix; mark the grids in the grid matrix that correspond to obstacles as impassable grids, and mark the grids in the grid matrix that do not correspond to obstacles as initially passable grids.

[0090] S203: Based on the preset size of the unmanned vessel and the preset safety distance requirements, the impassable grids in the grid matrix are expanded to increase the grid coverage of the obstacles and generate a set of expanded obstacle grid coordinates; based on the grid matrix and the set of expanded obstacle grid coordinates, the initially passable grids covered by the expanded obstacles are removed to obtain a set of passable grids.

[0091] S204: Based on the navigation mission requirements of the unmanned vessel, the starting grid coordinates and the ending grid coordinates are calibrated in the passable grid set; the grid granularity, grid matrix, expanded obstacle grid coordinate set, passable grid set, starting grid coordinates and ending grid coordinates are integrated to obtain the gridded parameter set.

[0092] Specifically, importing electronic nautical charts of the target navigation area using the UTM universal lateral projection method can convert the latitude and longitude coordinates of the Earth's ellipsoid into Cartesian coordinates, effectively reducing the impact of projection distortion on the accuracy of subsequent environmental modeling and ensuring the accurate mapping of the relative positional relationships of hydrological and geographic information in the electronic nautical chart. After importation, image processing tools, such as MATLAB's rgb2gray function, can be used to convert multi-channel color charts into single-channel grayscale images. By setting reasonable grayscale thresholds, such as setting the grayscale value range for obstacles to 0-50 and for passable areas to 200-255, the grayscale difference between obstacles and passable areas can be enhanced, making the two types of areas clearly distinguishable in the grayscale image. This provides a clear image basis for subsequent obstacle identification and rasterization, resulting in a grayscale electronic nautical chart.

[0093] Subsequently, an image segmentation algorithm based on grayscale thresholding can be used to identify obstacles in the grayscale electronic nautical chart. By traversing each pixel of the grayscale electronic nautical chart, pixels whose grayscale values ​​fall within the preset obstacle grayscale threshold range can be identified as obstacle pixels. The planar coordinates (i.e., pixel coordinates) of all obstacle pixels are extracted to form a set of obstacle pixel coordinates. For the extracted obstacle pixel coordinates, a connected component analysis algorithm can be used to determine the boundary range of a single obstacle. For irregularly shaped obstacles, the maximum x-coordinate Xmax, minimum x-coordinate Xmin, maximum y-coordinate Ymax, and minimum y-coordinate Ymin of its boundary pixels can be extracted. A standard rectangle can be constructed with (Xmin, Ymin) and (Xmax, Ymax) as diagonal vertices. The area of ​​this rectangle is calculated as the area estimate Si = (Xmax - Xmin) × (Ymax - Ymin) for the corresponding irregular obstacle. The total area of ​​the obstacles is obtained by summing the area estimates of all individual obstacles. The total area S of the grayscale electronic nautical chart (i.e., the product of the total number of rows and columns of the chart pixels) can be calculated using the formula "obstacle proportion = The " / S" parameter indicates the percentage of obstacles, which directly reflects the density of obstacles in the navigation environment.

[0094] Schematic illustration: A maximum grid length Lmax and a minimum grid length Lmin can be set. Lmax is determined based on the size of the largest obstacle in the electronic chart, ensuring the maximum grid length does not exceed half the size of the smallest obstacle to prevent small obstacles from being overlooked due to an excessively large grid. Lmin is set based on the minimum movement step size of the unmanned surface vessel (USV), ensuring smooth movement between adjacent grids and satisfying kinematic constraints. Based on the obstacle proportions obtained above, the grid granularity L can be adaptively calculated using a preset formula, as follows:

[0095]

[0096] Where k is the raster adjustment coefficient, ranging from 0.8 to 1.2, used to fine-tune the raster granularity according to actual navigation accuracy requirements; Sob is the total area of ​​obstacles; S is the total area of ​​the grayscale electronic chart; Lmax is the preset maximum raster length; and Lmin is the preset minimum raster length. When the proportion of obstacles is high (complex environment), the calculated L approaches Lmax, which can reduce the computational load of path planning and avoid excessive system resource consumption; when the proportion of obstacles is low (open environment), the calculated L approaches Lmin, which can improve the accuracy of path planning and ensure accurate path details. Subsequently, the grayscale electronic chart can be rasterized according to the calculated raster granularity L, and the planar region of the grayscale electronic chart can be discretized into a uniform raster matrix through planar coordinate mapping. For example, the raster network can be generated using MATLAB's meshgrid function, with each raster corresponding to a unique raster index and planar coordinate range. Traverse each grid cell in the grid matrix and determine whether the planar coordinate range of the grid cell intersects with the set of obstacle pixel coordinates. If there is an intersection, mark the grid cell as an impassable grid cell. If there is no intersection, mark the grid cell as an initially passable grid cell. This can transform the continuous navigation environment into a discrete space that can be traversed by the ant colony algorithm, and clarify the boundaries of legal and illegal areas for path search.

[0097] Specifically, the preset dimensions of the unmanned surface vessel (USV) can include its length and width. The preset safety distance requirement can be determined based on the impact of wind, waves, and currents on the USV's trajectory. Combining these two factors yields the total buffer distance for obstacle expansion. Dividing this total buffer distance by the grid granularity L converts it into the corresponding number of grid cells. Using each impassable grid cell as the center, the calculated number of grid cells is expanded outwards (up, down, left, right, and diagonally). All the expanded grid cells together constitute the expanded obstacle region. Recording the coordinates of all grid cells within this region generates the expanded obstacle grid coordinate set. This expansion process compensates for the shortcomings of simplifying the USV to a point mass model, reserving sufficient safe navigation space for the USV and avoiding collision risks caused by neglecting actual navigation factors in environmental modeling.

[0098] In a schematic manner, based on the grid matrix and the coordinate set of the expanded obstacle grid, the initial passable grid is filtered. This involves traversing the coordinates of all initial passable grids and determining whether they belong to the expanded obstacle grid coordinate set. If they do, the initial passable grid is removed; otherwise, it is retained, resulting in the final passable grid set. This passable grid set clearly defines the safe zone boundary for unmanned surface vessel (USV) navigation, ensuring that subsequent path searches are conducted only within legal and safe areas, thus guaranteeing path safety from an environmental modeling perspective. Based on the USV's navigation mission requirements, the latitude and longitude coordinates of the navigation start and end points can be determined. These coordinates can be converted into Cartesian coordinates using the UTM universal lateral projection. Based on the grid granularity L and the range of the grid matrix's planar coordinates, the grid indices corresponding to the start and end point planar coordinates are calculated. Subsequently, the grids corresponding to these indices can be labeled as the start and end point grid coordinates within the passable grid set. Furthermore, during the calibration process, it is essential to ensure that both the starting and ending grid coordinates belong to the passable grid set. If the calibration results do not, the latitude and longitude coordinates of the starting or ending point can be adjusted (within the mission's allowable range), and reprojection and calibration can be performed until the requirements are met. By integrating the grid granularity, grid matrix, expanded obstacle grid coordinate set, passable grid set, starting grid coordinates, and ending grid coordinates obtained from the above steps, a rasterized parameter set can be formed. This rasterized parameter set contains discretized information about the unmanned vessel's navigation environment, providing accurate and structured environmental input for subsequent path planning algorithms, ensuring that the algorithm performs path search based on real environmental features.

[0099] In one embodiment, based on the set of puffed obstacle grid coordinates, the starting grid coordinates, and the ending grid coordinates in the rasterized environment map package, combined with the initial parameter set, the path quality dynamic weight and potential field pheromone increment are calculated to generate an improved pheromone update rule, including:

[0100] Based on the minimum obstacle avoidance safe distance in the initial parameter set, the maximum obstacle avoidance safe distance is set; based on the coordinate set of the puffed obstacle grid in the rasterized environment map package, the shortest distance between the path of a single ant and each puffed obstacle grid is calculated, and the average of the shortest distances is taken as the average obstacle avoidance safe distance of the path of a single ant; based on the average obstacle avoidance safe distance, the minimum obstacle avoidance safe distance, and the maximum obstacle avoidance safe distance, the path quality dynamic weight is calculated using the path quality dynamic weight calculation formula;

[0101] Based on the starting and ending grid coordinates in the rasterized environment map package, and obtaining the current grid coordinates, the gravitational potential field coefficients in the initial parameter set are used to calculate the gravitational force of the current grid on the ant. Based on the set of puffed obstacle grid coordinates in the rasterized environment map package and the current grid coordinates, combined with the repulsive potential field coefficients in the initial parameter set, the obstacle influence distance, and optimization parameters, the improved repulsive force of the current grid on the ant is calculated. The gravitational force and the improved repulsive force are vector-synthesized to obtain the potential field force experienced by the ant at the current grid. Based on the potential field force, the starting and ending grid coordinates, and the potential field pheromone increment calculation formula, the potential field pheromone increment is calculated.

[0102] Based on the grid granularity in the rasterized environment map package and the path of a single ant, the length of a single ant's path is obtained by counting the number of grids traversed by the path and the spacing between adjacent grids. Based on the pheromone evaporation factor, pheromone intensity, and ant colony size in the initial parameter set, a global pheromone update formula is constructed by combining the dynamic weight of path quality, the potential field pheromone increment, and the length of a single ant's path. The improved pheromone update rule is generated by integrating the dynamic weight calculation formula of path quality, the potential field pheromone increment calculation formula, and the global pheromone update formula.

[0103] Specifically, the minimum obstacle avoidance safety distance is a fundamental threshold for ensuring the navigation safety of unmanned surface vessels (USVs). However, using only the minimum obstacle avoidance safety distance as the standard may lead to overly conservative paths and excessively long navigation distances. Therefore, a maximum obstacle avoidance safety distance can be further set to limit the reasonable range of path safety distances, making the calculation of path quality weights more targeted. For example, the maximum obstacle avoidance safety distance can be 1.5-3 times the minimum obstacle avoidance safety distance. The specific value can be determined based on the USV's maneuverability, the obstacle distribution density in the navigation area, and the impact of wind, waves, and currents on the trajectory, ensuring sufficient safety redundancy while avoiding loss of navigation efficiency due to excessively large safety distances. Subsequently, the complete path coordinate sequence of a single ant can be extracted. This sequence consists of the coordinates of all grid centers traversed by the ant during path searching, arranged in the order of movement. For each path point coordinate in this coordinate sequence, the coordinates of all obstacle grid centers in the expanded obstacle grid coordinate set can be traversed. The straight-line distance between the path point and each obstacle grid can be calculated using the Euclidean distance formula, and the minimum value can be taken as the minimum obstacle avoidance distance for that path point. After traversing all waypoints, the arithmetic mean of the minimum obstacle avoidance distances for all waypoints is calculated to obtain the average obstacle avoidance safe distance for a single ant's path. This calculation process, based on global pathpoint obstacle avoidance distance statistics, comprehensively reflects the overall obstacle avoidance safety level of the path, avoiding the neglect of overall path safety hazards due to the local safety compliance of individual waypoints. The core function of the dynamic path quality weight is to assign higher weights to paths with better safety performance during pheromone updates, guiding subsequent ants to prioritize safe paths. This weight can be obtained based on the average obstacle avoidance safe distance, minimum obstacle avoidance safe distance, and maximum obstacle avoidance safe distance using the dynamic path quality weight calculation formula.

[0104] Furthermore, the starting grid coordinates, ending grid coordinates, and current grid coordinates, combined with the gravitational potential field coefficients in the initial parameter set, can be used to calculate the gravitational force exerted by the current grid on the ant. This gravitational force is used to simulate the attraction of the target point to the ant, guiding the ant to move towards the ending grid. Its calculation can be based on the negative gradient of the gravitational potential field, such as... , This represents the gravitational vector of the current grid cell on the ant. The gravitational potential field coefficient in the initial parameter set is used to adjust the gravitational strength. The larger the value, the stronger the gravity. It needs to be set according to the unmanned ship's sailing speed and path search efficiency requirements. The center coordinates of the current grid; The center coordinates of the endpoint grid; This represents the Euclidean distance between the current grid cell and the endpoint grid cell. This is the unit direction vector pointing from the current grid cell to the endpoint grid cell. The core logic of this formula is that the magnitude of the gravity is proportional to the distance from the current grid cell to the endpoint, and the direction always points to the endpoint, ensuring that the ant continues to move in the self-target direction under the influence of gravity.

[0105] Specifically, based on the coordinate set of the inflated obstacle grid and the current grid coordinates, the improved repulsive force of the current grid on the ants can be calculated by combining the repulsive potential field coefficients in the initial parameter set, the obstacle influence distance, and the optimized parameters. This improved repulsive force can be based on the negative gradient of the improved repulsive potential field, and its formula is as follows:

[0106]

[0107] in, This represents the improved repulsion vector of the current grid for the ants; The repulsive potential field coefficient in the initial parameter set is used to adjust the repulsive force intensity. The value needs to balance the obstacle avoidance effect and the path smoothness. The center coordinates of the expanded obstacle grid; This refers to the distance of the obstacle's influence in the initial parameter set, i.e., the critical distance at which the repulsive force acts. These are the optimized parameters from the initial parameter set. When the current grid cell is close to an obstacle, the repulsive force increases as the distance decreases, and this is achieved by introducing... The factor causes the repulsive force of the current grid to decay rapidly as it approaches the endpoint, eventually reaching zero at the endpoint, thus solving the problem of the target being unreachable.

[0108] Specifically, the parallelogram law can be used to vector-synthesize the attraction and the modified repulsion. This involves constructing a parallelogram with the attraction and repulsion vectors as adjacent sides, and the diagonal of this parallelogram represents the potential force vector acting on the ant at the current grid cell. The direction of this potential force reflects the optimal guidance direction for the ant from the current grid cell, ensuring the ant moves towards its destination while preventing collisions with obstacles, thus providing a directional basis for the subsequent calculation of the potential pheromone increment.

[0109] Schematic illustration: Based on the calculated potential field force, starting grid coordinates, and ending grid coordinates, the potential field pheromone increment can be calculated using the potential field pheromone increment calculation formula. The core function of this potential field pheromone increment is to integrate the potential field's guiding effect into pheromone updates, making pheromone distribution target-oriented and reducing the blindness of ant searches. Its calculation formula is as follows: , This represents the increase in potential field pheromones; The potential field influence coefficient in the initial parameter set is used to adjust the contribution of the potential field to the pheromone increment. The force vector is the force vector in the potential field. The vector pointing from the current grid cell to the endpoint grid cell; It is the absolute value of the dot product of the resultant force vector and the target direction vector; Let be the magnitude of the resultant force vector. According to this formula, the smaller the angle between the resultant force direction and the target direction, the closer the dot product ratio is to 1, and the smaller the increment of the potential field pheromone, indicating that the current path direction has conformed to the potential field guidance; conversely, the larger the increment, the more it guides the ant to adjust its path direction to move closer to the target direction.

[0110] Specifically, based on the grid granularity in the rasterized environment map package and the path of a single ant, the number of grids traversed by the ant's path and the spacing between adjacent grids can be counted to calculate the length of the ant's path. If the ant's path is a straight line through adjacent grids (without diagonal crossings), the path length is obtained by multiplying the number of grids traversed by the grid granularity. If the ant's path crosses grids diagonally, the distance between the centers of every two adjacent path grids needs to be calculated using Euclidean distance, and then the path length is obtained by summing all the distances between adjacent grids. This ensures the accuracy of the path length calculation and provides precise data support for the logic in pheromone updates that "the shorter the path length, the greater the pheromone increment."

[0111] Finally, based on the pheromone evaporation factor, pheromone intensity, and ant colony size in the initial parameter set, combined with the dynamic weight of path quality, the potential field pheromone increment, and the path length of a single ant, a global pheromone update formula can be constructed. This solves the problems of slow convergence and insufficient safety performance caused by traditional ant colony algorithms relying solely on path length. For example, this global pheromone update formula can be:

[0112]

[0113] in, For the first In the next iteration, the grid To grid pheromone concentration; The pheromone volatilization factor in the initial parameter set has a value range of [0,1] and is used to simulate the natural volatilization of pheromones to avoid local optima caused by excessive accumulation of pheromones. For the first In the next iteration, the grid To grid pheromone concentration; The size of the ant colony is defined in the initial parameter set. Dynamic weights for path quality; Let be the pheromone intensity in the initial parameter set, and be a constant used to quantify the overall intensity of the pheromone increment; This represents the path length of a single ant. This represents the increase in potential field pheromones.

[0114] An improved pheromone update rule is generated by integrating the dynamic weight calculation formula for path quality, the pheromone increment calculation formula for potential field, and the global pheromone update formula. This rule clarifies the complete logic of pheromone update: pheromone first decays through evaporation factors, then the pheromone increments of all ants are superimposed. The pheromone increment is composed of a "basic increment dominated by path length" and an "optimization increment dominated by potential field guidance," weighted according to path quality. The core advantage of this improved pheromone update rule is that it retains the positive feedback mechanism of "accumulating more pheromones on shorter paths" in traditional ant colony algorithms, while strengthening the priority of safe paths through path quality weights. It guides ants to search towards the target direction and safe areas through potential field pheromone increments, thereby achieving synergistic optimization of algorithm convergence speed and path safety performance.

[0115] In one embodiment, an improved heuristic function is constructed based on the set of puffed obstacle grid coordinates, the starting grid coordinates, and the ending grid coordinates in the rasterized environment map package, combined with the potential field parameters in the initial parameter set, including:

[0116] Based on the grid granularity in the rasterized environment map package, calculate the Euclidean distance from the current grid to the next candidate grid, and calculate the distance heuristic factor based on the Euclidean distance; based on the rasterized environment map package, obtain the coordinates of the current grid and the coordinates of the endpoint grid, and calculate the gravitational potential field by combining the gravitational potential field coefficients in the initial parameter set.

[0117] Based on the raster coordinate set of expanded obstacle in the rasterized environment map package, calculate the center coordinates of each obstacle; based on the current raster coordinates, the center coordinates of the obstacle, and the repulsive potential field coefficients, obstacle influence distance, and optimization parameters in the initial parameter set, calculate the improved repulsive potential field.

[0118] By combining the gravitational potential field and the improved repulsive potential field, the total potential field is obtained; based on the total potential field, the potential field heuristic factor is calculated using a preset formula; and the distance heuristic factor and the potential field heuristic factor are fused to construct an improved heuristic function.

[0119] Specifically, both the current grid and the next candidate grid are valid grids in the grid matrix. The next candidate grid must belong to the set of walkable grids and not be recorded in the ant's tabu list. Based on grid granularity, the Euclidean distance from the current grid to the next candidate grid can be calculated using the grid center coordinates as a reference, such as... , For the current grid To the next candidate grid Euclidean distance, , For the current grid The center x-coordinate and y-coordinate, , For the next candidate grid The x and y coordinates of the center of a raster are determined by the raster granularity and the raster's index in the matrix; that is, the x-coordinate of the center of a raster equals the number of raster index columns. Raster granularity + raster granularity / 2, center ordinate = number of raster index rows Raster granularity + raster granularity / 2. Based on the calculated Euclidean distance, calculate the distance heuristic factor, such as... , for The distance heuristic factor at any given moment. According to this formula, the shorter the Euclidean distance, the larger the distance heuristic factor, and the higher the probability that the ant will choose that path. This guides the ant to prioritize shorter paths, ensuring the path's economic efficiency.

[0120] Subsequently, based on the current grid coordinates and the endpoint grid coordinates, the gravitational potential field can be calculated by combining the gravitational potential field coefficients from the initial parameter set. The core function of the gravitational potential field is to simulate the attraction of the target point to the ant, guiding the ant to move towards the endpoint. Its formula is as follows: , For the current grid The gravitational potential field; The gravitational potential field coefficient in the initial parameter set is used to adjust the gravitational strength. The value needs to be dynamically set according to the unmanned ship's sailing speed and path search efficiency. The larger the value, the stronger the gravity, which prevents the ants from deviating from the target direction. The center coordinates of the current grid ( ); The center coordinates of the endpoint grid ( ); This represents the Euclidean distance from the current grid cell to the endpoint grid cell, calculated in the same way as the Euclidean distance between grid cells. This formula shows that the gravitational potential field is proportional to the square of the distance from the current grid cell to the endpoint. The closer the distance, the smaller the gravitational potential field, resulting in a gentler gravitational guidance for the ant and preventing delays in obstacle avoidance due to excessively strong gravity.

[0121] Specifically, for a single obstacle's corresponding puffed obstacle grid coordinate set, the center coordinates of all grids can be traversed, and the maximum and minimum values ​​of the horizontal and vertical coordinates can be extracted. The obstacle's center coordinates are then calculated using an arithmetic mean. The obstacle center coordinates calculated in this way accurately represent the geometric center position of the puffed obstacle, providing a precise obstacle position reference for subsequent calculations of the repulsive potential field. Based on the current grid coordinates and the obstacle's center coordinates, an improved repulsive potential field can be calculated by combining the repulsive potential field coefficient, the obstacle's influence distance, and optimization parameters. The core innovation of the improved repulsive potential field is the introduction of optimization parameters to solve the problem of target unreachability caused by excessive repulsive force near the target point in traditional repulsive potential fields. The formula is as follows:

[0122]

[0123] in, For the current grid Improved repulsive potential field; The repulsive potential field coefficient in the initial parameter set is used to adjust the repulsive force intensity. The value needs to balance the obstacle avoidance effect and the path smoothness to avoid collisions caused by too small a repulsive force or path deviations caused by too large a repulsive force. The center coordinates of the current grid; The coordinates of the obstacle's center; This is the Euclidean distance from the current grid cell to the center of the obstacle. This is the distance at which obstacles affect the grid in the initial parameter set, i.e., the critical distance at which the repulsive force acts. When the distance from the current grid to the obstacle exceeds this value, the repulsive force can be ignored. The center coordinates of the endpoint grid; These are optimization parameters in the initial parameter set, ranging from 1 to 3. They are used to adjust the rate of repulsive force decay near the target point. Larger values ​​result in faster repulsive force decay near the target, which is more conducive to the ant reaching the target. Combining the gravitational potential field and the improved repulsive potential field, the total potential field can be obtained through vector superposition. Overall momentum This comprehensively reflects the current attraction and repulsion effect of the grid on ants. Based on the total potential field. Then, the potential field heuristic factor can be calculated using a preset formula, which can be expressed as follows: , for Potential field heuristic factor at any given moment; Let this be the total potential field. Based on this formula, the total potential field is... The smaller the value, the better the environmental adaptability of the current grid, which indicates that the grid is both close to the target point and far from obstacles. The larger the corresponding potential field heuristic factor, the more likely it is to guide the ants to prioritize selecting this grid as the next moving node.

[0124] Finally, the distance heuristic factor and the potential field heuristic factor can be multiplied to construct an improved heuristic function. The core advantage of this improved heuristic function is that it retains the preference of the traditional heuristic function for short-distance paths, while introducing obstacle avoidance and goal orientation constraints through the potential field heuristic factor. This prevents ants from getting trapped in locally optimal regions surrounded by obstacles due to excessive pursuit of short distances, or from exhibiting path swaying near obstacles, thereby improving the rationality and safety of path planning.

[0125] In one embodiment, based on the raster matrix and traversable raster set in the rasterized environment map package, and the ant colony's basic parameters in the initial parameter set, combined with improved pheromone update rules and improved heuristic functions, an ant colony path search iteration is performed. The path of each ant and its corresponding path length and average obstacle avoidance safe distance are recorded to obtain a path set, including:

[0126] S501. Based on the ant colony size and initial pheromone concentration in the initial parameter set, place each ant at the starting grid coordinates in the rasterized environment map package, clear the taboo table for each ant, and initialize the pheromone concentration between grids in the h-th iteration to the initial pheromone concentration; where h is a positive integer.

[0127] Specifically, the taboo list for each ant can be an array structure to record the coordinates of the grid cells visited by the ant, preventing the ant from repeatedly visiting the same grid cell, which could lead to path loops or getting stuck in a local area. Initializing the pheromone concentration between grid cells in the h-th iteration to the initial pheromone concentration ensures that the pheromone update in each iteration is based on the concentration state of the previous iteration, forming a continuous positive feedback mechanism. The initial value of h can be 1.

[0128] S502. Set the maximum number of iterations, the threshold for the path length change rate, and the preset number of iterations to continuously meet the conditions.

[0129] Specifically, the maximum number of iterations limits the total running time of the algorithm, preventing excessive system resource consumption due to infinite iterations. Its value can be adjusted based on the complexity of the grid matrix and the size of the ant colony; the more complex the grid and the larger the ant colony, the greater the maximum number of iterations should be. The path length change rate threshold is used to determine whether the algorithm has converged. Its value can range from 0.5% to 2%. When the optimal path length change rate is less than this threshold after multiple consecutive iterations, it indicates that the algorithm is close to the optimal solution and no further iterations are needed. The preset number of iterations that continuously meet the conditions is used to avoid non-optimal paths caused by accidental convergence. This ensures that the algorithm stops iterating only after stable convergence, improving the reliability of path planning.

[0130] S503. Based on the pheromone concentration and improved heuristic function between each grid in the h-th iteration, and combined with the pheromone heuristic factor and distance heuristic factor in the initial parameter set, calculate the state transition probability of the ant from the current grid to the next grid using a preset state transition formula; the next candidate grid is the grid in the rasterized environment map package that is not included in the taboo table from the set of passable grids.

[0131] Specifically, the core function of state transition probability is to guide ants to balance global exploration and local development. The preset state transition formula can be as follows:

[0132]

[0133] in, Let t be the state transition probability of ant k from the current grid i to the next candidate grid j; The pheromone concentrations from grid i to grid j in the h-th iteration; This is a pheromone heuristic factor in the initial parameter set, used to adjust the weighting of the influence of pheromone concentration on the transition probability. The larger the ant, the more it tends to choose paths with higher pheromone concentrations, thus enhancing its local development capabilities. To improve the output value of the heuristic function, the distance heuristic factor and the potential field heuristic factor are combined to guide the ants to move towards shorter distances, safer areas, and the target direction; This is a distance heuristic factor in the initial parameter set, used to adjust the weighting of the improved heuristic function on the transition probability. The larger the size, the more ants tend to choose the path with the shortest distance and the best potential field, thus improving search efficiency; The valid set of the next candidate grid is obtained by taking the difference between the set of accessible grids in the rasterized environment map package and the tabu list of ant k, ensuring that the next candidate grid is both safe and has not been visited by ants; The pheromone concentration of grid i to grid s within the legal set in the h-th iteration; The improved heuristic function value is given for the current grid i to the grid s in the legal set.

[0134] S504. Select the next grid cell according to the state transition probability, add the coordinates of the next grid cell to the tabu list, and update the coordinates of the ant's current grid cell.

[0135] Specifically, a roulette wheel selection method can be used to select the next grid cell based on the state transition probability. This involves mapping the transition probability of each candidate grid cell to the proportion of sectors in a roulette wheel, randomly generating a random number between 0 and 1, and the grid cell corresponding to that sector is the selected next grid cell. This ensures that high-probability paths are prioritized while retaining opportunities to explore low-probability paths, preventing the algorithm from getting trapped in local optima prematurely. The coordinates of the selected next grid cell can then be appended to the ant's tabu list, updating the tabu list array length to ensure that the grid cell is not visited repeatedly in subsequent searches. Furthermore, the ant's current grid coordinates can be updated to the coordinates of the next grid cell, providing a current position reference for the next state transition probability calculation.

[0136] S505. Repeat steps S503-S504 until the ant reaches the endpoint grid coordinates in the rasterized environment map package, and record the ant's path.

[0137] Specifically, repeat steps S503-S504. When the ant's current grid coordinates are exactly the same as the destination grid coordinates, stop the ant's path search. Extract all grid coordinates recorded in the taboo table according to the path progression order to form the ant's complete path sequence. If the ant encounters a valid set during the search process... If the next grid cell is empty (no next grid cell available), it means that the ant is stuck in a dead end. In this case, you can clear the taboo table of the ant, put it back at the starting grid cell coordinates, and re-execute the path search to ensure that each ant can generate a valid path.

[0138] S506. Based on the grid granularity in the rasterized environment map package, calculate the number of grids traversed by the ant's path, and combine the grid granularity to obtain the ant's path length.

[0139] Specifically, the number of grid cells traversed by the path is the number of coordinates in the ant's complete path sequence. If adjacent grid cells in the path are horizontally or vertically adjacent (without diagonal crossings), the path length is calculated using the following formula: , Let k be the path length of ant k. This represents the number of grid cells the path passes through. This refers to the raster granularity within the rasterized environment map package. If the path crosses diagonally between adjacent graticles, the Euclidean distance between the centers of each pair of adjacent graticles needs to be calculated. Summing the Euclidean distances of all adjacent graticles yields the path length, ensuring the accuracy of the length calculation.

[0140] S507. Based on the coordinate set of the puffed obstacle grid in the rasterized environment map package, calculate the shortest distance between the ant's path and each puffed obstacle grid, and take the average of the shortest distances to obtain the average obstacle avoidance safe distance corresponding to the ant's path.

[0141] By traversing the coordinates of each grid cell in the ant's complete path sequence, the Euclidean distance between each path grid cell and the center of all obstacle grid cells in the set of inflated obstacle grid cells can be calculated. The minimum distance among these distances is taken as the minimum obstacle avoidance distance for that path grid cell. After traversing all path grid cells, the arithmetic mean of the minimum obstacle avoidance distances of all path grid cells can be calculated to obtain the average obstacle avoidance safe distance corresponding to the ant's path. This average value comprehensively reflects the overall obstacle avoidance safety level of the path.

[0142] S508. According to the improved pheromone update rule, update the pheromone concentration between each adjacent grid cell on the ant's path to obtain the pheromone concentration between each grid cell in the (h+1)th iteration.

[0143] Specifically, the improved pheromone update rule integrates the dynamic weight of path quality, the increment of potential field pheromone, and the path length. Its formula can be:

[0144]

[0145] in, The pheromone concentrations from grid i to grid j in the (h+1)th iteration; is the pheromone volatilization factor in the initial parameter set, with a value range of [0,1], used to simulate the natural volatilization of pheromones and avoid excessive accumulation of pheromones that could cause the algorithm to fall into a local optimum. The pheromone concentrations from grid i to grid j in the h-th iteration; The path quality dynamic weight is calculated from the average obstacle avoidance safety distance of the path; the better the safety performance, the greater the weight. Let be the pheromone intensity in the initial parameter set, and be a constant used to quantify the overall intensity of the pheromone increment; Let k be the path length of ant k. The potential field pheromone increment is calculated from the potential field force and guides the pheromone to concentrate in the target direction and safe area.

[0146] S509. Repeat steps S503-S508 until each ant completes a path search from the starting grid coordinates to the ending grid coordinates, then end the current iteration. Obtain and select the optimal path length for the current iteration based on the path length of each ant. If the current iteration is the first iteration, record the optimal path length of the current iteration without calculating the path length change rate. If the current iteration is not the first iteration, calculate the change rate between the optimal path length of the current iteration and the optimal path length of the previous iteration. If the change rate is less than the path length change rate threshold, accumulate the number of iterations that continuously meet the condition. If the change rate is greater than or equal to the path length change rate threshold, reset the accumulated number of iterations that continuously meet the condition.

[0147] Specifically, repeat steps S503-S508 until each ant has completed a path search from the starting grid coordinates to the ending grid coordinates. The current iteration can then end. Based on the path lengths of all ants in the iteration, the minimum value can be obtained through traversal comparison; this minimum value is the optimal path length for the current iteration. Furthermore, if the current iteration is the first iteration (h=1), the optimal path length is directly recorded without calculating the path length change rate to avoid calculation errors due to a lack of historical data. If the current iteration is not the first iteration, the change rate between the optimal path length of the current iteration and the optimal path length of the previous iteration can be calculated. If this change rate is greater than or equal to the path length change rate threshold, the cumulative number of iterations that continuously meet the condition can be reset to 0, ensuring that the algorithm only stops when it reaches stable convergence, avoiding non-optimal paths caused by accidental fluctuations.

[0148] S600. Update h to h+1. Repeat steps S53-S59 until the number of iterations reaches the maximum number of iterations, or the cumulative number of iterations that continuously meet the conditions reaches the preset number of iterations that continuously meet the conditions. Stop the iteration and obtain the path of each ant, the corresponding path length, and the average obstacle avoidance safe distance during the iteration process to form a path set.

[0149] Specifically, after the current iteration ends, h can be updated to h+1, and steps S53-S59 are repeated. The algorithm stops when any of the above conditions are met, thus ensuring both the algorithm completes within the specified time and the optimality of the path planning. After stopping the iteration, the complete path sequences of all ants during the iteration process, their corresponding path lengths, and the average obstacle avoidance safe distances are collected and stored according to ant number and iteration number, forming a path set. This path set covers all feasible paths and key performance parameters during the algorithm's search process, providing comprehensive data support for subsequent optimal path selection.

[0150] In one embodiment, the path set is filtered according to the constraints in the initial parameter set to obtain the filtered paths; the filtered paths are then smoothed to obtain the optimal path, including:

[0151] Extract the path length and average obstacle avoidance safe distance of each path in the path set; calculate the heading change angle between adjacent grids based on the coordinate sequence of each path, integrate the heading change angles according to the path travel order, and obtain the turning angle sequence corresponding to each path; based on the minimum obstacle avoidance safe distance in the initial parameter set, select paths from the path set whose average obstacle avoidance safe distance is greater than or equal to the minimum obstacle avoidance safe distance, and obtain the first candidate path set;

[0152] Based on the maximum turning angle in the initial parameter set, the turning angle sequence of each path in the first candidate path set is traversed. Paths with turning angles less than or equal to the maximum turning angle are selected from the first candidate path set to obtain the second candidate path set. The path lengths of each path in the second candidate path set are compared, and the path with the shortest path length in the second candidate path set is selected as the initial optimal path. The inflection point coordinates of the initial optimal path are extracted and used as the control vertices of the B-spline curve.

[0153] Define the order and node vectors of the B-spline curve, and construct the B-spline curve equation based on the control vertices, order, and node vectors; solve the B-spline curve equation to obtain the smoothed path coordinate sequence; based on the raster matrix and traversable raster set in the rasterized environment map package, verify whether all rasters corresponding to the smoothed path coordinate sequence are traversable rasters. If the verification is successful, the path corresponding to the smoothed path coordinate sequence is taken as the optimal path.

[0154] Specifically, the path set is stored in order of path number, with each path number corresponding to a unique path coordinate sequence, path length, and average obstacle avoidance safe distance. By traversing the index of the path set, the path length parameter and average obstacle avoidance safe distance parameter corresponding to each path can be read sequentially by index, and these two parameters are associated with the path number for storage, forming a mapping table of path number - path length - average obstacle avoidance safe distance. Furthermore, the path coordinate sequence is a set of grid center coordinates arranged in the order of movement. We can define the coordinate sequence of a certain path as... First calculate the coordinates of two adjacent points. and The heading angle between The heading angle is the angle between the line segment and true north (the positive y-axis direction in the coordinate system). Then, the difference between adjacent heading angles is calculated. If the absolute value of the difference is greater than Then by addition and subtraction Adjust to Within the range, the heading change angle between adjacent grid cells is obtained. Following the path travel order (from...) arrive By integrating all heading change angles, a sequence of turning angles corresponding to that path can be formed. This sequence fully reflects the degree of drastic change in the path.

[0155] The mapping table can then be iterated through, comparing the average obstacle avoidance safe distance of each path with the minimum obstacle avoidance safe distance. If the former is greater than or equal to the latter, all relevant information for that path (path number, coordinate sequence, path length, and turning angle sequence) is retained; otherwise, the path is discarded. After filtering, the retained path information is reorganized to form the first candidate path set. This process initially filters out paths that meet basic navigation requirements from a safety perspective, eliminating paths with collision risks. Furthermore, the maximum turning angle can be determined by the unmanned vessel's servo performance, hull structure, and navigation stability requirements, reflecting the unmanned vessel's maximum controllable turning capability. By iterating through the first candidate path set by path number, for each path's turning angle sequence, the absolute value of each heading change angle is checked to see if it is less than or equal to the maximum turning angle. If all turning angles meet this condition, the path is retained; otherwise, it is discarded. This further filters from the unmanned vessel's kinematic constraints perspective, ensuring that the retained paths can be actually controlled and executed by the unmanned vessel, avoiding paths that cannot be implemented due to exceeding turning angle limits. Furthermore, since path length is directly related to the unmanned vessel's travel time and energy consumption, the path lengths of all paths in the second candidate path set can be extracted. By iterating and comparing, the minimum value can be obtained, and the corresponding path is the initial optimal path. If multiple paths have the same length and are all the shortest, the average obstacle avoidance safe distance of these paths can be compared, and the path with the larger average distance can be selected as the initial optimal path to ensure both economy and safety.

[0156] Specifically, an inflection point is a critical point in the path where the heading changes significantly. If the absolute value of a heading change angle in the turning angle sequence is greater than a preset inflection point threshold (this threshold is set based on the path smoothing accuracy requirements), then the next coordinate point corresponding to that heading change angle is the inflection point. Illustratively, the inflection point coordinates of the initial optimal path can be extracted as the control vertices of the B-spline curve. By setting the third-order curve order and uniform node vectors, the core curve equation can be constructed as follows: , Let the coordinates of the point on the curve be... To control the vertices, For k-th order B-spline basis functions, The parameter is denoted as . Solving this equation yields the smoothed path coordinate sequence. Finally, traversing this sequence, the corresponding raster index is calculated based on the raster granularity to verify if all are passable rasteres. If all rasteres corresponding to coordinate points are passable, the verification passes, and the path corresponding to the smoothed path coordinate sequence is taken as the optimal path. If any raster corresponding to any coordinate point is impassable, the process returns to the "select initial optimal path" step, and the second shortest path is selected as the new initial optimal path. This process of inflection point extraction, smoothing, and verification is repeated until a verified optimal path is obtained, ensuring that the final planned path satisfies both smoothness requirements and practical navigation feasibility.

[0157] Based on the same inventive concept, this application also provides a path planning system for ant colonies based on an improved pheromone update strategy for implementing the aforementioned path planning method for ant colonies based on an improved pheromone update strategy. The solution provided by this system is similar to the implementation described in the above method. Therefore, the specific limitations of one or more embodiments of the path planning system for ant colonies based on an improved pheromone update strategy provided below can be found in the limitations of the path planning method for ant colonies based on an improved pheromone update strategy described above, and will not be repeated here.

[0158] In one exemplary embodiment, such as Figure 3 As shown, an ant colony unmanned surface vessel path planning system 700 based on an improved pheromone update strategy is provided, including:

[0159] The environment modeling module 701 is used to perform grayscale processing on the electronic nautical chart of the target navigation area to obtain a grayscale electronic nautical chart; to perform rasterization processing on the grayscale electronic nautical chart to obtain a rasterization parameter set; and to combine the grayscale electronic nautical chart to obtain a rasterization environment map package including the rasterization parameter set and the grayscale electronic nautical chart; wherein, the rasterization parameter set includes raster granularity, raster matrix, raster coordinate set of expanded obstacles, passable raster set, starting point raster coordinates, and ending point raster coordinates;

[0160] The constraint initialization module 702 is used to obtain the maximum turning angle of the unmanned surface vessel based on the grid granularity and the grid coordinate set of the expanded obstacle in the rasterized environment map package; based on the grid granularity, the grid coordinate set of the expanded obstacle, and the maximum turning angle, it sets the basic parameters of the ant colony, the potential field parameters, the potential field influence coefficient, and the constraint conditions to obtain the initial parameter set; among which, the basic parameters of the ant colony include the ant colony size, the initial concentration of pheromones, the pheromone evaporation factor, the pheromone intensity, the pheromone heuristic factor, and the distance heuristic factor; the potential field parameters include the gravitational potential field coefficient, the repulsive potential field coefficient, the obstacle influence distance, and the optimization parameters; and the constraint conditions include the minimum obstacle avoidance safety distance and the maximum turning angle.

[0161] The pheromone rule module 703 is used to calculate the dynamic weight of path quality and the potential field pheromone increment based on the set of puffed obstacle grid coordinates, the starting grid coordinates and the ending grid coordinates in the rasterized environment map package, combined with the initial parameter set, to generate improved pheromone update rules.

[0162] Heuristic function module 704 is used to construct an improved heuristic function based on the set of puffed obstacle grid coordinates, the starting grid coordinates, and the ending grid coordinates in the rasterized environment map package, combined with the potential field parameters in the initial parameter set.

[0163] The iterative search module 705 is used to perform ant colony path search iteration based on the raster matrix and passable raster set in the rasterized environment map package and the basic parameters of the ant colony in the initial parameter set, combined with the improved pheromone update rule and the improved heuristic function, and to record the path of each ant and the corresponding path length and the average obstacle avoidance safe distance to obtain the path set.

[0164] The path optimization module 706 is used to filter the path set according to the constraints in the initial parameter set to obtain the filtered path; and to smooth the filtered path to obtain the optimal path.

[0165] In one exemplary embodiment, the present invention also provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the ant colony unmanned surface vessel path planning method based on an improved pheromone update strategy proposed in this application. A multi-core processor is preferred to improve the system's parallel processing capability. The memory provides sufficient temporary storage space to support program execution and data processing. The memory capacity should be large enough to accommodate large amounts of data and computational tasks.

[0166] In one exemplary embodiment, the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the ant colony unmanned surface vessel path planning method based on an improved pheromone update strategy of this application. The computer-readable storage medium may include: a read-only memory, a random access memory, a solid-state drive, or an optical disk, etc.

[0167] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.

Claims

1. A path planning method for unmanned surface vessels (USVs) based on an improved pheromone update strategy, characterized in that, The method includes: S1. The electronic chart of the target navigation area is converted to grayscale to obtain a grayscale electronic chart; the grayscale electronic chart is rasterized to obtain a rasterization parameter set, and combined with the grayscale electronic chart to obtain a rasterized environment map package including the rasterization parameter set and the grayscale electronic chart; wherein, the rasterization parameter set includes raster granularity, raster matrix, set of expanded obstacle raster coordinates, set of passable raster, starting point raster coordinates, and ending point raster coordinates; S2. Based on the grid granularity and the set of grid coordinates of the expanded obstacle in the gridded environment map package, obtain the maximum turning angle of the unmanned surface vessel; based on the grid granularity, the set of grid coordinates of the expanded obstacle, and the maximum turning angle, set the basic parameters of the ant colony, the potential field parameters, the potential field influence coefficient, and the constraints to obtain the initial parameter set; wherein, the basic parameters of the ant colony include the ant colony size, the initial concentration of pheromones, the pheromone evaporation factor, the pheromone intensity, the pheromone heuristic factor, and the distance heuristic factor; the potential field parameters include the gravitational potential field coefficient, the repulsive potential field coefficient, the obstacle influence distance, and the optimization parameters; the constraints include the minimum obstacle avoidance safety distance and the maximum turning angle; S3. Based on the set of grid coordinates of the expanded obstacle, the starting grid coordinates, and the ending grid coordinates in the gridded environment map package, and combined with the initial parameter set, calculate the dynamic weight of the path quality and the potential field pheromone increment, and generate an improved pheromone update rule. S4. Based on the set of grid coordinates of the expanded obstacle, the starting grid coordinates, and the ending grid coordinates in the gridded environment map package, and combined with the potential field parameters in the initial parameter set, construct an improved heuristic function; S5. Based on the raster matrix and passable raster set in the rasterized environment map package, the ant colony basic parameters in the initial parameter set, and combined with the improved pheromone update rule and the improved heuristic function, perform ant colony path search iteration, record the path of each ant and the corresponding path length and the average obstacle avoidance safe distance, and obtain the path set. S6. Based on the constraints in the initial parameter set, the path set is filtered to obtain the filtered paths; the filtered paths are smoothed to obtain the optimal path.

2. The method according to claim 1, characterized in that, The electronic nautical chart of the target navigation area is processed into grayscale to obtain a grayscale electronic nautical chart; The grayscale electronic nautical chart is rasterized to obtain a rasterization parameter set, including: The electronic nautical chart of the target navigation area is imported by UTM universal transverse projection. The imported electronic nautical chart is then grayscaled to highlight the grayscale difference between obstacles and passable areas in the imported electronic nautical chart, thus obtaining a grayscale electronic nautical chart. Obstacle identification is performed on the grayscale electronic nautical chart, the pixel coordinates of the obstacles are extracted, and the area ratio of each obstacle in the grayscale electronic nautical chart is calculated to obtain the obstacle ratio; Set the maximum and minimum grid lengths, and adaptively calculate the grid granularity based on the obstacle ratio using a preset grid granularity formula; The grayscale electronic nautical chart is rasterized according to the raster granularity to generate the raster matrix. The raster corresponding to the obstacle in the raster matrix is ​​marked as an impassable raster, and the raster that does not correspond to the obstacle in the raster matrix is ​​marked as an initially passable raster. Based on the preset size of the unmanned vessel and the preset safety distance requirements, the impassable grid cells in the grid matrix are expanded to increase the grid coverage of the obstacles and generate the coordinate set of the expanded obstacle grid cells. Based on the grid matrix and the grid coordinate set of the inflated obstacle, the initial passable grids covered by the inflated obstacle are removed to obtain the passable grid set; According to the navigation mission requirements of the unmanned vessel, the coordinates of the starting grid and the coordinates of the ending grid are marked in the passable grid set; The rasterization parameter set is obtained by integrating the raster granularity, the raster matrix, the set of expanded obstacle raster coordinates, the set of passable raster coordinates, the starting point raster coordinates, and the ending point raster coordinates.

3. The method according to claim 1, characterized in that, Based on the rasterized environment map package's set of expanded obstacle raster coordinates, starting point raster coordinates, and ending point raster coordinates, combined with the initial parameter set, the path quality dynamic weight and potential field pheromone increment are calculated to generate improved pheromone update rules, including: Based on the minimum obstacle avoidance safe distance in the initial parameter set, the maximum obstacle avoidance safe distance is set; Based on the set of puffed obstacle grid coordinates in the rasterized environment map package, the shortest distance between the path of a single ant and each puffed obstacle grid is calculated, and the average of the shortest distances is taken as the average obstacle avoidance safe distance of the path of a single ant. Based on the average obstacle avoidance safe distance, the minimum obstacle avoidance safe distance, and the maximum obstacle avoidance safe distance, the path quality dynamic weight is calculated using the path quality dynamic weight calculation formula. Based on the starting grid coordinates and ending grid coordinates in the rasterized environment map package, and obtaining the current grid coordinates, the gravitational potential field coefficients in the initial parameter set are used to calculate the gravitational force of the current grid on the ant. Based on the set of puffed obstacle grid coordinates in the rasterized environment map package and the current grid coordinates, combined with the repulsive potential field coefficient, obstacle influence distance and optimization parameters in the initial parameter set, the improved repulsive force of the current grid on the ant is calculated; The attraction and the improved repulsion are vectorized to obtain the potential field force on the ant at the current grid; based on the potential field force, the starting grid coordinates and the ending grid coordinates, the potential field pheromone increment is calculated using the potential field pheromone increment calculation formula. Based on the grid granularity in the rasterized environment map package and the path of a single ant, the number of grids traversed by the path of a single ant and the spacing between adjacent grids are counted to obtain the length of the path of a single ant. Based on the pheromone evaporation factor, pheromone intensity, and ant colony size in the initial parameter set, and combined with the path quality dynamic weight, the potential field pheromone increment, and the path length of a single ant, a global pheromone update formula is constructed; the improved pheromone update rule is generated by integrating the path quality dynamic weight calculation formula, the potential field pheromone increment calculation formula, and the global pheromone update formula.

4. The method according to claim 1, characterized in that, The improved heuristic function is constructed based on the set of puffed obstacle grid coordinates, the starting grid coordinates, and the ending grid coordinates in the rasterized environment map package, combined with the potential field parameters in the initial parameter set, including: Based on the raster granularity in the rasterized environment map package, the Euclidean distance from the current raster to the next candidate raster is calculated, and the distance heuristic factor is calculated based on the Euclidean distance. Based on the rasterized environment map package, the current raster coordinates and the endpoint raster coordinates are obtained, and the gravitational potential field is calculated by combining the gravitational potential field coefficients in the initial parameter set. Based on the expanded obstacle grid coordinate set in the rasterized environment map package, calculate the center coordinates of each obstacle; Based on the current grid coordinates, the center coordinates of the obstacle, and the repulsive potential field coefficients in the initial parameter set, the obstacle's influence distance, and the optimization parameters, the improved repulsive potential field is calculated. By combining the gravitational potential field and the improved repulsive potential field, the total potential field is obtained; based on the total potential field, the potential field heuristic factor is calculated using a preset formula for calculating the potential field heuristic factor. The improved heuristic function is constructed by fusing the distance heuristic factor and the potential field heuristic factor.

5. The method according to claim 1, characterized in that, Based on the raster matrix and passable raster set in the rasterized environment map package, the ant colony basic parameters in the initial parameter set, and combined with the improved pheromone update rule and the improved heuristic function, the ant colony path search iteration is performed, recording the path of each ant and its corresponding path length and average obstacle avoidance safe distance, to obtain a path set, including: S51. Based on the ant colony size and initial pheromone concentration in the initial parameter set, place each ant at the starting grid coordinates in the rasterized environment map package, clear the taboo table for each ant, and initialize the pheromone concentration between grids in the h-th iteration to the initial pheromone concentration; where h is a positive integer. S52. Set the maximum number of iterations, the threshold for the path length change rate, and the preset number of iterations to continuously meet the conditions; S53. Based on the pheromone concentration between each grid in the h-th iteration and the improved heuristic function, combined with the pheromone heuristic factor and distance heuristic factor in the initial parameter set, the state transition probability of the ant from the current grid to the next grid is calculated by a preset state transition formula; the next candidate grid is the grid in the rasterized environment map package that is not included in the taboo table from the set of passable grids. S54. Select the next grid cell according to the state transition probability, add the coordinates of the next grid cell to the tabu table, and update the coordinates of the ant's current grid cell. S55. Repeat steps S53-S54 until the ant reaches the endpoint grid coordinates in the rasterized environment map package, and record the ant's path; S56. Based on the grid granularity in the rasterized environment map package, calculate the number of grids traversed by the ant's path, and combine the grid granularity to obtain the path length of the ant; S57. Based on the set of coordinates of the puffed obstacle grids in the rasterized environment map package, calculate the shortest distance between the ant's path and each puffed obstacle grid, and take the average of the shortest distances to obtain the average obstacle avoidance safe distance corresponding to the ant's path. S58. According to the improved pheromone update rule, update the pheromone concentration between each adjacent grid on the ant's path to obtain the pheromone concentration between each grid in the (h+1)th iteration. S59. Repeat steps S53-S58 until each ant completes a path search from the starting grid coordinates to the ending grid coordinates, then end the current iteration. Obtain and, based on the path length of each ant, select the optimal path length for the current iteration. If the current iteration is the first iteration, record the optimal path length for the current iteration without calculating the path length change rate. If the current iteration is not the first iteration, calculate the change rate between the optimal path length of the current iteration and the optimal path length of the previous iteration. If the change rate is less than the path length change rate threshold, accumulate the number of iterations that continuously meet the condition. If the change rate is greater than or equal to the path length change rate threshold, reset the accumulated number of iterations that continuously meet the condition. S60. Update h to h+1, repeat steps S53-S59 until the number of iterations reaches the maximum value of the number of iterations, or the cumulative number of iterations that continuously meet the conditions reaches the preset value of the number of iterations that continuously meet the conditions. Stop the iteration, obtain the path of each ant during the iteration process, the corresponding path length and the average value of the obstacle avoidance safety distance, and form the path set.

6. The method according to claim 1, characterized in that, The path set is filtered according to the constraints in the initial parameter set to obtain the filtered paths; The filtered paths are smoothed to obtain the optimal path, including: Extract the average path length and obstacle avoidance safe distance of each path in the path set; Based on the coordinate sequence of each path, the heading change angle between adjacent grids is calculated, and the heading change angles are integrated according to the path travel order to obtain the turning angle sequence corresponding to each path. Based on the minimum obstacle avoidance safety distance in the initial parameter set, paths with an average obstacle avoidance safety distance greater than or equal to the minimum obstacle avoidance safety distance are selected from the path set to obtain the first candidate path set; Based on the maximum turning angle in the initial parameter set, the turning angle sequence of each path in the first candidate path set is traversed, and paths whose turning angles are all less than or equal to the maximum turning angle are selected from the first candidate path set to obtain the second candidate path set. Compare the path lengths of each path in the second candidate path set, and select the path with the shortest path length in the second candidate path set as the initial optimal path; Extract the inflection point coordinates of the initial optimal path, and use the inflection point coordinates as the control vertices of the B-spline curve; Define the order and node vector of the B-spline curve, and construct the B-spline curve equation based on the control vertex, the order, and the node vector; solve the B-spline curve equation to obtain the smoothed path coordinate sequence. Based on the raster matrix and the set of traversable rasters in the rasterized environment map package, it is verified whether all the rasters corresponding to the smoothed path coordinate sequence are traversable rasters. If the verification is successful, the path corresponding to the smoothed path coordinate sequence is taken as the optimal path.

7. A path planning system for unmanned surface vessels based on an improved pheromone update strategy, characterized in that, The system includes: An environmental modeling module is used to perform grayscale processing on the electronic nautical chart of the target navigation area to obtain a grayscale electronic nautical chart; to perform rasterization processing on the grayscale electronic nautical chart to obtain a rasterization parameter set; and to combine the grayscale electronic nautical chart to obtain a rasterization environment map package including the rasterization parameter set and the grayscale electronic nautical chart; wherein, the rasterization parameter set includes raster granularity, raster matrix, raster coordinate set of expanded obstacles, passable raster set, starting point raster coordinates, and ending point raster coordinates; The constraint initialization module is used to obtain the maximum turning angle of the unmanned surface vessel based on the grid granularity and the set of grid coordinates of the expanded obstacle in the rasterized environment map package; and to set the ant colony basic parameters, potential field parameters, potential field influence coefficient, and constraint conditions based on the grid granularity, the set of grid coordinates of the expanded obstacle, and the maximum turning angle to obtain an initial parameter set; wherein, the ant colony basic parameters include ant colony size, initial pheromone concentration, pheromone evaporation factor, pheromone intensity, pheromone heuristic factor, and distance heuristic factor; the potential field parameters include gravitational potential field coefficient, repulsive potential field coefficient, obstacle influence distance, and optimization parameters; and the constraint conditions include minimum obstacle avoidance safe distance and the maximum turning angle; The pheromone rule module is used to calculate the dynamic weight of path quality and the potential field pheromone increment based on the set of puffed obstacle grid coordinates, the starting grid coordinates and the ending grid coordinates in the gridded environment map package, combined with the initial parameter set, and to generate improved pheromone update rules. The heuristic function module is used to construct an improved heuristic function based on the set of puffed obstacle grid coordinates, the starting grid coordinates, and the ending grid coordinates in the rasterized environment map package, combined with the potential field parameters in the initial parameter set. The iterative search module is used to perform ant colony path search iteration based on the raster matrix and passable raster set in the rasterized environment map package, the ant colony basic parameters in the initial parameter set, the improved pheromone update rule and the improved heuristic function, record the path of each ant and the corresponding path length and the average obstacle avoidance safe distance, and obtain the path set. The path optimization module is used to filter the path set according to the constraints in the initial parameter set to obtain the filtered paths; and to smooth the filtered paths to obtain the optimal path.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. 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 steps of the method according to any one of claims 1 to 6.