A battery analysis method
Through the solution of the polyal analysis of the battery working status and the steady distribution of the Marcov chain, combined with the analysis model of neural network failure, the problem of the accuracy of battery failure analysis in the existing technologies is low and insufficient generalized ability, and it has achieved more more High fault prediction accuracy and model generalization.
Patent Information
- Application Number
- CN202411045141.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-08-01
AI Technical Summary
The existing battery fault analysis methods have insufficient accuracy and generalization capabilities, especially when facing complex working environments and load conditions, pre-trained models are difficult to adapt to various situations in practical applications, resulting in a decrease in the accuracy of fault analysis. .
By analyzing the battery working status, statistical transfer probability of the transfer of battery work mode, and solving the steady -state distribution of the Malcov chain, build a neural network -based fault analysis model, combined with the working mode, key characteristics and combined characteristics, There is supervision and learning to improve the accuracy of fault prediction.
It improves the accuracy of battery failure probability prediction, enhances the generalization ability of the fault analysis model, and can more accurately capture the timing dependencies and dynamic evolution characteristics of battery faults.
Smart Images

Figure CN118962455B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of energy storage batteries, and in particular to a battery analysis method. Background Art
[0002] With the rapid development of new energy technologies, batteries have become a core component in various electronic devices, electric vehicles, energy storage systems and other fields. The reliability and safety of batteries are directly related to the operating stability and service life of the entire system. However, batteries often face complex and changeable working environments and load conditions in practical applications, and are prone to various faults and performance degradation problems, such as overcharge, overdischarge, overheating, short circuit, etc. These faults will not only lead to a decline in battery performance and shorten the service life, but may also cause safety accidents, resulting in serious economic losses and social impacts. Therefore, timely and accurate analysis of the working status of the battery and prediction of potential failure risks are of great significance to ensure the reliable operation and safe maintenance of the battery system.
[0003] Existing battery failure analysis methods mainly include methods based on empirical models, data-driven and machine learning. The empirical model-based method establishes an equivalent circuit model or electrochemical model of the battery, analyzes the internal parameters and state changes of the battery, and predicts the possibility of failure. However, such methods usually rely on expert experience and prior knowledge, and are difficult to adapt to the diversity and complexity of the battery working environment. The data-driven method uses various monitoring data collected during the operation of the battery, such as voltage, current, temperature, etc., and uses statistical analysis and data mining technology to discover the fault modes and laws hidden in the data. However, battery operation data usually has noise and redundancy, and the data quality and feature expression capabilities are limited, which affects the accuracy of fault analysis. Machine learning-based methods, such as support vector machines, decision trees, neural networks, etc., establish a mapping relationship between battery status and fault type by learning a large amount of historical data, and realize intelligent diagnosis and prediction of faults. However, these methods often regard the battery as a static system, ignore the dynamic evolution characteristics of the battery state, and find it difficult to capture the temporal dependency of battery failures, resulting in low prediction accuracy.
[0004] In the related art, for example, Chinese patent document CN117347869A provides a data analysis method, device, electronic device and medium for an energy storage battery management system. The present application obtains multiple initial data of the energy storage battery from the energy storage battery management system, and obtains multiple target data with high quality and accuracy from the multiple initial data. After obtaining the mean current data based on the battery current data, and obtaining the battery capacity change rate based on the battery working time data and the battery capacity data, the working mode of the energy storage battery is accurately identified based on the mean current data and the battery capacity change rate, thereby using the pre-trained fault analysis model based on the working mode and multiple target data. However, this scheme uses a pre-trained fault analysis model to perform fault analysis based on the working mode and target data. However, the working environment and load conditions of the battery are complex and changeable, and the pre-trained model may be difficult to adapt to various situations in actual applications, and the generalization ability is insufficient, resulting in a decrease in the accuracy of fault analysis. Summary of the invention
[0005] In response to the problem of low accuracy of battery fault analysis in the prior art, the present application provides a battery analysis method, which improves the accuracy of predicting battery failure probability by performing cluster analysis on the battery working status, counting the transition probability between battery working modes, and solving the steady-state distribution of the Markov chain.
[0006] Technical solution, the purpose of this application is achieved through the following technical solution.
[0007] The present application provides a battery analysis method, comprising: S1, obtaining battery data from an energy storage battery management system BMS, and preprocessing the collected data; wherein the data includes current, voltage, temperature, capacity, number of cycles and cumulative usage time; wherein the preprocessing includes data cleaning, outlier processing and data normalization; S2, extracting key features from the preprocessed data; wherein the key features include mean current, capacity change rate, temperature change rate, number of cycles and cumulative usage time; S3, constructing combined features based on the key features; wherein the combined features include an interaction term between mean current and temperature, and a ratio of capacity change rate to number of cycles; S4, constructing a combined feature based on the mean current, capacity change rate, temperature change rate, number of cycles and cumulative usage time. The change rate and temperature change rate are used to cluster the working state of the battery using the DBSCAN clustering algorithm to obtain the working mode division result of the battery; S5, according to the working mode obtained by clustering, the transition frequency between different working modes is counted, and the transition probability matrix is calculated. The transition probability matrix is used to characterize the probability of the battery switching between different working modes; S6, a fault analysis model based on a neural network is constructed, the working mode division results, key features and combined features are used as input, and the fault state of the battery is used as output. A supervised learning algorithm is used to train the fault analysis model; wherein the fault analysis model includes at least one of a logistic regression model, a decision tree model, a support vector machine model and a neural network model. S7, the battery data to be processed is input into the trained fault analysis model to predict the failure probability of the battery.
[0008] Among them, the mean current refers to the average value of the battery charge and discharge current within a certain period of time. It reflects the average working state and current level of the battery during the period. By calculating the mean current, we can understand the average working intensity of the battery and determine whether the battery is in an abnormal state such as overcharge or overdischarge. The capacity change rate indicates the degree of change of the battery capacity relative to the initial capacity. It can be calculated by dividing the difference between the current capacity and the initial capacity by the initial capacity. The capacity change rate reflects the health status and aging of the battery. As the battery is used, the capacity will gradually decay. The capacity change rate can quantify this decay trend and provide a basis for evaluating the remaining life of the battery. The temperature change rate indicates the rate of change of the battery temperature over time. It can be obtained by calculating the change in temperature per unit time. The temperature change rate reflects the thermal stability and heat dissipation performance of the battery. A high temperature change rate may mean that the battery has problems such as abnormal heating and poor heat dissipation, which need to be paid attention to. DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a density-based clustering algorithm. It can divide the data set into multiple clusters and noise points according to the density relationship of sample points. In the clustering of battery working status, the DBSCAN algorithm can automatically discover the typical working mode of the battery based on features such as mean current and capacity change rate. The working mode of the battery refers to the typical working state and behavior mode exhibited by the battery during actual use. Different working modes may correspond to different combinations of current, voltage, temperature and other features. By clustering the working status of the battery, the main working modes of the battery can be discovered and defined, such as normal working mode, overcharge mode, over-discharge mode, etc. The division of working modes helps to understand the actual use of the battery and provide a basis for fault diagnosis and health management. In supervised learning, the training data consists of input features and corresponding true labels. The algorithm continuously adjusts the model parameters to fit the mapping relationship of the training data by minimizing the error between the predicted value and the true label. Common supervised learning algorithms include decision trees, random forests, support vector machines, neural networks, etc. In battery fault analysis, supervised learning algorithms can be used to train fault analysis models with working modes, key features, etc. as inputs and fault status as outputs.
[0009] Further, S3, constructs a combined feature based on the key features; wherein the combined feature includes an interaction term between the mean current and the temperature, and a ratio of the capacity change rate to the number of cycles, including: multiplying the mean current by the temperature to obtain the interaction term data between the average current and the temperature; dividing the capacity change rate by the number of cycles to obtain the ratio data of the capacity change rate to the number of cycles; combining the interaction term data between the average current and the temperature, and the ratio data of the capacity change rate to the number of cycles to generate a combined feature.
[0010] Among them, the mean current is multiplied by the temperature to obtain a new feature. This interaction term captures the mutual influence between current and temperature. Generally, the operating current and temperature of the battery are interrelated. Higher current may lead to higher temperature, and temperature changes will affect the charge and discharge performance of the battery. By constructing the interaction term between current and temperature, the impact of the combined effect of current and temperature on the battery health status can be better characterized. The capacity change rate is divided by the number of cycles to obtain a new feature. This ratio feature reflects the rate of change of capacity per unit number of cycles. The capacity change of the battery is closely related to the number of cycles. As the number of cycles increases, the battery capacity usually decays gradually. However, the capacity decay rate of different batteries may be different. By calculating the ratio of the capacity change rate to the number of cycles, the influence of the number of cycles can be eliminated, and the speed of battery capacity decay can be more directly reflected, so as to better evaluate the health status of the battery. Combining the above two combined features with the original key features can obtain a more comprehensive and expressive feature set. The combined features provide information about the interaction and proportional relationship between the key features, which helps to mine potential patterns and laws in the data. In the subsequent battery working mode clustering and fault analysis model construction, the combined features can be used as input features and participate in calculation and modeling together with key features. By introducing combined features, the accuracy of clustering algorithm for dividing working modes and the ability of fault analysis model to predict battery health status can be improved.
[0011] Further, S4, according to the mean current and capacity change rate, a clustering algorithm is used to cluster the working state of the battery to obtain the working mode division result of the battery, including: S41, from the key features obtained in step S2, the mean current, capacity change rate and temperature change rate are obtained, and they are combined into three-dimensional data points to constitute the input data of the clustering algorithm; S42, by using the feature weight calculation method, the weight coefficients of the mean current, capacity change rate and temperature change rate are set; according to the weight coefficients, the weighted Euclidean distance between the three-dimensional data points is calculated; S43, the neighborhood radius ε and the neighborhood density threshold MinPts of the DBSCAN clustering algorithm are set; S44, for each input number Based on the points, calculate the number of data points in the corresponding ε-neighborhood; if the number of data points in the ε-neighborhood of the input data point is greater than or equal to MinPts, mark the corresponding input data point as a core point; S45, taking each core point as the starting point, recursively divide the core points and non-core points in the ε-neighborhood into the same cluster; wherein, the non-core points are divided into the cluster where the nearest core point is located; the input data points that are not divided into any cluster are marked as noise points; S46, according to the cluster division result, the cluster label to which each input data point belongs is used as the corresponding working mode category, and the noise point is used as an abnormal working state, and the working mode division result of the battery is output.
[0012] Specifically, the determination of the core point (step S44): when determining whether a data point is a core point, it is necessary to calculate the number of data points in the ε-neighborhood of the data point. The determination of whether a data point is in the ε-neighborhood of another data point is achieved by comparing the weighted Euclidean distance between the two data points with the size of the neighborhood radius ε. If the weighted Euclidean distance between the two data points is less than or equal to ε, they are considered to belong to each other's ε-neighborhood.
[0013] Formation of clusters (step S45): In the process of recursively dividing the core points and non-core points in the ε-neighborhood into the same cluster with the core point as the starting point, the weighted Euclidean distance is also needed to determine the neighborhood relationship between data points. For a core point, all data points (including core points and non-core points) in its ε-neighborhood will be divided into the cluster where the core point is located. And judging whether a data point is in the ε-neighborhood of the core point is also achieved by comparing the weighted Euclidean distance between them and the size of ε.
[0014] Attribution of non-core points (step S45): For non-core points, they need to be assigned to the cluster where the closest core point is located. The "closest distance" here is determined by comparing the weighted Euclidean distance between the non-core point and each core point. The non-core point will be assigned to the cluster where the core point with the smallest weighted Euclidean distance is located.
[0015] Further, S5, according to the working mode obtained by clustering, the transfer frequencies between different working modes are counted, and the transfer probability matrix is calculated. The transfer probability matrix is used to characterize the probability of the battery switching between different working modes, including: S51, according to the working mode division result of the battery, the transfer frequencies between different working modes are counted, and the transfer frequency matrix A is generated; wherein the matrix element a ij represents the frequency of transition from working mode i to working mode j; S52, generating a transition probability matrix P according to the transition frequency matrix A; wherein the element p_ij in the transition probability matrix P represents the probability of transition from working mode i to working mode j; wherein, for each row in the transition frequency matrix, it is divided by the sum of the elements in the row to obtain the transition probability; S53, regularizing the generated transition probability matrix P to obtain the regularized transition probability matrix P norm ; S54, according to the regularized transition probability matrix P norm , solve the steady-state distribution π of the Markov chain, and obtain the steady-state distribution of the battery under different working modes; S55, output the transfer probability matrix P norm and the steady-state distribution of the battery in different operating modesπ.
[0016] Among them, the transfer probability matrix is obtained by counting the transfer frequencies between different working modes, and performing probability calculation and regularization processing, which characterizes the probability characteristics of the battery switching between different working modes; the steady-state distribution reflects the long-term stable probability distribution of the battery under different working modes, providing a probabilistic basis for subsequent battery failure analysis. The dynamic characteristics of the battery working mode transfer are described by the Markov chain model, and the eigenvalue decomposition or numerical optimization method is used to solve the steady-state distribution according to the properties of the state transfer matrix. When the Markov chain meets the steady distribution conditions, the accurate steady-state distribution can be directly solved; when the steady distribution conditions are not met, the optimization method is used to estimate the steady-state distribution, which improves the applicability and robustness of the steady-state distribution calculation. The calculation results of the steady-state distribution provide long-term probability information for battery failure analysis.
[0017] Further, S54, according to the regularized transition probability matrix P norm , solve the steady-state distribution π of the Markov chain, and obtain the steady-state distribution of the battery in different working modes, including: converting the regularized transition probability matrix P norm As the state transfer matrix of the Markov chain, a Markov chain model of battery working mode transfer is constructed; the state transfer matrix P of the Markov chain norm Perform eigenvalue decomposition to determine whether the state transfer matrix meets the stationary distribution condition. The stationary distribution condition is that the maximum eigenvalue is unique and equal to 1. If the stationary distribution condition is met, then according to the state transfer matrix P norm Solve the corresponding left eigenvector, normalize the left eigenvector, and obtain the steady-state distribution π of the Markov chain; if the steady distribution condition is not met, the numerical optimization method is used to estimate the steady-state distribution π of the Markov chain; where the steady-state distribution π of the Markov chain refers to the probability distribution of each state converging to a stable probability distribution after the Markov chain has been in state transition for a sufficiently long time. The steady-state distribution π satisfies the equation π'=π×P, where P is the state transition matrix of the Markov chain. Under the steady-state distribution, the transition probability of the Markov chain between each state reaches equilibrium and no longer changes with time. In the Markov chain model of battery working mode transfer, the steady-state distribution π represents the long-term stable probability distribution of the battery under different working modes. By solving the steady-state distribution π, the relative frequency and importance of the battery in each working mode can be understood.
[0018] The stationary distribution condition means that the state transfer matrix P of the Markov chain satisfies certain mathematical properties, so that the Markov chain has a unique steady-state distribution π. The stationary distribution condition usually includes two requirements: the maximum eigenvalue of the state transfer matrix P is unique and equal to 1; the modulus of other eigenvalues of the state transfer matrix P is less than 1. A Markov chain that satisfies the stationary distribution condition is called an ergodic Markov chain, which ensures that the Markov chain will converge to a unique steady-state distribution π after a sufficiently long period of state transition. By judging whether the state transfer matrix P satisfies the stationary distribution condition, it can be determined whether the Markov chain of the battery working mode transfer has a steady-state distribution. The left eigenvector refers to the transposed matrix P of the state transfer matrix P. T For the eigenvalue λ, the left eigenvector v satisfies the equation vP T =λv. When the state transfer matrix P satisfies the stationary distribution condition, the left eigenvector corresponding to the maximum eigenvalue 1 (normalized) is the steady-state distribution π of the Markov chain. By solving the left eigenvector of the state transfer matrix P and normalizing it, the steady-state distribution π of the Markov chain can be directly obtained.
[0019] Numerical optimization methods refer to a class of methods that solve optimization problems through numerical calculations and iterative algorithms. In the steady-state distribution estimation of the Markov chain, if the state transfer matrix P does not meet the steady distribution conditions, the steady-state distribution π cannot be directly solved, and numerical optimization methods can be used for estimation. Common numerical optimization methods include gradient descent method, quasi-Newton method, interior point method, etc. These methods update the estimated value by iteration to gradually approach the true steady-state distribution π. In each iteration, according to the current estimated value and the optimization objective function (such as minimizing the difference between the estimated value and the true distribution), the optimization direction and step size are calculated, and the estimated value is updated until the convergence condition is reached. Numerical optimization methods provide a flexible and general steady-state distribution estimation scheme, which is suitable for situations where the state transfer matrix P does not meet the steady distribution conditions.
[0020] Preferably, S1, when the state transfer matrix P does not satisfy the stationary distribution condition, the steady-state distribution π of the Markov chain is estimated using the quasi-Newton method, including: initializing the estimated value π of the steady-state distribution 0 , usually uniform distribution or random distribution is selected as the initial value; define the optimization objective function f(π) to measure the difference between the estimated value π and the true steady-state distribution. Common objective functions include KL divergence, Euclidean distance, etc.; set the upper limit of the number of iterations max_iter and the convergence threshold tol as the stopping condition of the quasi-Newton method; initialize the approximate Hessian matrix H of the quasi-Newton method 0 , usually choose the identity matrix or a diagonal matrix.
[0021] S2, in each iteration, uses the quasi-Newton method to update the estimate of the steady-state distribution until the stopping condition is reached, including: calculating the current estimate π k The gradient g k , that is, the objective function f(π) is k The gradient of the search direction d is calculated by using the update formula of the quasi-Newton method. k , where d k =-H k -1 ×g k , H k is the current approximate Hessian matrix; adopt the line search strategy, along the search direction d k Find the appropriate step length a k , so that the objective function value f(π k +a k d k ) decreases; update the estimate of the steady-state distribution, π k+1 =π k +α k ×d k , and obtain a new estimated value π k+1 ; Using π k , π k+1 , g k and g k+1 , update the approximate Hessian matrix through the correction formula of the quasi-Newton method (such as BFGS, DFP, etc.) to obtain H k+1 ; Determine whether the stopping condition is met, that is, the number of iterations reaches max_iter or the change in the estimated value is less than the convergence threshold tol. If it is met, the iteration is terminated, otherwise it continues.
[0022] S3, after the iteration is terminated, the final estimated value π k As the estimated result of the Markov chain steady-state distribution, the estimated steady-state distribution π is obtained. est. By introducing the optimization objective function f(π), the estimation problem of the steady-state distribution is transformed into an optimization problem, the goal of which is to minimize the difference between the estimated value and the true distribution. The quasi-Newton method is used for optimization, and the gradient information and the approximate Hessian matrix are used to update the estimated value in each iteration, gradually approaching the true steady-state distribution. The appropriate step size is selected through the line search strategy, and a new estimated value that can reduce the objective function value is found in the search direction to improve the optimization efficiency. The correction formula of the quasi-Newton method (such as BFGS, DFP, etc.) is used to update the approximate Hessian matrix during the iteration process, gradually improve the approximate accuracy of the true Hessian matrix, and accelerate the convergence speed. The upper limit of the number of iterations and the convergence threshold are set as stop conditions to control the termination of the optimization process and avoid meaningless excessive iterations. By using the quasi-Newton method to estimate the steady-state distribution, the approximate solution of the Markov chain steady-state distribution can be obtained when the state transfer matrix P does not meet the stationary distribution conditions. The estimated steady-state distribution π est It provides an estimate of the long-term stable probability distribution of the battery under different operating modes, providing important prior information for subsequent battery health status analysis and prediction.
[0023] Furthermore, a numerical optimization method is used to estimate the steady-state distribution of the Markov chain, including: constructing an optimization objective function, the optimization objective is to minimize the difference between the state distribution and the product of the state transfer matrix; wherein the state distribution is the steady-state distribution π of the Markov chain to be estimated, and the state transfer matrix is the state transfer matrix P of the constructed Markov chain norm ; Based on the optimization objective function, calculate the gradient of the steady-state distribution; use the gradient descent algorithm to iteratively update the steady-state distribution π; set the iteration termination condition, after the iteration is terminated, update the current steady-state distribution π k as an estimate of the steady-state distribution of the Markov chain.
[0024] Furthermore, the expression of the optimization objective function is as follows:
[0025] The expression of the optimization objective function is as follows:
[0026] minimizeJ(π)=||π-πP norm || 2 +λ||π-π 0 || 2 +μ||π-π f || 2
[0027] Among them, π 0 is the prior distribution of battery failure mode, set according to historical failure data; fis the ideal distribution of battery failure modes, which represents the expected failure mode distribution and is set according to battery performance and safety requirements; and μ are balancing factors, which control the weights of the prior distribution term and the ideal distribution term, respectively.
[0028] Specifically, the first term in the objective function ||π-πP norm || 2 Represents the estimated steady-state distribution π and the current state transfer matrix P norm Minimizing this term can make the estimated steady-state distribution as consistent as possible with the current state transition characteristics, that is, it ensures the consistency of the estimated result with the currently observed battery working state transition law. At the same time, the second term λ||π-π 0 || 2 Introducing the prior distribution π 0 The influence of , which represents the difference between the estimated steady-state distribution and the prior distribution. Minimizing this term can make the estimation result take historical experience into account to a certain extent and avoid overfitting the current observation data. By adjusting the weights of these two terms by the balance factor λ, a balance can be achieved between the current state transition characteristics and historical experience, thus improving the robustness of the steady-state distribution estimation.
[0029] The weighting factor λ controls the influence of the prior distribution. The calculation is:
[0030] λ||π-π|| 0 2 =λ[(π 1 -π 01 ) 2 +(π 2 -π 02 ) 2 +......+(π n -π 0n ) 2 ), where π 0 is the n-dimensional prior
[0031] cloth vector. This term calculates the relationship between π and π 0 The squares of the differences at each element are summed and multiplied by a weighting factor λ.
[0032] Specifically, μ||π-π f || 2 Represents the steady-state distribution π and the ideal failure mode distribution π f The square of the weighted Euclidean distance between π-π f Represents the steady-state distribution π and the ideal failure mode distribution π f The difference vector between π and π f The difference between each element is an n-dimensional vector representing the element-by-element difference between the two distributions. f|| 2 Represents the square of the Euclidean norm (L2 norm) of a vector.
[0033] Specifically, the third term μ||π-π in the objective function f || 2 Introducing the ideal distribution π f The influence of represents the difference between the estimated steady-state distribution and the preset ideal distribution. By minimizing this term, the estimated steady-state distribution can be made as close to the ideal distribution as possible while satisfying the current state transition characteristics and historical experience. The ideal distribution can be set based on the expectations of the battery health state or expert knowledge, reflecting the expectation of the long-term stable working state of the battery. Introducing the ideal distribution constraint helps to guide the steady-state distribution estimation results to a healthier and more stable state, and improve the accuracy of battery fault prediction.
[0034] For a vector x=(x 1 ,x 2 ,......,x n ), the square calculation formula of its Euclidean norm is: It calculates the sum of the squares of the elements of the vector, indicating the length or size of the vector. μ is a positive real number, representing a weighting factor or a balancing factor, which is used to control the weight or importance of the item in the entire optimization objective function. μ||π-π f || 2 Represents the steady-state distribution π and the ideal failure mode distribution π f The weighted sum of the squares of the differences between π and π f The difference in each element is amplified by the square operation to amplify the impact of larger differences. The weighting factor μ controls the importance of this term in the entire optimization objective function. μ||π-π f || 2 As a regularization term, it is used to guide the steady-state distribution estimation result to approach the ideal failure mode distribution. By minimizing this term, the estimated steady-state distribution can be made as close as possible to the expected failure mode distribution, thereby improving the accuracy of fault diagnosis and prediction.
[0035] Furthermore, the gradient of the steady-state distribution is calculated by the following formula:
[0036] Where I is the n×n dimensional identity matrix, P norm T is the regularized state transfer matrix P norm transposed matrix; specifically, based on the original gradient term, the present application adds a gradient term of the difference between the steady-state distribution and the ideal fault mode distribution, and the gradient direction is affected by the transfer matrix, the prior distribution and the ideal distribution at the same time.
[0037] Furthermore, the steady-state distribution is updated by the following formula: Among them, v k represents the momentum term of the kth iteration, β is the momentum factor, which controls the influence of the historical gradient; α k represents the adaptive learning rate of the kth iteration, and uses AdaGrad, RMSprop or Adam optimization algorithm to adaptively adjust the learning rate. Specifically, in the iterative update process of the gradient descent algorithm, the momentum term and the adaptive learning rate are introduced to further optimize the convergence speed and stability.
[0038] Furthermore, the iteration termination condition includes any of the following:
[0039] k≥K max
[0040] |J(π k+1 )-J(π k )|≤ε
[0041] ||π k+1 -π k ||≤ε
[0042] ||πP norm -π||≤ε p
[0043] ||π-π f ||≤ε f
[0044] Among them, K max is the preset maximum number of iterations, and ε is the preset convergence threshold. When any of the above conditions is met, the iteration process is terminated and the current steady-state distribution estimate π is k As the estimated result of the Markov chain steady-state distribution; ε p is the threshold of battery failure mode transition stability, ε f is the similarity threshold between the steady-state distribution and the ideal failure mode distribution.
[0045] Compared with the prior art, the advantages of this application are:
[0046] By preprocessing the battery data and extracting key features, the noise and redundant information in the data are effectively eliminated, the data quality is improved, and the foundation is laid for subsequent analysis. At the same time, the introduction of combined features, such as the interaction term between average current and temperature, the ratio of capacity change rate to cycle number, etc., fully considers the mutual influence between different features, enhances the feature expression ability, and improves the accuracy of fault analysis.
[0047] The DBSCAN clustering algorithm is used to adaptively cluster the battery working status, overcoming the limitation of manually setting the number of clusters in traditional methods. By setting the neighborhood radius ε and the neighborhood density threshold MinPts, the clustering structure is automatically identified and the battery working mode is discovered, which improves the rationality and interpretability of the clustering results. The weighted Euclidean distance is introduced to give different features weight coefficients, highlighting the influence of key features and improving the clustering effect.
[0048] Based on the clustering results, the transition frequencies between different working modes are counted, and the transition probability matrix is constructed to characterize the dynamic transition characteristics of the battery working state. Furthermore, by solving the steady-state distribution of the Markov chain, the long-term stable probability distribution of the battery in different working modes is obtained, revealing the healthy evolution law of the battery and providing important prior information for fault prediction.
[0049] In the case where the transition probability matrix does not meet the stable distribution conditions, a numerical optimization method is used to estimate the steady-state distribution, which improves the applicability and robustness of the steady-state distribution estimation. By constructing an optimization objective function containing prior distribution terms and ideal distribution terms, and introducing a balance factor, while fitting the current state transition characteristics, it takes into account both historical experience and expected goals, making the steady-state distribution estimation more comprehensive and reliable.
[0050] In the iterative optimization process of estimating the steady-state distribution, adaptive learning rate adjustment strategies such as AdaGrad, RMSprop or Adam are used to dynamically adjust the step size of each iteration to accelerate the convergence speed. At the same time, a variety of iterative termination conditions are introduced to comprehensively evaluate the convergence of the optimization process, which improves the computational efficiency while ensuring the estimation accuracy.
[0051] The clustering results, key features and combined features are input into the neural network-based fault analysis model. The powerful nonlinear fitting ability of the neural network is used to establish a complex mapping relationship between the battery working state and the fault state. The model is trained by a supervised learning algorithm and the model parameters are adjusted adaptively, which improves the generalization ability and prediction accuracy of the fault analysis model. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 is an exemplary flow chart of a battery analysis method according to some embodiments of the present application;
[0053] Figure 2 is an exemplary flow chart of obtaining combined features according to some embodiments of the present application;
[0054] Figure 3 is an exemplary flow chart of obtaining the working mode division result of a battery according to some embodiments of the present application;
[0055] Figure 4 is an exemplary flow chart of outputting a probability transfer matrix according to clustering results according to some embodiments of the present application;
[0056] Figure 5 It is an exemplary flow chart for solving the steady-state distribution of a Markov chain according to some embodiments of the present application. DETAILED DESCRIPTION
[0057] The method and system provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0058] Figure 1 It is an exemplary flow chart of a battery analysis method shown in some embodiments of the present application, a battery analysis method, comprising: obtaining battery data from an energy storage battery management system BMS, and preprocessing the collected data; wherein the data includes current, voltage, temperature, capacity, number of cycles and cumulative usage time; extracting key features from the preprocessed data; wherein the key features include mean current, capacity change rate, temperature change rate, number of cycles and cumulative usage time; constructing combined features based on the key features; wherein the combined features include an interaction term between mean current and temperature, and a ratio of capacity change rate to cycle number; according to the mean current , capacity change rate and temperature change rate, and use the DBSCAN clustering algorithm to cluster the working status of the battery to obtain the working mode division result of the battery; according to the working mode obtained by clustering, the transition frequency between different working modes is counted, and the transition probability matrix is calculated. The transition probability matrix is used to characterize the probability of the battery switching between different working modes; a fault analysis model based on a neural network is constructed, and the working mode division results, key features and combined features are used as input, and the battery fault state is used as output. A supervised learning algorithm is used to train the fault analysis model; the battery data to be processed is input into the trained fault analysis model to predict the failure probability of the battery.
[0059] Obtain battery data from the energy storage battery management system BMS and pre-process the collected data; the data includes current, voltage, temperature, capacity, number of cycles and cumulative usage time; specifically, establish a communication connection with the energy storage battery management system BMS and regularly obtain real-time monitoring data of the battery from the BMS. BMS uses communication protocols such as CAN bus or RS485 to send battery monitoring data to the external system at a fixed frequency (such as 1Hz). Receive the battery monitoring data sent by BMS, parse the data frame, and extract key data fields, including: Current: indicates the charge and discharge current of the battery, in ampere (A), with an accuracy of 0.1A, and a data range of -1000A to 1000A; Voltage: indicates the port voltage of the battery, in volts (V), with an accuracy of 0.1V, and a data range of 0V to 5V; Temperature: indicates the surface temperature of the battery, in degrees Celsius (℃), with an accuracy of 0.1℃, and a data range of -50℃ to 100℃; Capacity: indicates the current remaining capacity of the battery, in ampere-hours (Ah), with an accuracy of 0.1Ah, and a data range of 0Ah to 1000Ah; Number of cycles: indicates the number of charge and discharge cycles of the battery, in times, with an accuracy of 1 time, and a data range of 0 times to 10,000 times; Cumulative usage time: indicates the cumulative working time of the battery, in hours (h), with an accuracy of 0.1h, and a data range of 0h to 50,000h.
[0060] The parsed and extracted battery monitoring data is preprocessed, including: data cleaning: detecting and eliminating abnormal values and invalid values, such as those exceeding the data range and data mutation; data normalization: mapping data of different dimensions to the same scale, such as using maximum and minimum value normalization to map the data to the [0, 1] interval; data smoothing: using sliding average, exponential smoothing and other methods to smooth the data to reduce data fluctuations and noise; data sampling: sampling the data at fixed time intervals (such as 1 minute) to obtain equally spaced time series data; converting the preprocessed battery monitoring data into a standardized data format, such as JSON or CSV format, and storing it in a local database or memory as input for subsequent data analysis.
[0061] Extract key features from the preprocessed data; the key features include mean current, capacity change rate, temperature change rate, number of cycles and cumulative usage time; extract key features from the preprocessed battery monitoring data according to a fixed time window (such as 1 hour). The selection of the time window needs to balance the amount of data and computational efficiency, while considering the time scale of battery performance changes. For the data in each time window, calculate the following key features: Mean current: represents the arithmetic mean of the battery current in the time window, reflecting the average charge and discharge intensity of the battery. The calculation formula is: I_avg = (ΣI_i) / N, where I_avg is the mean current, I_i is the current value of the i-th sampling point, and N is the number of sampling points in the time window. Capacity change rate: represents the relative change rate of the battery capacity in the time window, reflecting the decay rate of the battery capacity. The calculation formula is: C_rate = (C_end-C_start) / C_start, where C_rate is the capacity change rate, C_start is the battery capacity at the start of the time window, and C_end is the battery capacity at the end of the time window. Temperature change rate: indicates the relative change rate of the battery temperature within the time window, reflecting the change trend of the battery temperature. The calculation formula is: T_rate = (T_end-T_start) / T_start, where T_rate is the temperature change rate, T_start is the battery temperature at the start of the time window, and T_end is the battery temperature at the end of the time window. Number of cycles: indicates the number of charge and discharge cycles of the battery at the end of the time window, reflecting the battery life. The number of cycles is directly extracted from the monitoring data at the end of the time window. Cumulative use time: indicates the cumulative working time of the battery at the end of the time window, reflecting the battery use time. The cumulative use time value is directly extracted from the monitoring data at the end of the time window. The extracted key features are organized into time series data according to the order of the time window, and each time window corresponds to a set of key features to form a feature matrix. Each row of the feature matrix represents the feature vector of a time window, and each column represents the value of a key feature in different time windows. The feature matrix is standardized to map feature values of different orders of magnitude to similar scales to improve the comparability of features. Commonly used normalization methods include maximum and minimum value normalization, zero mean and unit variance normalization, etc. The standardized feature matrix is stored in the local database or memory as input for subsequent data analysis.
[0062] Figure 2It is an exemplary flow chart for obtaining combined features according to some embodiments of the present application, and a combined feature is constructed according to the key features; wherein the combined feature includes an interaction term between average current and temperature, and a ratio of capacity change rate to cycle number, and a combined feature reflecting battery performance is constructed based on the extracted key features. The combined feature is obtained by mathematically operating multiple key features, which can capture the interaction relationship and relative strength between key features and provide richer battery performance information. The interaction term feature of average current and temperature is constructed to reflect the joint effect of current and temperature on battery performance. The calculation formula is: IT_interaction = I_avg*T_avg, wherein IT_interaction is the interaction term between average current and temperature, I_avg is the mean current, and T_avg is the arithmetic mean of the battery temperature in the time window. The physical meaning of the interaction term is that current and temperature are two key factors affecting battery performance, and there is an interaction between them. Higher current will accelerate the heating of the battery, resulting in an increase in temperature; while higher temperature will accelerate the aging of the battery and reduce the battery capacity. The interaction term can quantitatively describe the joint effect of current and temperature.
[0063] Construct the ratio feature of capacity change rate and cycle number to reflect the battery capacity decay rate under unit cycle number. The calculation formula is: CC_ratio=C_rate / cycle_count, where CC_ratio is the ratio of capacity change rate to cycle number, C_rate is the capacity change rate, and cycle_count is the cycle number. The physical meaning of the ratio feature is that the decay of battery capacity is closely related to the number of cycles, but the capacity decay rate of different batteries may be different. By calculating the capacity change rate under unit cycle number, the capacity decay characteristics of different batteries can be compared in a standardized manner and batteries with abnormal capacity decay can be identified. The interaction feature (IT_interaction) of average current and temperature and the ratio feature (CC_ratio) of capacity change rate and cycle number are added to the generated feature matrix to form a new combined feature matrix. The combined feature matrix is standardized, and the interaction term and ratio features are mapped to a scale close to the key features to improve the comparability of the features. The standardized combined feature matrix is stored in the local database or memory, together with the generated key feature matrix, as subsequent input data.
[0064] Figure 3This is an exemplary flow chart for obtaining the working mode division result of the battery as shown in some embodiments of the present application. According to the mean current and capacity change rate, a clustering algorithm is used to cluster the working state of the battery to obtain the working mode division result of the battery, including: extracting the three features of mean current (I_avg), capacity change rate (C_rate) and temperature change rate (T_rate) from the generated key feature matrix, combining them into three-dimensional data points (I_avg, C_rate, T_rate) to form the input data set of the clustering algorithm. The feature weight calculation method is used to set the weight coefficients w_I, w_C and w_T of the mean current, capacity change rate and temperature change rate to reflect the importance of different features to the working state of the battery. The weight coefficient can be set according to expert experience or data analysis results to satisfy w_I+w_C+w_T=1.
[0065] Based on the weight coefficient, the weighted Euclidean distance d_ij between any two data points (x_i, y_i, z_i) and (x_j, y_j, z_j) in the input data set is calculated as the similarity measure of the clustering algorithm. The calculation formula is: d_ij = sqrt(w_I*(x_i-x_j)^2+w_C*(y_i-y_j)^2+w_T*(z_i-z_j)^2). The DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm is selected to cluster the input data set, and the clusters are divided according to the spatial density of the data points. Set two key parameters of the DBSCAN algorithm: neighborhood radius ε and neighborhood density threshold MinPts. ε defines the neighborhood range of the data point, which means the hypersphere area with the data point as the center and ε as the radius; MinPts defines the condition of the core point, which means that the number of data points in the neighborhood must be at least MinPts to be called a core point. For each data point in the input data set, calculate the number of data points in its ε-neighborhood. If the number of data points contained in the ε-neighborhood of a data point is greater than or equal to MinPts, mark the data point as a core point. Taking each core point as the starting point, recursively divide the data points that are density-reachable to it into the same cluster. For a core point, divide all core points and non-core points in its ε-neighborhood into the same cluster; for a non-core point, divide it into the cluster to which the nearest core point is located. Data points that are not divided into any cluster are marked as noise points, indicating an abnormal working state. According to the clustering results, the cluster label to which each input data point belongs is used as the working mode category of the battery in the corresponding time window to generate the battery working mode division results.
[0066] Specifically, the DBSCAN clustering algorithm is used to perform cluster analysis on the working state of a battery to obtain the working mode division results of the battery, wherein the key feature data obtained are shown in Table 1:
[0067] Table 1 Key characteristic data
[0068] Sampling number I_avg (average current) C_rate (capacity change rate) T_rate (temperature change rate) 1 0.25 -0.02 0.05 2 0.18 -0.01 0.03 3 0.32 -0.03 0.08 4 0.05 -0.05 0.01 5 0.28 -0.02 0.06 6 0.20 -0.01 0.04 7 0.35 -0.04 0.09 8 0.08 -0.06 0.02 9 0.30 -0.03 0.07 10 0.22 -0.02 0.05
[0069] Combine I_avg (mean current), C_rate (capacity change rate) and T_rate (temperature change rate) into three-dimensional data points to form the input data set of the DBSCAN clustering algorithm. Set the weight coefficients of mean current, capacity change rate and temperature change rate to: w_I = 0.5, w_C = 0.3, w_T = 0.2, satisfying w_I + w_C + w_T = 1. Calculate the weighted Euclidean distance between any two data points in the input data set based on the weight coefficients. Set the neighborhood radius ε = 0.05 and the neighborhood density threshold MinPts = 3 for the DBSCAN clustering algorithm. For each input data point, calculate the number of data points in its ε-neighborhood. Taking the first data point (0.25, -0.02, 0.05) as an example, its ε-neighborhood contains the fifth data point (0.28, -0.02, 0.06) and the tenth data point (0.22, -0.02, 0.05). The number of data points is 2, which is less than MinPts. Therefore, the first data point is not a core point. Taking each core point as the starting point, clustering is performed recursively. Through calculation, it can be found that the third data point (0.32, -0.03, 0.08), the seventh data point (0.35, -0.04, 0.09) and the ninth data point (0.30, -0.03, 0.07) are core points, and the data points in their ε-neighborhood can be divided into the same cluster. The 4th data point (0.05, -0.05, 0.01) and the 8th data point (0.08, -0.06, 0.02) do not belong to the ε-neighborhood of any core point and are marked as noise points. The remaining data points are divided into corresponding clusters according to the distance from the nearest core point. According to the cluster division results, the output battery working mode division results are shown in Table 2, where 1 represents the first normal working mode, 2 represents the second normal working mode, and -1 represents the abnormal working state (noise point):
[0070] Table 2 Battery working mode classification results
[0071]
[0072] According to the working mode obtained by clustering, the steady-state distribution of the battery is obtained, and the battery works according to the obtained distribution. Figure 4This is an exemplary flow chart for outputting a probability transfer matrix based on clustering results as shown in some embodiments of the present application. According to the mode division results, the transfer frequencies between different working modes are counted to generate a transfer frequency matrix A. If the battery has m working modes, A is an m×m dimensional matrix, and the matrix element a_ij represents the number of times the battery transfers from working mode i to working mode j in a given data set. According to the transfer frequency matrix A, the transfer probability matrix P is calculated. For the element p_ij in the matrix P, the calculation formula is: p_ij=a_ij / Σ_ja_ij, where Σ_ja_ij represents the sum of the elements in the i-th row of the matrix A, that is, the total transfer frequency of the battery in working mode i. This step normalizes the transfer frequency to the transfer probability, ensuring that for each working mode i, Σ_jp_ij=1.
[0073] The generated transition probability matrix P is regularized to obtain the regularized transition probability matrix P_norm. The regularization process includes: for each element p_ij in P, add a small positive constant ε to obtain p_ij'=p_ij+ε. This can avoid the transition probability being 0 and improve numerical stability. Each row of P is normalized to ensure that Σ_jp_ij'=1. After normalization, the regularized transition probability matrix P_norm is obtained.
[0074] Figure 5 It is an exemplary flow chart for solving the steady-state distribution of the Markov chain shown in some embodiments of the present application, and the regularized transfer probability matrix P_norm is used as the state transfer matrix of the Markov chain to construct a Markov chain model for the battery working mode transfer. Then, by performing eigenvalue decomposition on the state transfer matrix, it is determined whether the stationary distribution condition is met, and the steady-state distribution of the Markov chain is solved according to the decomposition result. If the battery has m working modes, the regularized transfer probability matrix P_norm is an m×m dimensional matrix. Using P_norm as the state transfer matrix of the Markov chain means that the transfer of the battery between different working modes satisfies the Markov property, that is, the working mode at the next moment is only related to the working mode at the current moment, and has nothing to do with the previous working mode. The state transfer matrix P_norm is eigenvalue decomposed to obtain eigenvalues λ_1, λ_2,..., λ_m and corresponding eigenvectors v_1, v_2,..., v_m. According to the Perron-Frobenius theorem, if P_norm is an irreducible non-negative matrix, then its largest eigenvalue λ_1 is unique and all components of the corresponding eigenvector v_1 are positive.
[0075] Determine whether the maximum eigenvalue λ_1 is unique and equal to 1 to determine whether the state transfer matrix P_norm satisfies the stationary distribution condition: If the maximum eigenvalue λ_1 is unique and equal to 1, the state transfer matrix P_norm satisfies the stationary distribution condition. This means that the Markov chain has a unique steady-state distribution π, which is independent of the initial state distribution. If the maximum eigenvalue λ_1 is not unique or not equal to 1, the state transfer matrix P_norm does not satisfy the stationary distribution condition. In this case, the state distribution of the Markov chain may have periodic changes or converge to multiple different distributions.
[0076] When the state transfer matrix P_norm satisfies the stationary distribution condition, the steady-state distribution π of the Markov chain can be obtained by solving the left eigenvector of the state transfer matrix. The left eigenvector π satisfies the following equation: πP_norm=π, where π is a 1×m-dimensional row vector, which represents the steady-state distribution probability of the Markov chain in m states. The left eigenvector π can be solved using numerical algorithms such as the power method, inverse power method, or Krylov subspace method. The solved left eigenvector π may not be normalized, and it needs to be normalized to satisfy the probability distribution condition of Σ_iπ_i=1. The normalized left eigenvector is the steady-state distribution π of the Markov chain. Through the above steps, it can be determined whether the Markov chain of the battery working mode transfer has a steady-state distribution, and the steady-state distribution π is solved. The steady-state distribution π represents the average proportion or time proportion of the battery in each working mode during long-term operation. This information can reflect the actual working state and usage characteristics of the battery, and provide an important basis for battery health status assessment and remaining life prediction.
[0077] In the Markov chain model of battery working mode transfer, if the state transfer matrix P_norm does not meet the stationary distribution condition, the numerical optimization method can be used to estimate the steady-state distribution π of the Markov chain. The specific implementation method is as follows: Construct an optimization objective function J(π), which represents the difference between the state distribution and the product of the state transfer matrix, as well as the difference with the prior distribution and the ideal distribution: J(π) = ∥π-πP_norm∥^2+λ∥π-π0∥^2+μ∥π-πf∥^2, the first term ∥π-πP_norm∥^2 represents the difference between the state distribution π and the product of the state transfer matrix P_norm, and this term is zero when π meets the steady-state distribution condition of the Markov chain. The second term λ∥π-π0∥^2 represents the difference between the estimated steady-state distribution π and the prior distribution π0. The introduction of the prior distribution can improve the stability and robustness of the estimate. The prior distribution π0 can be set according to the historical working data of the battery or expert experience. The third term μ∥π-πf∥^2 represents the difference between the estimated steady-state distribution π and the ideal distribution πf. Introducing the ideal distribution can guide the estimation results to optimize in the desired direction. The ideal distribution πf can be set according to battery performance and safety requirements.
[0078] Compute the gradient of the steady-state distribution The gradient calculation formula is: (I-P_norm^T)+2λ(π-π0)+2μ(π-πf), where I is the unit matrix and P_norm^T is the transposed matrix of the state transfer matrix P_norm. The gradient descent algorithm is used to iteratively update the steady-state distribution π to reduce the value of the optimization objective function. The update formula is: π^(k+1)=π^k-α^kv^(k+1), where v^k represents the velocity term of the kth iteration, β is the momentum factor, which controls the influence of the historical gradient; α^k represents the learning rate of the kth iteration, which can be a constant learning rate or an adaptive learning rate (such as AdaGrad, RMSprop, Adam, etc.).
[0079] The iteration termination condition is set. When any of the following conditions is met, the iteration process is terminated: the number of iterations reaches the preset maximum number of iterations K_max; the change in the objective function value is less than the preset threshold ε, that is, |J(π^(k+1))-J(π^k)|≤ε; the change in the state distribution is less than the preset threshold ε, that is, ∥π^(k+1)-π^k∥≤ε; the difference between the state distribution and the product of the transfer matrix is less than the preset threshold ε_p, that is, ∥πP_norm-π∥≤ε_p; the difference between the state distribution and the ideal distribution is less than the preset threshold ε_f, that is, ∥π-πf∥≤ε_f. The state distribution at the termination of the iteration is used as the estimated value of the steady-state distribution of the Markov chain. By introducing the prior distribution and the ideal distribution, and combining the gradient descent algorithm, the steady-state distribution of the Markov chain can be estimated when the state transfer matrix does not meet the steady distribution conditions. This numerical optimization method comprehensively considers the consistency, prior knowledge and expected characteristics of the state distribution and the transfer matrix, and can obtain more stable and reasonable estimation results.
[0080] Specifically, according to the battery working mode classification results identified in Table 2, the transfer frequencies between different working modes are counted to generate a transfer frequency matrix A, as shown in Table 3:
[0081] Table 3 Transfer frequency matrix A
[0082] Mode-1 Mode 1 Mode 2 Mode-1 0 1 1 Mode 1 1 2 2 Mode 2 1 2 1
[0083] From the data, we can see that the battery has transitions between different working modes. For example, the transition from mode-1 to mode 1 and mode 2 occurred once each, the transition from mode 1 to mode-1 occurred once, the transition within mode 1 occurred twice, the transition from mode 1 to mode 2 occurred twice, and so on.
[0084] According to the transfer frequency matrix A, the transfer probability matrix P is generated, see Table 4:
[0085] Table 4 Transition probability matrix P
[0086]
[0087]
[0088] The transfer probability matrix P represents the probability of the battery transferring from one working mode to another. For example, when the battery is in mode -1, the probability of transferring to mode 1 and mode 2 is 0.5; when the battery is in mode 1, there is a 0.2 probability of transferring to mode -1, a 0.4 probability of remaining in mode 1, and a 0.4 probability of transferring to mode 2; and so on. The transfer probability matrix P is regularized to obtain the regularized transfer probability matrix P_norm. Regularization can ensure that the sum of each row element of the transfer probability matrix is 1, which meets the requirements of probability distribution. The regularized transfer probability matrix P_norm is used as the state transfer matrix of the Markov chain to construct a Markov chain model for battery working mode transfer. The state transfer matrix P_norm is eigenvalue decomposed: λ_1=1.0000, λ_2=0.2463, λ_3=-0.2413, the maximum eigenvalue λ_1 is unique and equal to 1, which meets the stationary distribution condition. Solve the left eigenvector corresponding to the state transfer matrix P_norm and normalize it to obtain the steady-state distribution π of the Markov chain: π = [0.1982, 0.4059, 0.3959]. The steady-state distributions of the battery in the three working modes are: Mode-1: 19.82%; Mode 1: 0.59%; Mode 2: 39.59%.
[0089] Output the normalized transition probability matrix P_norm and the steady-state distribution π of the battery in different working modes. In another embodiment, the transition frequency matrix A is shown in Table 5:
[0090] Table 5 Transfer frequency matrix A
[0091] Mode 1 Mode 2 Mode 3 Mode 1 12 5 3 Mode 2 6 18 4 Mode 3 2 3 9
[0092] According to the transfer frequency matrix A, the transfer probability matrix P is calculated, see Table 6:
[0093] Table 6 Transition probability matrix P
[0094] Mode 1 Mode 2 Mode 3 Mode 1 0.6 0.25 0.15 Mode 2 0.2142 0.6428 0.143 Mode 3 0.143 0.2142 0.6428
[0095] The transition probability matrix P is regularized to obtain the regularized transition probability matrix P_norm as shown in Table 7:
[0096] Table 7 Regularized transition probability matrix P_norm
[0097] Mode 1 Mode 2 Mode 3 Mode 1 0.6 0.25 0.15 Mode 2 0.2142 0.6428 0.143 Mode 3 0.143 0.2142 0.6428
[0098] The regularized transfer probability matrix P_norm is used as the state transfer matrix of the Markov chain; the state transfer matrix P_norm is decomposed by eigenvalue, and the eigenvalues are obtained: λ_1=1.0000, λ_2=1.0000, λ_3=0.4000. The maximum eigenvalue is not unique and does not meet the stationary distribution condition. Since the stationary distribution condition is not met, the steady-state distribution π of the Markov chain is estimated by numerical optimization method; the prior distribution π0 and the ideal distribution πf are adjusted: π0=[0.35, 0.40, 0.25], πf=[0.25, 0.45, 0.30]. Adjust the optimization algorithm parameters: maximum number of iterations K_max = 1500, convergence threshold ε = 1e-7, balance factor λ = 0.15, μ = 0.25, momentum factor β = 0.85, initial learning rate α = 0.008; use the gradient descent algorithm to iteratively update the steady-state distribution π, calculate the gradient of the optimization objective function, and obtain the estimated value of the steady-state distribution according to the iteration termination condition: π_est = [0.2837, 0.4421, 0.2742]. Since the maximum eigenvalue is still not unique, the numerical optimization method can continue to be used to estimate the steady-state distribution.
[0099] Construct a fault analysis model based on a neural network, take the work mode division results, key features and combined features as input, take the battery fault status as output, and use a supervised learning algorithm to train the fault analysis model; Specifically, prepare training data: combine the work mode division results, key features and combined features into an input feature vector; collect battery fault status information, such as normal, mild fault, severe fault, etc., as output labels; and form a training data set with the input feature vector and the corresponding output label. Feature preprocessing: standardize or normalize the input features to make them consistent in scale; perform feature selection or dimensionality reduction as needed, remove redundant or irrelevant features, and improve the generalization performance of the model.
[0100] Select machine learning algorithms suitable for battery fault analysis, such as decision trees, random forests, support vector machines, neural networks, etc.; build a fault analysis model based on neural networks, such as: decision tree model: adjust the maximum depth of the tree, the minimum number of samples of leaf nodes, partition quality metrics and other parameters; random forest model: adjust the number of trees, the maximum number of features, sample sampling ratio and other parameters; support vector machine model: select different kernel functions (such as linear kernel, Gaussian kernel), adjust regularization parameters and kernel function parameters; neural network model: design different network structures (such as the number of layers, the number of neurons per layer), select activation functions, regularization methods, etc. Use k-fold cross validation or holdout method to divide the training data set into training set and validation set; use the training set data to train the constructed fault analysis model, and use supervised learning algorithms to optimize model parameters; evaluate the performance of the model on the validation set, such as accuracy, precision, recall, F1 score and other indicators; according to the validation results, further adjust the structure and parameters of the model to improve the generalization performance of the model. Integrate multiple trained fault analysis models, such as using voting, averaging, weighted averaging, etc. The integrated model usually has higher robustness and generalization performance than a single model. Evaluate the performance of the integrated fault analysis model on an independent test set to verify its effectiveness in practical applications; analyze the model's error samples and identify possible improvement directions, such as introducing new features and optimizing the model structure.
[0101] Specifically, the present application adopts a random forest model as a machine learning model for battery fault analysis, including: collecting and organizing historical working data of the battery, including feature data (such as current, voltage, temperature, etc.) and corresponding fault label data; preprocessing the data, such as removing outliers, processing missing values, normalizing data, etc.; dividing the data set into a training set, a validation set, and a test set. Analyze and select key features related to battery failures, such as mean current, capacity change rate, temperature change rate, etc.; perform operations such as feature combination and feature conversion to construct a more effective feature representation. Determine the basic parameters of the random forest, such as the number of decision trees, the maximum depth of each tree, the minimum number of leaf node samples, the feature sampling ratio, etc.; use the Bootstrap sampling method to randomly extract a sample subset from the training set to construct multiple decision trees; when constructing each decision tree, use a random feature subset (usually the square root of the total number of features) to perform node division to improve the randomness and diversity of the model; during the growth of the decision tree, no pruning operation is performed to allow each tree to grow to the maximum depth as much as possible. Use the training set data to train the random forest model, and use the decision tree integration strategy (such as majority voting) to predict the fault label of the sample; evaluate the performance of the model on the validation set, and use indicators such as accuracy, precision, recall, and F1 score to measure the classification effect of the model; adjust the hyperparameters of the random forest (such as the number of decision trees, maximum depth, minimum number of samples of leaf nodes, etc.) through grid search or random search methods to find the optimal parameter combination; retrain the random forest model with the tuned hyperparameters to obtain the final battery fault analysis model. Evaluate the performance of the trained random forest model on an independent test set to verify its generalization ability on unknown data; analyze the model's misclassified samples and identify possible improvement directions, such as introducing new features and adjusting sample weights; calculate feature importance, evaluate the contribution of each feature to battery fault prediction, and select the most discriminative feature subset. Deploy the trained random forest model to the actual battery fault analysis system to perform real-time fault prediction on newly collected battery data; regularly collect new battery working data and fault labels, retrain and update the model to adapt to changes in the battery usage environment and new fault types.
[0102] Input the battery data to be processed into the trained fault analysis model to predict the failure probability of the battery. Specifically, obtain the battery data to be processed, such as time series data such as current, voltage, and temperature; perform preprocessing operations such as denoising and removing outliers on the data to make it consistent with the format of the model training data. Based on the preprocessed battery data, extract the key features and combined features that are the same as the model training data; combine the extracted features into a feature vector consistent with the model input. Input the extracted feature vector into the trained working mode division model (such as a clustering model); obtain the division results of the battery data under different working modes. Input the working mode division results, the extracted key features and combined features into the trained fault analysis model; for the integrated fault analysis model, input the features into each sub-model respectively to obtain the prediction results of the sub-model; according to the integrated strategy (such as voting method, averaging method, weighted average method), the prediction results of the sub-model are integrated to obtain the final fault probability prediction value. The predicted battery failure probability is output as the final result of the battery analysis method; the threshold of the failure probability can be set, and the battery is judged whether there is a failure risk according to the predicted failure probability, and the corresponding health status assessment result is given. The battery failure probability prediction results are visualized in the form of charts, reports, etc., so that users can intuitively understand the health status of the battery; a battery health status analysis report is generated, including failure probability, health status assessment, potential risk factor analysis, etc., to provide support for subsequent maintenance decisions.
Claims
1. A battery analysis method, comprising: S1, obtain battery data from the energy storage battery management system BMS and pre-process the collected data; the data includes current, voltage, temperature, capacity, number of cycles and cumulative usage time; S2, extracting key features from the preprocessed data; wherein the key features include mean current, capacity change rate, temperature change rate, number of cycles and cumulative usage time; S3, constructing a combined feature based on the key features; wherein the combined feature includes an interaction term between the mean current and the temperature, and a ratio of the capacity change rate to the number of cycles; S4, clustering the working state of the battery using the DBSCAN clustering algorithm according to the mean current, capacity change rate and temperature change rate, and obtaining the working mode division result of the battery; S5, according to the working modes obtained by clustering, counting the transition frequencies between different working modes, and calculating the transition probability matrix, which is used to characterize the probability of the battery switching between different working modes; S6, construct a fault analysis model based on a neural network, take the working mode division results, key features and combined features as input, take the battery fault status as output, and use a supervised learning algorithm to train the fault analysis model; S7, inputting the battery data to be processed into the trained fault analysis model to predict the failure probability of the battery; S3, constructing a combined feature based on the key features; wherein the combined feature includes the interaction term between the mean current and the temperature, and the ratio of the capacity change rate to the number of cycles, including: The mean current is multiplied by the temperature to obtain the interaction term data of the mean current and the temperature; Divide the capacity change rate by the number of cycles to obtain the ratio of the capacity change rate to the number of cycles; The interaction term data of average current and temperature, and the ratio data of capacity change rate and cycle number are combined to generate a combined feature; S4, according to the mean current, capacity change rate and temperature change rate, the DBSCAN clustering algorithm is used to cluster the working state of the battery to obtain the battery working mode division results, including: S41, obtaining the mean current, capacity change rate and temperature change rate from the key features obtained in step S2, and combining them into three-dimensional data points to constitute the input data of the DBSCAN clustering algorithm; S42, setting weight coefficients of the mean current, capacity change rate, and temperature change rate by a feature weight calculation method; and calculating the weighted Euclidean distance between the three-dimensional data points according to the weight coefficients; S43, setting the neighborhood radius ε and neighborhood density threshold MinPts of the DBSCAN clustering algorithm; S44, for each input data point, calculate the number of data points in the corresponding ε-neighborhood according to the weighted Euclidean distance; if the number of data points in the ε-neighborhood of the input data point is greater than or equal to MinPts, mark the corresponding input data point as a core point; S45, taking each core point as a starting point, recursively dividing the core points and non-core points in the ε-neighborhood into the same cluster; wherein the non-core points are divided into the cluster where the core point with the closest weighted Euclidean distance is located; and the input data points that are not divided into any cluster are marked as noise points; S46, according to the clustering result, taking the cluster label to which each input data point belongs as the corresponding working mode category, taking the noise point as the abnormal working state, and outputting the working mode division result of the battery; S5, according to the working modes obtained by clustering, the transition frequencies between different working modes are counted, and the transition probability matrix is calculated. The transition probability matrix is used to characterize the probability of the battery switching between different working modes, including: S51, according to the result of the battery working mode division, the transfer frequencies between different working modes are counted to generate a transfer frequency matrix A; wherein the matrix element a ij represents the frequency of transition from working mode i to working mode j; S52, generating a transfer probability matrix P according to the transfer frequency matrix A; wherein the element p in the transfer probability matrix P is ij represents the probability of transitioning from working mode i to working mode j; S53, performing regularization processing on the generated transition probability matrix P to obtain the regularized transition probability matrix P norm ; S54, according to the regularized transition probability matrix P norm , solve the steady-state distribution π of the Markov chain and obtain the steady-state distribution of the battery under different working modes; S55, output transition probability matrix P norm and the steady-state distribution of the battery in different operating modesπ.
2. The battery analysis method according to claim 1, characterized in that: S54, according to the regularized transition probability matrix P norm , solve the steady-state distribution π of the Markov chain, and obtain the steady-state distribution of the battery in different working modes, including: The regularized transition probability matrix P norm As the state transition matrix of the Markov chain, a Markov chain model of battery working mode transition is constructed; The state transition matrix P of the Markov chain norm Perform eigenvalue decomposition to determine whether the state transfer matrix meets the stationary distribution condition. The stationary distribution condition is that the maximum eigenvalue is unique and equal to 1; If the stationary distribution condition is met, then according to the state transfer matrix P norm Solve the corresponding left eigenvector, normalize the left eigenvector, and obtain the steady-state distribution π of the Markov chain; If the stationary distribution condition is not met, a numerical optimization method is used to estimate the steady-state distribution π of the Markov chain.
3. The battery analysis method according to claim 2, characterized in that: Numerical optimization methods are used to estimate the steady-state distribution of Markov chains, including: Construct an optimization objective function, the optimization objective is to minimize the difference between the state distribution and the product of the state transfer matrix; where the state distribution is the steady-state distribution π of the Markov chain to be estimated, and the state transfer matrix is the state transfer matrix P of the constructed Markov chain norm ; Based on the optimization objective function, the gradient of the steady-state distribution is calculated; Adopt the gradient descent algorithm to iteratively update the steady-state distribution π; Set the iteration termination condition. After the iteration is terminated, the current steady-state distribution π k as an estimate of the steady-state distribution of the Markov chain.
4. The battery analysis method according to claim 3, characterized in that: The expression of the optimization objective function is as follows: minimizeJ(π)=||π-πP norm || 2 +λ||π-π0|| 2 +μ‖π-π f || 2 Among them, π0 is the prior distribution of battery failure mode, which is set according to historical failure data; f is the ideal distribution of battery failure modes, which represents the expected failure mode distribution and is set according to battery performance and safety requirements; λ and μ are balancing factors, which control the weights of the prior distribution term and the ideal distribution term, respectively.
5. The battery analysis method according to claim 4, characterized in that: The gradient of the steady-state distribution is calculated using the following formula: Where I is the n×n dimensional identity matrix, P norm T is the regularized state transfer matrix P norm The transposed matrix of .
6. The battery analysis method according to claim 5, characterized in that: The steady-state distribution is updated by the following formula: π (k+1) =π k -α k ×v (k+1) Among them, v k represents the momentum term of the kth iteration, β is the momentum factor, which controls the influence of the historical gradient; α k Represents the adaptive learning rate for the kth iteration, using the AdaGrad, RMSprop, or Adam optimization algorithm to adaptively adjust the learning rate.
7. The battery analysis method according to claim 6, characterized in that: The iteration termination conditions include any of the following: k≥K max |J(π k+1 )-J(π k )|≤e ||p k+1 -p k ||≤e ||πP norm -π||≤ε p ||p-p f ||≤e f Among them, K max is the preset maximum number of iterations, ε is the preset convergence threshold; when any iteration termination condition is met, the iteration process is terminated and the current steady-state distribution estimate π is k As the estimated result of the Markov chain steady-state distribution; ε p is the threshold of battery failure mode transition stability, ε f is the similarity threshold between the steady-state distribution and the ideal failure mode distribution.
Citation Information
Patent Citations
Data analysis method and device for energy storage battery management system, electronic equipment and medium
CN117347869A
Implementation method and device for battery predictive maintenance of uninterruptible power supply and electronic device
CN112347692A
Power battery fault diagnosis method based on probability analysis
CN116125290A
Fault detection method and device of power battery, electronic equipment and electric automobile
CN117067920A