An unmanned aerial vehicle electronic fence efficient anti-collision detection method based on distance priority and rolling calculation
Patent Information
- Application Number
- CN202610967395.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-01
- Publication Date
- 2026-10-30
AI Technical Summary
该方案虽然减少了实时检测的围栏数量,但仍存在不足:一是网格划分粒度固定,难以适应不同场景的精度需求;二是对于距离无人机较远但仍在同一网格内的围栏,仍然需要进行不必要的精确检测;三是缺乏对计算资源的动态调度机制,无法根据风险程度自适应调整检测频率;四是当无人机位于网格边界附近时,可能需要查询相邻多个网格,导致预筛选效果下降
本发明提供的一种基于距离优先级与滚动计算的无人机电子围栏高效防撞检测方法,有效解决了现有技术中因全量高频检测导致计算负载过高、难以兼顾计算效率与检测实时性的矛盾。该方法根据无人机与电子围栏的实际空间距离,动态划分高频、中频、低频三个优先级区域,并对各区域采用差异化的检测周期与计算策略,实现了计算资源与风险程度的动态匹配,尤其适用于大规模无人机监管场景下的计算效率优化。
Smart Images

Figure CN123010840A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to unmanned aerial vehicle (UAV) safe flight control technology, and in particular to an efficient anti-collision detection method for UAV electronic fences based on distance priority and roll calculation. Background Technology
[0002] With the booming development of the low-altitude economy, drones are increasingly used in various industries, and the number of drones in the airspace is growing exponentially. To ensure airspace safety, regulatory authorities have set up a large number of electronic fences (no-fly zones, restricted flight zones, warning zones, etc.) in areas such as airports, military restricted areas, important infrastructure, and densely populated areas. According to incomplete statistics, the number of electronic fences in the airspace of a medium-sized city can reach hundreds, while the number of electronic fences in the national airspace management system is in the tens of thousands.
[0003] In drone flight monitoring systems, both the ground control platform and the drone flight management system need to continuously monitor the positional relationship between each managed drone and all electronic fences to prevent drones from accidentally entering no-fly zones. This monitoring is usually conducted periodically, and each monitoring cycle requires calculating the spatial relationship between the drone's position and the boundaries of each electronic fence.
[0004] One existing method is the full-scale real-time detection method. This method performs precise geometric collision detection on all electronic fences defined in the system within each detection cycle. The system receives GNSS location information reported by drones and calculates the positional relationship between that location and the boundary of each electronic fence to determine whether a drone has intruded or is about to intrude into a no-fly zone. The drawback of this approach is its high computational complexity. As the number of electronic fences in the airspace increases, each detection cycle requires traversing all fences for calculation, placing a huge burden on the computing resources of the monitoring system. Taking a city's airspace management system as an example, when there are 1000 managed drones and 500 electronic fences, each detection cycle requires 500,000 distance calculations. When the number of drones or electronic fences further increases, the system's computational load grows linearly, easily leading to exhaustion of computing resources, system response delays, and affecting the real-time performance and reliability of monitoring.
[0005] Another existing technology is the spatial grid pre-screening method. Some technical solutions use spatial index structures (such as quadtrees and grid partitioning) to pre-screen electronic fences. First, the airspace is divided into several grids, and each grid is associated with a list of electronic fences it covers. Then, based on the grid where the drone is currently located, a small number of potentially relevant fences are quickly located, and only these fences are accurately detected. Although this solution reduces the number of fences detected in real time, it still has shortcomings: First, the grid partitioning granularity is fixed, making it difficult to adapt to the accuracy requirements of different scenarios; second, for fences that are far from the drone but still within the same grid, unnecessary accurate detection is still required; third, there is a lack of a dynamic scheduling mechanism for computing resources, making it impossible to adaptively adjust the detection frequency according to the level of risk; fourth, when the drone is near the grid boundary, it may need to query multiple adjacent grids, leading to a decrease in the pre-screening effect.
[0006] Another existing technology is the fixed-frequency detection method. Some systems use a fixed detection frequency to periodically detect all drones and all electronic fences. The drawback of this approach is that it cannot dynamically adjust the computational load according to the actual risk. Regardless of whether the drone is far from all fences or close to a particular fence, the system consumes the same computational resources, resulting in a serious waste of computational resources. Furthermore, in high-risk phases, a fixed frequency may be insufficient to cope with rapidly changing flight conditions.
[0007] In summary, existing technologies suffer from a trade-off between computational efficiency and real-time detection, making it difficult to achieve efficient and reliable collision avoidance detection in large-scale drone surveillance scenarios. There is an urgent need for a novel collision avoidance detection method that can dynamically allocate computing resources based on the actual spatial relationship and movement trends between the drone and the electronic fence.
[0008] It should be noted that the information disclosed in the background section above is only for understanding the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0009] The main objective of this invention is to overcome the deficiencies in the aforementioned background technology and provide an efficient anti-collision detection method for drone electronic fences based on distance priority and rolling calculation.
[0010] To achieve the above objectives, the present invention adopts the following technical solution: An efficient collision avoidance detection method for drone electronic fences based on distance priority and scrolling calculation includes the following steps: S1. Periodically calculate the current distance between the managed drone and the electronic fence, and dynamically divide each drone-fence pair into a high-frequency calculation area, a medium-frequency prediction area, or a low-frequency screening area according to the relationship between the current distance and the preset first distance threshold and second distance threshold. S2. For the UAV-fence pair that is divided into the high-frequency computing area, perform precise collision detection in the first detection cycle. The precise collision detection includes ray-polygon intersection detection, and determine whether to trigger an alarm based on the detection result. S3. For the drone-fence pair that is divided into the mid-frequency prediction zone, perform distance calculation with a second detection period that is longer than the first detection period, and determine whether to switch to the high-frequency calculation zone or the low-frequency screening zone based on the recalculated distance value. S4. For the drone-fence pair that is classified into the low-frequency screening zone, calculate an expiration time and skip all detection calculations within the expiration time. After the expiration time expires, recalculate the distance and re-classify the priority. Through the continuous cyclical execution of the above steps S1 to S4, dynamic switching between priority areas and continuous rolling monitoring of the entire area are achieved.
[0011] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned efficient anti-collision detection method for drone electronic fences based on distance priority and rolling calculation.
[0012] A computer program product includes a computer program that, when executed by a processor, implements the aforementioned efficient anti-collision detection method for drone electronic fences based on distance priority and rolling calculation.
[0013] The present invention has the following beneficial effects: This invention provides an efficient collision avoidance detection method for drone electronic fences based on distance priority and rolling calculation, effectively solving the contradiction between excessive computational load and difficulty in balancing computational efficiency and real-time detection caused by full-scale high-frequency detection in existing technologies. This method dynamically divides the drone into three priority zones—high-frequency, mid-frequency, and low-frequency—based on the actual spatial distance between the drone and the electronic fence, and employs differentiated detection cycles and calculation strategies for each zone. This achieves dynamic matching of computational resources and risk levels, making it particularly suitable for optimizing computational efficiency in large-scale drone monitoring scenarios.
[0014] Specifically, this invention places a large number of drone-fence pairs far from the electronic fence into a low-frequency screening zone with an expiration time. During the expiration time, all detection calculations are completely skipped, allowing the majority of the system's computing resources to be concentrated on a few potentially risky drone-fence pairs, thus significantly reducing the overall computing load. In city-level scenarios, the computing load is reduced by more than 99%, and in national-level scenarios, it is reduced by nearly 99.94%, significantly alleviating the computational pressure on the monitoring system. Simultaneously, the high-frequency calculation zone maintains high-frequency, accurate collision detection, using the ray-polygon intersection method to directly calculate the precise time it takes for a drone to reach the fence along its actual flight trajectory. Alarm thresholds are set based on braking distance, system latency, and safety margin to ensure timely triggering of obstacle avoidance commands in emergencies. The mid-frequency prediction zone periodically confirms distance change trends at a lower frequency, achieving a seamless transition from low-risk to high-risk, thereby improving efficiency while fully ensuring the real-time performance and safety of detection.
[0015] Furthermore, this invention employs a clear layered architecture design. The high-frequency zone is responsible for accurate collision detection and alarm judgment, the mid-frequency zone is responsible for periodic distance confirmation and area switching, and the low-frequency zone is responsible for expiration time management. Each zone has clearly defined responsibilities and is logically self-consistent. A hysteresis degradation mechanism (confirming a continuously increasing distance over multiple cycles while the flight direction does not point towards the fence) achieves smooth degradation, avoiding frequent switching due to distance fluctuations. Simultaneously, the early wake-up safety buffer time in the expiration time calculation formula fills the security loopholes in the low-frequency zone, forming a complete two-way state switching mechanism. All key parameters (such as the high-frequency zone boundary, mid-frequency zone boundary, and expiration time) are derived based on physical quantities such as the drone's maximum flight speed and maximum braking deceleration, without relying on empirical coefficients. It can adapt to different distance thresholds for different drone models, such as light, medium, and large drones, achieving an optimal balance between safety and efficiency under the premise of unified parameter derivation formulas. The entire method has clear logic and simple engineering implementation. It can be integrated and deployed into existing drone monitoring systems simply through a task scheduler, demonstrating good practical value and promising prospects for widespread adoption.
[0016] Other beneficial effects of the embodiments of the present invention will be further described below. Attached Figure Description
[0017] Figure 1 This is an overall flowchart of the efficient anti-collision detection method for drone electronic fences based on distance priority and rolling calculation according to an embodiment of the present invention.
[0018] Figure 2 This is a logic diagram for calculating the high-frequency region in an embodiment of the present invention.
[0019] Figure 3 This is a logic diagram for calculating the low-frequency region in an embodiment of the present invention. Detailed Implementation
[0020] The embodiments of the present invention will be described in detail below. It should be emphasized that the following description is merely exemplary and not intended to limit the scope and application of the present invention.
[0021] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of the present invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0022] This invention aims to address the problem of excessive computational load in drone-based electronic fence collision avoidance detection. It proposes a dynamic scheduling method based on distance priority and rolling computation. According to the distance between the drone and the fence, each pair is dynamically divided into three regions: high-frequency, medium-frequency, and low-frequency. Precise collision detection, periodic distance confirmation, and expired skip strategies are employed for each region, respectively, achieving adaptive matching of computational resources and risk levels. This significantly reduces the overall computational load while ensuring that emergency collision risks are detected promptly and obstacle avoidance is triggered. The rolling computation mentioned in this invention refers to dynamically and periodically adjusting the detection priority region of the drone based on changes in the real-time distance between the drone and the electronic fence, and applying a task scheduling mechanism with different detection frequencies and computational accuracies.
[0023] See Figures 1 to 3 This invention provides an efficient collision avoidance detection method for drone electronic fences based on distance priority and rolling calculation, comprising the following steps: Step S1: Periodically calculate the current distance between the managed drone and the electronic fence, and dynamically divide each drone-fence pair into a high-frequency calculation area, a medium-frequency prediction area, or a low-frequency screening area according to the relationship between the current distance and the preset first distance threshold and second distance threshold.
[0024] In some embodiments, the preset first distance threshold in step S1 is less than the second distance threshold, and the first distance threshold is derived based on the braking distance and safety margin of the UAV; wherein, the braking distance is calculated based on the maximum flight speed and maximum braking deceleration of the UAV by dividing the square of the speed by twice the deceleration; the first distance threshold is configured to be greater than the braking distance, specifically by multiplying the sum of the braking distance and the safety margin by a preset safety amplification factor to ensure that the UAV in the high-frequency computing area has a safe distance to complete braking.
[0025] In some embodiments, before performing the distance calculation in step S1, the electronic fence is pre-screened by establishing a spatial index structure. The list of potentially related electronic fences is quickly retrieved with the current drone location as the center and the second distance threshold as the radius, thereby reducing the number of drone-fence pairs for which distance needs to be calculated. Furthermore, for multiple drones existing in the system at the same time, a parallel computing architecture is adopted to allocate the detection tasks of each drone to different computing nodes or threads for execution. At the same time, for multiple drones associated with the same electronic fence, batch computing optimization is adopted to reduce the repeated reading of fence data.
[0026] Step S2: For the UAV-fence pair divided into the high-frequency computing area, perform precise collision detection in the first detection cycle. The precise collision detection includes ray-polygon intersection detection, and determine whether to trigger an alarm based on the detection results. See the detailed process below. Figure 2 .
[0027] In some embodiments, the precise collision detection in step S2 specifically includes the following sub-steps: S21. Construct a parameterized ray equation with the current position of the UAV as the starting point and the current velocity direction as the ray direction; S22. Calculate the intersection parameters of the ray and each side of the electronic fence polygon, and determine whether there are any valid intersection points with a value greater than zero; S23. If a valid intersection point exists, the smallest intersection point parameter is taken, and the estimated arrival time is calculated in combination with the speed of the UAV; if no valid intersection point exists, the estimated arrival time is determined to be infinite. S24. Compare the estimated arrival time with a pre-stored alarm time threshold. When the estimated arrival time is less than or equal to the alarm time threshold, it is determined that there is an emergency collision risk, alarm information is generated immediately and obstacle avoidance command is triggered. The alarm time threshold is composed of the maximum braking time of the UAV, the system response delay and the safety margin. The maximum braking time is the maximum flight speed divided by the maximum braking deceleration.
[0028] Step S3: For the drone-fence pair that is divided into the mid-frequency prediction zone, perform distance calculation with a second detection period that is longer than the first detection period, and determine whether to switch to the high-frequency calculation zone or the low-frequency screening zone based on the recalculated distance value.
[0029] In some embodiments, the second detection period in step S3 is a fixed integer multiple of the first detection period; correspondingly, the boundary of the intermediate frequency prediction region, i.e., the second distance threshold, is set based on the sum of the first distance threshold and the distance that the UAV can fly at its maximum flight speed in a single second detection period. This setting ensures that the UAV is detected at least once during the process of crossing the intermediate frequency prediction region.
[0030] In some embodiments, the processing mechanism of the intermediate frequency prediction region in step S3 specifically includes the following sub-steps: S31. At the arrival of each second detection cycle, recalculate the current distance between the drone and the electronic fence; S32. If the recalculated distance is less than the first distance threshold, the corresponding drone-fence pair is immediately upgraded to the high-frequency calculation area, and precise collision detection is then performed according to the first detection cycle. S33. If the recalculated distance is greater than or equal to the second distance threshold, it is downgraded to the low-frequency screening area, and the expiration time is recalculated according to step S4. S34. If the recalculated distance is between the first distance threshold and the second distance threshold, then maintain the current mid-frequency prediction zone state and wait for the next second detection cycle to perform the evaluation.
[0031] Step S4: For the drone-fence pair classified as part of the low-frequency screening zone, calculate an expiration time and skip all detection calculations within the expiration time. After the expiration time expires, recalculate the distance and re-prioritize. See the detailed process below. Figure 3 .
[0032] In some embodiments, the processing mechanism of the low-frequency screening region in step S4 specifically includes the following sub-steps: S41. The formula for calculating the expiration time is: the difference between the current distance and the second distance threshold is divided by the maximum flight speed of the drone, and then a preset early wake-up safety buffer time is subtracted. S42. When the calculated expiration time is less than or equal to zero, it is determined that the drone is very close to the second distance threshold boundary. The corresponding drone-fence pair does not enter the low-frequency skip state, but is directly included in the mid-frequency prediction area. S43. When the calculated expiration time is positive, start the timer and completely skip any distance calculation and collision detection for the drone-fence pair before the timer reaches zero. After the timer expires, the system automatically wakes up and recalculates the distance between the drone and the electronic fence, re-divides the priority area according to the new distance value, and enters the next round of rolling calculation cycle.
[0033] Through the continuous cyclic execution of the above steps S1 to S4, dynamic switching between priority regions and continuous rolling monitoring of the entire area are realized.
[0034] In some embodiments, the method further includes a hysteresis degradation mechanism, which is applied to the switching process from the high-frequency calculation region or the intermediate-frequency prediction region to a lower priority region: when it is determined according to the current distance detection result that the condition for degradation from the high-frequency calculation region or the intermediate-frequency prediction region is satisfied, the degradation operation is not performed immediately; instead, it is required to confirm through multiple consecutive detection cycles that the current distance continues to increase, and the ray-polygon intersection detection indicates that the flight direction of the drone does not point to the geofence (that is, the estimated arrival time is infinite). After the above conditions are continuously satisfied for a preset number of consecutive cycles, the degradation switching to the intermediate-frequency prediction region or the low-frequency screening region is performed, so as to avoid frequent oscillation of the priority region caused by distance measurement fluctuations or short flight disturbances.
[0035] The efficient anti-collision detection method for drone geofences based on distance priority and rolling calculation proposed by the present invention has the main technical advantages that, through the three-level priority partitioning and rolling calculation mechanism based on distance, computing resources are accurately focused on high-risk drone-fence pairs, and on the premise of ensuring that emergencies can be warned in time, the overall computing load can be reduced by more than 99%; at the same time, with the layered coordination of high-frequency accurate detection, intermediate-frequency periodic confirmation and low-frequency expiration skipping, as well as smooth switching strategies such as hysteresis degradation and early wake-up, real-time performance, safety and system efficiency are all considered, and the parameter derivation is physically verifiable, easy for engineering deployment and model adaptation, and suitable for large-scale drone supervision systems.
[0036] Examples of specific embodiments of the present invention and algorithm implementations are further described below.
[0037] An efficient anti-collision detection method for drone geofences based on distance priority and rolling calculation, comprising the following steps (for details, refer to Figure 1 the flow block diagram shown): Step 1: Distance calculation and priority division Obtain the real-time position information of all managed drones in the system, and the boundary definition data of all geofences in the airspace. For each drone, periodically calculate the minimum distance d between its current position and the boundary of each geofence. According to preset distance thresholds D1 and D2 (where D1<D2), each drone-fence pair is divided into three calculation priority regions: If d<D1, mark the drone-fence pair as a high-frequency calculation region; If D1≤d<D2, mark the drone-fence pair as an intermediate-frequency prediction region; If d≥D2, mark the drone-fence pair as a low-frequency screening region.
[0038] Physical meanings of the three regions: the high-frequency calculation region covers the short-range range that "must be detected accurately immediately"; the intermediate-frequency prediction region covers the medium-range range that "requires regular confirmation but is still relatively safe"; the low-frequency screening region covers the long-range range that "can be safely skipped".
[0039] Step 2: Accurate collision detection in the high-frequency calculation region For drone-fence pairs marked as the high-frequency calculation region, high-precision geometric collision detection is performed in each high-frequency detection period T_high (0.5s by default). The detection includes: judging whether the current position of the drone has entered the interior of the geofence; taking the current position of the drone as the starting point and the velocity direction as the ray direction, performing ray-polygon intersection detection to predict whether the drone will intersect with the fence boundary. The calculation logic is as Figure 2 shown in the figure.
[0040] An alarm time threshold T_alert is set in the high-frequency region. When the detected estimated time of arrival T_eta ≤ T_alert, it is determined as an emergency collision risk, alarm information is immediately generated and sent to the corresponding drone or ground control personnel to trigger a braking or obstacle avoidance instruction; the calculation formula of T_alert is: T_alert = v_max / a_max + t_latency + t_margin Where: v_max is the maximum flight speed of the drone; a_max is the maximum braking deceleration; v_max / a_max is the full-speed braking time; t_latency is the system response delay (including instruction issuance and communication round trip, which is measured and set according to the network environment and computing capacity of the actual system deployment, usually 0.5s~2.0s is available); t_margin is the safety margin (≥ 1s). T_alert represents the shortest response time "from threat detection to braking completion".
[0041] Step 3: Regular distance confirmation in the intermediate-frequency prediction region For drone-fence pairs marked as the intermediate-frequency prediction region, distance calculation is performed every N1 high-frequency detection periods, and it is judged whether the priority region needs to be switched according to the latest distance value.
[0042] The detection logic of the intermediate-frequency region is executed in three steps: ① If d<D1, upgrade to the high-frequency calculation region immediately; ② If d ≥ D2, downgrade back to the low-frequency screening region, recalculate and set T_expire; ③ Otherwise, maintain the state of the intermediate-frequency prediction region, and wait for the next N1 period for re-evaluation.
[0043] Design principle: In the intermediate frequency zone, only distance calculation and interval judgment are performed, and complex calculations such as ray intersection detection are not executed. All complex calculations are delegated to the high-frequency zone. The responsibilities of the intermediate frequency zone are: to confirm at a relatively low frequency whether the drone is still within the range of D1 to D2, timely detect the distance change trend, and provide an advance transition for the accurate detection in the high-frequency zone.
[0044] Step 4: Expiration time setting and rolling calculation for the low-frequency screening zone For the drone-geofence pair marked as the low-frequency screening zone, calculate its expiration time T_expire: T_expire = (d - D2) / v_max - ΔT Where d is the current minimum distance between the drone and the geofence, D2 is the boundary distance threshold of the intermediate frequency zone, v_max is the maximum flight speed of the drone, and ΔT is the safety buffer time for advance wake-up. This formula ensures that when the drone flies towards the geofence at the maximum speed, the detection is resumed ΔT seconds before reaching the D2 boundary, the distance is recalculated, and the priority is reclassified.
[0045] Within the T_expire period, the system completely skips any distance calculation and collision detection for this drone-geofence pair. After T_expire expires, the distance between the drone and the electronic geofence is recalculated, the priority is reclassified according to the new distance value, and the next rolling calculation cycle is entered. When d - D2 ≤ v_max × ΔT, T_expire ≤ 0, which indicates that the drone is already very close to the D2 boundary, and should not enter the low-frequency skip state, but be directly included in the intermediate frequency prediction zone. The calculation logic of the low-frequency zone is as Figure 3 shown.
[0046] Step 5: Priority zone state switching mechanism The present invention establishes clear trigger conditions for state switching between different priority zones: Low-frequency zone → Intermediate frequency zone: The distance is recalculated after T_expire expires, and if D1 ≤ d < D2, it is upgraded to the intermediate frequency zone; Low-frequency zone → High-frequency zone: The distance is recalculated after T_expire expires, and if d < D1, it is directly upgraded to the high-frequency zone; Intermediate frequency zone → High-frequency zone: When it is found during intermediate frequency detection that d < D1, it is immediately upgraded to the high-frequency zone; High-frequency zone → Intermediate frequency zone: When it is found during high-frequency zone detection that d ≥ D1 and d < D2, it is downgraded to the intermediate frequency zone; High-frequency zone → Low-frequency zone: When it is found during high-frequency zone detection that d ≥ D2, it is downgraded to the low-frequency zone, and T_expire is reset; Mid-frequency range → Low-frequency range: When mid-frequency detection is performed, if d ≥ D2, the frequency is downgraded to the low-frequency range, and T_expire is reset.
[0047] The degradation mechanism incorporates delayed confirmation: the system maintains a degradation confirmation counter for each "drone-fence pair," initially set to 0. After each distance detection, the system determines whether the pair meets the degradation conditions—that is, the current distance exceeds the degradation threshold, and the collision time is estimated to be infinite (no intersecting trajectories). If the detection meets the degradation conditions, the counter increments by 1; if not, the counter immediately resets to zero and restarts counting. Degradation is only performed when the counter accumulates to K_down (a value not less than 3), and the counter is then cleared. This means that degradation only occurs if all K_down consecutive detection cycles determine that degradation is possible. Any interruption (such as a drone briefly turning around or a temporary reduction in distance) will reset the counter, requiring it to accumulate again. If an upgrade operation is triggered before the counter reaches the threshold, the upgrade takes priority, and the counter is simultaneously cleared.
[0048] Step Six: Dynamic Adjustment of Rolling Calculation Cycle Steps one through five above constitute a rolling calculation cycle. The system continuously executes this cycle, but different priority areas use different update frequencies for the drone-fence pairs: High-frequency calculation area: updated once every high-frequency detection cycle T_high (0.5s); Mid-frequency prediction region: Updated every N1 high-frequency cycles (N1 = 5, i.e., every 2.5s); Low-frequency filtering zone: Updates are triggered only when the expiration time T_expire is reached.
[0049] Step 7: Optimization of Parallel Processing for Multiple UAVs For multiple drones operating simultaneously in the system, a parallel computing architecture is employed, distributing the detection tasks of each drone to different computing nodes or threads. Simultaneously, the spatial index structure of the electronic fence is shared to avoid redundant loading of fence data. For multiple drones associated with the same electronic fence, batch computing optimization is used to reduce the repeated reading of fence data.
[0050] Key parameter configuration (drone classification and distance threshold) This invention sets differentiated distance thresholds based on the flight performance of different UAVs to adapt to the flight characteristics and risk profiles of different models. Specific parameters are shown in the table below: Table 1: Key parameter configurations for different UAV types
[0051] Parameter derivation process (1) Braking distance s_brake The distance required for a drone to come to a complete stop from the start of braking when flying at its maximum speed v_max: s_brake = v_max 2 / (2 × a_max) Where v_max is the maximum flight speed of the drone, and a_max is the maximum braking deceleration.
[0052] (2) High-frequency region boundary D1 The physical meaning of D1 is "the distance at which precise detection must begin". The design constraint is that braking must be able to be completed in the high-frequency range without intruding into the fence, and sufficient safety margin must be maintained.
[0053] D1= (s_brake + d_safety) × 1.5 Where s_brake is the braking distance (see Formula 1), and d_safety is the GPS error margin (5m for light-duty vehicles, 8m for medium-duty vehicles, and 10m for large-duty vehicles). A coefficient of 1.5 is the safety amplification factor, ensuring that the high-frequency bandwidth is 1.5 times the sum of the braking distance and the error margin, providing sufficient buffer space for the braking process. The above coefficient values are optimal values verified through actual testing and can be adjusted according to the actual system performance.
[0054] (3) Intermediate frequency detection interval N1 N1 is the intermediate frequency detection interval coefficient, which is fixed at N1 = 5, meaning that distance calculation is performed once every 5 high-frequency cycles (every 2.5s) in the intermediate frequency region. This value is an engineering design parameter designed to achieve a balance between detection reliability and computational efficiency, and can be adjusted according to the actual system performance and application scenario.
[0055] The intermediate frequency detection period is N1 × T_high = 5 × 0.5s = 2.5s. During this period, the system does not update the drone's motion status. After 2.5s, the distance is recalculated and it is determined whether a priority area switch is needed.
[0056] (4) Mid-frequency region boundary D2 The design goal of D2 is to ensure that the width of the intermediate frequency range is not less than the maximum flight distance of the UAV within one intermediate frequency detection cycle, so as to ensure that the UAV is detected at least once when it crosses the intermediate frequency range.
[0057] D2 = D1 + v_max × N1 × T_high Where N1 × T_high = 2.5s is the intermediate frequency detection period. D2 is longer than D1 by "the distance the drone travels at its maximum speed for 2.5 seconds" - which is exactly the maximum possible displacement within an intermediate frequency detection period, ensuring that it is detected at least once.
[0058] (5) Low-frequency zone expiration time T_expire T_expire = (d - D2) / v_max - ΔT Ensure that detection resumes ΔT seconds before reaching the D2 boundary, where ΔT can be set according to the model and can be adjusted according to the actual scenario.
[0059] Parameter verification The following verifies whether all parameters meet the safety constraints: Table 2: Parameter Verification
[0060] Specific calculation method (1) Calculation of the closest distance between the drone and the electronic fence For a polygonal electronic fence, the formula for calculating the minimum distance d from the drone's location point P(x0, y0, z0) to the polygon boundary is: d = min(||P - V_i||, distance(P, edge_i)) Where V_i are the vertices of the polygon, and edge_i are the edges of the polygon.
[0061] (2) Ray-Polygon Intersection Detection Algorithm Parametric ray equation: P(t) = P0 + t × v̂ (t ≥ 0), where P0 is the UAV position and v̂ is the unit vector of velocity direction. For each edge of the fence polygon [A i A i+1 Solve for the intersection parameter t_hit of the ray and the line segment. If a valid intersection point exists (t_hit>0), take t_min = min(t_hit), then T_eta = t_min / |v|. If no valid intersection point exists, T_eta = ∞.
[0062] (3) Calculation of estimated arrival time T_eta = t_min / |v| (when a valid intersection exists) T_eta = ∞ (when the ray does not intersect the fence) (4) Braking distance calculation s_brake = v 2 / (2 × a_max) Where: v is the current flight speed; a_max is the maximum braking deceleration.
[0063] (5) Safe braking judgment conditions The conditions under which a drone can safely land without intruding into an electronic fence are: d_current > s_brake + d_safety Where d_current is the current distance and d_safety is the safety margin.
[0064] (6) Calculate load quantization The system's average computational load L_avg can be expressed as: L_avg = Σ (N_pair,i × f_i × C_i) Where: N_pair,i is the number of drone-fence pairs in the i-th priority region; f_i is the detection frequency of this region; C_i is the computational complexity of performing one collision detection.
[0065] Compared with traditional full-scale detection methods, the computational load reduction rate η of the method of this invention is: η = (L_full - L_dynamic) / L_full × 100% Case study: City-level drone monitoring scenario Scene setting Number of drones under management: 500 (a mix of types, including light, medium and large).
[0066] Number of electronic fences: 200 (including airport no-fly zones, government buildings, hospitals, schools, etc.) The high-frequency detection period T_high = 0.5s.
[0067] Computing resources: 8-core server, using a parallel processing architecture.
[0068] Step 1: System Initialization Upon system startup, the boundary definition data for all electronic fences is loaded, and an R-tree spatial index is created for each electronic fence. Based on the model of each drone, a corresponding distance threshold parameter is assigned. Lightweight UAVs (200 units): v_max = 15 m / s, a_max = 5 m / s 2 , s_brake=22.5m, D1=41m, D2=79m, ΔT=2s.
[0069] Medium UAVs (250 units): v_max=25m / s, a_max=6m / s 2 , s_brake=52.1m, D1=90m, D2=153m, ΔT=3s.
[0070] Large UAVs (50 units): v_max=40m / s, a_max=4m / s 2 , s_brake=200m, D1=315m, D2=415m, ΔT=5s.
[0071] Step 2: First-round distance calculation The system receives real-time position information of all UAVs, and quickly filters potentially relevant geofences through R-tree spatial index. For each UAV, a list of geofences with the query radius D2 is generated centering on its own position.
[0072] Step 3: Priority division and rolling calculation High-frequency calculation zone (d<D1): accounting for approximately 2% of the total query volume, detection is performed once every 0.5s.
[0073] Medium-frequency prediction zone (D1≤ d<D2): accounting for approximately 8% of the total query volume, detection is performed once every 2.5s.
[0074] Low-frequency screening zone (d ≥ D2): accounting for 90% of the total query volume, skipped according to T_expire.
[0075] Step 4: Example of dynamic switching of priority zones A medium UAV flies towards the airport no-fly zone, with the distance gradually decreasing from 500m: d=500m ≥ D2=153m → low-frequency zone, T_expire=(500-153) / 25-3=10.9s.
[0076] When T_expire expires, the distance is recalculated as d=120m → D1≤ d<D2, upgraded to the medium-frequency zone.
[0077] The medium-frequency zone performs detection once every 2.5s: d=95m → remain in the medium-frequency zone; d=85m → d<D1, upgraded to the high-frequency zone.
[0078] The high-frequency zone performs detection once every 0.5s, and executes ray-polygon intersection calculation: T_eta=3.2s ≤ T_alert=6s → alert.
[0079] Step 5: Calculation load statistics Full detection method: 500×200=100,000 calculations are required per cycle.
[0080] The method of this invention: approximately 100 high frequencies per 0.5 seconds + approximately 40 mid frequencies per 2.5 seconds + approximately 50 low frequencies per cycle ≈ 270 cycles per cycle. Calculate the load reduction rate: η = (100,000 - 270) / 100,000 × 100% ≈ 99.73% Example 2: National-level airspace management system scenario Scene setting Number of drones under management: 10,000 (nationwide).
[0081] Number of electronic fences: 5,000 (including all types of no-fly zones and restricted areas nationwide).
[0082] Distributed architecture, deploying 100 computing nodes, T_high = 0.5s.
[0083] Computational load analysis Theoretical calculation of full-volume testing method: 10,000 × 5,000 = 50,000,000 times / cycle.
[0084] The method of this invention is approximately 10,000 high-frequency cycles + approximately 5,000 mid-frequency cycles + approximately 250 low-frequency cycles, totaling approximately 15,250 cycles per cycle.
[0085] Computational load reduction rate: η ≈ 99.94%; the number of servers was reduced from 500 to 100, resulting in an annual operating cost reduction of approximately 80%.
[0086] In summary, this invention provides an efficient collision avoidance detection method for drone electronic fences based on distance priority and rolling calculation. This method dynamically divides the drone into three priority zones—high-frequency, mid-frequency, and low-frequency—by comparing the real-time distance between the drone and the electronic fence with preset dual thresholds. Different detection cycles and calculation strategies are configured for each zone: the high-frequency zone performs precise collision detection and real-time alarms; the mid-frequency zone periodically confirms distance changes at a lower frequency to complete zone switching; and the low-frequency zone has an expiration time and completely skips calculations within that time. Through continuous rolling and collaborative operation of each zone, adaptive matching of computing resources and flight risk levels is achieved, significantly reducing the overall computational load of the system while ensuring timely response to emergency collisions.
[0087] Compared with the prior art, the significant advantages of the present invention are reflected in the following aspects: 1. Significantly Reduced Computational Load: By placing a large number of remote drone-fence pairs into a low-frequency screening zone and setting expiration times, the system only needs to process a few potentially risky pairs most of the time, avoiding meaningless full-scale computation. This reduces computational load by 99.73% in city-level scenarios and 99.94% in national-level scenarios. To further illustrate the superiority of this method, it is compared with the "spatial grid pre-screening method." The spatial grid pre-screening method divides the airspace into fixed grids and performs precise calculations only on drone-fence pairs within the same or adjacent grids. This reduces the number of precise calculations per cycle from 100,000 to approximately 5,000–10,000 (assuming drones and fences are uniformly distributed in the airspace, with a grid coverage hit rate of approximately 5%–10%). However, this method has two inherent costs: first, it requires performing grid attribution queries for all 100,000 pairs, an operation that, while lightweight, is indispensable; second, there is a tension between grid granularity and the real-time nature of dynamic spatial domains—too coarse a grid introduces false positives and false negatives, while too fine a grid increases index maintenance costs. In contrast, this invention employs a distance-based three-zone layering mechanism. In a typical city-level scenario (1,000 drones, 100 fences), approximately 54 pairs enter the high-frequency zone, approximately 216 pairs enter the mid-frequency zone, and only expired pairs need to be processed per cycle in the low-frequency zone. The total precise computation is approximately 270 times per cycle, which is still about 95%–97% lower than the 5,000–10,000 times required by the spatial grid pre-screening method. Furthermore, this invention does not require maintaining a grid index structure; state management relies solely on the distance value and counter for each pair, resulting in constant memory usage and insensitivity to sudden changes in drone density and fence shape complexity.
[0088] 2. Balancing real-time detection with security: The high-frequency calculation area maintains a precise detection frequency of 0.5 seconds, and uses the ray-polygon intersection method to directly calculate the precise time when the UAV arrives at the fence along the actual flight trajectory; the mid-frequency prediction area periodically confirms the distance change trend, achieving a seamless transition from low risk to high risk.
[0089] 3. Clearly layered architecture design: The high-frequency zone is responsible for accurate collision detection and alarm judgment (T_eta ≤ T_alert), the mid-frequency zone is responsible for periodic distance confirmation and zone switching, and the low-frequency zone is responsible for expiration time management. Each zone has clearly defined responsibilities, does not overlap with each other, and has simple and self-consistent logic.
[0090] 4. Physically Verifiable Parameter Derivation: All parameters (D1, D2, T_expire) have complete physical derivation processes and do not rely on empirical coefficients. D1 is derived from the braking distance, and D2 is derived from the mid-frequency detection cycle constraint. The three constraints can be cross-verified to ensure the logical self-consistency of the parameter configuration.
[0091] 5. Complete bidirectional state switching mechanism: Smooth degradation is achieved through a delayed degradation mechanism (continuous K_down cycle confirmation), ensuring that computing resources are automatically released as the risk decreases; the early wake-up mechanism fills the security vulnerabilities in the low-frequency area, complementing the ΔT security buffer.
[0092] 6. Excellent aircraft compatibility: By setting differentiated distance thresholds for light, medium, and large drones, the system ensures that each model achieves an optimal balance between safety and efficiency. The parameter derivation formulas are standardized; only the input values differ.
[0093] 7. Simple engineering implementation: The entire logic can be easily implemented through a task scheduler without complex hardware modifications, and it is easy to integrate and deploy on existing drone monitoring systems.
[0094] This invention also provides a storage medium for storing a computer program, which, when executed, performs at least the methods described above.
[0095] This invention also provides a control device, including a processor and a storage medium for storing a computer program; wherein the processor executes the computer program by performing at least the method described above.
[0096] This invention also provides a processor that executes a computer program, at least performing the methods described above.
[0097] The storage medium can be implemented by any type of non-volatile storage device, or a combination thereof. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc or CD-ROM; magnetic surface memory can be disk storage or magnetic tape storage. The storage media described in the embodiments of this invention are intended to include, but are not limited to, these and any other suitable types of memory.
[0098] In the several embodiments provided by this invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0099] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0100] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0101] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0102] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0103] The methods disclosed in the several method embodiments provided by this invention can be arbitrarily combined without conflict to obtain new method embodiments.
[0104] The features disclosed in the several product embodiments provided by this invention can be arbitrarily combined without conflict to obtain new product embodiments.
[0105] The features disclosed in the several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0106] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various equivalent substitutions or obvious modifications can be made without departing from the concept of the present invention, and all such modifications, achieving the same performance or application, should be considered within the scope of protection of the present invention.
Claims
1. A highly efficient collision avoidance detection method for drone electronic fences based on distance priority and rolling calculation, characterized in that, Includes the following steps: S1. Periodically calculate the current distance between the managed drone and the electronic fence, and dynamically divide each drone-fence pair into a high-frequency calculation area, a medium-frequency prediction area, or a low-frequency screening area according to the relationship between the current distance and the preset first distance threshold and second distance threshold. S2. For the UAV-fence pair that is divided into the high-frequency computing area, perform precise collision detection in the first detection cycle. The precise collision detection includes ray-polygon intersection detection, and determine whether to trigger an alarm based on the detection result. S3. For the drone-fence pair that is divided into the mid-frequency prediction zone, perform distance calculation with a second detection period that is longer than the first detection period, and determine whether to switch to the high-frequency calculation zone or the low-frequency screening zone based on the recalculated distance value. S4. For the drone-fence pair that is classified into the low-frequency screening zone, calculate an expiration time and skip all detection calculations within the expiration time. After the expiration time expires, recalculate the distance and re-classify the priority. Through the continuous cyclical execution of the above steps S1 to S4, dynamic switching between priority areas and continuous rolling monitoring of the entire area are achieved.
2. The method as described in claim 1, characterized in that, In step S1, the preset first distance threshold is less than the second distance threshold, and the first distance threshold is derived based on the braking distance and safety margin of the UAV; wherein, the braking distance is calculated based on the maximum flight speed and maximum braking deceleration of the UAV by dividing the square of the speed by twice the deceleration; the first distance threshold is configured to be greater than the braking distance, specifically by multiplying the sum of the braking distance and the safety margin by a preset safety amplification factor to ensure that the UAV in the high-frequency calculation area has a safe distance to complete braking.
3. The method as described in claim 1, characterized in that, The precise collision detection described in step S2 specifically includes: A parameterized ray equation is constructed, with the current position of the UAV as the starting point and the current velocity direction as the ray direction. Calculate the intersection parameters of the ray and each side of the electronic fence polygon, and determine whether there are any valid intersection points with a value greater than zero; If a valid intersection point exists, the smallest intersection point parameter is taken, and the estimated arrival time is calculated based on the drone's speed; if no valid intersection point exists, the estimated arrival time is determined to be infinite. The estimated arrival time is compared with a pre-stored alarm time threshold. When the estimated arrival time is less than or equal to the alarm time threshold, it is determined that there is an emergency collision risk, an alarm message is immediately generated, and an obstacle avoidance command is triggered. The alarm time threshold is composed of the UAV's maximum braking time, system response delay, and safety margin. The maximum braking time is the maximum flight speed divided by the maximum braking deceleration.
4. The method as described in claim 1, characterized in that, In step S3, the second detection period is a fixed integer multiple of the first detection period; correspondingly, the boundary of the intermediate frequency prediction zone, i.e., the second distance threshold, is set based on the sum of the first distance threshold and the distance that the UAV can fly at its maximum flight speed in a single second detection period. This setting ensures that the UAV is detected at least once during the process of crossing the intermediate frequency prediction zone.
5. The method as described in claim 1, characterized in that, The processing mechanism for the intermediate frequency prediction region in step S3 specifically includes: At the beginning of each second detection cycle, the current distance between the drone and the electronic fence is recalculated; If the recalculated distance is less than the first distance threshold, the corresponding drone-fence pair is immediately upgraded to the high-frequency computing area, and precise collision detection is then performed according to the first detection cycle. If the recalculated distance is greater than or equal to the second distance threshold, it is downgraded to the low-frequency screening area, and the expiration time is recalculated according to step S4. If the recalculated distance is between the first distance threshold and the second distance threshold, the current mid-frequency prediction zone state is maintained, and the evaluation is performed again in the next second detection cycle.
6. The method as described in claim 1, characterized in that, The processing mechanism for the low-frequency screening area in step S4 specifically includes: The formula for calculating the expiration time is: the difference between the current distance and the second distance threshold is divided by the maximum flight speed of the drone, and then a preset early wake-up safety buffer time is subtracted. When the calculated expiration time is less than or equal to zero, it is determined that the drone is very close to the second distance threshold boundary. The corresponding drone-fence pair does not enter the low-frequency skip state, but is directly included in the mid-frequency prediction zone. When the calculated expiration time is positive, the timer is started, and all distance calculations and collision detections for the drone-fence pair are completely skipped before the timer reaches zero. After the timer expires, the system automatically wakes up and recalculates the distance between the drone and the electronic fence, re-divides the priority area according to the new distance value, and enters the next round of rolling calculation cycle.
7. The method as described in claim 1, characterized in that, The method also includes a hysteresis degradation mechanism applied to the switching process from the high-frequency computing region or the mid-frequency prediction region to a lower priority region: When the current distance detection result determines that the conditions for downgrading from the high-frequency calculation area or the mid-frequency prediction area are met, the downgrading operation is not performed immediately. Instead, it requires multiple consecutive detection cycles to confirm that the current distance is continuously increasing, and the ray-polygon intersection detection indicates that the UAV's flight direction is not pointing towards the electronic fence. Only after the above conditions are met for a preset number of consecutive cycles will a downgrade switch to the mid-frequency prediction area or the low-frequency screening area be executed, in order to avoid frequent oscillations in the priority area caused by distance measurement fluctuations or brief flight disturbances.
8. The method as described in claim 1, characterized in that, Before performing the distance calculation in step S1, the electronic fence is pre-screened using the established spatial index structure. The list of potentially related electronic fences is quickly retrieved with the current drone location as the center and the second distance threshold as the radius, thereby reducing the number of drone-fence pairs for which distance needs to be calculated. Furthermore, for multiple drones existing in the system at the same time, a parallel computing architecture is adopted to allocate the detection tasks of each drone to different computing nodes or threads for execution. At the same time, for multiple drones associated with the same electronic fence, batch computing optimization is adopted to reduce the repeated reading of fence data.
9. A computer-readable storage medium storing a computer program, characterized in that, The computer program, when executed by a processor, implements the method as described in any one of claims 1 to 8.
10. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the method as described in any one of claims 1 to 9.
