Method and system for automatic flying around no-fly zone by unmanned aerial vehicle
By combining Voronoi diagrams and rasterized maps with A* search algorithm and Bézier curve processing, the safety distance and path weight are dynamically adjusted, solving the problems of low efficiency and poor stability in path planning for UAVs to bypass no-fly zones, and achieving efficient and safe dynamic path optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QINGDAO CLOUD CENTURY INFORMATION TECH CO LTD
- Filing Date
- 2025-07-24
- Publication Date
- 2026-04-21
AI Technical Summary
Existing drones suffer from low path planning efficiency, insufficient dynamic adaptability, and poor flight stability when flying around no-fly zones. In particular, in dense no-fly zone scenarios, the computational complexity is high, real-time replanning is lacking, and physical feasibility is weak, making it unable to effectively respond to dynamic no-fly zone updates.
A safe path planning base map is constructed using Voronoi diagrams and raster maps. Combined with A* search algorithm and Bézier curve smoothing, the minimum safe detour distance and path weight are dynamically adjusted. Through multi-objective optimization algorithm, the path length, energy consumption and obstacle avoidance rate are optimized in real time in response to changes in no-fly zones.
It achieves efficient and safe path planning in dynamic no-fly zones, reducing computation time to one-third of traditional methods, improving replanning response speed by three times, reducing sharp turns by 90%, significantly reducing energy consumption and improving flight stability.
Smart Images

Figure CN120803027B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of scheme design for automatic flight around no-fly zones by unmanned aerial vehicles (UAVs), and specifically to a method and system for automatic flight around no-fly zones by UAVs. Background Technology
[0002] With the widespread application of drones in logistics, inspection, surveying, and other fields, their autonomous flight safety faces severe challenges. Current technologies mainly rely on manually pre-planned flight routes to avoid no-fly zones, which has three major drawbacks:
[0003] Inefficient: Manual route planning requires repeated adjustments to avoid polygonal no-fly zones, consuming a significant amount of time and prone to oversights. Especially in scenarios with dense no-fly zones (such as urban airspace), the time required for route planning increases exponentially with the number of no-fly zones.
[0004] Insufficient dynamic adaptability: Traditional static maps cannot respond to updates to temporary no-fly zones (such as sudden military exercises or fire zones). When the no-fly zone changes dynamically, the drone needs to abort the mission and return to base or hover urgently, resulting in mission failure.
[0005] Poor flight stability: Paths generated by algorithms such as Dijkstra and RRT are mostly polylines with many sharp turns. When drones execute such paths, they need to frequently accelerate and decelerate, which not only increases energy consumption but also makes them more prone to crashes due to attitude instability.
[0006] Although some schemes adopted A The algorithm optimizes path length, but still fails to solve three core problems:
[0007] High computational complexity: When directly processing irregular no-fly zone polygons, the algorithm needs to traverse a large number of invalid nodes;
[0008] Lack of real-time replanning: Unable to dynamically adjust the path during flight;
[0009] Weak physical feasibility: Ignoring drone dynamics constraints (such as minimum turning radius).
[0010] Therefore, there is an urgent need for an autonomous flight avoidance technology that supports dynamic no-fly zone avoidance, has low computational overhead, and conforms to the flight characteristics of UAVs.
[0011] Therefore, existing technologies still need further development. Summary of the Invention
[0012] The purpose of this invention is to overcome the above-mentioned technical deficiencies and provide a method and system for drones to automatically fly around no-fly zones, so as to solve the problems existing in the prior art.
[0013] To achieve the above-mentioned technical objectives, according to a first aspect of the present invention, the present invention provides a method for an unmanned aerial vehicle (UAV) to automatically bypass a no-fly zone, comprising:
[0014] S100. Initialize flight mission parameters: Set the start and end points, load the no-fly zone polygon data, and configure the initial value of the minimum safe detour distance; this initial value can be dynamically updated during flight.
[0015] S200. Construct a basic map for safe route planning: Generate a Voronoi diagram based on the boundary and center points of the no-fly zone, and mark the feasible flight areas and the no-fly zone; or use a raster map to divide the flight areas.
[0016] S300, Dynamic Path Search: Using A The search algorithm calculates the bypass path on the Voronoi diagram or raster map; the A The heuristic function of the search algorithm is the Euclidean distance from the current point to the destination, and the cost function includes wind speed and energy consumption weights.
[0017] S400, Path Optimization: For A The paths generated by the search algorithm are smoothed using Bézier curves to reduce sharp turns; the paths are also optimized for multiple objectives, balancing path length, energy consumption, and obstacle avoidance rate.
[0018] Specifically, the construction of the Voronoi diagram in step S200 includes:
[0019] Extract the boundary points and center points of all no-fly zone polygons;
[0020] Generate a Voronoi map covering the flight area to ensure that the path maintains a safe distance from the no-fly zone boundary.
[0021] Specifically, the A The cost function g(n) of the search algorithm satisfies:
[0022] ;
[0023] in To dynamically adjust the weighting coefficients.
[0024] Specifically, this also includes dynamic no-fly zone detection:
[0025] The flight area is gridded to monitor the predicted trajectory points of the drone within the next T seconds in real time.
[0026] If a trajectory point falls into a no-fly zone grid, path replanning is triggered.
[0027] Specifically, the minimum detour safety distance Based on dynamic adjustment of initial values, its calculation satisfies:
[0028] ;
[0029] in, For the drone's real-time speed, These are the weighting coefficients. Used as a base buffer distance.
[0030] Specifically, the Bézier curve smoothing process includes:
[0031] Extract curvature change points in the path as control points, and constrain the position of the control points to maintain a safe distance in the no-fly zone;
[0032] A continuous and smooth path is generated by fitting a third-order Bézier curve.
[0033] Limit the maximum curvature of the path to ensure that the drone can perform the operation; and perform no-fly zone re-detection after fitting.
[0034] Specifically, the multi-objective optimization employs a variant of Dijkstra's algorithm, in A Based on the path generated by the search algorithm, local fine-tuning is performed, and the total cost function is:
[0035] TotalCost distance Energy consumption Obstacle density;
[0036] in, To dynamically adjust the weighting coefficients, the weighting coefficients are dynamically switched according to the flight mode.
[0037] Specifically, the path replanning is a local optimization:
[0038] Replanning will only be performed within a radius of R meters around the affected path segment;
[0039] The optimization objective is to minimize the cumulative change in heading angle.
[0040] Specifically, the multi-objective optimization in step S400 includes:
[0041] Adjust the path gradient based on the drone's real-time pitch and roll angles;
[0042] In mountainous terrain, prioritize routes with low elevation gain.
[0043] According to a second aspect of the present invention, a system for automatically bypassing no-fly zones by unmanned aerial vehicles (UAVs) is provided, comprising:
[0044] The acquisition module is used to initialize flight mission parameters: set the start and end points, load the no-fly zone polygon data, and configure the initial value of the minimum safe detour distance; this initial value can be dynamically updated during flight.
[0045] The control module is used to construct a basic map for safe path planning: generating a Voronoi diagram based on the boundary and center points of the no-fly zone, marking feasible flight areas and no-fly zones; or using a raster map to divide flight areas; and for dynamic path search: employing A... The search algorithm calculates the bypass path on the Voronoi diagram or raster map; the A The heuristic function of the search algorithm is the Euclidean distance from the current point to the destination, and the cost function includes wind speed and energy consumption weights; used for path optimization: for A The paths generated by the search algorithm are smoothed using Bézier curves to reduce sharp turns; the paths are also optimized for multiple objectives, balancing path length, energy consumption, and obstacle avoidance rate.
[0046] Beneficial effects:
[0047] This invention achieves the following significant advancements through its innovative technical solution:
[0048] 1. Improve route planning efficiency and safety:
[0049] ① Voronoi diagram preprocessing: Transform the no-fly zone boundary into a safe path skeleton, so that A The number of search nodes has been reduced by more than 70%, and the computation time has been reduced to 1 / 3 of that of traditional methods;
[0050] ② Dynamic safety distance mechanism: Automatically expands the no-fly zone boundary based on real-time flight status (speed, wind speed, positioning error) to ensure that the drone always maintains a safe buffer space;
[0051] ③ Ray-based no-fly zone detection: Quickly determine location risk through lightweight geometric calculations, avoiding complex geographic information system calls.
[0052] 2. Achieve real-time response to dynamic environments:
[0053] ① Local replanning window: Optimization is only applied to route segments (radius ≤ 100 meters) affected by the new no-fly zone, maintaining overall route stability and improving replanning response speed by 3 times;
[0054] ② Multi-objective optimization engine: It dynamically balances path length, energy consumption, and obstacle density, and flexibly adapts to different task modes (such as energy saving priority / obstacle avoidance priority) through weight coefficients.
[0055] 3. Optimize flight physics performance:
[0056] ① Bezier curve smoothing: Transforms the jagged path into a continuous trajectory that conforms to the minimum turning radius of the UAV, reducing sharp turns by more than 90% and significantly reducing mechanical wear on the airframe;
[0057] ② Three-dimensional dynamics compensation: Automatically adjusts the path gradient based on pitch / roll angle to avoid the risk of stalling in mountainous terrain.
[0058] 4. Expand application scenario compatibility:
[0059] ① Support for heterogeneous no-fly zones: Simultaneously handle government-designated no-fly zones (fixed polygons), temporary no-fly zones (dynamic circles / rectangles), and natural obstacle zones (mountains, high-voltage lines);
[0060] ② Hardware resource optimization: The algorithm can run in real time on embedded chips (such as Jetson Nano), meeting the computing power requirements of drones from consumer to industrial levels. Attached Figure Description
[0061] Figure 1 This is a flowchart illustrating the method for automatically bypassing no-fly zones by unmanned aerial vehicles (UAVs) provided in a specific embodiment of the present invention.
[0062] Figure 2 This is a schematic diagram of the system composition of the system for automatically bypassing no-fly zones for unmanned aerial vehicles provided in a specific embodiment of the present invention. Detailed Implementation
[0063] To enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Based on the embodiments in this application, other similar embodiments obtained by those skilled in the art without creative effort should all fall within the scope of protection of this application. Furthermore, directional terms mentioned in the following embodiments, such as "up," "down," "left," and "right," are only for reference to the directions in the accompanying drawings; therefore, the directional terms used are for illustrative purposes and not for limiting the invention.
[0064] The present invention will be further described below with reference to the accompanying drawings and preferred embodiments.
[0065] Please see Figure 1 This invention provides a method for an unmanned aerial vehicle (UAV) to automatically fly around a no-fly zone, comprising:
[0066] S100. Initialize flight mission parameters: Set the start and end points, load the no-fly zone polygon data, and configure the initial value of the minimum safe detour distance; this initial value can be dynamically updated during flight.
[0067] It is understandable that the initial value of the minimum safe detour distance is configured (such as the default 20 meters). This parameter is dynamically updated during flight based on real-time sensor data. It is clear that the "initial value" is only used as a starting point parameter, and the actual update is the safe distance parameter itself, thus avoiding the ambiguity of "dynamic update of the initial value".
[0068] It should be further explained that, regarding step S100, the specific design of this invention includes:
[0069] ① Define the starting point : Current GPS coordinates (latitude and longitude) of the drone;
[0070] ② Define the endpoint GPS coordinates of the target point;
[0071] ③ Define the no-fly zone polygon: composed of a sequence of vertices. Defined polygonal region;
[0072] ④ Define the minimum safe distance :
[0073] ;
[0074] in:
[0075] Base_Buffer: Base safe buffer distance (default 20 meters);
[0076] : Real-time speed of the drone (unit: m / s);
[0077] Real-time wind speed (unit: m / s);
[0078] GPS positioning error estimate (unit: meters);
[0079] Weighting coefficient (dynamically adjusted according to flight environment);
[0080] Example: During high-speed flight ( ), The safety distance was increased from 0.5 to 1.2 to address inertial risks.
[0081] Understandably, the minimum safe detour distance It is configured with a base value during initialization, but is dynamically updated during flight based on real-time sensor data (such as speed and wind speed) to ensure that the safe buffer distance adapts to the dynamic environment.
[0082] Understandably, the initial configuration... These values serve only as basic references and are recalculated in real time during flight via an embedded processor. The weighting coefficients a, β, and γ are dynamically adjusted by the flight controller based on the mission mode (such as energy-saving mode or obstacle avoidance mode) to ensure parameter continuity.
[0083] It should be further explained that the dynamic adjustment of the weighting coefficients a and β is based on the UAV dynamics model and wind tunnel test calibration, with values ranging from a∈[0.5,1.5] and β∈[0.1,0.5], and default values of a=0.7 and β=0.3. Among them, a is increased to 1.2 in high-speed flight mode (V>15m / s) to compensate for inertial risk, and β is linearly adjusted based on the wind speed-heading angle under headwind conditions.
[0084] It should be further explained that the weight coefficients a, β, and γ are set based on the actual flight dataset, where a is used for speed compensation (range [0.8, 1.2]), β is used for wind speed compensation (range [0.2, 0.4]), and γ is used for GPS error compensation (range [1.0, 1.5]). The specific values are optimized online by the embedded controller, including increasing the weight of a when V increases.
[0085] Understandably, the weighting coefficient is a dimensionless scaling factor used to balance the dimensional differences and contribution weights of different physical quantities (distance, wind speed, energy consumption, etc.). Its value is not limited to the range [0,1], and its specific design depends on:
[0086] Differences in magnitude of physical quantities (e.g., wind speed unit m / s vs. distance unit m);
[0087] Priorities of task scenarios (e.g., obstacle avoidance priority vs. energy saving priority).
[0088] Degrees of freedom of value selection:
[0089] From a mathematical perspective, the weighting coefficient can be any positive real number (including >1).
[0090] It should be further explained that when the weight is greater than 1, it indicates that the system strengthens a certain constraint in a specific scenario:
[0091] 1. Physical quantity compensation:
[0092] Example: γ·GPS error in the safety distance formula:
[0093] When the GPS error is 10m, if γ = 1.5, then the compensation term is 15m.
[0094] Technical function: To offset misjudgments of no-fly zones caused by positioning drift.
[0095] 2. Mode priority switching:
[0096] Example: In the total cost function, γ = 1.0 (near the upper limit).
[0097] Achieved effect: Prioritize obstacle avoidance rate in areas with dense obstacles (sacrificing some path length).
[0098] 3. Balance of nonlinear effects:
[0099] When the cost of wind speed drag is exponentially related to speed, β>1 is required to achieve a linear approximation;
[0100] Understandably, the range of values is set to avoid excessive weights that could distort the algorithm. This application limits the range through constraints:
[0101] 1. Dynamic boundary:
[0102] α max =1.5 is derived from the maximum thrust limit of the drone (too much thrust would make the path unflyable);
[0103] 2. Sensor error limit:
[0104] γ max =1.5 corresponds to a 10% margin of the maximum GPS positioning error (15m).
[0105] In other preferred embodiments of the present invention, the values of the weighting coefficients α, β, and γ are dynamically adjusted according to the UAV flight mode:
[0106] Energy-saving mode: Prioritize reducing energy consumption (β=0.6, α=0.2, γ=0.2);
[0107] Obstacle avoidance mode: Prioritize obstacle avoidance (γ=0.6, α=0.3, β=0.1);
[0108] The total weight always satisfies α+β+γ=1, calibrated using 200 sets of mountain flight test data.
[0109] S200. Construct a basic map for safe path planning: Generate a Voronoi diagram based on the boundary points and center points of the no-fly zone, and mark the feasible flight areas and the no-fly zone; or use a raster map to divide the flight areas.
[0110] Specifically, the construction of the Voronoi diagram in step S200 includes:
[0111] Extract the boundary points and center points of all no-fly zone polygons;
[0112] Generate a Voronoi map covering the flight area to ensure that the path maintains a safe distance from the no-fly zone boundary.
[0113] It should be further explained that, regarding step S200, the specific design of this invention includes:
[0114] Option A, Voronoi diagram generation:
[0115] ① Extract the set of boundary points of the no-fly zone {B1, B2, ..., B} m};
[0116] ② Calculate the center point of the no-fly zone ;
[0117] ③ Generate a Voronoi diagram based on the point set to keep the path away from the no-fly zone boundary;
[0118] Option B, Rasterized Map:
[0119] ① Divide the flight area into 10m×10m grids;
[0120] ② Mark raster attributes:
[0121] SafeZone: Feasible area (white grid);
[0122] NoFlyZone: No-fly zone (red grid).
[0123] S300, Dynamic Path Search: Using A The search algorithm calculates the bypass path on the Voronoi diagram or raster map; the A The heuristic function of the search algorithm is the Euclidean distance from the current point to the destination, and the cost function includes wind speed and energy consumption weights.
[0124] Specifically, the A The cost function g(n) of the search algorithm satisfies:
[0125] ;
[0126] in To dynamically adjust the weighting coefficients.
[0127] Specifically, this also includes dynamic no-fly zone detection:
[0128] The flight area is gridded to monitor the predicted trajectory points of the drone within the next T seconds in real time.
[0129] If a trajectory point falls into a no-fly zone grid, path replanning is triggered.
[0130] It should be further explained that after fitting the Bezier curve, the present invention applies trajectory point detection to the smooth path segment. If any predicted point falls into the no-fly zone grid, local replanning is immediately performed within the affected radius R meters, with the optimization objective being to minimize the change in heading angle.
[0131] Furthermore, in the equation of Bézier curves In the middle, add path point coordinate boundary conditions to ensure Internal; Maximum curvature limit Combined with the no-fly zone buffer, This is the minimum turning radius for the drone.
[0132] Understandably, Bézier smoothing does not introduce deviation risk because the control point originates from A. The search algorithm generates paths with extreme curvature points, and a replanning mechanism provides redundancy guarantees.
[0133] Specifically, the minimum detour safety distance Based on dynamic adjustment of initial values, its calculation satisfies:
[0134] ;
[0135] in, For the drone's real-time speed, These are the weighting coefficients. The basic buffer distance is the minimum real-time distance that the drone / vehicle must maintain with respect to the obstacle. It can be set according to the actual situation. The larger the value, the higher the safety. According to experimental tests, the preferred value is 5 meters.
[0136] Specifically, the path replanning is a local optimization:
[0137] Only the area within R meters surrounding the affected path segment needs to be replanned;
[0138] The optimization objective is to minimize the cumulative change in heading angle.
[0139] It should be further explained that, regarding step S300, the specific design of this invention includes:
[0140] ① Design the cost function:
[0141]
[0142] in:
[0143] From the starting point to the node Actual distance (unit: meters);
[0144] Headwind drag coefficient ( , (The angle between the heading and the wind direction);
[0145] Dynamic weights (default) );
[0146] ② Design heuristic functions:
[0147]
[0148] in, For nodes To the finish line Euclidean distance (straight-line distance).
[0149] S400, Path Optimization: For A The paths generated by the search algorithm are smoothed using Bézier curves to reduce sharp turns; the paths are also optimized for multiple objectives, balancing path length, energy consumption, and obstacle avoidance rate.
[0150] Specifically, the Bézier curve smoothing process includes:
[0151] Extract curvature change points in the path as control points, and constrain the position of the control points to maintain a safe distance in the no-fly zone;
[0152] A continuous and smooth path is generated by fitting a third-order Bézier curve.
[0153] Limit the maximum curvature of the path to ensure that the drone can perform the operation; and perform no-fly zone re-detection after fitting.
[0154] It should be noted that the present invention incorporates the following security mechanisms:
[0155] Before smoothing, the selection of control points is constrained by the no-fly zone boundary to ensure that the fitted path points maintain a minimum safe distance from the no-fly zone. After smoothing, perform real-time no-fly zone detection (such as the ray method of weight 4). If the path point deviates, trigger local replanning.
[0156] Specifically, the multi-objective optimization employs a variant of Dijkstra's algorithm, in A Based on the path generated by the search algorithm, local fine-tuning is performed, and the total cost function is:
[0157] TotalCost distance Energy consumption Obstacle density;
[0158] in, To dynamically adjust the weighting coefficients, the weighting coefficients are dynamically switched according to the flight mode.
[0159] It is understood that this invention incorporates a dynamic switching logic for weighting coefficients: energy-saving mode takes priority. =0.6, obstacle avoidance mode prioritized =0.8; range of values ∈[0.4,0.8]、 ∈[0.3,0.7]、 ∈[0.5,1.0], based on the task simulation results, to ensure that the total cost is minimized.
[0160] Specifically, the multi-objective optimization in step S400 includes:
[0161] Adjust the path gradient based on the drone's real-time pitch and roll angles;
[0162] In mountainous terrain, prioritize routes with low elevation gain.
[0163] It should be further explained that, regarding the dynamic adjustment of the path slope, the specific solution designed in this invention includes:
[0164] 1. Design a slope-attitude coupled control model:
[0165] ① Input parameters:
[0166] Real-time pitch angle (drone nose and tail tilt angle);
[0167] Real-time roll angle (fuselage tilt angle);
[0168] Topographic elevation gradient (change in elevation per unit distance).
[0169] ② Control Logic:
[0170] ;
[0171] in:
[0172] Theoretical minimum climb gradient for drones (determined by aircraft dynamics);
[0173] Weighting coefficient (calibrated through wind tunnel testing).
[0174] ③ Dynamic adjustment strategy:
[0175] When (the nose of the aircraft is tilted up) and (uphill): reduce the gradient of the path to 0.7 times the original to compensate for insufficient power;
[0176] When (tilting) and (downhill): Increase the path slope to 1.2 times the original to resist crosswind shift.
[0177] 2. Design slope smooth transition technology
[0178] ① Segmented control: Divide the continuous path into segments of length (where is velocity and is allowable acceleration);
[0179] ②Slope transition constraints:
[0180] ;
[0181] Implementation process:
[0182] ① Read the current slope θ0;
[0183] ② Calculate the slope θ1 of the next path point;
[0184] ③ If Δθ ≤ threshold, then connect directly;
[0185] If Δθ > threshold, then the insertion transition point θ' = (θ0 + θ1) / 2;
[0186] ④ Recursively check new segments.
[0187] It should be further explained that, regarding the optimal strategy for selecting routes with low elevation gain in mountainous areas, the specific scheme designed in this invention includes:
[0188] 1. Mountainous terrain feature identification:
[0189] ① Basis for judgment:
[0190] Calculate terrain roughness using the following formula:
[0191]
[0192] The basis for judgment is Typical threshold (typical mountainous area) );
[0193] in:
[0194] : indicates the first in the terrain The elevation value (i.e., altitude) of each point
[0195] : Represents the average elevation of all points within the selected area, i.e. ;
[0196] This indicates the total number of measurement points within the selected area;
[0197] : Indicates the absolute deviation of the elevation of each point from the average elevation;
[0198] : Represents the sum of the absolute elevation deviations of all points.
[0199] Standard deviation of elevation ;
[0200] Continuous ascent length > preset value (default 500m).
[0201] ② Design a multi-objective optimization function:
[0202] Cost function design:
[0203]
[0204] in:
[0205] For the path to the total plant, the optimization objective is to minimize it;
[0206] The average climb rate is optimized to ≤3% (safety threshold);
[0207] For steep slope sections (slope > 8%), the optimization objective is to minimize the number of iterations.
[0208] , , To dynamically adjust the weighting coefficients, the weighting coefficients are dynamically switched according to the flight mode.
[0209] ③ Design a low climb rate path generation algorithm, the code includes:
[0210] def generate_low_climb_path(terrain_map):
[0211] # Step 1: Construct a contour map
[0212] contour_graph = extract_contour_isolines(terrain_map, step=5m)
[0213] # Step 2: Filter the set of feasible paths
[0214] candidate_paths = []
[0215] for contour_line in contour_graph:
[0216] if contour_line.slope < 0.08: # Slope < 8%
[0217] path = connect_contour_segments(contour_line, max_gap=100m)
[0218] candidate_paths.append(path)
[0219] # Step 3: Optimal Energy Consumption Selection
[0220] optimal_path = min(candidate_paths, key=lambda p: p.cost_energy)
[0221] # Step 4: Secondary smoothing (to ensure curvature continuity)
[0222] return bezier_smoothing(optimal_path, control_point_strategy="curvature_guided")
[0223] It is understandable that the above solution has the following technical advantages:
[0224] 1. Slope-Attitude Dynamic Coupling:
[0225] Addressing the pain point: Traditional static paths are prone to dynamic saturation under sudden winds or steep slopes;
[0226] Innovation: Real-time attitude data is converted into slope control parameters to achieve adaptive flight capability.
[0227] 2. Optimal energy consumption for mountain routes:
[0228] Technological breakthrough: Generating naturally low-ramp paths through contour topology analysis (rather than forcibly reducing the slope).
[0229] Safety gains: The number of steep slope sections is reduced by more than 60%, significantly reducing the risk of motor overload.
[0230] 3. Balancing smoothness and efficiency:
[0231] Design a segmented constraint model to avoid excessive smoothing that leads to detours (path length increase ≤ 8%).
[0232] The design recursively inserts transition points to eliminate curvature abrupt changes (maximum centripetal acceleration decreases by 40%).
[0233] Implementation example: In mountainous testing (maximum elevation difference 620m):
[0234] Original A The average crawl rate of paths generated by the search algorithm was 6.2% → after optimization: 2.9%;
[0235] Motor peak power decreased by 28% (actual measured data for M300 model).
[0236] It is understandable that this invention, through dynamic feedback control and terrain feature-driven optimization, achieves for the first time a triple guarantee of safety, energy consumption, and smoothness for unmanned mountain flight.
[0237] It should be further explained that, regarding step S500, the specific design of this invention includes:
[0238] ① Design the total cost function:
[0239]
[0240] in:
[0241] Total path length (in meters);
[0242] Energy consumption cost ( (Related to speed and climb rate);
[0243] Obstacle density (unit: obstacles / square meter);
[0244] Mode weight (energy saving mode) Obstacle avoidance mode ).
[0245] ② Design the equation of a third-order Bézier curve:
[0246]
[0247] in:
[0248] : Start / end point of the path segment;
[0249] Control points (generated from curvature extrema);
[0250] Curve parameters (step size 0.1 generates continuous trajectory);
[0251] Constraint: Maximum curvature ( (Minimum turning radius for the drone).
[0252] It should be further explained that, regarding dynamic no-fly zone detection and replanning, the solution designed in this invention includes:
[0253] ①Predicted trajectory detection:
[0254] (1) Calculate the trajectory point set {Q1, Q2, ..., Qk} for the next T seconds based on the UAV's state (position (x, y), velocity V, heading angle θ);
[0255] (2) Perform no-fly zone judgment for each Qi:
[0256] Inside = {true if raycasting returns odd intersections false otherwise.}
[0257] ② Local replanning:
[0258] Triggering conditions:
[0259] (1) The new no-fly zone was detected to intersect with the predicted trajectory;
[0260] (2) Optimization objective:
[0261]
[0262] in:
[0263] , New / Original route heading angle (unit: radians);
[0264] ΔD: Change in path length (unit: meters);
[0265] λ: Smoothing factor (default 0.3).
[0266] It should be further explained that the present invention includes the following code:
[0267] 1. Key data structure, MyLatLng class:
[0268] class MyLatLng {
[0269] double latitude; / / Latitude coordinates (unit: degrees)
[0270] double longitude; / / Longitude coordinates (unit: degrees)
[0271] public MyLatLng(double lat, double lon) {
[0272] this.latitude = lat;
[0273] this.longitude = lon;
[0274] }
[0275] }
[0276] Technical function:
[0277] Encapsulate the geographic coordinates of the drone as the basic data type for path planning;
[0278] All algorithms (A) Search and no-fly zone detection are both based on calculations performed using this coordinate object.
[0279] 2. No-fly zone detection, NoFlyZone category:
[0280] class NoFlyZone {
[0281] List <mylatlng>polygon; / / No-fly zone polygon vertex sequence
[0282] public boolean isInside(MyLatLng point) {
[0283] int intersections = 0;
[0284] for (int i = 0, j = polygon.size() - 1; i <polygon.size(); j= i++) {
[0285] MyLatLng p1 = polygon.get(i);
[0286] MyLatLng p2 = polygon.get(j);
[0287] if ((p1.latitude>point.latitude) != (p2.latitude>point.latitude)&&
[0288] (point.longitude<(p2.longitude - p1.longitude)
[0289] (point.latitude - p1.latitude) /
[0290] (p2.latitude - p1.latitude) + p1.longitude)) {
[0291] intersections++;
[0292] }
[0293] }
[0294] return (intersections % 2 == 1); / / An odd number of intersections indicates the area is within a no-fly zone.
[0295] }
[0296] }
[0297] Technical principle:
[0298] Ray Casting Algorithm:
[0299] ① A horizontal ray is emitted to the right from the detection point;
[0300] ② Calculate the number of intersections between the ray and each side of the polygon;
[0301] ③ For odd-numbered intersections, the decision point is inside the polygon (no-fly zone); for even-numbered intersections, the decision point is outside the polygon (safe zone).
[0302] 3. A The AStar Path Finder class is used for path searching generated by search algorithms.
[0303] public List <mylatlng>find Path(MyLatLng start, MyLatLng target, List <noflyzone>noFlyZones) {
[0304] / / 1. Initialize the open set (priority queue)
[0305] openSet.add(new Node(start, 0));
[0306] gScore.put(start, 0.0);
[0307] fScore.put(start, heuristic(start, target));
[0308] while (!openSet.isEmpty()) {
[0309] Node current = openSet.poll();
[0310] / / 2. Reconstruct the path upon reaching the destination.
[0311] if (current.position.equals(target)) {
[0312] return reconstructPath(target);
[0313] }
[0314] / / 3. Traverse adjacent nodes
[0315] for (MyLatLng neighbor: getNeighbors(current.position, noFlyZones)) {
[0316] / / 4. Calculate the temporary cost: g(n) = g(current) + distance(current, neighbor)
[0317] double tentativeGScore = gScore.getOrDefault(current.position, Double.MAX_VALUE)
[0318] + distance(current.position,neighbor);
[0319] / / 5. Update if a better path is found
[0320] if (tentativeGScore <gScore.getOrDefault(neighbor,Double.MAX_VALUE)) {
[0321] cameFrom.put(neighbor, current.position);
[0322] gScore.put(neighbor, tentativeGScore);
[0323] fScore.put(neighbor, tentativeGScore + heuristic(neighbor, target));
[0324] openSet.add(new Node(neighbor, fScore.get(neighbor)));
[0325] }
[0326] }
[0327] Key technology components:
[0328] Heuristic function:
[0329]
[0330] The heuristic function represents the Euclidean distance (straight-line distance) from the current node to the endpoint, guiding the search direction;
[0331] Cost function: g(n) = g(current) + distance(current, n), which represents the cumulative movement cost (actual path length) from the starting point to the current node.
[0332] Node evaluation: f(n) = g(n) + h(n), representing the estimated total cost (A). The core of the algorithm is to prioritize expanding the node with the smallest f(n);
[0333] Neighbor generation: getNeighbors(), which generates 8 neighboring points around the current point (grid method), and filters out points in the no-fly zone;
[0334] Path reconstruction: reconstructPath() means tracing back from the endpoint to the parent node to generate a complete path.
[0335] Innovation achieved:
[0336] Dynamic safe distance fusion: When isInNoFlyZone() is called in getNeighbors(), safe distance control is achieved by expanding the no-fly zone boundary;
[0337] Multi-objective optimization basis: g(n) can be expanded to include wind speed and energy consumption factors.
[0338] 4. Path smoothing and Bézier curve processing:
[0339] List <mylatlng>smoothedPath = new ArrayList<>();
[0340] for (int i = 0; i <path.size() - 2; i++) {
[0341] MyLatLng p0 = path.get(i);
[0342] MyLatLng p1 = path.get(i+1);
[0343] MyLatLng p2 = path.get(i+2);
[0344] for (double t = 0; t<= 1; t += 0.1) {
[0345] double x = (1-t) (1-t) p0.latitude
[0346] +2 (1-t) t p1.latitude
[0347] + t t p2.latitude;
[0348] double y = (1-t) (1-t) p0.longitude
[0349] +2 (1-t) t p1.longitude
[0350] + t t p2.longitude;
[0351] smoothedPath.add(new MyLatLng(x, y));
[0352] }
[0353] }
[0354] Mathematical principles:
[0355] Equation of a second-order Bézier curve:
[0356]
[0357] in:
[0358] : Start / end point of the path segment;
[0359] Control point (take the midpoint of the original path);
[0360] Curve parameters (step size 0.1 generates 10 interpolation points).
[0361] Technical effects:
[0362] 1. Eliminate jagged paths: Set A The generated polyline is converted into a continuous curve;
[0363] 2. Reduce turning radius: Avoid attitude instability caused by sharp turns of the drone;
[0364] 3. Reduced energy consumption: Smooth path reduces the number of acceleration and deceleration cycles (actual energy saving of 15-25%).
[0365] 5. Achievement of dynamic safety distance
[0366] / / Dynamically calculate safe distance
[0367] double calculateSafeDistance() {
[0368] double baseBuffer = 20.0; / / Base safety distance (meters)
[0369] double alpha = 0.8; / / Velocity weighting coefficient
[0370] double beta = 0.3; / / Wind speed weighting coefficient
[0371] double gamma = 1.2; / / GPS error weighting coefficient
[0372] double currentSpeed = getDroneSpeed(); / / Real-time speed (m / s)
[0373] double windSpeed = getWindSpeed(); / / Real-time wind speed (m / s)
[0374] double gpsError = getGpsErrorEstimation(); / / GPS error estimation (m)
[0375] return baseBuffer
[0376] + alpha currentSpeed
[0377] + beta windSpeed
[0378] + gamma gpsError;
[0379] }
[0380] in:
[0381] currentSpeed: The drone's real-time speed. The faster the speed, the greater the safe distance (to mitigate inertial risks).
[0382] windSpeed: Ambient wind speed. When flying against the wind, a safe distance should be increased (to prevent drifting due to crosswinds).
[0383] gpsError: GPS positioning accuracy error. The larger the error, the greater the safe distance (to compensate for positioning uncertainty).
[0384] alpha, beta, γ: dynamic weighting coefficients, adjusted according to flight mode (e.g., alpha=1.5 for high-speed mode).
[0385] It is understandable that the code's role in the overall solution includes:
[0386] 1. Core Path Planning: AStarPathFinder implements the main algorithm for bypassing obstacles.
[0387] 2. Security Guarantee: NoFlyZone detection + dynamic safety distance prevents intrusion.
[0388] 3. Flight Optimization: Bezier curves improve flight stability and energy efficiency.
[0389] 4. Scalability:
[0390] Voronoi diagram guidance can be achieved by overriding heuristic();
[0391] Integrate dynamic no-fly zone detection in getNeighbors().
[0392] Please see Figure 2 The present invention provides another embodiment, which provides a system for drones to automatically fly around no-fly zones. The system for drones to automatically fly around no-fly zones includes:
[0393] The acquisition module 100 is used to initialize flight mission parameters: set the start and end points, load the no-fly zone polygon data, and configure the initial value of the minimum safe detour distance; this initial value can be dynamically updated during flight.
[0394] Control module 200 is used to construct a basic map for safe path planning: generating a Voronoi diagram based on the boundary and center points of the no-fly zone, marking feasible flight areas and no-fly zones; or using a rasterized map to divide flight areas; and for dynamic path search: employing A... The search algorithm calculates the bypass path on the Voronoi diagram or raster map; the A The heuristic function of the search algorithm is the Euclidean distance from the current point to the destination, and the cost function includes wind speed and energy consumption weights; used for path optimization: for A The paths generated by the search algorithm are smoothed using Bézier curves to reduce sharp turns; the paths are also optimized for multiple objectives, balancing path length, energy consumption, and obstacle avoidance rate.
[0395] It should be further noted that the system includes:
[0396] Sensor group: including GPS module and wind speed sensor, to collect real-time data on the drone's position, heading and environmental conditions;
[0397] Navigation module: Stores no-fly zone map data and constructs Voronoi diagrams or rasterized maps;
[0398] Real-time obstacle avoidance processor: configured as:
[0399] (a) Monitor no-fly zone update events and dynamically detect whether the predicted trajectory of the drone intersects with the new no-fly zone;
[0400] (b) Locally replan the affected path segments to minimize path changes;
[0401] Communication module: Interacts with ground control station to update no-fly zone instructions.
[0402] Specifically, the system includes:
[0403] ① Sensor group:
[0404] GPS module (positioning error EGPS≤2m);
[0405] IMU (Measurement Unit for pitch angle ϕ and roll angle ψ).
[0406] ② Anemometer (range 0~30m / s):
[0407] ③ Real-time obstacle avoidance processor:
[0408] Embedded chips (such as NVIDIA Jetson) execute the following threads:
[0409] while flying:
[0410] if detect_new_nofly_zone(): # No-fly zone update listener;
[0411] replan_path(window_radius=100m) # Local replanning;
[0412] adjust_safe_distance() # Calculates the dynamic safe distance.
[0413] It should be further explained that the software flow designed in this invention includes:
[0414] public void runAutopilot() {
[0415] MyLatLng start = getGPSPosition();
[0416] MyLatLng target = getMissionTarget();
[0417] List <noflyzone>zones = loadNoFlyZones();
[0418] / / Dynamic safety distance calculation
[0419] double baseBuffer = 20.0;
[0420] double alpha = 0.8 (currentSpeed>15 ? 1.2 : 1.0);
[0421] double d_safe = baseBuffer + alpha currentSpeed + ... ;
[0422] / / A Path generation by search algorithm
[0423] List <mylatlng>path = AStarFinder.findPath(start, target, zones,d_safe);
[0424] / / Bezier smoothing
[0425] List <mylatlng>smoothPath = BezierCurve.fit(path, maxCurvature=0.1);
[0426] / / Send to flight controller
[0427] flightController.executePath(smoothPath);
[0428] }
[0429] In a preferred embodiment, this application also provides an electronic device, the electronic device comprising:
[0430] The computer device includes a memory and a processor, wherein the memory stores computer-readable instructions that, when executed by the processor, implement the method for automatically bypassing no-fly zones by a drone. The computer device can be broadly categorized as a server, terminal, or any other electronic device with the necessary computing and / or processing capabilities. In one embodiment, the computer device may include a processor, memory, network interface, communication interface, etc., connected via a system bus. The processor of the computer device can be used to provide the necessary computing, processing, and / or control capabilities. The memory of the computer device may include a non-volatile storage medium and internal memory. The non-volatile storage medium may store an operating system, computer programs, etc. The internal memory can provide an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface and communication interface of the computer device can be used to connect and communicate with external devices via a network. When the computer program is executed by the processor, it performs the steps of the method of the present invention.
[0431] This invention can be implemented as a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, causes the steps of the methods of embodiments of the invention to be performed. In one embodiment, the computer program is distributed across multiple network-coupled computer devices or processors, such that the computer program is stored, accessed, and executed in a distributed manner by one or more computer devices or processors. A single method step / operation, or two or more method steps / operations, may be executed by a single computer device or processor or by two or more computer devices or processors. One or more method steps / operations may be executed by one or more computer devices or processors, and one or more other method steps / operations may be executed by one or more other computer devices or processors. One or more computer devices or processors may execute a single method step / operation, or execute two or more method steps / operations.
[0432] Those skilled in the art will understand that the method steps of this invention can be performed by a computer program instructing related hardware, such as a computer device or processor, to perform the steps of this invention when executed. Depending on the context, any references herein to memory, storage, databases, or other media may include non-volatile and / or volatile memory. Examples of non-volatile memory include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid-state drive, etc. Examples of volatile memory include random access memory (RAM), external cache memory, etc.
[0433] The technical features described above can be combined arbitrarily. Although not all possible combinations of these technical features are described, any combination of these technical features should be considered to be covered by this specification, provided that such combination does not contain contradictions.
[0434] The specific embodiments of the present invention described above do not constitute a limitation on the scope of protection of the present invention. Any other corresponding changes and modifications made in accordance with the technical concept of the present invention should be included within the scope of protection of the claims of the present invention.< / mylatlng> < / mylatlng> < / noflyzone> < / mylatlng> < / noflyzone> < / mylatlng> < / mylatlng>
Claims
1. A method for an unmanned aerial vehicle (UAV) to automatically fly around a no-fly zone, characterized in that, The method includes: S100. Initialize flight mission parameters: Set the start and end points, load the no-fly zone polygon data, and configure the initial value of the minimum safe detour distance; this initial value can be dynamically updated during flight. S200. Construct a basic map for safe route planning: Generate a Voronoi diagram based on the boundary and center points of the no-fly zone, and mark the feasible flight areas and the no-fly zone; or use a raster map to divide the flight areas. S300, Dynamic Path Search: Using A The search algorithm calculates the bypass path on the Voronoi diagram or raster map; the A The heuristic function of the search algorithm is the Euclidean distance from the current point to the destination, and the cost function includes wind speed and energy consumption weights. S400, Path Optimization: For A The paths generated by the search algorithm are smoothed using Bézier curves to reduce sharp turns; the paths are also optimized for multiple objectives, balancing path length, energy consumption, and obstacle avoidance rate. It also includes dynamic no-fly zone detection: The flight area is gridded to monitor the predicted trajectory points of the drone within the next T seconds in real time. If the trajectory point falls into the no-fly zone grid, path replanning is triggered; The minimum safe detour distance Based on dynamic adjustment of initial values, its calculation satisfies: ; in: Base_Buffer: Base safe buffer distance; : Real-time speed of the drone; Weighting coefficients; The Bézier curve smoothing process includes: Extract curvature change points in the path as control points, and constrain the position of the control points to maintain a safe distance in the no-fly zone; A continuous and smooth path is generated by fitting a third-order Bézier curve. Limit the maximum curvature of the path to ensure drone operability, and perform no-fly zone re-detection after fitting; The multi-objective optimization employs a variant of Dijkstra's algorithm, in A Based on the path generated by the search algorithm, local fine-tuning is performed, and the total cost function is: TotalCost distance Energy consumption Obstacle density; in, To dynamically adjust the weighting coefficients, the weighting coefficients are dynamically switched according to the flight mode; The multi-objective optimization in step S400 includes: Adjust the path gradient based on the drone's real-time pitch and roll angles; In mountainous terrain, prioritize routes with low elevation gain.
2. The method for automatically bypassing no-fly zones by unmanned aerial vehicles according to claim 1, characterized in that, The construction of the Voronoi diagram in step S200 includes: Extract the boundary points and center points of all no-fly zone polygons; Generate a Voronoi map covering the flight area to ensure that the path maintains a safe distance from the no-fly zone boundary.
3. The method for automatically bypassing a no-fly zone by an unmanned aerial vehicle according to claim 1, characterized in that, The A The cost function g(n) of the search algorithm satisfies: ; in, To dynamically adjust the weighting coefficients.
4. The method for automatically bypassing no-fly zones by unmanned aerial vehicles according to claim 1, characterized in that, The path replanning is a local optimization: Only the area within R meters surrounding the affected path segment needs to be replanned; The optimization objective is to minimize the cumulative change in heading angle.
5. A system for automatically bypassing no-fly zones by unmanned aerial vehicles (UAVs), characterized in that, The method for automatically bypassing no-fly zones using a drone as described in any one of claims 1-4 includes: The acquisition module is used to initialize flight mission parameters: set the start and end points, load the no-fly zone polygon data, and configure the initial value of the minimum safe detour distance; this initial value can be dynamically updated during flight. The control module is used to construct a basic map for safe path planning: generating a Voronoi diagram based on the boundary and center points of the no-fly zone, marking feasible flight areas and no-fly zones; or using a raster map to divide flight areas; and for dynamic path search: employing A... The search algorithm calculates the bypass path on the Voronoi diagram or raster map; the A The heuristic function of the search algorithm is the Euclidean distance from the current point to the destination, and the cost function includes wind speed and energy consumption weights; used for path optimization: for A The paths generated by the search algorithm are smoothed using Bézier curves to reduce sharp turns; the paths are also optimized for multiple objectives, balancing path length, energy consumption, and obstacle avoidance rate.
Citation Information
Patent Citations
Multi-unmanned aerial vehicle cooperative search and rescue reconnaissance planning method in dynamic environment
CN114721427A
Unmanned aerial vehicle voyage cost estimation method
CN120338226A