Battery fault diagnosis method and device, computer device and storage medium
By generating a sample dataset based on a battery model and utilizing a fault diagnosis model based on support vector machines and the K-nearest neighbor algorithm, the problem of inaccurate fuel cell diagnosis was solved, and high-accuracy identification of abnormal battery temperature and pressure was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TSINGHUA UNIVERSITY
- Filing Date
- 2023-11-28
- Publication Date
- 2026-07-03
AI Technical Summary
Existing fuel cell fault diagnosis models are inaccurate and have difficulty effectively identifying abnormal states of the battery system.
By acquiring the operating signals of the battery under test, a fault diagnosis model trained on a sample dataset is used for diagnosis. The sample dataset is generated by the battery model corresponding to the battery under test, including water transport, reactive gas transport and electrochemical reaction models. The fault classification is performed by combining support vector machine and K-nearest neighbor algorithm.
It improves the accuracy of fault diagnosis, especially the identification of abnormal battery temperature and pressure, and achieves high-accuracy fault diagnosis.
Smart Images

Figure CN117872136B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of battery fault diagnosis technology, and in particular to a method, apparatus, computer equipment, and storage medium for diagnosing battery faults. Background Technology
[0002] As a power source, the efficiency and performance of a proton exchange membrane fuel cell (PEMFC) system are affected by a variety of external and internal factors. Therefore, it is very meaningful to diagnose faults in fuel cells and maintain their efficient and normal operation.
[0003] Currently, when diagnosing faults in fuel cells, the fuel cell system is tested under different operating conditions. The data from these different operating conditions is used as a dataset to train a fault diagnosis model, which is then used to diagnose the fault.
[0004] However, the above fault diagnosis model has the problem of inaccurate diagnosis. Summary of the Invention
[0005] Therefore, it is necessary to provide a method, apparatus, computer equipment, and storage medium for diagnosing battery faults that can improve diagnostic accuracy in response to the aforementioned technical problems.
[0006] In a first aspect, this application provides a method for diagnosing battery faults, the method comprising:
[0007] Acquire the operating signal of the battery under test; the operating signal includes the operating voltage and / or polarization voltage of the battery under test;
[0008] The working signal is input into the fault diagnosis model for fault diagnosis to obtain the diagnosis result; the fault diagnosis model is trained based on the sample dataset; the sample dataset is generated by the battery model corresponding to the battery under test.
[0009] In one embodiment, the method for generating a sample dataset using a battery model corresponding to the battery under test includes:
[0010] Obtain the initial sample dataset corresponding to different fault types; the initial sample dataset includes the battery voltage signal and / or temperature signal under different operating conditions.
[0011] The initial sample dataset is input into the battery model for prediction, resulting in the sample dataset.
[0012] In one embodiment, a method for training a fault diagnosis model based on a sample dataset includes:
[0013] The sample dataset is labeled with fault types based on the initial sample dataset to obtain the labeled dataset;
[0014] The initial fault diagnosis model is trained using the labeled dataset and the sample dataset to obtain the fault diagnosis model.
[0015] In one embodiment, the operating signal is input to a fault diagnosis model for fault diagnosis, and the diagnosis results are obtained, including:
[0016] Acquire standard signals;
[0017] The standard signal and the working signal are input into the fault diagnosis model to perform fault diagnosis and obtain the diagnosis results.
[0018] In one embodiment, a standard signal and a working signal are input into a fault diagnosis model to perform fault diagnosis and obtain diagnostic results, including:
[0019] The error values are obtained by calculating the error between the standard signal and the working signal;
[0020] The signal error value is input into the fault diagnosis model for fault diagnosis, and the diagnosis result is obtained.
[0021] In one embodiment, the fault diagnosis model includes a feature extraction network and a fault classification network. Signal error values are input into the fault diagnosis model for fault diagnosis, and diagnostic results are obtained, including:
[0022] The signal error value is input into the feature extraction network for feature extraction to obtain the signal features;
[0023] The signal features are input into a fault classification network for fault classification to obtain diagnostic results.
[0024] Secondly, this application also provides a battery fault diagnostic device, the device comprising:
[0025] The acquisition module is used to acquire the operating signal of the battery under test; the operating signal includes the operating voltage and / or polarization voltage of the battery under test;
[0026] The diagnostic module is used to input the working signal into the fault diagnosis model to perform fault diagnosis and obtain the diagnostic results. The fault diagnosis model is trained based on the sample dataset. The sample dataset is generated by the battery model corresponding to the battery under test.
[0027] Thirdly, this application also provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0028] Acquire the operating signal of the battery under test; the operating signal includes the operating voltage and / or polarization voltage of the battery under test;
[0029] The working signal is input into the fault diagnosis model for fault diagnosis to obtain the diagnosis result; the fault diagnosis model is trained based on the sample dataset; the sample dataset is generated by the battery model corresponding to the battery under test.
[0030] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0031] Acquire the operating signal of the battery under test; the operating signal includes the operating voltage and / or polarization voltage of the battery under test;
[0032] The working signal is input into the fault diagnosis model for fault diagnosis to obtain the diagnosis result; the fault diagnosis model is trained based on the sample dataset; the sample dataset is generated by the battery model corresponding to the battery under test.
[0033] Fifthly, this application also provides a computer program product, which includes a computer program that, when executed by a processor, performs the following steps:
[0034] Acquire the operating signal of the battery under test; the operating signal includes the operating voltage and / or polarization voltage of the battery under test;
[0035] The working signal is input into the fault diagnosis model for fault diagnosis to obtain the diagnosis result; the fault diagnosis model is trained based on the sample dataset; the sample dataset is generated by the battery model corresponding to the battery under test.
[0036] The aforementioned battery fault diagnosis method, apparatus, computer equipment, and storage medium involve acquiring the operating signals of the battery under test and then inputting these signals into a fault diagnosis model to perform fault diagnosis and obtain a diagnostic result. The operating signals include the operating voltage and / or polarization voltage of the battery under test. The fault diagnosis model is trained based on a sample dataset, which is generated using a battery model corresponding to the battery under test. This method generates a large number of sample datasets using the battery model and then uses these datasets to train a high-accuracy fault diagnosis model, thereby improving the accuracy of fault diagnosis. Attached Figure Description
[0037] Figure 1 This is an internal structural diagram of a computer device in one embodiment;
[0038] Figure 2 This is a flowchart illustrating a battery fault diagnosis method in one embodiment;
[0039] Figure 3 This is a schematic diagram of the battery model in one embodiment;
[0040] Figure 4 This is a schematic diagram illustrating a method for constructing a battery model in one embodiment;
[0041] Figure 5 This is a flowchart illustrating a battery fault diagnosis method in another embodiment;
[0042] Figure 6 This is a flowchart illustrating a battery fault diagnosis method in another embodiment;
[0043] Figure 7 This is a schematic diagram illustrating the distribution of normal data samples and fault data samples in one embodiment;
[0044] Figure 8 This is a schematic diagram illustrating the distribution of diagnostic results from the support vector machine algorithm in one embodiment;
[0045] Figure 9 This is a schematic diagram illustrating the fault diagnosis accuracy of the support vector machine algorithm in one embodiment;
[0046] Figure 10 This is a schematic diagram illustrating the distribution of diagnostic results from the K-nearest neighbor algorithm in one embodiment;
[0047] Figure 11 This is a schematic diagram illustrating the fault diagnosis accuracy of the K-nearest neighbor algorithm in one embodiment;
[0048] Figure 12 This is a flowchart illustrating a battery fault diagnosis method in another embodiment;
[0049] Figure 13 This is a flowchart illustrating a battery fault diagnosis method in another embodiment;
[0050] Figure 14 This is a flowchart illustrating a battery fault diagnosis method in another embodiment;
[0051] Figure 15 This is a flowchart illustrating a battery fault diagnosis method in another embodiment;
[0052] Figure 16 This is a structural block diagram of a battery fault diagnosis device in one embodiment. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0054] As a power source, the efficiency and performance of a proton exchange membrane fuel cell (PEMFC) system are affected by various external and internal factors. Therefore, fault diagnosis of the fuel cell is crucial for maintaining its efficient and normal operation. Currently, fault diagnosis of fuel cells involves conducting tests under different operating conditions, using the data from these tests as a dataset to train a fault diagnosis model, and then using this model for fault diagnosis. However, the aforementioned fault diagnosis models suffer from inaccurate diagnostic results.
[0055] This application provides a method for diagnosing battery faults, which aims to solve the above-mentioned technical problems. The following embodiments will specifically illustrate the method for diagnosing battery faults described in this application.
[0056] The battery fault diagnosis method provided in this application embodiment can be applied to, for example, Figure 1 The computer device shown can be a terminal or a server, and its internal structure diagram can be as follows. Figure 1 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a method for diagnosing battery failure. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0057] Those skilled in the art will understand that Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0058] In one embodiment, such as Figure 2 As shown, a method for diagnosing battery faults is provided, which can be applied to... Figure 1 Taking a computer device as an example, the explanation includes the following steps:
[0059] S101, acquire the operating signal of the battery under test.
[0060] The operating signals include the operating voltage and / or polarization voltage of the battery under test. The operating voltage of the battery under test can be an internal resistance correction voltage, and the polarization voltage can be an ohmic polarization value.
[0061] In this embodiment, various sensors can be pre-installed on the battery under test to detect its operating state. For example, a voltage sensor can be installed. When real-time fault diagnosis of the battery under test is required, the computer device can acquire the operating signals of the battery under test based on the sensors on the battery. For example, the voltage sensor can be used to acquire the current operating voltage and / or polarization voltage of the battery under test.
[0062] S102, input the working signal into the fault diagnosis model to perform fault diagnosis and obtain the diagnosis result.
[0063] The fault diagnosis model is pre-trained based on a sample dataset. This sample dataset is generated using the battery model corresponding to the battery under test. The sample dataset includes: high temperature – excessively high temperature, low temperature – excessively low temperature, high pressure – excessively high pressure, low pressure – excessively low pressure, normal temperature – normal temperature, and normal pressure – normal pressure. The battery model corresponding to the battery under test is a simulation model of the actual battery system, used to describe the water transport process, reactant gas transport process, and electrochemical reaction process of the battery system. The diagnostic results include at least one of the following: normal temperature, excessively high temperature, excessively low temperature, excessively high pressure, excessively low pressure, and normal pressure.
[0064] In this embodiment, when the sample dataset is sufficiently large, a fault diagnosis model with high accuracy can be trained using a large sample dataset. However, since the sample dataset includes input signals such as high temperature or high pressure, resulting in abnormal data of excessively high temperature or pressure, directly inputting such signals to the battery system would damage the battery, reducing its lifespan. Furthermore, only a small amount of sample data can be obtained, making it impossible to train a fault diagnosis model with high accuracy. To address this issue, the computer device can pre-construct a battery model corresponding to the battery under test. By performing state evaluation and feedback algorithm adjustments on this battery model, the outputs of the battery model and the battery system are almost identical when the same input is applied, meaning the error between the battery model's output and the battery system's output meets preset requirements. Then, by inputting a large amount of high temperature or high pressure signals to the adjusted battery model, a large amount of corresponding abnormal data of excessively high temperature or pressure can be obtained, resulting in a large sample dataset. Finally, using this large sample dataset to train an initial fault diagnosis model, a fault diagnosis model with high accuracy can be obtained.
[0065] After acquiring the operating signal of the battery under test based on the above steps, the computer equipment can input the operating signal into the fault diagnosis model. The fault diagnosis model then diagnoses the operating signal to obtain the diagnostic result. For example, if the operating signal is high temperature, the diagnostic result is that the battery temperature is too high. In this scenario, the temperature sensor and actuator are faulty. If the operating signal is high pressure, the diagnostic result is that the battery pressure is too high. In this scenario, the pressure sensor and actuator are faulty.
[0066] The method for constructing the battery model in the above steps is as follows:
[0067] Battery models include water transport models, reactive gas transport models, and electrochemical reaction models.
[0068] like Figure 3 As shown, the battery is divided into several cavities, including the flow channel CH, gas diffusion layer GDL, catalyst layer CL, and proton exchange membrane MB. The anode comprises the anode flow channel ACH, anode gas diffusion layer AGDL, anode catalyst layer ACL, and anode proton exchange membrane AMB. The cathode comprises the cathode flow channel CCH, cathode flow channel CCH, cathode gas diffusion layer CGDL, cathode catalyst layer CCL, and cathode proton exchange membrane CMB. The main state variables include the hydrogen concentration in the anode flow channel. Water vapor concentration Hydrogen concentration in the anode catalyst layer Water vapor concentration Liquid water saturation Water content Water content λ of proton exchange membrane mOxygen concentration in the cathode catalyst layer Water vapor concentration Liquid water saturation Water content This ensures that important state features can be described, and also guarantees the real-time performance of the PEMFC model.
[0069] 1. Water transport model
[0070] The dynamic changes in water content within the membrane are influenced by different transport mechanisms and electrochemical reactions. Equation (1) represents the change in water content within the membrane. The flux across the membrane includes electroosmotic migration. and diffusion
[0071]
[0072] Where, ρ m Let λ be the density of the membrane. m The membrane water content is given by EW, the polymer equivalent is given by t, and δ is given by time. m n is the thickness of the proton exchange membrane. d Let be the electroosmotic migration coefficient, i be the current density, F be the Faraday constant, and D be the current density. w Let be the diffusion coefficient of water in the membrane. It is the difference in water content on the cathode and anode sides of the membrane.
[0073] Equation (2) represents the change in water content on the anode membrane surface, which can be expressed as the sum of water transfer within the membrane and water absorption / discharge processes on the membrane surface. Wherein, This refers to the water absorption / drainage process of the membrane; Water is produced by the reaction.
[0074]
[0075] in, The water content on the surface of the anode film, k represents the thickness of the anode catalyst layer. ad The suction and discharge coefficient is... This represents the water content in the anolyte membrane at equilibrium.
[0076] Similarly, equation (3) represents the change in water content on the cathode film surface.
[0077]
[0078] in, The water content on the cathode film surface. The thickness of the cathode catalyst layer. This represents the equilibrium water content of the cathode membrane. Water vapor transport is primarily considered in terms of diffusion, with a focus on the water vapor concentration in the catalyst layer and flow channels.
[0079] Equation (4) represents the change in water vapor concentration in the catalyst layer. Wherein, For diffusion between the fuel cell catalyst layer and the flow channel; k pc ·s cl (c sat -c v,cl () represents the phase change of water vapor.
[0080]
[0081] Where, ε cl c represents the porosity of the cathode catalyst layer. v,cl c represents the water vapor concentration in the catalyst layer. v,ch R represents the water vapor concentration in the cathode channel. v,ch R represents the convective mass transfer resistance of water vapor at the interface between the cathode / anode channel and the GDL. v,gdl and R v,cl These correspond to the diffusion resistance of water vapor in the cathode / anode GDL and the catalyst layer, respectively. pc Let s be the phase transition rate. cl c represents the saturation level of liquid water at the cathode. sat This represents the saturated water vapor concentration as a function of temperature.
[0082] Equation (5) represents the change in water vapor concentration in the flow channel, which is determined by the operating conditions:
[0083]
[0084] Among them, c v,ch δ represents the water vapor concentration in the flow channel. ch For the thickness of the flow channel, Water vapor introduced for external humidification This refers to the water vapor discharged from the tailpipe valve.
[0085] The transport of liquid water mainly considers the phase change of liquid water in the catalyst layer and its diffusion into the flow channel.
[0086] Equation (6) represents the change in the saturation of liquid water at the cathode:
[0087]
[0088] Among them, s cl ρ represents the saturation level of liquid water. l The density of liquid water, The effective permeability of liquid water, μ l The viscosity of liquid water, This represents the change in liquid water pressure.
[0089] 2. Reaction Gas Transport Model
[0090] The transport of hydrogen at the anode considers the hydrogen concentrations in the flow channel and the catalyst layer, respectively. Equations (7) and (8) represent the hydrogen concentrations in the flow channel and the catalyst layer, respectively. The transport process includes the transport between the anode catalyst layer and the flow channel. air intake of the flow channel / exhaust process Catalyst layer reaction consumes hydrogen
[0091]
[0092]
[0093] in, The hydrogen concentration in the flow channel. The hydrogen concentration in the catalyst layer. The convective resistance of hydrogen gas through the flow channel. The diffusion resistance of hydrogen in the gas diffusion layer, The diffusion resistance of hydrogen in the catalyst. This refers to the hydrogen inlet flow rate. The hydrogen exhaust flow rate is given. Similar to the hydrogen transport at the anode, the oxygen transport considers the oxygen concentration in the flow channel and the catalyst layer, respectively, and their variations are shown in equations (9) and (10). This includes the transport between the cathode catalyst layer and the flow channel, the intake / exhaust process in the flow channel, and the oxygen consumption of the catalyst layer reaction.
[0094]
[0095]
[0096] in, The oxygen concentration in the catalyst layer. This refers to the oxygen concentration in the flow channel. The convective resistance of oxygen flowing through the channel. The resistance to oxygen diffusion in the gas diffusion layer, This represents the diffusion resistance of oxygen in the catalyst layer.
[0097] 3. Electrochemical reaction model
[0098] The voltage V of the fuel cell is determined by the open-circuit voltage and the oxidation reaction η. HOR oxygen reduction reaction η ORR and Ohmic polarization η ohm Composition of various parts.
[0099]
[0100] Where T is the fuel cell temperature and R is the gas constant. The local pressure of hydrogen gas. For oxygen local pressure. Ohmic polarization η ohm It can be acquired in real time through high-frequency AC impedance and can be expressed as:
[0101]
[0102] Among them, the proton exchange membrane impedance R m The impedance of the catalyst layer Electronic resistance R ele R m It is strongly correlated with membrane water content, i.e., R m =f(λ) m ).
[0103] Internal resistance correction voltage V IR-free This can be achieved by measuring voltage V and ohmic polarization η. ohm The results are obtained by adding these factors together, and an electrochemical reaction equation is established based on the internal states of the cathode, such as liquid water saturation, temperature, and oxygen partial pressure.
[0104]
[0105] The methods for state evaluation and feedback algorithm adjustment of the battery model in the above steps are as follows:
[0106] like Figure 4 As shown, firstly, the environmental information u of the battery (at least one of the battery's current, AC impedance, temperature, pressure, humidity, concentration, and flow rate) is acquired, and the environmental information is input into the battery system. Figure 4 In the PEMFC system and the state observer (which includes a battery model and a preset observation model; the battery model is the PEMFC model in the figure, and the preset observation model is the observation algorithm in the figure), the battery system performs state estimation to output actual state information y (the ohmic polarization value and internal resistance correction voltage of the battery), and the battery model in the state observer performs state prediction to output external state information in the predicted state information. .
[0107] Then, based on the actual state information y and the predicted state information Determine the error e, and adjust the internal state information (liquid water saturation, membrane water content, and oxygen concentration in the predicted state information of the battery model) through the preset observation model in the state observer so that the error e meets the preset threshold requirement. If the adjusted error e still does not meet the preset threshold requirement, continue to repeat the above method until the error e meets the preset threshold requirement.
[0108] Secondly, when the error e does not meet the preset threshold requirement, the process of adjusting the battery model is as follows:
[0109] Ohmic polarization η measured by high-frequency AC impedance ohm and internal resistance correction voltage V IR-free =η ohm The two measured values, +V, are used as feedback correction values.
[0110]
[0111] Where ε1 and ε2 are the errors e (sliding surface), and η ohm For actual Ohmic polarization, To predict Ohmic polarization, V IR-free The voltage is the correction voltage for the actual internal resistance. To predict the internal resistance correction voltage. Internal resistance correction voltage V IR-free =η ohm +V. V is the battery voltage, V is determined by the open-circuit voltage U, and the oxidation reaction η. HOR oxygen reduction reaction η ORR and Ohmic polarization η ohm The components V can be represented by the relation (15):
[0112] V=U-η HOR -η ORR -η ohm (15);
[0113] The feedback correction is then input into the preset observation model to perform state correction on the membrane liquid water saturation and membrane water content, thereby obtaining the estimated values corresponding to the internal state information in the predicted state information:
[0114]
[0115] Where x1 is the membrane water content λ m , Its corresponding estimate is related to ohmic polarization and is therefore corrected by ε1; x2 is the liquid water saturation s of the cathode catalyst layer. ccl It is related to the internal resistance correction voltage, and is therefore corrected by ε2.
[0116] sign is a switching function, which can be expressed as:
[0117]
[0118] Finally, based on the corrected internal state information, the actual state information y output by the battery system and the predicted state information output by the battery model are further determined. Determine the new error e, and further determine whether the new error e meets the preset threshold requirements.
[0119] The battery fault diagnosis method provided in this application acquires the operating signal of the battery under test and then inputs the operating signal into a fault diagnosis model for fault diagnosis to obtain a diagnosis result. The fault diagnosis model is trained based on a sample dataset, which is generated from the battery model corresponding to the battery under test. This method generates a large number of sample datasets through the battery model and then uses these large sample datasets to train a high-accuracy fault diagnosis model, thereby improving the accuracy of fault diagnosis.
[0120] In one embodiment, a method for generating a sample dataset using a battery model corresponding to the battery under test is also provided, such as... Figure 5 As shown, the method includes:
[0121] S201, Obtain the initial sample dataset corresponding to different fault types.
[0122] The fault types include at least one of the following: normal temperature, excessively high temperature, excessively low temperature, excessively high pressure, excessively low pressure, and normal pressure. The initial sample dataset includes voltage and / or temperature signals of the battery under different operating conditions.
[0123] In this embodiment, the computer device can acquire battery signals under different operating conditions through manual settings or web crawling, and use these signals as the initial sample dataset. For example, the normal operating conditions of the battery are 70°C and 150 kPa, which is taken as the standard operating condition. Based on the standard operating condition, a ramp signal is applied to the battery stack operating temperature to obtain signals for continuous cooling and continuous heating conditions. Based on the standard operating condition, ramp signals are superimposed on the cathode and anode pressures of the battery to obtain signals for continuous voltage reduction and continuous voltage increase conditions. At the same time, a perturbation signal characterizing signal fluctuations is applied, thereby generating fault samples and a training set.
[0124] S202, input the initial sample dataset into the battery model for prediction to obtain the sample dataset.
[0125] The sample dataset includes high temperature - excessively high temperature, low temperature - excessively low temperature, high pressure - excessively high pressure, low pressure - excessively low pressure, normal temperature - normal temperature, and normal pressure - normal pressure.
[0126] In this embodiment, after obtaining the adjusted battery model and the initial sample dataset obtained based on the above steps, the computer device can input the initial sample dataset into the battery model, perform prediction through the battery model, generate corresponding fault results, and then use the fault signals and corresponding fault results as the sample dataset. For example, the data label for the normal state is f0, simulating the normal operation of various sensors and actuators; the fault label for continuous battery cooling is f1, and the fault label for continuous battery heating is f2, simulating the failure of temperature sensors or actuators; the fault label for continuous battery depressurization is f3, and the fault label for continuous battery pressurization is f4, simulating the failure of pressure sensors or actuators. For example, the operating conditions can be manually changed to make the battery work in a fault mode to generate fault data.
[0127] The method described in this application embodiment is simple and convenient in generating sample datasets through battery models. Compared with traditional methods of experimenting on batteries, the above method also saves costs and improves the efficiency of sample acquisition.
[0128] In one embodiment, a method for training a fault diagnosis model based on a sample dataset is also provided, such as... Figure 6 As shown, the method includes:
[0129] S301, label the sample dataset with fault types based on the initial sample dataset to obtain the labeled dataset.
[0130] In this embodiment of the application, after the computer device obtains the initial sample dataset and the sample dataset, it performs one-to-one annotation on the sample dataset based on the initial sample dataset to obtain the annotated dataset. For example, fault data is labeled with fault type tags to form a fault data training set.
[0131] S302, the initial fault diagnosis model is trained based on the labeled dataset and sample dataset to obtain the fault diagnosis model.
[0132] The initial fault diagnosis model includes a classification sub-model. This classification sub-model can be constructed using either the Support Vector Machine (SVM) algorithm or the K-nearest neighbor algorithm.
[0133] In this embodiment of the application, after the computer device obtains the labeled dataset, it can input the labeled dataset and the sample dataset into the initial fault diagnosis model for training to obtain the fault diagnosis model. Optionally, such as Figure 7 The distribution of normal and fault data samples generated by the battery model is shown below. Figure 7The vertical axis represents the voltage residual corrected for internal resistance, and the horizontal axis represents the ohmic polarization residual. Specifically, the difference between the standard operating condition data and the fault condition data in the initial sample dataset can be calculated first. Then, the differenced data (residual values) can be input into the classification sub-model for training. By adjusting the parameters of the classification sub-model, the loss can be made to reach the threshold requirement, and finally, the fault diagnosis model can be obtained.
[0134] For example, after labeling the fault samples, it is necessary to extract their fault features to train the diagnostic model. Ohmic polarization and internal resistance correction voltage can effectively reflect the operating state of PEMFC and can be used to construct fault features. The diagnostic variables are defined as the residual values of internal resistance correction voltage and ohmic polarization compared with the standard operating conditions, as shown in Equation (18). Fault diagnosis is performed by combining the residual with the sample dataset.
[0135] To increase the reliability and universality of the data, additional perturbation signals were also applied to the fault data.
[0136]
[0137] The method for training a fault diagnosis model using the Support Vector Machine (SVM) algorithm is as follows: Using the SVM classification algorithm, fault data can be diagnosed, and the diagnosis results can be plotted as follows: Figure 8 As shown. The diagnostic results are basically consistent with the actual situation. The confusion matrix of the SVM diagnostic algorithm is shown below. Figure 9 As shown in the matrix, the accuracy of SVM in diagnosing sensor and actuator faults in the battery is 90.22%. The false alarm rate (FAR) is 0.648%, which represents the percentage of samples under normal conditions that are incorrectly diagnosed as fault categories.
[0138] The method for training a fault diagnosis model using the K-nearest neighbor algorithm is as follows: The K-nearest neighbor algorithm can be used to diagnose fault data, and the diagnosis results can be plotted as follows: Figure 10 As shown, the diagnostic results are basically consistent with the actual situation. Furthermore, the confusion matrix of the K-nearest neighbor classification algorithm was plotted, as shown below. Figure 11 As shown, the accuracy of the K-nearest neighbor classification algorithm can be further calculated. The accuracy of the K-nearest neighbor algorithm for fault diagnosis of PEMFC sensors and actuators is 89.93%, slightly lower than the SVM algorithm. The false alarm rate (FAR) is 0.429%, slightly lower than the SVM algorithm.
[0139] The above embodiments provide a model- and data-driven method for fuel cell fault diagnosis. By injecting faults into the battery model and labeling the fault data, a fault data training set is generated, effectively reducing the difficulty and complexity of simulating fault experiments and preparing training samples. A method is proposed that uses the residual values of internal resistance correction voltage and ohmic polarization compared to standard operating conditions as feature vectors, combined with classifier algorithms such as Support Vector Machine (SVM) and K-Nearest Neighbors (KNN) for fault diagnosis. This method can effectively diagnose abnormal operating temperature and pressure in fuel cells. Experimental verification shows that the accuracy of SVM and KNN algorithms reached 90.22% and 89.93%, respectively, with false alarm rates of 0.648% and 0.429%, respectively.
[0140] In one embodiment, a specific implementation method for obtaining diagnostic results is also provided, such as... Figure 12 As shown, step S102 above, "inputting the working signal into the fault diagnosis model for fault diagnosis and obtaining the diagnosis result," includes:
[0141] S401, acquire standard signal.
[0142] The standard signal is the signal under standard operating conditions.
[0143] In this embodiment of the application, when it is necessary to use a trained fault diagnosis model to diagnose battery faults, the computer device can obtain standard signals of the battery under standard operating conditions through sensors.
[0144] S402 inputs standard signals and working signals into the fault diagnosis model to perform fault diagnosis and obtain the diagnosis results.
[0145] In this embodiment of the application, after the computer device acquires the working signal based on step S101, it can directly input the standard signal and the working signal into the fault diagnosis model for fault diagnosis to obtain the diagnosis result. Optionally, the standard signal and the working signal can be preprocessed, and then the preprocessed signal can be input into the fault diagnosis model for fault diagnosis to obtain the diagnosis result.
[0146] In one embodiment, a specific implementation method for determining the diagnostic result based on a standard signal and a working signal is also provided, such as... Figure 13 As shown, step S402 above, "inputting the standard signal and the working signal into the fault diagnosis model to perform fault diagnosis and obtain the diagnosis result," includes:
[0147] S501 calculates the error between the standard signal and the working signal to obtain the signal error value.
[0148] In this embodiment of the application, after receiving the standard signal and the working signal, the computer device can perform error calculation on the standard signal and the working signal to obtain the signal error value. For example, the error between the standard internal resistance correction voltage and the current internal resistance correction voltage can be calculated to obtain the signal error value of the internal resistance correction voltage. As another example, the error between the standard ohmic polarization value and the current ohmic polarization value can be calculated to obtain the signal error value of the ohmic polarization value.
[0149] S502 inputs the signal error value into the fault diagnosis model for fault diagnosis and obtains the diagnosis result.
[0150] In this embodiment, after obtaining the signal error value, the computer device can input the signal error value into the fault diagnosis model for fault diagnosis and obtain the diagnosis result. Specifically, the computer device can preprocess the signal error value, including data cleaning, normalization, feature extraction, and other operations, to transform the signal error value into a feature vector that the model can recognize and process. Then, the feature vector is input into the fault diagnosis model to obtain the diagnosis result.
[0151] In one embodiment, a specific implementation method for obtaining diagnostic results using a fault diagnosis model is also provided, such as... Figure 14 As shown, step S102 above, "inputting the working signal into the fault diagnosis model for fault diagnosis and obtaining the diagnosis result," includes:
[0152] S601 inputs the working signal into the feature extraction network for feature extraction to obtain signal features.
[0153] The fault diagnosis model includes a feature extraction network and a fault classification network. Signal features include internal resistance-corrected voltage features and ohmic polarization features.
[0154] In this embodiment of the application, after the computer device obtains the working signal, it can input the working signal into the feature extraction network for feature extraction to obtain signal features. For example, the internal resistance correction voltage can be input into the feature extraction network for feature extraction to obtain the internal resistance correction voltage feature, and the ohmic polarization value can be input into the feature extraction network for feature extraction to obtain the ohmic polarization feature.
[0155] S602 inputs the signal characteristics into the fault classification network for fault classification and obtains the diagnostic results.
[0156] In this embodiment, after obtaining signal characteristics, the computer device can input these characteristics into a fault classification network. The network then classifies the signal characteristics to identify faults, resulting in a diagnostic result. For example, if the operating signal is high temperature, the diagnostic result is that the battery temperature is too high; in this scenario, the temperature sensor and actuator are faulty. If the operating signal is high voltage, the diagnostic result is that the battery pressure is too high; in this scenario, the pressure sensor and actuator are faulty.
[0157] In summary, based on all the above embodiments, a method for diagnosing battery faults is also provided, such as... Figure 15 As shown, the method includes:
[0158] S701, Obtain the initial sample dataset corresponding to different fault types. The initial sample dataset includes the battery voltage signal and / or temperature signal under different fault conditions.
[0159] S702, input the initial sample dataset into the battery model for prediction, and obtain the sample dataset.
[0160] S703, label the sample dataset with fault types based on the initial sample dataset to obtain the labeled dataset.
[0161] S704. The initial fault diagnosis model is trained based on the labeled dataset and the sample dataset to obtain the fault diagnosis model.
[0162] S705, acquire the operating signal of the battery under test; the operating signal includes the operating voltage and / or polarization voltage of the battery under test.
[0163] S706, acquire standard signal.
[0164] S707 performs error calculations on the standard signal and the working signal to obtain the signal error value.
[0165] S708 inputs the signal error value into the feature extraction network for feature extraction to obtain signal features.
[0166] S709 inputs the signal features into the fault classification network for fault classification to obtain the diagnostic results. The fault diagnosis model is trained based on a sample dataset; the sample dataset is generated using the battery model corresponding to the battery under test.
[0167] The methods described in each of the above steps have been described in the foregoing embodiments. For details, please refer to the foregoing descriptions. They will not be repeated here.
[0168] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0169] Based on the same inventive concept, this application also provides a battery fault diagnosis device for implementing the battery fault diagnosis method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more battery fault diagnosis device embodiments provided below can be found in the limitations of the battery fault diagnosis method described above, and will not be repeated here.
[0170] In one embodiment, such as Figure 16 As shown, a battery fault diagnostic device is provided, comprising:
[0171] The first acquisition module 10 is used to acquire the operating signal of the battery under test; the operating signal includes the operating voltage and / or polarization voltage of the battery under test.
[0172] The diagnostic module 11 is used to input the working signal into the fault diagnosis model to perform fault diagnosis and obtain the diagnosis result; the fault diagnosis model is trained based on the sample dataset; the sample dataset is generated by the battery model corresponding to the battery under test.
[0173] In one embodiment, the battery fault diagnostic device further includes:
[0174] The second acquisition module is used to acquire the initial sample dataset corresponding to different fault types; the initial sample dataset includes the voltage signal and / or temperature signal of the battery under different fault conditions.
[0175] The prediction module is used to input the initial sample dataset into the battery model for prediction, and obtain the sample dataset.
[0176] In one embodiment, the aforementioned battery fault diagnostic device includes:
[0177] The annotation module is used to annotate the sample dataset with fault types based on the initial sample dataset, resulting in an annotated dataset.
[0178] The training module is used to train the initial fault diagnosis model based on the labeled dataset and the sample dataset to obtain the fault diagnosis model.
[0179] In one embodiment, the diagnostic module 11 includes:
[0180] The acquisition unit is used to acquire standard signals.
[0181] The diagnostic unit is used to input standard signals and operating signals into the fault diagnosis model to perform fault diagnosis and obtain diagnostic results.
[0182] In one embodiment, the diagnostic unit includes:
[0183] The calculation subunit is used to perform error calculation on the standard signal and the working signal to obtain the signal error value.
[0184] The diagnostic subunit is used to input the signal error value into the fault diagnosis model to perform fault diagnosis and obtain the diagnosis result.
[0185] In one embodiment, the diagnostic subunit is specifically used to input the signal error value into a feature extraction network for feature extraction to obtain signal features; and to input the signal features into a fault classification network for fault classification to obtain a diagnostic result.
[0186] The modules in the aforementioned battery fault diagnosis device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0187] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0188] Acquire the operating signal of the battery under test; the operating signal includes the operating voltage and / or polarization voltage of the battery under test;
[0189] The working signal is input into the fault diagnosis model for fault diagnosis to obtain the diagnosis result; the fault diagnosis model is trained based on the sample dataset; the sample dataset is generated by the battery model corresponding to the battery under test.
[0190] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0191] Acquire the operating signal of the battery under test; the operating signal includes the operating voltage and / or polarization voltage of the battery under test;
[0192] The working signal is input into the fault diagnosis model for fault diagnosis to obtain the diagnosis result; the fault diagnosis model is trained based on the sample dataset; the sample dataset is generated by the battery model corresponding to the battery under test.
[0193] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0194] Obtain the initial sample dataset corresponding to different fault types; the initial sample dataset includes the voltage signal and / or temperature signal of the battery under different fault conditions.
[0195] The initial sample dataset is input into the battery model for prediction, resulting in the sample dataset.
[0196] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0197] The sample dataset is labeled with fault types based on the initial sample dataset to obtain the labeled dataset;
[0198] The initial fault diagnosis model is trained using the labeled dataset and the sample dataset to obtain the fault diagnosis model.
[0199] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0200] Acquire the operating signal of the battery under test; the operating signal includes the operating voltage and / or polarization voltage of the battery under test;
[0201] The working signal is input into the fault diagnosis model for fault diagnosis to obtain the diagnosis result; the fault diagnosis model is trained based on the sample dataset; the sample dataset is generated by the battery model corresponding to the battery under test.
[0202] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0203] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0204] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for diagnosing battery faults, characterized in that, The method includes: Acquire the operating signal of the battery under test; the operating signal includes the operating voltage of the battery under test and / or the polarization voltage of the battery under test; A standard signal is acquired, and the error between the standard signal and the working signal is calculated to obtain a signal error value. The signal error value is then input into a fault diagnosis model for fault diagnosis to obtain a diagnosis result. The fault diagnosis model is trained based on a sample dataset, which is generated by the battery model corresponding to the battery under test. The fault diagnosis model includes a feature extraction network and a fault classification network. The step of inputting the signal error value into the fault diagnosis model for fault diagnosis to obtain a diagnosis result includes: The signal error value is input into the feature extraction network for feature extraction to obtain signal features; the signal features are then input into the fault classification network for fault classification to obtain diagnostic results.
2. The method according to claim 1, characterized in that, The method for generating the sample dataset using the battery model corresponding to the battery under test includes: Obtain initial sample datasets corresponding to different fault types; the initial sample datasets include voltage and / or temperature signals of the battery under different operating conditions. The initial sample dataset is input into the battery model for prediction to obtain the sample dataset.
3. The method according to claim 2, characterized in that, The method for training the fault diagnosis model based on a sample dataset includes: Based on the initial sample dataset, the sample dataset is labeled with fault types to obtain the labeled dataset; The initial fault diagnosis model is trained based on the labeled dataset and the sample dataset to obtain the fault diagnosis model.
4. A battery fault diagnosis device, used to implement the battery fault diagnosis method as described in claim 1, characterized in that, The device includes: An acquisition module is used to acquire the operating signal of the battery under test; the operating signal includes the operating voltage of the battery under test and / or the polarization voltage of the battery under test; The diagnostic module is used to input the working signal into the fault diagnosis model for fault diagnosis and obtain the diagnostic result; the fault diagnosis model is trained based on the sample dataset; the sample dataset is generated by the battery model corresponding to the battery under test.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.
7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.