Automobile fault detection method based on big data

Through the method of hierarchical grouping features and dynamic selection of LSTM sub-model output results, the problem of large data calculation volume and low model performance in automobile fault detection is solved, and the accuracy of fault detection and the stability of the model are improved.

CN118245849BActive Publication Date: 2024-09-27BEIJING DEHE SHUNTIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410628024.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-09-27
Estimated Expiration
2044-05-21

AI Technical Summary

Technical Problem

In existing automobile fault detection methods, too many dimensions of the original data lead to heavy calculations, poor feature extraction effects, and poor feature selection accuracy, resulting in low accuracy of fault detection results; improper model loss design and poor parameter optimization lead to poor model performance. Too low.

Method used

Use a hierarchical method to group features, determine feature relationships through cumulative dominance comparison, objectively evaluate feature importance, and set removal thresholds and verification methods in feature extraction; use input layer, MoE layer and output layer architecture, through the gating network Dynamically select the LSTM sub-model output results, and optimize the model parameters combined with the gradient enhanced regression tree.

Benefits of technology

It improves the accuracy of feature selection and the stability and reliability of the model, and enhances the accuracy of fault detection results and the flexibility and robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118245849B
    Figure CN118245849B
Patent Text Reader

Abstract

The present invention discloses a method for automobile fault detection based on big data, and the method includes data collection, data preprocessing, feature hierarchization, finding the optimal combination of hierarchical numbers, feature extraction, establishing an automobile fault detection model and automobile fault detection. The present invention belongs to the field of automobile fault detection technology, and specifically refers to a method for automobile fault detection based on big data. The scheme groups features in a hierarchical manner to improve the accuracy of feature selection; by setting removal thresholds and verification methods; and giving priority to high-level feature combinations; the model's ability to characterize data is enhanced; the architecture of the input layer, MoE layer and output layer is adopted, and the output results are dynamically selected through a gated network, which improves the flexibility and robustness of the model; the loss function considers the error between the output of the expert network and the true label, so that the model fits the data more accurately; the model parameters are optimized based on the gradient enhancement regression tree to ensure the accuracy and stability of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automobile fault detection, and in particular to an automobile fault detection method based on big data. Background Art

[0002] The automobile fault detection method based on big data is a method that uses big data technology and related algorithms to identify and predict automobile faults. It collects, stores, processes and analyzes a large amount of automobile sensor data, vehicle operation data, maintenance records and other information to mine patterns, laws and anomalies related to automobile faults, so as to achieve early detection, prediction and diagnosis of faults. However, the general automobile fault detection method has the problems of too many dimensions of original data leading to excessive data calculation, poor feature extraction effect leading to low feature interpretability, poor feature selection accuracy, and thus low accuracy of fault detection results; the general automobile fault detection method has the problems of improper model loss design leading to the inability of the model to accurately fit the data, and poor optimization of model parameters leading to low model performance. Summary of the invention

[0003] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides a method for automobile fault detection based on big data. In view of the problem that the general automobile fault detection method has too many dimensions of original data, resulting in excessive data calculation, poor feature extraction effect, low feature interpretability, and poor accuracy of feature selection, which leads to low accuracy of fault detection results, this solution groups features in a hierarchical manner and uses cumulative dominance comparison to determine the dominance relationship between features; objectively evaluates the importance of features, avoids subjective setting of thresholds, and improves the accuracy of feature selection; in the feature extraction process, by setting removal thresholds and verification methods; and gives priority to high-level feature combinations; enhances the model's ability to characterize data, and enhances the stability and reliability of the model; in view of the problem that the general automobile fault detection method has improper model loss design, resulting in the model being unable to accurately fit the data, and poor model parameter optimization resulting in too low model performance, this solution adopts the architecture of input layer, MoE layer and output layer, and dynamically selects the output result of each LSTM sub-model through a gated network, thereby improving the flexibility and robustness of the model; the loss function considers the error between the output of the expert network and the true label, so that the model fits the data more accurately; the model parameters are optimized based on the gradient enhancement regression tree to ensure the accuracy and stability of the model.

[0004] The technical solution adopted by the present invention is as follows: The automobile fault detection method based on big data provided by the present invention comprises the following steps:

[0005] Step S1: data collection;

[0006] Step S2: data preprocessing;

[0007] Step S3: feature hierarchization;

[0008] Step S4: Find the optimal number of combination levels;

[0009] Step S5: feature extraction;

[0010] Step S6: Establishing a vehicle fault detection model;

[0011] Step S7: Vehicle fault detection.

[0012] Furthermore, in step S1, the data collection is to collect historical data; the historical data includes sensor data, vehicle maintenance records, operating environment data, operation data, vehicle characteristic data, battery data, vehicle sound data, time data and vehicle detection results, and the vehicle detection results include normal vehicle and vehicle fault types, and the vehicle detection results are used as data labels.

[0013] Furthermore, in step S2, the data preprocessing is to perform data cleaning, data conversion, standardization and data set division on the collected data; the data cleaning is to process missing values, duplicate values ​​and outliers; the data conversion is to convert the data into a vector form, and finally obtain a time series data set; the standardization is to standardize the data based on the maximum and minimum normalization method; the data set division is to divide the data into a training set and a test set.

[0014] Furthermore, in step S3, the feature hierarchization is to hierarchize the features according to the cumulative dominance relationship between the features; specifically, the following steps are included:

[0015] Step S31: Initialization: Initialize the feature set, set the hierarchical index front to 1, create an empty list F(front).f for storing features; for each feature i, initialize N to 0 and S to an empty list; traverse the features and perform cumulative dominance comparisons between features. If the i-th feature dominates another feature, add the dominated feature to the list S of the i-th feature, otherwise add 1 to the N of the i-th feature; after the traversal, if N is equal to 0, it means that the i-th feature is the highest non-dominated level feature, and store feature i in the current front layer; the cumulative dominance comparison process is as follows:

[0016] Step S311: Traverse category k. For any two features, if p(i, k) < p(j, k), increment dom_less by 1; if p(i, k) = p(j, k), increment dom_equal by 1; if p(i, k) > p(j, k), increment dom_more by 1; where p(i, k) and p(j, k) are the mutual information between the ith feature and the jth feature and the kth category respectively; dom_less, dom_equal, and dom_more are values used to accumulate dominance counts.

[0017] Step S312: Cumulative dominance determination. If dom_more equals 0 and dom_equal does not equal the number of categories, feature i is dominated by feature j; if dom_less equals 0 and dom_equal does not equal the number of categories, feature i dominates feature j.

[0018] Step S32: For the feature set F(front).f of the current front layer, if it is empty, execute the following loop:

[0019] Step S321: Create an empty list Q to store features in the next priority.

[0020] Step S322: Traverse the features. If the S of a feature is not empty, traverse each feature in S: decrement N by 1 each time; if N equals 0, add the traversed feature to Q, indicating that these features are stored in the next priority.

[0021] Step S323: Increment front by 1, move to the next level, and set F(front).f to the feature set stored in Q.

[0022] Step S33: Repeat Step S32 until all features are processed.

[0023] Step S34: Return the constructed hierarchical feature set F.

[0024] Furthermore, in Step S4, the finding of the optimal combination level number is to determine the optimal number of levels of feature combinations for feature grouping; specifically, it includes the following steps:

[0025] Step S41: Preset, calculate the number of levels di; the total number of features wi; initialize the hole array tn to record the number of features in each layer; traverse the number of levels, and for each layer, add the number of features ttn in that layer to tn.

[0026] Step S42: Determine the number of levels, if di is not less than 2; initialize the number of levels ki = 2, let k = di-ki + 1, k is the maximum number of available levels; initialize summ to an empty array; for each i from 1 to k, calculate the sum of the number of features of every two layers and add it to summ; record the sum of the number of features of the first layer and the last layer; if di is less than 2, calculate summ as the sum of the number of features of all layers in tn;

[0027] Step S43: Calculate the maximum number of features, calculate maxtn as the maximum value in summ; set ti to half of wi, that is, half of the total number of features;

[0028] Step S44: adjusting the number of layers, specifically including:

[0029] Step S441: If maxtn is not less than ti, set ki equal to di;

[0030] Step S442: when maxtn is less than ti;

[0031] Step S4421: gradually increase ki, update k=di-ki+1, and reset summ to an empty array;

[0032] Step S4422: For each index j from 1 to k, calculate the sum of the number of features in each two layers and add it to summ;

[0033] Step S4423: Update maxtn to the maximum value in summ; update ti to the rounded value of wi divided by ki;

[0034] Step S4424: If maxtn is not less than ti, go to step S45; otherwise go to step S4421;

[0035] Step S45: Return the optimal level number ki.

[0036] Furthermore, in step S5, the feature extraction specifically includes the following steps:

[0037] Step S51: feature removal, a removal threshold is set in advance, and features whose mutual information with all categories is lower than the removal threshold are deleted;

[0038] Step S52: feature grouping, grouping the features into ki feature subsets based on the optimal number of layers; and performing high-level priority combination. If the number of feature layers is greater than the optimal number of layers, the features are combined in order from high to low layers;

[0039] Step S53: feature selection, verifying the generated feature subsets, selecting the best feature subset as the feature extraction result, and updating the training set and test set after feature extraction.

[0040] Furthermore, in step S6, the establishment of the automobile fault detection model specifically includes the following steps:

[0041] Step S61: Model architecture design. The established automobile fault detection model includes an input layer, a MoE layer, and an output layer. The input layer receives the feature-extracted data set and converts it into a discrete event sequence. The MoE layer consists of multiple expert networks, each of which is an LSTM network used to learn the features and long-term dependencies of the data. The gating network determines the importance of each expert network to the input data. The output layer receives the output of the MoE layer and makes the final prediction.

[0042] Step S62: Input layer design, the input layer consists of input sample data and multiple different LSTM sub-models; specifically, the time series sample data is input into different LSTM sub-models, and each LSTM sub-model unit transmits time information by using the output of the previous moment as the input of the current moment; the learning result of each LSTM sub-model is represented by probability distribution; the representation used is as follows:

[0043] ;

[0044] ;

[0045] ;

[0046] In the formula, y t+1 and t They are the prediction results of the LSTM sub-model at time t+1 and time t respectively; argmax γ1 is the operator that maximizes the probability under given conditions, γ1 is the gating mechanism; n is the number of LSTM sub-models; is the probability distribution predicted by the model; y is the model prediction result; x t+1 is the input sample data at time t+1; y(x i ) is the output result of the automobile fault detection model for the i-th input sample; g(x i ) e is the output of the e-th LSTM sub-model of the gating network for the i-th input sample; f e (x i ) is the output result of the i-th input sample in the e-th LSTM sub-model; is the output of the gating network; W g is the weight matrix of the gating network; softmax(·) is the softmax activation function;

[0047] Step S63: MoE layer design. The MoE layer consists of multiple expert networks. First, the learning results of the upstream input layer are input into the expert network. Each expert network is responsible for dynamically selecting the LSTM for the upstream input sample through the gating network. Then, the outputs of multiple expert networks are mapped to a weight vector. The loss function is expressed as follows:

[0048] ;

[0049] Where L is the loss function; g i is the output of the i-th expert network, which is a weight vector used to dynamically select the weight of the output results of each LSTM sub-model; y is the true label of the input sample; f i is the model prediction label; I is the total number of samples;

[0050] Step S64: Output layer design. The output layer generates the final output result by weight calculation of the multi-layer expert model; and adjusts the model parameters based on the gradient; the output result of the final model is the output vector matrix and weight vector g of all LSTM sub-models i The product of; the formula used is as follows:

[0051] ;

[0052] ;

[0053] In the formula, is the loss function for each LSTM sub-model output f i The gradient of is used to correct the parameters of each LSTM sub-model; is the loss function L for each input sample x i The gradient of is used to correct the expert network weights;

[0054] Step S65: Model parameter optimization, building a learner based on the gradient boosting regression tree to optimize the model parameters; specifically including:

[0055] Step S651: Initialize the weak learner and the first regression tree to minimize the loss function; it is expressed as follows:

[0056] ;

[0057] In the formula, f 0 (x) is the prediction function of the first regression tree, which indicates the initial state of the model; N is the number of samples in the training set; c is the regression tree parameter, which indicates the state of the current learner; argmin is the parameter operator for minimization; L(y i ,c) is the loss of the automobile fault detection model in the current learner state;

[0058] Step S652: Calculate the negative gradient for the sample. During the iteration process of the gradient boosting regression tree, a new regression tree will be generated in each iteration, where each new regression tree is trained on the negative gradient of the previous tree. The formula used to calculate the negative gradient is as follows:

[0059] ;

[0060] In the formula, r im is the negative gradient of the i-th sample; L(y i -f(x i )) is the loss between the true label and the predicted value of the vehicle fault detection model for the xth sample in the current model state; f(x)=f (m-1) x indicates that the current prediction model is equal to the regression tree obtained at the m−1th iteration; f(x) is the output of the gradient boosting regression tree;

[0061] Step S653: The calculated negative gradient is regarded as the true value of the sample, and the data (x i ,r im ) is considered as the training data for the next tree to obtain a new regression tree f m (x), each leaf node represents the prediction result of a data; the leaf node corresponding to the new regression tree is denoted as R jm ;

[0062] Step S654: For the leaf node region, calculate the best fitting value;

[0063] ;

[0064] In the formula, zr im is the best fit value of the i-th sample in the m-th iteration; L(y i ,f m-1 (x i )+γ) is used to measure the predicted value f m-1 (x i )+γ and the loss of the true value; f m-1 (x i ) is the predicted value of the learner obtained in the m-1th iteration; γ is the adjustment of the fitting value of the current leaf node area;

[0065] Step S655: Update the learner and obtain the final learner. At this time, the parameters of the vehicle fault detection model represented by the learner are optimal; the formula used is as follows:

[0066] ;

[0067] ;

[0068] In the formula, f m(x) is the learner at the mth iteration and also the new regression tree; is the best fit value of the jth leaf node region at the mth iteration; I(·) is the indicator function; J is the number of leaf nodes; f(x) is the final learner; M is the maximum number of iterations;

[0069] Step S66: Model evaluation. A correctness threshold is pre-set. When the prediction rate of the vehicle fault detection model trained based on the training set for the test set is higher than the correctness threshold, the vehicle fault detection model is established; otherwise, the data set is re-divided to train the model.

[0070] Furthermore, in step S7, the vehicle fault detection is based on the established vehicle fault detection model, real-time data of the vehicle fault detection is collected, and the output of the vehicle fault detection model to the real-time data is used as the vehicle fault detection result.

[0071] The beneficial effects achieved by the present invention using the above scheme are as follows:

[0072] (1) In view of the problems of too many dimensions of original data leading to excessive data calculation, poor feature extraction effect leading to low feature interpretability, and poor accuracy of feature selection, which in turn leads to low accuracy of fault detection results, this solution groups features in a hierarchical manner and uses cumulative dominance comparison to determine the dominance relationship between features. It objectively evaluates the importance of features and avoids subjective threshold setting, thereby improving the accuracy of feature selection. In the feature extraction process, it sets removal thresholds and verification methods and gives priority to high-level feature combinations. This enhances the model's ability to represent data and improves the stability and reliability of the model.

[0073] (2) In view of the problems that general automobile fault detection methods have, such as improper model loss design resulting in the model being unable to accurately fit the data, and poor model parameter optimization resulting in low model performance, this solution adopts the architecture of input layer, MoE layer and output layer, and dynamically selects the output result of each LSTM sub-model through the gating network, thereby improving the flexibility and robustness of the model; the loss function considers the error between the output of the expert network and the true label, so that the model can fit the data more accurately; the model parameters are optimized based on the gradient boosting regression tree to ensure the accuracy and stability of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 A schematic diagram of the process of the automobile fault detection method based on big data provided by the present invention;

[0075] Figure 2 It is a flowchart diagram of step S6.

[0076] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION

[0077] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0078] In the description of the present invention, it should be understood that terms such as “upper”, “lower”, “front”, “back”, “left”, “right”, “top”, “bottom”, “inside” and “outside” indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as limiting the present invention.

[0079] Example 1, see Figure 1 The present invention provides a method for automobile fault detection based on big data, which comprises the following steps:

[0080] Step S1: data collection, collecting historical data;

[0081] Step S2: Data preprocessing, data cleaning, data conversion, standardization and data set division of the collected data;

[0082] Step S3: feature hierarchization, stratifying the features according to the cumulative dominance relationship between the features;

[0083] Step S4: Find the optimal number of combination levels and determine the optimal number of feature combination levels to perform feature grouping;

[0084] Step S5: feature extraction, combining hierarchical features based on the optimal number of levels, and finally extracting features;

[0085] Step S6: Establishing a vehicle fault detection model, based on the architecture of the input layer, the MoE layer and the output layer, optimizing the model parameters based on the gradient boosting regression tree;

[0086] Step S7: Vehicle fault detection.

[0087] Example 2, see Figure 1, this embodiment is based on the above embodiment. In step S1, the historical data includes sensor data, vehicle maintenance records, operating environment data, operation data, vehicle feature data, battery data, vehicle sound data, time data, and vehicle inspection results. The vehicle inspection results include normal vehicle conditions and vehicle fault types, and the vehicle inspection results are used as data labels.

[0088] Embodiment Three, refer to Figure 1 , this embodiment is based on the above embodiment. In step S2, the data cleaning is to handle missing values, duplicate values, and outliers; the data transformation is to transform the data into vector form, and finally obtain a time series data set; the normalization process is to normalize the data based on the maximum-minimum normalization method; the data set division is to divide the data into a training set and a test set.

[0089] Embodiment Four, refer to Figure 1 , this embodiment is based on the above embodiment. In step S3, the feature hierarchical process specifically includes the following steps:

[0090] Step S31: Initialization: Initialize the feature set, set the hierarchical index front to 1, create an empty list F(front).f to store features; for each feature i, initialize N to 0 and S to an empty list; traverse the features and perform cumulative dominance comparison between features. If the i-th feature dominates another feature, add the dominated feature to the list S of the i-th feature, otherwise increment N of the i-th feature by 1; after the traversal, if N is equal to 0, it means the i-th feature is the highest non-dominated level feature, and store feature i in the current front layer; the cumulative dominance comparison process is as follows:

[0091] Step S311: Traverse category k. For any two features, if p(i,k) < p(j,k), increment dom_less by 1; if p(i,k) = p(j,k), increment dom_equal by 1; if p(i,k) > p(j,k), increment dom_more by 1; where p(i,k) and p(j,k) are the mutual information between the i-th feature and the j-th feature and the k-th category respectively; dom_less, dom_equal, and dom_more are values used for cumulative dominance counting;

[0092] Step S312: Cumulative dominance determination. If dom_more is equal to 0 and dom_equal is not equal to the number of categories, then feature i is dominated by feature j; if dom_less is equal to 0 and dom_equal is not equal to the number of categories, then feature i dominates feature j;

[0093] Step S32: For the feature set F(front).f of the current front layer, if it is empty, execute the following loop:

[0094] Step S321: Create an empty list Q for storing features in the next priority level;

[0095] Step S322: Traverse the features. If the feature S is not empty, traverse each feature in S: subtract 1 from N each time traversal is performed; if N is equal to 0, add the traversed features to Q, indicating that these features are stored in the next priority level;

[0096] Step S323: add 1 to front, move to the next level, and set F(front).f to the feature set stored in Q;

[0097] Step S33: repeat step S32 until all features are processed;

[0098] Step S34: Return the constructed hierarchical feature set F.

[0099] Example 5, see Figure 1 Based on the above embodiment, in step S4, finding the optimal number of combination levels specifically includes the following steps:

[0100] Step S41: Preset, calculate the number of layers di; the total number of features wi; initialize the hole array tn, which is used to record the number of features in each layer; traverse the number of layers, and for each layer, add the number of features ttn in the layer to tn;

[0101] Step S42: Determine the number of levels, if di is not less than 2; initialize the number of levels ki = 2, let k = di-ki + 1, k is the maximum number of available levels; initialize summ to an empty array; for each i from 1 to k, calculate the sum of the number of features of every two layers and add it to summ; record the sum of the number of features of the first layer and the last layer; if di is less than 2, calculate summ as the sum of the number of features of all layers in tn;

[0102] Step S43: Calculate the maximum number of features, calculate maxtn as the maximum value in summ; set ti to half of wi, that is, half of the total number of features;

[0103] Step S44: adjusting the number of layers, specifically including:

[0104] Step S441: If maxtn is not less than ti, set ki equal to di;

[0105] Step S442: when maxtn is less than ti;

[0106] Step S4421: gradually increase ki, update k=di-ki+1, and reset summ to an empty array;

[0107] Step S4422: For each index j from 1 to k, calculate the sum of the number of features in each two layers and add it to summ;

[0108] Step S4423: Update maxtn to the maximum value in summ; update ti to the rounded value of wi divided by ki;

[0109] Step S4424: If maxtn is not less than ti, go to step S45; otherwise go to step S4421;

[0110] Step S45: Return the optimal level number ki.

[0111] Example 6, see Figure 1 This embodiment is based on the above embodiment. In step S5, feature extraction specifically includes the following steps:

[0112] Step S51: feature removal, a removal threshold is set in advance, and features whose mutual information with all categories is lower than the removal threshold are deleted;

[0113] Step S52: feature grouping, grouping the features into ki feature subsets based on the optimal number of layers; and performing high-level priority combination. If the number of feature layers is greater than the optimal number of layers, the features are combined in order from high to low layers;

[0114] Step S53: feature selection, verifying the generated feature subsets, selecting the best feature subset as the feature extraction result, and updating the training set and test set after feature extraction.

[0115] By performing the above operations, in order to solve the problems of general automobile fault detection methods, such as too many dimensions of original data resulting in excessive data calculation, poor feature extraction effect resulting in low feature interpretability, and poor accuracy of feature selection, which leads to low accuracy of fault detection results, this solution groups features in a hierarchical manner and uses cumulative dominance comparison to determine the dominance relationship between features; objectively evaluates the importance of features, avoids subjective setting of thresholds, and improves the accuracy of feature selection; in the feature extraction process, removes thresholds and verification methods; and gives priority to high-level feature combinations; enhances the model's ability to represent data, and enhances the stability and reliability of the model.

[0116] Embodiment 7, see Figure 1 and Figure 2 This embodiment is based on the above embodiment. In step S6, establishing a vehicle fault detection model specifically includes the following steps:

[0117] Step S61: Model architecture design. The established automobile fault detection model includes an input layer, a MoE layer, and an output layer. The input layer receives the feature-extracted data set and converts it into a discrete event sequence. The MoE layer consists of multiple expert networks, each of which is an LSTM network used to learn the features and long-term dependencies of the data. The gating network determines the importance of each expert network to the input data. The output layer receives the output of the MoE layer and makes the final prediction.

[0118] Step S62: Input layer design, the input layer consists of input sample data and multiple different LSTM sub-models; specifically, the time series sample data is input into different LSTM sub-models, and each LSTM sub-model unit transmits time information by using the output of the previous moment as the input of the current moment; the learning result of each LSTM sub-model is represented by probability distribution; the representation used is as follows:

[0119] ;

[0120] ;

[0121] ;

[0122] In the formula, y t+1 and t They are the prediction results of the LSTM sub-model at time t+1 and time t respectively; argmax γ1 is the operator that maximizes the probability under given conditions, γ1 is the gating mechanism; n is the number of LSTM sub-models; is the probability distribution predicted by the model; y is the model prediction result; x t+1 is the input sample data at time t+1; y(x i ) is the output result of the automobile fault detection model for the i-th input sample; g(x i ) e is the output of the e-th LSTM sub-model of the gating network for the i-th input sample; f e (x i ) is the output result of the i-th input sample in the e-th LSTM sub-model; is the output of the gating network; W g is the weight matrix of the gating network; softmax(·) is the softmax activation function;

[0123] Step S63: MoE layer design. The MoE layer consists of multiple expert networks. First, the learning results of the upstream input layer are input into the expert network. Each expert network is responsible for dynamically selecting the LSTM for the upstream input sample through the gating network. Then, the outputs of multiple expert networks are mapped to a weight vector. The loss function is expressed as follows:

[0124] ;

[0125] Where L is the loss function; g i is the output of the i-th expert network, which is a weight vector used to dynamically select the weight of the output results of each LSTM sub-model; y is the true label of the input sample; f i is the model prediction label; I is the total number of samples;

[0126] Step S64: Output layer design. The output layer generates the final output result by weight calculation of the multi-layer expert model; and adjusts the model parameters based on the gradient; the output result of the final model is the output vector matrix and weight vector g of all LSTM sub-models i The product of; the formula used is as follows:

[0127] ;

[0128] ;

[0129] In the formula, is the loss function for each LSTM sub-model output f i The gradient of is used to correct the parameters of each LSTM sub-model; is the loss function L for each input sample x i The gradient of is used to correct the expert network weights;

[0130] Step S65: Model parameter optimization, building a learner based on the gradient boosting regression tree to optimize the model parameters; specifically including:

[0131] Step S651: Initialize the weak learner and the first regression tree to minimize the loss function; it is expressed as follows:

[0132] ;

[0133] In the formula, f 0 (x) is the prediction function of the first regression tree, which indicates the initial state of the model; N is the number of samples in the training set; c is the regression tree parameter, which indicates the state of the current learner; argmin is the parameter operator for minimization; L(y i ,c) is the loss of the automobile fault detection model in the current learner state;

[0134] Step S652: Calculate the negative gradient for the sample. During the iteration process of the gradient boosting regression tree, a new regression tree will be generated in each iteration, where each new regression tree is trained on the negative gradient of the previous tree. The formula used to calculate the negative gradient is as follows:

[0135] ;

[0136] In the formula, r im is the negative gradient of the i-th sample; L(y i -f(x i )) is the loss between the true label and the predicted value of the vehicle fault detection model for the xth sample in the current model state; f(x)=f (m-1) x indicates that the current prediction model is equal to the regression tree obtained at the m−1th iteration; f(x) is the output of the gradient boosting regression tree;

[0137] Step S653: The calculated negative gradient is regarded as the true value of the sample, and the data (x i ,r im ) is considered as the training data for the next tree to obtain a new regression tree f m (x), each leaf node represents the prediction result of a data; the leaf node corresponding to the new regression tree is denoted as R jm ;

[0138] Step S654: For the leaf node region, calculate the best fitting value;

[0139] ;

[0140] In the formula, zr im is the best fit value of the i-th sample in the m-th iteration; L(y i ,f m-1 (x i )+γ) is used to measure the predicted value f m-1 (x i )+γ and the loss of the true value; f m-1 (x i ) is the predicted value of the learner obtained in the m-1th iteration; γ is the adjustment of the fitting value of the current leaf node area;

[0141] Step S655: Update the learner and obtain the final learner. At this time, the parameters of the vehicle fault detection model represented by the learner are optimal; the formula used is as follows:

[0142] ;

[0143] ;

[0144] In the formula, f m(x) is the learner at the mth iteration and also the new regression tree; is the best fit value of the jth leaf node region at the mth iteration; I(·) is the indicator function; J is the number of leaf nodes; f(x) is the final learner; M is the maximum number of iterations;

[0145] Step S66: Model evaluation. A correctness threshold is pre-set. When the prediction rate of the vehicle fault detection model trained based on the training set for the test set is higher than the correctness threshold, the vehicle fault detection model is established; otherwise, the data set is re-divided to train the model.

[0146] By performing the above operations, this solution adopts the architecture of input layer, MoE layer and output layer to solve the problems of improper model loss design in general automobile fault detection methods, which leads to the inability of the model to accurately fit the data and poor model parameter optimization, resulting in low model performance. The output result of each LSTM sub-model is dynamically selected through the gating network, which improves the flexibility and robustness of the model. The loss function considers the error between the output of the expert network and the true label, so that the model can fit the data more accurately. The model parameters are optimized based on the gradient boosting regression tree to ensure the accuracy and stability of the model.

[0147] Embodiment 7, see Figure 1 This embodiment is based on the above embodiment. In step S7, the automobile fault detection is based on the established automobile fault detection model, and the real-time data of the automobile fault detection is collected. The output of the automobile fault detection model on the real-time data is used as the automobile fault detection result.

[0148] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0149] While the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that many changes, modifications, substitutions and variations can be made to the embodiments without departing from the principles and spirit of the invention.

[0150] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.

Claims

1. A vehicle fault detection method based on big data, characterized in that: The method comprises the following steps: Step S1: data collection; Step S2: data preprocessing; Step S3: feature hierarchization, stratifying the features according to the cumulative dominance relationship between the features; Step S4: Find the optimal number of combination levels and determine the optimal number of feature combination levels to perform feature grouping; Step S5: feature extraction, combining hierarchical features based on the optimal number of hierarchical levels, and finally extracting features; Step S6: Establishing a vehicle fault detection model, based on the architecture of the input layer, the MoE layer and the output layer, optimizing the model parameters based on the gradient boosting regression tree; Step S7: vehicle fault detection; In step S6, the establishment of the automobile fault detection model specifically includes the following steps: Step S61: Model architecture design. The established automobile fault detection model includes an input layer, a MoE layer, and an output layer. The input layer receives the feature-extracted data set and converts it into a discrete event sequence. The MoE layer consists of multiple expert networks, each of which is an LSTM network used to learn the features and long-term dependencies of the data. The gating network determines the importance of each expert network to the input data. The output layer receives the output of the MoE layer and makes the final prediction. Step S62: Input layer design, the input layer consists of input sample data and multiple different LSTM sub-models; specifically, the time series sample data is input into different LSTM sub-models, and each LSTM sub-model unit transmits time information by using the output of the previous moment as the input of the current moment; the learning result of each LSTM sub-model is represented by probability distribution; the representation used is as follows: ; ; ; In the formula, y t+1 and t They are the prediction results of the LSTM sub-model at time t+1 and time t respectively; argmax γ1 is the operator that maximizes the probability under given conditions, γ1 is the gating mechanism; n is the number of LSTM sub-models; is the probability distribution predicted by the model; y is the model prediction result; x t+1 is the input sample data at time t+1; y(x i ) is the output result of the automobile fault detection model for the i-th input sample; g(x i ) e is the output of the e-th LSTM sub-model of the gating network for the i-th input sample; f e (x i ) is the output result of the i-th input sample in the e-th LSTM sub-model; is the output of the gating network; W g is the weight matrix of the gating network; softmax(·) is the softmax activation function; Step S63: MoE layer design. The MoE layer consists of multiple expert networks. First, the learning results of the upstream input layer are input into the expert network. Each expert network is responsible for dynamically selecting the LSTM for the upstream input sample through the gating network. Then, the outputs of multiple expert networks are mapped to a weight vector. The loss function is expressed as follows: ; Where L is the loss function; g i is the output of the i-th expert network, which is a weight vector used to dynamically select the weight of the output results of each LSTM sub-model; y is the true label of the input sample; f i is the model prediction label; I is the total number of samples; Step S64: Output layer design. The output layer generates the final output result by weight calculation of the multi-layer expert model; and adjusts the model parameters based on the gradient; the output result of the final model is the output vector matrix and weight vector g of all LSTM sub-models i The product of; the formula used is as follows: ; ; In the formula, is the loss function for each LSTM sub-model output f i The gradient of is used to correct the parameters of each LSTM sub-model; is the loss function L for each input sample x i The gradient of is used to correct the expert network weights; Step S65: model parameter optimization; Step S66: Model evaluation, a correctness threshold is set in advance. When the prediction rate of the automobile fault detection model trained based on the training set for the test set is higher than the correctness threshold, the automobile fault detection model is established; otherwise, the data set is re-divided to train the model; Step S6 includes step S655: updating the learner and obtaining the final learner. At this time, the parameters of the vehicle fault detection model represented by the learner are optimal. The formula used is as follows: ; ; In the formula, f m (x) is the learner at the mth iteration and also the new regression tree; is the best fit value of the jth leaf node region at the mth iteration; I(·) is the indicator function; J is the number of leaf nodes; f(x) is the final learner; M is the maximum number of iterations; R jm is the leaf node corresponding to the new regression tree; In step S65, the model parameter optimization is to optimize the model parameters by establishing a learner based on the gradual enhancement regression tree; specifically, it includes: Step S651: Initialize the weak learner and the first regression tree to minimize the loss function; it is expressed as follows: ; Where f0(x) is the prediction function of the first regression tree, which indicates the initial state of the model; N is the number of samples in the training set; c is the regression tree parameter, which indicates the state of the current learner; argmin is the parameter operator for minimization; L(y i ,c) is the loss of the automobile fault detection model in the current learner state; Step S652: Calculate the negative gradient for the sample. During the iteration process of the gradient boosting regression tree, a new regression tree will be generated in each iteration, where each new regression tree is trained on the negative gradient of the previous tree. The formula used to calculate the negative gradient is as follows: ; In the formula, r im is the negative gradient of the i-th sample; L(y i -f(x i )) is the loss between the true label and the predicted value of the vehicle fault detection model for the xth sample in the current model state; f(x)=f (m-1) x indicates that the current prediction model is equal to the regression tree obtained at the m−1th iteration; f(x) is the output of the gradient boosting regression tree; Step S653: The calculated negative gradient is regarded as the true value of the sample, and the data (x i ,r im ) is considered as the training data for the next tree to obtain a new regression tree f m (x), each leaf node represents the prediction result of a data; the leaf node corresponding to the new regression tree is denoted as R jm ; Step S654: For the leaf node region, calculate the best fitting value; ; In the formula, zr im is the best fit value of the i-th sample in the m-th iteration; L(y i ,f m-1 (x i )+γ) is used to measure the predicted value f m-1 (x i )+γ and the loss of the true value; f m-1 (x i ) is the predicted value of the learner obtained in the m-1th iteration; γ is the adjustment of the fitting value of the current leaf node area; Step S655: Update the learner.

2. The automobile fault detection method based on big data according to claim 1 is characterized in that: In step S3, the feature hierarchicalization is to layer features according to the cumulative dominance relationship between features, which specifically includes the following steps: Step S31: Initialization: Initialize the feature set, set the layer index front to 1, create an empty list F(front).f to store features; for each feature i, initialize N to 0 and S to an empty list; traverse the features and perform cumulative dominance comparison between features. If the i-th feature dominates another feature, add the dominated feature to the list S of the i-th feature; otherwise, increment N of the i-th feature by 1. After the traversal, if N is equal to 0, it means that the i-th feature is the highest non-dominated level feature, and store feature i in the current front layer; Step S32: For the feature set F(front).f in the current front layer, if it is empty, execute the following loop: Step S321: Create an empty list Q to store features in the next priority; Step S322: Traverse the features. If the S of a feature is not empty, traverse each feature in S: decrement N by 1 each time; if N is equal to 0, add the traversed feature to Q, indicating that these features are stored in the next priority; Step S323: Increment front by 1, move to the next level, and set F(front).f to the feature set stored in Q; Step S33: Repeat step S32 until all features are processed; Step S34: Return the constructed hierarchical feature set F.

3. The automobile fault detection method based on big data according to claim 2 is characterized in that: In step S31, the cumulative dominance comparison specifically includes the following steps: Step S311: Traverse category k. For any two features, if p(i,k) < p(j,k), increment dom_less by 1; if p(i,k) = p(j,k), increment dom_equal by 1; if p(i,k) > p(j,k), increment dom_more by 1; where p(i,k) and p(j,k) are the mutual information between the i-th feature and the j-th feature and the k-th category respectively; dom_less, dom_equal, and dom_more are values used for cumulative dominance counting; Step S312: Cumulative dominance determination. If dom_more is equal to 0 and dom_equal is not equal to the number of categories, feature i is dominated by feature j; if dom_less is equal to 0 and dom_equal is not equal to the number of categories, feature i dominates feature j.

4. The automobile fault detection method based on big data according to claim 1 is characterized in that: In step S4, the finding of the optimal combination level number is to determine the optimal number of levels of feature combination for feature grouping, which specifically includes the following steps: Step S41: Preset, calculate the number of levels di; the total number of features wi; initialize the hole array tn to record the number of features in each layer; traverse the number of levels, and for each layer, add the number of features ttn in that layer to tn; Step S42: Determine the number of levels, if di is not less than 2; initialize the number of levels ki = 2, let k = di-ki + 1, k is the maximum number of available levels; initialize summ to an empty array; for each i from 1 to k, calculate the sum of the number of features of every two layers and add it to summ; record the sum of the number of features of the first layer and the last layer; if di is less than 2, calculate summ as the sum of the number of features of all layers in tn; Step S43: Calculate the maximum number of features, calculate maxtn as the maximum value in summ; set ti to half of wi, that is, half of the total number of features; Step S44: adjusting the number of layers, specifically including: Step S441: If maxtn is not less than ti, set ki equal to di; Step S442: when maxtn is less than ti; Step S4421: gradually increase ki, update k=di-ki+1, and reset summ to an empty array; Step S4422: For each index j from 1 to k, calculate the sum of the number of features in each two layers and add it to summ; Step S4423: Update maxtn to the maximum value in summ; update ti to the rounded value of wi divided by ki; Step S4424: If maxtn is not less than ti, go to step S45; otherwise go to step S4421; Step S45: Return the optimal level number ki.

5. The automobile fault detection method based on big data according to claim 1 is characterized in that: In step S5, the feature extraction specifically includes the following steps: Step S51: feature removal, a removal threshold is set in advance, and features whose mutual information with all categories is lower than the removal threshold are deleted; Step S52: feature grouping, grouping the features into ki feature subsets based on the optimal number of layers; and performing high-level priority combination. If the number of feature layers is greater than the optimal number of layers, the features are combined in order from high to low layers; Step S53: feature selection, verifying the generated feature subsets, selecting the best feature subset as the feature extraction result, and updating the training set and test set after feature extraction.

6. The automobile fault detection method based on big data according to claim 1 is characterized in that: In step S1, the data collection is to collect historical data; the historical data includes sensor data, vehicle maintenance records, operating environment data, operation data, vehicle feature data, battery data, vehicle sound data, time data and vehicle detection results, and the vehicle detection results include normal vehicle and vehicle fault types, and the vehicle detection results are used as data labels.

7. The automobile fault detection method based on big data according to claim 1 is characterized in that: In step S2, the data preprocessing is to clean the collected data, transform it, standardize it and divide it into data sets; the data cleaning is to process missing values, duplicate values ​​and outliers; the data transformation is to transform the data into vector form, and finally obtain a time series data set; the standardization is to standardize the data based on the maximum and minimum normalization method; The data set division is to divide the data into a training set and a test set.

8. The automobile fault detection method based on big data according to claim 1 is characterized in that: In step S7, the vehicle fault detection is based on the established vehicle fault detection model, real-time data of the vehicle fault detection is collected, and the output of the vehicle fault detection model to the real-time data is used as the vehicle fault detection result.