Fault diagnosis method and device of aircraft, electronic equipment and storage medium

Through the fault diagnosis method based on the k-nearest neighbor algorithm, the problem that the quadrotor vehicle fault diagnosis method is difficult to meet real-time and accuracy is solved, and fast and accurate fault recognition is achieved, improving the efficiency and reliability of fault recognition.

CN119106341APending Publication Date: 2024-12-10BEIJING INST OF TECH
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411041424.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

The fault diagnosis method of four-rotor aircraft relies on experience and complex algorithms, and is difficult to meet the requirements of real-time and accuracy, affecting the safety and reliability of the aircraft.

Method used

Using a fault diagnosis method based on k-nearest neighbor algorithm (kNN), the fault diagnosis model is constructed by training the state variable data of the aircraft, and using similarity analysis between samples to identify and classify fault types to achieve fast and accurate fault diagnosis. .

Benefits of technology

It improves the efficiency and reliability of fault identification, adapts to complex fault modes, reduces the computing burden, and ensures the safe operation of the four-rotor aircraft.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106341A_ABST
    Figure CN119106341A_ABST
Patent Text Reader

Abstract

The invention provides a fault diagnosis method and device for an aircraft, electronic equipment and a storage medium, and relates to the technical field of machine learning, and the method comprises the steps: obtaining the state variable data of the aircraft; inputting the state variable data of the aircraft into the fault diagnosis model to obtain a fault prediction result of the aircraft output by the fault diagnosis model; wherein the fault diagnosis model is obtained by training state variable sample data and fault labels of the aircraft on the basis of a k-nearest neighbor algorithm kNN model. According to the method, the similarity between the samples is analyzed by using the k-nearest neighbor algorithm, and various fault types are effectively identified and classified, so that rapid and accurate fault diagnosis is realized, and the efficiency and reliability of fault identification are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning technology, and in particular to an aircraft fault diagnosis method, device, electronic equipment and storage medium. Background Art

[0002] As a complex dynamic system, the safety and reliability of quadrotor aircraft pose challenges to real-time fault diagnosis methods. Traditional fault diagnosis methods rely on experience and complex algorithms, which are insufficient in the face of rapidly changing flight environments and complex dynamic characteristics, affecting the accuracy and real-time nature of diagnosis. Summary of the invention

[0003] The present invention provides an aircraft fault diagnosis method, device, electronic equipment and storage medium, which are used to solve the defects of aircraft fault diagnosis in the prior art, realize rapid and accurate fault diagnosis, and improve the efficiency and reliability of fault identification.

[0004] The present invention provides a method for diagnosing a fault of an aircraft, comprising the following steps: Obtain the state variable data of the aircraft; Inputting the state variable data of the aircraft into a fault diagnosis model to obtain a fault prediction result of the aircraft output by the fault diagnosis model; The fault diagnosis model is obtained by training the state variable sample data and fault labels of the aircraft on the basis of the k-nearest neighbor algorithm (kNN) model.

[0005] According to a method for fault diagnosis of an aircraft provided by the present invention, the fault diagnosis model is trained based on the following method: Determining the state variable sample data of the aircraft according to the multiplicative fault coefficient of the aircraft; According to the fault label, the state variable sample data is labeled to construct a data set; The kNN model is trained using the training data in the data set to obtain the fault diagnosis model.

[0006] According to a method for diagnosing a fault of an aircraft provided by the present invention, after the state variable sample data is labeled according to the fault label to construct a data set, the method further includes: Determining the mean and standard deviation of the training data; Centering the training data according to the mean; Scaling the centralized training data according to the standard deviation to obtain standardized training data; The kNN model is trained using the standardized training data to obtain the fault diagnosis model.

[0007] According to a method for diagnosing a fault of an aircraft provided by the present invention, after scaling the centralized training data according to the standard deviation to obtain the standardized training data, the method further comprises: Performing a parameter grid search on the parameters of the kNN model to obtain at least one parameter combination; Cross-validating the at least one parameter combination to obtain an optimal parameter combination; According to the optimal parameter combination, adjusting the parameters of the kNN model; The standardized training data is used to train the kNN model after parameter adjustment to obtain the fault diagnosis model.

[0008] According to a method for diagnosing a fault of an aircraft provided by the present invention, cross-validating the at least one parameter combination to obtain an optimal parameter combination includes: Using the at least one parameter combination to adjust the parameters of the kNN model to obtain at least one target kNN model; Perform k-fold cross validation on each target kNN model to obtain a validation result; The optimal parameter combination is determined according to the verification result.

[0009] According to a method for diagnosing a fault of an aircraft provided by the present invention, determining the state variable sample data of the aircraft according to the multiplicative fault coefficient of the aircraft comprises: Determining fault simulation data according to the multiplicative fault coefficient of the aircraft and the actuator setting output of the aircraft; Data extraction is performed on the fault simulation data to obtain the state variable sample data of the aircraft.

[0010] According to a method for fault diagnosis of an aircraft provided by the present invention, after training the fault diagnosis model, the method further comprises: Inputting the test data in the data set into the fault diagnosis model to obtain a fault prediction result of the aircraft output by the fault diagnosis model; Generating a classification report of the test data according to the fault prediction results corresponding to the test data; The classification report includes the precision, recall and K score indicators for each fault category, as well as the performance indicators of the overall model.

[0011] The present invention also provides an aircraft fault diagnosis device, comprising the following modules: A data acquisition module, used to acquire state variable data of the aircraft; A fault diagnosis module is used to input the state variable data of the aircraft into a fault diagnosis model to obtain a fault prediction result of the aircraft output by the fault diagnosis model; wherein the fault diagnosis model is obtained by training the state variable sample data and fault labels of the aircraft on the basis of a k-nearest neighbor algorithm (kNN) model.

[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a fault diagnosis method for an aircraft as described above is implemented.

[0013] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the fault diagnosis method of the aircraft as described in any one of the above is implemented.

[0014] The present invention provides an aircraft fault diagnosis method, device, electronic device and storage medium, which obtains aircraft state variable data; inputs the aircraft state variable data into a fault diagnosis model, and obtains the aircraft fault prediction result output by the fault diagnosis model; wherein the fault diagnosis model is obtained by training the aircraft state variable sample data and its fault label on the basis of the k-nearest neighbor algorithm kNN model. The present invention uses the k-nearest neighbor algorithm to analyze the similarity between samples, effectively identify and classify various fault types, thereby achieving rapid and accurate fault diagnosis and improving the efficiency and reliability of fault identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0016] Figure 1 It is a flow chart of the aircraft fault diagnosis method provided by the present invention.

[0017] Figure 2 It is a two-dimensional visualization diagram of the roll angle and pitch angle obtained by diagnosing the Actuator25 data set provided by the present invention using the kNN basic version.

[0018] Figure 3 It is a two-dimensional visualization diagram of the roll angle and pitch angle diagnosed by using the kNN improved version 1 of the Actuator25 data set provided by the present invention.

[0019] Figure 4 It is a two-dimensional visualization diagram of the roll angle and pitch angle diagnosed by using the kNN improved version 2 of the Actuator25 data set provided by the present invention.

[0020] Figure 5 It is a two-dimensional visualization diagram of the roll angle and pitch angle obtained by diagnosing the Actuator50 data set provided by the present invention using the kNN basic version.

[0021] Figure 6 It is a two-dimensional visualization diagram of the roll angle and pitch angle diagnosed by using the kNN improved version 1 of the Actuator50 data set provided by the present invention.

[0022] Figure 7 It is a two-dimensional visualization diagram of the roll angle and pitch angle obtained by diagnosing the Actuator50 data set provided by the present invention using the kNN improved version 2.

[0023] Figure 8 It is a structural schematic diagram of the aircraft fault diagnosis device provided by the present invention.

[0024] Fig. 9 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] In related technologies, the k-Nearest Neighbors (kNN) algorithm is a simple and effective supervised learning algorithm that is applied to classification and regression problems. Its basic principle is based on the similarity of samples. By calculating the distance between the sample to be classified and each sample in the training set (such as Euclidean distance and Manhattan distance), k nearest neighbor samples are found, and predictions are made based on the labels of the neighbor samples. In the classification task, kNN determines the category of the sample to be classified through a voting mechanism, that is, the category with the highest frequency is selected as the prediction result; in the regression task, the average value of the k neighbors is calculated as the prediction result.

[0027] A quadrotor is an unmanned aerial vehicle widely used in various fields. It consists of four rotors, usually driven by electric motors, and can achieve vertical take-off and landing, hovering, and flexible flight movements. The basic structure of this aircraft includes a lightweight frame, motor, rotor, flight control system (flight control system), and power supply system, usually powered by lithium polymer batteries. The working principle of the quadrotor relies on the speed regulation of different rotors, and by changing the distribution of lift and thrust, various flight movements such as ascent, descent, steering, and hovering can be achieved.

[0028] At present, the aircraft fault detection method relies on experience and complex algorithms, which is difficult to meet the real-time and accuracy requirements, and will increase the potential safety hazards of aircraft in practical applications. In order to solve the above problems, the present invention proposes an aircraft fault diagnosis method, specifically an aircraft fault diagnosis method based on a k-nearest neighbor algorithm, which analyzes the similarity between samples by using the algorithm, effectively identifies and classifies various fault types, thereby achieving fast and accurate fault diagnosis and improving the efficiency and reliability of fault identification.

[0029] Combine the following Figure 1-Figure 9 The invention describes an aircraft fault diagnosis method, an apparatus, an electronic device and a storage medium.

[0030] Figure 1 FIG. 1 is a flow chart of a method for diagnosing a fault in an aircraft provided by the present invention. Figure 1 As shown, the method includes the following: Step 101: Obtain state variable data of the aircraft.

[0031] In the embodiment of the present invention, the aircraft may be a quad-rotor aircraft, a hexacopter aircraft, an octocopter aircraft, or the like.

[0032] The state variable data of the aircraft is obtained in real time through the flight control system. For example, the relevant flight control software is used to configure and connect the aircraft's sensors, such as accelerometers, gyroscopes, magnetometers, etc. These sensors are responsible for measuring the aircraft's attitude, speed, and environmental conditions. Then, the flight control software is used to monitor the aircraft's sensor data in real time, including attitude, altitude, speed and other information. In addition, the collected state variable data can be transmitted to the ground station or data recording device through the communication interface on the aircraft (such as UART, CAN bus, etc.) for analysis and processing. Among them, the state variable data of the aircraft includes but is not limited to: Time variables: Record or label each data point with a timestamp or time interval to facilitate analysis and comparison of data at different time points.

[0033] Control input variables: describe the control instructions received by the aircraft, such as engine thrust, rudder angle, instructions from the autopilot system, etc.

[0034] Position and attitude output variables: describe the current state of the aircraft, such as longitude, latitude, altitude (position), and pitch, roll, yaw angles (attitude), etc.

[0035] Step 102: Input the state variable data of the aircraft into a fault diagnosis model to obtain a fault prediction result of the aircraft output by the fault diagnosis model.

[0036] In an embodiment of the present invention, the fault diagnosis model is obtained by training the state variable sample data and fault labels of the aircraft on the basis of the k-nearest neighbor algorithm model (i.e., kNN model). In the fault diagnosis model, the fault label is used to describe the type of aircraft fault, wherein the specific definition and classification of the fault label may vary according to the aircraft type, application scenario, and manufacturer's design. After obtaining the state variable data of the aircraft, the state variable data is input into the fault diagnosis model to obtain the fault prediction result of the aircraft output by the fault diagnosis model.

[0037] It is understandable that there are many types of aircraft failures, such as motor failure, electric regulator failure, servo failure, flight control system and actuator communication failure, and power supply system failure. The fault diagnosis model is used to predict the probability or confidence distribution of each fault type and output the fault type with the highest probability or confidence.

[0038] In order to further analyze and explain the fault diagnosis method of the aircraft proposed in the present invention, the embodiment of the present invention specifically proposes a fault diagnosis method for a quadrotor aircraft based on a k-nearest neighbor algorithm, which mainly includes the following contents: (1) In the embodiments of the present invention, Represents the thrust generated by each rotor of the quadrotor aircraft, They represent virtual control inputs respectively, and the mapping relationship between them is linear. In the embodiment of the present invention, multiplicative faults are set for u to simulate and generate a fault data set.

[0039] (2) Set different multiplicative fault coefficients and set a data point to be taken every certain number of rows (25 rows or 50 rows) to reduce the data volume and improve the diagnostic efficiency while retaining the data characteristics. After simulation, the data of related variables can be obtained in the workspace of MATLAB and further sorted to obtain the required data set. For example, a data point is taken every 25 rows or 50 rows to form different versions of data sets, Actuator25 data set and Actuator50 data set. Among them, Actuator25 data set refers to the actuator fault data set obtained by taking a row every 25 rows; Actuator50 data set refers to the actuator fault data set obtained by taking a row every 50 rows.

[0040] (3) Design a basic version of kNN. Design and implement the model training, prediction, and performance evaluation functions of the k-nearest neighbor algorithm. The advantages of the k-nearest neighbor algorithm are its intuitiveness and ease of implementation, which makes it suitable for small data sets and pattern recognition tasks. Since kNN is a lazy learning algorithm, the model training process is simple and does not require complex parameter adjustments. However, this also means that all training samples need to be traversed during prediction, which is computationally intensive and inefficient. In addition, the choice of k value is crucial to model performance. A smaller k value may lead to overfitting due to sensitivity to noise, while a larger k value may cause the model to ignore local structures, resulting in underfitting.

[0041] (4) The kNN basic version is further improved to obtain kNN improved version 1 and kNN improved version 2 respectively.

[0042] (5) Set evaluation indicators including accuracy, precision, recall and score to evaluate model performance.

[0043] (6) Use the kNN model to perform fault diagnosis on the data set.

[0044] Optionally, in step (4), the kNN model uses cross-validation to select the best parameter combination.

[0045] The embodiment of the present invention provides a quadrotor fault diagnosis method based on the k-nearest neighbor algorithm, which improves the accuracy of fault diagnosis, especially in complex fault modes, by optimizing data features and improving models, so that the method has stronger adaptability and lower computational burden. The application of this technology not only ensures the safe operation of quadrotors, but also promotes technological progress in the field of drones, and provides a practical solution for actual operations.

[0046] The fault diagnosis method of an aircraft provided by an embodiment of the present invention obtains the state variable data of the aircraft; inputs the state variable data of the aircraft into a fault diagnosis model, and obtains the fault prediction result of the aircraft output by the fault diagnosis model; wherein the fault diagnosis model is obtained by training the state variable sample data of the aircraft and its fault label on the basis of the k-nearest neighbor algorithm kNN model. The present invention analyzes the similarity between samples by using the k-nearest neighbor algorithm, effectively identifies and classifies various fault types, thereby achieving rapid and accurate fault diagnosis and improving the efficiency and reliability of fault identification.

[0047] Based on the above embodiment, the fault diagnosis model is trained based on the following method: Step 210, determining the state variable sample data of the aircraft according to the multiplicative fault coefficient of the aircraft; Step 211, annotating the state variable sample data according to the fault label to construct a data set; Step 212: Use the training data in the data set to train the kNN model to obtain the fault diagnosis model.

[0048] In an embodiment of the present invention, the state variable sample data is obtained through simulation. Specifically, the fault simulation data is determined according to the multiplicative fault coefficient of the aircraft and the actuator setting output of the aircraft; then, the fault simulation data is extracted to obtain the state variable sample data of the aircraft. Further, according to the fault label, the state variable sample data is data labeled to construct a data set, and finally the training data in the data set is used to train the kNN model to obtain a fault diagnosis model. At the same time, the test data in the data set can also be input into the fault diagnosis model to obtain the fault prediction result of the aircraft output by the fault diagnosis model, and then a classification report of the test data is generated according to the fault prediction result corresponding to the test data; wherein the classification report includes the precision, recall and K score indicators of each fault category, as well as the overall performance indicators of the model.

[0049] For example, in order to diagnose the impact of extreme faults, three types of faults with multiplicative fault coefficients of 0.1, 0.5, and 1 are set; further, in order to diagnose the impact of gradually changing faults in reality, two types of faults with multiplicative fault coefficients of 0.7 and 0.9 are set (together with the two types of faults with multiplicative fault coefficients of 0.5 and 1, they constitute four types of gradually changing faults). Therefore, a total of five types of faults with multiplicative fault coefficients of 0.1, 0.5, 0.7, 0.9, and 1 are set.

[0050] The multiplicative fault formula is as follows: ; in, is the actual output of the actuator, Set the output for the actuator, is the multiplicative fault coefficient, for example, , representing a 50% loss in actuator set output.

[0051] Then, meaningful fault diagnosis variables including time variables, control input variables, position and attitude output variables are selected, and the data sets are obtained by taking one line every 25 and 50 lines respectively (including five files 0.1.xlsx, 0.5.xlsx, 0.7.xlsx, 0.9.xlsx, 1.xlsx).

[0052] Furthermore, a kNN model is designed: the kNN model used is KNeighborsClassifier in python and is used as the basic version of kNN.

[0053] The process of kNN model training, prediction, and performance evaluation includes the following steps: (1) Data preprocessing: Since the quadcopter is a dynamic system, it is necessary to consider data over a period of time (not just data at a certain moment), so a sliding window method is used to construct the data set. The window length of the Actuator25 data set is 200, and the window length of the Actuator50 data set is 100. Then, the time series data is flattened by splicing to obtain the training data result1 to adapt to the processing capacity of the kNN algorithm.

[0054] (2) Training model: Use the training data result1 and the corresponding label train_y to train the kNN model.

[0055] (3) Model prediction: Predict the training data result1 and obtain the prediction result ytrain_pred on the training set. Predict the test data result2 and obtain the prediction result y_pred on the test set.

[0056] (4) Calculate the accuracy: Calculate the accuracy of the training set by comparing the true label train_y with the predicted result ytrain_pred; calculate the accuracy of the test set by comparing the true label test_y with the predicted result y_pred, and then output the accuracy of the training set and test set.

[0057] (5) Output classification report: Generate and output the classification report of the test set, including the precision, recall and K score indicators of each fault category, as well as the overall performance indicators.

[0058] The embodiment of the present invention trains a fault diagnosis model by using a k-nearest neighbor algorithm, and uses the fault diagnosis model to analyze the similarities between samples, thereby effectively identifying and classifying various fault types, achieving fast and accurate fault diagnosis, and improving the efficiency and reliability of fault identification.

[0059] Based on the above embodiment, after the state variable sample data is labeled according to the fault label to construct a data set, the method further includes: Step 310, determining the mean and standard deviation of the training data; Step 311, centering the training data according to the mean; Step 312, scaling the centralized training data according to the standard deviation to obtain standardized training data; Step 313: Use the standardized training data to train the kNN model to obtain the fault diagnosis model.

[0060] In machine learning, the scale of features has an important impact on the performance of the model, especially for the k-nearest neighbor algorithm. The k-nearest neighbor algorithm relies on calculating the distance between samples. Therefore, if the scales of the features are inconsistent, the larger feature value will dominate the distance calculation, thereby affecting the performance of the model. To solve this problem, the embodiment of the present invention performs standardization processing on the training data to convert the features to the same scale.

[0061] Determine the mean and standard deviation of the training data, then center the training data according to the mean, and further scale the centralized training data according to the standard deviation to obtain standardized training data; finally, use the standardized training data to train the kNN model to obtain a fault diagnosis model.

[0062] For example, the basic version of kNN is improved to obtain kNN improved version 1, in which kNN improved version 1 uses StandardScaler to standardize the data so that each feature is on the same scale, thereby improving the performance of kNN. The principle of StandardScaler is based on data standardization. It linearly transforms the data so that the data of each feature (that is, each attribute or each column) obeys the standard normal distribution, that is, the mean is 0 and the standard deviation is 1. This conversion is completed by calculating the mean and standard deviation of the feature.

[0063] StandardScaler uses the following formula for normalization: ; in, is the original data, is the mean of the feature, is the standard deviation of the feature.

[0064] In StandardScaler, the mean and standard deviation are calculated based on the training data. The fit method can be used to calculate the mean and standard deviation, and then the transform method can be used to standardize the data into a standard normal distribution.

[0065] The embodiment of the present invention uses StandardScaler to standardize data, which is an important step to improve the performance of the kNN algorithm. By converting features to the same scale, the accuracy and stability of the model can be significantly improved, thereby better capturing the inherent structure of the data.

[0066] Based on the above embodiment, after scaling the centralized training data according to the standard deviation to obtain standardized training data, the method further includes: Step 410, performing a parameter grid search on the parameters of the kNN model to obtain at least one parameter combination; Step 411, cross-validating the at least one parameter combination to obtain an optimal parameter combination; Step 412, adjusting the parameters of the kNN model according to the optimal parameter combination; Step 413: Use the standardized training data to train the kNN model after parameter adjustment to obtain the fault diagnosis model.

[0067] In order to further improve the performance of the model, the embodiment of the present invention optimizes the parameters of the model based on the kNN improved version 1 to obtain the kNN improved version 2.

[0068] Perform parameter grid search on the parameters of the kNN model to obtain at least one parameter combination, further perform cross validation on at least one parameter combination to obtain the optimal parameter combination, then adjust the parameters of the kNN model according to the optimal parameter combination, and finally use the standardized training data to train the kNN model after parameter adjustment to obtain a fault diagnosis model. The optimal parameter combination is determined by: using at least one parameter combination to adjust the parameters of the kNN model to obtain at least one target kNN model; performing k-fold cross validation on each target kNN model to obtain a validation result; and determining the optimal parameter combination according to the validation result.

[0069] For example, the main contents of kNN Improvement 2 are as follows: (1) Parameter grid search: Using GridSearchCV to perform parameter grid search is an important step in optimizing the performance of the k-nearest neighbor algorithm. GridSearchCV can be used to find the best k value (number of neighbors), weight options, and distance metrics, thereby improving the accuracy and generalization ability of the model.

[0070] In kNN, the main key parameters can be adjusted: 1) k value: The number of neighbors selected determines the complexity of the model and its sensitivity to noise.

[0071] 2) Weight: Determines the influence of neighbors on the prediction. Options include: uniform: All neighbors have the same weight. distance: The weight of neighbors is proportional to the inverse of their distance. Close neighbors have a greater influence on the prediction.

[0072] 3) Distance metric: The method used to calculate the distance between samples. Options include: euclidean: Euclidean distance, suitable for most cases. manhattan: Manhattan distance, suitable for certain specific data distributions.

[0073] Use GridSearchCV to adjust the k value (number of neighbors), weights (uniform and distance), and distance metrics (euclidean and manhattan). In kNN basic and kNN improved, k=5, weight is uniform, and distance is euclidean.

[0074] (2) Cross-validation: k-fold cross-validation is used to measure the performance and generalization ability of machine learning models. The basic idea is to divide the dataset into k subsets (folds) of equal size, and then perform k training and validation. In each iteration, the model is trained using k-1 subsets, and the remaining 1 subset is used for validation. In this way, the model can be evaluated on each subset, thereby reducing the randomness caused by data partitioning and improving the reliability of model evaluation.

[0075] Specifically, the process of k-fold cross validation is as follows: First, the original data set is randomly divided into k folds, each containing a similar number of data samples. Then, k iterations are performed, each time a different fold is selected as the validation set, and the remaining folds are used as the training set. Based on this, the model can be trained and validated on all data, ensuring that each sample has a chance to be used as test data. The advantage of this method is that it can make full use of the data, especially when the sample size is small, to avoid overfitting or underfitting problems caused by uneven data division.

[0076] For example, 5-fold cross validation is used to evaluate the performance of each set of parameters and select the best parameter combination.

[0077] The best parameter combination results for the Actuator25 dataset are:

[0078] The best parameter combination results for the Actuator50 dataset are:

[0079] The embodiment of the present invention can significantly improve the performance of the model on the training set by optimizing the model parameters, and help avoid overfitting of the model on the training set. In addition, through cross-validation, the performance, stability and generalization ability of the model can be effectively improved, thereby building a more reliable fault diagnosis model.

[0080] In one embodiment, the evaluation index of the model can also be set, mainly including the following contents: Four basic definitions are given: (True example), (false positive example), (false negatives) and (True negative example).

[0081] Accuracy definition: ; That is, the total number of correctly predicted samples divided by the total number of samples. The performance of the machine learning model can be evaluated.

[0082] Definition of precision: ; That is, the total number of samples correctly predicted to be a certain class divided by the number of samples predicted to be that class.

[0083] Recall definition: ; That is, the total number of samples correctly predicted to be a certain class divided by the number of samples that are actually of that class.

[0084] Definition of score index K: ; Take a weighted average of the precision and recall. The larger the value, the better the performance of the machine learning model.

[0085] Set relevant parameters as required, run kNN fault diagnosis and related data preprocessing programs, and obtain the diagnosis results as shown in the following table. The macro avg in the table represents the average of all categories, while the weighted avg considers the proportion of each category sample in the total sample for weighted average.

[0086] The fault diagnosis results of the Actuator25 data set (window length is 200) and the kNN basic version are as follows:

[0087] The fault diagnosis results of the Actuator25 data set (window length is 200) and the kNN improved version 1 are as follows:

[0088] The fault diagnosis results of the Actuator25 data set (window length is 200) and the improved version 2 of kNN are as follows:

[0089] The fault diagnosis results of the Actuator50 data set (window length is 100) and the kNN basic version are as follows:

[0090] The fault diagnosis results of the Actuator50 data set (window length is 100) and the kNN improved version 1 are as follows:

[0091] The fault diagnosis results of the Actuator50 data set (window length is 100) and the improved version 2 of kNN are as follows:

[0092] Furthermore, for the Actuator25 dataset and the Actuator50 dataset, the kNN basic version, kNN improved version 1, and kNN improved version 2 were used to diagnose the roll angle and pitch angle of the aircraft. The diagnosis results are shown in the figure below. Figures 2 to 7 shown.

[0093] The aircraft fault diagnosis device provided by the present invention is described below. The aircraft fault diagnosis device described below and the aircraft fault diagnosis method described above can be referenced to each other.

[0094] refer to Figure 8 The aircraft fault diagnosis device provided by the present invention includes: a data acquisition module 801 and a fault diagnosis module 802.

[0095] The data acquisition module 801 is used to acquire the state variable data of the aircraft; The fault diagnosis module 802 is used to input the state variable data of the aircraft into the fault diagnosis model to obtain the fault prediction result of the aircraft output by the fault diagnosis model; wherein the fault diagnosis model is obtained by training the state variable sample data and fault labels of the aircraft on the basis of the k-nearest neighbor algorithm kNN model.

[0096] The fault diagnosis device for an aircraft provided by an embodiment of the present invention obtains the state variable data of the aircraft; inputs the state variable data of the aircraft into a fault diagnosis model, and obtains the fault prediction result of the aircraft output by the fault diagnosis model; wherein the fault diagnosis model is obtained by training the state variable sample data of the aircraft and its fault label on the basis of the k-nearest neighbor algorithm kNN model. The present invention uses the k-nearest neighbor algorithm to analyze the similarity between samples, effectively identify and classify various fault types, thereby achieving rapid and accurate fault diagnosis and improving the efficiency and reliability of fault identification.

[0097] In one embodiment, the fault diagnosis module 802 is further used to: determine the state variable sample data of the aircraft based on the multiplicative fault coefficient of the aircraft; annotate the state variable sample data based on the fault label to construct a data set; and train the kNN model using the training data in the data set to obtain the fault diagnosis model.

[0098] In one embodiment, the fault diagnosis module 802 is also used to: determine the mean and standard deviation of the training data; center the training data according to the mean; scale the centralized training data according to the standard deviation to obtain standardized training data; and train the kNN model using the standardized training data to obtain the fault diagnosis model.

[0099] In one embodiment, the fault diagnosis module 802 is further used to: perform a parameter grid search on the parameters of the kNN model to obtain at least one parameter combination; perform cross-validation on the at least one parameter combination to obtain an optimal parameter combination; adjust the parameters of the kNN model according to the optimal parameter combination; and use standardized training data to train the kNN model after parameter adjustment to obtain the fault diagnosis model.

[0100] In one embodiment, the fault diagnosis module 802 is further used to: use the at least one parameter combination to adjust the parameters of the kNN model to obtain at least one target kNN model; perform k-fold cross validation on each target kNN model to obtain a validation result; and determine the optimal parameter combination based on the validation result.

[0101] In one embodiment, the fault diagnosis module 802 is further used to: determine fault simulation data according to the multiplicative fault coefficient of the aircraft and the actuator setting output of the aircraft; and perform data extraction on the fault simulation data to obtain the state variable sample data of the aircraft.

[0102] In one embodiment, the fault diagnosis module 802 is further used to: input the test data in the data set into the fault diagnosis model to obtain the fault prediction result of the aircraft output by the fault diagnosis model; generate a classification report of the test data according to the fault prediction result corresponding to the test data; the classification report includes the precision, recall rate and K score indicators of each fault category, as well as the overall performance indicators of the model.

[0103] Fig. 9 An example of a physical structure diagram of an electronic device is shown in FIG. Fig. 9As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communication interface 920 and the memory 930 communicate with each other through the communication bus 940. The processor 910 may call the logic instructions in the memory 930 to execute the fault diagnosis method of the aircraft, the method comprising: obtaining the state variable data of the aircraft; inputting the state variable data of the aircraft into the fault diagnosis model to obtain the fault prediction result of the aircraft output by the fault diagnosis model; wherein the fault diagnosis model is obtained by training the state variable sample data of the aircraft and its fault label on the basis of the k-nearest neighbor algorithm kNN model.

[0104] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0105] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the aircraft fault diagnosis method provided by the above-mentioned methods, and the method includes: obtaining state variable data of the aircraft; inputting the state variable data of the aircraft into a fault diagnosis model to obtain a fault prediction result of the aircraft output by the fault diagnosis model; wherein the fault diagnosis model is obtained by training the state variable sample data of the aircraft and its fault label based on the k-nearest neighbor algorithm kNN model.

[0106] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the aircraft fault diagnosis method provided by the above-mentioned methods, the method comprising: obtaining state variable data of the aircraft; inputting the state variable data of the aircraft into a fault diagnosis model to obtain a fault prediction result of the aircraft output by the fault diagnosis model; wherein the fault diagnosis model is obtained by training the state variable sample data of the aircraft and its fault label on the basis of the k-nearest neighbor algorithm kNN model.

[0107] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0108] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for diagnosing a fault in an aircraft, characterized in that: include: Obtain the state variable data of the aircraft; Inputting the state variable data of the aircraft into a fault diagnosis model to obtain a fault prediction result of the aircraft output by the fault diagnosis model; The fault diagnosis model is obtained by training the state variable sample data and fault labels of the aircraft on the basis of the k-nearest neighbor algorithm (kNN) model.

2. The aircraft fault diagnosis method according to claim 1, characterized in that: The fault diagnosis model is trained based on the following method: Determining the state variable sample data of the aircraft according to the multiplicative fault coefficient of the aircraft; According to the fault label, the state variable sample data is labeled to construct a data set; The kNN model is trained using the training data in the data set to obtain the fault diagnosis model.

3. The aircraft fault diagnosis method according to claim 2, characterized in that: After the state variable sample data is labeled according to the fault label to construct a data set, the method further includes: Determining the mean and standard deviation of the training data; Centering the training data according to the mean; Scaling the centralized training data according to the standard deviation to obtain standardized training data; The kNN model is trained using the standardized training data to obtain the fault diagnosis model.

4. The method for diagnosing a fault in an aircraft according to claim 3, characterized in that: After scaling the centralized training data according to the standard deviation to obtain standardized training data, the method further includes: Performing a parameter grid search on the parameters of the kNN model to obtain at least one parameter combination; Cross-validating the at least one parameter combination to obtain an optimal parameter combination; According to the optimal parameter combination, adjusting the parameters of the kNN model; The standardized training data is used to train the kNN model after parameter adjustment to obtain the fault diagnosis model.

5. The method for diagnosing a fault in an aircraft according to claim 4, characterized in that: The cross-validating the at least one parameter combination to obtain the optimal parameter combination includes: Using the at least one parameter combination to adjust the parameters of the kNN model to obtain at least one target kNN model; Perform k-fold cross validation on each target kNN model to obtain a validation result; The optimal parameter combination is determined according to the verification result.

6. The aircraft fault diagnosis method according to claim 2, characterized in that: Determining the state variable sample data of the aircraft according to the multiplicative fault coefficient of the aircraft includes: Determining fault simulation data according to the multiplicative fault coefficient of the aircraft and the actuator setting output of the aircraft; Data extraction is performed on the fault simulation data to obtain the state variable sample data of the aircraft.

7. The method for diagnosing a fault in an aircraft according to any one of claims 2 to 3, characterized in that: After training the fault diagnosis model, the method further includes: Inputting the test data in the data set into the fault diagnosis model to obtain a fault prediction result of the aircraft output by the fault diagnosis model; Generating a classification report of the test data according to the fault prediction results corresponding to the test data; The classification report includes the precision, recall and K score indicators for each fault category, as well as the performance indicators of the overall model.

8. A fault diagnosis device for an aircraft, characterized in that: include: A data acquisition module, used to acquire state variable data of the aircraft; A fault diagnosis module is used to input the state variable data of the aircraft into a fault diagnosis model to obtain a fault prediction result of the aircraft output by the fault diagnosis model; wherein the fault diagnosis model is obtained by training the state variable sample data and fault labels of the aircraft on the basis of a k-nearest neighbor algorithm (kNN) model.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the fault diagnosis method for an aircraft as claimed in any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the fault diagnosis method for an aircraft as claimed in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Data-driven unmanned aerial vehicle flight control system real-time defect prediction system and method

    CN119902559A

  • A data-driven real-time defect prediction system and method for unmanned aerial vehicle flight control systems

    CN119902559B

  • Aircraft fault detection method based on orthogonal moment signal characteristics

    CN120910675A

  • Open fault identification method for driving motor of maritime work equipment

    CN122283438A

  • A Method for Diagnosing a Multi-Copter Based on an Artificial Intelligence Algorism

    KR102997265B1