A method and system for automobile fault diagnosis based on deep learning
By grouping and word embedding encoding of car fault codes, the dimension of fault codes is reduced, the problem of dimension explosion in deep learning automobile fault diagnosis is solved, and diagnostic efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411764629.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The vehicle fault diagnosis method based on deep learning in the prior art has a problem of dimensional explosion, which makes it difficult to effectively deal with the fault codes.
By grouping multiple fault codes, adjusting the fault codes into regular sequences, reducing the dimensions on the time scale; at the same time, each fault code is regarded as a vocabulary, and encoding is used using word embedding technology to represent complex fault codes as word vectors with lower dimensions, reducing the dimensions on the type scale.
It effectively reduces the dimensions of fault codes in time and type scales, solves the problem of dimensional explosion, and improves the efficiency and accuracy of fault diagnosis.
Smart Images

Figure CN119247937B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automobile fault diagnosis instruments, and in particular to an automobile fault diagnosis method and system based on deep learning. Background Art
[0002] The car fault diagnostic instrument is a professional detection tool that reads the fault codes (DTC) by connecting to the car's on-board diagnostic system (OBD) to identify and analyze various faults in the car. Diagnosis through fault codes can quickly point out possible problem areas, thus saving maintenance time and costs.
[0003] However, the fault code can only indicate the abnormality of the monitoring data, and cannot confirm the specific cause of the fault. Therefore, even with the fault code, it is still necessary for automotive maintenance experts to evaluate and determine the exact cause of the fault based on their experience and expertise. This may include further testing, inspection and repair work.
[0004] In theory, deep learning technology is particularly suitable for replacing manual analysis of fault codes for automobile fault diagnosis because of its ability to process large amounts of data and identify complex patterns. However, in practical applications, due to the large number of types of automobile fault codes, deep learning technology faces the problem of dimensionality explosion when analyzing fault codes. Therefore, people need a technical solution that can avoid the problem of dimensionality explosion by analyzing fault codes for diagnosis through deep learning technology. Summary of the invention
[0005] Therefore, the present invention provides a deep learning-based automobile fault diagnosis method and system to solve the problem of dimensional explosion in the deep learning-based automobile fault diagnosis method in the prior art.
[0006] The present invention provides a vehicle fault diagnosis method based on deep learning, comprising:
[0007] Obtaining fault code data of a target vehicle, the fault code data including multiple fault codes and acquisition time series data corresponding to each fault code;
[0008] Based on the order of the collected time series data representation, multiple fault codes are continuously grouped to obtain a multi-frame fault code set;
[0009] Based on the preset word embedding matrix, all fault codes in the multi-frame fault code set are converted into word vectors, and the word vectors in the same frame fault code set are merged to obtain the context vector of each frame fault code set;
[0010] Multiple context vectors are input into the preset neural network diagnosis model to obtain the fault diagnosis results of the target vehicle.
[0011] In a preferred embodiment: all fault codes in a multi-frame fault code set are converted into word vectors based on a preset word embedding matrix, and the word vectors in the same frame fault code set are merged to obtain a context vector for each frame fault code set, including:
[0012] Obtain a target fault code set, and create a one-hot encoding vector for each fault code in the target fault code set;
[0013] Calculate the multiplication result of each one-hot encoding vector and the preset word embedding matrix to obtain the word vector corresponding to each one-hot encoding vector;
[0014] The number of times each one-hot encoding vector appears in the target fault code set is used as the weight of the word vector corresponding to the one-hot encoding vector, and the weighted average vector of multiple word vectors is calculated as the context vector of the target fault code set.
[0015] In a preferred embodiment: the fault code is in the OBD standard fault code format; a target fault code set is obtained, and a unique hot encoding vector is established for each fault code in the target fault code set, including:
[0016] Obtain a target initial fault code, where the target initial fault code is a fault code in the target fault code set whose one-hot encoding vector is currently to be established;
[0017] The second character in the target initial fault code is modified to a manufacturer feature code, wherein the manufacturer feature code is used to indicate a standard type of the fault code;
[0018] Based on the modified target initial fault code, a one-hot encoding vector is created.
[0019] In a preferred embodiment: it also includes obtaining a preset word embedding matrix and a preset neural network diagnostic model, obtaining a preset word embedding matrix and a preset neural network diagnostic model specifically includes:
[0020] Obtaining an initial word embedding matrix, an initial neural network diagnostic model, historical fault code data, and actual faults corresponding to the historical fault code data, wherein the fault code data includes multiple historical fault codes and historical acquisition time series data corresponding to each historical fault code;
[0021] Based on the order of historical acquisition time series data representation, multiple historical fault codes are continuously grouped to obtain a multi-frame historical fault code set;
[0022] Based on the initial word embedding matrix, all fault codes in the multi-frame historical fault code set are converted into historical word vectors, and the historical word vectors in the same frame historical fault code set are merged to obtain the historical context vector of each frame historical fault code set;
[0023] Input multiple historical context vectors into the initial neural network diagnosis model to obtain output results;
[0024] According to the difference between the output results and the actual fault, a loss function is established;
[0025] Optimize the initial word embedding matrix and the initial neural network diagnostic model based on the loss function.
[0026] In a preferred embodiment: optimizing the initial word embedding matrix and the initial neural network diagnostic model based on the loss function includes:
[0027] Performing back propagation on the initial neural network diagnosis model based on the loss function to optimize the initial neural network diagnosis model;
[0028] Based on the loss function, a total correction vector of the historical context vector corresponding to a frame of historical fault code set is obtained;
[0029] Based on the number of times each historical fault code appears in the target fault code set of the frame, the total correction vector is decomposed to obtain the correction component of the vector corresponding to each historical fault code in the initial word embedding matrix;
[0030] Based on the correction component, the vector corresponding to each historical fault code in the initial word embedding matrix is corrected.
[0031] In a preferred embodiment: based on the number of times each historical fault code appears in the target fault code set of the frame, the total correction vector is decomposed to obtain the correction component of the vector corresponding to each historical fault code in the initial word embedding matrix, including:
[0032] The correction component of the vector corresponding to a historical fault code is obtained by the following formula:
[0033] ;
[0034] in, is the total correction vector of the historical context vector corresponding to a frame of historical fault code set, For the The correction component of the vector corresponding to the historical fault code, is the total number of historical fault codes that appear in the historical fault code set of this frame, The first fault code in the historical fault code set of this frame The number of historical fault codes that have occurred.
[0035] In a preferred embodiment: based on the correction component, the vector corresponding to each historical fault code in the initial word embedding matrix is corrected, including:
[0036] The vector corresponding to a historical fault code in the initial word embedding matrix is corrected by the following formula:
[0037] ;
[0038] in, is the first word in the initial word embedding matrix The corrected vector corresponding to the historical fault code, is the first word in the initial word embedding matrix The vector before correction corresponding to the historical fault code, is the preset learning rate.
[0039] In a preferred embodiment, the collected time series data includes a timestamp corresponding to each fault code; based on the order represented by the collected time series data, multiple fault codes are continuously grouped to obtain a multi-frame fault code set, including:
[0040] Arrange multiple fault codes in order based on timestamps;
[0041] Multiple fault codes are continuously grouped based on a preset time interval to obtain a multi-frame fault code set.
[0042] In a preferred embodiment, the collected time series data includes the mileage corresponding to each fault code; based on the order represented by the collected time series data, multiple fault codes are continuously grouped to obtain a multi-frame fault code set, including:
[0043] Arrange multiple fault codes in order based on mileage;
[0044] Multiple fault codes are grouped continuously based on a preset total number of groups to obtain a multi-frame fault code set.
[0045] The present invention also provides an automobile fault diagnosis system based on deep learning, comprising:
[0046] A data collection module is used to obtain the fault code data of the target vehicle, the fault code data includes multiple fault codes and the collection time series data corresponding to each fault code;
[0047] A data grouping module, used to continuously group multiple fault codes based on the order of the collected time series data representation to obtain a multi-frame fault code set;
[0048] A data dimension reduction module is used to convert all fault codes in a multi-frame fault code set into word vectors based on a preset word embedding matrix, merge the word vectors in the same frame fault code set, and obtain the context vector of each frame fault code set;
[0049] The fault diagnosis module is used to input multiple context vectors into a preset neural network diagnosis model to obtain the fault diagnosis result of the target vehicle.
[0050] The beneficial effects of adopting the above embodiment are:
[0051] The present invention provides a method and system for diagnosing automobile faults based on deep learning, which first obtains fault code data of a target automobile, wherein the fault code data includes multiple fault codes and acquisition time series data corresponding to each fault code, and then, based on the order represented by the acquisition time series data, the multiple fault codes are continuously grouped to obtain a multi-frame fault code set, and then, based on a preset word embedding matrix, all fault codes in the multi-frame fault code set are converted into word vectors, and the word vectors in the same frame fault code set are merged to obtain a context vector of each frame fault code set, and finally, the multiple context vectors are input into a preset neural network diagnosis model to obtain a fault diagnosis result of the target automobile. Compared with the prior art, the present invention, on the one hand, adjusts the fault codes originally randomly generated in time into a regular sequence by grouping multiple fault codes, thereby reducing the dimension of the fault code on the time scale, and on the other hand, the present invention also regards each fault code as a vocabulary, utilizes the word embedding technology in the field of natural language processing to transfer to the encoding of the fault code, and represents the complex fault code by a word vector with a lower dimension, thereby reducing the dimension of the fault code on the type scale itself, and solves the problem of dimensional explosion in the automobile fault diagnosis method based on deep learning in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 A method flow chart of the automobile fault diagnosis method based on deep learning provided by the present invention;
[0053] Figure 2 for Figure 1 Specific step diagram of step S103;
[0054] Figure 3 for Figure 1 Specific step diagram of step S105;
[0055] Figure 4 Schematic diagram of the training process of the preset word embedding matrix and the preset neural network diagnosis model in this embodiment;
[0056] Figure 5 This is a system structure diagram of the deep learning-based automobile fault diagnosis system provided by the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0058] Combination Figure 1 As shown, a specific embodiment of the present invention discloses a vehicle fault diagnosis method based on deep learning, comprising:
[0059] S101, acquiring fault code data of a target vehicle, where the fault code data includes multiple fault codes and acquisition time series data corresponding to each fault code;
[0060] S102, based on the order of the collected time series data representation, continuously grouping multiple fault codes to obtain a multi-frame fault code set;
[0061] S103, converting all fault codes in the multi-frame fault code set into word vectors based on a preset word embedding matrix, merging the word vectors in the same frame fault code set, and obtaining a context vector for each frame fault code set;
[0062] S104, inputting the multiple context vectors into a preset neural network diagnosis model to obtain a fault diagnosis result of the target vehicle.
[0063] In the above process, the collected time series data is data that can represent the generation time of the fault code on a time scale, such as time, mileage, etc.
[0064] The vehicle's fault code is a set of standardized codes used to help diagnose the car's faults. The fault codes commonly used in practice are OBD-II (On-Board Diagnostics II) fault codes, which are a set of standardized codes used to help diagnose the car's faults. These codes were developed by SAE (Society of Automotive Engineers) and are widely used in car repair and fault diagnosis. The fault code usually starts with "P" followed by four digits, which are divided into different categories, each category representing a different system or problem, for example:
[0065] P0101: air flow meter is bad (signal value is wrong);
[0066] P0115: Water temperature sensor circuit is bad;
[0067] P0500: Vehicle speed sensor circuit failure or intermittent failure;
[0068] These codes are the starting point for fault diagnosis, and they can guide technicians to further check and repair the problem. Each code corresponds to a specific sensor, actuator or system problem. These codes can be read by professional diagnostic tools and provide more detailed fault information. Obviously, a single code often cannot clearly reflect the specific fault of the vehicle. In most cases, professionals will combine their experience to conduct a comprehensive analysis of the existing fault codes to obtain diagnostic results, such as:
[0069] If the vehicle displays both P0112 (Intake Air Temperature Sensor Circuit Voltage Too Low) and P0113 (Intake Air Temperature Sensor Circuit Input Voltage Too High) fault codes, this may indicate an intermittent problem or damage to the intake air temperature sensor. A technician will need to check the sensor circuit and the sensor itself to determine the problem.
[0070] It can be imagined that deep learning technology, especially neural networks, has the ability to handle complex nonlinear problems. The specific analysis process is very similar to the process of human brain analyzing fault codes. Therefore, it is particularly suitable for replacing manual analysis of fault codes for diagnosis.
[0071] In reality, the time when a car's fault code is generated is obviously uncontrollable and highly random. The same fault code may appear at multiple times, and multiple different fault codes may be generated at the same time. When diagnosing faults through the changes in fault codes, if all fault codes are arranged based on their original time sequence, the resulting sequence will obviously be long and sparse.
[0072] For example, a car generates fault codes P0101, P0102, P0103 and P0104 at time 1, 3, 6 and 9 respectively (the above four fault codes are only used as examples, and have no practical significance). In practice, in order to improve the universality of the neural network model that can process sequence data and analyze the fault codes generated at any time, the data input to the neural network often needs to be equally spaced. Therefore, it is necessary to interpolate the sequences of the above four fault codes so that the input sequences correspond to the four moments 0-9 respectively. In this way, the form of the sequence input to the neural network is very likely to be:
[0073] 0, P0101, 0, P0102, 0, 0, P0103, 0, 0, P0104;
[0074] There are a total of 10 values in the above sequence and there are 6 zeros, but there are only 4 valid fault codes. The amount of data has doubled, which is obviously disadvantageous. In practice, facing complex situations, the problem of data growth will only become more serious. Therefore, this embodiment adopts a method similar to video framing, and divides the fault codes in a certain continuous time into a group according to the time sequence, and divides them into multiple "frames". The fault codes generated at different times in a frame are approximately regarded as data generated at the same time, so as to reduce the total amount of data in the sequence of the final data preset neural network model, and slightly sacrifice some accuracy to reduce the dimension of the fault code on the time scale.
[0075] For example, if three moments are used as the length of a "frame" for aggregation, then for the example in the previous article, the generated sequence may be:
[0076] P0101, P0102, P0103, P0104;
[0077] It can be seen that there are a total of 4 values in the above sequence and all 4 are valid fault codes, and the dimensionality reduction effect is very significant. The above example is relatively simple. It is understandable that in practice, there may be multiple fault codes in the same frame.
[0078] This is only the dimension on the time scale, and the complexity caused by the type of fault code itself is even more serious. Taking the OBD standard fault code format as an example, the OBD standard fault code is usually represented by 5 characters, which is actually composed of 16-bit binary numbers. The corresponding relationship is as follows:
[0079]
[0080] It can be seen that, in theory, the fault code exists There are possibilities, and in practice, one-hot encoding is usually used to encode them. Then for the fault code, the length of the one-hot encoding of each fault code is As an extreme example, if all types of fault codes appear once in a frame, the total number of fault codes in the frame is If all are encoded as one-hot vectors, we will get × bits of input data (into the neural network), which would be a disaster for the neural network for subsequent processing.
[0081] Therefore, this embodiment innovatively uses word embedding technology to reduce the dimension of the fault code encoding. Word embedding technology was originally a technology for processing text data in the field of natural language processing (NLP). It maps the unique hot encoding of the vocabulary to a vector space with lower dimensionality through the word embedding matrix to achieve dimensionality reduction of vocabulary data. In this embodiment, each fault code is regarded as a vocabulary, so that it can be processed using the same principle of word embedding technology. In this embodiment, each row in the preset word embedding vocabulary corresponds to a fault code, indicating the word vector corresponding to the fault code.
[0082] For example, if we use the commonly used settings in practice and set the dimension of a word vector to 300, the default word embedding matrix is ×300 size, a 1× The unique hot encoding of the fault code is multiplied by the word embedding matrix to obtain the word vector corresponding to the fault code, that is, 1×300, which achieves data dimensionality reduction. For the example given above, in practice, if all types of fault codes appear once in a frame, the original × After the input data is processed by the word embedding matrix, only ×300 bits, the dimensionality reduction effect is very significant. It can greatly improve the processing speed of subsequent neural networks and reduce the complexity of neural networks.
[0083] In addition, it is worth mentioning that word embedding technology itself has the ability to capture semantic information, that is, word embedding technology can capture the semantic relationship between words, making similar words closer in the vector space. For example, the word vectors of words with similar meanings are closer in the vector space, while the word vectors of words with opposite meanings are farther away in the vector space, and the scale of the difference between different words is the same as the meaning they imply (for example, the distance between the word vectors of the two words "man" and "woman" is similar to the distance between the word vectors of the two words "king" and "queen").
[0084] Similarly, when word embedding technology is applied to the representation of fault codes, in addition to the dimensionality reduction effect, word vectors can also be used to represent the logical meaning relationship between different fault codes. For example, for the following fault codes:
[0085] P0182 indicates that the fuel temperature sensor A circuit voltage is too low;
[0086] P0183 indicates that the fuel temperature sensor A circuit voltage is too high;
[0087] P0187 indicates that the fuel temperature sensor B circuit voltage is too low;
[0088] P0188 indicates that the fuel temperature sensor B circuit voltage is too high;
[0089] U0260 indicates that the communication with the seat control switch module A is lost;
[0090] Among them, P0182, P0183, P0187 and P0188 are all related to fuel temperature perception, so the word vectors corresponding to the four are relatively close, and because the four represent high and low voltages, the distance between the word vectors corresponding to P0182 and P0183 should also be close to the distance between the word vectors corresponding to P0187 and P0188. U0260 is related to seat control and communication, so the distance between the word vectors corresponding to P0182, P0183, P0187 and P0188 and U0260 is relatively far.
[0091] It can be foreseen that the above characteristics can reduce the workload of feature engineering in the fault code analysis process, improve the accuracy of similarity analysis by neural networks, enhance the performance of the entire model, and improve the accuracy of fault diagnosis.
[0092] In general, compared with the prior art, the present invention, on the one hand, adjusts the fault codes that were originally randomly generated in time into a regular sequence by grouping multiple fault codes, thereby reducing the dimension of the fault codes on the time scale; on the other hand, the present invention also regards each fault code as a vocabulary, and uses the word embedding technology in the field of natural language processing to encode the fault codes, and represents complex fault codes through low-dimensional word vectors, thereby reducing the dimension of the fault codes on the type scale themselves, and solving the problem of dimensionality explosion in the prior art automobile fault diagnosis method based on deep learning.
[0093] Further, in a preferred embodiment, the collected time series data includes a timestamp corresponding to each fault code. On this basis, the above step S102, based on the order represented by the collected time series data, continuously groups multiple fault codes to obtain a multi-frame fault code set, specifically including:
[0094] Arrange multiple fault codes in order based on timestamps;
[0095] Multiple fault codes are continuously grouped based on a preset time interval to obtain a multi-frame fault code set.
[0096] The above process groups multiple fault codes at equal time intervals, and is mainly used in situations where subsequent preset neural network diagnostic models can handle sequences of indefinite length, such as recurrent neural networks, long short-term memory networks, etc.
[0097] In another preferred embodiment, the collected time series data includes the mileage corresponding to each fault code. On this basis, the above step S102, based on the order represented by the collected time series data, continuously groups multiple fault codes to obtain a multi-frame fault code set, specifically including:
[0098] Arrange multiple fault codes in order based on mileage;
[0099] Multiple fault codes are grouped continuously based on a preset total number of groups to obtain a multi-frame fault code set.
[0100] The above process groups the fault codes into a fixed number, which is mainly used in the case where the preset neural network diagnosis model can only process fixed-length sequences, such as a common fully connected model. In addition, mileage is also used as the scale for time division in this embodiment. It is understandable that other scales can be used in practice according to specific needs.
[0101] Further, combined with Figure 2 As shown, in a preferred embodiment, the above step S103, based on the preset word embedding matrix, converts all fault codes in the multi-frame fault code set into word vectors, merges the word vectors in the same frame fault code set, and obtains the context vector of each frame fault code set, specifically including:
[0102] S201, obtaining a target fault code set, and establishing a one-hot encoding vector for each fault code in the target fault code set;
[0103] S202, calculating the multiplication result of each one-hot encoding vector and the preset word embedding matrix to obtain the word vector corresponding to each one-hot encoding vector;
[0104] S203, using the number of times each one-hot encoding vector appears in the target fault code set as the weight of the word vector corresponding to the one-hot encoding vector, and calculating the weighted average vector of multiple word vectors as the context vector of the target fault code set.
[0105] The target fault code set is a frame of fault code set to be analyzed. In this embodiment, the types and times of the fault codes in different target fault code sets may be inconsistent. Therefore, after obtaining the word vector, this embodiment uses the average vector of multiple word vectors as the context vector input to the preset neural network diagnosis model to achieve uniformity in data scale. And when calculating the average vector, the number of times each unique hot encoding vector appears in the target fault code set (that is, the fault code in the target fault code set) is used as the weight to adjust the influence weight of different fault codes on the context vector, so that the context vector is more in line with the actual situation.
[0106] Further, in a preferred embodiment, the fault code is in the OBD standard fault code format. On this basis, the above step S201, obtaining the target fault code set, and establishing a unique hot encoding vector for each fault code in the target fault code set, specifically includes:
[0107] Obtain a target initial fault code, where the target initial fault code is a fault code in the target fault code set whose one-hot encoding vector is currently to be established;
[0108] The second character in the target initial fault code is modified to a manufacturer feature code, wherein the manufacturer feature code is used to indicate a standard type of the fault code;
[0109] Based on the modified target initial fault code, a one-hot encoding vector is created.
[0110] In the OBD standard fault code, the second character (refer to the introduction of the fault code format in the previous text) indicates the fault type, that is, whether the fault code is a fault code defined by the ISO / SAE standard (the specific character is 0) or a fault code customized by the manufacturer (the specific character is 1). In order to improve the versatility of the entire model, this embodiment rewrites the second character in the fault code before establishing the one-hot encoding vector so that it can clearly indicate the identity of the manufacturer, which enables the present invention to be universal for multiple different manufacturers.
[0111] Although changing the second character in the target initial fault code to the manufacturer's feature code will increase the total number of fault code types and increase its complexity, the dimensionality increase brought by adding the manufacturer's feature code is acceptable in view of the dimensionality reduction effect of word embedding technology.
[0112] Furthermore, in practice, both the preset word embedding matrix and the preset neural network diagnosis model need to be obtained through training. Figure 1 and Figure 3 As shown, in a preferred embodiment, the automobile fault diagnosis method based on deep learning also includes step S105, obtaining a preset word embedding matrix and a preset neural network diagnosis model, and the step S105, obtaining a preset word embedding matrix and a preset neural network diagnosis model, specifically includes:
[0113] S301, obtaining an initial word embedding matrix, an initial neural network diagnosis model, historical fault code data, and actual faults corresponding to the historical fault code data, wherein the fault code data includes multiple historical fault codes and historical acquisition time series data corresponding to each historical fault code;
[0114] S302, based on the order represented by the historically collected time series data, continuously grouping multiple historical fault codes to obtain a multi-frame historical fault code set;
[0115] S303, converting all fault codes in the multi-frame historical fault code set into historical word vectors based on the initial word embedding matrix, merging the historical word vectors in the same frame historical fault code set, and obtaining a historical context vector for each frame historical fault code set;
[0116] S304, inputting multiple historical context vectors into the initial neural network diagnosis model to obtain an output result;
[0117] S305, establishing a loss function according to the difference between the output result and the actual fault;
[0118] S306. Optimize the initial word embedding matrix and the initial neural network diagnosis model based on the loss function.
[0119] It can be understood that the above process is an iterative training process, and the initial word embedding matrix and the initial neural network diagnostic model are the results of the previous iteration. The word embedding matrix and the neural network diagnostic model finally obtained after multiple iterations are the preset word embedding matrix and the preset neural network diagnostic model. Similarly, the meanings of historical fault code data, historical fault codes, historical acquisition time series data, historical fault code sets, historical word vectors, historical context vectors, etc. are the same as before, except that the word "history" is added as a prefix to indicate that it is prepared in advance and used for training data. Similarly, the use process, calculation method and technical effects of the above data are the same, and will not be explained in detail here.
[0120] However, it should be noted that the significance of the above process lies in that it is an improvement on the existing bag-of-words (CBOW) model. Simply put, the bag-of-words model in the prior art needs to embed the context vector of a target word to obtain a context vector, and then input the context vector into a linear layer for further analysis, and finally output the specific content of the target word. In the present embodiment, first, the fault code is word-embedded to obtain the context vector of a frame of historical fault code set, and a sequence of multiple context vectors is obtained at the same time. Secondly, the present embodiment replaces the linear layer in the prior art with a preset neural network diagnostic model to realize the processing of the context vector sequence. Finally, the present embodiment changes the output result in the prior art from a specific vocabulary to a fault diagnosis result, thereby innovatively realizing the use of word embedding technology in the field of fault diagnosis. The training process of the preset word embedding matrix and the preset neural network diagnostic model in the present embodiment is as follows. Figure 4 As shown, it can be understood that the forward propagation process in the figure is also the actual running process.
[0121] Further, in a preferred embodiment, the above step S306, optimizing the initial word embedding matrix and the initial neural network diagnostic model based on the loss function, specifically includes:
[0122] Performing back propagation on the initial neural network diagnosis model based on the loss function to optimize the initial neural network diagnosis model;
[0123] Based on the loss function, a total correction vector of the historical context vector corresponding to a frame of historical fault code set is obtained;
[0124] Based on the number of times each historical fault code appears in the target fault code set of the frame, the total correction vector is decomposed to obtain the correction component of the vector corresponding to each historical fault code in the initial word embedding matrix;
[0125] Based on the correction component, the vector corresponding to each historical fault code in the initial word embedding matrix is corrected.
[0126] The significance of the above process is that, unlike the prior art, since the context vector in this embodiment is obtained based on the weighted average of multiple word vectors, during the back-propagation correction process, the word embedding matrix also needs to be decomposed by the number of times to achieve correction.
[0127] Specifically, in a preferred embodiment, the initial word embedding matrix is:
[0128] ;
[0129] in, is the initial embedding matrix, , and They respectively represent the vectors before correction (i.e. the corresponding word vectors) corresponding to different historical fault codes in the initial word embedding matrix. There are t types of historical fault codes in total.
[0130] The correction method for the vector corresponding to each historical fault code is:
[0131] ;
[0132] in, is the first word in the initial word embedding matrix The corrected vector corresponding to the historical fault code, is the first word in the initial word embedding matrix The vector before correction corresponding to the historical fault code, is the preset learning rate, For the The correction component of the vector corresponding to the historical fault code.
[0133] The correction component is obtained according to the following formula:
[0134] ;
[0135] in, is the total correction vector of the historical context vector corresponding to a frame of historical fault code set, For the The correction component of the vector corresponding to the historical fault code, is the total number of historical fault codes that appear in the historical fault code set of this frame, The first fault code in the historical fault code set of this frame The number of historical fault codes that have occurred.
[0136] The total correction vector of the historical context vector corresponding to a frame of historical fault code set in the above process is specifically expressed as:
[0137] ;
[0138] in, is the loss function, represents the historical context vector, Different subscripts represent different elements in the historical context vector. It represents the total number of elements in the historical context vector, that is, the representation dimension of the word vector. It can be seen that the total correction vector is a vector composed of the magnitudes of each element that need to be corrected, and these magnitudes are the results of the gradient descent operation in the back propagation process of the neural network technology.
[0139] Combination Figure 5 As shown, the present invention also provides an automobile fault diagnosis system based on deep learning, comprising:
[0140] The data collection module 510 is used to obtain the fault code data of the target vehicle, where the fault code data includes multiple fault codes and the collection time series data corresponding to each fault code;
[0141] The data grouping module 520 is used to continuously group multiple fault codes based on the order of the collected time series data representation to obtain a multi-frame fault code set;
[0142] A data dimension reduction module 530 is used to convert all fault codes in a multi-frame fault code set into word vectors based on a preset word embedding matrix, merge the word vectors in the same frame fault code set, and obtain a context vector for each frame fault code set;
[0143] The fault diagnosis module 540 is used to input multiple context vectors into a preset neural network diagnosis model to obtain a fault diagnosis result of the target vehicle.
[0144] It should be noted here that the corresponding system provided in the above embodiments can implement the technical solutions described in the above method embodiments. The specific implementation principles of the above modules or units can be found in the corresponding contents in the above method embodiments, which will not be repeated here.
[0145] The present invention provides a method and system for diagnosing automobile faults based on deep learning, which first obtains fault code data of a target automobile, wherein the fault code data includes multiple fault codes and acquisition time series data corresponding to each fault code, and then, based on the order represented by the acquisition time series data, the multiple fault codes are continuously grouped to obtain a multi-frame fault code set, and then, based on a preset word embedding matrix, all fault codes in the multi-frame fault code set are converted into word vectors, and the word vectors in the same frame fault code set are merged to obtain a context vector of each frame fault code set, and finally, the multiple context vectors are input into a preset neural network diagnosis model to obtain a fault diagnosis result of the target automobile. Compared with the prior art, the present invention, on the one hand, adjusts the fault codes originally randomly generated in time into a regular sequence by grouping multiple fault codes, thereby reducing the dimension of the fault code on the time scale, and on the other hand, the present invention also regards each fault code as a vocabulary, utilizes the word embedding technology in the field of natural language processing to transfer to the encoding of the fault code, and represents the complex fault code by a word vector with a lower dimension, thereby reducing the dimension of the fault code on the type scale itself, and solves the problem of dimensional explosion in the automobile fault diagnosis method based on deep learning in the prior art.
[0146] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0147] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for automobile fault diagnosis based on deep learning, characterized in that: include: Obtaining fault code data of a target vehicle, the fault code data including multiple fault codes and acquisition time series data corresponding to each fault code; Based on the order of the collected time series data representation, multiple fault codes are continuously grouped to obtain a multi-frame fault code set; Based on the preset word embedding matrix, all fault codes in the multi-frame fault code set are converted into word vectors, and the word vectors in the same frame fault code set are merged to obtain the context vector of each frame fault code set; Multiple context vectors are input into the preset neural network diagnosis model to obtain the fault diagnosis results of the target vehicle.
2. The automobile fault diagnosis method based on deep learning according to claim 1 is characterized in that: Based on the preset word embedding matrix, all fault codes in the multi-frame fault code set are converted into word vectors, and the word vectors in the same frame fault code set are merged to obtain the context vector of each frame fault code set, including: Obtain a target fault code set, and create a one-hot encoding vector for each fault code in the target fault code set; Calculate the multiplication result of each one-hot encoding vector and the preset word embedding matrix to obtain the word vector corresponding to each one-hot encoding vector; The number of times each one-hot encoding vector appears in the target fault code set is used as the weight of the word vector corresponding to the one-hot encoding vector, and the weighted average vector of multiple word vectors is calculated as the context vector of the target fault code set.
3. The automobile fault diagnosis method based on deep learning according to claim 2 is characterized in that: The fault code is in the OBD standard fault code format; obtain the target fault code set, and establish a unique hot encoding vector for each fault code in the target fault code set, including: Obtain a target initial fault code, where the target initial fault code is a fault code in the target fault code set whose one-hot encoding vector is currently to be established; The second character in the target initial fault code is modified to a manufacturer feature code, wherein the manufacturer feature code is used to indicate a standard type of the fault code; Based on the modified target initial fault code, a one-hot encoding vector is created.
4. The automobile fault diagnosis method based on deep learning according to claim 2 is characterized in that: Before obtaining fault code data of a target vehicle, the fault code data including multiple fault codes and acquisition time series data corresponding to each fault code, the method further includes obtaining a preset word embedding matrix and a preset neural network diagnostic model, and obtaining the preset word embedding matrix and the preset neural network diagnostic model specifically includes: Obtaining an initial word embedding matrix, an initial neural network diagnostic model, historical fault code data, and actual faults corresponding to the historical fault code data, wherein the fault code data includes multiple historical fault codes and historical acquisition time series data corresponding to each historical fault code; Based on the order of historical acquisition time series data representation, multiple historical fault codes are continuously grouped to obtain a multi-frame historical fault code set; Based on the initial word embedding matrix, all fault codes in the multi-frame historical fault code set are converted into historical word vectors, and the historical word vectors in the same frame historical fault code set are merged to obtain the historical context vector of each frame historical fault code set; Input multiple historical context vectors into the initial neural network diagnosis model to obtain output results; According to the difference between the output results and the actual fault, a loss function is established; Optimize the initial word embedding matrix and the initial neural network diagnostic model based on the loss function.
5. The automobile fault diagnosis method based on deep learning according to claim 4 is characterized in that: Optimizing the initial word embedding matrix and the initial neural network diagnostic model based on the loss function, including: Performing back propagation on the initial neural network diagnosis model based on the loss function to optimize the initial neural network diagnosis model; Based on the loss function, a total correction vector of the historical context vector corresponding to a frame of historical fault code set is obtained; Based on the number of times each historical fault code appears in the target fault code set of the frame, the total correction vector is decomposed to obtain the correction component of the vector corresponding to each historical fault code in the initial word embedding matrix; Based on the correction component, the vector corresponding to each historical fault code in the initial word embedding matrix is corrected.
6. The automobile fault diagnosis method based on deep learning according to claim 5 is characterized in that: Based on the number of times each historical fault code appears in the target fault code set of the frame, the total correction vector is decomposed to obtain the correction component of the vector corresponding to each historical fault code in the initial word embedding matrix, including: The correction component of the vector corresponding to a historical fault code is obtained by the following formula: in, is the total correction vector of the historical context vector corresponding to a frame of historical fault code set, is the correction component of the vector corresponding to the i-th historical fault code, n is the total number of historical fault codes appearing in the historical fault code set of this frame, and m is the number of occurrences of the i-th historical fault code in the historical fault code set of this frame.
7. The automobile fault diagnosis method based on deep learning according to claim 6 is characterized in that: Based on the correction component, the vector corresponding to each historical fault code in the initial word embedding matrix is corrected, including: The vector corresponding to a historical fault code in the initial word embedding matrix is corrected by the following formula: in, is the corrected vector corresponding to the i-th historical fault code in the initial word embedding matrix, is the vector before correction corresponding to the i-th historical fault code in the initial word embedding matrix, and σ is the preset learning rate.
8. The automobile fault diagnosis method based on deep learning according to claim 1 is characterized in that: The collected time series data includes the timestamp corresponding to each fault code; Based on the order of collecting the timing data representation, multiple fault codes are grouped continuously to obtain a multi-frame fault code set, including: Arrange multiple fault codes in order based on timestamps; Multiple fault codes are continuously grouped based on a preset time interval to obtain a multi-frame fault code set.
9. The automobile fault diagnosis method based on deep learning according to claim 1, characterized in that: The collected time series data includes the mileage corresponding to each fault code; Based on the order of collecting the timing data representation, multiple fault codes are grouped continuously to obtain a multi-frame fault code set, including: Arrange multiple fault codes in order based on mileage; Multiple fault codes are grouped continuously based on a preset total number of groups to obtain a multi-frame fault code set.
10. A method for automobile fault diagnosis based on deep learning, characterized in that: include: A data collection module is used to obtain the fault code data of the target vehicle, the fault code data includes multiple fault codes and the collection time series data corresponding to each fault code; A data grouping module, used to continuously group multiple fault codes based on the order of the collected time series data representation to obtain a multi-frame fault code set; A data dimension reduction module is used to convert all fault codes in a multi-frame fault code set into word vectors based on a preset word embedding matrix, merge the word vectors in the same frame fault code set, and obtain the context vector of each frame fault code set; The fault diagnosis module is used to input multiple context vectors into a preset neural network diagnosis model to obtain the fault diagnosis result of the target vehicle.
Citation Information
Patent Citations
Maintenance decision tree / word vector-based fault remote diagnosis platform
CN106054857A
Fault code recognition and classification method
CN106056154A