A method for calculating the dynamic yaw threshold of unmanned aerial vehicles based on multiple features
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-12
- Publication Date
- 2026-08-14
AI Technical Summary
[0007]在上述多因素交织影响下,若仍采用统一的静态偏航阈值,系统往往无法有效区分“暂时性、可接受的轨迹波动”与“实质性、危险的航线偏离”
(1)动态适应性:相比固定阈值,本方法能根据环境与任务实时调整,提升飞行安全性。
Smart Images

Figure CN122570844A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of UAV yaw threshold calculation technology, and more specifically to a method for calculating the dynamic yaw threshold of UAVs based on multiple features. Background Technology
[0002] The yaw warning function for drones is a key safety mechanism in the flight management system, primarily used to monitor in real time whether the drone deviates from the predetermined planned flight path during flight. Once an abnormal deviation is detected, the system will trigger an alarm and report the yaw information to the air traffic control system or ground control station so that operators can intervene in a timely manner. The core objective of this function is to ensure flight safety, improve mission execution efficiency, and effectively prevent risks such as loss of control, collisions, or mission failures caused by flight path deviations.
[0003] Currently, conventional drone yaw alarms mostly employ a static fixed threshold triggering mechanism. Specifically, the system continuously calculates the lateral and longitudinal distances between the drone's actual position and the planned flight path. If the deviation in either direction exceeds a preset fixed allowable range, it is determined to be a yaw and an alarm is generated. This fixed threshold-based judgment method is simple and easy to implement, and was widely used in the past.
[0004] However, with the continuous expansion of drone application scenarios and the increasing complexity of flight environments, the limitations of the fixed threshold method are becoming increasingly apparent. Drones are subject to numerous interference factors in actual flight, primarily including: Environmental dynamics, such as sudden changes in wind speed and direction, atmospheric turbulence, and differences in airflow at different altitudes, can all cause temporary, recoverable attitude deviations and trajectory fluctuations in drones.
[0005] Changes in the drone's own condition: For example, a decrease in battery power may lead to unstable power output, instantaneous sensor errors, or differences in the response characteristics of the flight control system under different loads, all of which will affect its trajectory tracking accuracy.
[0006] Diversity of tasks and scenarios: Different tasks have different requirements for flight path accuracy. For example, logistics transportation may allow a certain degree of deviation tolerance during the cruise phase, while surveying and inspection, aerial photography, or formation flying require extremely high positioning accuracy. In addition, the logic for judging yaw should also differ from that in open areas during takeoff and landing or when flying in complex urban areas.
[0007] Under the combined influence of the aforementioned factors, if a uniform static yaw threshold is still used, the system often cannot effectively distinguish between "temporary, acceptable trajectory fluctuations" and "substantial, dangerous course deviations." This leads to two typical problems: First, the false alarm rate increases, meaning that UAVs frequently trigger unnecessary alarms when responding to environmental interference or performing maneuvers, which not only interferes with air traffic control scheduling but may also cause alarm fatigue among operators; second, there is a risk of missed alarms, as in some scenarios requiring strict track maintenance, the fixed threshold may be too lenient, failing to identify potential risk deviations in a timely manner.
[0008] Although the industry has made some attempts to improve this, such as switching different thresholds according to flight phases (e.g., takeoff, cruise, landing) or introducing simple speed adaptive adjustments, these methods still fail to fully and in real time take into account the multi-dimensional characteristics of the environment, UAV status and mission requirements, and the fineness and dynamic adaptability of threshold adjustment are insufficient.
[0009] Therefore, there is an urgent need for a method that can integrate multi-dimensional real-time features and dynamically calculate yaw alarm thresholds to improve alarm accuracy, adapt to complex flight environments and diverse mission requirements, and thus truly achieve safe, efficient and reliable UAV flight management. Summary of the Invention
[0010] To overcome the shortcomings of the existing technology, this invention discloses a multi-feature-based method for calculating the dynamic yaw threshold of unmanned aerial vehicles (UAVs). This invention combines extensive historical flight data with machine learning techniques to achieve adaptive dynamic adjustment of the UAV yaw threshold. The method comprehensively considers multiple key features such as wind speed, battery level, and task priority. Utilizing the XGBoost model's machine learning approach, it calculates the influence factors of each feature on the yaw threshold and ultimately generates a dynamic yaw threshold adapted to different flight environments, thereby improving the flight safety and mission execution efficiency of the UAV.
[0011] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A method for calculating the dynamic yaw threshold of a UAV based on multiple features includes the following steps: I. Data Collection and Preprocessing S1. Collect historical flight data of the UAV and perform data preprocessing; wherein, the data preprocessing includes data cleaning and feature engineering of the historical flight data of the UAV, screening out key features including wind speed, battery level, and task priority, and constructing derived features. Preferably, the historical flight data of the UAV includes real-time sensor data during the planned flight phase of the UAV, specifically including: environmental parameters, flight status parameters, equipment status parameters, and mission parameters.
[0012] Preferably, in step S1, the data cleaning includes: removing outliers, filling in missing values, and performing normalization or standardization processing.
[0013] Preferably, in step S1, the feature engineering includes: selecting key features and constructing derived features based on the UAV model and flight mission characteristics in the UAV's historical flight data; wherein the key features include wind speed, battery level, and mission priority, and the derived features include wind speed change rate, battery level decay rate, and mission priority index.
[0014] Preferably, in step S1, the data preprocessing further includes: dividing the cleaned and feature-engineered UAV historical flight data into a training set, a validation set, and a test set according to a certain proportion; the training set is used to train the subsequently constructed machine learning model, the validation set is used to adjust the model hyperparameters and prevent overfitting during the training process, and the test set is used to evaluate the final generalization performance of the model.
[0015] Preferably, the data preprocessing further includes: performing time alignment and fusion on multi-source heterogeneous sensor data, uniformly converting the timestamps of all sensor data to millisecond-level precision, and establishing a global time axis based on the highest sampling rate; filling low-frequency data to high-frequency moments using linear interpolation or spline interpolation, performing forward padding on discrete event data, compensating for missing intervals using state estimation based on Kalman filtering for data with transmission delays or packet loss, and generating a quality flag bit for each aligned data point.
[0016] Preferably, the outlier removal in the data preprocessing adopts an intelligent anomaly detection strategy based on unsupervised learning, including: using isolated forest to identify global outliers, using DBSCAN clustering to detect local density anomalies, using autoencoder reconstruction error to discover nonlinear anomaly patterns, and using local anomalous integration or sliding window difference anomaly detection for time series variables; median filtering or nearest neighbor interpolation is used to correct the detected isolated point anomalies, continuous anomaly intervals are marked as missing and transferred to the missing value processing flow, and the original data is retained for device-level anomalies and an anomaly marker feature column is added.
[0017] Preferably, the construction-derived features further include at least one of the following: The yaw stability index is constructed and defined as the absolute value of the difference between the measured yaw rate and the commanded yaw rate, divided by the airspeed and multiplied by the wind speed. The energy efficiency ratio is calculated by dividing the product of the number of yaw corrections and the average correction magnitude by the power consumed by the battery. Construct the gust impact factor and calculate the ratio of short-term average wind speed to long-term average wind speed; Construct a task-power coupling risk coefficient, taking into account priority, the exponential decay term of battery power, and the wind speed change rate.
[0018] Preferably, the data preprocessing further includes a sliding window segmentation and data augmentation strategy: setting the time window length and sliding step size, each window contains all sensor sequence data, the label is defined as the actual yaw threshold of the time step after the end of the window, and the task change point is forced as the window boundary; in terms of data augmentation, Gaussian noise is added to the wind speed sequence within the window, the wind speed and yaw error sequences are randomly stretched or compressed on the time axis, and the time-series-SMOTE method is used to interpolate rare working condition samples in the feature space to generate new samples, while constraining the consistency of the time order of the generated samples.
[0019] Preferably, the data partitioning in the data preprocessing adopts a hierarchical adaptive partitioning strategy: several scene categories are combined according to wind speed level, priority level and power stage, and training set, validation set and test set are divided in time order within each scene category; leave-one-out validation is used for scenes with very few samples, and an additional test set outside the scene is set; the entire continuous flight mission is used as the basic partitioning unit, and it is prohibited to divide the data of the same mission into the training set and test set at the same time.
[0020] II. Model Development and Training S2. Construct a machine learning model for calculating the dynamic yaw threshold of the UAV, and train the model by taking the preprocessed historical flight data of the UAV as input and the UAV yaw threshold as output. Preferably, in step S2, the machine learning model for calculating the UAV dynamic yaw threshold adopts the XGBoost model, and a supervised learning or time-series prediction model is selected according to the data characteristics; the input features for model training include: wind speed, battery level, and task priority; the output target is the UAV yaw threshold.
[0021] Preferably, in step S2, the UAV dynamic yaw threshold calculation function in the UAV dynamic yaw threshold calculation machine learning model is:
[0022] in, Yaw threshold refers to the maximum allowable yaw angle error or correction response threshold for a drone during flight. The smaller the threshold, the stricter the control; the larger the threshold, the looser the control. Wind speed; P represents battery level; P represents mission priority, the more critical the mission, the higher the requirements for flight stability. This is the baseline yaw threshold, which is the yaw threshold under no wind, full battery, and default priority conditions. These are the influencing factor functions for wind speed, power consumption, and priority, respectively. This indicates the scaling factor relative to the baseline yaw threshold; The influencing factor functions for wind speed, power consumption, and priority are as follows:
[0023]
[0024]
[0025] In the formula, To adjust the parameters; The power consumption impact coefficient; This is the priority influence coefficient.
[0026] Preferably, embedded feature selection is applied during model building and optimization, including: calculating the feature importance score of each input feature, deleting features with a score of zero as irrelevant variables, retraining the model based on the updated feature subset, and optimizing the hyperparameter combination of the model using a Bayesian automatic optimization algorithm.
[0027] III. Model Evaluation and Optimization S3. Use evaluation metrics to assess and optimize the capabilities of the trained model; Preferably, step S3 includes: evaluating the capabilities of the trained UAV dynamic yaw threshold calculation machine learning model according to the evaluation metrics, and optimizing the UAV dynamic yaw threshold calculation machine learning model based on the evaluation results, with the optimization objective being to minimize the prediction error.
[0028] Preferably, in step S3, the capability assessment uses at least one of the following assessment indicators: standard deviation (SD), mean square error (MSE), root mean square error (RMSE), correlation coefficient (R), or coefficient of determination (R²). 2 .
[0029] Preferably, in step S3, the standard deviation SD is:
[0030] The root mean square error (RMSE) is:
[0031] The correlation coefficient R is:
[0032] The determination coefficient R 2 for:
[0033] Where i is the number of data points. For the i-th data point, The average value of the dataset. The actual value of the target feature. Let N be the predicted value of the target feature, and N be the sample size. This represents the average value of the actual target characteristics. To predict the mean of the target feature, RSS is the residual sum of squares, which is the sum of the squared differences between the predicted and actual values of the dependent variable, and TSS is the total sum of squares, which is the sum of the squared differences between the actual value and the mean of the dependent variable.
[0034] Preferably, in step S3, the optimization adopts the Bayesian automatic optimization algorithm, using the root mean square error obtained by cross-validation as the optimization objective function, and automatically searches the design space of the model hyperparameters; Diagnose whether the model is underfitting or overfitting by analyzing the loss function curves on the training and validation sets, and adjust the key parameters of the Bayesian optimization algorithm accordingly to obtain the optimal combination of hyperparameters.
[0035] IV. Model Deployment S4. Deploy the optimized model in the airspace controller. The model uses real-time multi-feature data to calculate the dynamic yaw threshold of the UAV.
[0036] Preferably, step S4 includes: encapsulating the optimized UAV dynamic yaw threshold calculation machine learning model into a REST API for real-time calls by the airspace controller, and deploying it at the edge to calculate the UAV dynamic yaw threshold in conjunction with streaming data processing.
[0037] Preferably, step S4 includes: The machine learning model for calculating the dynamic yaw threshold of the UAV dynamically adjusts and calculates the yaw threshold of the UAV based on real-time sensor data. The machine learning model for calculating the dynamic yaw threshold of drones flexibly adjusts the threshold setting strategy based on task priority.
[0038] Preferably, step S4 includes: continuous learning and updating of the machine learning model for calculating the UAV dynamic yaw threshold, including: An online learning mechanism is adopted to adapt the dynamic yaw threshold calculation of UAVs to the new flight environment; Regularly transmit flight data and iteratively optimize the machine learning model for calculating the dynamic yaw threshold of the UAV.
[0039] Preferably, in step S4, model deployment also includes model lightweighting and accelerated inference: feature importance pruning is performed on the trained UAV dynamic yaw threshold calculation machine learning model to remove redundant features with a contribution value lower than the set threshold; 8-bit integer quantization is used to replace floating-point parameters, and operator fusion and computation graph optimization are combined to make the inference latency reach the millisecond level.
[0040] Preferably, in step S4, the model deployment adopts an edge-cloud collaborative architecture: a lightweight model copy is deployed on the edge spatial controller for real-time inference, and the complete model or integrated model is deployed on the cloud. The cloud periodically receives summary and abnormal data back from the edge and performs offline retraining or incremental updates.
[0041] Preferably, in step S4, the model deployment also has a three-level fault tolerance and degradation mechanism: the latest model in the edge cache is used for inference first; if the model loading fails, it automatically switches to analytical threshold calculation based on physical formulas and outputs a safe and conservative threshold according to real-time wind speed, power consumption and priority; if the sensor fails momentarily, the current state is predicted by Kalman filtering based on the historical time series and then input into the model.
[0042] Preferably, in step S4, the model deployment adopts an online learning pipeline with drift detection: the edge airspace controller caches the flight characteristics and actual yaw error data in the most recent time window in real time, and uses a sliding window to calculate the cumulative distribution of the model prediction deviation; when a change in data distribution is detected and the deviation exceeds a preset threshold, a lightweight online update is triggered, the FTRL algorithm is used to fine-tune the weights of the leaf nodes of the last few decision trees of the model, and the model is fully deployed after verification by A / B testing.
[0043] Preferably, in step S4, when the model is deployed in a multi-drone collaborative scenario, a federated learning framework is adopted: each airspace controller locally uses its own flight data to calculate the model gradient update, and only encrypts and uploads the gradient to the cloud aggregation server. After the cloud forms a global augmented model, it is distributed to each edge node to improve the model generalization capability across regions and aircraft types.
[0044] Preferably, in step S4, model deployment also includes security verification and adversarial defense of input features: range verification is performed on the input features of real-time wind speed and battery power. If the input features exceed three times the interquartile range of the training set distribution, an anomaly flag is triggered and the system reverts to a conservative physical threshold. During edge-cloud communication, Laplacian noise is added using integrated differential privacy technology to prevent the model interface from being maliciously probed or the model parameters from being reverse-engineered.
[0045] The beneficial effects of this invention are: (1) Dynamic adaptability: Compared with a fixed threshold, this method can adjust in real time according to the environment and mission, thereby improving flight safety.
[0046] (2) Data-driven: Based on massive flight data training, it is more accurate than traditional empirical formulas.
[0047] (3) Scalability: It supports different drone models and mission scenarios, and can be adapted simply by adjusting the training data.
[0048] (4) Real-time decision-making: Low-latency computing to meet the rapid response requirements of UAVs during high-speed flight.
[0049] (5) Wide range of applications.
[0050] Logistics drones: Dynamically adjust yaw tolerance range under complex weather conditions to avoid crashes.
[0051] Inspection drones: Optimize flight paths based on remaining battery power to ensure safe return.
[0052] Military drones: Adjust obstacle avoidance strategies flexibly when flying in enemy territory, based on mission priorities.
[0053] This invention combines big data and machine learning to achieve intelligent calculation of the yaw threshold of UAVs, providing reliable technical support for the autonomous flight decision-making of UAVs. Attached Figure Description
[0054] Figure 1 This is a flowchart of the UAV dynamic yaw threshold calculation method based on multiple features according to the present invention. Detailed Implementation
[0055] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with the embodiments and accompanying drawings, so as to fully understand the purpose, features, and effects of the present invention.
[0056] A method for calculating the dynamic yaw threshold of unmanned aerial vehicles based on multiple features, such as... Figure 1 As shown, it includes: S1. Data collection and preprocessing.
[0057] 1) Data Acquisition: Acquire no fewer than 50,000 historical flight data points for the drone, covering real-time sensor data during the planned flight phase, including but not limited to: Environmental parameters: wind speed, wind direction, temperature, air pressure, etc. Flight status parameters: flight altitude, speed, yaw angle, GPS coordinates, etc.; Equipment status parameters: battery level, motor speed, load weight, etc.; Mission parameters: mission priority, flight path planning, urgency level, etc.
[0058] 2) Data cleaning: Remove outliers; Impute missing values (using mean imputation or time series-based interpolation methods); Data normalization / standardization.
[0059] 3) Feature engineering: Based on the drone model and flight mission characteristics, key features (wind speed, battery level, and mission priority, etc.) are selected. Structural characteristics (such as wind speed change rate, battery power decay rate, etc.).
[0060] In this invention, the key features selected include wind speed, battery level, and task priority. The purpose of selecting these key features is as follows: 1. Improve model performance and generalization ability. Prevent overfitting: If there are too many features, especially those containing a large number of irrelevant or redundant features, the model tends to "remember" noise and random patterns in the training data instead of learning true, generalizable causal relationships. This can cause the model to perform exceptionally well on the training set but poorly on new, unseen data. Filtering out key features such as "wind speed" allows the model to focus on the primary issue. Improve prediction accuracy: Irrelevant features (such as "temperature," which may have a weak impact on yaw) introduce interference, diluting the strength of the effective signal. Removing them is equivalent to "denoising," allowing the model to more clearly identify the true relationship between "wind speed" and "yaw," thus making more accurate predictions.
[0061] 2. Reduce computational and storage costs. Reduce training and prediction time: Fewer features mean simpler models and faster computation. This is crucial for applications requiring real-time predictions or processing massive amounts of data. Save storage and memory: Reduced feature data volume lowers hardware requirements.
[0062] 3. Enhance the operational feasibility of the model. Understand the driving factors: The selected list of key features directly identifies which are the core variables affecting the results, allowing monitoring and optimization to focus on wind speed-related systems and control strategies.
[0063] In this invention, the structural features include the structural wind speed change rate, battery power decay rate, and task priority index. The purpose of these structural features is as follows: 1. Identify implicit patterns and physical laws: Raw data represents a "state," while the rate of change represents a "dynamic process." For yaw control, the instantaneous rate of change of wind speed (gust intensity) has a greater impact on the stability of the aircraft than the wind speed itself. For battery health prediction, the degradation rate directly reflects the aging rate and remaining lifespan, and is more predictive than the absolute charge value at a certain point in time, thus more accurately determining the impact of the battery on the drone's flight attitude.
[0064] 2. Introducing the time dimension into static models: Most models assume that each sample is independent. By constructing time-related features, we encode the system's temporal dynamic behavior into features that the model can understand, greatly enhancing the model's ability to understand the process.
[0065] 3. Improved feature discrimination capability: The constructed features have a more direct and stronger nonlinear or logical relationship with the target variable, enabling better judgment of the yaw threshold of the UAV.
[0066] In step S1, the historical flight data of the UAV is divided into training set, validation set, and test set according to a certain ratio, wherein: The training set is used to train the machine learning model for calculating the dynamic yaw threshold of the UAV constructed in step S2. The validation set is used during training to adjust model hyperparameters, select the optimal model architecture, and perform early stopping to prevent cloning. The test set is used to objectively and fairly evaluate the model's final generalization performance (i.e., its predictive ability on new data) after the model has been fully determined (including its structure and parameters).
[0067] In the process of data collection and preprocessing, in order to further improve data quality, enhance feature representation capabilities, and improve the robustness of model training, this invention proposes a series of preferred technical solutions.
[0068] First, to address the issue of inconsistent sampling frequencies and time bases between multi-source heterogeneous sensor data (such as anemometers, GPS, IMU, and battery monitoring chips) from UAVs, a high-precision time alignment and fusion method is adopted: the timestamps of all sensor data are uniformly converted to UTC millisecond precision, and a global time axis is established based on the highest sampling rate; low-frequency data is filled to high-frequency moments using linear interpolation or spline interpolation, discrete event data (such as task priority changes) is filled forward, and data with transmission delays or packet loss is compensated for missing intervals using state estimation based on Kalman filtering. At the same time, a quality flag is generated for each aligned data point so that low-quality samples can be weighted or removed as needed during subsequent training.
[0069] Secondly, in terms of outlier detection and processing, an intelligent anomaly detection strategy based on unsupervised learning is introduced. This strategy comprehensively utilizes isolated forests to quickly identify global outliers, DBSCAN clustering to detect local density anomalies (such as sudden changes in yaw angle without synchronized wind speed changes), and autoencoder reconstruction errors to discover nonlinear anomaly patterns. Simultaneously, for time-series variables such as yaw angle and motor speed, local anomalous integration or sliding window differential anomaly detection is employed. For detected anomalies, median filtering or nearest-neighbor interpolation is used to correct isolated point anomalies. Continuous anomaly intervals are marked as missing and transferred to the missing value processing flow. For equipment-level anomalies (such as a sudden drop in battery voltage followed by recovery), the original data is retained, but an "anomaly flag" feature column is added.
[0070] Furthermore, in feature engineering, composite features with clear physical meaning are constructed to enhance the model's understanding of yaw dynamics: a yaw stability index is constructed, defined as the absolute value of the difference between the measured yaw angular velocity and the commanded yaw angular velocity divided by the airspeed and then multiplied by the wind speed; the larger the index, the more difficult the yaw control. An energy efficiency ratio is constructed, which is the product of the number of yaw corrections and the average correction magnitude divided by the battery power consumption, reflecting the cost of maintaining yaw stability per unit of energy consumption. A gust impact factor is constructed, calculating the ratio of short-term (0.5 seconds) to long-term (3 seconds) average wind speed; if this ratio exceeds 1.5, it indicates the presence of strong gusts, and the yaw threshold should be significantly reduced. A task-power coupling risk coefficient is also constructed, combining priority, the exponential decay term of battery power, and the rate of change of wind speed to quantify the comprehensive risk of high-priority tasks under low power and sudden wind speed increases. By calculating the mutual information values between each constructed feature and the target yaw threshold, features with high importance are retained, while redundant or weakly correlated features are eliminated.
[0071] To address the unique characteristics of time-series data, a sliding window segmentation and data augmentation strategy is employed: A time window length and sliding step size are set, with each window containing all sensor sequence data. The label is defined as the actual yaw threshold of the time step following the end of the window, and is forcibly used as the window boundary at task change points, enabling the model to learn abrupt responses. For data augmentation, small Gaussian noise is added to the wind speed sequence within the window to simulate different turbulence intensities. The wind speed and yaw error sequences are randomly stretched or compressed by 0.9 to 1.1 times along the time axis to simulate different flight speeds. Furthermore, the time-SMOTE method is used to interpolate rare operating condition samples such as low battery and high priority samples in the feature space to generate new samples, while simultaneously constraining the consistency of the generated samples' temporal order.
[0072] Finally, a hierarchical adaptive partitioning strategy is proposed for data partitioning: several scenario categories are combined based on wind speed level, priority level, and power stage. Within each scenario category, training set, validation set, and test set are partitioned in chronological order to ensure that no future information is leaked within the same scenario. For scenarios with very few samples, leave-one-out validation is used, and an additional test set outside the scenario (using flight missions with distributions significantly different from the training data) is set up to evaluate the model's transferability. At the same time, the entire continuous flight mission (from takeoff to landing) is used as the basic partitioning unit, and data from the same mission is prohibited from being simultaneously assigned to the training set and the test set, thereby avoiding inflated evaluation results due to time correlation.
[0073] The above comprehensive preprocessing scheme significantly improves the availability of UAV historical flight data, the physical correlation of features, and the accuracy and generalization ability of subsequent model training and evaluation.
[0074] S2, Model Development and Training.
[0075] 1) Algorithm selection: The XGBoost model is used to select either supervised learning or time series prediction models based on the characteristics of the data. 2) Dataset partitioning: The training, validation, and test sets are divided in a 7:2:1 ratio to ensure the model's generalization ability. Time series cross-validation is used to prevent data leakage.
[0076] 3) Model training: Input features: wind speed, battery level, task priority, etc. Output target: UAV yaw threshold (e.g., maximum allowable yaw angle); Optimization objective: Minimize prediction error.
[0077] In step S2, the function for calculating the UAV dynamic yaw threshold is:
[0078] in: Yaw threshold (unit: degrees or radians) refers to the maximum allowable yaw angle error or correction response threshold for a UAV during flight. The smaller the threshold, the stricter the control (stronger anti-yaw capability, but more energy-consuming); the larger the threshold, the more relaxed the control.
[0079] W: Wind speed (unit: m / s) Usually W≥0.
[0080] B: Battery power (unit: %, value range 0~100% represents the remaining power percentage).
[0081] P: Task priority (normalizable to 0) 10 The higher the priority (1 or discrete level), the more critical the mission, and the higher the requirements for flight stability may be.
[0082] It is the baseline yaw threshold (the value under no wind, full charge, and default priority).
[0083] These are the influence factor functions for wind speed, power consumption, and priority, respectively, representing the scaling ratio of the baseline threshold.
[0084] 1. Wind speed influencing factors
[0085]
[0086] in >0 is an adjustable parameter. The higher the wind speed, the more adjustable the parameter. The smaller the value, the lower the yaw threshold.
[0087] 2. Electricity Influence Factor
[0088]
[0089] Where γ ≥ 0. The lower the charge (the smaller B), the better. The larger the value, the greater the yaw threshold, thus saving energy.
[0090] 3. Priority Influence Factors
[0091] Assume priority P is normalized to 0 1, 1 is the highest priority:
[0092] Where η > 0. The higher the priority, The smaller the value, the lower the yaw threshold, thus improving control accuracy.
[0093] In step S2, to simplify the machine learning model and improve its performance, this invention employs an embedded feature selection method during model construction and optimization. Boosting algorithms excel at interpreting the effects of input features relative to output variables; therefore, this invention uses a boosting algorithm best suited to the structure of each data subset to analyze feature importance. In this invention, input variables with a feature importance score of 0 are removed as irrelevant variables. The results of the feature selection process are further applied to update the machine learning model based on the original data subset. To ensure the performance of the final model, a Bayesian automatic optimization algorithm is again used to optimize the hyperparameter combination. Finally, the optimal machine learning model is obtained by retraining the training dataset with the selected features using the optimal hyperparameter combination.
[0094] S3. Model Evaluation and Optimization.
[0095] The capabilities of the trained model are evaluated based on the evaluation metrics.
[0096] The evaluation metrics in step S3 include: all model performance evaluation metrics used in this invention are standard deviation (SD), mean squared error (MSE), root mean squared error (RMSE), correlation coefficient (R), and coefficient of determination (R²). 2 ) The specific formulas for the evaluation indicators are as follows: The standard deviation (SD) reflects the dispersion of a dataset. It is calculated as the square root of the variance, which is the average of the squared differences from the mean. The formula is:
[0097] The root mean square error (RMSE) is a measure of the difference between predicted and actual values. It is commonly used in regression analysis to measure the accuracy of predictions. The formula for RMSE is:
[0098] The correlation coefficient (R) is a measure of the strength and direction of the linear relationship between two variables. It ranges from -1 to +1, where -1 indicates a perfect negative correlation, +1 indicates a perfect positive correlation, and 0 indicates no correlation. The formula for R is:
[0099] Coefficient of determination (R) 2 R² is a measure of the proportion of variance in one variable, which can be interpreted by another variable in regression analysis. It ranges from 0 to 1, where 0 indicates no relationship and 1 indicates a perfect relationship. The formula for R² is:
[0100] in: i represents the number of data points. For the i-th data point, The average value of the dataset. The actual value of the target feature. Let N be the predicted value of the target feature, and N be the sample size. This represents the average value of the actual target characteristics. To predict the mean of the target feature, RSS is the residual sum of squares (i.e., the sum of squared differences between the predicted and actual values of the dependent variable), and TSS is the total sum of squares (i.e., the sum of squared differences between the actual value and the mean of the dependent variable).
[0101] In step S3, the Bayesian automatic optimization algorithm is used to further optimize the model's hyperparameter combination. The root mean square error (RMSE) obtained from five cross-validation processes is used as the optimization objective function, and the Bayesian optimization algorithm is used to automatically search for... The hyperparameter design space of the optimal model is determined. Furthermore, the RMSE loss function curves on the training and validation datasets are used to diagnose whether the model exhibits underfitting or overfitting. The key parameters of the Bayesian optimization algorithm are then further adjusted to obtain the optimal hyperparameter combination that produces a good fit. The key parameters of the final Bayesian automatic optimization algorithm, the search space of the model hyperparameters, and the final hyperparameter combinations selected for each target variable are given in Table 1.
[0102] Table 1 Performance evaluation metrics for machine learning models
[0103] S4, Model Deployment.
[0104] 1) Online deployment: The trained model is encapsulated as a REST API (FastAPI) for the airspace controller to call in real time. Edge computing deployment (NVIDIA Jetson) enables low-latency decision-making; Combined with streaming data processing (Kafka), it supports real-time input of data such as wind speed and power consumption.
[0105] 2) Dynamic threshold calculation: Based on real-time sensor data, dynamically adjust the yaw threshold (e.g., relax the threshold when the wind speed is high and tighten the threshold when the battery is low). Adjust threshold setting strategies flexibly based on task priority (e.g., allow higher risk thresholds for urgent tasks).
[0106] 3) Continuous learning and updating: Online learning mechanisms to adapt to the new flight environment; Flight data is regularly transmitted back to iteratively optimize the model.
[0107] In step S4, in order to further improve the real-time performance, robustness and adaptability of dynamic yaw threshold calculation in real airspace environment, this invention proposes a series of preferred technical solutions.
[0108] First, to address the limited computational resources of edge spatial controllers, the trained XGBoost model is lightweighted, compressed, and inference accelerated: feature importance pruning is employed to remove redundant features with contributions below a set threshold to reduce model size; 8-bit integer quantization is used to replace floating-point parameters, and operator fusion and computation graph optimization are combined to reduce inference latency to within milliseconds, ensuring that threshold calculation is completed within control cycles of 50Hz or higher.
[0109] In terms of deployment architecture, an edge-cloud collaboration strategy is adopted: lightweight model replicas are deployed on the edge spatial controller for millisecond-level real-time inference; at the same time, the complete model or integrated model is deployed on the cloud, which regularly receives summary and abnormal data back from the edge for offline retraining or incremental updates.
[0110] To address network disconnections or fluctuations in edge computing power, a three-level fault tolerance and degradation mechanism is designed: firstly, the latest model cached at the edge is used for inference; if the model loading fails, it automatically switches to analytical threshold calculation based on physical formulas, and directly outputs a safe and conservative threshold after inputting real-time wind speed, power consumption, and priority; if the sensor fails momentarily, the current state is predicted by Kalman filtering based on historical time series and then input into the model.
[0111] For continuous learning and updating, an online learning pipeline with drift detection is adopted: the edge airspace controller caches the flight characteristics and actual yaw error data of the most recent hour in real time, and uses a sliding window to calculate the cumulative distribution of model prediction deviation; when a significant change in data distribution is detected (such as seasonal wind field pattern switching or battery aging drift) and the deviation exceeds a preset threshold, a lightweight online update is triggered - the FTRL (Follow-The-Regularized-Leader) algorithm is used to fine-tune the weights of the leaf nodes of the last few decision trees of the model, and after the update, it is tested by A / B (verifying the new version with 10% traffic) before being fully deployed.
[0112] For scenarios involving multiple drones working together, a federated learning framework is introduced: each airspace controller locally uses its own flight data to calculate model gradient updates, and only encrypted gradients are uploaded to the cloud aggregation server. After the cloud forms a global augmented model, it is distributed to each edge node, thereby improving the model generalization capability across regions and aircraft types without leaking sensitive information such as mission paths and payload types.
[0113] Finally, in terms of security, range verification and adversarial defense are implemented for the model input features: if features such as real-time wind speed and power consumption exceed three times the interquartile range of the training set distribution, an anomaly flag is triggered and the data is rolled back to a conservative physical threshold; and integrated differential privacy technology is used to add Laplacian noise during edge-to-cloud communication to prevent the model interface from being maliciously probed or the model parameters from being reverse-engineered.
[0114] Through the above deployment scheme, the UAV dynamic yaw threshold calculation model can achieve stable, safe, and efficient real-time inference and continuous evolution in complex and dynamic airspace environments.
[0115] The embodiments of the present invention have been described in detail above, but the present invention is not limited to the described embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and these equivalents or substitutions are all included within the scope defined by the claims of the present invention.
Claims
1. A method for calculating the dynamic yaw threshold of a UAV based on multiple features, characterized in that, Includes the following steps: S1. Collect historical flight data of the UAV and perform data preprocessing; wherein, the data preprocessing includes data cleaning and feature engineering of the historical flight data of the UAV, screening out key features including wind speed, battery level, and task priority, and constructing derived features. S2. Construct a machine learning model for calculating the dynamic yaw threshold of the UAV, and train the model by taking the preprocessed historical flight data of the UAV as input and the UAV yaw threshold as output. S3. Use evaluation metrics to assess and optimize the capabilities of the trained model; S4. Deploy the optimized model in the airspace controller. The model uses real-time multi-feature data to calculate the dynamic yaw threshold of the UAV.
2. The method for calculating the dynamic yaw threshold of a UAV based on multiple features as described in claim 1, characterized in that, In step S1, the data cleaning includes: removing outliers, filling in missing values, and performing normalization or standardization processing. The feature engineering includes: selecting key features based on UAV model and flight mission characteristics in historical UAV flight data, and constructing derived features; wherein, the key features include wind speed, battery level and mission priority, and the derived features include wind speed change rate, battery level decay rate and mission priority index.
3. The method for calculating the dynamic yaw threshold of a UAV based on multiple features as described in claim 2, characterized in that, In step S1, the outlier removal in the data preprocessing adopts an intelligent anomaly detection strategy based on unsupervised learning, including: using isolated forest to identify global outliers, using DBSCAN clustering to detect local density anomalies, using autoencoder reconstruction error to discover nonlinear anomaly patterns, and using local anomalous integration or sliding window difference anomaly detection for time series variables; median filtering or nearest neighbor interpolation is used to correct the detected isolated point anomalies, continuous anomaly intervals are marked as missing and transferred to the missing value processing flow, and the original data is retained for device-level anomalies and an anomaly marker feature column is added; The constructed derivative features also include at least one of the following: The yaw stability index is constructed and defined as the absolute value of the difference between the measured yaw rate and the commanded yaw rate, divided by the airspeed and multiplied by the wind speed. The energy efficiency ratio is calculated by dividing the product of the number of yaw corrections and the average correction magnitude by the power consumed by the battery. Construct the gust impact factor and calculate the ratio of short-term average wind speed to long-term average wind speed; Construct a task-power coupling risk coefficient, taking into account priority, the exponential decay term of battery power, and the wind speed change rate.
4. The method for calculating the dynamic yaw threshold of a UAV based on multiple features as described in claim 2, characterized in that, In step S1, the data preprocessing further includes: dividing the cleaned and feature-engineered UAV historical flight data into a training set, a validation set, and a test set according to a certain proportion; the training set is used to train the subsequently constructed machine learning model, the validation set is used to adjust the model hyperparameters and prevent overfitting during the training process, and the test set is used to evaluate the final generalization performance of the model. The data partitioning in the data preprocessing adopts a hierarchical adaptive partitioning strategy: several scenario categories are combined according to wind speed level, priority level and power stage. Within each scenario category, training set, validation set and test set are divided in chronological order. For scenarios with very few samples, leave-one-out validation is used, and an additional test set outside the scenario is set. The entire continuous flight mission is used as the basic partitioning unit, and it is prohibited to include data from the same mission in both the training set and the test set at the same time.
5. The method for calculating the dynamic yaw threshold of a UAV based on multiple features as described in claim 1, characterized in that, In step S1, the data preprocessing further includes: performing time alignment and fusion on multi-source heterogeneous sensor data, uniformly converting the timestamps of all sensor data to millisecond-level precision, and establishing a global time axis based on the highest sampling rate; filling low-frequency data to high-frequency moments using linear interpolation or spline interpolation, performing forward padding on discrete event data, compensating for missing intervals using state estimation based on Kalman filtering for data with transmission delays or packet loss, and generating a quality flag bit for each aligned data point; The data preprocessing also includes a sliding window segmentation and data augmentation strategy: setting the time window length and sliding step size, each window contains all sensor sequence data, the label is defined as the actual yaw threshold of the time step after the end of the window, and the task change point is forced as the window boundary; in terms of data augmentation, Gaussian noise is added to the wind speed sequence within the window, the wind speed and yaw error sequences are randomly stretched or compressed on the time axis, and the time-series-SMOTE method is used to interpolate rare operating condition samples in the feature space to generate new samples, while constraining the consistency of the time order of the generated samples.
6. The method for calculating the dynamic yaw threshold of a UAV based on multiple features as described in claim 1, characterized in that, In step S2, the machine learning model for calculating the dynamic yaw threshold of the UAV adopts the XGBoost model, and a supervised learning or time series prediction model is selected according to the characteristics of the data. The input features for model training include: wind speed, battery level, and task priority; the output target is the drone yaw threshold. Embedded feature selection is applied during model building and optimization, including: calculating the feature importance score of each input feature, deleting features with a score of zero as irrelevant variables, retraining the model based on the updated feature subset, and using a Bayesian automatic optimization algorithm to optimize the hyperparameter combination of the model.
7. The method for calculating the dynamic yaw threshold of a UAV based on multiple features as described in claim 1, characterized in that, In step S2, the UAV dynamic yaw threshold calculation function in the UAV dynamic yaw threshold calculation machine learning model is: in, Yaw threshold refers to the maximum allowable yaw angle error or correction response threshold for a drone during flight. The smaller the threshold, the stricter the control; the larger the threshold, the looser the control. Wind speed; P represents battery level; P represents mission priority, the more critical the mission, the higher the requirements for flight stability. This is the baseline yaw threshold, which is the yaw threshold under no wind, full battery, and default priority conditions. These are the influencing factor functions for wind speed, power consumption, and priority, respectively. This indicates the scaling factor relative to the baseline yaw threshold; The influencing factor functions for wind speed, power consumption, and priority are as follows: In the formula, To adjust the parameters; This is the power consumption impact coefficient; This is the priority influence coefficient.
8. The method for calculating the dynamic yaw threshold of a UAV based on multiple features as described in claim 1, characterized in that, Step S3 includes: evaluating the capabilities of the trained UAV dynamic yaw threshold calculation machine learning model based on evaluation metrics, and optimizing the UAV dynamic yaw threshold calculation machine learning model based on the evaluation results, with the optimization objective being to minimize the prediction error. In step S3, the capability assessment uses at least one of the following evaluation indicators: standard deviation (SD), mean square error (MSE), root mean square error (RMSE), correlation coefficient (R), or coefficient of determination (R). 2 ; In step S3, the optimization adopts the Bayesian automatic optimization algorithm, using the root mean square error obtained by cross-validation as the optimization objective function, and automatically searches the design space of the model hyperparameters. Diagnose whether the model is underfitting or overfitting by analyzing the loss function curves on the training and validation sets, and adjust the key parameters of the Bayesian optimization algorithm accordingly to obtain the optimal combination of hyperparameters.
9. The method for calculating the dynamic yaw threshold of a UAV based on multiple features as described in claim 1, characterized in that, Step S4 includes: The optimized machine learning model for calculating the dynamic yaw threshold of UAVs is encapsulated as a REST API for real-time calls by the airspace controller and deployed at the edge. Combined with streaming data processing, it calculates the dynamic yaw threshold of UAVs. The machine learning model for calculating the dynamic yaw threshold of the UAV dynamically adjusts and calculates the yaw threshold of the UAV based on real-time sensor data. The machine learning model for calculating the dynamic yaw threshold of drones flexibly adjusts the threshold setting strategy based on task priority. The machine learning model for calculating the dynamic yaw threshold of drones is continuously learned and updated, including: An online learning mechanism is adopted to adapt the dynamic yaw threshold calculation of UAVs to the new flight environment; Regularly transmit flight data and iteratively optimize the machine learning model for calculating the dynamic yaw threshold of the UAV.
10. The method for calculating the dynamic yaw threshold of a UAV based on multiple features as described in claim 1, characterized in that, In step S4, model deployment also includes model lightweighting and accelerated inference: feature importance pruning is performed on the trained UAV dynamic yaw threshold calculation machine learning model to remove redundant features with contributions below the set threshold; 8-bit integer quantization is used to replace floating-point parameters, and operator fusion and computation graph optimization are combined to make the inference latency reach the millisecond level. In step S4, the model deployment adopts an edge-cloud collaborative architecture: a lightweight model copy is deployed on the edge spatial controller for real-time inference, and the complete model or integrated model is deployed on the cloud. The cloud periodically receives summary and abnormal data back from the edge and performs offline retraining or incremental updates. In step S4, model deployment also has a three-level fault tolerance and degradation mechanism: the latest model in the edge cache is used for inference first; if the model loading fails, it automatically switches to the analytical threshold calculation based on the physical formula, and outputs a safe and conservative threshold according to the real-time wind speed, power consumption and priority. If the sensor fails momentarily, the current state is predicted using Kalman filtering based on the historical time series and then input into the model; In step S4, the model deployment adopts an online learning pipeline with drift detection: the edge airspace controller caches the flight characteristics and actual yaw error data in the most recent time window in real time, and uses a sliding window to calculate the cumulative distribution of the model prediction bias; when a change in data distribution is detected and the bias exceeds a preset threshold, a lightweight online update is triggered, and the FTRL algorithm is used to fine-tune the weights of the leaf nodes of the last few decision trees of the model, and after verification by A / B testing, it is fully deployed online; In step S4, when the model is deployed in a multi-drone collaborative scenario, a federated learning framework is adopted: each airspace controller locally uses its own flight data to calculate the model gradient update, and only encrypts and uploads the gradient to the cloud aggregation server. After the cloud forms a global augmented model, it is distributed to each edge node to improve the model generalization capability across regions and aircraft types. In step S4, model deployment also includes security verification and adversarial defense of input features: range verification is performed on input features such as real-time wind speed and battery power. If the input features exceed three times the interquartile range of the training set distribution, an anomaly flag is triggered and the system is rolled back to a conservative physical threshold. During edge-cloud communication, Laplacian noise is added using integrated differential privacy technology to prevent the model interface from being maliciously probed or the model parameters from being reverse-engineered.