Fuel cell performance degradation prediction method, system, equipment and medium
By adopting a graph neural network-based prediction model in fuel cell performance decay prediction and using the output voltage as a health indicator, the problem that prediction accuracy depends on the quality of the training data in the prior art is solved, and a high-precision and interpretable fuel is achieved Battery performance decay prediction.
Patent Information
- Application Number
- CN202411415969.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-02-21
AI Technical Summary
The existing fuel cell performance decay prediction methods have the problem that prediction accuracy depends on the quality of the training data, and the model is susceptible to noise, making it difficult to accurately predict under dynamic load conditions, and lacks interpretability.
Using a prediction model based on graph neural network (GNN), the output voltage is used as a health indicator to construct graph construction layer, graph convolutional layer, graph attention layer, LSTM layer and linear layer, combined with a random search algorithm to optimize hyperparameters to achieve the High-precision prediction of fuel cell performance degradation.
It improves the accuracy and interpretability of fuel cell performance decay prediction, can accurately predict performance decay trends under dynamic operating conditions, and enhances the credibility of the model.
Smart Images

Figure CN119493002A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of batteries, and in particular to a method, system, device and medium for predicting fuel cell performance degradation. Background Art
[0002] Proton exchange membrane fuel is an energy conversion device that directly converts the chemical energy of fuel into electrical energy. The performance of fuel cells is affected by various factors, such as operating conditions, internal electrochemical reactions, water and thermal management of the gas diffusion layer, which in turn will affect the performance degradation of the system during operation. In order to improve the use and maintenance costs of fuel cells and extend their service life, the degradation prediction of fuel cell systems is used to provide theoretical basis and information support for the management of fuel cell systems.
[0003] In some related technologies, the prediction accuracy of the fuel cell performance degradation prediction method based on statistical theory depends more on the quantity and quality of training data and is easily affected by noise; the prediction model based on shallow neural network has limited feature extraction ability for fuel cell performance degradation information. The existing battery performance degradation prediction method also has the following problems: the load test process of battery operation is simple, and there is little research on fuel cell prediction under dynamic load conditions; the traditional performance degradation prediction model long short-term memory network is implemented using an iterative structure. As the prediction time increases, the model is prone to gradient vanishing or gradient exploding problems, which affects the prediction accuracy; the neural network model can handle the complex relationship between input and output parameters, but this complexity also makes the model a black box model. Since it is impossible to know the relationship between the prediction results and these features, the model lacks interpretability. Summary of the invention
[0004] In order to solve at least one of the problems mentioned in the above background technology, the present application provides a fuel cell performance degradation prediction method, system, device and medium, which takes the output voltage as a health indicator of fuel cell performance degradation, fully considers the heterogeneity and correlation of fuel cell operating parameters, and realizes high-precision and explainable performance degradation prediction of proton exchange membrane fuel cells.
[0005] The specific technical solutions provided by the embodiments of this application are as follows:
[0006] In a first aspect, a method for predicting fuel cell performance degradation is proposed, the method comprising:
[0007] Acquire a battery durability data set, and scale the data in the data set using a standard score to obtain preprocessed data;
[0008] Dividing the preprocessed data into training set data and test set data;
[0009] Constructing a recession prediction model based on a graph neural network, optimizing hyperparameters of the recession prediction model using a random search algorithm, and training the recession prediction model in combination with the training set data to obtain a trained prediction model;
[0010] The test set data is input into the trained prediction model, and the prediction result is output.
[0011] In a specific embodiment, data cleaning is performed on the data in the data set to obtain abnormal data values in the cleaned data set; a preset threshold is set to replace the abnormal data values to obtain a normal data set; and the standard score is used to scale the data in the normal data set to preprocessed data with a preset mean and a preset standard deviation.
[0012] In a specific embodiment, the construction of a decline prediction model based on a graph neural network specifically includes: selecting the output voltage in the data set as the health indicator of the fuel cell, and setting other parameters in the data set as parameters of the decline prediction model; and respectively constructing a graph construction layer, a graph convolution layer, a graph attention layer, a LSTM layer and a linear layer of the decline prediction model.
[0013] In a specific embodiment, the method further comprises:
[0014] The calculation formula (1) of the graph structure layer is as follows:
[0015] M1=tanh(αE1Θ1)
[0016] M2=tanh(αE2Θ2) (1)
[0017]
[0018] Where E1 and E2 represent randomly initialized node embedding vectors; α represents a hyperparameter used to control the saturation rate of the activation function; Θ1 and Θ2 represent model decay prediction model parameters; M1 and M2 represent adjacency matrices, respectively; A represents the embedding matrix;
[0019] The calculation formula (2) of the graph convolution layer is as follows:
[0020]
[0021] Among them, H (l) represents the feature representation matrix of level l nodes; H (l+1) Represents the feature representation matrix of l+1 level nodes; represents the adjacency matrix plus the identity matrix I; express degree matrix; i is the row index of the adjacency matrix A; W (l)represents the weight matrix of layer l; σ represents the nonlinear activation function;
[0022] The calculation formula (3) of the graph attention layer is as follows:
[0023] α ij =Softmax(LeakyReLU(a T [Wh i ||Wh j ])) (3)
[0024] Where a represents the learned attention weight vector; W represents the learnable weight matrix; h i and h j Represent the feature vectors of node i and node j respectively; || represents the concatenation operation of vectors; LeakyReLU represents the introduction of nonlinear activation function, and Softmax represents the normalization function that converts the elements of the vector into probability distribution;
[0025] The LSTM layer includes an input gate, a forget gate and an output gate. The calculation formula (4) of the input gate is as follows:
[0026] i t =σ(W xi x t +W hi h t-1 +b i ) (4)
[0027] Among them, i t represents the state vector of the input gate; x t represents the input vector at time t; h t-1 Represents the hidden vector of the LSTM unit at the previous moment; W xi and W hi represents different weight matrices; σ represents the activation function; b i represents the bias vector of the input gate;
[0028] The calculation formula (5) of the forget gate is as follows:
[0029] f t =σ(W xf x t +W hf h t-1 +b f ) (5)
[0030] Among them, f t Represents the state vector of the forget gate; W xf and W hf represents different weight matrices; b f Represents the bias vector of the forget gate;
[0031] The calculation formula (6) of the output gate is as follows:
[0032] o t =σ(W xo x t +W ho h t-1 +b o ) (6)
[0033] Among them, t Represents the state vector of the output gate; W xo and W ho represents different weight matrices; b o Represents the bias vector of the output gate.
[0034] In a specific embodiment, the length of the time moving window in the graph attention layer is set to a first length, and the prediction length in the graph attention layer is set to a second length; the first length is set to be an integer multiple of the second length, where the integer is greater than or equal to 2.
[0035] In a specific embodiment, the Adam algorithm is used to adjust the weight of the decay prediction model, specifically including:
[0036] The model parameters of the decay prediction model at the preset number of iterations are obtained, and the gradient of the objective function with respect to the model parameters at the preset number of iterations is calculated. The calculation formula (7) is as follows:
[0037]
[0038] Among them, θ t represents the model parameters at the tth iteration; g t Indicates the objective function with respect to θ at the tth iteration t The gradient of
[0039] Calculate and update the first-order moment estimate, and the calculation formula (8) is as follows:
[0040] m t =β1·m t-1 +(1-β1)·g t (8)
[0041] Among them, m t represents the first-order moment estimate of the gradient at the tth iteration; β1 represents the decay rate of the first-order moment estimate; g t Indicates the objective function with respect to θ at the tth iteration t The gradient of m t-1 Represents the first-order moment estimate of the gradient at the t-1th iteration;
[0042] Calculate and update the second-order moment estimate, and the calculation formula (9) is as follows:
[0043] v t =β2·v t-1 +(1-β2)·g t (9)
[0044] Among them, v t represents the second-order moment estimate of the gradient at the tth iteration; β2 represents the decay rate of the second-order moment estimate; g t Indicates the objective function with respect to θ at the tth iteration t The gradient of v t-1 represents the second-order moment estimate of the gradient at the t-1th iteration;
[0045] Calculate the first-order moment deviation correction and the second-order moment deviation correction, and the calculation formulas (10) and (11) are as follows:
[0046]
[0047] in, represents the first-order moment deviation correction at the tth iteration; m t represents the first-order moment estimate of the gradient at the tth iteration; represents the decay rate of the first-order moment estimate at the t-th iteration; represents the second-order moment deviation correction at the tth iteration; v t represents the second-order moment estimate of the gradient at the tth iteration; represents the decay rate of the second-order moment estimate at the tth iteration;
[0048] The model parameters at the t-th iteration are updated by combining the first-order moment deviation correction and the second-order moment deviation correction, and the calculation formula (12) is as follows:
[0049]
[0050] Among them, θ t represents the model parameters at the tth iteration; θ t-1 represents the model parameters at the t-1th iteration; α represents the learning rate; represents the first-order moment deviation correction at the tth iteration; represents the second-order moment deviation correction at the tth iteration.
[0051] In a specific embodiment, the MSE model is used as the error correction function in the decay prediction model, and its calculation formula (13) is as follows:
[0052]
[0053] Among them, m represents the number of samples, y i Indicates the measured voltage value. Indicates the predicted voltage value.
[0054] In a second aspect, a fuel cell performance degradation prediction system is provided, which is used to implement the fuel cell performance degradation prediction method as described above, and the system comprises:
[0055] A preprocessing unit, used for acquiring a battery durability data set, and scaling the data in the data set using a standard score to obtain preprocessed data;
[0056] A division unit, used for dividing the preprocessed data into training set data and test set data;
[0057] A model building unit, used to build a recession prediction model based on a graph neural network, optimize the hyperparameters of the recession prediction model using a random search algorithm, and train the recession prediction model in combination with the training set data to obtain a trained prediction model;
[0058] The model prediction unit is used to input the test set data into the trained prediction model and output the prediction result.
[0059] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0060] Step A: obtaining a battery durability data set, and scaling the data in the data set using a standard score to obtain preprocessed data;
[0061] Step B: Divide the preprocessed data into training set data and test set data;
[0062] Step C: constructing a recession prediction model based on a graph neural network, optimizing the hyperparameters of the recession prediction model using a random search algorithm, and training the recession prediction model in combination with the training set data to obtain a trained prediction model;
[0063] Step D: Input the test set data into the trained prediction model and output the prediction result.
[0064] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0065] Step A: obtaining a battery durability data set, and scaling the data in the data set using a standard score to obtain preprocessed data;
[0066] Step B: Divide the preprocessed data into training set data and test set data;
[0067] Step C: constructing a recession prediction model based on a graph neural network, optimizing the hyperparameters of the recession prediction model using a random search algorithm, and training the recession prediction model in combination with the training set data to obtain a trained prediction model;
[0068] Step D: Input the test set data into the trained prediction model and output the prediction result.
[0069] The embodiments of the present application have the following beneficial effects:
[0070] 1. The fuel cell performance degradation prediction method provided in the embodiment of the present application constructs a prediction model based on GNN, trains the model using training set data, and defines a hyperparameter search space, defines a target error function to be optimized, and creates a function optimizer to adjust the hyperparameters of the model, thereby performing hyperparameter optimization. It achieves high-precision performance degradation prediction of fuel cells under dynamic conditions using the GNN proton exchange membrane fuel cell performance degradation prediction model. At the same time, in response to the black box problem faced by commonly used degradation prediction models, the graph neural network used in the present application improves the prediction accuracy while making an explanatory analysis of the prediction process, thereby improving the credibility of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0072] Figure 1 A schematic diagram of an application environment according to the present application is shown;
[0073] Figure 2 A schematic diagram of a fuel cell performance degradation prediction method according to the present application is shown;
[0074] Figure 3 A schematic diagram showing the specific steps of the fuel cell performance degradation prediction method in the present application;
[0075] Figure 4 A schematic diagram showing the change of voltage data over time in the preprocessed data according to the present application;
[0076] Figure 5 A schematic diagram of an error convergence curve of the recession prediction model in the present application is shown;
[0077] Figure 6 A schematic diagram showing predicted values and actual values of output voltage according to the decay prediction model under dynamic load conditions in the present application is shown;
[0078] Figure 7 A schematic diagram showing the correlation of parameters of the recession prediction model in the present application is shown;
[0079] Figure 8 A schematic diagram showing the average weight distribution of the graph attention layer according to the decay prediction model in this application;
[0080] Fig. 9 A schematic diagram of a fuel cell performance degradation prediction system according to the present application is shown;
[0081] Fig.10 A schematic diagram of a computer device according to the present application is shown. DETAILED DESCRIPTION
[0082] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0083] The fuel cell performance degradation prediction method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 is configured with a decay prediction model, by constructing a decay prediction model based on a graph neural network, and using a random search algorithm to optimize the hyperparameters of the decay prediction model, and training the decay prediction model in combination with the training set data to obtain a trained prediction model; input the test set data into the trained prediction model to output a prediction result. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0084] In one embodiment, Figure 2 As shown, a fuel cell performance degradation prediction method is provided, and the method is applied to Figure 1 The terminal in the , including the following steps:
[0085] Step 101: Acquire a battery durability data set, and use a standard score to scale the data in the data set to obtain preprocessed data.
[0086] like Figure 3As shown, the raw sensor data of the fuel cell stack is collected to obtain a battery durability data set, wherein the data in the battery durability data set include operating time, operating current, output voltage, output power, anode inlet / outlet pressure, cathode inlet / outlet pressure, anode inlet temperature / outlet temperature, cathode inlet temperature / outlet temperature, anode hydrogen volume flow, cathode oxygen volume flow, anode plate temperature, cathode plate temperature, anode dew temperature and cathode dew temperature. The direct performance parameter output voltage is selected as the health indicator of the fuel cell.
[0087] Data sampling and data cleaning are performed on the battery durability data set, specifically including data cleaning of the data in the data set to obtain abnormal data values in the cleaned data set; setting a preset threshold to replace the abnormal data values to obtain a normal data set; and using the standard score to scale the data in the normal data set to pre-processed data with a preset mean and a preset standard deviation.
[0088] In a specific embodiment, outliers are corrected by replacing them with the mean, and then the data is normalized and scaled to a specific range so that different features are consistent. After that, the acquired data set is scaled to a standard normal distribution with a mean of 0 and a standard deviation of 1 using the Z-score method, and the operating parameters used as model input are unified within a certain range to improve the convergence speed and accuracy of the model.
[0089] The calculation formula (1) for scaling the acquired data set to a standard normal distribution with a mean of 0 and a standard deviation of 1 using the Z-score method is as follows:
[0090]
[0091] Among them, X represents the sequence value of the parameter in the data set, and μ and σ represent the mean and standard deviation of the parameter sequence respectively.
[0092] Step 102: Divide the preprocessed data into training set data and test set data.
[0093] It should be noted that in this embodiment, the pre-processed data is divided into training set data and test set data to train the model, and the trained model is verified by the test set data. Specifically, the data set is divided according to the ratio of 60% and 40%, the first 605 hours of data are divided into the training set, and the last 403 hours are divided into the test set. The final processing result of all voltage data is as follows Figure 4 shown.
[0094] Step 103: construct a recession prediction model based on a graph neural network, use a random search algorithm to optimize the hyperparameters of the recession prediction model, and train the recession prediction model in combination with the training set data to obtain a trained prediction model.
[0095] Specifically, the method includes selecting the output voltage in the data set as the health indicator of the fuel cell, setting other parameters in the data set as parameters of the decay prediction model; and constructing the graph construction layer, graph convolution layer, graph attention layer, LSTM layer and linear layer of the decay prediction model respectively.
[0096] Among them, graph construction is a key component in GNN, and its role is to create graph structure data based on input data and determine the connections and relationships between nodes in the graph structure. In the proposed graph construction layer, different types of operating parameters of the fuel cell are regarded as nodes in the graph, and the graph adjacency matrix is used to describe the unidirectional connection relationship between different operating parameters. Graph neural networks can model and analyze complex structures and relationships in the graph through feature representation and information transfer of nodes and edges. The calculation formula (2) of the graph construction layer is as follows:
[0097] M1=tanh(αE1Θ1)
[0098] M2=tanh(αE2Θ2) (2)
[0099]
[0100] Among them, E1 and E2 represent randomly initialized node embedding vectors; α represents a hyperparameter used to control the saturation rate of the activation function; Θ1 and Θ2 represent model decay prediction model parameters; M1 and M2 represent adjacency matrices, respectively; A represents the embedding matrix; tanh and ReLU are two commonly used activation functions used to introduce nonlinear characteristics in neural networks.
[0101] The number of edges in each node is constrained to a maximum value. Specifically, for each node, only the k nearest neighboring nodes are retained. This strategy effectively reduces the graph density, reduces computational complexity, and enables the network to prioritize information exchange with the most relevant neighboring nodes. The calculation formulas (3) and (4) for each row of the adjacency matrix (i = 1, 2, ..., N) are as follows:
[0102] idx=argtopk(A[i,:]) (3)
[0103] A[i,-idx]=0 (4)
[0104] Where i is the row index of the adjacency matrix A and argtopk is a function that selects the top k largest elements from a given vector and returns their indices as idx.
[0105] Furthermore, the graph data is propagated and updated through the graph convolution layer. It updates the representation of the node by focusing on the information of the node's neighbors to capture the relationship and contextual information between the nodes. The calculation formula (5) of the graph convolution layer is as follows:
[0106]
[0107] Among them, H (l) represents the feature representation matrix of level l nodes; H (l+1) Represents the feature representation matrix of the l+1 level nodes; represents the adjacency matrix plus the identity matrix I; express degree matrix; i is the row index of the adjacency matrix A; W (l) represents the weight matrix of layer l; σ represents the nonlinear activation function;
[0108] The core calculation process of the graph convolution layer is described through the graph convolution layer. The feature matrix H (l) By comparing with the adjacency matrix and the weight matrix W (l) Multiply to summarize and transform information, and finally get the updated feature matrix H (l+1) .
[0109] The calculation formula (6) of the graph attention layer is as follows:
[0110] α ij =Softmax(LeakyReLU(a T [Wh i ||Wh j ])) (6)
[0111] Where a represents the learned attention weight vector; W represents the learnable weight matrix; h i and h j They represent the feature vectors of node i and node j respectively; || represents the concatenation operation of the vectors; LeakyReLU represents the introduction of a nonlinear activation function, and Softmax represents the normalization function that converts the elements of the vector into a probability distribution.
[0112] The graph attention network improves the model’s expressiveness and predictive performance by considering node and time attention. Node attention is used to calculate the importance or relevance between different nodes in the graph. It is calculated based on the connection relationship between nodes and node feature vectors to determine the importance of each node in the graph. Then, the features of adjacent nodes are weighted and aggregated according to the attention weight to obtain the node h′ i The updated feature vector of is calculated as follows:
[0113]
[0114] Among them, W represents the learnable weight matrix and σ represents the activation function.
[0115] Temporal attention focuses on the importance of different moments to learn the temporal correlation in sequence data. It is calculated based on the time step index and the hidden state of the sequence data to determine the importance of each time step. The calculation formula (8) of temporal attention is as follows:
[0116]
[0117] where h i is the hidden state of the input sequence data at time i, s t is the hidden state of the corresponding output at time t. Then the elements in the input sequence are weighted and summed according to the attention weights, and the final context state vector is obtained by calculating formula (9) below, which will be used for further processing and output.
[0118]
[0119] Among them, by updating the attention weight α and the weight matrix W, the graph attention layer can adaptively focus on important neighbor nodes and time steps, and aggregate their features to perform complex graph data modeling and prediction tasks. The above equation describes the information transfer process in the graph attention layer.
[0120] The LSTM layer includes an input gate, a forget gate and an output gate. The calculation formula (10) of the input gate is as follows:
[0121] i t =σ(W xi x t +W hi h t-1 +b i ) (10)
[0122] Among them, i t represents the state vector of the input gate; x t represents the input vector at time t; h t-1 Represents the hidden vector of the LSTM unit at the previous moment; W xi and W hi represents different weight matrices; σ represents the activation function; b i represents the bias vector of the input gate;
[0123] The calculation formula (11) of the forget gate is as follows:
[0124] f t =σ(Wxf x t +W hf h t-1 +b f ) (11)
[0125] Among them, f t Represents the state vector of the forget gate; W xf and W hf represents different weight matrices; b f Represents the bias vector of the forget gate;
[0126] The calculation formula (12) of the output gate is as follows:
[0127] o t =σ(W xo x t +W ho h t-1 +b o ) (12)
[0128] Among them, t Represents the state vector of the output gate; W xo and W ho represents different weight matrices; b o Represents the bias vector of the output gate.
[0129] In a specific embodiment, the time moving window length in the graph attention layer is set to a first length, and the prediction length in the graph attention layer is set to a second length; the first length is set to be an integer multiple of the second length, where the integer is greater than or equal to 2. Specifically, the historical time step of the prediction model for predicting the degradation trend is set to 5, and the predicted future time step is set to 1.
[0130] LSTM is used to process and model sequence data and can be effectively applied to the learning of long-term dependent information. The core component of the long short-term memory network is the LSTM unit, in which the input gate, forget gate and output gate are used to control the flow of information, allowing the network to selectively remember or ignore the input information. The input gate determines the extent of new input information required to update the unit state, and the forget gate determines which information in the unit state needs to be forgotten, so that the model can preserve important information in the sequence data and adapt to changes between time steps.
[0131] In a specific embodiment, the weight of the decay prediction model is adjusted by using the Adam algorithm, which specifically includes obtaining the model parameters of the decay prediction model at a preset number of iterations, and calculating the gradient of the objective function with respect to the model parameters at the preset number of iterations. The calculation formula (13) is as follows:
[0132]
[0133] Among them, θ t represents the model parameters at the tth iteration; g t Indicates the objective function with respect to θ at the tth iteration t The gradient of
[0134] Calculate and update the first-order moment estimate, and the calculation formula (14) is as follows:
[0135] m t =β1·m t-1 +(1-β1)·g t (14)
[0136] Among them, m t represents the first-order moment estimate of the gradient at the tth iteration; β1 represents the decay rate of the first-order moment estimate; g t Indicates the objective function with respect to θ at the tth iteration t The gradient of m t-1 Represents the first-order moment estimate of the gradient at the t-1th iteration;
[0137] Calculate and update the second-order moment estimate, and the calculation formula (15) is as follows:
[0138] v t =β2·v t-1 +(1-β2)·g t (15)
[0139] Among them, v t represents the second-order moment estimate of the gradient at the tth iteration; β2 represents the decay rate of the second-order moment estimate; g t Indicates the objective function with respect to θ at the tth iteration t The gradient of v t-1 represents the second-order moment estimate of the gradient at the t-1th iteration;
[0140] Calculate the first-order moment deviation correction and the second-order moment deviation correction, and the calculation formulas (16) and (17) are as follows:
[0141]
[0142] in, represents the first-order moment deviation correction at the tth iteration; m t represents the first-order moment estimate of the gradient at the tth iteration; represents the decay rate of the first-order moment estimate at the t-th iteration; represents the second-order moment deviation correction at the tth iteration; v t represents the second-order moment estimate of the gradient at the tth iteration; represents the decay rate of the second-order moment estimate at the tth iteration;
[0143] The model parameters at the t-th iteration are updated by combining the first-order moment deviation correction and the second-order moment deviation correction, and the calculation formula (18) is as follows:
[0144]
[0145] Among them, θ t represents the model parameters at the tth iteration; θ t-1 represents the model parameters at the t-1th iteration; α represents the learning rate; represents the first-order moment deviation correction at the tth iteration; represents the second-order moment deviation correction at the tth iteration.
[0146] Furthermore, the MSE model is used as the error correction function in the recession prediction model, and its calculation formula (19) is as follows:
[0147]
[0148] Among them, m represents the number of samples, y i Indicates the measured voltage value. Indicates the predicted voltage value.
[0149] Step 104: input the test set data into the trained prediction model to output a prediction result.
[0150] like Figure 5 As shown in the figure, the error convergence curve of the GNN model with the best performance in the training stage is shown. Through training, the model has the best performance when the number of graph convolution layers, the number of LSTM layers, the batch size, and the learning rate are 3, 1, 32, and 0.000272 respectively. The GNN model reaches convergence after 18 iterations of training, and the mean square error of the training set is 4.8957×10 -6 .
[0151] Next, the improved GNN performance prediction model is used to obtain the performance degradation prediction results of proton exchange membrane fuel cells. Figure 6 As shown in the figure, the actual value of the fuel cell output voltage under dynamic load conditions and some results of the output voltage prediction value based on the GNN model are shown. According to the different preset current values corresponding to the output voltage, the prediction results of all current test cycles are decomposed into eight sub-graphs. It can be concluded from the line graph that the GNN model can accurately fit the fuel cell output voltage under dynamic load. Finally, the graph convolution layer and graph attention layer of the GNN model are used to explain the performance degradation mechanism of the proton exchange membrane fuel cell.
[0152] The graph convolution layer of the GNN model can learn the spatial correlation between the fuel cell output voltage and all other variables. The overall structure of the graph is as follows: Figure 7 As shown, Figure 7 The voltage node of the fuel cell in (a) (node 20) is connected to the nodes of all parameters in the figure, and these connections include direct connections and indirect connections. This shows that the voltage degradation of the fuel cell is a complex process involving multiple components and factors. Each operating parameter directly or indirectly affects the voltage degradation of the fuel cell. Figure 7 (b) Highlights the parameter nodes directly connected to the fuel cell voltage node (node 20), which are time, power, cathode outlet pressure, anode plate temperature, anode inlet temperature, cathode inlet temperature, and cathode outlet temperature. This shows that these variables are most relevant to the voltage decay of the fuel cell.
[0153] The graph attention layer of the GNN model is an interpretable component used to learn the relevance of temporal features. The time moving window length used in this patent is 5 and the prediction step is 1. This means that when predicting each future time point, the data of the past 5 time points need to be used as model input. Using the attention weights extracted from the model, we can understand the degree of attention of each future predicted time point to different time points in the moving window, thereby explaining the prediction process of the model.
[0154] like Figure 8 As shown, the average weight distribution of the extracted graph attention layer is shown, where the horizontal axis represents the time index of the predicted target, and the vertical axis represents the index of the moving window corresponding to the predicted target, representing the order of past time points. It can be found that at prediction time 0, the weight of time -1 in the moving window is higher, which indicates that the model pays more attention to short-term time information. As the time index of the predicted target increases, it is observed that the attention weight of prediction time -5 begins to increase. This shows that the GNN model has the ability to extract features of short-term and long-term time information, thereby improving the accuracy of the prediction. In general, the results show that the GNN model can learn short-term and long-term time information, resulting in highly accurate prediction results.
[0155] This embodiment realizes the high-precision performance degradation prediction of the fuel cell dynamic operating conditions using the GNN proton exchange membrane fuel cell performance degradation prediction model. At the same time, in response to the black box problem faced by commonly used degradation prediction models, the graph neural network used in this application improves the prediction accuracy while making an explanatory analysis of the prediction process, thereby improving the credibility of the model.
[0156] Embodiment 2
[0157] Corresponding to the above embodiments, the present application provides a fuel cell performance degradation prediction system, such as Fig. 9 As shown, for implementing the above-mentioned fuel cell performance degradation prediction method, the system includes:
[0158] A preprocessing unit, used for acquiring a battery durability data set, and scaling the data in the data set using a standard score to obtain preprocessed data;
[0159] A division unit, used for dividing the preprocessed data into training set data and test set data;
[0160] A model building unit, used to build a recession prediction model based on a graph neural network, optimize the hyperparameters of the recession prediction model using a random search algorithm, and train the recession prediction model in combination with the training set data to obtain a trained prediction model;
[0161] The model prediction unit is used to input the test set data into the trained prediction model to output a prediction result.
[0162] In a specific embodiment, the preprocessing unit is also used to perform data cleaning on the data in the data set to obtain abnormal data values in the cleaned data set; set a preset threshold to replace the abnormal data values to obtain a normal data set; and use the standard score to scale the data in the normal data set to preprocessed data with a preset mean and a preset standard deviation.
[0163] In a specific embodiment, the model construction unit is also used to select the output voltage in the data set as the health indicator of the fuel cell, and set other parameters in the data set as parameters of the decay prediction model; and respectively construct the graph construction layer, graph convolution layer, graph attention layer, LSTM layer and linear layer of the decay prediction model.
[0164] In a specific embodiment, the model construction unit is also used for the calculation formula (1) of the graph construction layer as follows:
[0165] M1=tanh(αE1Θ1)
[0166] M2=tanh(αE2Θ2) (1)
[0167]
[0168] Where E1 and E2 represent randomly initialized node embedding vectors; α represents a hyperparameter used to control the saturation rate of the activation function; Θ1 and Θ2 represent model decay prediction model parameters; M1 and M2 represent adjacency matrices, respectively; A represents the embedding matrix;
[0169] The calculation formula (2) of the graph convolution layer is as follows:
[0170]
[0171] Among them, H (l) represents the feature representation matrix of level l nodes; H(l+1) Represents the feature representation matrix of the l+1 level nodes; represents the adjacency matrix plus the identity matrix I; express degree matrix; i is the row index of the adjacency matrix A; W (l) represents the weight matrix of layer l; σ represents the nonlinear activation function;
[0172] The calculation formula (3) of the graph attention layer is as follows:
[0173]
[0174] Where a represents the learned attention weight vector; W represents the learnable weight matrix; h i and h j Represent the feature vectors of node i and node j respectively; || represents the concatenation operation of vectors; LeakyReLU represents the introduction of nonlinear activation function, and Softmax represents the normalization function that converts the elements of the vector into probability distribution;
[0175] The LSTM layer includes an input gate, a forget gate and an output gate. The calculation formula (4) of the input gate is as follows:
[0176] i t =σ(W xi x t +W hi h t-1 +b i ) (4)
[0177] Among them, i t represents the state vector of the input gate; x t represents the input vector at time t; h t-1 Represents the hidden vector of the LSTM unit at the previous moment; W xi and W hi represents different weight matrices; σ represents the activation function; b i represents the bias vector of the input gate;
[0178] The calculation formula (5) of the forget gate is as follows:
[0179] f t =σ(W xf x t +W hf h t-1 +b f ) (5)
[0180] Among them, f t Represents the state vector of the forget gate; W xf and W hfrepresents different weight matrices; b f Represents the bias vector of the forget gate;
[0181] The calculation formula (6) of the output gate is as follows:
[0182] o t =σ(W xo x t +W ho h t-1 +b o ) (6)
[0183] Among them, t Represents the state vector of the output gate; W xo and W ho represents different weight matrices; b o Represents the bias vector of the output gate.
[0184] In a specific embodiment, the model building unit is also used to set the time moving window length in the graph attention layer to a first length, and set the prediction length in the graph attention layer to a second length; set the first length to be an integer multiple of the second length, wherein the integer is greater than or equal to 2.
[0185] In a specific embodiment, the model building unit is further used to use the Adam algorithm to adjust the weight of the recession prediction model, specifically including:
[0186] The model parameters of the decay prediction model at the preset number of iterations are obtained, and the gradient of the objective function with respect to the model parameters at the preset number of iterations is calculated. The calculation formula (7) is as follows:
[0187]
[0188] Among them, θ t represents the model parameters at the tth iteration; g t Indicates the objective function with respect to θ at the tth iteration t The gradient of
[0189] Calculate and update the first-order moment estimate, and the calculation formula (8) is as follows:
[0190] m t =β1·m t-1 +(1-β1)·g t (8)
[0191] Among them, m t represents the first-order moment estimate of the gradient at the tth iteration; β1 represents the decay rate of the first-order moment estimate; g t Indicates the objective function with respect to θ at the tth iteration t The gradient of m t-1Represents the first-order moment estimate of the gradient at the t-1th iteration;
[0192] Calculate and update the second-order moment estimate, and the calculation formula (9) is as follows:
[0193] v t =β2·v t-1 +(1-β2)·g t (9)
[0194] Among them, v t represents the second-order moment estimate of the gradient at the tth iteration; β2 represents the decay rate of the second-order moment estimate; g t Indicates the objective function with respect to θ at the tth iteration t The gradient of v t-1 represents the second-order moment estimate of the gradient at the t-1th iteration;
[0195] Calculate the first-order moment deviation correction and the second-order moment deviation correction, and the calculation formulas (10) and (11) are as follows:
[0196]
[0197] in, represents the first-order moment deviation correction at the tth iteration; m t represents the first-order moment estimate of the gradient at the tth iteration; represents the decay rate of the first-order moment estimate at the t-th iteration; represents the second-order moment deviation correction at the tth iteration; v t represents the second-order moment estimate of the gradient at the tth iteration; represents the decay rate of the second-order moment estimate at the tth iteration;
[0198] The model parameters at the t-th iteration are updated by combining the first-order moment deviation correction and the second-order moment deviation correction, and the calculation formula (12) is as follows:
[0199]
[0200] Among them, θ t represents the model parameters at the tth iteration; θ t-1 represents the model parameters at the t-1th iteration; α represents the learning rate; represents the first-order moment deviation correction at the tth iteration; represents the second-order moment deviation correction at the tth iteration.
[0201] In a specific embodiment, the model building unit is further used to use the MSE model as the error correction function in the recession prediction model, and its calculation formula (13) is as follows:
[0202]
[0203] Among them, m represents the number of samples, y i Indicates the measured voltage value. Indicates the predicted voltage value.
[0204] Embodiment 3
[0205] A computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0206] Step 201: Acquire a battery durability data set, and use a standard score to scale the data in the data set to obtain preprocessed data;
[0207] Step 202: dividing the preprocessed data into training set data and test set data;
[0208] Step 203: construct a recession prediction model based on a graph neural network, use a random search algorithm to optimize the hyperparameters of the recession prediction model, and train the recession prediction model in combination with the training set data to obtain a trained prediction model;
[0209] Step 204: input the test set data into the trained prediction model and output the prediction result.
[0210] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store a battery durability data set. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a fuel cell performance degradation prediction method is implemented.
[0211] Those skilled in the art will understand that Fig.10 The structure shown is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0212] Embodiment 4
[0213] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0214] Step 301: Acquire a battery durability data set, and use a standard score to scale the data in the data set to obtain preprocessed data;
[0215] Step 302: Divide the preprocessed data into training set data and test set data;
[0216] Step 303: construct a recession prediction model based on a graph neural network, use a random search algorithm to optimize the hyperparameters of the recession prediction model, and train the recession prediction model in combination with the training set data to obtain a trained prediction model;
[0217] Step 304: input the test set data into the trained prediction model and output the prediction result.
[0218] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0219] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present application.
[0220] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for predicting fuel cell performance degradation, characterized in that: The method comprises: Acquire a battery durability data set, and scale the data in the data set using a standard score to obtain preprocessed data; Dividing the preprocessed data into training set data and test set data; Constructing a recession prediction model based on a graph neural network, optimizing hyperparameters of the recession prediction model using a random search algorithm, and training the recession prediction model in combination with the training set data to obtain a trained prediction model; The test set data is input into the trained prediction model, and the prediction result is output.
2. The method for predicting fuel cell performance degradation according to claim 1, characterized in that: The method further comprises: Performing data cleaning on the data set to obtain abnormal data values in the cleaned data set; Setting a preset threshold to replace the abnormal data value to obtain a normal data set; The standard score is used to scale the data in the normal data set to pre-processed data with a preset mean and a preset standard deviation.
3. The method for predicting fuel cell performance degradation according to claim 1 or 2, characterized in that: The construction of a recession prediction model based on a graph neural network specifically includes: Selecting the output voltage in the data set as a health indicator of the fuel cell, and setting other parameters in the data set as parameters of the degradation prediction model; The graph construction layer, graph convolution layer, graph attention layer, LSTM layer and linear layer of the decay prediction model are constructed respectively.
4. The method for predicting fuel cell performance degradation according to claim 3, characterized in that: The method further comprises: The calculation formula (1) of the graph structure layer is as follows: Where E1 and E2 represent randomly initialized node embedding vectors; α represents a hyperparameter used to control the saturation rate of the activation function; Θ1 and Θ2 represent model decay prediction model parameters; M1 and M2 represent adjacency matrices, respectively; A represents the embedding matrix; The calculation formula (2) of the graph convolution layer is as follows: Among them, H (l) represents the feature representation matrix of level l nodes; H (l+1) Represents the feature representation matrix of the l+1 level nodes; represents the adjacency matrix plus the identity matrix I; express degree matrix; i is the row index of the adjacency matrix A; W (l) represents the weight matrix of layer l; σ represents the nonlinear activation function; The calculation formula (3) of the graph attention layer is as follows: α ij =Softmax(LeakyReLU(a T [Wh i ||Wh j ])) (3) Where a represents the learned attention weight vector; W represents the learnable weight matrix; h i and h j Represent the feature vectors of node i and node j respectively; || represents the concatenation operation of vectors; LeakyReLU represents the introduction of nonlinear activation function, and Softmax represents the normalization function that converts the elements of the vector into probability distribution; The LSTM layer includes an input gate, a forget gate and an output gate. The calculation formula (4) of the input gate is as follows: i t =σ(W xi x t +W hi h t-1 +b i ) (4) Among them, i t represents the state vector of the input gate; x t represents the input vector at time t; h t-1 Represents the hidden vector of the LSTM unit at the previous moment; W xi and W hi represents different weight matrices; σ represents the activation function; b i represents the bias vector of the input gate; The calculation formula (5) of the forget gate is as follows: f t =σ(W xf x t +W hf h t-1 +b f ) (5) Among them, f t Represents the state vector of the forget gate; W xf and W hf represents different weight matrices; b f Represents the bias vector of the forget gate; The calculation formula (6) of the output gate is as follows: o t =σ(W xo x t +W ho h t-1 +b o ) (6) Among them, t Represents the state vector of the output gate; W xo and W ho represents different weight matrices; b o Represents the bias vector of the output gate.
5. The method for predicting fuel cell performance degradation according to claim 4, characterized in that: The method further comprises: Setting the time moving window length in the graph attention layer to a first length, and setting the prediction length in the graph attention layer to a second length; The first length is set to be an integer multiple of the second length, where the integer is greater than or equal to 2.
6. The method for predicting fuel cell performance degradation according to claim 4, characterized in that: The method further includes: using the Adam algorithm to adjust the weight of the recession prediction model, specifically including: The model parameters of the decay prediction model at the preset number of iterations are obtained, and the gradient of the objective function with respect to the model parameters at the preset number of iterations is calculated. The calculation formula (7) is as follows: Among them, θ t represents the model parameters at the tth iteration; g t Indicates the objective function with respect to θ at the tth iteration t The gradient of Calculate and update the first-order moment estimate, and the calculation formula (8) is as follows: m t =β1·m t-1 +(1-β1)·g t (8) Among them, m t represents the first-order moment estimate of the gradient at the tth iteration; β1 represents the decay rate of the first-order moment estimate; g t Indicates the objective function with respect to θ at the tth iteration t The gradient of m t-1 Represents the first-order moment estimate of the gradient at the t-1th iteration; Calculate and update the second-order moment estimate, and the calculation formula (9) is as follows: v t =β2·v t-1 +(1-β2)·g t (9) Among them, v t represents the second-order moment estimate of the gradient at the tth iteration; β2 represents the decay rate of the second-order moment estimate; g t Indicates the objective function with respect to θ at the tth iteration t The gradient of v t-1 represents the second-order moment estimate of the gradient at the t-1th iteration; Calculate the first-order moment deviation correction and the second-order moment deviation correction, and the calculation formulas (10) and (11) are as follows: in, represents the first-order moment deviation correction at the tth iteration; m t represents the first-order moment estimate of the gradient at the tth iteration; represents the decay rate of the first-order moment estimate at the t-th iteration; represents the second-order moment deviation correction at the tth iteration; v t represents the second-order moment estimate of the gradient at the tth iteration; represents the decay rate of the second-order moment estimate at the tth iteration; The model parameters at the t-th iteration are updated by combining the first-order moment deviation correction and the second-order moment deviation correction, and the calculation formula (12) is as follows: Among them, θ t represents the model parameters at the tth iteration; θ t-1 represents the model parameters at the t-1th iteration; α represents the learning rate; represents the first-order moment deviation correction at the tth iteration; represents the second-order moment deviation correction at the tth iteration.
7. The method for predicting fuel cell performance degradation according to claim 5, characterized in that: The method further comprises: The MSE model is used as the error correction function in the recession prediction model, and its calculation formula (13) is as follows: Among them, m represents the number of samples, y i Indicates the measured voltage value. Indicates the predicted voltage value.
8. A fuel cell performance degradation prediction system, used to implement the fuel cell performance degradation prediction method according to any one of claims 1 to 7, characterized in that: The system comprises: A preprocessing unit, used for acquiring a battery durability data set, and scaling the data in the data set using a standard score to obtain preprocessed data; A division unit, used for dividing the preprocessed data into training set data and test set data; A model building unit, used to build a recession prediction model based on a graph neural network, optimize the hyperparameters of the recession prediction model using a random search algorithm, and train the recession prediction model in combination with the training set data to obtain a trained prediction model; The model prediction unit is used to input the test set data into the trained prediction model and output the prediction result.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Network performance prediction method and device, equipment and medium
CN120151221A
Method, device and equipment for adjusting charging state of battery pack and storage medium
CN120462221A
Method, apparatus, device and storage medium for adjusting battery pack charging state
CN120462221B
Fuel cell life prediction method and system based on multi-source feature fusion
CN122246183A