Fault prediction and early warning method for proton exchange membrane fuel cell
By building a dual-TF anomaly detection model and a TSMixer time series prediction model, the problem of insufficient real-time fault diagnosis in proton exchange membrane fuel cell systems is solved, real-time fault warning and long-term fault prediction for fuel cells are achieved, and the stability of the system and the accuracy of maintenance decisions are improved.
Patent Information
- Application Number
- CN202510841543.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-10-17
AI Technical Summary
Existing proton exchange membrane fuel cell fault diagnosis methods lack real-time performance and cannot effectively predict future operating conditions, resulting in decreased system performance and shortened lifespan.
A dual-TF anomaly detection model and a TSMixer time series prediction model are constructed, combined with nested sliding windows and deep belief networks to detect the current state and predict future faults in real time, and to perform fault warning and diagnosis through time domain and frequency domain anomaly detectors and deep belief networks.
Real-time early warning and long-term prediction of proton exchange membrane fuel cell failures are achieved, which improves the comprehensiveness, timeliness and reliability of failure prediction, ensures system stability and forward-looking maintenance decisions.
Smart Images

Figure CN120809879A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of fuel cell fault prediction, in particular to a proton exchange membrane fuel cell fault prediction and early warning method. BACKGROUND
[0002] Hydrogen energy, as a clean and efficient secondary energy, can be used as a zero-carbon energy carrier and chemical raw material. Proton exchange membrane fuel cell (PEMFC) is a kind of high-efficiency and clean energy conversion device, which has become one of the core equipment of hydrogen energy utilization due to its high power density, low operating temperature and fast load response, and has shown great development potential in the fields of electric vehicles, aerospace vehicles, ships and power generation.
[0003] However, the large-scale commercial application of PEMFC still faces many technical bottlenecks, among which reliability and durability are one of the most prominent problems. PEMFC system is a multi-physical field coupling nonlinear system, with numerous internal electronic devices and complex structure, complex and variable working environment, and long-term aging performance degradation, which are all key inducements for its failure. Faults will cause the performance of PEMFC system to decline, shorten the service life, and even cause irreversible damage. Therefore, it is necessary to diagnose the fault of PEMFC in time and find out potential hidden dangers in advance. At present, the field of PEMFC fault diagnosis has made many achievements, but there are still limitations of insufficient real-time performance, and it cannot predict the running state of PEMFC in advance. By monitoring the running state of fuel cell in real time and constructing a fault prediction and early warning mechanism, preventive maintenance measures can be taken in time to avoid serious faults and effectively eliminate potential risks. SUMMARY
[0004] In view of the limitations of the prior art and the need for improvement, the present application provides a proton exchange membrane fuel cell fault prediction and early warning method, which aims to predict the running state of the future proton exchange membrane fuel cell in advance, obtain fault warning information in advance and take timely response measures, so as to avoid serious damage to the system due to faults.
[0005] To achieve the above technical purpose, the present application provides a proton exchange membrane fuel cell fault prediction and early warning method, comprising the following steps:
[0006] (1) A dual-TF anomaly detection model is trained using the historical operation data of the proton exchange membrane fuel cell, which is used to detect the current operation state of the cell;
[0007] Before training the model using historical operating data, for each given operating data point, a nested sliding window method is used to define a series of covering outer windows for the given operating data point. Each covering outer window contains a series of covering inner windows, and the sliding step size of the outer window is obtained by the dynamic step size decision method.
[0008] The dual-TF anomaly detection model uses two anomaly detectors in the time domain and frequency domain, and ultimately returns a t-anomaly score and an f-anomaly score for a given running data point. The combined t-anomaly score and f-anomaly score are used as the total anomaly score. If the total anomaly score is above a threshold, the status of the given data point is output as an anomaly; otherwise, the status of the given data point is output as normal.
[0009] (2) Use the trained dual-TF anomaly detection model to determine whether the current operating data is abnormal. If it is abnormal, a fault warning is triggered; otherwise, the historical operating data is loaded into the pre-trained time series prediction model to obtain the predicted value of the operating data at the future moment;
[0010] (3) The predicted value of the future operation data is input into the pre-trained deep belief network for fault diagnosis to obtain the fault state of the proton exchange membrane fuel cell; the fault state includes normal, lack of gas, flooding or membrane dryness.
[0011] Furthermore, the operating data includes the output voltage of the battery, the load current, the inlet and outlet gas temperatures of the cathode and anode, the inlet and outlet air humidity of the cathode and anode, the inlet and outlet gas flow rates and gas pressures of the cathode and anode.
[0012] Furthermore, the method also includes the steps of preprocessing the running data: using the WSTD method to reduce the noise in the data, using DWT to perform wavelet decomposition on the signal to decompose the data into wavelet coefficients of different frequency components, and setting a soft threshold function to reduce the amplitude of the wavelet coefficients.
[0013] Furthermore, the nested sliding window method is specifically as follows:
[0014] Define a multivariate time series Where n is the number of data points and d is the number of features. Using the sliding window technique, the multivariate time series X is divided into a series of outer windows, defining the outer window at time t where x t represents the running data point at time t, w outer Indicates the length of the outer window. In each outer window, a series of inner windows are nested by sliding window technology to define the inner window at time t where w inner Indicates the length of the inner window. For a given outer window OW t , OW t The corresponding set of all inner windows wherein represents the inner window set.
[0015] Further, the dynamic step decision method is specifically:
[0016] with the historical abnormal signal strength Z hist represents the overall strength of the abnormal signal detected recently:
[0017] a larger Z hist represents that a stronger abnormal signal is detected recently, a smaller external window sliding step is adopted, a smaller Z hist represents that all the data detected recently are normal data, a larger external window sliding step is adopted; the dynamic step s outer of the external window is calculated as follows:
[0018]
[0019] wherein, γ is a sensitivity coefficient, the larger γ is, the more sensitive to the historical abnormal signal strength; w outer represents the length of the external window, and sigmoid represents an activation function.
[0020] Further, the loss for training the dual-TF anomaly detection model includes a reconstruction loss and a correlation difference, the correlation difference is the KL divergence between a prior correlation and a sequence correlation, wherein the prior correlation is generated by a learnable Gaussian kernel function, and the sequence correlation is the self-correlation weight from the input sequence in the attention layer of the anomaly detector.
[0021] Further, the two anomaly detectors in time domain and frequency domain calculate the reconstruction loss by reconstructing the input sequence, specifically:
[0022] one external window OW t is sent into a time reconstructor, the external window corresponds to a series of inner windows converted from the original time domain to a frequency domain representation by a fast Fourier transform The series of inner windows after conversion are sent into a frequency reconstructor; wherein, represents the frequency domain representation of the IW t ;
[0023] The time reconstructor based on the Anomaly Transformer model maps each external window to calculates the time domain reconstruction loss before and after mapping, x t and are the running data points at time t before and after mapping, w outer represents the length of the external window;
[0024] The frequency reconstructor based on the Anomaly Transformer model will be denoted as OW t The frequency-domain representation of the generated is denoted as The frequency-domain reconstruction loss before and after mapping is denoted as is the frequency-domain representation of the reconstructed IW t
[0025] Further, the loss function formula corresponding to each outer window and its inner window in the outer window is as follows:
[0026]
[0027]
[0028] wherein, denotes the time-domain reconstruction loss, AssDis time (P, S; OW t ) denotes the time reconstructor correlation difference loss, denotes the time reconstructor loss corresponding to an outer window OW t denotes the frequency-domain reconstruction loss, denotes the frequency-domain reconstructor correlation difference loss, denotes the frequency-domain reconstructor loss corresponding to the generated t ; λ is a hyperparameter for weighting the correlation difference.
[0029] Further, for each coverage outer window of a given running data point, the t-anomaly score of the given outer window is calculated according to the time-domain reconstruction loss and its correlation difference, and the implementation process is as follows:
[0030] For a given data point feature vector x t , which corresponds to a series of coverage outer window sets Cov outer (x t ), is defined as:
[0031] Cov outer (x t ) = {OW ti | x t ∈ OW ti , t-w outer +1≤ti≤t}
[0032] wherein, OW ti = {x ti , x ti+1 ,...,x ti+wouter-1} denotes the outer window at time ti. For a given outer window OWti ∈Cov outer (x t ), OW ti is x t A covered exterior window.
[0033] For a given data point feature vector x t and x t Covering exterior windows ti ∈Cov outer (x t ), which corresponds to a series of covering inner window sets Cov inner (x t OW ti ), defined as:
[0034] Cov inner (x t OW ti )={IW tj ∣x t ∈IW tj And IW tj ∈OW ti ,ti≤tj≤ti+w outer -w inner}
[0035] in, Represents the inner window at time tj. For a given inner window IW tj ∈Cov inner (x t OW ti ), IW tj is x t For a given covered outer window OW ti ∈Cov outer (x t ), OW ti The corresponding set of all inner windows
[0036] Then for a given covered outer window OW ti ∈Cov outer (x t ), OW ti For each data point x t The t-anomaly score is calculated as follows:
[0037]
[0038] The f-anomaly score is calculated in two steps, and the formula is as follows:
[0039]
[0040]
[0041] where, denotes the outer coverage window OW ti x t t-anomaly score, AssDis time (P, S; OW ti ) denotes the outer coverage window OW ti corresponding temporal reconstructor associated difference loss, denotes the temporal reconstruction loss of the outer coverage window OW ti denotes element-wise multiplication, denotes the f-anomaly score of x ti x t denotes the f-anomaly score of the inner coverage window IW tj denotes the corresponding complete inner coverage window set of the outer coverage window OW ti Cov inner (x t ; OW ti ) denotes the outer coverage window OW t of x t and x ti Cov outer (x t ) corresponds to the inner coverage window set, denotes the frequency reconstructor associated difference loss of the inner coverage window set denotes the frequency domain reconstruction loss of the inner coverage window set
[0042] averaging the outer coverage window of all x t x t
[0043]
[0044]
[0045] where, and are the t-anomaly score and the f-anomaly score of x outer x t t Cov outer (x t ) denotes the outer coverage window set of x t
[0046] Further, the total anomaly score is:
[0047]
[0048] wherein, is the total anomaly score of a given operation data point x t ; and are the normalized t-anomaly score and f-anomaly score respectively; and a is the weight coefficient of the enhancement term; and b is the consistency enhancement factor.
[0049] Further, the deep belief network is composed of a plurality of restricted Boltzmann machines and a back propagation layer, the plurality of restricted Boltzmann machines are connected in sequence, and the output of the last restricted Boltzmann machine is input to the back propagation layer, and the back propagation layer serves as an output layer of the deep belief network.
[0050] Further, the pre-trained deep belief network is obtained based on a particle swarm optimization.
[0051] Compared with the prior art, the present application has the following beneficial effects:
[0052] 1. The present application innovatively constructs an abnormality detection and time series prediction joint analysis framework, forming a PEMFC sudden failure warning and gradual failure prediction mechanism. In the short time dimension, the dual-TF abnormality detection model is used to capture the trend mutation and other fault feature signals of the PEMFC in real time, realize failure warning, and avoid sudden failure; in the long time dimension, the TSMixer time series prediction combined with the fault identification technology is used to analyze the operation state in the future long period (such as several hours to several days), accurately identify the slowly accumulated fault, and provide a forward-looking basis for maintenance decision. This method not only guarantees the response timeliness of sudden failure, but also strengthens the prediction ability of long-term failure, significantly improves the comprehensiveness, timeliness and reliability of failure warning and prediction;
[0053] 2. The dual-TF time series abnormality detection method is used to detect the abnormal state of the proton exchange membrane fuel cell in real time. This method uses a nested sliding window to align the two field anomaly scores to the data point granularity, overcomes the inherent time-frequency granularity difference in the existing method, helps to improve the accuracy and the ability to capture the mode abnormal boundary, and has good real-time performance;
[0054] 3. The TSMixer time series prediction method is used to predict the operation time series data of the proton exchange membrane fuel cell at the future time. This method has simple structure and high calculation efficiency, is easy to implement and train, has good long-term prediction effect on gradual trend, can cover the fault development trend in a long period of time in the future, and reserve sufficient time window for maintenance decision; meanwhile, the cross-variable information is considered, the multi-feature fusion ability is strong, is suitable for the multi-element time series prediction task of the proton exchange membrane fuel cell, and can improve the stability and accuracy of prediction. BRIEF DESCRIPTION OF DRAWINGS
[0055] Figure 1 This is an overall flow chart of a proton exchange membrane fuel cell fault prediction and early warning method provided by the present invention;
[0056] Figure 2 This is a schematic diagram of the overall process of the dual-TF anomaly detection method provided by the present invention;
[0057] Figure 3 This is a schematic diagram of the overall process of the TSMixer time series prediction method provided by the present invention. DETAILED DESCRIPTION
[0058] The present invention will be described in further detail below with reference to the accompanying drawings.
[0059] like Figure 1 As shown, the present invention proposes a proton exchange membrane fuel cell fault prediction and early warning method, comprising:
[0060] Step S1: Collect PEMFC historical operating sequence data, including voltage data, current data, temperature data, humidity data, flow data, and pressure data, through a multi-dimensional sensor, and pre-process the raw data, including:
[0061] The output voltage, load current, gas temperature at the cathode / anode inlet / outlet, air humidity at the inlet / outlet, and gas flow and pressure at the cathode / anode inlet / outlet of the proton exchange membrane fuel cell were collected. The raw data set was cleaned, and noise was reduced using the WSTD method. The signal was decomposed using wavelet decomposition using the DWT, breaking the data into wavelet coefficients of different frequency components. A soft threshold function was set to reduce the amplitude of the wavelet coefficients, effectively mitigating noise while retaining useful information.
[0062] Step S2: Load the pre-processed historical operating time series data into a pre-established and trained dual-TF anomaly detection model to detect the current operating status of the PEMFC; the dual-TF time series anomaly detection method overcomes the inherent time-frequency granularity differences in existing methods, helps to improve accuracy and the ability to capture pattern anomaly boundaries, while having good real-time performance.
[0063] like Figure 2 As shown in Figure 2, the dual-TF anomaly detection method uses nested sliding windows to accommodate time and frequency domain information and aligns anomaly scores to the data point granularity. It also employs two anomaly detector models in the time and frequency domains and integrates anomaly scores to accurately identify the boundaries of pattern-type anomalies.
[0064] First, the pre-processed PEMFC historical operation sequence data is used as the observation data of the model down-sampling, resulting in a multivariate time series where n is the number of data points, d is the number of features, corresponding to the number of sensors that collected the raw data, x n is the feature vector of the nth data point; using X as a training set, an anomaly detector is constructed a deep neural network is used in both time and frequency domain to return an anomaly score for a given data point, where x t is the data point feature vector at time stamp t, Θ time is the time reconstructor parameter, Θ frequency is the frequency reconstructor parameter. Given another multivariate time series as a test sequence, the anomaly detector is able to classify each data point x t in X' as normal or abnormal.
[0065] Through a nested sliding window scheme, the multivariate time series X or X' is converted into a series of outer windows of length w outer The outer window at time t is taken as an example, a series of inner windows is divided for this outer window, where OW t denotes an outer window, x t denotes the data point feature vector at time stamp t, denotes the corresponding full set of inner windows for a given outer window OW t , IW t denotes the inner window at time t, w inner denotes the inner window length, w outer denotes the outer window length; the outer window slides as usual to capture various temporal contexts, the inner window only slides within the corresponding outer window to generate multiple spectra for each data point, the nested window scheme is to use nested sliding windows to accommodate temporal and frequency information.
[0066] For a given data point feature vector x t , a series of covering outer window sets Cov outer (x t ) is defined as:
[0067] Cov outer (x t ) = {OW ti | x t ∈ OW ti , t - w outer + 1≤ ti≤ t}
[0068] where, denotes the outer window at time ti. For a given outer window OW ti∈Cov outer (x t ), OW ti is x t A covered exterior window.
[0069] For a given data point feature vector x t and x t Covering exterior windows ti ∈Cov outer (x t ), which corresponds to a series of covering inner window sets Cov inner (x t OW ti ), defined as:
[0070] Cov inner (x t OW ti )={IW tj ∣x t ∈IW tj And IW tj ∈OW ti ,ti≤tj≤ti+w outer -w inner}
[0071] Among them, IW tj ={x tj ,x tj+1 ,…,x tj+winner-1} represents the inner window at time tj. For a given inner window IW tj ∈Cov inner (x t OW ti ), IW tj is x t A covered inner window. For a given outer window OW ti ∈Cov outer (x t ), OW ti The corresponding set of all inner windows
[0072] Among them, the sliding step of the outer window Obtained by the dynamic step size decision method. Using the historical abnormal signal strength Z hist Indicates the overall strength of the abnormal signals detected recently:
[0073]
[0074]
[0075] Among them, N hist is the number of windows outside the history; wk the weight coefficient of the historical outer window, denotes the kth outer window from the end; is the average of the final anomaly scores of all data points in the kth outer window from the end; is the final anomaly score of each x i corresponding anomaly score.
[0076] a larger Z hist indicates that a stronger anomaly signal is detected recently, and a smaller outer window sliding step is used to ensure a detailed analysis of the anomaly region and its boundary; a smaller Z hist indicates that all recent data are normal, and a larger outer window sliding step is used to quickly skip the continuous normal region and improve the overall analysis efficiency. The dynamic step size s outer of the outer window is calculated as follows:
[0077]
[0078] where γ is a sensitivity coefficient, and a larger γ indicates a greater sensitivity to the intensity of historical anomaly signals.
[0079] An outer window OW t is sent to the time reconstructor, and the inner windows corresponding to the outer window are converted from their original time domain to frequency domain representation by fast Fourier transform (FFT) The converted inner windows are sent to the frequency reconstructor.
[0080] In one specific implementation of the present application, the time reconstructor and the frequency reconstructor based on the Anomaly Transformer model are used, and each input X 0 of the time reconstructor is t , and each input of the frequency reconstructor is
[0081] According to the self-attention mechanism, the output of the lth layer is defined as:
[0082]
[0083]
[0084]
[0085] where l is the index of the number of attention layers, l∈[l,n layer ], n layer is the total number of attention layers; Q, K, and V are query, key, and value vectors; are learnable parameters corresponding to Q, K, and V; d modelis the dimension of the hidden layer; is the output of the l-th layer reconstruction network in the time reconstructor / frequency reconstructor; Θ* is the parameter set.
[0086] Since the input dimensions of the time reconstructor and the frequency reconstructor are different, the two reconstructors are trained separately and the total loss is calculated. The parameters are updated through backpropagation to minimize the total loss;
[0087] Specifically, use the parameter Θ time Each outer window formed by the time reconstructor Map to OW t The reconstruction loss formula is as follows:
[0088]
[0089] Similar to the time reconstructor, the frequency reconstructor will be composed of OW t Produced Frequency domain representation of Reconstruction For parameter Θ frequency Updated by OW t Produced The reconstruction loss is:
[0090]
[0091] in, IW p The p-th dimension result of the frequency domain representation before and after reconstruction.
[0092] Define the association difference as the prior association (P l ) and sequence association (S l ) between the KL divergence, the formula for the associated difference is as follows:
[0093]
[0094]
[0095]
[0096] Where AssDis(P,S;X) represents the association difference; P l is the prior association, generated by a learnable Gaussian kernel function; σ is a learnable scale parameter; S l is the sequence association, which means the self-association weight from the original sequence in the lth attention layer; for the time reconstructor, For the frequency reconstructor, Where m = w outer -w inner+1, m is the number of inner windows per outer window;
[0097] The total loss includes reconstruction loss and correlation discrepancy, and the loss function is as follows:
[0098]
[0099]
[0100] Wherein, λ (>0) is a hyperparameter for weighting the correlation discrepancy.
[0101] The abnormal score in time domain (t-abnormal score) and the abnormal score in frequency domain (f-abnormal score) are derived from the two reconstructors respectively; wherein, for a given coverage outer window OW ti ∈Cov outer (x t ), OW ti The t-abnormal score of each data point x t is calculated as follows:
[0102]
[0103] The f-abnormal score is calculated in two steps, and the formula is as follows:
[0104]
[0105]
[0106] By aligning the outer window time domain reconstruction loss and the inner window frequency domain reconstruction loss to break the time-frequency granularity difference, the coverage outer window of all x t is averaged, and the formula is as follows:
[0107]
[0108] Finally, the t-abnormal score and the f-abnormal score normalized to the interval [0, 1] are combined to form the final abnormal score, and compared with the threshold value:
[0109]
[0110] Wherein, is the final abnormal score; and are the normalized t-abnormal score and f-abnormal score respectively; α (>0) is the weight coefficient of the enhancement term; β (>0) is the consistency enhancement factor. When the t-abnormal score and the f-abnormal score are both high and similar, Close to exp(beta), the enhancement of the double high abnormal signal is realized, the larger beta is, the more obvious the enhancement effect is; when the t- abnormal score and the f- abnormal score are high and low respectively, Close to 1, no additional enhancement.
[0111] If the final abnormal score is higher than the threshold value, the state of the given data point is output as abnormal, otherwise, the state of the given data point is output as normal.
[0112] Through the above scheme, given x t , combined with its corresponding series of outer windows (inner windows), whether x t is abnormal / normal can be judged.
[0113] Step S3, judging whether the PEMFC will fail at a future time according to the current running state of the PEMFC, if the running state is abnormal, triggering a failure warning, otherwise, entering step S4;
[0114] Step S4, loading the pretreated historical running time series data into a TSMixer time series prediction model established and trained in advance, and predicting the running time series data of the PEMFC at a future time; the TSMixer time series prediction method has simple structure and high calculation efficiency, is easy to implement and train, has good long-term prediction effect on gradual trend, and considers cross variable information, and has strong multi-dimensional feature fusion capability;
[0115] As shown in Figure 3 , the TSMixer time series prediction method stacks multiple layers of time mixing and feature mixing MLPs to aggregate time patterns and cross variable information; the historical time series data is sent to time projection after being mixed by the multiple layers of mixers; in the time projection, a prediction is generated by a fully connected layer;
[0116] Firstly, due to the existence of time mixing and feature mixing operations, for the historical running time series data of the PEMFC 2D normalization is applied in the time and feature dimensions to maintain the scale of features and time steps;
[0117] In the time mixer module, the input is transposed and then enters the time mixing MLP component, which models the time patterns in the time series; before leaving the time mixer, the matrix X is transposed again and sent to the feature mixer, which enters the feature mixing MLP component after applying 2D normalization again, for feature transformation modeling; after mixing is completed, the output is sent to the time projection step; in the time projection, the matrix X is transposed and generates a prediction by a fully connected layer; the matrix is transposed again and output.
[0118] The TSMixer only uses historical time series As input, a series of mixer blocks are applied to project the input data to a latent representation of size d, and then project the final output to the prediction length T; the principle of TSMixer model is well known in the art, and will not be described here.
[0119] In step S5, the prediction result is input into the trained deep belief network based on particle swarm optimization for fault diagnosis to obtain a fault state of the PEMFC; the deep belief network based on particle swarm optimization is composed of a plurality of restricted Boltzmann machines and a back propagation layer, the plurality of restricted Boltzmann machines are connected in sequence, the output of the last restricted Boltzmann machine is input into the back propagation layer, and the back propagation layer serves as an output layer of the deep belief network; the fault state includes normal, insufficient gas, water flooding or membrane dryness.
[0120] The specific embodiments of the present application are described in detail above, which is intended to illustrate the technical solutions of the present application, rather than limit the protection scope of the present application. Any modification, equivalent replacement, technical extension or adaptive improvement based on the technical concept of the present application shall be considered to fall within the protection scope of the present application.
Claims
1. A proton exchange membrane fuel cell fault prediction and early warning method, characterized in that: The following steps are involved: (1) Using historical operating data of proton exchange membrane fuel cells, a dual-TF anomaly detection model is trained to detect the current operating status of the battery; Before training the model using historical operating data, for each given operating data point, a nested sliding window method is used to define a series of covering outer windows for the given operating data point. Each covering outer window contains a series of covering inner windows, and the sliding step size of the outer window is obtained by the dynamic step size decision method. The dual-TF anomaly detection model uses two anomaly detectors in the time domain and frequency domain, and ultimately returns a t-anomaly score and an f-anomaly score for a given running data point. The combined t-anomaly score and f-anomaly score are used as the total anomaly score. If the total anomaly score is above a threshold, the status of the given data point is output as an anomaly; otherwise, the status of the given data point is output as normal. (2) Use the trained dual-TF anomaly detection model to determine whether the current running data is abnormal. If abnormal, a fault warning is triggered; Otherwise, the historical operation data is loaded into the pre-trained time series prediction model to obtain the predicted value of the operation data at the future moment; (3) The predicted value of the future operation data is input into the pre-trained deep belief network for fault diagnosis to obtain the fault state of the proton exchange membrane fuel cell; the fault state includes normal, lack of gas, flooding or membrane dryness.
2. The proton exchange membrane fuel cell fault prediction and early warning method according to claim 1, characterized in that: The nested sliding window method is specifically: Define a multivariate time series Where n is the number of data points and d is the number of features; By using the sliding window technique, the multivariate time series X is divided into a series of outer windows, defining the outer window at time t where x t represents the running data point at time t, w outer Indicates the length of the outer window; within each outer window, a series of inner windows are nested using the sliding window technique to define the inner window at time t where w inner Indicates the length of the inner window; for a given outer window OW t ,OW t The corresponding set of all inner windows in Represents the inner window set.
3. The proton exchange membrane fuel cell fault prediction and early warning method according to claim 1, characterized in that: The dynamic step size decision method is as follows: Use the historical abnormal signal strength Z hist Indicates the overall strength of the abnormal signals detected recently: Larger Z hist Indicates that a strong abnormal signal has been detected recently, so a smaller external window sliding step size and a smaller Z hist Indicates that the recent data are normal, then a larger external window sliding step is used; the dynamic step size of the external window s outer The calculation formula is as follows: Among them, γ is the sensitivity coefficient. The larger γ is, the more sensitive it is to the strength of historical abnormal signals. outer represents the outer window length, and sigmoid represents the activation function.
4. The proton exchange membrane fuel cell fault prediction and early warning method according to claim 2, characterized in that: The loss used to train the dual-TF anomaly detection model includes reconstruction loss and association divergence, where the association divergence is the KL divergence between the prior association and the sequential association, where the prior association is generated by a learnable Gaussian kernel function and the sequential association is the autocorrelation weight from the input sequence in the anomaly detector's attention layer.
5. The proton exchange membrane fuel cell fault prediction and early warning method according to claim 2, characterized in that: The two anomaly detectors in the time domain and frequency domain calculate the reconstruction loss by reconstructing the input sequence, specifically: an outer window OW t Enter the time reconstructor, the series of inner windows corresponding to the outer window Converted from its original time domain to frequency domain representation via Fast Fourier Transform The converted series of inner windows are fed into the frequency reconstructor; Indicates IW t Frequency domain representation of ; The temporal reconstructor based on the Anomaly Transformer model transforms each outer window Map to Calculate the time domain reconstruction loss before and after mapping, x t and They are the running data points at time t before and after the mapping, w outer Indicates the length of the outer window; The frequency reconstructor based on the Anomaly Transformer model will be provided by OW t Produced Frequency domain representation of Reconstruction Calculate the frequency domain reconstruction loss before and after mapping, It is the rebuilt IW t Frequency domain representation of .
6. The proton exchange membrane fuel cell fault prediction and early warning method according to claim 4, characterized in that: The loss function formula for each outer window and its inner window is as follows: in, represents the time domain reconstruction loss, AssDis time (P,S;OW t ) represents the temporal reconstructor correlation difference loss, Indicates an exterior window OW t the corresponding temporal reconstructor loss; represents the frequency domain reconstruction loss, represents the frequency domain reconstructor associated difference loss, Indicated by OW t Produced The corresponding frequency domain reconstructor loss; λ is a hyperparameter used to weight the association differences.
7. The proton exchange membrane fuel cell fault prediction and early warning method according to claim 4, characterized in that: Given each covered outer window of a given running data point, the t-anomaly score of the given outer window is calculated based on the temporal reconstruction loss and its associated difference. The implementation process is as follows: For a given data point feature vector x t , which corresponds to a series of covered exterior window sets Cov outer (x t ), defined as: Number outer (x) t )={OW ti ∣x t ∈OW ti ,tw outer +1≤ti≤t} in, Represents the outer window at time ti. For a given outer window OW ti ∈Cov outer (x t ), OW ti is x t a covered exterior window; For a given data point feature vector x t and x t Covering exterior windows ti ∈Cov outer (x t ), which corresponds to a series of covering inner window sets Cov inner (x t OW ti ), defined as: Cov inner (x t ; OW ti ) = {IW tj ∣x t ∈IW tj 且IW tj ∈OW ti , ti ≤ tj ≤ ti + w outer -w inner} in, Represents the inner window at time tj. For a given inner window IW tj ∈Cov inner (x t OW ti ), IW tj is x t A covered inner window; for a given covered outer window OW ti ∈Cov outer (x t ), OW ti The corresponding set of all inner windows Then for a given covered outer window OW ti ∈Cov outer (x t ), OW ti For each data point x t The t-anomaly score is calculated as follows: The f-anomaly score is calculated in two steps, and the formula is as follows: in, Indicates covering the outer window OW ti x inside t t-anomaly score, AssDis time (P,S;OW ti ) means covering the outer window OW ti The corresponding temporal reconstructor is associated with the difference loss, Indicates covering the outer window OW ti The time domain reconstruction loss, ⊙ represents element-by-element multiplication, Indicates covering the outer window OW ti x inside t The f-anomaly score, Represents a given inner window set Internal covered window IW tj The f-anomaly score, Indicates covering the outer window OW ti The corresponding set of all inner windows Cov inner (x t OW ti ) represents x t and x t Covering exterior windows ti ∈Cov outer (x t ) corresponds to the set of covered inner windows Inner window set The corresponding frequency reconstructor is associated with the difference loss, Inner window set The corresponding frequency domain reconstruction loss; For all x t The average of the covered outer windows is as follows: in, and x t t-anomaly score and f-anomaly score of all covered outer windows; Cov outer (x t ) represents x t A collection of covered exterior windows.
8. The proton exchange membrane fuel cell fault prediction and early warning method according to claim 7, characterized in that: The total anomaly score is: in, For a given running data point x t Total anomaly score; and are the normalized t-anomaly score and f-anomaly score respectively; α is the enhancement item weight coefficient; β is the consistency enhancement factor.
9. The proton exchange membrane fuel cell fault prediction and early warning method according to claim 1, characterized in that: The deep belief network consists of multiple restricted Boltzmann machines and a back propagation layer. The multiple restricted Boltzmann machines are connected in sequence, and the output of the last restricted Boltzmann machine is input to the back propagation layer, which serves as the output layer of the deep belief network.
10. The proton exchange membrane fuel cell fault prediction and early warning method according to claim 1, characterized in that: The operating data include the output voltage of the battery, the load current, the inlet and outlet gas temperatures of the cathode and anode, the inlet and outlet air humidity of the cathode and anode, the inlet and outlet gas flow rates and gas pressures of the cathode and anode.