Fault diagnosis method and system of fuel cell, electronic equipment and storage medium
By evaluating the importance of fuel cell operation data and calculating statistically, key features are selected, and a fault diagnosis classification model is established, the problem of poor diagnosis accuracy of multidimensional data in the existing technology is solved, and the rapid and accurate diagnosis of fuel cell failures is achieved.
Patent Information
- Application Number
- CN202411784847.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-06
AI Technical Summary
Existing fuel cell fault diagnosis methods have poor diagnostic accuracy when facing multidimensional data, feature selection and model training are complex, and it is easy to ignore or over-rely rely on certain features, which affects the accuracy of the diagnosis.
A fuel cell fault diagnosis method is proposed. By collecting operation data under various operating conditions, the data is evaluated for importance, the characteristic data with high importance scores are selected, and their expectations, entropy and superentropy are calculated to establish a fault diagnosis classification model as a training set.
Through importance evaluation and statistical calculation, key features are screened out, model complexity is reduced, diagnostic efficiency and accuracy are improved, and the rapid and accurate diagnosis of fuel cell failures is achieved.
Smart Images

Figure CN119812397A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of fuel cell fault diagnosis, and in particular to a fuel cell fault diagnosis method, system, electronic equipment and storage medium. Background Art
[0002] Global warming has had a profound impact on the earth's natural environment and human society. Greenhouse gas emissions are one of the main causes of global warming. Fuel cells, as a clean energy technology, play an important role in reducing greenhouse gas emissions, promoting energy transformation and responding to global warming. As the main form of fuel cells, proton exchange membrane fuel cells (PEMFC) have the advantages of high energy density, strong power performance and zero emissions, and have shown great application potential in transportation, energy storage and supply, aerospace and military fields. However, in the actual operation process, fuel cells are a nonlinear complex system composed of multiple physical fields such as heat, electricity and fluid. Component aging, environmental changes or improper control may cause system failures. If the fault cannot be eliminated in time, the performance of the battery stack will be reduced, and in severe cases, it will cause irreversible damage to the system. Therefore, it is very important to diagnose the faults that occur during the operation of the fuel cell system in a timely and accurate manner.
[0003] At present, fuel cell fault diagnosis mainly relies on machine learning technology, which collects operating data, extracts features, builds models, and trains models to identify faults. This method can process large amounts of data and automatically learn patterns in the data through algorithms, thereby achieving rapid diagnosis of faults. For example, some studies use support vector machines (SVMs), neural networks, or deep learning methods to predict and classify different faults by analyzing fuel cell voltage, current, temperature, and other parameters.
[0004] Although existing machine learning technologies have achieved certain results in fuel cell fault diagnosis, there are still some problems and challenges. In practical applications, after data collection, extracting useful features from a large amount of operating data is a complex process. As the diversity and complexity of data increase, feature selection and model training become more difficult. In addition, when performing feature selection, some key features may be ignored or over-rely on certain features, which will affect the accuracy of diagnosis. Summary of the invention
[0005] The present invention proposes a fuel cell fault diagnosis method, system, electronic device and storage medium, which solves the problem that the existing fault diagnosis method has poor diagnostic accuracy when facing multi-dimensional data.
[0006] In order to solve the above technical problems, the present invention provides a fuel cell fault diagnosis method, comprising the following steps:
[0007] Step S1: collecting a plurality of operating data of the fuel cell under various working conditions;
[0008] Step S2: performing importance evaluation on several types of the operating data, taking the operating data with importance scores greater than a set threshold as feature data, respectively calculating the expectation, entropy and super entropy of each type of feature data, and taking all the feature data, the expectation, entropy and super entropy of the feature data as a training set;
[0009] Step S3: establishing a fault diagnosis classification model, and using the training set to train the fault diagnosis classification model;
[0010] Step S4: collecting characteristic data of the fuel cell to be diagnosed, inputting the characteristic data of the fuel cell to be diagnosed and the expectation, entropy and super entropy of the characteristic data into the trained fault diagnosis classification model to obtain the fault type of the fuel cell.
[0011] Preferably, in step S2, the importance of the operating data is evaluated by Gini impurity, and the expression for calculating the Gini impurity is:
[0012]
[0013] In the formula, G m is the Gini impurity; K is the number of types of running data; p m,k is the probability that the mth running data belongs to the kth class.
[0014] Preferably, the expected expression for calculating the characteristic data in step S2 is:
[0015]
[0016] Where Ex(k) is the expectation of the kth feature data; x i (k) is the i-th feature data in the k-th feature data; N is the total number of data in the k-th feature data;
[0017] The expression for calculating the entropy of the characteristic data is:
[0018]
[0019] Where En(k) is the entropy of the k-th feature data;
[0020] The expression for calculating the super entropy of the characteristic data is:
[0021]
[0022] Where He(k) is the super entropy of the k-th feature data; S(k) is the variance of the k-th feature data.
[0023] Preferably, after collecting several types of operation data in step S1, preprocessing the several types of operation data comprises the following steps:
[0024] Step S11: cleaning missing values, abnormal values and duplicate data in the operation data;
[0025] Step S12: normalizing the cleaned operation data.
[0026] Preferably, the fault diagnosis classification model in step S3 is a random forest model.
[0027] Preferably, in step S3, a grid search algorithm GS is used to perform hyperparameter optimization on the fault diagnosis classification model to obtain the optimal parameter combination of the fault diagnosis classification model.
[0028] The present invention also provides a fuel cell fault diagnosis system, which is implemented based on the above-mentioned fuel cell fault diagnosis method, and includes: a data acquisition module, a feature extraction module, a fault diagnosis module and an iterative optimization module;
[0029] The data acquisition module is used to collect the operating data of the fuel cell to be diagnosed in real time;
[0030] The feature extraction module is used to extract features from the operating data to obtain feature data of the fuel cell to be diagnosed;
[0031] The fault diagnosis module: establishes a fault diagnosis model, trains the fault diagnosis model using the historical operation data of the fuel cell to be diagnosed, inputs the characteristic data of the fuel cell into the trained fault diagnosis model, and obtains the fault type of the fuel cell to be diagnosed;
[0032] The iterative optimization module is used to iteratively optimize the parameters of the fault diagnosis model according to the training results of the fault diagnosis model.
[0033] Preferably, the feature extraction module evaluates the importance of the operation data and uses the operation data with an importance score greater than a set threshold as feature data.
[0034] The present invention also provides an electronic device, comprising: a memory, a processor and a computer program, wherein the computer program is stored in the memory and is configured to be executed by the processor to implement the above-mentioned fuel cell fault diagnosis method.
[0035] The present invention further provides a computer-readable storage medium, in which a computer program is stored. The computer program is executed by a processor to implement the above-mentioned fuel cell fault diagnosis method.
[0036] The benefits of the present invention include at least:
[0037] 1. By evaluating the importance of fuel cell operation data and screening the characteristic data, we can remove data that does not contribute much to fault diagnosis, reduce the complexity of the model, and improve diagnostic efficiency;
[0038] 2. By using feature data and its statistics as training sets, more comprehensive data information can be provided for the fault diagnosis model, which helps the model learn deeper data patterns;
[0039] 3. By establishing a fault diagnosis classification model, fuel cell faults can be diagnosed automatically, reducing manual intervention and improving the speed and accuracy of diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of a method flow chart of an embodiment of the present invention;
[0041] Figure 2 is the importance assessment result of the operation data of the embodiment of the present invention;
[0042] Figure 3 A schematic diagram of the fault classification accuracy of the fault diagnosis model according to an embodiment of the present invention;
[0043] Figure 4 Schematic diagram of a fault classification confusion matrix according to an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings 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 belong to the protection scope of the present invention.
[0045] like Figure 1 As shown, an embodiment of the present invention provides a fuel cell fault diagnosis method, comprising the following steps:
[0046] Step S1: collecting several kinds of original operation data of the fuel cell under normal, membrane dry and hydrogen leakage conditions respectively.
[0047] Specifically, the original operating data collected by the embodiment of the present invention originates from a fuel cell system with a dual-stack structure, and the collected original operating data includes 20 state variables in total, as shown in Table 1.
[0048] Table 1 State variables of fuel cell
[0049]
[0050]
[0051] The missing values, outliers and duplicate data in the collected original operation data are cleaned, and the cleaned operation data are normalized.
[0052] Min-Max normalization can be used to convert operating data of different dimensions into the same order of magnitude, reduce the differences between operating data, accelerate the convergence process of the model, and balance the contribution of each operating data to the model, thereby improving the performance of the model. The formula used is as follows:
[0053]
[0054] In the formula, x * is the normalized running data; x i is the i-th running data after cleaning; x imax For x i The maximum value in x imin For x i The minimum value in .
[0055] Step S2: Evaluate the importance of several types of operating data, take the operating data with importance scores greater than the set threshold as feature data, calculate the expectation, entropy and super entropy of each type of feature data respectively, and take all feature data, the expectation, entropy and super entropy of feature data as training sets.
[0056] Specifically, in the embodiment of the present invention, the Random Forest algorithm (RF) is used to evaluate the importance of the operating data, so as to select the characteristic variables for fault diagnosis. RF uses Gini Impurity as an evaluation index to evaluate the importance of the operating data, and the evaluation standard is the highest purity that each child node can achieve. If the Gini impurity after feature division is smaller, the purity of the feature set after division is greater, indicating that the feature set is more important. Conversely, the greater the Gini impurity, the greater the uncertainty, indicating that the importance of the feature set is lower. Therefore, the importance of the operating data can be evaluated by Gini impurity, so as to perform feature selection. Its calculation formula is:
[0057]
[0058] In the formula, G m is the Gini impurity; K is the number of types of running data; p m,k is the probability that the mth running data belongs to the kth class.
[0059] The feature importance evaluation results of the embodiment of the present invention are as follows: Figure 2 The higher the feature importance, the richer the information contained in the feature, and the greater the impact on the diagnosis result. In order to select the best input feature combination, after comparing different operation data combinations, the final feature selection situation of the embodiment of the present invention is shown in Table 2.
[0060] Table 2 Feature selection results
[0061]
[0062] The data samples after normalization and feature selection are divided into training set and test set in a ratio of 7:3.
[0063] In addition, the cloud model can capture the uncertainty and ambiguity in the data by extracting the expectation (Ex), entropy (En) and hyperentropy (He) of the data, which is equivalent to generating new, uncertainty-related features for each feature. These new features provide additional information and can reveal the hidden complexity in the data, thereby helping the random forest to better understand and process the data. Therefore, the embodiment of the present invention fuses the features extracted by the cloud model with the original features, adds these features to the original training set and test set, and obtains a new training set and test set.
[0064] The expected expression for calculating the characteristic data is:
[0065]
[0066] Where Ex(k) is the expectation of the kth feature data; x i (k) is the i-th feature data in the k-th feature data; N is the total number of data in the k-th feature data;
[0067] The expression for calculating the entropy of feature data is:
[0068]
[0069] Where En(k) is the entropy of the k-th feature data;
[0070] The expression for calculating the super entropy of characteristic data is:
[0071]
[0072]
[0073] Where He(k) is the super entropy of the k-th feature data; S(k) is the variance of the k-th feature data.
[0074] Step S3: Establish a fault diagnosis classification model and use the training set to train the fault diagnosis classification model.
[0075] Specifically, the fault diagnosis classification model in the embodiment of the present invention adopts a random forest model, uses a grid search algorithm (GridSearch, GS) to optimize the hyperparameters of the random forest model, and brings the obtained optimal parameters into the random forest model for training. The GS algorithm defines a search space for parameters such as the number of decision trees, the maximum depth, and the minimum number of sample splits, and exhaustively searches all combinations through grid search, and evaluates the model performance through cross-validation, and finally obtains the optimal parameter combination. After finding the optimal parameters, the random forest model is retrained using data that incorporates the characteristics of the cloud model, thereby improving the accuracy and robustness of fuel cell fault diagnosis.
[0076] The new test set is input into the trained random forest model to obtain the diagnosis results, and the performance of the diagnosis results is verified. Figure 3 , 4 They are respectively a schematic diagram of the fault diagnosis accuracy and a schematic diagram of the confusion matrix of an embodiment of the present invention. It can be seen from the figures that the overall classification accuracy of the three types of data, namely normal, membrane dry and hydrogen leakage, is 99.11%.
[0077] Step S4: Collect characteristic data of the fuel cell to be diagnosed, input the characteristic data of the fuel cell to be diagnosed and the expectation, entropy and super entropy of the characteristic data into the trained fault diagnosis classification model to obtain the fault type of the fuel cell.
[0078] Aiming at the problem of low accuracy and insufficient reliability of traditional data-driven fuel cell fault diagnosis methods, the present invention proposes a fault diagnosis method based on cloud model and random forest. The cloud model captures the uncertainty and ambiguity in the data by extracting three parameters: expectation, entropy and hyperentropy. By fusing these parameters with the original data, the interpretability of the diagnosis model is enhanced and the transparency of the diagnosis process is improved. The random forest model has excellent anti-overfitting ability. By constructing multiple decision trees and integrating their results, the risk of overfitting of a single decision tree is effectively reduced, and the generalization ability of the model is enhanced. In addition, the random forest has strong robustness. Even if there is noise or outliers in the data, it can significantly reduce the impact of noise on the prediction results by integrating multiple trees. After combining the cloud model with the random forest, the model performs well in processing complex and uncertain fault diagnosis tasks, and can also cope with data noise and imbalance problems. The cloud model enhances the richness of feature expression, while the random forest ensures the accuracy and robustness of classification, thereby achieving effective judgment of fuel cell faults.
[0079] An embodiment of the present invention further provides a fuel cell fault diagnosis system, which is implemented based on the above-mentioned fuel cell fault diagnosis method and includes a data acquisition module, a feature extraction module, a fault diagnosis module and an iterative optimization module.
[0080] The data acquisition module is used to collect the operating data of the fuel cell to be diagnosed in real time.
[0081] The feature extraction module is used to extract features from the operating data to obtain feature data of the fuel cell to be diagnosed.
[0082] The fault diagnosis module establishes a fault diagnosis model, trains the fault diagnosis model using the historical operation data of the fuel cell to be diagnosed, inputs the characteristic data of the fuel cell into the trained fault diagnosis model, and obtains the fault type of the fuel cell to be diagnosed.
[0083] The iterative optimization module is used to iteratively optimize the parameters of the fault diagnosis model according to the training results of the fault diagnosis model.
[0084] An embodiment of the present invention further provides an electronic device, comprising: a memory, a processor and a computer program, wherein the computer program is stored in the memory and is configured to be executed by the processor to implement the above-mentioned fuel cell fault diagnosis method.
[0085] The embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. The computer program is executed by a processor to implement the above-mentioned fuel cell fault diagnosis method.
[0086] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. Only the preferred embodiments of the present invention are expressed. The description is more specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. As long as there is no contradiction in the combination of these technical features, they should be considered as the scope recorded in this specification.
[0087] It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these modifications and improvements all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A fuel cell fault diagnosis method, characterized in that: The following steps are involved: Step S1: collecting a plurality of operating data of the fuel cell under various working conditions; Step S2: evaluating the importance of several types of the operating data, and taking the operating data with an importance score greater than a set threshold as feature data; respectively calculating the expectation, entropy and super entropy of each type of feature data, and taking all the feature data, the expectation, entropy and super entropy of the feature data as a training set; Step S3: establishing a fault diagnosis classification model, and using the training set to train the fault diagnosis classification model; Step S4: collecting characteristic data of the fuel cell to be diagnosed, inputting the characteristic data of the fuel cell to be diagnosed and the expectation, entropy and super entropy of the characteristic data into the trained fault diagnosis classification model to obtain the fault type of the fuel cell.
2. A fuel cell fault diagnosis method according to claim 1, characterized in that: In step S2, the importance of the operating data is evaluated by Gini impurity, and the expression for calculating the Gini impurity is: In the formula, G m is the Gini impurity; K is the number of types of running data; p m,k is the probability that the mth running data belongs to the kth class.
3. A fuel cell fault diagnosis method according to claim 1, characterized in that: The expected expression for calculating the characteristic data in step S2 is: Where Ex(k) is the expectation of the kth feature data; x i (k) is the i-th feature data in the k-th feature data; N is the total number of data in the k-th feature data; The expression for calculating the entropy of the characteristic data is: Where En(k) is the entropy of the k-th feature data; The expression for calculating the super entropy of the characteristic data is: Where He(k) is the super entropy of the k-th feature data; S(k) is the variance of the k-th feature data.
4. A fuel cell fault diagnosis method according to claim 1, characterized in that: After collecting several types of operation data, step S1 pre-processes the several types of operation data, including the following steps: Step S11: cleaning missing values, abnormal values and duplicate data in the operation data; Step S12: normalizing the cleaned operation data.
5. A fuel cell fault diagnosis method according to claim 1, characterized in that: The fault diagnosis classification model in step S3 is a random forest model.
6. A fuel cell fault diagnosis method according to claim 5, characterized in that: In step S3, a grid search algorithm GS is used to optimize the hyperparameters of the fault diagnosis classification model to obtain the optimal parameter combination of the fault diagnosis classification model.
7. A fuel cell fault diagnosis system, implemented based on a fuel cell fault diagnosis method according to any one of claims 1 to 6, characterized in that: include: Data acquisition module, feature extraction module, fault diagnosis module and iterative optimization module; The data acquisition module is used to collect the operating data of the fuel cell to be diagnosed in real time; The feature extraction module is used to extract features from the operating data to obtain feature data of the fuel cell to be diagnosed; The fault diagnosis module: establishes a fault diagnosis model, trains the fault diagnosis model using the historical operation data of the fuel cell to be diagnosed, inputs the characteristic data of the fuel cell into the trained fault diagnosis model, and obtains the fault type of the fuel cell to be diagnosed; The iterative optimization module is used to iteratively optimize the parameters of the fault diagnosis model according to the training results of the fault diagnosis model.
8. A fuel cell fault diagnosis system according to claim 7, characterized in that: The feature extraction module evaluates the importance of the operation data and uses the operation data with an importance score greater than a set threshold as feature data.
9. An electronic device, comprising: A memory, a processor and a computer program, characterized in that: the computer program is stored in the memory and is configured to be executed by the processor to implement a fuel cell fault diagnosis method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement a fuel cell fault diagnosis method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Fuel cell fault diagnosis method and device
CN110632519A
Multi-mode double-layer fault diagnosis method for fuel cell system
CN113962259A
Water management fault diagnosis method for vehicle fuel cell power system
CN115409084A
Proton exchange membrane fuel cell fault diagnosis method and device
CN116184207A
Fuel cell fault diagnosis method and system
CN118114101A