Unmanned aerial vehicle flight control rudder abnormality detection method for long delay cooperative failure

By modeling long-delay anomaly evolution and conducting multi-channel collaborative quantization analysis, a bidirectional attention collaborative detection model was constructed, which solved the problem of insufficient early warning capability in flight control servo anomaly detection and achieved efficient identification and reliability assurance of long-delay collaborative faults.

CN122450108APending Publication Date: 2026-07-24BEIJING BEIHANG TIANYU ZHANGYING UAV TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING BEIHANG TIANYU ZHANGYING UAV TECH CO LTD
Filing Date
2026-05-25
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing flight control servo anomaly detection methods lack early warning capabilities and reliability assurance when facing long-delay coordinated faults. They are unable to effectively identify the coordinated relationship of multi-channel signals, resulting in insufficient accuracy and reliability of detection.

Method used

By modeling the long-delay anomaly evolution of historical flight control servo data of UAVs, the target time-series observation window is determined, multi-channel anomaly collaborative quantitative analysis is performed, a bidirectional attention collaborative detection model is constructed, anomaly detection is performed using a bidirectional LSTM structure and attention mechanism, and early warning is provided in conjunction with an alarm state machine.

Benefits of technology

It significantly improves the early warning capability and reliability of flight control servo anomaly detection, can accurately identify key channel combinations, eliminate redundant signals, improve the stability and consistency of anomaly detection, and meet extreme safety requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122450108A_ABST
    Figure CN122450108A_ABST
Patent Text Reader

Abstract

The application provides a UAV flight control rudder anomaly detection method for long-delay cooperative failure, and relates to the technical field of unmanned aerial vehicles, comprising: long-delay anomaly evolution modeling on historical flight control rudder data of the unmanned aerial vehicle to obtain a target time sequence observation window covering flight control rudder anomaly trajectories; based on the target time sequence observation window, performing anomaly cooperative quantization analysis on multiple feature channels contained in the historical flight control rudder data to obtain a key channel combination; taking the target time sequence observation window and the key channel combination as joint constraints, constructing target sample data and flight control rudder state labels thereof; using the target sample data and the flight control rudder state labels thereof, performing model training on a pre-constructed bidirectional attention cooperative detection model, and using the trained bidirectional attention cooperative detection model for anomaly detection based on current flight control rudder data of the unmanned aerial vehicle. The application can significantly improve the early warning capability and reliability guarantee of flight control rudder anomaly detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of unmanned aerial vehicle (UAV) technology, and in particular to a method for detecting abnormalities in UAV flight control servos in the face of long-delay collaborative faults. Background Technology

[0002] The reliability of the flight control servo system is the lifeline of UAV flight safety. The multi-channel position signals (such as left / right elevator servos, left / right yaw servos, and left / right aileron servos) and flight phase information generated during flight control servo operation constitute a complex multivariate time-series system. These parameters have complex coupling relationships, and failures are often accompanied by coordinated changes in multiple parameters. However, existing anomaly detection methods, based on fixed-length time windows and independent or simply pieced-together feature organization between channels, result in significant shortcomings in early warning capabilities and reliability assurance for flight control servo anomaly detection. Summary of the Invention

[0003] In view of this, the purpose of this invention is to provide a method for detecting abnormalities in UAV flight control servos in the face of long-delay collaborative faults, which can significantly improve the early warning capability and reliability assurance of flight control servo anomaly detection.

[0004] In a first aspect, the present invention provides a method for detecting abnormalities in the flight control servo mechanism of a UAV facing long-delay cooperative faults, including: Long-delay anomaly evolution modeling is performed on historical flight control servo data of UAVs to obtain a target time-series observation window covering the abnormal trajectory of flight control servos. Based on the target time series observation window, anomaly co-quantitative analysis is performed on multiple feature channels contained in historical flight control servo data to obtain key channel combinations; Using the target time-series observation window and key channel combination as joint constraints, target sample data and its flight control servo status labels are constructed based on historical flight control servo data. Using target sample data and its flight control servo status labels, a pre-built bidirectional attention collaborative detection model is trained. The trained bidirectional attention collaborative detection model is then used for anomaly detection based on the current flight control servo data of the UAV.

[0005] In one implementation, long-delay anomaly evolution modeling is performed on the historical flight control servo data of the UAV to obtain a target time-series observation window covering the abnormal trajectory of the flight control servo, including: Based on multiple alternative time series observation windows with different time steps, the first sample data corresponding to the alternative time series observation windows and their flight control servo status labels are extracted from the historical flight control servo data of the UAV. For each candidate timing observation window, the pre-built bidirectional attention cooperative detection model is trained using the first sample data corresponding to the candidate timing observation window and its flight control servo status label, and the first evaluation index of the trained bidirectional attention cooperative detection model is evaluated. Based on the first evaluation metric, a target time-series observation window covering abnormal flight control servo trajectories is determined from multiple alternative time-series observation windows.

[0006] In one implementation, based on the target time-series observation window, anomaly co-quantification analysis is performed on multiple feature channels contained in historical flight control servo data to obtain key channel combinations, including: Under the target time series observation window, based on the reference channel combination consisting of all feature channels contained in the historical flight control servo data, multiple feature channel ablation processes are performed on the reference channel combination to obtain multiple alternative channel combinations. Using the target time-series observation window and alternative channel combinations as joint constraints, second sample data and their flight control servo status labels corresponding to multiple alternative channel combinations are extracted from historical flight control servo data. For each alternative channel combination, the pre-built bidirectional attention cooperative detection model is trained using the second sample data corresponding to the alternative channel combination and its flight control servo status label, and the second evaluation index of the trained bidirectional attention cooperative detection model is evaluated. Based on the second evaluation metric, the key channel combination is determined from the alternative channel combinations.

[0007] In one implementation, the bidirectional attention cooperative detection model includes a bidirectional LSTM structure, an attention mechanism layer, and a fully connected classification layer; the pre-built bidirectional attention cooperative detection model is trained using target sample data and its flight control servo status labels, including: The target sample data is mapped to a bidirectional hidden state sequence containing the time dimension using a bidirectional LSTM structure. Through the attention mechanism layer, the importance weights corresponding to multiple time steps are determined based on the bidirectional hidden state sequence, and the bidirectional hidden states corresponding to multiple time steps in the bidirectional hidden state sequence are aggregated according to the importance weights to obtain the context vector. The flight control servo state prediction result corresponding to the target sample data is determined by the fully connected classification layer based on the context vector. The model is trained using the flight control servo status labels and flight control servo status prediction results from the target sample data.

[0008] In one embodiment, the bidirectional LSTM structure includes at least two layers of forward LSTM units stacked in the forward path and at least two layers of backward LSTM units stacked in the backward path, wherein the number of stacked layers in the forward path and the backward path are equal; mapping the target sample data into a bidirectional hidden state sequence containing a time dimension includes: The target sample data is input into the forward LSTM unit in chronological order. The basic temporal variation features and abnormal collaborative features of the target sample data are extracted by multiple forward LSTM units, and the forward hidden state is output by the top forward LSTM unit. Additionally, the target sample data is input into the backward LSTM unit in reverse chronological order. The basic temporal variation features and abnormal collaborative features of the target sample data are extracted by multiple backward LSTM units, and the backward hidden state is output by the top backward LSTM unit. The forward hidden state and backward hidden state corresponding to each time step in the target time series observation window are concatenated to obtain the bidirectional hidden state corresponding to each time step, thus forming a bidirectional hidden state sequence.

[0009] In one implementation, the method further includes: Write the current flight control servo data of the UAV to the buffer. The feature channels and key channels contained in the current flight control servo data are matched. The length of the buffer is consistent with the time step of the target time series observation window. If the data in the buffer meets the anomaly detection triggering conditions, the trained bidirectional attention collaborative detection model generates flight control servo state prediction results. Based on the flight control servo state prediction results across multiple time frames, the alarm state machine is switched to trigger an alarm notification when the UAV's flight control servo malfunctions.

[0010] In one implementation, the alarm state machine includes a normal state, a suspicious state, and an alarm state, and is configured with a first counter corresponding to the suspicious state and a second counter corresponding to the alarm state. The flight control servo state prediction result includes an anomaly probability value. Based on the flight control servo state prediction results in multiple time frames, the alarm state machine is switched to trigger an alarm prompt when the UAV's flight control servo is abnormal, including: If the anomaly probability value is greater than the preset anomaly threshold, the alarm state machine will be switched from the normal state to the suspicious state, and the second counter will be started. The second counter is used to record the number of frames that are continuously judged as abnormal in the suspicious state. If the anomaly probability value in any time frame is less than the preset anomaly threshold, the alarm state machine is switched from the suspicious state to the normal state; or, if the number of frames recorded by the first counter is greater than the preset first frame number threshold, the alarm state machine is switched from the suspicious state to the alarm state, and the second counter is started. The second counter is used to record the number of frames that are continuously judged as normal in the alarm state. If the anomaly probability value in any time frame is greater than the preset anomaly threshold, the alarm state machine remains in the alarm state; or, if the number of frames recorded by the second counter is greater than the preset second frame number threshold, the alarm state machine is switched from the alarm state to the normal state.

[0011] Secondly, the present invention also provides an anomaly detection device for UAV flight control servo motors accommodating long-delay cooperative faults, comprising: The window modeling module is used to perform long-delay anomaly evolution modeling on the historical flight control servo data of UAVs, and obtain a target time-series observation window covering the abnormal trajectory of the flight control servo. The channel combination quantization analysis module is used to perform anomaly co-quantization analysis on multiple characteristic channels contained in historical flight control servo data based on the target time series observation window, and to obtain key channel combinations. The sample construction module is used to construct target sample data and its flight control servo status labels based on historical flight control servo data, using the target time-series observation window and key channel combination as joint constraints. The model training module is used to train a pre-built bidirectional attention collaborative detection model using target sample data and its flight control servo status labels. The trained bidirectional attention collaborative detection model is used to detect anomalies based on the current flight control servo data of the UAV.

[0012] Thirdly, the present invention also provides an electronic device including a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement any of the methods provided in the first aspect.

[0013] Fourthly, the present invention also provides a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement any of the methods provided in the first aspect.

[0014] This invention provides a method for detecting UAV flight control servo anomalies in the face of long-delay collaborative faults. It determines the target time-series observation window through long-delay anomaly evolution modeling, enabling the model to cover the complete evolution process of the fault from its inception to its manifestation. Based on this window, multi-channel anomaly collaborative quantitative analysis is conducted to accurately identify key channel combinations that substantially contribute to collaborative anomaly detection, while eliminating redundant interference signals. Training samples are then constructed using these two factors as joint constraints to drive the bidirectional attention collaborative detection model's learning. Thus, without introducing external priors or additional sensors, it significantly improves the early identification capability of slowly accumulating, multi-channel coupled anomalies, enhancing the stability and consistency of anomaly judgment results, thereby effectively compensating for the shortcomings of flight control servo anomaly detection in terms of early warning timeliness and system operational reliability.

[0015] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained through the structures particularly pointed out in the description and the drawings.

[0016] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating an anomaly detection method for UAV flight control servo motors in response to long-delay collaborative faults, provided by an embodiment of the present invention; Figure 2 This invention provides a technical framework for a method of detecting abnormalities in UAV flight control servos in the face of long-delay collaborative faults. Figure 3 This is a schematic diagram of the structure of a UAV flight control servo anomaly detection device for long-delay collaborative faults provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Currently, existing monitoring methods face three core challenges: First, at the time-series modeling level, servo motor failures often manifest as slow accumulation or intermittent occurrences. Existing methods lack targeted modeling for long-term failure evolution patterns. Fixed short-term windows cannot capture complete fault precursors, while excessively long windows are impractical due to computational burden and noise accumulation issues. Second, at the feature understanding level, the output signals of multiple servo motor channels exhibit strong spatiotemporal coordination under both normal and abnormal conditions. Existing methods often analyze each channel independently or simply merge them, failing to quantify and evaluate the independent and joint contributions of each channel signal in this coordination relationship, and failing to identify key coordination features and redundant information. Finally, at the model design level, existing models fail to incorporate the aforementioned long-term dependency characteristics and multi-channel coordination relationships as prior knowledge into the architecture design, resulting in the model being insensitive to slowly occurring coordinated failures and struggling to achieve breakthroughs in the contradictory goals of extremely high detection recall and extremely low false alarm rate.

[0021] Therefore, current technology lacks a systematic design framework that can uniformly handle long-term dependence, multi-channel collaboration, and meet extreme safety requirements, resulting in significant shortcomings in the early warning capability and reliability assurance of flight control servo anomaly detection.

[0022] Based on this, the present invention provides a method for detecting abnormalities in UAV flight control servos in the face of long-delay collaborative faults, which can significantly improve the early warning capability and reliability assurance of flight control servo anomaly detection.

[0023] To facilitate understanding of this embodiment, a detailed description of the UAV flight control servo anomaly detection method for long-delay cooperative faults, as disclosed in this embodiment of the invention, will be provided first. (See [link to relevant documentation]). Figure 1 The diagram shows a flowchart of a method for detecting UAV flight control servo anomalies in the face of long-delay collaborative faults. The method mainly includes the following steps S102 to S108: Step S102: Perform long-delay anomaly evolution modeling on the historical flight control servo data of the UAV to obtain a target time-series observation window covering the abnormal trajectory of the flight control servo.

[0024] The historical flight control servo data, which is the flight control servo data collected at historical moments, comes from the actual UAV flight control servo operation monitoring system. The data feature dimensions include seven measurement parameters (corresponding one-to-one with the feature channels): flight phase, left elevator servo position (primary), right elevator servo position (primary), left directional servo position (primary), right directional servo position (primary), left aileron servo position (primary), and right aileron servo position (primary). The target time series observation window refers to the time interval that can cover typical abnormal evolution characteristics.

[0025] In one implementation, multiple alternative timing observation windows are pre-configured to construct corresponding first sample data and their flight control servo status labels. The bidirectional attention collaborative detection model is then trained to evaluate the detection performance of each alternative timing observation window, and then the target timing observation window that can cover abnormal flight control servo trajectories is selected from them.

[0026] Step S104: Based on the target time series observation window, perform anomaly co-quantitative analysis on multiple feature channels contained in the historical flight control servo data to obtain the key channel combination.

[0027] Among them, the key channel combination refers to the smallest subset of features that has been proven in quantitative analysis to have a statistically significant contribution to distinguishing normal / abnormal synergistic patterns.

[0028] In one implementation, under the target time-series observation window, a reference channel combination consisting of all feature channels contained in the historical flight control servo data is used as a benchmark. The reference channel combination is subjected to multiple feature channel ablation processes to obtain multiple candidate channel combinations. Then, second sample data and flight control servo status labels corresponding to each required channel combination are constructed. The bidirectional attention collaborative detection model is trained to evaluate the detection performance corresponding to each candidate channel combination, and then the key channel combination is selected from them.

[0029] Step S106: Using the target time-series observation window and key channel combination as joint constraints, construct target sample data and its flight control servo status labels based on historical flight control servo data.

[0030] The target sample data refers to a set of structured training samples generated by sliding slices from historical flight control servo data based on joint constraints. Each sample is a two-dimensional matrix of shape (14×6), representing the normalized observations of 6 key channels within 14 time steps backward from a certain moment. The flight control servo status label refers to a binary label (0=normal, 1=abnormal) strictly aligned with each target sample data, taken from the fault identification field corresponding to the end of the sample's time window.

[0031] In one implementation, a 14-step time series observation window and a 6-dimensional key channel combination are used. On the normalized full historical sequence, a sliding window method with a step size of 1 is employed for sample slicing: starting from the 14th time step, 14 consecutive rows corresponding to 6 columns of data are extracted each time to form an input sample; simultaneously, the fault identifier corresponding to the last row (i.e., the 14th row) is extracted as a label. All samples are hierarchically divided into training and test sets in a 7:3 ratio to ensure a consistent proportion of abnormal samples in each subset. The final output is target sample data with a unified structure, spatiotemporal alignment, and reliable labels, along with their flight control servo status labels.

[0032] Step S108: Using the target sample data and its flight control servo status labels, the pre-built bidirectional attention collaborative detection model is trained. The trained bidirectional attention collaborative detection model is used for anomaly detection based on the current flight control servo data of the UAV.

[0033] The bidirectional attention collaborative detection model includes a bidirectional LSTM (BiLSTM) as the core temporal encoder, superimposed with a temporal dimension attention mechanism, followed by two fully connected classification layers.

[0034] In one implementation, target sample data and flight control servo status labels are loaded, and the model training process is initiated in a unified hardware and software environment: network parameters are initialized, data is input in batches (batch size=64), weighted loss is calculated and parameters are updated, and the F1 score on the validation set is monitored synchronously; after training, the optimal model weights are fixed. During deployment, the external module continuously receives the raw state stream (referred to as the current flight control servo data) sent by the flight control system, extracts 6-dimensional features according to the same rules as during training, normalizes them, and fills them into a FIFO sliding buffer of length 14; when the buffer is full, an inference is triggered, the flight control servo anomaly detection result is output, and the state machine is used to determine whether a suspicious or alarm state has been entered, thus realizing the anomaly detection of the UAV flight control servo.

[0035] This invention provides a method for detecting UAV flight control servo anomalies in the face of long-delay collaborative faults. It determines the target time-series observation window through long-delay anomaly evolution modeling, enabling the model to cover the complete evolution process of the fault from its inception to its manifestation. Based on this window, multi-channel anomaly collaborative quantitative analysis is conducted to accurately identify key channel combinations that substantially contribute to collaborative anomaly detection, while eliminating redundant interference signals. Training samples are then constructed using these two factors as joint constraints to drive the bidirectional attention collaborative detection model's learning. Thus, without introducing external priors or additional sensors, it significantly improves the early identification capability of slowly accumulating, multi-channel coupled anomalies, enhancing the stability and consistency of anomaly judgment results, thereby effectively compensating for the shortcomings of flight control servo anomaly detection in terms of early warning timeliness and system operational reliability.

[0036] This invention aims to overcome the shortcomings of existing flight control servo anomaly detection technologies, which suffer from a fragmented design in handling long-delay faults, analyzing multi-channel cooperative relationships, and meeting extreme reliability requirements. The fundamental objective of this invention is to provide an integrated parameter and model co-design methodology. This methodology can: adaptively determine a timing observation window sufficient to cover the typical fault development process of servos; quantitatively analyze and select the core feature combinations that contribute most to the identification of abnormal cooperative patterns from multi-channel cooperative signals; and, based on the optimized input space defined by the former two, construct a bidirectional attention detection model that is sensitive to long-term dependencies, specific to cooperative patterns, and achieves a balance between extremely high recall and extremely low false alarm rate. Ultimately, this results in a complete flight control servo anomaly detection solution with excellent overall performance for high-safety-level applications.

[0037] This invention proposes a flight control servo anomaly detection method based on a "long-term cooperative optimization framework." The inventive aspect of this invention lies in constructing a technical framework comprising three sequentially dependent, deeply coupled optimization stages, specifically tailored to the long latency and multi-channel cooperative characteristics of flight control servo systems. See also... Figure 2 The present invention presents a technical framework for an anomaly detection method of UAV flight control servo for long-delay collaborative faults. The framework comprises the following three core optimization stages executed sequentially: First, the long-term dependency-oriented time-series window optimization stage. The core of this stage is to abandon fixed windows and instead treat window length as a key variable related to the physical timescale of the fault. Specifically, with a fixed baseline model architecture, the system evaluates the model's performance on the validation set under different time-series window lengths. Evaluation metrics include not only overall accuracy and F1 score, but also a particular focus on the balance between recall and inference latency for long-latency faults. Through performance-latency curves, an optimal historical observation window is adaptively determined that captures the complete early trajectory of the fault while meeting real-time requirements. The length of this window must be sufficient to capture the complete early trajectory of the fault's development.

[0038] Second, the multi-channel collaborative feature contribution analysis and screening stage. After locking the optimal time window determined in the first stage, this stage begins, focusing on processing the collaborative relationships between features. This stage adopts a collaborative contribution analysis method based on performance changes: based on the constructed time-series samples, it not only evaluates the impact of removing a single feature on model performance, but also assesses the impact of changes in specific channel combinations (reflecting collaborative relationships) on model performance. Through quantitative analysis, it identifies which channels or channel combinations are key to defining normal / abnormal collaborative patterns, and which information is redundant or even interfering, thereby extracting a concise feature set that best characterizes the collaborative state of the system.

[0039] Third, the bidirectional attention-based collaborative detection model construction stage. This stage uses the outputs of the first two stages (i.e., the optimal long-term window and the simplified feature set representing collaborative relationships) as the sole input constraint for model design. Under this constraint, this stage employs a dedicated architecture combining a bidirectional long short-term memory network (LSTM) and an attention mechanism. The bidirectional LSTM fully mines dependencies in the long-term temporal context from both forward and backward dimensions; the attention mechanism further focuses on key time segments in the fault occurrence process; the entire model is trained to keenly identify abnormal collaborative patterns between multi-channel signals. The model's architecture and parameter optimization are entirely based on the "cleaned" and "focused" input space provided by the previous stages, thus ensuring its specificity and superiority for long-term collaborative fault detection of flight control servos.

[0040] These three stages form an inseparable and strongly sequential optimization chain. Each subsequent stage builds upon the output of the previous stage and deepens it, together achieving global optimization of the detection performance of the specific object, the flight control servo.

[0041] To facilitate understanding, this embodiment of the invention provides a specific implementation method for detecting abnormalities in UAV flight control servos in the face of long-delay collaborative faults.

[0042] Step 1, Data Acquisition and Preprocessing: This step details the data sources, feature composition, and standardized preprocessing procedures in the UAV flight control servo anomaly detection method, providing standardized input samples for subsequent model training.

[0043] 1.1 Data Sources and Feature Dimensions: In this embodiment, the data comes from an actual UAV flight control servo operation monitoring system, collecting two fault scenario record files and 27 normal flight record files. The raw data sampling frequency is 20 milliseconds, totaling approximately 6 million valid records, ensuring the sufficiency and diversity of the sample.

[0044] The data feature dimension includes seven measurement parameters: flight phase, left elevator servo position (primary), right elevator servo position (primary), left directional servo position (primary), right directional servo position (primary), left aileron servo position (primary), and right aileron servo position (primary). These parameters constitute a multivariate time series, fully reflecting the dynamic response characteristics of the flight control servos during UAV flight.

[0045] 1.2 Data Cleaning and Tag Supplementation: The "Fault Identifier" field in the original data contained a large number of missing values. Based on the business logic of the UAV flight control system, all missing values ​​in this field were uniformly filled with 0, indicating normal flight status; non-missing values ​​were uniformly set to 1, indicating abnormal or fault status. This processing explicitly defines the anomaly detection task as a binary classification problem, where label 0 represents normal and label 1 represents abnormal. This labeling method enables the model to learn the characteristic patterns of servo states in a balanced manner from both normal and abnormal samples.

[0046] 1.3 Data resampling and normalization: Considering the high original sampling frequency (20 milliseconds), directly using all the data would lead to excessive computational burden. This embodiment employs interlaced sampling for data resampling, specifically retaining one row out of every four rows, effectively reducing the sampling interval to 80 milliseconds and decreasing the total data volume to one-quarter of the original. This operation significantly improves the computational efficiency of subsequent experiments while maintaining the dynamic characteristics of the time series.

[0047] To eliminate differences in units and numerical ranges among different features, all numerical features except those in the flight phase are subjected to max-min normalization. The normalization formula is: ; in, These are the original eigenvalues. This is the minimum value of the feature in the training set. This is the maximum value of the feature in the training set. This is the normalized value, and its range is [0,1].

[0048] Specifically, the minimum and maximum values ​​required for normalization are calculated based on the training set data, and these parameters are saved as separate files. In subsequent model testing and deployment phases, all new input data uses the same set of parameters saved during the training phase. and Normalization is performed to ensure the consistency of data distribution.

[0049] 1.4 Sliding window sample construction: To capture the time dependency of the UAV flight control servo states, a sliding time window technique is used to reconstruct samples from the normalized sequence data. The specific construction method is as follows: For time series data, set the optimal window length. There are 14 time steps, with a sliding step size of 1. That is, starting from the 14th time step, the first valid sample is constructed. The input for each sample is all the feature values ​​from 14 consecutive time steps within a window, denoted as the input matrix. ,in The feature dimension is denoted by 'feature dimension'; the output label corresponding to this sample is the end time of the window. Corresponding fault identifier The first 13 time steps cannot form a complete window and are only retained as historical information, without generating corresponding training samples.

[0050] Through the sliding window process described above, the original point-by-point time series is transformed into a sample set with a well-defined temporal structure, and each sample can be represented as: ; in, For the first Feature vectors at each time step For the first Fault labels at any given time.

[0051] During the actual deployment phase, the airborne inference module also maintains a 14-time-first-out (FIFO) queue as a sliding window buffer. After the system starts up, it first continuously collects data for 14 time steps to fill the buffer, during which no inference is performed; after the buffer is full, each time a new frame of data is received (corresponding to an 80-millisecond interval), it is added to the tail of the queue and the oldest data at the head of the queue is discarded, forming a new 14-step input window, triggering one model inference.

[0052] 1.5 Dataset Partitioning and Evaluation Metrics: In the processed dataset, normal samples accounted for approximately 90.93%, while abnormal samples accounted for approximately 9.07%, indicating a certain degree of class imbalance. All samples were randomly divided into training and test sets in a 7:3 ratio, and a stratified sampling strategy was employed to ensure that the ratio of normal to abnormal samples in the training and test sets remained consistent with the original dataset.

[0053] To comprehensively and objectively evaluate the model performance, the following evaluation metrics are selected in this embodiment: Accuracy: ; Precision: ; Recall: ; F1 score: ; AUC value: Area under the ROC curve; Specificity: ; False positive rate (FPR): ; False negative rate (FNR, false negative rate): ; in, The number of correctly identified outlier samples. The number of correctly identified normal samples, This represents the number of normal samples that were falsely reported as abnormal. This represents the number of missed abnormal samples. Considering the high sensitivity to false alarms in practical applications, this embodiment uses the false positive rate (false alarm rate) as one of the key performance indicators.

[0054] Step 2, Time step parameter optimization: When constructing time series samples, the time step... The choice of step size directly determines the length of historical information available to the model and is a key hyperparameter affecting model performance. This step systematically studies the impact of different step size configurations on detection performance through controlled variable experiments and determines the optimal step size parameter.

[0055] 2.1 Experimental Design and Parameter Range: Based on multiple candidate time-series observation windows with different time steps, the first sample data and its flight control servo status labels corresponding to the candidate time-series observation windows are extracted from the historical flight control servo data of the UAV. For each candidate time-series observation window, the first sample data and its flight control servo status labels corresponding to the candidate time-series observation window are used to train the pre-built bidirectional attention collaborative detection model, and the first evaluation index of the trained bidirectional attention collaborative detection model is evaluated. Based on the first evaluation index, the target time-series observation window covering the abnormal trajectory of the flight control servo is determined from multiple candidate time-series observation windows.

[0056] The specific implementation process is as follows: To fairly assess the impact of the step size, the subsequent model architecture is fixed as LSTM with Attention, and only the sliding window length is changed. Specifically, test in sequence. There are 15 configurations in total, ranging from 0 to 14. This indicates the number of historical steps contained within the window; the total window length is [value missing]. (Time steps). For each configuration, data preprocessing, training hyperparameters, evaluation metrics, and other experimental conditions are kept completely consistent. Each configuration is trained, validated, and tested independently, and complete performance metrics are recorded. Based on the above experimental design, the model training and evaluation process corresponding to each step size configuration is executed according to a unified process. Specifically, for each set of candidate time series observation windows, the original time series data is first reconstructed using a sliding window based on the data preprocessing method described in step 1 to generate the corresponding training sample set. The window length is determined by the current step size, and each sample consists of consecutive time steps. The data for each time step is composed of labels that are taken from the status identifier of the last time step in the window.

[0057] Subsequently, the constructed sample data was divided into training and test sets according to a preset 7:3 ratio, and a validation set was further divided within the training set for parameter tuning and convergence monitoring during model training. All step size configurations employed the same data partitioning strategy to ensure the comparability of experimental results.

[0058] During the model training phase, for each set of candidate time-series observation windows, the model parameters were reinitialized, and each window was trained independently using the same training strategy. Specifically, this included using the same optimizer type, learning rate setting, batch size, and number of training epochs. During training, model performance changes were monitored using a validation set, and the corresponding model parameters were saved when the validation metrics reached their optimal values. To avoid the influence of random factors, model training for each configuration was conducted under the same random seed conditions to ensure the stability and repeatability of the experiment. In the model evaluation phase, the optimal model parameters after training were used to perform inference calculations on the test set to obtain the corresponding prediction results. Based on the prediction results and the true labels, the first evaluation metrics, including accuracy, precision, recall, F1 score, false positive rate, and false negative rate, were calculated. The calculation methods for these metrics were consistent with the evaluation criteria defined in step 1, thus ensuring the uniformity of evaluation results across different time-length configurations. Through this standardized experimental procedure, the comparison of model performance under different time-length parameters was established on a strictly consistent experimental basis, thereby ensuring the comparability and reliability of the results in Table 1.

[0059] 2.2 Analysis of Experimental Results: The model performance metrics under different time length configurations are shown in Table 1.

[0060] Table 1 Comparison of model performance metrics under different time lengths

[0061] As shown in Table 1, the model performance generally increases with the increase of the step size. When the window length is 15 time steps, the model achieves optimal overall performance: an F1 score of 0.9983, accuracy of 99.97%, precision of 99.93%, recall of 99.74%, a false alarm rate as low as 0.01%, and a false negative rate of 0.26%. When the step size is further increased to 15, all indicators show a slight decrease, indicating that an excessively long historical window may introduce irrelevant noise and dilute recent key state information.

[0062] 2.3 Determining the optimal step size: Based on experimental results and practical application requirements, the step size was finally determined. (Window length of 14 time steps) is the optimal configuration, mainly based on the following technical considerations: From the perspective of detection performance, Step 14 has reached or is close to the optimal level in all indicators, especially with the false alarm rate controlled at an extremely low 0.01%, which meets the requirements of industrial applications for sensitivity to false alarms.

[0063] From a physical perspective, the development timescale of UAV flight control servo anomalies typically ranges from hundreds of milliseconds to several seconds. Using an 80-millisecond sampling interval and 14 time steps corresponding to an 1120-millisecond observation window, the system can effectively capture most rapidly evolving anomaly patterns while avoiding excessively long response delays.

[0064] From a computational efficiency perspective, performance improvement plateaus when the step size exceeds 10, indicating that historical information is essentially saturated. The 14-step window maintains high accuracy while having a moderate model input dimension, which is beneficial for subsequent real-time inference and embedded deployment.

[0065] In summary, this embodiment selects a step size. As the optimal window length parameter for constructing time-series samples, it lays the foundation for subsequent feature selection and model comparison experiments.

[0066] Step 3, Feature Ablation and Screening: After determining the optimal time step, this step shifts to the optimization analysis of feature dimensions. The original data contains seven measurement features, but not all features are equally important for anomaly detection. Some features may be highly correlated, contain a lot of noise, or only have diagnostic value for specific fault types. Through feature ablation experiments, redundant features can be identified and eliminated, reducing the dimensionality of the model input and improving generalization ability and computational efficiency.

[0067] 3.1 Ablation Experiment Design: Specifically, the following steps are taken: (1) Under the target time series observation window, the reference channel combination consisting of all feature channels contained in the historical flight control servo data is used as the benchmark, and the reference channel combination is subjected to multiple feature channel ablation processing to obtain multiple alternative channel combinations; (2) With the target time series observation window and alternative channel combinations as joint constraints, the second sample data corresponding to multiple alternative channel combinations and their flight control servo status labels are extracted from the historical flight control servo data; (3) For each alternative channel combination, the second sample data corresponding to the alternative channel combination and its flight control servo status labels are used to train the pre-constructed bidirectional attention collaborative detection model and evaluate the second evaluation index of the trained bidirectional attention collaborative detection model; (4) Based on the second evaluation index, the key channel combination is determined from the alternative channel combinations.

[0068] The specific implementation process is as follows: Characteristic ablation experiments were designed using the controlled variable method: fixed step size. With all other experimental conditions unchanged, using the model with all seven features as a baseline, individual features were removed sequentially, and the changes in model performance were observed. A total of eight experiments were conducted, including one baseline experiment and seven ablation experiments removing a single feature. Each experiment was independently trained, validated, and tested, and complete performance metrics were recorded. By comparing the performance differences before and after removing a feature, the independent contribution of that feature to the anomaly detection task can be quantitatively evaluated. Based on the above ablation experiment design, the model training and evaluation processes corresponding to each feature configuration were executed according to a unified workflow. Specifically, firstly, based on the data preprocessing methods and time step parameters determined in steps 1 and 2... A sliding window was used to construct a unified time-series sample dataset from the original time-series data. This dataset remained consistent across all ablation experiments and did not change with feature removal, thus ensuring the uniformity of experimental input.

[0069] In practice, for each feature ablation configuration, after removing specified features from the complete feature set, the input feature vector is reconstructed. For example, when a servo position feature is removed, the data for that dimension is no longer included in the input matrix during the sample construction stage, while the remaining features retain their original order and normalization method. This results in a new input sample matrix: ; in, Indicates the feature index that was removed. This represents the original feature dimension.

[0070] During model training, for each ablation configuration (i.e., candidate channel combination), the model parameters were reinitialized, and the input layer structure was constructed based on the corresponding feature dimension, while the rest of the network structure remained unchanged. All experiments employed a completely consistent training strategy, including the same optimizer type, learning rate, batch size, number of training epochs, and loss function settings, thus ensuring fairness in the comparison between different feature combinations.

[0071] Furthermore, to avoid the fluctuations caused by random initialization and sample partitioning, all experiments used the same data partitioning scheme, dividing the sample data into training, validation, and test sets in a fixed ratio, while maintaining a consistent class distribution across each subset. During training, model performance was monitored using the validation set, and model parameters were saved when optimal performance was achieved for subsequent testing and evaluation.

[0072] During the model evaluation phase, the optimal model after training is used to infer on the test set to obtain prediction results. Model performance is then calculated according to preset evaluation metrics, including accuracy, precision, recall, F1 score, and secondary evaluation metrics such as false positive rate and false negative rate. By comparing the evaluation results of each ablation configuration with the baseline model, the changes in model performance after removing a certain feature can be intuitively reflected.

[0073] By using the standardized experimental procedures described above, the performance comparison of models under different feature combinations is based on unified data input, unified training strategy, and unified evaluation criteria, thereby ensuring the reliability and repeatability of the feature importance analysis results.

[0074] 3.2 Results of Feature Importance Analysis The model performance metrics under different feature ablation configurations are shown in Table 2.

[0075] Table 2 Comparison of characteristic ablation experimental results

[0076] The results in Table 2 show that: (1) After removing the “left servo position (main)” feature, the model’s F1 score improved from 0.9983 to 0.9987, and the accuracy and recall also improved simultaneously. The false negative rate decreased from 0.26% to 0.19%. This indicates that the feature has a certain degree of information redundancy or noise interference in the existing dataset, and its removal helps the model focus on more discriminative features.

[0077] (2) After removing the “flight phase” feature, the model performance decreased most significantly, with the F1 score dropping from 0.9983 to 0.9934, a decrease of about 0.49%; the false positive rate increased from 0.01% to 0.07%. This shows that flight phase information provides important contextual reference for anomaly judgment and is an indispensable key feature.

[0078] (3) Removing the remaining 5 features all resulted in varying degrees of decline in model performance, indicating that these features all have a positive contribution to anomaly detection.

[0079] 3.3 Determination of the simplified feature set: Based on the above ablation experiment results, this embodiment determines that in subsequent model comparisons and the final scheme, the 6-dimensional feature set after removing the "left directional servo position (primary)" will be used. The simplified features include: flight phase, left elevator servo position (primary), right elevator servo position (primary), right directional servo position (primary), left aileron servo position (primary), and right aileron servo position (primary).

[0080] This feature set, while maintaining high detection performance, reduces the input feature dimension from 7 to 6, decreasing the model's dependence on specific sensors, reducing computational overhead, and improving the system's robustness and deployment flexibility. All subsequent experiments and model deployments were based on this 6-dimensional feature set.

[0081] Step 4, Model Architecture Design: After completing data preprocessing, time step optimization, and feature selection, this step further constructs a deep learning model for detecting anomalies in UAV flight control servo motors. Considering that the formation process of flight control servo motor anomalies usually has obvious time dependence, and the anomaly pattern often manifests as the coordinated change of multiple servo motor channels within a certain time range, the model not only needs to have the ability to memorize long-term sequences, but also needs to be able to automatically identify the most critical time segments for anomaly determination within the sequence.

[0082] Based on the above requirements, this embodiment adopts a model structure combining a bidirectional long short-term memory network (BiLSTM) and an attention mechanism. The model consists of an input layer, a bidirectional LSTM structure, an attention mechanism layer, and a fully connected classification layer. The bidirectional LSTM structure includes at least two layers of forward LSTM units stacked in the forward path and at least two layers of backward LSTM units stacked in the backward path, with the number of stacked layers in the forward and backward paths being equal. Through layer-by-layer feature extraction and information aggregation, an end-to-end mapping from raw time-series data to anomaly probabilities is achieved.

[0083] In this embodiment, the input sample is time series data processed by a sliding window, denoted as: X ; in, Indicates batch size, Indicates the time step. This represents the dimension of the input features after feature filtering. The final output of the model is a scalar probability value. , which represents the confidence level that the current input sequence belongs to an abnormal state.

[0084] The overall computation process is as follows: the input sequence first enters the bidirectional LSTM layer for temporal feature extraction, resulting in a hidden state sequence containing forward and backward information; then, the hidden states at each time step are weighted and aggregated through an attention mechanism to generate a sequence-level context vector; finally, the classification mapping is completed through a fully connected layer, and the anomaly probability is output.

[0085] 4.1 Bidirectional LSTM Structure: Long Short-Term Memory (LSTM) is an improved recurrent neural network structure that addresses the vanishing and exploding gradient problems inherent in traditional RNNs for long sequence modeling by introducing a gating mechanism. In flight control servo anomaly detection tasks, the servo state often gradually deviates from the normal range over multiple time steps, and the state at a single moment is insufficient to independently determine whether an anomaly exists. Therefore, it is necessary to effectively memorize and filter historical information.

[0086] In one implementation, a bidirectional LSTM structure is used to map target sample data into a bidirectional hidden state sequence containing a time dimension. This includes: inputting the target sample data sequentially into a forward LSTM unit; extracting the basic temporal variation features and anomalous co-operation features of the target sample data through multiple layers of forward LSTM units; and outputting the forward hidden state from the top-level forward LSTM unit. Additionally, inputting the target sample data in reverse temporal order into a backward LSTM unit; extracting the basic temporal variation features and anomalous co-operation features of the target sample data through multiple layers of backward LSTM units; and outputting the backward hidden state from the top-level backward LSTM unit. The forward and backward hidden states corresponding to each time step in the target temporal observation window are concatenated to obtain the bidirectional hidden state corresponding to each time step, thus forming a bidirectional hidden state sequence. Specifically: For time step Let the input features be The previous hidden state was Cell state is The calculation process of the LSTM unit is as follows: Forget gates are used to control the degree to which historical information is retained: ; Input gates are used to control the degree to which the current input information is written. ; Candidate states represent new information generated from the current input: ; Cell status updated to: ; Output gates are used to control the current output information: ; The final hidden state is: ; in, For the Sigmoid function, It is the hyperbolic tangent function. This represents element-wise multiplication. (Each weight matrix...) and bias All of these are trainable parameters.

[0087] The above structure enables the model to adaptively determine which historical information needs to be retained and which needs to be forgotten based on data characteristics, thereby extracting effective features from complex time-series data.

[0088] However, standard LSTM can only utilize historical information up to the current moment. In real-world flight control scenarios, anomalies at a given moment often require consideration of the trends observed in the preceding and following time steps. For example, a momentary fluctuation in servo position might simply be noise, but if this fluctuation persists across preceding and following time steps, it is more likely to be an anomaly. Therefore, relying solely on one-way timing information can lead to inaccurate judgments.

[0089] Therefore, this embodiment employs a bidirectional LSTM structure to perform forward and backward modeling simultaneously in the time dimension. The forward LSTM processes the sequence in chronological order to obtain the forward hidden state. The backward LSTM processes the sequence in reverse order to obtain the backward hidden state. The two are concatenated to obtain the complete timing representation: ; ; In this way, the feature representation of each time step not only includes past information, but also incorporates future context information, enabling the model to more comprehensively understand the changing trends of the servo state.

[0090] In this embodiment, the bidirectional LSTM employs a two-layer stacked structure, with 128 hidden units in each layer. The first layer is primarily used to extract basic temporal variation features, such as smooth changes or short-term fluctuations in servo position. The second layer further extracts higher-level abstract features, such as cooperative anomaly patterns among multiple servos. Through this multi-layer structure, the model can progressively enhance its feature representation capabilities and improve its ability to identify complex anomaly patterns.

[0091] Finally, the BiLSTM layer outputs a sequence of hidden states: H = ; in, This represents the bidirectional hidden state at time step (t), output by the feedforward Long Short-Term Memory network. Hidden states of the feedforward long short-term memory network output It is obtained by splicing along the feature dimension.

[0092] 4.2 Attention Mechanism Layer: While BiLSTM can extract temporal dependencies from sequences, its output typically treats each time step equally, making it difficult to distinguish the importance of different time segments to the final judgment. In servo motor anomaly detection tasks, anomalies often occur concentrated at certain key time points, while other time periods may be in a stable state. If all time steps are averaged, key anomaly features may be diluted by a large amount of normal information, thus affecting the model's judgment performance.

[0093] Therefore, this embodiment introduces an attention mechanism after the BiLSTM layer to adaptively weight features in the time dimension, thereby highlighting the time segments most valuable for anomaly detection. In one implementation, the attention mechanism layer determines the importance weights corresponding to multiple time steps based on the bidirectional hidden state sequence, and aggregates the bidirectional hidden states corresponding to multiple time steps in the bidirectional hidden state sequence according to the importance weights to obtain a context vector. Specifically: For the hidden state sequence output by BiLSTM First, calculate the intermediate representation for each time step: ; in, This is the weight matrix. For bias vectors, The dimension of the attention space is represented, and in this embodiment it is preferably set to 128.

[0094] Context vector These are trainable parameters used to calculate the importance score at each time step: ; This score reflects the degree of matching between the features at the current time step and the model's focus pattern.

[0095] To obtain a normalized weight distribution, the scores are subjected to Softmax normalization: ; in, Indicates the first Attention weights at each time step, satisfying .

[0096] Finally, the hidden states at all time steps are summed using weighted averages to obtain the context vector: c = ; This vector integrates information from the entire sequence and emphasizes key time segments through weight allocation, thereby enhancing the model's ability to express anomalous features.

[0097] It should be noted that attention weight It can be used not only for internal model calculations but also for visualization analysis after model deployment. By observing the weight distribution, it is possible to intuitively determine when the model considers anomalies to be most significant, thereby providing a basis for flight failure analysis and improving the interpretability of the model.

[0098] 4.3 Fully Connected Classification Layer: In one implementation, a fully connected classification layer is used to determine the predicted flight control servo state corresponding to the target sample data based on the context vector. Specifically: after obtaining the context vector... Next, it needs to be further mapped to anomaly probabilities. This embodiment uses a two-layer fully connected network for classification.

[0099] First fully connected layer calculation: ; This is the weight matrix. The bias vector is activated by the ReLU function: ; The ReLU function truncates negative values, making the neuron output sparse, thereby enhancing the model's ability to express complex features and improving the convergence speed during training.

[0100] To prevent the model from becoming overly reliant on specific features during training, a Dropout mechanism is introduced after the first fully connected layer. Specifically, during the training phase, Dropout is applied probabilistically... Randomly setting the output of some neurons to zero disrupts the co-adaptation relationship between neurons, thereby improving the model's generalization ability. In this embodiment, the preferred setting is: .

[0101] The output after Dropout processing is denoted as: ; It should be noted that during the model inference phase, the Dropout mechanism no longer randomly masks neurons, but directly uses the complete neuron output to ensure the stability of the output results.

[0102] The calculation for the second fully connected layer is similar: ; Finally, the anomaly probability is output through the Sigmoid function: p = ; This probability value This is used to indicate the confidence level that the current input sequence belongs to an abnormal state. The closer the value is to 1, the higher the probability of an anomaly; the closer it is to 0, the higher the probability of normality. In practical applications, a threshold is set... Determine the probability when If a false alarm occurs, the threshold is considered abnormal; otherwise, it is considered normal. When it is necessary to reduce the false alarm rate, the threshold can be appropriately increased; when it is necessary to reduce the false alarm rate, the threshold can be appropriately decreased, thereby achieving flexible adjustment of detection performance in different application scenarios.

[0103] 4.4 Analysis of the advantages of the model structure: Through the above model structure design, this embodiment achieves multi-level modeling of UAV flight control servo anomalies. The bidirectional LSTM layer can capture the dependencies between events in the time series, enabling the model to consider not only historical information but also future trends when determining the current state, thereby improving the completeness of the judgment. The attention mechanism layer further weights and filters the time dimension, allowing the model to automatically focus on the key time segments where the anomaly occurs, avoiding interference from irrelevant information.

[0104] Furthermore, the multi-layer LSTM structure enhances the model's ability to represent complex temporal patterns, enabling it to identify the coordinated changes among multiple servos. The combination of fully connected layers and the Dropout mechanism improves the model's generalization performance while maintaining its classification capabilities.

[0105] In summary, the model structure combining BiLSTM and attention mechanism constructed in this embodiment outperforms traditional single time-series models in terms of time-dependent modeling, key feature extraction, and anomaly detection capabilities, providing an efficient and reliable technical solution for anomaly detection of UAV flight control servos.

[0106] Step 5, Model Training and Evaluation: After completing the model architecture design, this step details the model's training configuration, optimization strategies, and performance evaluation process. Through systematic comparative experiments and cross-validation, the effectiveness and superiority of the proposed BiLSTM with Attention model in UAV flight control servo anomaly detection tasks are fully verified.

[0107] 5.1 Training Configuration and Hyperparameters: Model training was conducted on a preprocessed and feature-selected dataset. The dataset was divided into a training set and a test set in a 7:3 ratio, with approximately 4.2 million samples in the training set and approximately 1.8 million samples in the test set. During training, 10% of the training set was randomly allocated as a validation set to monitor the model's convergence and adjust hyperparameters.

[0108] The specific configuration of the training hyperparameters is as follows: Optimizer: The Adam adaptive moment estimation optimizer is employed. The Adam optimizer combines the advantages of momentum and RMSProp, adaptively adjusting the learning rate for each parameter and performing excellently in non-stationary objective functions and sparse gradient scenarios. Its parameter update formula is: ; ; ; ; ; in, For the first Gradient of each iteration The learning rate is set in this embodiment. ; and The decay rates of the first and second moments are respectively, taking the default values. , ; To prevent smooth terms with a denominator of zero, take .

[0109] Learning rate scheduler: Employs the ReduceLROnPlateau adaptive adjustment strategy. This strategy monitors the F1 score on the validation set. If the F1 score does not significantly improve within a certain number of consecutive epochs, the learning rate is decayed by a preset factor. The specific configuration is as follows: monitoring metric is the validation set F1 score, mode is maximized, patience value is set to 5 epochs, decay factor is 0.5, and lower bound of the learning rate is set to... The learning rate update condition can be expressed as: ; in, As the attenuation factor, To minimize the improvement threshold, This is the patience value.

[0110] Batch size: Set to 64. This value strikes a balance between the stability of gradient estimation and memory footprint. For approximately 4.2 million training samples, each epoch contains approximately 65,625 parameter updates.

[0111] Maximum number of training epochs: Set to 100. In actual training, the early stopping mechanism is usually triggered between epochs 40 and 60 to avoid invalid calculations.

[0112] Gradient clipping: To prevent gradient explosion during training, the gradient norm is clipped. Let the gradient vector be... The clipping threshold is 1.0, and the gradient after clipping is: ; 5.2 Loss Function and Optimization Objective: Because there is a significant class imbalance between normal and abnormal samples in the dataset (normal samples account for approximately 90.93%, and abnormal samples account for approximately 9.07%), if the standard binary cross-entropy loss function is used, the model will tend to predict all samples as normal in order to obtain a lower overall loss, resulting in a large number of missed abnormal samples. To mitigate this problem, this embodiment uses a weighted binary cross-entropy loss function, which applies a higher penalty weight to abnormal samples, making the model pay more attention to the correct classification of minority class samples during training.

[0113] In one example, the model is trained using the flight control servo state labels and flight control servo state prediction results from the target sample data. Specifically: Let the true label for a single sample be... (0 indicates normal, 1 indicates abnormal), the model predicts the probability as follows: The weighted binary cross-entropy loss is defined as: ; in, The weights of the outlier samples, The weights are assigned to normal samples. In this embodiment, the weights are set according to the ratio of normal to abnormal samples in the training set, so that the contributions of the two types of samples to the total loss are balanced. ; In the formula, The total number of training samples, This represents the number of abnormal samples. This represents the normal sample size. After calculation, , By employing the aforementioned weighting strategy, the model's misclassification of anomalous samples will result in a loss approximately 10 times greater than that of misclassifying normal samples, thereby effectively driving the model to learn anomalous patterns.

[0114] For a containing For each batch of samples, the batch loss is the average of the losses of all samples: ; The training process aims to minimize batch loss. The gradients of the parameters of each layer are calculated using the backpropagation algorithm, and the parameters are updated by the Adam optimizer.

[0115] 5.3 Early Termination Mechanism and Model Selection: To prevent overfitting on the training set, this embodiment employs an early stopping mechanism. Specifically, after each epoch, the F1 score of the model on the validation set is calculated. If the current validation set F1 score exceeds the historical best score, the current model parameters are saved as the optimal model; otherwise, the model continues to fail to achieve its optimal performance. If the F1 score on the validation set does not improve within one epoch (i.e., does not exceed the historical best), an early stop is triggered, terminating the training process and restoring the model parameters to the historical best.

[0116] As training progresses, the training loss continues to decrease, and the validation set F1 score gradually increases. Around the 50th round, the validation set F1 score reaches its peak, then stabilizes and shows a slight downward trend. The early stopping mechanism is triggered in the 60th round, effectively avoiding overfitting.

[0117] 5.4 Model Comparison Experiment: To comprehensively evaluate the performance advantages of the proposed BiLSTM with Attention model, this embodiment selects five representative deep learning models as baselines for comparison, training and testing them under the same dataset and experimental conditions. The comparison models include: (1) ST-GCN (Spatiotemporal Graph Convolutional Network): The servo motor channels are modeled as graph nodes. The spatial dependencies between channels are captured by graph convolution, and temporal features are extracted by combining temporal convolution.

[0118] (2) Mixture of Experts: It consists of multiple parallel expert sub-networks and a gating network. The gating network dynamically weights the outputs of each expert according to the input, and is suitable for multi-mode data distribution.

[0119] (3) MSCAN (Multi-scale Convolutional Attention Network): It uses convolutional kernels of different scales to extract multi-granular temporal features in parallel and introduces channel attention mechanism to enhance the expression of key features.

[0120] (4) DRA-Net (Deep Residual Attention Network): Stacks multiple residual attention modules to alleviate the gradient degradation problem of deep networks through residual connections. The attention mechanism focuses on discriminative time segments.

[0121] (5) Self-supervised contrastive learning network: By constructing positive and negative sample pairs for contrastive learning pre-training, robust temporal representations are extracted, and then the classification layer is fine-tuned for anomaly detection.

[0122] All comparative models use the same input features (6 dimensions), time step (14), and training configuration (optimizer, learning rate, batch size, etc.) as the model of this invention to ensure the fairness of the comparison.

[0123] The core performance metrics of different models on the test set are shown in Table 3.

[0124] Table 3 Performance Comparison of Different Models

[0125] The results in Table 3 show that: (1) The BiLSTM with Attention model proposed in this embodiment of the invention has reached or is at the best level in all evaluation metrics. Its F1 score is 0.9987, accuracy is as high as 99.98%, precision is 99.93%, recall is 99.81%, false positive rate (false alarm rate) is as low as 0.01%, and false negative rate (false negative rate) is only 0.19%, which fully demonstrates the excellent detection accuracy and robustness of the model.

[0126] (2) The Mixture of Experts model achieved performance metrics comparable to the model of this invention, but its model structure is more complex, with approximately three times the number of parameters as the model of this invention, resulting in a significant increase in training and inference overhead.

[0127] (3) The ST-GCN model performed second best, with an F1 score of 0.9976 and a false negative rate of 0.37%, which was slightly higher than the model of this invention. It shows that although explicit modeling of the graph structure relationship between servo channels is beneficial, bidirectional LSTM combined with attention mechanism can implicitly capture such coupling relationship.

[0128] (4) The performance of MSCAN, DRA-Net and self-supervised contrastive learning network is relatively low. This may be because these models are designed for more general sequence modeling tasks. However, with the limited data scale of this task, complex models are prone to overfitting. Furthermore, there is a certain semantic gap between the self-supervised pre-training task and the final anomaly detection task.

[0129] The comprehensive comparison results show that the BiLSTM with Attention model designed in this embodiment of the invention achieves the best balance in terms of detection accuracy, false alarm control and computational efficiency, and is the preferred solution for UAV flight control servo anomaly detection tasks.

[0130] 5.5 Cross-validation: To further verify the model's generalization ability and stability, this embodiment employs a 5-fold cross-validation method for model evaluation. Specifically, the entire labeled dataset is divided into five disjoint subsets based on flight log files. Each time, four subsets are selected as the training set, and the remaining subset is used as the validation set. This process is repeated five times, selecting a different subset as the validation set each time. This approach ensures that the training and validation sets come from different flight sorties, more realistically reflecting the model's generalization performance in unknown flight scenarios.

[0131] The F1 score statistics for 5-fold cross-validation are as follows: First fold: F1 = 0.9985; Second fold: F1 = 0.9989; Third fold: F1 = 0.9986; Fourth fold: F1 = 0.9988; Fifth fold: F1 = 0.9987; The average F1 score was 0.9987, with a standard deviation of 0.00014. The extremely low standard deviation indicates that the model performance is highly stable across different data partitions, does not overfit to specific flight scenarios, and possesses good generalization ability and deployment reliability.

[0132] In an optional implementation, the training process of the aforementioned bidirectional attention collaborative detection model can be further improved by adopting a closed-loop process of three-module collaborative evolution, divided into two stages: initialization and iterative optimization, based entirely on the aforementioned target sample data and its flight control servo status labels: Phase 1: Starting with a pre-trained bidirectional attention-based collaborative detection model, all parameters of its bidirectional LSTM backbone are frozen; only the learnable weights of the attention layer, the context vector, and the fully connected classification head are enabled for training, and an additional learnable gating vector matching the dimension of the attention space is introduced; this sub-network is fine-tuned on target sample data to obtain the initial detector. Its output includes the anomaly detection probability and the normalized attention weight distribution.

[0133] Based on the same target sample data and its flight control servo status labels, a lightweight dual-output network is constructed as the evaluator. Input is the initial detector. The output includes a bidirectional hidden state sequence, a normalized attention weight distribution, and anomaly detection probability. Two continuous values ​​are output: one representing the probability of a missed detection and the other a false positive for that sample, denoted as the risk score. The supervision signal comes from the actual number of missed and false positive samples in the validation set. The initial evaluator is trained using regression. The construction of.

[0134] Using the inference results of the initial detector G0 on the validation set, all false negatives and false positives are identified; combined with the initial evaluator Based on the risk scores output, we analyze the time steps and channel combinations in these samples where the attention weights significantly deviate from the normal distribution, and summarize typical risk patterns. Based on this, we construct a structured training sample set, with abnormal samples and their risk scores as inputs and corresponding time-channel adjustment instructions as outputs. We then supervise the training of a lightweight Transformer model to obtain the initial improver. .

[0135] Phase Two: Current detector Applied to the batch of data to be tested, forward inference is performed to obtain the anomaly detection probability and normalized attention weight distribution of each sample, forming an initial set of detection results; The results set is compared one by one with the actual flight control servo status labels to identify the missed and false alarm samples, and their numbers are counted to form two basic performance indicators: missed alarm rate and false alarm rate. Based on the above indicators and the current evaluator For each sample's output risk score, select the samples with the highest underreporting risk score or the highest false alarm risk score to form a high-risk sample set. Input the high-risk sample set and its corresponding risk score into the current improver. This generates a set of structured calibration instructions, each of which clearly specifies the range of time steps to be adjusted, the sensor channels involved, and the suggested direction and magnitude of attention weight adjustment. Map the instruction set to the current detector At the corresponding trainable parameter positions in the attention layer, weights are updated according to the instruction suggestions to obtain the updated detector. ; Using the updated detector G k The high-risk sample set is re-inferred to obtain the updated prediction results and attention weights, which are then compared with the actual flight control servo status labels to calculate the updated false alarm rate and false alarm rate, forming the data on the improvement effect of this round. Judging the effectiveness of the improvement: If the underreporting risk score and false positive risk score of all high-risk samples show a downward trend, and the average decrease meets the preset validity threshold, then the improvement is confirmed to be effective. Set as And add the high-risk samples and their corresponding instructions from this round to... and The training data pool is updated. and Otherwise, maintain constant; Repeat the complete closed-loop process from inference to verification until no significant decrease in the risk score of any high-risk sample is observed in multiple consecutive rounds, then terminate the iteration and output the final detector. evaluator With Improver .

[0136] Step 6, Model Deployment and Application: After completing model training and performance verification, this step describes the method for deploying the trained BiLSTM with Attention model to an actual UAV flight control system, including the real-time inference process, sliding window buffer maintenance, risk alarm triggering logic, and integration with the flight control system.

[0137] 6.1 Deployment Plan Overview: This embodiment employs an external intelligent computing module deployment architecture. As an auxiliary computing unit independent of the main flight controller, the external module interacts with the flight control system via standard communication protocols, providing real-time servo anomaly detection capabilities without intruding on the core flight control code. The external module can be an embedded device with deep learning inference capabilities, performing online inference by loading pre-trained model files.

[0138] Before model deployment, the model parameters (including weight matrices and bias vectors of each layer) saved in the training environment are exported as a universal format file. During deployment, the inference engine on the plug-in module loads the model file, reconstructs the network structure that is completely consistent with the training phase, and enters a standby state.

[0139] 6.2 Sliding window buffer maintenance mechanism: In one implementation, the current flight control servo data of the UAV is written to a buffer, and the feature channels and key channels contained in the current flight control servo data are matched. The length of the buffer is consistent with the time step of the target time series observation window.

[0140] Specifically, to achieve real-time temporal inference, the add-on module needs to maintain a sliding window buffer with parameters consistent with those used in the training phase. The buffer design is as follows: Buffer capacity: fixed length This corresponds to 14 consecutive time steps.

[0141] Data structure: First-in-first-out (FIFO) queue is used, with the oldest time step data at the front of the queue and the latest time step data at the back of the queue.

[0142] Single time step data format: a vector of length 6, which sequentially stores the flight phase, left elevator position, right elevator position, right yaw position, left aileron position, and right aileron position (all normalized).

[0143] The buffer maintenance process is as follows: (1) Initialization phase: After the system is powered on, the external module begins to receive status data sent by the flight control system. During the first 14 sampling cycles (80 milliseconds per cycle, totaling 1120 milliseconds), the module only performs data enqueueing operations and does not perform inference. This phase is used to fill the buffer to full capacity.

[0144] (2) Steady-state operation phase: After the buffer is full, each time a new frame of data is received (corresponding to the first frame) (each time step), perform the following operations: New data vector Join the back of the line; If the buffer length exceeds 14, then the first element of the queue (corresponding to...) will be... Dequeue and discard; At this time, the data sequence in the buffer is: This forms a complete 14-step input window; Trigger a model inference.

[0145] This mechanism ensures that each new data arrival immediately forms a valid input sample, enabling continuous anomaly detection synchronized with the data acquisition frequency.

[0146] 6.3 Real-time Inference Process After each inference trigger, the add-on module executes the process of generating flight control servo state prediction results through the trained bidirectional attention collaborative detection model: (1) Data preprocessing: Data from 14 time steps is retrieved from the buffer and arranged into the following shape: A two-dimensional matrix. Using the normalization parameters (for each feature) saved during the training phase. and The matrix is ​​then subjected to min-max normalization to ensure that it is consistent with the distribution of the training data.

[0147] (2) Forward propagation of the model: The normalized matrix is ​​expanded to a shape of The tensor (with added batch dimension) is input into the already loaded BiLSTM with Attention model. The model computes layer by layer, and finally outputs a scalar probability value. .

[0148] (3) Result determination: Output probability With preset threshold Compare. If If the current state is deemed abnormal, it is deemed normal otherwise.

[0149] The computation time for a single inference operation can be controlled to within 10 milliseconds on a typical embedded platform, which is much smaller than the 80-millisecond sampling interval and fully meets the real-time requirements.

[0150] 6.4 Risk Alarm Triggering Logic: Considering that instantaneous noise from the sensor or brief disturbances during flight may lead to misjudgment in a single frame, this embodiment designs an alarm triggering mechanism based on continuous confirmation to improve the reliability and anti-interference capability of the alarm.

[0151] The alarm state machine is defined as follows: Normal state: No abnormalities have been detected in the system at present.

[0152] Suspicious state: An anomaly was detected in a single frame, but the conditions for continuous confirmation have not yet been met.

[0153] Alarming Status: When an anomaly is detected in multiple consecutive frames, a formal alarm is triggered.

[0154] Furthermore, the alarm state machine is equipped with a first counter (also known as a valid counter) corresponding to a suspicious state and a second counter (also known as a normal counter) corresponding to an alarm state. Based on this, the alarm state machine is switched according to the flight control servo state prediction results under multiple time frames, so as to trigger an alarm prompt when the UAV's flight control servo is abnormal.

[0155] The specific rules for triggering alarms are as follows: If the anomaly probability value is greater than the preset anomaly threshold, the alarm state machine will be switched from the normal state to the suspicious state, and the second counter will be started. The second counter is used to record the number of frames that are continuously judged as abnormal in the suspicious state. If the anomaly probability value in any time frame is less than the preset anomaly threshold, the alarm state machine is switched from the suspicious state to the normal state; or, if the number of frames recorded by the first counter is greater than the preset first frame number threshold, the alarm state machine is switched from the suspicious state to the alarm state, and the second counter is started. The second counter is used to record the number of frames that are continuously judged as normal in the alarm state. If the anomaly probability value in any time frame is greater than the preset anomaly threshold, the alarm state machine remains in the alarm state; or, if the number of frames recorded by the second counter is greater than the preset second frame number threshold, the alarm state machine is switched from the alarm state to the normal state.

[0156] In one application example: (1) When in a normal state, if the current frame inference result If so, the state transitions to a suspicious state, and a suspiciousness counter is activated. .

[0157] (2) When in a suspicious state: - If the current frame inference result ,but ; - If the current frame inference result If the state transitions back to the normal state, the system will be reset. .

[0158] (3) When a suspicious counter When the alarm state is reached, an alarm signal is sent to the main control program of the external module and the flight control system.

[0159] (4) When in alarm state: - If the current frame inference result Then start the normal counter. ; - If the current frame inference result If so, maintain the alarm status and reset. .

[0160] (5) When the counter is normal When the alarm is cleared, the status returns to normal.

[0161] In the above rules, three consecutive frames of confirmation can effectively filter out false alarms caused by transient disturbances lasting less than 240 milliseconds; clearing the alarm after 10 consecutive normal frames can avoid frequent switching of alarm states. The alarm threshold and the number of consecutive frames can be adjusted on-site according to the actual flight environment and the tolerance for false alarms / missed alarms.

[0162] 6.5 Feedback and interaction with the flight control system: The external module interacts bidirectionally with the flight control system via a standard communication interface. The interaction includes: (1) Status data reception: The external module subscribes to the UAV status messages periodically sent by the flight control system and parses out the required 6-dimensional feature data. The communication protocol can be MAVLink, UDP or a custom serial port protocol. In this embodiment, the widely used MAVLink protocol is used as an example: The module listens to the ATTITUDE message sent by the flight control system to obtain flight attitude information, listens to the SERVO_OUTPUT_RAW message to obtain the position commands of each servo channel, and combines the FLIGHT_MODE message to obtain the current flight stage.

[0163] (2) Alarm signal transmission: When the alarm state machine triggers an alarm, the external module constructs an alarm message and sends it to the flight control system. The alarm message includes the current risk level (e.g., minor anomaly, severe anomaly) and the anomaly confidence level. And optional attention weight distribution information. After receiving an alarm message, the flight control system executes corresponding actions according to the preset risk response strategy. For example, in the case of a minor anomaly, a prompt is sent to the operator through the ground station; in the case of a serious anomaly, the return-to-home or landing procedure is automatically triggered.

[0164] (3) Log recording and backtracking: The external module cyclically saves the raw sensor data, model output probabilities, and attention weight vectors for the most recent period in local storage. When an alarm event occurs, this historical data is locked and uploaded to the ground station for maintenance personnel to perform offline fault analysis and model performance evaluation. The visualization of attention weights can provide an intuitive time-based basis for fault tracing—the moment corresponding to the weight peak is the key evidence window for the model to determine an anomaly.

[0165] Through the above deployment scheme, this invention can provide UAV systems with high-precision, low-false-alarm real-time servo anomaly detection capabilities in a modular and loosely coupled manner without modifying the core flight control logic. The external module design provides plug-and-play flexibility, adapting to various flight control hardware platforms and offering broad engineering application prospects.

[0166] In summary, the key point of this invention lies in proposing a three-stage, sequentially coupled systematic optimization framework specifically designed to address the challenges of long-latency and multi-channel collaborative fault detection. This framework, through a performance feedback loop, achieves end-to-end globally optimal design from raw data to a dedicated detection model, enabling it to automatically focus on key anomaly features and improve discriminative capabilities in multivariate time-series data. This invention has at least the following characteristics: (i) Achieved in-depth optimization for specific challenges: The framework of this invention is not a general solution, but focuses on the two core difficulties in flight control servo anomaly detection: long-term delay evolution and multi-channel coordinated changes. It carries out a structured and stage-coupled design. All three optimization stages are carried out around these two characteristics. Relying on experimental data-driven approach, the optimal observation window and core feature subset are accurately calibrated, making the solution significantly irreplaceable and outstandingly innovative in solving such specific problems.

[0167] (ii) The optimal balance of key safety indicators has been achieved: Through three-stage collaborative optimization, the system achieves a high degree of coordination between the inherently contradictory indicators of recall rate (ensuring zero missed reports) and false alarm rate (eliminating false alarms). The actual test results show a recall rate of over 99.8% and a false alarm rate of less than 0.01%, which fully meets the stringent requirements of high-safety-level flight missions.

[0168] (III) Provides quantifiable insights into the cooperative behavior of the system: The feature contribution analysis in the second stage not only serves the purpose of model lightweighting, but its analysis results themselves have engineering value. It quantitatively reveals the evolution of the cooperative relationship between each servo channel under normal and abnormal conditions, such as confirming the key regulatory role of flight phase information and the redundancy of some control surface channels, providing verifiable data for fault mechanism research, sensor configuration optimization, and even control law iteration.

[0169] (iv) Possessing strong interpretability and high credibility: The fusion design of bidirectional LSTM and attention mechanism enables the model to not only output anomaly judgment results, but also to intuitively locate the key time segments and dominant channels of anomaly occurrence through attention weights, significantly improving the transparency and traceability of the decision-making process, and effectively enhancing the operator's trust in the intelligent detection results.

[0170] Based on the foregoing embodiments, this invention provides a UAV flight control servo anomaly detection device for long-delay cooperative faults. (See also...) Figure 3The diagram shows a structural schematic of a UAV flight control servo anomaly detection device for long-delay collaborative faults. The device mainly includes the following parts: The window modeling module 302 is used to perform long-delay anomaly evolution modeling on the historical flight control servo data of the UAV, and obtain a target time-series observation window covering the abnormal trajectory of the flight control servo. The channel combination quantization analysis module 304 is used to perform anomaly collaborative quantization analysis on multiple characteristic channels contained in historical flight control servo data based on the target time series observation window, and obtain key channel combinations. The sample construction module 306 is used to construct target sample data and its flight control servo status labels based on historical flight control servo data, using the target time-series observation window and key channel combination as joint constraints. The model training module 308 is used to train a pre-built bidirectional attention collaborative detection model using target sample data and its flight control servo status labels. The trained bidirectional attention collaborative detection model is used for anomaly detection based on the current flight control servo data of the UAV.

[0171] The UAV flight control servo anomaly detection device provided by this invention for long-delay collaborative faults determines the target time-series observation window through long-delay anomaly evolution modeling, enabling the model to cover the complete evolution process of the fault from its inception to its manifestation. Based on this window, multi-channel anomaly collaborative quantitative analysis is carried out to accurately identify key channel combinations that substantially contribute to the collaborative anomaly discrimination and eliminate redundant interference signals. Then, training samples are constructed using the two as joint constraints to drive the bidirectional attention collaborative detection model to learn. Thus, without introducing external priors or additional sensors, the early identification capability of slowly accumulating, multi-channel coupled anomalies is significantly improved, and the stability and consistency of anomaly judgment results are enhanced, thereby effectively making up for the shortcomings of flight control servo anomaly detection in terms of early warning timeliness and system operational reliability.

[0172] In one implementation, the window modeling module 302 is specifically used for: Based on multiple alternative time series observation windows with different time steps, the first sample data corresponding to the alternative time series observation windows and their flight control servo status labels are extracted from the historical flight control servo data of the UAV. For each candidate timing observation window, the pre-built bidirectional attention cooperative detection model is trained using the first sample data corresponding to the candidate timing observation window and its flight control servo status label, and the first evaluation index of the trained bidirectional attention cooperative detection model is evaluated. Based on the first evaluation metric, a target time-series observation window covering abnormal flight control servo trajectories is determined from multiple alternative time-series observation windows.

[0173] In one implementation, the channel combination quantization analysis module 304 is specifically used for: Under the target time series observation window, based on the reference channel combination consisting of all feature channels contained in the historical flight control servo data, multiple feature channel ablation processes are performed on the reference channel combination to obtain multiple alternative channel combinations. Using the target time-series observation window and alternative channel combinations as joint constraints, second sample data and their flight control servo status labels corresponding to multiple alternative channel combinations are extracted from historical flight control servo data. For each alternative channel combination, the pre-built bidirectional attention cooperative detection model is trained using the second sample data corresponding to the alternative channel combination and its flight control servo status label, and the second evaluation index of the trained bidirectional attention cooperative detection model is evaluated. Based on the second evaluation metric, the key channel combination is determined from the alternative channel combinations.

[0174] In one implementation, the bidirectional attention collaborative detection model includes a bidirectional LSTM structure, an attention mechanism layer, and a fully connected classification layer; the sample construction module 306 is specifically used for: The target sample data is mapped to a bidirectional hidden state sequence containing the time dimension using a bidirectional LSTM structure. Through the attention mechanism layer, the importance weights corresponding to multiple time steps are determined based on the bidirectional hidden state sequence, and the bidirectional hidden states corresponding to multiple time steps in the bidirectional hidden state sequence are aggregated according to the importance weights to obtain the context vector. The flight control servo state prediction result corresponding to the target sample data is determined by the fully connected classification layer based on the context vector. The model is trained using the flight control servo status labels and flight control servo status prediction results from the target sample data.

[0175] In one embodiment, the bidirectional LSTM structure includes at least two layers of forward LSTM units stacked in the forward path and at least two layers of backward LSTM units stacked in the backward path, wherein the number of stacked layers in the forward path and the backward path are equal; the sample construction module 306 is specifically used for: The target sample data is input into the forward LSTM unit in chronological order. The basic temporal variation features and abnormal collaborative features of the target sample data are extracted by multiple forward LSTM units, and the forward hidden state is output by the top forward LSTM unit. Additionally, the target sample data is input into the backward LSTM unit in reverse chronological order. The basic temporal variation features and abnormal collaborative features of the target sample data are extracted by multiple backward LSTM units, and the backward hidden state is output by the top backward LSTM unit. The forward hidden state and backward hidden state corresponding to each time step in the target time series observation window are concatenated to obtain the bidirectional hidden state corresponding to each time step, thus forming a bidirectional hidden state sequence.

[0176] In one implementation, an anomaly detection module is further included, for: Write the current flight control servo data of the UAV to the buffer. The feature channels and key channels contained in the current flight control servo data are matched. The length of the buffer is consistent with the time step of the target time series observation window. If the data in the buffer meets the anomaly detection triggering conditions, the trained bidirectional attention collaborative detection model generates flight control servo state prediction results. Based on the flight control servo state prediction results across multiple time frames, the alarm state machine is switched to trigger an alarm notification when the UAV's flight control servo malfunctions.

[0177] In one implementation, the alarm state machine includes a normal state, a suspicious state, and an alarm state, and is equipped with a first counter corresponding to the suspicious state and a second counter corresponding to the alarm state. The flight control servo state prediction result includes an anomaly probability value; the anomaly detection module is specifically used for: If the anomaly probability value is greater than the preset anomaly threshold, the alarm state machine will be switched from the normal state to the suspicious state, and the second counter will be started. The second counter is used to record the number of frames that are continuously judged as abnormal in the suspicious state. If the anomaly probability value in any time frame is less than the preset anomaly threshold, the alarm state machine is switched from the suspicious state to the normal state; or, if the number of frames recorded by the first counter is greater than the preset first frame number threshold, the alarm state machine is switched from the suspicious state to the alarm state, and the second counter is started. The second counter is used to record the number of frames that are continuously judged as normal in the alarm state. If the anomaly probability value in any time frame is greater than the preset anomaly threshold, the alarm state machine remains in the alarm state; or, if the number of frames recorded by the second counter is greater than the preset second frame number threshold, the alarm state machine is switched from the alarm state to the normal state.

[0178] The device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0179] This invention provides an electronic device, specifically, the electronic device includes a processor and a memory; the memory stores a computer program, which, when run by the processor, executes the method described in any of the above embodiments.

[0180] Figure 4 The present invention provides a schematic diagram of the structure of an electronic device 100, which includes a processor 40, a memory 41, a bus 42 and a communication interface 43. The processor 40, the communication interface 43 and the memory 41 are connected through the bus 42. The processor 40 is used to execute executable modules, such as computer programs, stored in the memory 41.

[0181] The memory 41 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 43 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.

[0182] Bus 42 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0183] The memory 41 is used to store programs. After receiving an execution instruction, the processor 40 executes the program. The method executed by the device for defining the flow process disclosed in any of the foregoing embodiments of the present invention can be applied to the processor 40 or implemented by the processor 40.

[0184] Processor 40 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 40 or by instructions in software form. Processor 40 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 41. The processor 40 reads the information in memory 41 and, in conjunction with its hardware, completes the steps of the above method.

[0185] The computer program product of the readable storage medium provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the foregoing method embodiments. For specific implementation, please refer to the foregoing method embodiments, which will not be repeated here.

[0186] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a portion of the technical solution, 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 steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0187] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for detecting abnormalities in UAV flight control servos in the face of long-delay collaborative faults, characterized in that, include: Long-delay anomaly evolution modeling is performed on historical flight control servo data of UAVs to obtain a target time-series observation window covering the abnormal trajectory of flight control servos. Based on the target time-series observation window, anomaly co-quantitative analysis is performed on multiple feature channels contained in the historical flight control servo data to obtain key channel combinations; Using the target time-series observation window and the key channel combination as joint constraints, target sample data and its flight control servo status labels are constructed based on the historical flight control servo data; Using the target sample data and its flight control servo status labels, a pre-built bidirectional attention collaborative detection model is trained. The trained bidirectional attention collaborative detection model is used to detect anomalies based on the current flight control servo data of the UAV.

2. The method for detecting UAV flight control servo anomalies in response to long-delay collaborative faults according to claim 1, characterized in that, Long-delay anomaly evolution modeling is performed on historical flight control servo data of the UAV to obtain a target time-series observation window covering the abnormal flight control servo trajectories, including: Based on multiple alternative time-series observation windows with different time steps, the first sample data corresponding to the alternative time-series observation windows and their flight control servo status labels are extracted from the historical flight control servo data of the UAV. For each of the candidate timing observation windows, the first sample data corresponding to the candidate timing observation window and its flight control servo status label are used to train the pre-built bidirectional attention cooperative detection model, and the first evaluation index of the trained bidirectional attention cooperative detection model is evaluated. Based on the first evaluation index, a target time-series observation window covering the abnormal trajectory of the flight control servo is determined from multiple candidate time-series observation windows.

3. The method for detecting UAV flight control servo anomalies in response to long-delay collaborative faults according to claim 1, characterized in that, Based on the target time-series observation window, anomaly co-quantification analysis is performed on multiple feature channels contained in the historical flight control servo data to obtain key channel combinations, including: Under the target time series observation window, based on the reference channel combination consisting of all feature channels contained in the historical flight control servo data, the reference channel combination is subjected to multiple feature channel ablation processes to obtain multiple alternative channel combinations. Using the target time-series observation window and the alternative channel combinations as joint constraints, extract the second sample data corresponding to multiple alternative channel combinations and their flight control servo status labels from the historical flight control servo data; For each of the alternative channel combinations, the pre-built bidirectional attention cooperative detection model is trained using the second sample data corresponding to the alternative channel combination and its flight control servo status label, and the second evaluation index of the trained bidirectional attention cooperative detection model is evaluated. Based on the second evaluation metric, the key channel combination is determined from the candidate channel combinations.

4. The method for detecting UAV flight control servo anomalies in response to long-delay collaborative faults according to claim 1, characterized in that, The bidirectional attention collaborative detection model includes a bidirectional LSTM structure, an attention mechanism layer, and a fully connected classification layer. Using the target sample data and its flight control servo status labels, a pre-built bidirectional attention cooperative detection model is trained, including: The target sample data is mapped to a bidirectional hidden state sequence containing a time dimension using the bidirectional LSTM structure. Through the attention mechanism layer, importance weights corresponding to multiple time steps are determined based on the bidirectional hidden state sequence, and the bidirectional hidden states corresponding to multiple time steps in the bidirectional hidden state sequence are aggregated according to the importance weights to obtain a context vector. The flight control servo state prediction result corresponding to the target sample data is determined by the fully connected classification layer based on the context vector. The model is trained using the flight control servo status labels and flight control servo status prediction results from the target sample data.

5. The method for detecting UAV flight control servo anomalies in response to long-delay cooperative faults according to claim 4, characterized in that, The bidirectional LSTM structure includes at least two layers of forward LSTM units stacked in the forward path and at least two layers of backward LSTM units stacked in the backward path, and the number of stacked layers in the forward path and the backward path are equal. Mapping the target sample data into a bidirectional hidden state sequence containing a time dimension includes: The target sample data is input into the forward LSTM unit in chronological order. The basic temporal variation features and abnormal collaborative features of the target sample data are extracted by the forward LSTM unit through multiple layers. The forward hidden state is output by the top-level forward LSTM unit. Furthermore, the target sample data is input into the backward LSTM unit in reverse chronological order, and the basic temporal variation features and abnormal collaborative features of the target sample data are extracted by multiple layers of the backward LSTM unit, and the backward hidden state is output by the top-level backward LSTM unit. The forward hidden state and the backward hidden state corresponding to each time step in the target time series observation window are concatenated to obtain the bidirectional hidden state corresponding to each time step, so as to form a bidirectional hidden state sequence.

6. The method for detecting UAV flight control servo anomalies in response to long-delay collaborative faults according to claim 1, characterized in that, The method further includes: The current flight control servo data of the UAV is written to a buffer. The feature channels contained in the current flight control servo data are matched with the key channels. The length of the buffer is consistent with the time step of the target time series observation window. If the data in the buffer meets the anomaly detection triggering conditions, the trained bidirectional attention collaborative detection model generates a flight control servo state prediction result. Based on the flight control servo state prediction results across multiple time frames, the alarm state machine is switched to trigger an alarm notification in the event of an abnormality in the UAV's flight control servo.

7. The method for detecting UAV flight control servo anomalies in response to long-delay cooperative faults according to claim 6, characterized in that, The alarm state machine includes a normal state, a suspicious state, and an alarm state, and is configured with a first counter corresponding to the suspicious state and a second counter corresponding to the alarm state. The flight control servo state prediction result includes an anomaly probability value. Based on the flight control servo state prediction results in multiple time frames, the alarm state machine is switched to trigger an alarm prompt when the UAV's flight control servo is abnormal, including: If the anomaly probability value is greater than the preset anomaly threshold, the alarm state machine is switched from the normal state to the suspicious state, and the second counter is started. The second counter is used to record the number of frames that are continuously judged as abnormal in the suspicious state. If the anomaly probability value in any time frame is less than the preset anomaly threshold, the alarm state machine is switched from the suspicious state to the normal state; or, if the number of frames recorded by the first counter is greater than the preset first frame number threshold, the alarm state machine is switched from the suspicious state to the alarm state, and the second counter is started, the second counter being used to record the number of frames continuously judged as normal in the alarm state. If the anomaly probability value in any time frame is greater than the preset anomaly threshold, the alarm state machine remains in the alarm state; or, if the number of frames recorded by the second counter is greater than the preset second frame number threshold, the alarm state machine is switched from the alarm state to the normal state.

8. A device for detecting abnormalities in UAV flight control servos in the face of long-delay collaborative faults, characterized in that, include: The window modeling module is used to perform long-delay anomaly evolution modeling on the historical flight control servo data of UAVs, and obtain a target time-series observation window covering the abnormal trajectory of the flight control servo. The channel combination quantization analysis module is used to perform anomaly collaborative quantization analysis on multiple feature channels contained in the historical flight control servo data based on the target time series observation window, and obtain key channel combinations. The sample construction module is used to construct target sample data and its flight control servo status labels based on the historical flight control servo data, using the target time-series observation window and the key channel combination as joint constraints. The model training module is used to train a pre-built bidirectional attention collaborative detection model using the target sample data and its flight control servo status labels. The trained bidirectional attention collaborative detection model is used to perform anomaly detection based on the current flight control servo data of the UAV.

9. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method according to any one of claims 1 to 7.