# Acquisition and Processing of UAV Fault Data Based on Time Line Modeling Method
## 1 Introduction  
With the rapid development of control theory, aerodynamic technology, navigation technology, and communication technology, the application of drones in agricultural image acquisition [1], traffic monitoring [2], environment detection [3], etc., is gradually increasing. According to statistics from the Civil Aviation Administration of China, at the end of 2021, there were 830,000 drones registered with their real names in China alone [4]. However, due to the drone's structural complexity and the flight environment's variability and instability, the flight of the drone is often affected by external factors such as weather and buildings, resulting in potential safety hazards. After the drone fails, if no remedial measures are taken, it may cause the drone to crash and cause loss of life or property to nearby people. For example, the failure of GPS will lead to the crashing of drones. According to the report from the British Aviation Accidents Committee, a British survey drone fell on a roof due to GPS failure [5]. The current security issues of UAVs have attracted widespread attention in the academic community, and the anomaly detection of UAVs has become one of the current research topics. Figure 1 shows a typical UAV anomaly detection network architecture. Thefault detection model can be deployed on the GCS, and when the fault detection model receives the log, it will be inputted to the fault detection model for judgment in order to obtain the current state of the drone. With the development of artificial intelligence technology, machine learning methods are widely applied to the fault detection of UAVs. Machine learning models based on drone flight logs require a large number of samples for training, but due to the following reasons, it is often challenging to obtain drone flight data that can be directly used for model training:  
* The logs of commercial drones are not open source and cannot be obtained. The flight log of the open-source UAV includes information such as the flight status, telemetry log, sensor information, communication information, and hardware status of the UAV within a time window T0-T1. Its data volume is large, the dimension of features is high, and the description of features is not uniform; that is, heterogeneous data from different sensors and features are difficult to process. * During the flight of the UAV, the time of abnormal flight is much lower than that of normal flight, which makes the number of samples when the UAV fails much lower than that of normal flight, and it is challenging to obtain abnormal data. Due to the extreme imbalance of the data, it is difficult for models to learn the abnormal data, so the unbalanced flight log cannot be directly used for the fault detection of the UAV. Given the above problems, this paper proposes a method based on Time Line Modeling to acquire and process UAV fault flight data in a simulation environment. This paper constructs the flight mission of the UAV in the simulation environment and realizes the original collection of the flight log. The time-related features and non-universal features are removed, and the feature selection of UAV data is realized. The initial and end positions of the fault data are determined using the Fault Time Point Anchoring Method. The Time Window Stretching method is used to effectively supplement the abnormal data so that the data becomes balanced. Machine learning and deep learning algorithms, such as K-NN, AdaBoost, random forest, Naive Bayesian, Decision Tree, CNN, etc., are used to evaluate the obtained data sets. The experiment proved that the acquisition method of UAV fault data in the simulation environment proposed in this paper is effective in UAV fault detection. In the rest of this paper, Section 2 introduces the related work. Section 3 introduces the construction method of UAV flight tasks in the simulation environment. Section 4 introduces the Time Point Anchoring method and the balance processing method of positive  
Figure 1: A typical drone anomaly detection network architecture.