A power battery pack anomaly detection method and system combining a VAE model and OT algorithm constraint
Patent Information
- Application Number
- CN202410489591.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2044-04-23
AI Technical Summary
Existing over-limit warning technologies are unable to detect early minor anomalies in lithium battery packs in a timely and accurate manner. Furthermore, the difficulty in setting thresholds leads to numerous false alarms, and the mixing of various fault characteristics makes it difficult to distinguish between them, making it difficult to prevent major failures.
By combining variational autoencoder (VAE) and optimal transport (OT) algorithm, a VAE-OT anomaly detection model is constructed through multidimensional time-series signal detection. The optimal threshold is determined by using OT distance, enabling rapid and accurate detection of early potential anomalies in lithium battery packs.
It enables timely and accurate detection of early minor anomalies in lithium battery packs, reduces false alarm rates, and ensures the safe operation of battery packs. By learning potential patterns in data through VAE and matching data distribution through OT, it improves the accuracy and robustness of detection.
Smart Images

Figure CN118585931B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of anomaly detection technology for electric vehicle power battery packs, specifically a method and system for anomaly detection of power battery packs that combines variational autoencoder (VAE) and optimal transport. Background Technology
[0002] Safe operation is the primary consideration for lithium-ion battery packs in electric vehicle applications. Due to inherent component defects, improper use, and harsh operating conditions, coupled with the degradation and aging of the power battery performance, electric vehicle lithium-ion battery systems are prone to various types of failures, and even catastrophic accidents such as combustion and explosion. Anomaly detection technology can promptly identify abnormal battery conditions and optimize management, preventing more serious failures. This is of great significance for ensuring the safe, reliable, and stable operation of the battery system and the electric vehicle itself, as well as the safety of life and property of passengers.
[0003] Currently, although BMS (Battery Management System) has fault detection functions for over-limit alarms—that is, by monitoring whether changes in a certain electrical characteristic parameter of the battery, such as voltage, current, internal resistance, or capacity, exceed a preset threshold to determine whether a cell in the battery pack is in an abnormal or faulty state—it can usually only detect major abnormalities or faults such as overvoltage, overcurrent, and overheating. Limited by the complex structure and operating mechanism of lithium-ion battery systems, current over-limit early warning technologies still have two main shortcomings: First, the characteristics of early, minor abnormalities (faults) are hidden in multi-dimensional time series and are easily masked by noise, making them difficult to detect in a timely and accurate manner; second, threshold setting is difficult, as thresholds may vary significantly across different scenarios, operating conditions, and systems, leading to many false alarms. Furthermore, multiple faults can easily occur together, their characteristics mixed together, making them difficult to distinguish and thus difficult to set reasonable thresholds.
[0004] If early, minor anomalies are not detected in a timely and accurate manner, they will accumulate and develop during the subsequent use of the battery pack, further deteriorating and inducing major failures or even thermal runaway, resulting in uncontrollable consequences. Therefore, timely detection of early, minor anomalies in battery packs is crucial for preventing potential problems. Summary of the Invention
[0005] Purpose of the Invention: To address the problems of existing over-limit early warning technologies, such as the inability to detect early, minor anomalies (faults) in a timely and accurate manner, and the high number of false alarms due to difficulties in setting thresholds, this invention proposes a method and system for detecting anomalies in power battery packs that combines a variational autoencoder (VAE) and optimal transport. By utilizing multi-dimensional time-series signals, it can quickly and accurately detect all early potential anomalies that may lead to faults in lithium battery packs.
[0006] Technical solution: A method for detecting anomalies in power battery packs that combines VAE model and OT algorithm constraints, comprising the following steps:
[0007] Step 1: Obtain battery timing data during actual operation of the electric vehicle. The battery timing data includes normal battery timing data and abnormal battery timing data.
[0008] Step 2: Preprocess the battery timing data obtained in Step 1 to obtain preprocessed battery timing data;
[0009] Step 3: Take the preprocessed normal battery time series data to build the model training set, and take the preprocessed normal battery time series data and abnormal battery time series data of equal quantity to build the threshold training set and test set;
[0010] Step 4: Build the VAE-OT model and train it using the model training set to obtain the VAE-OT anomaly detection model;
[0011] Step 5: Input the threshold training set into the VAE-OT anomaly detection model to obtain the theoretical normal reconstruction dataset of normal battery time series data and abnormal battery time series data. Calculate the OT distance corresponding to the normal battery time series data and abnormal battery time series data in the threshold training set. Find the OT distance that maximizes the resolution of the abnormal battery time series data. Determine the hyperparameter λ in the VAE-OT anomaly detection model based on the OT distance to obtain the optimal threshold of the VAE-OT anomaly detection model.
[0012] Step 6: Use the test set to test the anomaly detection accuracy of the VAE-OT anomaly detection model adjusted in Step 5;
[0013] Step 7: Input the real-time battery timing data of the electric vehicle during operation into the tested VAE-OT anomaly detection model to obtain the real-time battery detection results.
[0014] Furthermore, the battery timing data includes: current timing data with timestamps, voltage timing data with timestamps, and temperature timing data with timestamps.
[0015] Furthermore, the preprocessing of the battery timing data obtained in step 1 specifically includes the following operations:
[0016] Delete empty and duplicate data rows;
[0017] The missing values are estimated using interpolation methods, and then imputed.
[0018] Perform normalization processing;
[0019] The sliding window method is used to process the battery time series data obtained in step 1 into a time window sequence dataset with each point aligned and the sampling point length consistent.
[0020] Furthermore, the VAE-OT model includes: a VAE reconfiguration model and an OT constraint model;
[0021] The VAE reconstruction model includes a GRU encoder and a GRU decoder. The GRU encoder, based on a GRU-based variational inference network, maps a multivariate observation sequence x with multiple time steps to a latent space that follows a certain probability distribution. The latent variable z is stored as a posterior distribution p(z|x) belonging only to the multivariate observation sequence x. By using KL divergence, the posterior distribution p(z|x) is constrained to conform as closely as possible to the given probability distribution. The normal distribution, where μ and σ 2 Let μ and σ represent the mean and variance of the posterior distribution in the latent space, respectively. 2 It is learned from the output of the GRU layer through two parallel dense layers using ReLU and SoftPlus activation functions respectively, and then obtained from a given posterior normal distribution using reparameterization techniques. Randomly sample latent variables z, and all latent variables z form the Z-space;
[0022] The decoder randomly selects elements from the Z-space distribution, based on the conditional probability distribution. The parameters generate reconstructed data similar to x.
[0023] The OT constraint model is used to calculate the multivariate observation sequence x and the reconstructed data. The OT distance between them.
[0024] Furthermore, the process of training the VAE-OT model using a model training set to obtain the VAE-OT anomaly detection model specifically includes:
[0025] The optimization objective of the VAE-OT model is to maximize ELBO and minimize the OT distance of the generated samples, expressed as:
[0026]
[0027] in:
[0028]
[0029] In the formula, λ represents the hyperparameters of the VAE-OT anomaly detection model. Let θ represent the loss function of the VAE reconstruction model, φ represent the encoder parameters, φ represent the decoder parameters, and x represent the input data. This indicates the expectation, and z represents a latent variable. This represents the conditional distribution of the data generated by the decoder. q represents the reconstructed data corresponding to the input data. θ (z|x) represents the distribution of latent variables given input data x, p φ (z) represents the prior distribution of the latent variable, D KL [q θ (z|x)||p φ [(z)] represents the distribution of latent variables generated by the encoder q θ (z|x) and prior distribution p φ KL divergence between (z);
[0030] P represents the loss function of the OT-constrained model. model P represents the sample distribution generated by the VAE reconstruction model. target This represents the distribution of normal data, where T represents the distribution from P. model To P target The joint distribution of Π(P) model ,P target ) represents P model and P target The set of all possible joint distributions between them. This represents a distance metric between the input data and the reconstructed data. It indicates a desire for the expected value.
[0031] Furthermore, the step of inputting real-time battery time-series data during electric vehicle operation into a tested VAE-OT anomaly detection model to obtain real-time battery detection results specifically includes:
[0032] Real-time battery time-series data during electric vehicle operation is input into a tested VAE-OT anomaly detection model to obtain corresponding reconstructed data;
[0033] Calculate the OT distance between the real-time battery time-series data and the corresponding reconstructed data during the operation of the electric vehicle;
[0034] The relationship between the OT distance and the optimal threshold is compared. If the OT distance is greater than the optimal threshold, the real-time battery detection result is abnormal; if the OT distance is not greater than the optimal threshold, the real-time battery detection result is normal.
[0035] This invention discloses a power battery pack anomaly detection system that combines VAE model and OT algorithm constraints, comprising:
[0036] The real-time battery timing data acquisition module is used to acquire real-time battery timing data during the operation of the electric vehicle.
[0037] The battery anomaly detection module is used to input the real-time battery time-series data obtained by the real-time battery time-series data acquisition module into the VAE-OT anomaly detection model to obtain the corresponding reconstructed data;
[0038] The battery anomaly determination module is used to calculate the OT distance between the real-time battery time-series data obtained by the real-time battery time-series data acquisition module and the reconstructed data obtained by the battery anomaly detection module, and compare the OT distance with the pre-determined optimal threshold. If the OT distance is greater than the optimal threshold, the real-time battery detection result is abnormal; if the OT distance is not greater than the optimal threshold, the real-time battery detection result is normal.
[0039] Furthermore, the VAE-OT anomaly detection model is constructed and trained according to the following steps:
[0040] Build a VAE-OT model;
[0041] Construct a model training set; use the model training set to train the VAE-OT model to obtain the VAE-OT anomaly detection model;
[0042] The VAE-OT model includes: a VAE reconstruction model and an OT constraint model;
[0043] The VAE reconstruction model includes a GRU encoder and a GRU decoder. The GRU encoder, based on a GRU-based variational inference network, maps a multivariate observation sequence x with multiple time steps to a latent space that follows a certain probability distribution. The latent variable z is stored as a posterior distribution p(z|x) belonging only to the multivariate observation sequence x. By using KL divergence, the posterior distribution p(z|x) is constrained to conform as closely as possible to the given probability distribution. The normal distribution, where μ and σ 2 Let μ and ρ represent the mean and variance of the posterior distribution in the latent space, respectively. 2 It is learned from the output of the GRU layer through two parallel dense layers using ReLU and SoftPlus activation functions respectively, and then obtained from a given posterior normal distribution using reparameterization techniques. Randomly sample latent variables z, and all latent variables z form the Z-space;
[0044] The decoder randomly selects elements from the Z-space distribution, based on the conditional probability distribution. The parameters generate reconstructed data similar to x.
[0045] The OT constraint model is used to calculate the multivariate observation sequence x and the reconstructed data. The OT distance between them.
[0046] Furthermore, the process of training the VAE-OT model using a model training set to obtain the VAE-OT anomaly detection model specifically includes:
[0047] The optimization objective of the VAE-OT model is to maximize ELBO and minimize the OT distance of the generated samples, expressed as:
[0048]
[0049] in:
[0050]
[0051] In the formula, λ represents the hyperparameters of the VAE-OT anomaly detection model. Let θ represent the loss function of the VAE reconstruction model, φ represent the encoder parameters, φ represent the decoder parameters, and x represent the input data. This indicates the expectation, and z represents a latent variable. This represents the conditional distribution of the data generated by the decoder. q represents the reconstructed data corresponding to the input data. θ (z|x) represents the distribution of latent variables given input data x, p φ (z) represents the prior distribution of the latent variable, D KL [q θ (z|x)||p φ [(z)] represents the distribution of latent variables generated by the encoder q θ (z|x) and prior distribution p φ KL divergence between (z);
[0052] P represents the loss function of the OT-constrained model. model P represents the sample distribution generated by the VAE reconstruction model. target This represents the distribution of normal data, where T represents the distribution from P. model To P target The joint distribution of Π(P) model ,P target ) represents Pmodel and P target The set of all possible joint distributions between them. This represents a distance metric between the input data and the reconstructed data. It indicates a desire for the expected value.
[0053] Furthermore, the optimal threshold is determined in advance by following these steps:
[0054] Construct a threshold training set;
[0055] The threshold training set is input into the VAE-OT anomaly detection model to obtain the theoretical normal reconstruction dataset of normal battery time series data and abnormal battery time series data. The OT distances corresponding to normal battery time series data and abnormal battery time series data in the threshold training set are calculated. The OT distance that maximizes the resolution of abnormal battery time series data is found. Based on this OT distance, the hyperparameter λ in the VAE-OT anomaly detection model is determined, and the optimal threshold of the VAE-OT anomaly detection model is obtained.
[0056] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0057] (1) The method of this invention combines VAE and OT. In the multidimensional time series anomaly detection task, VAE can effectively learn the potential patterns and features of data by mapping high-dimensional time series data to a low-dimensional latent space. It can identify abnormal data points by generating new samples that conform to the distribution and has good generalization ability and adaptability. The method of this invention adds OT constraints to the loss function of VAE, which solves the problem that the latent space of VAE is continuous and the data is generated by random sampling. Therefore, there is a certain uncertainty in the latent space of VAE, which will lead to the model's representation of abnormal data being unclear, thus affecting the accuracy of anomaly detection. The method of this invention uses the OT method to calculate the distance or similarity between the generated new samples and normal data samples, combining the reconstruction error of VAE and the distance or similarity calculated by OT. It comprehensively considers the reconstruction quality of data and the differences between data, thereby reconstructing the original normal data more accurately, achieving more accurate and robust anomaly detection, making the samples generated during training closer to the distribution of normal samples, thus more accurately identifying small potential anomalies during testing, effectively discovering and handling abnormal situations of battery packs in advance, and ensuring the safe operation of battery packs.
[0058] (2) In the training phase, the VAE model learns the latent representation of the data and the OT model learns the characteristics of the data distribution. In the data distribution matching phase, the OT method is used to match and align different data distributions. In the anomaly detection phase, the detection and location of abnormal data points are achieved by combining the reconstruction capability of VAE and the distribution matching capability of OT. Attached Figure Description
[0059] Figure 1 This is a schematic flowchart of a battery pack anomaly detection method combining Variational Autoencoder (VAE) and Optimal Transport (OT) according to the present invention.
[0060] Figure 2 This is a schematic diagram of the structure of a GRU-based VAE reconstruction model;
[0061] Figure 3 A schematic diagram of the VAE reconstruction model with added OT constraints. Detailed Implementation
[0062] The technical solution of the present invention will now be further described in conjunction with the accompanying drawings and embodiments.
[0063] Example 1:
[0064] This embodiment discloses a battery pack anomaly detection method combining Variational Autoencoder (VAE) and Optimal Transport (OT). This method can perform real-time anomaly detection of the power battery pack, improving the detection rate and reducing the false alarm rate. It mainly includes the following steps:
[0065] Step 1: Acquire normal and abnormal time-series data of the electric vehicle's power battery pack during operation. Data acquisition should cover as many normal and abnormal conditions as possible to ensure the model has sufficient generalization ability to accurately detect new anomalies. Specifically, normal time-series data includes normal data under various operating conditions to train the VAE-OT model, including but not limited to real-time monitoring data of basic parameters such as current, voltage, and temperature, as well as timestamp information, collected every 10 seconds. Abnormal time-series data includes various types of abnormal data under various operating conditions to help the model perform supervised learning, distinguish between normal and abnormal conditions, and set anomaly detection thresholds. This includes but is not limited to real-time monitoring data of basic parameters such as current, voltage, and temperature, as well as timestamp information, collected every 10 seconds.
[0066] Step 2: During data acquisition, transmission, and recording, issues such as missing data, duplicate data, outliers, and misaligned timestamps may arise in the original data due to equipment failure, human error, system failure, or data corruption. Therefore, it is necessary to preprocess both normal and abnormal time-series data to improve data quality and reliability, ensuring that the model can learn and predict accurately. This preprocessing includes, but is not limited to, the following operations: deleting empty and duplicate data rows, using interpolation methods (such as mean, median, and mode) to estimate missing values and perform imputation, normalization, and using the sliding window method to process the original data into a time window sequence dataset with aligned points and a sampling point length of 20.
[0067] Step 3: Divide the preprocessed data into a model training set, a threshold training set, and a test set. The specific division criteria are as follows: the data in the model training set consists entirely of normal time-series data, used for training the VAE-OT model; the threshold training set and the test set contain both normal and abnormal time-series data, and the number of normal and abnormal time-series data is equal; the threshold training set is used to determine the optimal threshold with the highest anomaly detection resolution; the test set is used to test the anomaly detection performance.
[0068] Step 4: Use Python to build such Figure 2 The VAE-OT model shown consists of two main parts: a GRU-based VAE reconfiguration model and an OT constraint model.
[0069] Among them, the GRU-based VAE reconstruction model, as a generative model, combines the ideas of autoencoder and variational inference to learn the latent representation of data and generate new data samples with similar features. The autoencoder consists of an encoder and a decoder. The encoder maps the input data to an encoded representation in the latent space, and the decoder maps this encoded representation back to the original data space to reconstruct the original data. An autoencoder is a method for approximating the posterior distribution of a probability model; its goal is to estimate the posterior distribution of model parameters given data and the model. In the GRU-based VAE reconstruction model, variational inference is used to estimate the probability distribution in the latent space of the encoder output.
[0070] Specifically, the encoder in the GRU-based VAE reconstruction model uses a GRU-based variational inference network to map a multivariate observation sequence x with multiple time steps to a latent space that follows a certain probability distribution (such as a Gaussian distribution). The latent variable z is stored as a posterior distribution p(z|x) belonging only to x. By using Kullback Leibler (KL) divergence, p(z|x) is constrained to conform as closely as possible to the desired probability distribution. The normal distribution, where μ and σ 2 Let represent the mean and variance of the posterior distribution in the latent space, respectively, and learn them from the output of the GRU layer through two parallel dense layers using ReLU and SoftPlus activation functions, respectively. Then, reparameterization techniques are used to learn from the determined posterior normal distribution. A random sample z is taken from the Z-space, and all z form the Z-space. The decoder randomly selects elements from the Z-space distribution according to the trained conditional probability distribution. The parameters generate reconstructed data similar to x.
[0071] The Optimal Transport (OT) constraint model, also known as Wasserstein distance, is a method for measuring the similarity between two probability distributions. Mathematically, the OT algorithm addresses the problem of optimally mapping one distribution to another, minimizing the cost of the mapping. Specifically, the OT constraint model measures the difference between the generated new samples and the normal data distribution by calculating the minimum transport cost, and uses this as part of the VAE loss function. When combined with a GRU-based VAE reconstruction model, the OT constraint model can further improve the model's performance and accuracy, providing a more powerful solution for complex data distribution matching and anomaly detection problems. The steps for processing multidimensional time series data using Optimal Transport (OT) can be briefly summarized as follows:
[0072] Data representation: Assume there are two multidimensional time series data sets consisting of a matrix X = {x1; x2; ...; x...} n} and Y = {y1; y2; ...; y m}, where row vectors It represents multidimensional data at each point in time, with each column in the matrix representing a time series of one dimension.
[0073] Cost matrix construction: Define the cost matrix based on the distance or similarity between two multidimensional time series data. Among them, C ij This indicates that time point x i Mapping to y jThe cost is represented by each element, where each element indicates the cost of mapping a time point from one sequence to another. Commonly used cost functions include L... p Distance, Euclidean distance, Mahalanobis distance, etc., can be used to construct the cost matrix, and the appropriate distance metric can be selected according to the specific application requirements.
[0074] Calculate the transportation plan: Define the transportation plan based on the cost matrix. Where, γ ij Indicates from x i to y j The transmission volume. The transmission plan needs to meet the following constraints:
[0075] Rows and constraints:
[0076]
[0077] Where, μ i x represents i The quality;
[0078] Columns and constraints:
[0079]
[0080] Among them, v i Indicates y j The quality;
[0081] Nonnegativity constraint: γ ij ≥0.
[0082] The transmission plan γ is calculated by solving the following optimization problem:
[0083] min r≥0 C,γ
[0084] Minimum total transmission cost that satisfies the constraints.
[0085] Calculate distance or similarity: Based on the transmission plan γ, calculate the transmission cost TC between two multidimensional time series data.
[0086]
[0087] Distance or similarity metric: Calculate the Wasserstein distance between two probability distributions based on the transmission cost TC. This distance represents the minimum cost required to transform one distribution into another.
[0088] Secondly, the OT method is used to calculate the observed sequence x and the reconstructed data. The distance or similarity between them.
[0089] Step 5: Train the VAE-OT model using the model training set to obtain the trained VAE-OT model; specific operations include:
[0090] The input data passes through the encoder and then through the hidden layers of the GRU neural network, eventually yielding the mean vector μ and variance vector σ in the latent space.
[0091] Then, a random vector z is sampled from the latent space, passed through the hidden layers of the neural network layer by layer via the decoder network, and finally the reconstructed data is generated.
[0092] To make the learned latent space more continuous and regular, KL divergence loss is introduced into the loss function to measure the difference between the distribution in the latent space and the standard normal distribution; at the same time, to make the generated samples closer to the distribution of normal samples, OT constraints are also introduced into the loss function.
[0093] Specifically, it includes:
[0094] The training objective of the GRU-based VAE reconstruction model is to maximize the variational lower bound (ELBO), which consists of two parts: reconstruction error and KL divergence. The reconstruction error measures the difference between the generated samples and the original data, while the KL divergence is used to keep the latent variable distribution close to the prior distribution. The loss function for training the VAE model is:
[0095]
[0096] In the formula, θ represents the encoder parameters, φ represents the decoder parameters, and x represents the given input data. This indicates the expectation, and z represents a latent variable. This represents the conditional distribution of the data generated by the decoder. q represents the reconstructed data corresponding to the input data. θ (z|x) represents the distribution of latent variables given input data x, p φ (z) represents the prior distribution of the latent variable, D KL [q θ (z|x)||p φ [(z)] represents the distribution of latent variables generated by the encoder q θ (z|x) and prior distribution p φ KL divergence between (z).
[0097] During the training of the GRU-based VAE reconstruction model, OT constraints are added to adjust the generated samples, making them closer to the normal data distribution. The expression for the OT constraint is:
[0098]
[0099] In the formula, P model P represents the sample distribution generated by the VAE reconstruction model. target This represents the distribution of normal data, where T represents the distribution from P. model To P target The joint distribution of Π(P) model ,P target ) represents P model and P target The set of all possible joint distributions between them. This represents the distance metric between two samples. It indicates a desire for the expected value.
[0100] In summary, the optimization objective of the VAE-OT model is to maximize ELBO and minimize the OptimalTransport distance of the generated samples:
[0101]
[0102] Where λ represents the hyperparameter that balances the two losses.
[0103] In this step, the model is trained using the model training set. The specific execution flowchart of the VAE-OT model is as follows: Figure 3 As shown in the diagram. First, the model training set is input into the reconstructed model composed of a GRU-based VAE network for training to determine the model parameters of each layer, thereby determining the VAE-OT model; the VAE-OT model framework diagram is shown below. Figure 3 As shown.
[0104] Step 6: The trained VAE-OT model reconstructs the threshold training set to obtain the theoretical normal reconstruction datasets corresponding to normal and abnormal data. The reconstruction errors for normal and abnormal data in the threshold training set are calculated separately. The distribution range of the reconstruction errors for normal and abnormal data in the threshold training set is analyzed. Clustering is used to find the reconstruction error value that maximizes the resolution of abnormal data. Based on this reconstruction error value, the hyperparameter λ is determined, thereby determining the optimal threshold for the VAE-OT model. After determining the optimal threshold, in subsequent runs, the presence of anomalies in the input data is determined by comparing the magnitude of the reconstruction errors between the input sample data and its reconstructed data with the threshold.
[0105] Step 7: After determining the optimal threshold, input the test set into the trained VAE-OT reconstruction model to obtain the corresponding reconstruction dataset. The presence of anomalies in the input data is determined by comparing the reconstruction error between the input sample data and its reconstructed data with the threshold. The anomaly detection result for the test set is obtained. If the error exceeds the optimal threshold, an anomaly is detected, and the electric vehicle should be stopped and powered off for further observation and inspection. If the error is below the optimal threshold, the battery pack can operate normally. This embodiment utilizes multi-dimensional time-series signals to quickly, accurately, and effectively detect all early potential anomalies that may lead to lithium battery pack failure. OT constraints are used to adjust the samples generated by the VAE to better match the original normal data distribution. When anomaly samples are processed by the trained VAE-OT model, their reconstruction error is amplified compared to using VAE alone, thus facilitating the identification of subtle potential anomalies and providing early warning of potential problems, ensuring the safe operation of the battery pack.
[0106] Example 2:
[0107] Based on Example 1, this example proposes a power battery pack anomaly detection system that combines VAE model and OT algorithm constraints, including:
[0108] The real-time battery timing data acquisition module is used to acquire real-time battery timing data during the operation of the electric vehicle.
[0109] The battery anomaly detection module is used to input the real-time battery time-series data obtained by the real-time battery time-series data acquisition module into the VAE-OT anomaly detection model to obtain the corresponding reconstructed data;
[0110] The battery anomaly determination module is used to calculate the OT distance between the real-time battery time-series data obtained by the real-time battery time-series data acquisition module and the reconstructed data obtained by the battery anomaly detection module, and compare the OT distance with the pre-determined optimal threshold. If the OT distance is greater than the optimal threshold, the real-time battery detection result is abnormal; if the OT distance is not greater than the optimal threshold, the real-time battery detection result is normal.
[0111] 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.
[0112] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. 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 patent application should be determined by the appended claims.
Claims
1. A method for detecting anomalies in power battery packs that combines VAE model and OT algorithm constraints, characterized in that: Includes the following steps: Step 1: Obtain battery timing data during actual operation of the electric vehicle. The battery timing data includes normal battery timing data and abnormal battery timing data. Step 2: Preprocess the battery timing data obtained in Step 1 to obtain preprocessed battery timing data; Step 3: Take the preprocessed normal battery time series data to build the model training set, take the preprocessed normal battery time series data and abnormal battery time series data of equal quantity to build the threshold training set, and take a portion of the preprocessed battery time series data to build the test set. Step 4: Build the VAE-OT model and train it using the model training set to obtain the VAE-OT anomaly detection model; Step 5: Input the threshold training set into the VAE-OT anomaly detection model to obtain the theoretical normal reconstruction dataset of normal battery time-series data and abnormal battery time-series data. Based on the theoretical normal reconstruction dataset, calculate the OT distance between the normal battery time-series data and the abnormal battery time-series data in the threshold training set. Find the OT distance that maximizes the resolution of the abnormal battery time-series data, and adjust the hyperparameters in the VAE-OT anomaly detection model according to this OT distance. The optimal threshold for the VAE-OT anomaly detection model was obtained; Step 6: Use the test set to test the anomaly detection accuracy of the VAE-OT anomaly detection model adjusted in Step 5; Step 7: Input the real-time battery timing data of the electric vehicle during operation into the tested VAE-OT anomaly detection model to obtain the real-time battery detection results; The VAE-OT model includes: a VAE reconstruction model and an OT constraint model; The VAE reconstruction model includes a GRU encoder and a GRU decoder; wherein, the GRU encoder, based on a GRU-based variational inference network, will construct multivariate observation sequences with multiple time steps. Mapped to a latent space that follows a certain probability distribution, latent variables Stored as belonging only to multivariate observation sequences posterior distribution By using KL divergence, the posterior distribution Constraints should be obeyed as much as possible. follows a normal distribution, where and Let represent the mean and variance of the posterior distribution in the latent space, respectively. and variance It is learned from the output of the GRU layer through two parallel dense layers using ReLU and SoftPlus activation functions respectively, and then obtained from a given posterior normal distribution using reparameterization techniques. Hidden variables in random sampling All hidden variables form space; The decoder from Elements are randomly selected from a spatial distribution, based on the conditional probability distribution. The parameters, generating and Similar reconstructed data ; The OT constraint model is used to calculate multivariate observation sequences. With reconstructing data OT distance between them; The method of training the VAE-OT model using a model training set to obtain the VAE-OT anomaly detection model specifically includes: The optimization objective of the VAE-OT model is to maximize ELBO and minimize the OT distance of the generated samples, expressed as: ; in: ; ; In the formula, This represents the hyperparameters of the VAE-OT anomaly detection model. This represents the loss function of the VAE reconstruction model. Indicates the parameters of the encoder, Indicates the parameters of the decoder. Indicates input data, Indicates the expectation. Represents latent variables. This represents the conditional distribution of the data generated by the decoder. This represents the reconstructed data corresponding to the input data. Indicates input data Distribution of latent variables under the given conditions This represents the prior distribution of the latent variables. Represents the distribution of latent variables generated by the encoder. and prior distribution KL divergence between them; This represents the loss function of the OT-constrained model. This represents the sample distribution generated by the VAE reconstruction model. This represents the distribution of normal data. Indicates from arrive The joint distribution express and The set of all possible joint distributions between them. This represents a distance metric between the input data and the reconstructed data. It indicates a desire for the expected value.
2. The method for detecting anomalies in a power battery pack combining VAE model and OT algorithm constraints as described in claim 1, characterized in that: The battery timing data includes: current timing data with timestamps, voltage timing data with timestamps, and temperature timing data with timestamps.
3. The method for detecting anomalies in a power battery pack combining VAE model and OT algorithm constraints as described in claim 1, characterized in that: The preprocessing of the battery timing data obtained in step 1 includes the following specific operations: Delete empty and duplicate data rows; The missing values are estimated using interpolation methods, and then imputed. Perform normalization processing; The sliding window method is used to process the battery time series data obtained in step 1 into a time window sequence dataset with each point aligned and the sampling point length consistent.
4. The method for detecting anomalies in a power battery pack combining VAE model and OT algorithm constraints as described in claim 1, characterized in that: The process of inputting real-time battery time-series data during electric vehicle operation into a tested VAE-OT anomaly detection model to obtain real-time battery detection results specifically includes: Real-time battery time-series data during electric vehicle operation is input into a tested VAE-OT anomaly detection model to obtain corresponding reconstructed data; Calculate the OT distance between the real-time battery time-series data and the corresponding reconstructed data during the operation of the electric vehicle; The relationship between the OT distance and the optimal threshold is compared. If the OT distance is greater than the optimal threshold, the real-time battery detection result is abnormal; if the OT distance is not greater than the optimal threshold, the real-time battery detection result is normal.
5. A power battery pack anomaly detection system combining VAE model and OT algorithm constraints, characterized in that: include: The real-time battery timing data acquisition module is used to acquire real-time battery timing data during the operation of the electric vehicle. The battery anomaly detection module is used to input the real-time battery time-series data obtained by the real-time battery time-series data acquisition module into the VAE-OT anomaly detection model to obtain the corresponding reconstructed data; The battery anomaly determination module is used to calculate the OT distance between the real-time battery time-series data obtained by the real-time battery time-series data acquisition module and the reconstructed data obtained by the battery anomaly detection module, and compare the OT distance with the pre-determined optimal threshold. If the OT distance is greater than the optimal threshold, the real-time battery detection result is abnormal; if the OT distance is not greater than the optimal threshold, the real-time battery detection result is normal. The VAE-OT anomaly detection model is constructed and trained according to the following steps: Build a VAE-OT model; Construct a model training set; use the model training set to train the VAE-OT model to obtain the VAE-OT anomaly detection model; The VAE-OT model includes: a VAE reconstruction model and an OT constraint model; The VAE reconstruction model includes a GRU encoder and a GRU decoder; wherein, the GRU encoder, based on a GRU-based variational inference network, will construct multivariate observation sequences with multiple time steps. Mapped to a latent space that follows a certain probability distribution, latent variables Stored as belonging only to multivariate observation sequences posterior distribution By using KL divergence, the posterior distribution Constraints should be obeyed as much as possible. follows a normal distribution, where and Let represent the mean and variance of the posterior distribution in the latent space, respectively. and variance It is learned from the output of the GRU layer through two parallel dense layers using ReLU and SoftPlus activation functions respectively, and then obtained from a given posterior normal distribution using reparameterization techniques. Hidden variables in random sampling All hidden variables form space; The decoder from Elements are randomly selected from a spatial distribution, based on the conditional probability distribution. The parameters, generating and Similar reconstructed data ; The OT constraint model is used to calculate multivariate observation sequences. With reconstructing data OT distance between them; The method of training the VAE-OT model using a model training set to obtain the VAE-OT anomaly detection model specifically includes: The optimization objective of the VAE-OT model is to maximize ELBO and minimize the OT distance of the generated samples, expressed as: ; in: ; ; In the formula, This represents the hyperparameters of the VAE-OT anomaly detection model. This represents the loss function of the VAE reconstruction model. Indicates the parameters of the encoder, Indicates the parameters of the decoder. Indicates input data, Indicates the expectation. Represents latent variables. This represents the conditional distribution of the data generated by the decoder. This represents the reconstructed data corresponding to the input data. Indicates input data Distribution of latent variables under the given conditions This represents the prior distribution of the latent variables. Represents the distribution of latent variables generated by the encoder. and prior distribution KL divergence between them; This represents the loss function of the OT-constrained model. This represents the sample distribution generated by the VAE reconstruction model. This represents the distribution of normal data. Indicates from arrive The joint distribution express and The set of all possible joint distributions between them. This represents a distance metric between the input data and the reconstructed data. It indicates a desire for the expected value.
6. The power battery pack anomaly detection system combining VAE model and OT algorithm constraints as described in claim 5, characterized in that: Determine the optimal threshold in advance by following these steps: Construct a threshold training set; The threshold training set is input into the VAE-OT anomaly detection model to obtain a theoretical normal reconstruction dataset of normal battery time-series data and abnormal battery time-series data. The OT distances corresponding to normal and abnormal battery time-series data in the threshold training set are calculated. The OT distance that maximizes the resolution of the abnormal battery time-series data is found, and the hyperparameters in the VAE-OT anomaly detection model are determined based on this OT distance. The optimal threshold for the VAE-OT anomaly detection model was obtained.
Citation Information
Patent Citations
Lithium battery anomaly detection method integrating variational auto-encoder and dynamic normalization
CN115469227A
