A method and apparatus for predicting the remaining life of a fuel cell stack
By integrating BP neural network and GRU neural network models and combining them with genetic algorithms to optimize hyperparameters and weight configuration, the problem of accuracy in predicting the remaining lifetime of fuel cell stacks was solved, achieving higher prediction accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies cannot accurately predict the remaining lifespan of fuel cell stacks, and suffer from noise sensitivity, overfitting tendency, and lack of physical meaning, resulting in insufficient prediction accuracy.
A prediction model that integrates BP neural network and GRU neural network is adopted. Hyperparameters are optimized by genetic algorithm, and prediction weights are configured by combining target data training and testing to achieve prediction of the remaining life of fuel cell stack.
The accuracy of fuel cell stack remaining life prediction has been improved by fully utilizing the data processing characteristics of each prediction sub-model and balancing their application advantages through multi-model fusion and weight configuration.
Smart Images

Figure CN118938054B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of battery life prediction, and particularly relates to a method and device for predicting the remaining life of a fuel cell stack. BACKGROUND
[0002] Fuel cells are widely used in various fields due to their characteristics of no pollution, stable performance, long service life, high energy density and the like. However, the fuel cell stack will naturally age along with the use time during use. When the service life of the fuel cell stack reaches a critical value, the probability of an accident will increase, thereby affecting the normal operation of the equipment. Therefore, accurately predicting the remaining life of the fuel cell stack has high practical value. The current prediction method has the disadvantages of sensitivity to noise, strong overfitting tendency and lack of physical meaning. In addition, due to the complexity of the degradation mechanism of the fuel cell stack, it cannot be completely expressed by a formula, resulting in that the service life of the fuel cell stack cannot be accurately predicted.
[0003] Therefore, how to improve the accuracy of the prediction of the remaining life of the fuel cell stack is a technical problem to be solved at present. SUMMARY
[0004] The present application provides a method and device for predicting the remaining life of a fuel cell stack, which can improve the accuracy of the prediction of the remaining life of the fuel cell stack.
[0005] The embodiments of the present application provide the following solutions:
[0006] In a first aspect, the embodiments of the present application provide a method for predicting the remaining life of a fuel cell stack, and the method comprises the following steps.
[0007] Obtaining target data of the fuel cell stack, wherein the target data is data associated with the service life of the fuel cell stack during operation of the fuel cell stack;
[0008] Training and testing a preset initial prediction model according to the target data to obtain a prediction error of each prediction sub-model in the initial prediction model, wherein the initial prediction model is at least fused with two prediction sub-models, and is a model for predicting the remaining life of the fuel cell stack;
[0009] Configuring a prediction weight of a corresponding prediction sub-model in the initial prediction model according to the prediction error of each prediction sub-model to obtain a target prediction model;
[0010] Predicting the remaining life of the fuel cell stack according to the target prediction model.
[0011] In an optional embodiment, the target data of the fuel cell stack is obtained, and the obtaining comprises the following steps.
[0012] acquiring durability test data of a fuel cell stack collected in real time in a durability test;
[0013] extracting polarization test data from the durability test data according to a preset interval period;
[0014] determining test time, test current and output voltage represented by the polarization test data as target data of the fuel cell stack.
[0015] In an optional embodiment, the preset initial prediction model is trained and tested according to the target data to obtain a prediction error of each prediction sub-model in the initial prediction model, including:
[0016] dividing the target data into a training set and a test set of the initial prediction model;
[0017] training and testing each prediction sub-model in the initial prediction model according to the training set, the test set and a preset genetic algorithm model to obtain a test result of each trained prediction sub-model;
[0018] judging whether each test result meets a preset target condition of the corresponding prediction sub-model;
[0019] If not, the training and testing of the prediction sub-model that does not meet the preset target condition are continued until the preset target condition is met.
[0020] If yes, a prediction error corresponding to each prediction sub-model is determined according to a voltage deviation between a predicted voltage of each prediction sub-model and an output voltage of the fuel cell stack.
[0021] In an optional embodiment, the initial prediction model is a prediction model fusing a BP neural network model and a GRU neural network model; the training and testing of each prediction sub-model in the initial prediction model according to the training set, the test set and a preset genetic algorithm model to obtain a test result of each trained prediction sub-model, including:
[0022] optimizing hyperparameters of the BP neural network model and the GRU neural network model according to the genetic algorithm model to obtain a first parameter set of the BP neural network model and a second parameter set of the GRU neural network model;
[0023] configuring the BP neural network model and the GRU neural network model according to the first parameter set and the second parameter set, respectively;
[0024] training the BP neural network model and the GRU neural network model after the parameter configuration according to the training set;
[0025] The trained BP neural network model and the trained GRU neural network model are respectively tested according to the test set, so as to obtain a first prediction error set of the trained BP neural network model and a second prediction error set of the trained GRU neural network model;
[0026] The first mean square error of the first prediction error set is determined as the first test result of the trained BP neural network model;
[0027] The second mean square error of the second prediction error set is determined as the second test result of the trained GRU neural network model.
[0028] In an optional embodiment, the prediction weight of the corresponding prediction sub-model in the initial prediction model is configured according to the prediction error of each prediction sub-model, so as to obtain the target prediction model, which comprises:
[0029] The current prediction error is smoothed according to the historical prediction error of each prediction sub-model, so as to obtain the target prediction error of each prediction sub-model; wherein the current prediction error is the prediction error obtained by the prediction sub-model based on the target data of the current same data acquisition period;
[0030] The target prediction error of each prediction sub-model is converted, so as to obtain the target prediction weight corresponding to each prediction sub-model;
[0031] Each target prediction weight is configured to the corresponding prediction sub-model, so as to obtain the target prediction model.
[0032] In an optional embodiment, the current prediction error is smoothed according to the historical prediction error of each prediction sub-model, so as to obtain the target prediction error of each prediction sub-model, which comprises:
[0033] According to the formula The target prediction error ε of each prediction sub-model is obtained, wherein x i is the prediction error, ωi is the error weight corresponding to the prediction error, and n is a natural number greater than 1.
[0034] In an optional embodiment, the residual life of the fuel cell stack is predicted according to the target prediction model, which comprises:
[0035] The test time and the test current of the polarization test of the fuel cell stack whose residual life is to be predicted are obtained;
[0036] The test time and the test current are input into the target prediction model, so as to obtain the output voltage of the fuel cell stack whose residual life is to be predicted;
[0037] The degradation rate of the fuel cell stack with the remaining lifetime to be predicted is determined based on the output voltage, and the remaining lifetime of the fuel cell stack with the remaining lifetime to be predicted is characterized based on the degradation rate.
[0038] Secondly, embodiments of the present invention also provide a device for predicting the remaining lifetime of a fuel cell stack, the device comprising:
[0039] The acquisition module is used to acquire target data of the fuel cell stack, wherein the target data is data related to the lifespan of the fuel cell stack during operation;
[0040] The first acquisition module is used to train and test the preset initial prediction model based on the target data to obtain the prediction error of each prediction sub-model in the initial prediction model. The initial prediction model is a model that integrates at least two prediction sub-models and is used for predicting the remaining life of fuel cell stacks.
[0041] The second acquisition module is used to configure the prediction weights of the corresponding prediction sub-models in the initial prediction model according to the prediction error of each prediction sub-model, so as to obtain the target prediction model.
[0042] The prediction module is used to predict the remaining lifespan of the fuel cell stack based on the target prediction model.
[0043] Thirdly, embodiments of the present invention also provide an electronic device, including a processor and a memory, the memory being coupled to the processor, the memory storing instructions that, when executed by the processor, cause the electronic device to perform the steps of any of the methods in the first aspect.
[0044] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods in the first aspect.
[0045] The method and apparatus for predicting the remaining lifetime of a fuel cell stack according to the present invention have the following advantages compared with the prior art:
[0046] The technical scheme of the present application obtains target data of the fuel cell stack, wherein the target data is the data associated with the service life of the fuel cell stack during the operation process of the fuel cell stack; the initial prediction model is trained and tested by the target data, wherein the initial prediction model is at least fused with two prediction sub-models, and the model is used for predicting the remaining life of the fuel cell stack; after the initial prediction model is trained and tested, the prediction error of each prediction sub-model in the initial prediction model can be obtained; in order to accurately apply each prediction sub-model, the prediction weight of the corresponding prediction sub-model in the initial prediction model is configured according to the prediction error of each prediction sub-model, so as to obtain a target prediction model; and the remaining life of the fuel cell stack is predicted according to the target prediction model. The scheme combines multiple prediction sub-models to implement the service life prediction of the fuel cell stack, fully utilizes the data processing characteristics of each prediction sub-model through weight distribution, balances the application advantages of different prediction sub-models, and thus improves the accuracy of the remaining life prediction of the fuel cell stack. BRIEF DESCRIPTION OF DRAWINGS
[0047] In order to more clearly illustrate the technical scheme in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0048] Figure 1 The flowchart of the prediction method of the remaining life of the fuel cell stack provided by the embodiment of the present application;
[0049] Figure 2 The flowchart of the prediction method of the remaining life of the fuel cell stack provided by the embodiment of the present application;
[0050] Figure 3 The flowchart of the prediction method of the remaining life of the fuel cell stack provided by the embodiment of the present application;
[0051] Figure 4 The prediction principle diagram of the BP neural network model provided by the embodiment of the present application;
[0052] Figure 5 The training flowchart of the BP neural network model provided by the embodiment of the present application;
[0053] Figure 6 The flowchart of the voltage prediction of the BP neural network model provided by the embodiment of the present application;
[0054] Figure 7 The structure diagram of the prediction device of the remaining life of the fuel cell stack provided by the embodiment of the present application. DETAILED DESCRIPTION
[0055] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, and not all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art belong to the scope of protection of the embodiments of the present application.
[0056] Currently, the prediction of the remaining life of the fuel cell stack is mostly an empirical or semi-empirical method, which uses a general mathematical model to learn the long-term degradation law of the battery. However, they have the disadvantages of sensitivity to noise, strong overfitting tendency and lack of physical meaning, and due to the complexity of the fuel cell stack degradation mechanism, it cannot be completely expressed by formula, resulting in insufficient accuracy of the prediction of the remaining life of the fuel cell stack. The embodiments of the present application will specifically describe how to improve the accuracy of the prediction of the remaining life of the fuel cell stack.
[0057] Please refer to Figure 1 , Figure 1 A flowchart of a prediction method of the remaining life of a fuel cell stack is provided in the embodiments of the present application. The prediction method can be applied to a computer or server device to implement the prediction of the remaining life of the fuel cell stack. The prediction method comprises:
[0058] S11, obtaining target data of the fuel cell stack, wherein the target data is data associated with the service life of the fuel cell stack during operation of the fuel cell stack.
[0059] Specifically, the data items of the target data can be configured in multiple ways according to actual needs, such as the cumulative use time of the fuel cell stack, the load current, the operating temperature, etc. The corresponding target data can be stored based on the cumulative use time of the fuel cell stack.
[0060] It should be noted that the fuel cell stack collecting the target data can be a fuel cell stack running on a load, such as a fuel cell stack installed on a hydrogen fuel vehicle; or a fuel cell stack for testing, such as a fuel cell stack for aging test or durability test on a test stand, which is not specifically limited here. The target data can include multiple fuel cell stacks, which are encoded and stored based on different fuel cell stacks.
[0061] In actual application, since the fuel cell stack is running on a vehicle, its data is affected by multiple factors, and the accuracy of the target data collected on the vehicle may be insufficient. Based on this, in a specific embodiment, step S11 comprises sub-steps S11-1 to S11-3, specifically:
[0062] S11-1, obtain the durability test data of the fuel cell stack collected in real time in the durability test. The main purpose of the durability test is to evaluate the performance degradation of the fuel cell stack during long-term operation, including the changes of key indicators such as voltage stability, current output capability, electrochemical impedance, and power transmittance. Through the test, the life expectancy of the fuel cell stack can be understood, providing important reference for the design, manufacture and application of the fuel cell stack. The durability test can be carried out on the fuel cell stack based on the existing test specification, and the test data collected in real time during the test is taken as the durability test data.
[0063] S11-2, extract the polarization test data from the durability test data according to the preset interval period. The interval period can be determined based on the polarization test requirements or the extraction requirements of the data amount, for example, set the interval period to 100h, and extract the polarization curve from the durability test data every 100h, which is a curve representing the relationship between the test time, test current and output voltage of the fuel cell stack in the durability test.
[0064] S11-3, determine the test time, test current and output voltage represented by the polarization test data as the target data of the fuel cell stack. The target data can be based on the test time, and the corresponding test current and output voltage are stored. It should be noted that the test current can be represented as current density. In the polarization test, after the fuel cell stack reaches the test time, the load test is carried out based on the current density to obtain the corresponding output voltage. The current density can be accumulated in sequence based on a preset step, for example, 0.1A / cm 2 , 0.2A / cm 2 , 0.3A / cm 2 , 0.4A / cm 2 , until the maximum value, which can be set as the current density corresponding to the rated current of the fuel cell stack.
[0065] It can be understood that the above-mentioned method can group and store the test time, test current and output voltage to construct the target data. Since the test current and test time have a greater impact on the fuel cell stack, taking them as the target data can take into account the time of data processing and the accuracy of subsequent remaining life prediction. After obtaining the target data of the fuel cell stack, step S12 is entered.
[0066] S12, train and test the preset initial prediction model according to the target data to obtain the prediction error of each prediction sub-model in the initial prediction model, wherein the initial prediction model is at least fused with two prediction sub-models, and is used for the remaining life prediction of the fuel cell stack.
[0067] Specifically, the initial prediction model can be built based on actual needs, please refer to Figure 2 ,Figure 2 To predict the model building process schematic diagram, select n prediction sub-models, n is a natural number greater than or equal to 2, including prediction sub-model 1, prediction sub-model 2… Prediction sub-model n, etc., all prediction sub-models are fused into prediction model based on model fusion strategy. Model fusion strategy can be parallel use of multiple prediction sub-models, or the output of one or more prediction sub-models can be used as the input of other prediction sub-models. The model fusion strategy is not specifically limited here. The target data can be used as a data sample to train the initial prediction model. After training, test it based on the test results to determine the prediction error of each prediction sub-model.
[0068] In practical application, since the prediction sub-models may involve multiple hyperparameters, if adjustment is made based on the experience or trial and error method of the technical personnel, it will consume more energy and time. Based on this, in a specific embodiment, step S12 includes sub-steps S12-1 to S12-5, specifically:
[0069] S12-1, divide the target data into a training set and a test set of the initial prediction model. The division ratio of the training set and the test set can be determined based on the total data amount of the target data, for example, when the total data amount is less than a preset interval, the division ratio of the training set and the test set is set to 7:3; when the total data amount is in the preset interval, the division ratio of the training set and the test set is set to 8:2; when the total data amount is greater than the preset interval, the division ratio of the training set and the test set is set to 9:1.
[0070] S12-2, according to the training set, the test set and the preset genetic algorithm model, train and test each prediction sub-model in the initial prediction model respectively to obtain the test result of each trained prediction sub-model. The prediction sub-model can select BP neural network model and LSTM model. The BP neural network model has high accuracy for processing large data amount; the LSTM model has good applicability when processing time series related data. However, both of the above models have a large number of hyperparameters, which can be quickly iterated by genetic algorithm model to determine the parameters with high importance in each model. Then train and adjust the parameters based on the training set, test the accuracy of the model after training to obtain the test result of each prediction sub-model. The test result can be represented as the accuracy of the prediction, or the prediction error, which is not specifically limited here.
[0071] The following will take the initial prediction model as an example of the prediction model fused with BP neural network model and GRU neural network model to explain how to obtain the test result of each trained prediction sub-model, specifically including:
[0072] In the first step, the hyperparameters of the BP neural network model and the GRU neural network model are respectively optimized according to the genetic algorithm model, so as to obtain a first parameter set of the BP neural network model and a second parameter set of the GRU neural network model. For example, the parameter optimization of the BP neural network model is a very difficult work, because the BP neural network model has many hyperparameters, such as learning rate, neuron number, activation function, etc. These parameters form an infinite combination of hyperparameters, so it is impossible to exhaust all possibilities, and therefore an effective optimization algorithm is needed to optimize the parameters.
[0073] The genetic algorithm can effectively perform global optimization on the parameters due to its own characteristics, and can be easily combined with various algorithms, so the genetic algorithm model is combined with the BP neural network model in the embodiment of the application to improve the prediction effect of the BP neural network model, and the improved BP neural network model can effectively converge to the global optimum. The key steps of using the genetic algorithm to improve the BP neural network model are as follows: the initial weight and threshold parameters of the BP neural network model are encoded and initialized to form a population, and each individual in the population is a feasible solution of the weight and threshold parameters of the BP neural network model. Please refer to Table 1, which shows the parameters determined by the genetic algorithm model based on the BP neural network model.
[0074] Table 1:
[0075]
[0076] Based on the above method, the first parameter set of the BP neural network model can be obtained; similarly, the hyperparameters of the GRU neural network model can be optimized based on the genetic algorithm model to obtain the second parameter set of the GRU neural network model.
[0077] In the second step, the BP neural network model and the GRU neural network model are respectively configured according to the first parameter set and the second parameter set. The first parameter set represents the characteristics of the remaining life prediction based on the fuel cell stack, and the parameters of the BP neural network model need to be configured; the second parameter set represents the parameters of the GRU neural network model that need to be configured, and after the parameter configuration of the BP neural network model and the GRU neural network model is completed based on the first parameter set and the second parameter set, the next step is entered.
[0078] In the third step, the BP neural network model and the GRU neural network model with completed parameter configuration are trained according to the training set. In the training process of each model, the fitness is calculated according to the training error fitness function, and it is judged whether the fitness meets the requirements. If the requirements are met, the optimal weight and threshold of the BP neural network are obtained by decoding, otherwise the selection, crossover and mutation operations are continued, the population is updated and repeated iteration is repeated until the final fitness meets the specified requirements or the specified number of iterations is reached.
[0079] The optimal weight and threshold obtained by decoding are substituted into the BP neural network model, and the model is trained until the training error reaches the preset target value or the BP neural network model reaches the specified training number of rounds, and the training of the BP neural network model is completed. Although the BP neural network model has many advantages, when it is applied to time series data, it is often difficult to obtain the optimal result due to the lack of time sequence, so the remaining life prediction of the fuel cell stack is considered by combining the GRU neural network model. The GRU neural network model is a variant of RNN (Recurrent Neural Network), which is used to process data with time series structure. The GRU neural network model solves the problems of gradient disappearance and gradient explosion in traditional RNN when processing long-term dependencies by introducing a gating mechanism. However, GRU also has the problem of lacking physical meaning, so the combination of BP neural network model and GRU neural network model can obtain better results.
[0080] In the fourth step, the trained BP neural network model and the trained GRU neural network model are tested based on the test set to obtain the first prediction error set of the trained BP neural network model and the second prediction error set of the trained GRU neural network model. The BP neural network model and the GRU neural network model are tested based on the test set to obtain the predicted voltage of the fuel cell stack, and the difference between each predicted voltage and the actual output voltage of the fuel cell stack is obtained. The set of all prediction errors of the BP neural network model is determined as the first prediction error set, and the set of all prediction errors of the GRU neural network model is determined as the second prediction error set.
[0081] In the fifth step, the first mean square error of the first prediction error set is determined as the first test result of the trained BP neural network model. The prediction accuracy of the model can be characterized by mean absolute error MAE, mean square error MSE and mean absolute percentage error MAPE.
[0082] The average of the absolute value of the difference between the predicted voltage and the actual output voltage of the fuel cell stack is the mean absolute error MAE, and its calculation formula is:
[0083]
[0084] The average of the square of the difference between the predicted voltage and the actual output voltage of the fuel cell stack is the mean square error MSE, and its calculation formula is:
[0085]
[0086] The average of the absolute value of the difference between the predicted voltage and the actual output voltage of the fuel cell stack divided by the output voltage is the mean absolute percentage error MAPE, and the calculation formula is:
[0087]
[0088] In the above formula, f(xi) is the predicted voltage, i is a natural number greater than 1, and yi is the actual output voltage of the fuel cell stack. The smaller the above three errors, the better the performance of the model to a certain extent, so as to find a better model, that is, a model with smaller error, but attention should also be paid to avoid overfitting. Through the above formula, it can be concluded that the mean square error MSE is squared, which has higher accuracy, so the first mean square error of the first prediction error set is determined as the first test result of the BP neural network model completed training.
[0089] In the sixth step, the second mean square error of the second prediction error set is determined as the second test result of the GRU neural network model completed training.
[0090] Please refer to Figure 3 , Figure 3 The technical roadmap of the prediction method. The training process of the initial prediction model composed of the BP neural network model and the GRU neural network model is as follows: first, build a data set and a prediction model; then, respectively optimize the parameters of the BP neural network model and the GRU neural network model through the genetic algorithm model; finally, determine the test result through the mean square error MSE of each model. Still taking the prediction of the BP neural network model as an example, please refer to Figure 4 , for the remaining life prediction of the fuel cell stack, the test time and the test current can be used for prediction to obtain the corresponding predicted voltage, and based on the difference between the predicted voltage and the actual output voltage, the mean square error MSE of each model is calculated.
[0091] S12-3, determine whether each test result meets the preset target condition of the corresponding prediction sub-model. The preset target condition can be set based on actual needs, which is not limited here, for example, for the BP neural network model, the corresponding preset target condition can be set as the mean square error less than or equal to 0.01.
[0092] S12-4, each test result represents the prediction accuracy of the corresponding prediction sub-model, and when the test result does not meet the preset target condition of the corresponding prediction sub-model, it means that the training of the prediction sub-model still needs to be implemented, then continue to train and test the prediction sub-model that does not meet the preset target condition until the preset target condition is met.
[0093] S12-5, when the test result satisfies the preset target condition of the corresponding prediction sub-model, it is indicated that the prediction sub-model has been able to implement accurate data prediction, and then the prediction error corresponding to each prediction sub-model is determined according to the voltage deviation between the predicted voltage of each prediction sub-model and the output voltage of the fuel cell stack.
[0094] The training process of the BP neural network model will be specifically described below. Please refer to Figure 5 , Figure 5 The training flowchart of the BP neural network model. Specifically, it includes:
[0095] S501, design the structure of the BP neural network model.
[0096] S502, obtain the initial weights and thresholds of the BP neural network model.
[0097] S503, encode the initial weights and thresholds of the BP neural network model.
[0098] S504, initialize the population according to the encoding result of step S503.
[0099] S505, obtain the fitness value according to the training error of the BP neural network model.
[0100] S506, select and genetically implement the selection, crossover and mutation of the corresponding parameters of the BP neural network model.
[0101] S507, update the population according to the selection and genetic results of step S506.
[0102] S508, judge whether the updated population meets the preset condition.
[0103] S509, when the preset condition is met, decode the updated population.
[0104] S510, obtain the optimal weights and thresholds of the BP neural network model according to the decoding result of step S509.
[0105] S511, forward propagate the information and calculate the prediction error of the trained BP neural network model.
[0106] S512, judge whether the prediction error meets the preset target condition.
[0107] S513, when the preset target condition is not met, backward propagate the error and adjust the weights and thresholds.
[0108] S514, judge whether the training number of the BP neural network model reaches the number threshold, and stop when the number threshold is reached.
[0109] Similarly, the GRU neural network model can be trained and tested in the above manner. Specifically, it includes:
[0110] First, data collection and preparation. Build a dataset to separate the polarization curve test results from the durability test data of the fuel cell stack, test the polarization curve every 100h, and the variables are: time, current, voltage. Then, divide the dataset into training set and test set according to the ratio of 9:1.
[0111] Second, build a GRU neural network model. Use a deep learning framework (such as TensorFlow, Keras or PyTorch) to build a GRU neural network model. The GRU neural network model consists of one or more GRU layers and can contain other common deep learning layers such as fully connected layers and Dropout layers.
[0112] Third, model training. Use the training set to train the GRU neural network model. During training, optimize model parameters by minimizing the loss function. Corresponding optimization algorithms such as stochastic gradient descent (SGD) or Adam can be used.
[0113] Fourth, model evaluation and tuning. Use the test set to evaluate the prediction accuracy of the trained GRU neural network model. Evaluation indicators can include root mean square error RMSE, mean absolute error MAE, etc. If the model performance is not ideal, you can try adjusting the model architecture, hyperparameters, or adding more training data, etc.
[0114] Fifth, model application and prediction: apply the trained GRU neural network model to the test set to predict the remaining life of the fuel cell stack. The GRU neural network model also has the problem of finding the optimal parameters, so combine the genetic algorithm model with the GRU neural network model to optimize, after optimization, based on time and current data to implement prediction, and obtain the corresponding prediction error.
[0115] At this point, each prediction sub-model has been trained and the prediction error of each prediction sub-model has been obtained.
[0116] S13, according to the prediction error of each prediction sub-model, configure the prediction weight of the corresponding prediction sub-model in the initial prediction model to obtain the target prediction model.
[0117] Specifically, the prediction weight represents the importance of the corresponding prediction sub-model in performing the remaining life prediction of the fuel cell stack, and the greater the prediction weight, the greater the percentage of importance, and vice versa. The prediction weight can be configured based on different prediction errors, and the greater the prediction error, the smaller the prediction weight configured for the corresponding prediction sub-model; the smaller the prediction error, the greater the prediction weight configured for the corresponding prediction sub-model, and the target prediction model is obtained based on all prediction sub-models with completed prediction weights.
[0118] In practical applications, since the predicted voltage is closely related to the input time data and current data, if the data collection is incorrect, the accuracy of the prediction will be insufficient. Based on this, in a specific embodiment, step S13 includes sub-steps S13-1 to S13-3, specifically:
[0119] S13-1, smoothing the current prediction error according to the historical prediction error of each prediction sub-model to obtain the target prediction error of each prediction sub-model; wherein the current prediction error is the prediction error obtained by the prediction sub-model based on the target data of the current same data collection period. The historical prediction error can be the previous period prediction error of the current prediction error, or the previous n period prediction error of the current prediction error, a corresponding weight can be configured for each period prediction error, and the target prediction error of each prediction sub-model is obtained by summing the product of the prediction error and the corresponding weight.
[0120] For example, the target prediction error ε of each prediction sub-model can be obtained according to the formula i wherein x i is the prediction error, ωi is the error weight corresponding to the prediction error, and n is a natural number greater than 1. Taking an example in which the historical prediction error only includes the previous period prediction error of the current prediction error, the above summation formula can be represented as ε = x1 × ω1 + x2 × ω2, x1 is the prediction error of the previous period, x2 is the current prediction error, and ω1 + ω2 = 1.
[0121] S13-2, converting the target prediction error of each prediction sub-model to obtain the target prediction weight corresponding to each prediction sub-model. Taking an example in which the prediction sub-models include a BP neural network model and a GRU neural network model, the target prediction weights of the two are calculated by the following formula:
[0122]
[0123] wherein W 1t is the target prediction weight of the BP neural network model, ε1 is the target prediction error of the BP neural network model, W 2t is the target prediction weight of the GRU neural network model, and ε2 is the target prediction error of the GRU neural network model.
[0124] S13-3, configure each target prediction weight to the corresponding prediction sub-model to obtain a target prediction model. After the configuration of each target prediction weight is completed, there is a prediction formula as follows:
[0125] yt= W 1t ×f(x 1t )+W 2t ×f(x 2t )
[0126] Where f(x 1t ) is the predicted voltage of the BP neural network model at time t, f(x 2t ) is the predicted voltage of the GRU neural network model at time t, and yt is the predicted voltage of the target prediction model.
[0127] At this point, the prediction weight configuration of each prediction sub-model has been completed, and the target prediction model has been obtained.
[0128] S14, predicting the remaining life of the fuel cell stack according to the target prediction model.
[0129] Specifically, since the target prediction model can accurately predict the voltage data of the fuel cell stack, the remaining life of the fuel cell stack can be obtained based on the voltage change of the fuel cell stack as the use time increases.
[0130] For example, step S14 includes sub-steps S14-1 to S14-3, specifically:
[0131] S14-1, obtaining the test time and test current of the fuel cell stack to be predicted for the polarization test. The test time and test current can be set based on the polarization test requirements of the fuel cell stack, and can fully characterize the life change of the fuel cell stack through the voltage data.
[0132] S14-2, inputting the test time and test current into the target prediction model to obtain the output voltage of the fuel cell stack to be predicted for the remaining life. The target prediction model has been trained and tested, and the corresponding output voltage can be predicted through the test time and test current. The following still takes the BP neural network model as an example to specifically describe the voltage prediction process of a single prediction sub-model, please refer to Figure 6 , specifically including:
[0133] S601, separating the polarization curve test results from the original data of the fuel cell stack durability test.
[0134] S602, constructing a data set including test time, test current and output voltage.
[0135] S603, data preprocessing, dividing training set and test set.
[0136] S604, designing hyperparameters, training BP neural network model.
[0137] S605, the trained BP neural network model predicts the corresponding output voltage in the above test set.
[0138] S606, calculate the mean square error MSE between the predicted results and the true results.
[0139] S607, determine whether the mean square error MSE is less than or equal to 0.01.
[0140] S608, when the mean square error MSE is less than or equal to 0.01, calculate the output voltage of the fuel cell stack extrapolated to 20000h.
[0141] S14-3, according to the output voltage, determine the degradation rate of the fuel cell stack whose remaining life is to be predicted, and characterize the remaining life of the fuel cell stack whose remaining life is to be predicted based on the degradation rate. The degradation rate can measure the change of the output voltage of the fuel cell stack over time after use. The degradation rate is based on the formula:
[0142] Wherein, η is the degradation rate, V0 is the initial output voltage of the fuel cell stack, V t is the output voltage predicted by the target prediction model at time t.
[0143] It should be noted that the prediction method of the remaining life of the fuel cell stack can be used to predict the remaining life of the entire fuel cell stack, or to predict the remaining life of a single fuel cell, which is not limited here.
[0144] Based on the same technical concept as the prediction method, the embodiment of the application also provides a prediction device for the remaining life of a fuel cell stack. Please refer to Figure 7 , Figure 7 is a structural schematic diagram of the prediction device, and the prediction device comprises:
[0145] The acquisition module 701 is configured to acquire target data of the fuel cell stack, wherein the target data is data associated with the service life of the fuel cell stack during operation of the fuel cell stack.
[0146] The first obtaining module 702 is configured to train and test a preset initial prediction model according to the target data, so as to obtain the prediction error of each prediction sub-model in the initial prediction model, wherein the initial prediction model is at least fused with two prediction sub-models, and is a model for predicting the remaining life of the fuel cell stack.
[0147] The second obtaining module 703 is configured to configure a prediction weight of a corresponding prediction sub-model in the initial prediction model according to a prediction error of each prediction sub-model, to obtain a target prediction model.
[0148] The prediction module 704 is configured to predict the remaining life of the fuel cell stack according to the target prediction model.
[0149] In an optional embodiment, the obtaining module comprises:
[0150] The first obtaining sub-module is configured to obtain endurance test data of the fuel cell stack collected in real time in the endurance test.
[0151] The extraction sub-module is configured to extract polarization test data from the endurance test data according to a preset interval period.
[0152] The first determining sub-module is configured to determine a test time, a test current and an output voltage represented by the polarization test data as target data of the fuel cell stack.
[0153] In an optional embodiment, the first obtaining module comprises:
[0154] The division sub-module is configured to divide the target data into a training set and a test set of the initial prediction model.
[0155] The first obtaining sub-module is configured to train and test each prediction sub-model in the initial prediction model respectively according to the training set, the test set and a preset genetic algorithm model, to obtain a test result of each trained prediction sub-model.
[0156] The judging sub-module is configured to judge whether each test result meets a preset target condition of the corresponding prediction sub-model.
[0157] The processing sub-module is configured to, when the test result does not meet the preset target condition, continue to train and test the prediction sub-model that does not meet the preset target condition until the preset target condition is met.
[0158] The second determining sub-module is configured to, when the test result meets the preset target condition, determine a prediction error of each prediction sub-model according to a voltage deviation between a prediction voltage of each prediction sub-model and an output voltage of the fuel cell stack.
[0159] In an optional embodiment, the initial prediction model is a prediction model that fuses a BP neural network model and a GRU neural network model; and the first obtaining sub-module comprises:
[0160] The processing unit is configured to respectively optimize hyperparameters of the BP neural network model and the GRU neural network model according to a genetic algorithm model, to obtain a first parameter set of the BP neural network model and a second parameter set of the GRU neural network model.
[0161] The configuration unit is configured to respectively configure the BP neural network model and the GRU neural network model according to the first parameter set and the second parameter set.
[0162] The training unit is configured to train the BP neural network model and the GRU neural network model after the parameter configuration according to a training set.
[0163] The first obtaining unit is configured to respectively test the trained BP neural network model and the trained GRU neural network model according to a test set, to obtain a first prediction error set of the trained BP neural network model and a second prediction error set of the trained GRU neural network model.
[0164] The first determining unit is configured to determine a first mean square error of the first prediction error set as a first test result of the trained BP neural network model.
[0165] The second determining unit is configured to determine a second mean square error of the second prediction error set as a second test result of the trained GRU neural network model.
[0166] In an optional embodiment, the second obtaining module comprises:
[0167] The second obtaining submodule is configured to perform smoothing processing on a current prediction error according to a historical prediction error of each prediction submodel, to obtain a target prediction error of each prediction submodel; the current prediction error is a prediction error obtained by the prediction submodel based on target data of a same current data collection period.
[0168] The third obtaining submodule is configured to perform conversion processing on the target prediction error of each prediction submodel, to obtain a target prediction weight corresponding to each prediction submodel.
[0169] The fourth obtaining submodule is configured to configure each target prediction weight to a corresponding prediction submodel, to obtain a target prediction model.
[0170] In an optional embodiment, the second obtaining submodule comprises:
[0171] The second obtaining unit is configured to obtain the target prediction error ε of each prediction submodel according to a formula The target prediction error ε of each prediction submodel is obtained, where x i is a prediction error, ω i is an error weight corresponding to the prediction error, and n is a natural number greater than 1.
[0172] In an alternative embodiment, the prediction module comprises:
[0173] a second obtaining sub-module configured to obtain a test time and a test current at which the fuel cell stack to be predicted for remaining useful life performs a polarization test;
[0174] a fifth obtaining sub-module configured to input the test time and the test current into the target prediction model to obtain an output voltage of the fuel cell stack to be predicted for remaining useful life;
[0175] a third determining sub-module configured to determine a degradation rate of the fuel cell stack to be predicted for remaining useful life according to the output voltage, and characterize the remaining useful life of the fuel cell stack to be predicted for remaining useful life based on the degradation rate.
[0176] Based on the same technical concept as the prediction method, the embodiments of the present application also provide an electronic device comprising a processor and a memory coupled to the processor, the memory storing instructions which, when executed by the processor, cause the electronic device to perform the steps of any one of the prediction methods.
[0177] Based on the same technical concept as the prediction method, the embodiments of the present application also provide a computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the steps of any one of the prediction methods.
[0178] The technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0179] By obtaining the target data of the fuel cell stack, since the target data is data associated with the service life of the fuel cell stack during operation of the fuel cell stack, the initial prediction model is trained and tested by the target data, since the initial prediction model is at least fused with two prediction sub-models and is a model for predicting the remaining useful life of the fuel cell stack, the prediction error of each prediction sub-model in the initial prediction model can be obtained after the initial prediction model is trained and tested, in order to accurately apply each prediction sub-model, the prediction weight of the corresponding prediction sub-model in the initial prediction model is configured according to the prediction error of each prediction sub-model to obtain a target prediction model, and the remaining useful life of the fuel cell stack is predicted according to the target prediction model. This scheme combines the use life prediction of the fuel cell stack by multiple prediction sub-models, fully utilizes the data processing characteristics of each prediction sub-model by weight distribution, balances the application advantages of different prediction sub-models, and thus improves the accuracy of the remaining useful life prediction of the fuel cell stack.
[0180] Those skilled in the art will appreciate that embodiments of the present application can be devised for a variety of applications. It is intended that the present application be limited only by the scope of the appended claims, and it is intended that various modifications and alterations made by those skilled in the art be considered as within the scope of the present application. The embodiments of the present application will be described with reference to the attached drawings, wherein:
[0181] The present application is described in reference to the drawings using a flowchart illustration and / or a block diagram of the method, apparatus (modules) and computer program product according to embodiments of the present application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.
[0182] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.
[0183] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.
[0184] While the preferred embodiments of the application have been described, additional variations and modifications can be made to the embodiments by those skilled in the art once they learn of the basic inventive concepts. Therefore, the appended claims are intended to cover all such modifications and variations as fall within the true scope of the present application.
[0185] Obviously, many modifications and variations of the present application are possible in light of the above teachings. It is, therefore, to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.
Claims
1. A method for predicting the remaining lifetime of a fuel cell stack, characterized in that, The method includes: Acquire target data for the fuel cell stack, wherein the target data is data related to the lifespan of the fuel cell stack during operation; The preset initial prediction model is trained and tested based on the target data to obtain the prediction error of each prediction sub-model in the initial prediction model. The initial prediction model is a model that integrates at least two prediction sub-models and is used for predicting the remaining life of fuel cell stacks. The prediction weights of the corresponding prediction sub-models in the initial prediction model are configured according to the prediction error of each prediction sub-model to obtain the target prediction model; The remaining lifetime of the fuel cell stack is predicted based on the target prediction model. The method specifically includes: The target data is divided into a training set and a test set. The initial prediction model is trained using the training set. The initial prediction model is a composite model that integrates at least a BP neural network model and a GRU neural network model. The mean square error between the predicted voltage and the actual output voltage of each prediction sub-model is calculated using the test set. Calculate the weight of each sub-model based on its mean square error; The target prediction model is obtained by weighted fusion of the prediction results of each sub-model.
2. The method for predicting the remaining lifetime of a fuel cell stack according to claim 1, characterized in that, The acquisition of target data for the fuel cell stack includes: Acquire the durability test data collected in real time during the durability test of the fuel cell stack; Polarization test data is extracted from the durability test data according to a preset time interval. The test time, test current, and output voltage characterized by the polarization test data are determined as the target data for the fuel cell stack.
3. The method for predicting the remaining lifetime of a fuel cell stack according to claim 1, characterized in that, The step of training and testing a preset initial prediction model based on the target data to obtain the prediction error of each prediction sub-model in the initial prediction model includes: The target data is divided into a training set and a test set for the initial prediction model; Based on the training set, the test set, and the preset genetic algorithm model, each prediction sub-model in the initial prediction model is trained and tested separately to obtain the test results of each completed prediction sub-model. Determine whether each test result meets the preset target conditions of the corresponding prediction sub-model; If not, continue training and testing the prediction sub-models that do not meet the preset target conditions until the preset target conditions are met; If so, the prediction error corresponding to each prediction sub-model is determined based on the voltage deviation between the predicted voltage of each prediction sub-model and the output voltage of the fuel cell stack.
4. The method for predicting the remaining lifetime of a fuel cell stack according to claim 3, characterized in that, The initial prediction model is a prediction model that integrates a BP neural network model and a GRU neural network model; the step of training and testing each prediction sub-model in the initial prediction model according to the training set, the test set, and the preset genetic algorithm model to obtain the test results of each trained prediction sub-model includes: The hyperparameters of the BP neural network model and the GRU neural network model are optimized according to the genetic algorithm model to obtain the first parameter set of the BP neural network model and the second parameter set of the GRU neural network model. Configure the BP neural network model and the GRU neural network model according to the first parameter set and the second parameter set, respectively; The BP neural network model and GRU neural network model with complete parameter configuration are trained based on the training set; The trained BP neural network model and GRU neural network model are tested according to the test set to obtain a first prediction error set of the trained BP neural network model and a second prediction error set of the trained GRU neural network model. The first mean square error of the first prediction error set is determined as the first test result of the trained BP neural network model. The second mean square error of the second prediction error set is determined as the second test result of the completed GRU neural network model.
5. The method for predicting the remaining lifetime of a fuel cell stack according to claim 1, characterized in that, The step of configuring the prediction weights of the corresponding prediction sub-models in the initial prediction model according to the prediction error of each prediction sub-model to obtain the target prediction model includes: The current prediction error is smoothed based on the historical prediction error of each prediction sub-model to obtain the target prediction error of each prediction sub-model; wherein, the current prediction error is the prediction error obtained by the prediction sub-model based on the target data of the same current data collection period; The target prediction error of each prediction sub-model is transformed to obtain the target prediction weight corresponding to each prediction sub-model; Each target prediction weight is assigned to the corresponding prediction sub-model to obtain the target prediction model.
6. The method for predicting the remaining lifetime of a fuel cell stack according to claim 5, characterized in that, The current prediction error is smoothed based on the historical prediction error of each prediction sub-model to obtain the target prediction error for each prediction sub-model, including: According to the formula Obtain the target prediction error for each prediction sub-model. ,in, For prediction error, The error weight is the error corresponding to the prediction error, where n is a natural number greater than 1.
7. The method for predicting the remaining lifetime of a fuel cell stack according to claim 1, characterized in that, The step of predicting the remaining lifetime of the fuel cell stack based on the target prediction model includes: To obtain the test time and test current for polarization testing of fuel cell stacks with predicted remaining lifetime; The test time and the test current are input into the target prediction model to obtain the output voltage of the fuel cell stack with the remaining lifetime to be predicted; The degradation rate of the fuel cell stack with the remaining lifetime to be predicted is determined based on the output voltage, and the remaining lifetime of the fuel cell stack with the remaining lifetime to be predicted is characterized based on the degradation rate.
8. A device for predicting the remaining lifespan of a fuel cell stack, characterized in that, The device includes: An acquisition module is used to acquire target data of the fuel cell stack, wherein the target data is data related to the lifespan of the fuel cell stack during operation; The first acquisition module is used to train and test a preset initial prediction model based on the target data to obtain the prediction error of each prediction sub-model in the initial prediction model, wherein the initial prediction model is a model that fuses at least two prediction sub-models and is used for predicting the remaining life of fuel cell stacks. The second obtaining module is used to configure the prediction weights of the corresponding prediction sub-models in the initial prediction model according to the prediction error of each prediction sub-model, so as to obtain the target prediction model. The prediction module is used to predict the remaining lifespan of the fuel cell stack based on the target prediction model. The first obtaining module and the second obtaining module are specifically used for: The target data is divided into a training set and a test set. The initial prediction model is trained using the training set. The initial prediction model is a composite model that integrates at least a BP neural network model and a GRU neural network model. The mean square error between the predicted voltage and the actual output voltage of each prediction sub-model is calculated using the test set. Calculate the weight of each sub-model based on its mean square error; The target prediction model is obtained by weighted fusion of the prediction results of each sub-model.
9. An electronic device, characterized in that, The device includes a processor and a memory, the memory being coupled to the processor, the memory storing instructions that, when executed by the processor, cause the electronic device to perform the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-7.
Citation Information
Patent Citations
Composite model lithium battery life prediction method based on multi-algorithm weighted sum
CN117034762A
Fuel cell life prediction method and device
CN117630718A