Method for predicting remaining service life of proton exchange membrane fuel cell based on improved HHO

Through the improved HHO algorithm model, combined with the HHO algorithm model optimized by Logistics chaotic mapping and arctangent decreasing strategy, the weight and bias terms of the LSTM model are optimized, and the quadratic prediction is used for self-Attention, which solves the problems of low accuracy and slow convergence speed in the PEMFC residual service life prediction, achieving a more efficient prediction effect.

CN119917811APending Publication Date: 2025-05-02HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510196558.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

In the remaining service life prediction of proton exchange membrane fuel cell (PEMFC), it is difficult to take into account local timing characteristics and global degradation trends, and the prediction accuracy is low under noise interference and the convergence speed is slow.

Method used

The residual service life prediction method of proton exchange membrane fuel cell based on the improved HHO algorithm model is adopted. By constructing a HHO algorithm model optimized based on Logistics chaotic mapping and arctangent decreasing strategy, the weight and bias terms of the LSTM model are optimized, and the quadratic prediction is used to perform quadratic prediction using Self-Attention.

Benefits of technology

It improves the accuracy and efficiency of PEMFC residual service life prediction, can handle noise more effectively, and improve the convergence speed and prediction accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917811A_ABST
    Figure CN119917811A_ABST
Patent Text Reader

Abstract

The invention discloses a method for predicting the remaining service life of a proton exchange membrane fuel cell based on an improved HHO, and the method comprises the following steps: 1), building a PEMFC original data set, and carrying out the data denoising processing through employing a wavelet adaptive threshold (WAD); 2) performing smoothing processing on the data by using an exponential smoothing method (ES) and performing secondary denoising; 3) constructing a Harris eagle algorithm (HHO) model based on improved Logistic chaotic mapping and arc tangent decline strategy optimization so as to improve the optimization performance; 4) using the improved HHO to optimize the weight and bias terms of the long short-term memory network (LSTM), and using a mean square error (MSE) to find out the optimal weight and bias parameters for prediction; and 5) carrying out secondary prediction on the prediction result by using a self-attention mechanism (Self-Attention) to obtain a final prediction result. The feasibility and superiority of the method are proved, the iteration speed of the model can be greatly improved, the training time is shortened, and the accuracy is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of remaining service life prediction of proton exchange membrane fuel cells, and in particular to a remaining service life prediction method of proton exchange membrane fuel cells based on improved HHO. Background Art

[0002] With the growing global demand for clean energy, proton exchange membrane fuel cells (PEMFCs), as an efficient and environmentally friendly energy conversion device, have shown great application potential in many fields such as electric vehicles and distributed power generation. However, in the actual operation process, the performance of PEMFCs will gradually decline due to the influence of various complex factors, such as catalyst aging, membrane degradation, and water and heat management imbalance during the electrochemical reaction process. These performance degradation problems will not only reduce the power generation efficiency of fuel cells, but may also cause system failures, affecting the normal operation and service life of the equipment. Accurately predicting the remaining useful life (RUL) of PEMFCs is crucial to optimizing equipment maintenance strategies, ensuring the stability of energy supply, and reducing operating costs. Traditional prediction methods based on physical models often require precise material properties, complex electrochemical parameters, and in-depth understanding of many physical processes, and are complex in calculation and have poor adaptability.

[0003] In the prior art, it is common to use machine learning models to deal with complex PEMFC life prediction. However, a single and unoptimized prediction model is difficult to take into account both local timing characteristics and global degradation trends in this field, especially when the accuracy is significantly reduced under noise interference, and it is easy to fall into local optimality. Therefore, in the field of proton exchange membrane fuel cell remaining service life prediction, it is necessary to design and modify targeted prediction models and optimization algorithms to improve the problems of slow convergence speed and insufficient accuracy of existing models. Summary of the invention

[0004] Purpose of the invention: To solve the problems mentioned in the background technology, the present invention discloses a method for predicting the remaining useful life of a proton exchange membrane fuel cell based on an improved HHO, constructs an HHO algorithm model based on an improved Logistics chaos mapping and an inverse tangent decreasing strategy optimization to improve the optimization performance, further improves the prediction model's accuracy and efficiency in predicting the RUL of PEMFC, and provides data support for subsequent care and maintenance of vehicles or equipment.

[0005] Technical solution:

[0006] The present invention discloses a method for predicting the remaining service life of a proton exchange membrane fuel cell based on an improved HHO, the method comprising the following steps:

[0007] S1 established the original PEMFC data set and used WAD to perform data denoising;

[0008] S2 uses ES to smooth the data for secondary denoising;

[0009] S3 constructs a HHO algorithm model based on the improved Logistics chaotic map with random perturbations and the inverse tangent decreasing strategy optimization;

[0010] S4 uses improved HHO to optimize the weights and bias terms of LSTM, and uses MSE to find the optimal weight and bias parameters;

[0011] S5 trains the improved HHO-LSTM model and predicts the remaining service life of proton exchange membrane fuel cells;

[0012] S6 performs secondary prediction on the prediction results through Self-Attention to obtain the final prediction results.

[0013] Furthermore, the WAD denoising method in S1 is to decompose and reconstruct the PEMFC raw data, which is specifically implemented as follows:

[0014]

[0015] Where: cA j,k is the approximation coefficient (representing the low-frequency part of the signal), is the scaling function The conjugate function of cD j,k is the detail coefficient (representing the high-frequency part of the signal), is the wavelet function ψ j,k The conjugate function of (t), k is the discrete time index, and the approximate coefficient cA of the Jth layer can be obtained through the above decomposition. J,k and the detail coefficient cD of each layer j,k (j=1,2,K,J);

[0016] For the detail coefficient of each layer, the soft threshold strategy is used to determine the threshold in combination with the estimated value of the noise standard deviation σ. The calculation formula of the standard deviation σ is as follows:

[0017]

[0018] Where: the numerator represents the median of the absolute value of the detail coefficient of each layer;

[0019] The threshold of each layer is determined according to the soft threshold rule, and its calculation formula is as follows:

[0020]

[0021] Where: n is the length of the original power signal;

[0022] For each layer detail coefficient cD j,k Soft threshold processing is used, and the calculation formula is as follows:

[0023]

[0024] Where: sgn(·) is the sign function; k represents the coefficient index;

[0025] The approximate coefficients and detail coefficients of each layer processed by soft threshold are restored to the denoised signal. The calculation formula is as follows:

[0026]

[0027] Where: is the power data obtained after denoising.

[0028] Furthermore, S2 uses ES to smooth the data for secondary denoising. ES predicts the future of phenomena by calculating exponential smoothing values ​​and combining them with a certain time series prediction model. The formula is as follows:

[0029]

[0030] Where: s(t) is the smoothed value at time t, s(t-1) is the smoothed value at time t-1, and ζ is a smoothing constant in [0,1].

[0031] Furthermore, the HHO algorithm model constructed in S3 based on the Logistics chaotic mapping optimization improved by random perturbation is specifically implemented as follows:

[0032] The population is initialized using the Logistics chaotic map that introduces random variables. The formula is as follows:

[0033] s n+1 =(μ+φ·r)s n (1-s n )

[0034] Where: s n is the chaotic sequence value after the nth iteration, s n ∈(0,1), μ is the control parameter, φ is a constant, which is 0.5, and r is a random number in [-1,1], which generates the chaotic sequence {s n}(n=1,2,K,S), there exists a matrix X=[x i,j ] N×M , maps the chaotic sequence to a matrix so that the kth value s in the chaotic sequence k With the matrix element x i,j Correspondingly, the matrix elements are updated through the mapping formula, and the calculation formula is as follows:

[0035] x i,j =a+(ba)s k

[0036] Where: the value range of the matrix elements is [a, b], and the matrix X is the initial population of HHO.

[0037] Furthermore, the HHO algorithm model optimized by the inverse tangent decreasing strategy is specifically implemented as follows:

[0038] In the exploration and exploitation conversion phase of the HHO algorithm, the physical energy of the prey gradually decreases during the escape process, so the prey's escape energy is used to choose the exploration or exploitation method for hunting. The formula of escape energy is as follows:

[0039]

[0040] Where: E0 is the initial escape energy of the prey, which is a random number in [-1,1]; t is the current iteration number; T is the maximum iteration number of the population;

[0041] Improve the escape capability and add the inverse tangent decreasing strategy:

[0042]

[0043] When |E|≥1, it enters the exploration phase, otherwise it enters the development phase.

[0044] Furthermore, S4 uses the improved HHO to optimize the weights and bias items of LSTM, and uses the mean square error to find the optimal weight and bias parameters for prediction. The specific implementation is as follows:

[0045] LSTM introduces memory units, which dynamically regulate information retention or forgetting through a gating mechanism, and receives the implicit state h of the previous moment. t-1 and the current input x t Splice and use the sigmoid activation function to get the vector f t , depending on its value, determines the cell state C t-1 Keep or forget, if f t If an element in is close to 1, it means that most of the information in the corresponding cell state will be retained. The formula is as follows:

[0046] f t =σ(W f ·[h t-1 ,x t ]+b f )

[0047] Where: W f is the weight matrix of the forget gate; h t-1 is the implicit state at time t-1; xt is the current input; b f is the bias term; σ is the sigmoid function;

[0048] Input gate operation: The first part determines the update information through the sigmoid function;

[0049] i t =σ(W i ·[h t-1 ,x t ]+b i )

[0050] Where: W i is the weight matrix of the input gate; b i is the bias term;

[0051] The second part creates a new candidate value vector through the tanh function It accepts h t-1 and x t Then, after a fully connected layer and tanh function, the updated cell state c is obtained. t

[0052] Output gate operation: receiving h t-1 and x t After a fully connected layer and a sigmoid function, a value between 0 and 1 is input to determine which parts of the cell state will be output, and the updated cell state c t The final hidden state h is obtained by multiplying the output of the output gate with the tanh function. t As the current output and also as part of the input at the next time, in order to obtain the optimal weight and bias, in the initialization stage of the HHO population, the mean square error is used as the fitness function value. When the minimum fitness function is obtained, the weight and bias at this time are the optimal solution, and its mathematical expression is as follows:

[0053]

[0054] Where: n is the total number of samples; s(t) is the true value of the original sample.

[0055] Furthermore, S5 uses Self-Attention to perform secondary prediction on the prediction results to obtain the final prediction results. The specific implementation is as follows:

[0056] For the input sequence S = [s1, s2, K, s n ], where s i Represents the i-th element in the sequence, and replaces s i Multiply with different weight vectors to get query vector, key vector, value vector, for each element s in the sequence i, calculate its attention score z with other elements i,j , by normalizing the attention score, we get the attention distribution z′ i,j Finally, according to z′ i,j The value vector v j Perform weighted summation to get the output y of the self-attention mechanism i , the output vector combines the information of each element in the input sequence and combines them with s i The attention weights are recombined and represented. For the entire input sequence S, the output of the self-attention mechanism is Y = [y1, y2, .., y n ].

[0057] Beneficial effects:

[0058] 1. The present invention uses WAD+ES to pre-process the original data for denoising. The composite denoising method has better adaptability to the processing effect of non-stationary signals than the traditional single modal decomposition. In this process, the coefficients of each frequency band that have been processed are reorganized to obtain a signal that can effectively suppress noise and is close to the original signal. This method can not only effectively maintain the basic characteristics of the original signal, but also effectively improve the analysis performance of the signal, providing a more reliable data basis for the subsequent feature extraction of the signal, and avoiding the accumulation of prediction errors.

[0059] 2. The present invention improves the Logistics chaotic map by adding random perturbations, thereby overcoming the problem that the sequence values ​​generated by calculation are no longer ideal random sequences, improving HHO and increasing its optimization speed for the weights and bias items of the LSTM model, further saving the model's prediction time for battery life.

[0060] 3. The present invention adds an inverse tangent reduction strategy to the HHO optimization algorithm. Compared with the conventional SSA algorithm and the original HHO algorithm, the HHO training efficiency of the application strategy is improved. Combined with Self-Attention for secondary prediction, the convergence speed is improved while ensuring the accuracy of the battery life prediction data. The efficiency is further improved while ensuring accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 This is a specific flow chart of the prediction model of the present invention;

[0062] Figure 2 Improved Harris Eagle algorithm flow chart for the present invention;

[0063] Figure 3 This is a graph of the training results for the comparison model. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0065] like Figure 1-Figure 2 As shown, the present invention discloses a method for predicting the remaining service life of a proton exchange membrane fuel cell based on improved HHO.

[0066] The steps include:

[0067] Step 1: Establish the original PEMFC data set and use WAD to perform data denoising;

[0068] Step 2: Use ES to smooth the data for secondary denoising;

[0069] Step 3: Construct an HHO algorithm model based on improved Logistics chaos mapping and inverse tangent reduction strategy optimization to improve optimization performance;

[0070] Step 4: Use the improved HHO to optimize the weights and bias terms of LSTM, and use the mean square error to find the optimal weight and bias parameters for prediction;

[0071] Step 5: Use Self-Attention to perform secondary prediction on the prediction results to obtain the final prediction results.

[0072] The WAD denoising method used in step 1 is to decompose and reconstruct the PEMFC raw data, which is specifically implemented as follows:

[0073] (11) Using a specific wavelet basis function, the original signal y(t) is subjected to multi-layer wavelet decomposition. Assuming the number of decomposition layers is j (j = 1, 2, K, J), a series of wavelet coefficients can be obtained through wavelet decomposition, as shown in the following formula:

[0074]

[0075] Where: cA j,k is the approximation coefficient (representing the low-frequency part of the signal), is the scaling function The conjugate function of cD j,k is the detail coefficient (representing the high-frequency part of the signal), is the wavelet function ψ j,k The conjugate function of (t), k is the discrete time index. After the above decomposition, the approximate coefficient cA of the Jth layer can be obtained: J,k and the detail coefficient cD of each layer j,k (j=1,2,K,J).

[0076] (12) For each layer of detail coefficients, a soft threshold strategy is used to determine the threshold in combination with the estimated value of the noise standard deviation σ. The calculation formula for the standard deviation σ is as follows:

[0077]

[0078] Where: The numerator represents the median of the absolute value of the detail coefficient of each layer.

[0079] The threshold of each layer is determined according to the soft threshold rule, and its calculation formula is as follows:

[0080]

[0081] Where: n is the length of the original power signal.

[0082] (13) For each layer’s detail coefficient cD j,k Soft threshold processing is used, and the calculation formula is as follows:

[0083]

[0084] Where: sgn(·) is the sign function; k represents the coefficient index.

[0085] (14) The approximate coefficients and detail coefficients of each layer after soft threshold processing are restored to the denoised signal. The calculation formula is as follows:

[0086]

[0087] Where: is the power data obtained after denoising.

[0088] In this process, the coefficients of each frequency band that have been processed are reorganized to obtain a signal that can effectively suppress noise and is close to the original signal. This method can not only effectively maintain the basic characteristics of the original signal, but also effectively improve the analysis performance of the signal, providing a more reliable data basis for subsequent signal feature extraction.

[0089] In step 2, ES is used to smooth the data for secondary denoising. ES predicts the future of the phenomenon by calculating the exponential smoothing value and combining it with a certain time series prediction model. The formula is as follows:

[0090]

[0091] Where: s(t) is the smoothing value at time t, s(t-1) is the smoothing value at time t-1, ζ is a smoothing constant in [0,1]. In this embodiment, α is 0.3.

[0092] Step 3 constructs an HHO algorithm model based on improved Logistics chaos mapping and inverse tangent reduction strategy optimization to improve the optimization performance. The specific implementation is as follows:

[0093] (31) The population is initialized using the Logistic chaotic map that introduces random variables. The formula is as follows:

[0094] s n+1 =(μ+φ·r)s n (1-s n ) (7)

[0095] Where: s n is the chaotic sequence value after the nth iteration, s n ∈(0,1), μ is the control parameter, usually in (3.5699456,4]; φ is a constant, 0.5, r is a random number in [-1,1]. This generates the chaotic sequence {s n}(n=1,2,K,S), there exists a matrix X=[x i,j ] N×M , maps the chaotic sequence to a matrix so that the kth value s in the chaotic sequence k With the matrix element x i,j Correspondingly, the matrix elements are updated through the mapping formula, and the calculation formula is as follows:

[0096] x i,j =a+(ba)s k (8)

[0097] Where: The value range of matrix elements is [a,b].

[0098] (32) The above matrix X is the initial population of HHO. For HHO, it is a heuristic optimization algorithm that imitates the predation characteristics of Harris Hawk to solve complex multi-dimensional problems. In HHO, Harris Hawk is a candidate solution, and the prey approaches the optimal solution with iteration. The HHO algorithm includes three stages: exploration stage, exploration and development conversion stage, and development stage. The specific implementation is as follows:

[0099] (321) Exploration Phase

[0100] Harris hawk populations are randomly distributed in different areas, using their sharp eyes to track and find targets, and adopting an equal probability global search strategy, that is, when P < 0.5, each Harris hawk will move with the location of its companions and prey, and when P ≥ 0.5, it will randomly land on a tree in the area, and its expression is as follows:

[0101]

[0102] Where: x(t) and x(t+1) are the positions of the individual in the current and next iterations respectively; x rand (t) is the position of a randomly selected Harris hawk individual in the t-generation population; x rabbit is the prey position (i.e. the optimal solution of iteration); x m is the average location of the current Harris Hawk population, N is the population size; x i (t) is the position vector of the ith individual at the tth iteration; ub and lb are the upper and lower limits of the search range respectively; r1, r2, r3, r4 and P are all random numbers in (0,1).

[0103] (322) Exploration and Development Transition Phase

[0104] The HHO algorithm divides Harris Hawk's hunting into two stages: exploration and exploitation. The prey's physical energy gradually decreases during the escape process, so the prey's escape energy is used to choose the exploration or exploitation method for hunting. The escape energy formula is as follows:

[0105]

[0106] Where: E0 is the initial escape energy of the prey, which is a random number in [-1,1]; t is the current iteration number; T is the maximum iteration number of the population.

[0107] During the experiment, it was found that the training time of HHO was too long and the number of convergence iterations was large. In order to further enhance the global search capability, improve the convergence accuracy and convergence speed, the escape ability was improved and the inverse tangent decreasing strategy was added. The formula is as follows:

[0108]

[0109] When |E|≥1, it enters the exploration phase, otherwise it enters the development phase.

[0110] (323) Development phase

[0111] Once the target is found, the Harris Hawk will launch an attack, it will surround the prey and wait for the opportunity to strike. However, in reality, the hunting process is very complicated. For example, a surrounded prey may escape the encirclement, and the Harris Hawk can adapt to the actions of the prey and make corresponding changes. For this reason, HHO adopts four methods of "soft encirclement-hard encirclement-gradual rapid dive soft encirclement-gradual rapid dive hard encirclement" to simulate the hunting behavior of the Harris Hawk.

[0112] (3231) Soft Encirclement Strategy

[0113] When 0.5≤|E|<1, the escape probability SP≥0.5, the prey still has the energy to escape and tries to escape the encirclement by random jumps. At this time, the Harris Hawk uses soft encirclement to prey to exhaust the prey, so that the Harris Hawk can suddenly attack. The update formula is:

[0114] x(t+1)=Δu-E|jx rabbit (t)-x(t)| (12)

[0115] Where: Δu is the difference between the prey position and the current individual position; j is the prey jumping distance, j=2(1-r5), r5∈(0,1).

[0116] (3232)Hard Encirclement Strategy

[0117] When |E|<0.5, SP≥0.5, the prey has no energy to escape and no chance to escape. Harris's hawk uses hard encirclement to catch the prey for the final surprise attack. The update formula is:

[0118] x(t+1)=x rabbit (t)-E|Δu| (13)

[0119] (3233) Progressive rapid dive soft surround

[0120] When 0.5≤|E|<1, SP<0.5, the prey has a chance to escape from the encirclement and has enough energy to escape the pursuit of the Harris Hawk, but the Harris Hawk will use a gradual rapid dive soft encirclement around the prey, and gradually correct its position and direction according to the deceptive behavior of the prey, so as to choose the best position to capture the prey, which is implemented through the following two strategies. When the first strategy is invalid, the second strategy is executed, and its update formula is:

[0121]

[0122] Where: f(·) is the fitness function; η is a d-dimensional random vector with elements between (0,1); LF(D) is the Levy flight strategy, and its formula is:

[0123]

[0124] Where: u, ν are random numbers uniformly distributed in (0,1); β = 1.5,

[0125] (3234) Progressive Fast Dive Hard Encirclement

[0126] When |E|<0.5, SP<0.5, the prey is exhausted but still has a chance to escape. Harris's hawks surround the prey through gradual and rapid dives. In this case, the Harris's hawks try to shorten the distance between them and the average position of the target prey. The update formula is:

[0127]

[0128] Step 4 uses the improved HHO to optimize the weights and bias terms of LSTM, and uses the mean square error to find the optimal weight and bias parameters for prediction. The specific implementation is as follows:

[0129] (41) LSTM introduces memory units, which enables the model to store important information for a long time and dynamically adjust which information should be retained or forgotten through the gating mechanism. The implementation of LSTM is as follows:

[0130] (411) The function of the forget gate is to decide which information to discard from the cell state. It receives the hidden state h at the previous moment. t-1 and the current input x t , then concatenate them and use the sigmoid activation function to get a vector f between 0 and 1 t , each element of which is related to the cell state C t-1 Each element of corresponds to, if f t If an element in is close to 0, it means that most of the information in the corresponding cell state will be forgotten. t If an element in is close to 1, it means that most of the information in the corresponding cell state will be retained. Its mathematical expression is as follows:

[0131] f t =σ(W f ·[h t-1 ,x t ]+b f )(17)

[0132] Where: W f is the weight matrix of the forget gate; h t-1 is the implicit state at time t-1; x t is the current input; b f is the bias term; σ is the sigmoid function;

[0133] (412) The function of the input gate is to update the cell state and decide which new information to add to the cell state. It consists of two parts. The first part is to decide which information to update through the sigmoid function. Its mathematical expression is as follows:

[0134]

[0135] Where: W i is the weight matrix of the input gate; b i is the bias term.

[0136] The second part is to create a new candidate value vector through the tanh function It accepts h t-1 and x t Then it passes through a fully connected layer and tanh function. Its mathematical expression is as follows:

[0137]

[0138] Where: W c is the candidate weight matrix; b c is the bias term.

[0139] Updated cell state c t Its mathematical expression is as follows:

[0140]

[0141] (413) The function of the output gate is to control the final output. First, it receives h t-1 and x t After a fully connected layer and a sigmoid function, a value between 0 and 1 is input to determine which parts of the cell state will be output. The mathematical expression is as follows:

[0142] o t =σ(W o ·[h t-1 ,x t ]+b0) (21)

[0143] Where: W o is the weight matrix of the output gate; b o is the bias term.

[0144] Finally, the updated cell state c t The final hidden state h is obtained by multiplying the output of the output gate with the tanh function. t As the current output and also as part of the input at the next time, its mathematical expression is as follows:

[0145] h t =o t*tanh(c t ) (twenty two)

[0146] Through the operation of these gates, LSTM can effectively remember key information and flexibly update and output information when processing sequence data.

[0147] In order to obtain the optimal weight and bias, in the initialization stage of the HHO population, the mean square error is used as the fitness function value. When the minimum fitness function is obtained, the weight and bias at this time are the optimal solution, and its mathematical expression is as follows:

[0148]

[0149] Where: n is the total number of samples; s(t) is the true value of the original sample.

[0150] Step 5 uses Self-Attention to perform secondary prediction on the prediction results to obtain the final prediction results. The specific implementation is as follows:

[0151] (51) For the input sequence S = [s1, s2, K, s n ], where s i Represents the i-th element in the sequence. i Multiplying with different weight vectors will yield query vector (Query), key vector (Key), and value vector (Value). The mathematical expression is as follows:

[0152]

[0153] Where: q i is the query vector; k i is the key vector; v i is a value vector; W q , W k , W v is the weight matrix.

[0154] (52) For each element s in the sequence i , calculate its attention score z with other elements i,j , which aims to measure the overall attention of the element, and its mathematical expression is as follows:

[0155] z i,j =q i ·k j (25)

[0156] (53) By normalizing the attention score, we get the attention distribution z′ i,j , the formula is as follows:

[0157]

[0158] (54) Finally, according to z′ i,j The value vector v j Perform weighted summation to get the output y of the self-attention mechanism i , its mathematical expression is as follows:

[0159]

[0160] This output vector combines the information of each element in the input sequence and calculates the value of the vector according to their relationship with s. i The attention weights are recombined and represented. For the entire input sequence S, the output of the self-attention mechanism is Y = [y1, y2, ..., y n ].

[0161] In order to better reflect the prediction results of the model, the following cases will significantly demonstrate the feasibility of the experiment.

[0162] The data set used in this experiment comes from the public data set of the French FCLAB Research Federation. The voltage and current characteristics in the data set are selected, and the current-voltage relationship is integrated through P=UI to obtain the impact of power on the remaining service life of PEMFC, and then the data prediction is performed. Because the original data set is too large, this experiment modified the data set and conducted the experiment every 1000 data samples.

[0163] By comparing with the existing prediction models, it is found that the test set training accuracy of HHO-LSTM-Self-Attention is the highest compared with other methods. The training results are shown in Table 1. The training results of each model are shown in Figure 1. Figure 3 Shown

[0164] Table 1

[0165]

[0166]

[0167] The above description of the embodiments enables professionals and technicians in the field to implement or use the present invention. Various modifications to the embodiments will be apparent to professionals and technicians. The general principles of the present invention can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention should not be limited to the embodiments shown herein, but should cover the widest range consistent with the principles and novel features disclosed in the present invention.

Claims

1. A method for predicting the remaining service life of a proton exchange membrane fuel cell based on improved HHO, characterized in that , the method comprises the following steps: S1 established the original PEMFC data set and used WAD to perform data denoising; S2 uses ES to smooth the data for secondary denoising; S3 constructs a HHO algorithm model based on the improved Logistics chaotic map with random perturbations and the inverse tangent decreasing strategy optimization; S4 uses improved HHO to optimize the weights and bias terms of LSTM, and uses MSE to find the optimal weight and bias parameters; S5 trains the improved HHO-LSTM model and predicts the remaining service life of proton exchange membrane fuel cells; S6 performs secondary prediction on the prediction results through Self-Attention to obtain the final prediction results.

2. The method for predicting the remaining service life of a proton exchange membrane fuel cell based on improved HHO according to claim 1, characterized in that: The WAD denoising method in S1 is to decompose and reconstruct the PEMFC raw data, which is specifically implemented as follows: Where: cA j,k is the approximation coefficient (representing the low-frequency part of the signal), is the scaling function The conjugate function of cD j,k is the detail coefficient (representing the high-frequency part of the signal), is the wavelet function ψ j,k The conjugate function of (t), k is the discrete time index, and the approximate coefficient cA of the Jth layer can be obtained through the above decomposition. J,k and the detail coefficient cD of each layer j,k (j=1,2,K,J); For the detail coefficient of each layer, the soft threshold strategy is used to determine the threshold in combination with the estimated value of the noise standard deviation σ. The calculation formula of the standard deviation σ is as follows: Where: the numerator represents the median of the absolute value of the detail coefficient of each layer; The threshold of each layer is determined according to the soft threshold rule, and its calculation formula is as follows: Where: n is the length of the original power signal; For each layer detail coefficient cD j,k Soft threshold processing is used, and the calculation formula is as follows: Where: sgn(·) is the sign function; k represents the coefficient index; The approximate coefficients and detail coefficients of each layer processed by soft threshold are restored to the denoised signal. The calculation formula is as follows: Where: is the power data obtained after denoising.

3. The method for predicting the remaining service life of a proton exchange membrane fuel cell based on improved HHO according to claim 2, characterized in that: S2 uses ES to smooth the data for secondary denoising. ES predicts the future of the phenomenon by calculating the exponential smoothing value and combining it with a certain time series prediction model. The formula is as follows: Where: s(t) is the smoothed value at time t, s(t-1) is the smoothed value at time t-1, and ζ is a smoothing constant in [0,1].

4. The method for predicting the remaining service life of a proton exchange membrane fuel cell based on improved HHO according to claim 1 or 3, characterized in that: S3 constructs the HHO algorithm model based on the Logistics chaos map optimization improved by random perturbation, and the specific implementation is as follows: The population is initialized using the Logistics chaotic map that introduces random variables. The formula is as follows: s n+1 =(μ+φ·r)s n (1-s n ) Where: s n is the chaotic sequence value after the nth iteration, s n ∈(0,1), μ is the control parameter, φ is a constant, which is 0.5, and r is a random number in [-1,1], which generates the chaotic sequence {s n }(n=1,2,K,S), there exists a matrix X=[x i,j ] N×M , map the chaotic sequence to the matrix so that the kth value s in the chaotic sequence k With the matrix element x i,j Correspondingly, the matrix elements are updated through the mapping formula, and the calculation formula is as follows: x i,j =a+(b-a)s k Where: the value range of the matrix elements is [a, b], and the matrix X is the initial population of HHO.

5. The method for predicting the remaining service life of a proton exchange membrane fuel cell based on improved HHO according to claim 4, characterized in that: The HHO algorithm model optimized by the inverse tangent decreasing strategy is specifically implemented as follows: In the exploration and exploitation conversion phase of the HHO algorithm, the physical energy of the prey gradually decreases during the escape process, so the prey's escape energy is used to choose the exploration or exploitation method for hunting. The formula of escape energy is as follows: Where: E0 is the initial escape energy of the prey, which is a random number in [-1,1]; t is the current iteration number; T is the maximum iteration number of the population; Improve the escape capability and add the inverse tangent decreasing strategy: When |E|≥1, it enters the exploration phase, otherwise it enters the development phase.

6. The method for predicting the remaining service life of a proton exchange membrane fuel cell based on improved HHO according to claim 4, characterized in that: S4 uses the improved HHO to optimize the weights and bias items of LSTM, and uses the mean square error to find the optimal weight and bias parameters for prediction. The specific implementation is as follows: LSTM introduces memory units, which dynamically regulate information retention or forgetting through a gating mechanism, receiving the implicit state h of the previous moment. t-1 and the current input x t Splice and use the sigmoid activation function to get the vector f t , depending on its value, determines the cell state C t-1 Keep or forget, if f t If an element in is close to 1, it means that most of the information in the corresponding cell state will be retained. The formula is as follows: f t =σ(W f ·[h t-1 ,x t ]+b f ) Where: W f is the weight matrix of the forget gate; h t-1 is the implicit state at time t-1; x t is the current input; b f is the bias term; σ is the sigmoid function; Input gate operation: The first part determines the update information through the sigmoid function; i t =σ(W i ·[h t-1 ,x t ]+b i ) Where: W i is the weight matrix of the input gate; b i is the bias term; The second part creates a new candidate value vector through the tanh function It accepts h t-1 and x t Then, after a fully connected layer and tanh function, the updated cell state c is obtained. t Output gate operation: receiving h t-1 and x t After a fully connected layer and a sigmoid function, a value between 0 and 1 is input to determine which parts of the cell state will be output, and the updated cell state c t The final hidden state h is obtained by multiplying the output of the output gate with the tanh function. t As the current output and also as part of the input at the next time, in order to obtain the optimal weight and bias, in the initialization stage of the HHO population, the mean square error is used as the fitness function value. When the minimum fitness function is obtained, the weight and bias at this time are the optimal solution, and its mathematical expression is as follows: Where: n is the total number of samples; s(t) is the true value of the original sample.

7. The method for predicting the remaining service life of a proton exchange membrane fuel cell based on improved HHO according to claim 1, characterized in that: S5 uses Self-Attention to perform secondary prediction on the prediction results to obtain the final prediction results. The specific implementation is as follows: For the input sequence S = [s1, s2, K, s n ], where s i Represents the i-th element in the sequence, and replaces s i Multiply with different weight vectors to get query vector, key vector, value vector, for each element s in the sequence i , calculate its attention score z with other elements i,j , by normalizing the attention score, we get the attention distribution z′ i,j Finally, according to z′ i,j The value vector v j Perform weighted summation to get the output y of the self-attention mechanism i , the output vector combines the information of each element in the input sequence and combines them with s i The attention weights are recombined and represented. For the entire input sequence S, the output of the self-attention mechanism is Y = [y1, y2, ..., y n ].

Citation Information

Cited By

  • Method, system and device for predicting remaining service life of proton exchange membrane fuel cell

    CN121659772A

  • Millimeter wave sign detection method based on swarm intelligence and improved wavelet threshold

    CN122140238A