A lithium ion battery state of health estimation method based on cross attention mechanism
By using a cross-attention mechanism-based approach, the aging mechanism and usage behavior indicators of lithium-ion batteries are extracted from vehicle data. Combined with a deep learning network, the accuracy and interpretability of battery health status estimation under random charge and discharge conditions are solved, enabling accurate prediction and cause analysis of battery health status.
Patent Information
- Application Number
- CN202411879714.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-12-19
AI Technical Summary
Existing technologies cannot accurately reflect the aging mechanism and health status of lithium-ion batteries under random charge and discharge conditions, and the reasons for the decline in health status are difficult to explain, resulting in inaccurate estimation of battery health status.
A cross-attention mechanism-based approach is adopted to extract health indicators reflecting the battery aging mechanism from vehicle data. The deep features of charging data and health indicators are fused through the cross-attention mechanism. Stacked convolutional neural networks and fully connected neural networks are used to estimate the battery health status and analyze the reasons for the decline in health status.
Under random charge and discharge conditions, it can accurately construct health indicators of battery aging modes, achieve interpretable estimation of health status, analyze the main factors affecting the decline of health status, and help improve battery usage and charge and discharge strategies.
Smart Images

Figure CN119827991B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of lithium-ion battery state estimation, and more specifically, relates to a lithium-ion battery health state estimation method based on a cross-attention mechanism. Background Technology
[0002] The development of new energy electric vehicles has reduced reliance on traditional fossil fuels and promoted environmental protection and energy conservation. As the core energy storage component of electric vehicles, commercial lithium-ion batteries, typically lithium iron phosphate and ternary lithium batteries, possess advantages such as high energy density, low self-discharge rate, and long cycle life. With continuous use of electric vehicles, batteries gradually age, manifested as a decrease in remaining capacity. The State of Health (SOH) of a battery is defined as the ratio of its current maximum remaining usable capacity to its rated capacity, reflecting the battery's health level.
[0003] Currently, estimating the health status of lithium-ion batteries often requires manually constructing health indicators and combining battery operating data with machine learning and deep learning methods to achieve this estimation. However, influenced by cell manufacturing processes, regional distribution, driving habits, and charging strategies, the aging trajectory of automotive lithium-ion batteries exhibits uncertainty and strong nonlinearity. The charging process of automotive batteries may begin at any state of charge (SOC) and does not adhere to fixed charging protocols, rendering quantitative methods that accurately reflect battery degradation mechanisms and aging patterns in the laboratory inapplicable in practice. Furthermore, the causes of battery aging are poorly interpretable, and their importance cannot be measured. The statistical or deep features extracted by existing methods are insufficient to explain the causes of battery health degradation.
[0004] Therefore, designing a method to accurately extract health indicators reflecting battery aging mechanisms and battery usage behavior from vehicle battery operation data, and integrating health indicators with battery data to accurately predict battery health status, and analyzing and explaining the causes of battery health degradation, has become an urgent need in this field. Summary of the Invention
[0005] (a) Technical problems to be solved
[0006] Based on the aforementioned deficiencies in the background technology, this invention discloses a lithium-ion battery health state estimation method based on a cross-attention mechanism. This method includes improvements such as extracting health indicators reflecting battery aging mechanisms from vehicle data, fusing health indicators with charging data using a cross-attention mechanism to estimate battery health state, and analyzing the causes of battery health state decline. The aim is to address the problems of difficulty in quantifying aging patterns reflecting the battery's intrinsic mechanisms under random charging and discharging conditions in vehicle-mounted lithium-ion batteries, difficulty in explaining the causes of battery health state decline, and difficulty in accurately estimating battery health state.
[0007] (II) Technical Solution
[0008] This invention discloses a method for estimating the state of health of lithium-ion batteries based on a cross-attention mechanism, comprising the following steps:
[0009] Step S100: Data preparation. During the use of lithium-ion batteries, obtain historical data on total battery voltage, total current, temperature, and state of charge recorded by the battery management system.
[0010] Step S200: Segmentation of charge / discharge segments, segmenting the charging and discharging segments in historical data according to the charging flag bit;
[0011] Step S300: Calculate the health index x reflecting battery aging patterns and usage behavior. h It calculates health indicators reflecting three aging modes of the battery: loss of active materials, loss of lithium ions, and loss of conductivity, from the charging segment; it also calculates health indicators reflecting battery usage behavior from the charging and discharging segments, including six usage behavior health indicators: average charging rate, charge / discharge rate and temperature, depth of charge / discharge and temperature, cumulative battery cycle count, driving mileage, and discharge current information entropy.
[0012] Step S400: Perform convolution operations on the charging segment using stacked convolutional neural networks to obtain the deep feature F of the charging data. c ;
[0013] Step S500: Use a cross-attention mechanism to fuse the deep features F of the charging data. c With health indicators x h Based on the cross-attention mechanism, attention enhancement related to health indicators is applied to the deep features of charging data, and attention enhancement related to the deep features of charging data is applied to the health indicators, respectively, to obtain the fusion feature A most relevant to the battery health status. c and A h ;
[0014] Step S600: Fuse feature A c and A h Input a fully connected neural network to predict the battery's health status; and evaluate the health metric x. h Attention weight S h The analysis was conducted to identify the main factors causing the decline in battery health.
[0015] Preferably, step S200 specifically includes:
[0016] When the charging flag of historical data is "charging" or "charging complete", the historical data is assigned to the charging segment; when the charging flag of historical data is "discharging", the historical data is assigned to the discharging segment.
[0017] Preferably, step S300 specifically includes:
[0018] Step S310: Calculate health indicators reflecting the aging pattern of battery active material loss from the charging segment.
[0019] The approximate constant current charging current is extracted from the charging data of the charging segment and denoted as I. cc (k), the charging voltage is denoted as V. cc (k), for the charging voltage V of the approximately constant current segment cc (k) Perform smoothing and interpolation to obtain The incremental capacity curve is calculated using equation (2).
[0020]
[0021] Where, ΔQ cc (k) represents the charging capacity of the approximate constant current section at the current time k, and sigmoid(·) is the sigmoid function;
[0022] The health index reflecting the loss of battery active materials is calculated using equation (3).
[0023]
[0024] in, and These represent the first charge and the nth charge of the battery, respectively. The peak value of the curve, where max is the function that takes the maximum value;
[0025] Step S320: Calculate health indicators reflecting the battery's lithium-ion loss aging mode from the charging segment.
[0026] The battery lithium-ion loss aging pattern is quantitatively quantified by the capacity charged between fixed SOC intervals. A start SOC and a stop SOC are selected to cover most of the random charging cases in the dataset, denoted as . and The corresponding times are k1 and k2, respectively; then, the charging capacity Q between k1 and k2 is... s The calculation is shown in equation (4).
[0027]
[0028] Among them, Ich (j) represents the charging current at time j, and Δt is the current sampling time interval; then, the Q of the nth charging is calculated. s and initial Q s The rate of change between them is used as As shown in equation (5)
[0029]
[0030] Q s,1 and Q s,n The SOC during the first and nth charges of the battery are respectively... and The charging capacity between these portions;
[0031] Step S330: Calculate health indicators reflecting the aging mode of battery conductivity loss from the charging segment;
[0032] Battery conductivity loss is quantified by ohmic internal resistance. Since ohmic internal resistance varies with temperature and SOC, the relatively fixed ohmic internal resistance at 100% SOC is used as the quantitative index of battery conductivity loss aging mode, as shown in Equation (6).
[0033]
[0034] Among them, R ohm,1 and R ohm,k These are the internal resistances at 100% SOC during the first and kth charging processes, respectively.
[0035] Preferably, step S300 further includes step S340:
[0036] Step S340: Calculate health indicators reflecting battery usage behavior from the charging and discharging segments, denoted as HI1, HI2, HI3, HI4, HI5, and HI6, respectively;
[0037] HI1 is the weighted average charge rate: In order to take into account the non-constant current charging situation during random charging and discharging, a weighted average charge rate index is defined as shown in equation (7).
[0038]
[0039] Among them, I ch (k) represents the charging current at time k, L represents the length of the charging data for this charging segment, and Q0 represents the rated capacity of the battery.
[0040] HI2 represents the charge / discharge rate and temperature: a health index related to the depth of charge / discharge and temperature is established, as shown in equation (8).
[0041]
[0042] Among them, T ch (k) represents the charging temperature, T min This is the lowest temperature at which the battery is allowed to operate.
[0043] HI3 represents the depth of charge / discharge and temperature: A health index related to the depth of charge / discharge and temperature is established, defined as the product of the depth of charge / discharge and the average temperature, as shown in equation (9).
[0044]
[0045] Wherein, SOC(0) and SOC(L) represent the starting SOC and ending SOC of the charging segment, respectively;
[0046] HI4 represents the cumulative number of battery cycles: defined as the cumulative number of cycles the battery has completed during the nth charge. The health index is the sum of the depth of charge (DOD) from the first charge to the depth of charge during the nth charge, as shown in equation (10).
[0047]
[0048] Where i is the charging count index, n is the current charging count; SOC i (0) and SOC i (L) represents the initial SOC and the final SOC of the i-th charge;
[0049] HI5 represents the driving range: The vehicle's driving range is expressed as "mileage" and is directly used as one of the health indicators of the battery during its use, as shown in formula (11).
[0050] HI5 = mileage (11)
[0051] HI6 represents the information entropy of the discharge current: the frequent changes in the vehicle's discharge current to some extent measure the intensity of the driver's acceleration and braking and the bumpiness of the road conditions; the entropy value is mathematically defined as the degree of disorder of the system, and is a suitable health indicator for measuring the frequency of changes in the discharge current. Its calculation method is shown in equation (12).
[0052]
[0053] Where p i Let i be the probability of a discharge segment occurring when the discharge current is i, and W be the length of the discharge data for this discharge segment.
[0054] Preferably, step S400 specifically includes:
[0055] The depth features of the charging data are calculated. Charging data with an initial SOC less than 81% and an ending SOC greater than 98% within a charging segment are considered valid charging data. The PCHIP interpolation method is used to interpolate the charging data of the charging segment to obtain the charging voltage V sampled at equal time intervals. ch (k), Current I ch (k), Temperature T ch (k) and SOC(k) are used as inputs to the charging data encoder subnetwork, as shown in Equation (13).
[0056] x c ={[V ch (k),I ch (k),T ch (k),SOC(k)] i ,k=1,2,...,L} (13)
[0057] For the charging data encoder, a stacked one-dimensional convolutional neural network is used for encoding. The calculation process of the one-dimensional convolutional neural network is shown in equation (14).
[0058]
[0059] Where, x j+m-1 For charging data x c The (j+m-1)th dimension feature, h m σ is the convolution kernel, b is the bias of the convolutional neural network, and σ(·) is the activation function.
[0060] Preferably, step S500 specifically includes:
[0061] Step S510: Process the deep features F of the charging data c Perform health indicators x h Related attention enhancement;
[0062] Replacement index for the aging mode during the nth charging process The battery usage health indicators HI1, HI2, ..., HI6 are integrated together using vector concatenation to form a comprehensive health indicator x. h As shown in equation (15)
[0063]
[0064] x is calculated using a fully connected neural network. h Query weight Q h As shown in equation (16); then, the key K of the deep features of the charging data is calculated using a fully connected neural network. c Sum V c As shown in equations (17) and (18):
[0065]
[0066] Then, the query weight Q, which reflects the aging pattern, is calculated. h Key K c The attention weights are shown in Equation (19);
[0067]
[0068] The attention score S c This reflects the charging depth characteristic F c Medium and health indicators x h The most relevant weights; then, according to equation (20), S c For V c Weighted, A c For charging data deep features F c The updated fusion features are enhanced by the cross-attention mechanism;
[0069] A c =S c ·V c (20)
[0070] Based on the above calculations, the value V c Medium and health indicators x h The most relevant features were enhanced with attention;
[0071] Step S520: For health indicators x h Perform deep feature analysis on charging data F c Related attention enhancement;
[0072] The query weight Q is obtained by calculating the charging depth features using a deep neural network. c Calculate x using a fully connected neural network h The key K h Sum V h As shown in equations (21) to (23)
[0073] Q c =W c q F c (twenty one)
[0074]
[0075] V c =W c v F c (twenty three)
[0076] Then, the query weight Q, which reflects the depth characteristics of the charging data, is calculated. cKey K h The attention weights are shown in Equation (24);
[0077]
[0078] The attention weight S h Reflects on health indicator x h Deep features of charging data F c The most relevant weights; then, according to equation (25), S h For V h Weighted, A h For health indicators x h The updated fusion features are enhanced by the cross-attention mechanism;
[0079] A h =S h ·V h (25)
[0080] Through equations (20) and (25), the mutual cross-attention of mechanism and data is achieved. This cross-attention mechanism, by calculating attention weights, gives different degrees of attention to different parts of the health indicators and charging data depth features, and can obtain more complementary mechanism and data fusion features A. c and A h .
[0081] Preferably, step S600 specifically includes:
[0082] Step S610: Use multiple stacked fully connected layers as the output neural network to predict the battery health status;
[0083] Multiple stacked fully connected layers are used as the output neural network. Features that integrate mechanisms and data are concatenated, and then the concatenated fused features are input into the output sub-network and mapped to the battery health status label. The calculation formula is shown in Equation (26):
[0084]
[0085] in, The output of the neural network represents the predicted value of the battery SOH. concat(·) is a matrix concatenation operation, and LinearLayers(·) is a stack of multiple fully connected layers. The calculation method of each fully connected layer is shown in Equation (27).
[0086] y o =σ(W i x i +b i (27)
[0087] Where, xi W i and b i These represent the input, weights, and biases of a single fully connected layer, y. o This is the output of a single fully connected layer.
[0088] Preferably, step S610 further includes:
[0089] The SmoothL1 loss function is used to calculate the network output. With dataset SOH label SOH label The loss between them is shown in equation (28).
[0090]
[0091] After obtaining the loss, the Adam optimization algorithm is used to perform backpropagation iterative optimization on the parameters of the neural network. The initial learning rate is set to 0.02. Every 200 iterations, the learning rate is reduced to half of the previous one. After 600 training rounds, the training process of the charging feature extraction neural network, the cross-attention neural network, and the output neural network is completed. After the neural network is trained, the model parameters of the neural network are fixed, and the charging data and health indicators of the vehicle battery are input to predict the health status of the vehicle battery.
[0092] Preferably, step S600 further includes step S620:
[0093] Step S620: Based on the attention weight S of health indicators h Analyze the main factors affecting the decline in health status;
[0094] Attention weight S for health indicators h The analysis identifies the main factors causing a decline in battery health. In calculating the attention weight, this represents the influence of the health indicator x. h Deep features of charging data F c Attention weight S of the most relevant weight h S was obtained, therefore h The attention weights, which are considered as the output of the network, are further expressed as shown in Equation (29);
[0095]
[0096] in, These represent the attention weights for the three aging modes. The attention weights of the six health indicators are given respectively. The top k health indicators are selected from largest to smallest value. These k health indicators are the k factors that contribute the most to battery capacity degradation.
[0097] (III) Beneficial Effects
[0098] This invention improves upon the design of a lithium-ion battery health state estimation method based on a cross-attention mechanism. For randomized historical data, it processes data from charge-discharge segments within the historical data to extract multifaceted health indicators (x) reflecting the battery aging mechanism from the vehicle-mounted data. h Furthermore, based on stacked convolutional neural networks, convolutional operations are performed on charging segments to obtain the deep feature F of the charging data. c And a cross-attention mechanism is used to fuse the deep features F of the charging data. c With health indicators x h Based on the cross-attention mechanism, attention enhancement related to health indicators is applied to the deep features of charging data, and attention enhancement related to the deep features of charging data is applied to the health indicators, respectively, to obtain the fusion feature A most relevant to the battery health status. c and A h This allows for accurate prediction of battery health status and analysis of the reasons for declining battery health status.
[0099] First, voltage, current, and temperature operating data of the lithium-ion battery are collected, and the system is divided into charging and discharging segments. Then, health indicators reflecting battery aging patterns and usage behavior are calculated. From the charging segment, health indicators reflecting three aging patterns—active material loss, lithium-ion loss, and conductivity loss—are calculated. From the discharging segment, health indicators reflecting battery usage behavior are calculated, including average charging rate, charge / discharge rate versus temperature, depth of charge / discharge versus temperature, cumulative battery cycle count, mileage, and discharge current entropy. Stacked one-dimensional convolutional neural networks are used to encode the charging data, obtaining deep features. Next, a cross-attention mechanism is used to fuse the deep features and health indicators. Based on cross-attention, attention enhancement related to health indicators is applied to both the deep features and the health indicators themselves, obtaining the fused features most relevant to the battery's health status. Finally, the fused features are input into a fully connected neural network to predict the battery's health status. Furthermore, the attention weights of the health indicators are analyzed to identify the main factors causing a decline in battery health.
[0100] Simulation results on a real-world vehicle battery operating dataset demonstrate that, even under random charge and discharge conditions, the battery health status estimation method proposed in this invention can accurately construct health indicators reflecting battery aging patterns, achieve interpretable estimation of health status, and analyze the main factors affecting health status decline. This helps vehicle operators and users improve battery usage and charge / discharge strategies, and has practical application value. Attached Figure Description
[0101] To more clearly illustrate the technical solutions in this invention or the prior art, the accompanying drawings used in the embodiments will be briefly described below:
[0102] Figure 1 A schematic diagram of the process for estimating the health status of lithium-ion batteries based on the cross-attention mechanism provided by the present invention;
[0103] Figure 2 This is a flowchart of the present invention for calculating health indicators reflecting the aging mode of battery active material loss from charging segments;
[0104] Figure 3 This is a diagram illustrating the overall architecture of the battery health state estimation neural network based on the cross-attention mechanism in this invention.
[0105] Figure 4 This is a comparison of the battery health state estimation performance of the algorithm proposed in this invention (referred to as crossattention) on a real-world vehicle battery operating dataset, and that of traditional convolutional neural networks (CNNs) and self-attention neural networks (self-attention). The label SOH represents the actual SOH state label value. Detailed Implementation
[0106] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0107] To address the challenges of shallow charging and discharging in actual lithium-ion battery use, the difficulty in constructing health indicators that accurately reflect battery aging mechanisms, the difficulty in predicting battery health status under random charging and discharging conditions, and the lack of interpretability in prediction results, this invention presents an improved lithium-ion battery health status estimation method based on a cross-attention mechanism.
[0108] like Figure 1 As shown, the specific steps of the lithium-ion battery health state estimation method based on the cross-attention mechanism are as follows:
[0109] Step S100: Data preparation. During the use of lithium-ion batteries, obtain historical data on the total battery voltage, total current, temperature, and state of charge recorded by the battery management system.
[0110] Historical data of lithium-ion batteries for a certain model of electric vehicle was collected over 500 days. The underlying battery management system of this electric vehicle recorded the battery pack's total voltage, total current, 17 temperature probe values, State of Charge (SOC), charging status flag, and mileage, among other data. This data was sent from the underlying battery management system to a cloud platform every 10 seconds. This data was retrieved from the cloud platform, and outliers, null values, and overflow values were removed. The median of the 17 temperature probe values was used as the temperature to complete the data preparation.
[0111] Step S200: Segmentation of charge and discharge segments, segmenting the charging and discharging segments in historical data according to the charging flag bit.
[0112] When the charging flag of historical data is "charging" or "charging complete", the historical data is assigned to the charging segment; when the charging flag of historical data is "discharging", the historical data is assigned to the discharging segment.
[0113] Step S300: Calculate the health index x reflecting battery aging patterns and usage behavior. h It calculates health indicators reflecting three aging modes from the charging segment: loss of active materials, loss of lithium ions, and loss of conductivity. It also calculates health indicators reflecting battery usage behavior from the charging and discharging segments, including six usage behavior health indicators: average charging rate, charge / discharge rate and temperature, depth of charge / discharge and temperature, cumulative battery cycle count, driving mileage, and discharge current information entropy.
[0114] Specifically, step S300 includes the following steps:
[0115] Step S310: Calculate health indicators reflecting the aging mode of battery active material loss (LAM) from the charging segment.
[0116] Find an approximate constant current charging data from the calibration data or factory test data of the electric vehicle battery pack, starting from a low initial SOC, such as SOC = 20%, SOC = 30%, etc., and charging to SOC = 100%. Calculate the IC curve of the charging process using equation (1). Figure 2 As shown in Figure (a).
[0117]
[0118] Then, the start SOC and end SOC are selected to include all IC peaks, denoted as . and
[0119] once and Once determined, the present invention searches for the initial charging SOC that meets the requirements from the vehicle's historical data. And the termination of SOC satisfies The charging segment, such as Figure 2 As shown in Figure (b). Since sudden changes in charging current can lead to sudden changes in charging voltage, only the constant current segment within the charging cycle where the charging current remains approximately constant is extracted. The charging current of this extracted approximately constant current segment is denoted as I. cc (k), the charging voltage is denoted as V. cc (k), such as Figure 2 As shown in Figure (c).
[0120] The charging voltage V of the approximately constant current segment cc (k) Perform a locally weighted scatterplot smoothing (Lowess) to remove the influence of low sampling accuracy on the charging voltage. Then, interpolate the smoothed voltage using a piecewise cubic Hermite interpolation polynomial (PCHIP). PCHIP interpolation is a conformal interpolation method, meaning that extreme points, inflection points, and other characteristic points of the data are preserved during the interpolation process, thus avoiding distortion of the voltage curve shape by the interpolation result. The voltage after smoothing and interpolation is denoted as... At this point, the portion of the charging voltage that changes from ΔV to 0 is significantly reduced, such as... Figure 2 As shown in Figure (d).
[0121] like Figure 2 As shown in Figure (e), the incremental capacity IC curve is calculated using Equation (2).
[0122]
[0123] Where, ΔQ cc (k) represents the charging capacity of the approximate constant current section at the current time k, and sigmoid(·) is the sigmoid function.
[0124] The health index reflecting the loss of active material LAM in the battery is calculated using equation (3).
[0125]
[0126] in, and These represent the first charge and the nth charge of the battery, respectively. The peak value of the curve, where max is the function that takes the maximum value.
[0127] Step S320: Calculate health indicators reflecting the aging mode of battery lithium-ion loss (LLI) from the charging segment.
[0128] Lithium-ion loss (LLI) in batteries is caused by side reactions such as SEI layer growth, electrolyte decomposition, and lithium deposition during lithiation / delithiation processes, which consume lithium ions in the electrolyte. The LLI aging pattern is quantified by the capacity charged between fixed State of Charge (SOC) intervals. A start SOC and a stop SOC are selected to cover most of the random charging cases in the dataset, denoted as . and The corresponding times are k1 and k2, respectively; then, the charging capacity Q between k1 and k2 is... s The calculation is shown in equation (4).
[0129]
[0130] Among them, I ch (j) represents the charging current at time j, and Δt is the current sampling time interval. Then, the Q value for the nth charging is calculated. s and initial Q s The rate of change between them is used as As shown in equation (5)
[0131]
[0132] Q s,1 and Q s,n The SOC during the first and nth charges of the battery are respectively... and The charging capacity between [the two].
[0133] Step S330: Calculate health indicators reflecting the aging mode of battery conductivity loss (CL) from the charging segment.
[0134] The battery conductivity loss CL is related to the corrosion of the current collector and the decomposition of the binder during the reaction process, and can be quantified by ohmic internal resistance. Since ohmic internal resistance varies with factors such as temperature and SOC, the ohmic internal resistance at a relatively fixed 100% SOC is used as the quantitative index of CL aging mode, as shown in equation (6).
[0135]
[0136] Among them, R ohm,1 and R ohm,kThese are the internal resistances at 100% SOC during the first and kth charging processes, respectively.
[0137] Step S340: Calculate health indicators reflecting battery usage behavior from the charging and discharging segments, and use HI1, HI2, HI3, HI4, HI5, and HI6 to represent the six health indicators of battery usage behavior, respectively.
[0138] HI1 is the weighted average charging rate: the charging current rate has a certain impact on battery aging. A high charging rate will lead to the growth of lithium dendrites and SEI film to a certain extent, which in turn leads to the growth of LLI. In order to consider the non-constant current charging situation in random charge and discharge process, a weighted average charging rate index is defined as shown in equation (7).
[0139]
[0140] Among them, I ch (k) represents the charging current at time k, L represents the length of the charging data for this charging segment, and Q0 represents the rated capacity of the battery.
[0141] HI2 represents the charge / discharge rate and temperature: lithium plating in the battery is aggravated at low temperatures and high current charging rates. Therefore, a health index related to the depth of charge / discharge and temperature was established, as shown in equation (8).
[0142]
[0143] Among them, T ch (k) represents the charging temperature, T min This is the lowest temperature at which the battery is allowed to operate.
[0144] HI3 represents the depth of charge / discharge and temperature: LAM and LLI aging modes are associated with deep depth of charge / discharge and high temperature. An indicator needs to be defined to measure the driver's charging habits, i.e., whether the driver habitually discharges the battery to a higher SOC and then charges it, or discharges it to a lower SOC and then charges it. Therefore, a health indicator related to depth of charge / discharge and temperature is established, defined as the product of depth of charge / discharge and average temperature, as shown in Equation (9).
[0145]
[0146] Wherein, SOC(0) and SOC(L) represent the starting SOC and ending SOC of the charging segment, respectively.
[0147] HI4 represents the cumulative cycle count of the battery: LAM is related to the number of battery cycles, and the increase in the number of cycles will inevitably cause the battery's LAM to age. The cumulative cycle count health index of the battery on the nth charge is defined as the sum of the depth of charge (DOD) of the battery on the first charge to the depth of charge on the nth charge, as shown in Equation (10).
[0148]
[0149] Where i is the charging index and n is the current charging count. SOC i (0) and SOC i (L) represents the initial SOC and the final SOC for the i-th charge.
[0150] HI5 represents mileage: the longer the vehicle's mileage, the longer the battery's lifespan. Therefore, the vehicle's mileage, usually expressed as "mileage," is directly used as one of the health indicators of the battery's usage process, as shown in equation (11).
[0151] HI5 = mileage (11)
[0152] HI6 represents the information entropy of the discharge current: the frequent changes in the vehicle's discharge current to some extent measure the intensity of the driver's acceleration and braking, as well as the bumpiness of the road conditions. Entropy is mathematically defined as the degree of disorder in a system, and is a suitable health indicator for measuring the frequency of changes in discharge current. Its calculation method is shown in equation (12).
[0153]
[0154] Where p i Let i be the probability of a discharge segment occurring when the discharge current is i, and W be the length of the discharge data for this discharge segment.
[0155] Step S400: Perform convolution operations on the charging segment using stacked convolutional neural networks to obtain the deep feature F of the charging data. c .
[0156] Charging data within a charging segment with an initial SOC less than 81% and an ending SOC greater than 98% is considered valid charging data. To address the issue of inconsistent charging data lengths caused by random charging, the PCHIP interpolation method is used to interpolate the charging data of the charging segment, obtaining charging voltage V sampled at equal time intervals. ch (k), Current I ch (k), Temperature T ch (k) and SOC(k) are used as inputs to the charging data encoder subnetwork, as shown in Equation (13).
[0157] x c={[V ch (k),I ch (k),T ch (k),SOC(k)] i ,k=1,2,...,L} (13)
[0158] In this embodiment, voltage, current, temperature, and SOC are sampled at equal intervals of 256 points.
[0159] For the charging data encoder, a stacked one-dimensional convolutional neural network (Conv Block) is used for encoding. The computation process of the one-dimensional convolutional neural network is shown in equation (14).
[0160]
[0161] Where, x j+m-1 For charging data x c The (j+m-1)th dimension feature, h m Let be the convolution kernel, b be the bias of the convolutional neural network, and σ(·) be the activation function, preferably the ReLU activation function. A one-dimensional convolutional neural network captures local patterns by sliding the convolution kernel across the input sequence. This allows it to capture features of the original charging data from a local to a global perspective, reducing the feature dimensionality of the original data and enabling the learning of a high-dimensional abstract feature representation of the original charging data. The stacked one-dimensional convolutional neural network structure is shown below. Figure 3 As shown in the three "Conv Blocks", each Conv Block includes a function that is concatenated with the convolution function Conv1d, followed by batch normalization (BatchNorm1d), activation function ReLU, and max pooling (MaxPool1d). c To obtain deep features of the charging data.
[0162] Step S500: Use a cross-attention mechanism to fuse the deep features F of the charging data. c With health indicators x h Based on the cross-attention mechanism, attention enhancement related to health indicators is applied to the deep features of charging data, and attention enhancement related to the deep features of charging data is applied to the health indicators, respectively, to obtain the fusion feature A most relevant to the battery health status. c and A h .
[0163] Preferably, step S500 specifically includes the following steps:
[0164] Step S510: Process the deep features F of the charging data c Perform health indicators x h Related attention enhancement.
[0165] Raw charging data such as current, voltage, and temperature contain potential aging information; however, simply using a neural network to establish a mapping between raw data and remaining capacity lacks interpretability. Therefore, a deep neural network with cross-attention between health indicators and deep features was designed. Health indicators with mechanistic significance guide the neural network to extract more representative features from the raw charging data. Alternative indicators for the aging pattern during the nth charging process are then used. The battery usage health indicators HI1, HI2, ..., HI6 are integrated together using vector concatenation to form a comprehensive health indicator x. h As shown in equation (15)
[0166]
[0167] Calculate x using a fully connected neural network (FN) h Query weight Q h As shown in equation (16). Then, the key K of the deep features of the charging data is calculated using a fully connected neural network. c Sum V c As shown in equations (17) and (18):
[0168]
[0169]
[0170]
[0171] Then, the query weight Q, which reflects the aging pattern, is calculated. h Key K c The attention weights are shown in Equation (19).
[0172]
[0173] The attention score S c This reflects the charging depth characteristic F c Medium and health indicators x h The most relevant weights. Then, according to equation (20), S is... c For V c Weighted, A c For charging data deep features F c The updated fusion features are enhanced through a cross-attention mechanism.
[0174] A c =S c ·V c (20)
[0175] Based on the above calculations, the value V c Medium and health indicators x h The most relevant features were enhanced with attention.
[0176] Step S520: For health indicators x h Perform deep feature analysis on charging data F c Related attention enhancement.
[0177] The deep features of charging data are used to calculate the query weight Q through a deep neural network. c Calculate x using a fully connected neural network h The key K h Sum V h As shown in equations (21) to (23)
[0178]
[0179]
[0180]
[0181] Then, the query weight Q, which reflects the depth characteristics of the charging data, is calculated. c Key K h The attention weights are shown in Equation (24).
[0182]
[0183] The attention weight S h Reflects on health indicator x h In and feature map F c The most relevant weights. Then, according to equation (25), S is... h For V h Weighted, A h For health indicators x h The updated fusion features are enhanced through a cross-attention mechanism.
[0184] A h =S h ·V h (25)
[0185] Equations (20) and (25) achieve mutual cross-attention between the mechanism and the data. This cross-attention mechanism, by calculating attention weights, gives different degrees of attention to different parts of the health indicators and charging data depth features, thus obtaining a more complementary mechanism-data fusion feature A. c and A h The network structure for computing the cross-attention mechanism is as follows: Figure 3As shown in the “Cross-attention Block” diagram, MatMul, Scale, and Softmax are the matrix multiplication function, scaling function, and normalization function, respectively.
[0186] Step S600: Fuse feature A c and A h Inputting the data into a fully connected neural network, the system predicts the battery's health status. Furthermore, it analyzes the health indicator x... h Attention weight S h The analysis was conducted to identify the main factors causing the decline in battery health.
[0187] Step S600 specifically includes the following steps:
[0188] Step S610: Use multiple stacked fully connected layers as the output neural network to predict the battery health status.
[0189] Multiple stacked fully connected layers are used as the output neural network. Features that integrate mechanisms and data are concatenated, and then the concatenated fused features are input into the output sub-network and mapped to the battery health status label. The calculation formula is shown in Equation (26):
[0190]
[0191] in, The output of the neural network (i.e. Figure 3 The y-value in the formula represents the predicted SOH of the battery. concat(·) is a matrix concatenation operation. LinearLayers(·) are multiple stacked fully connected layers. The calculation method of each fully connected layer is shown in Equation (27).
[0192] y o =σ(W i x i +b i (27)
[0193] Where, x i W i and b i These represent the input, weights, and biases of a single fully connected layer. o This represents the output of a single fully connected layer. The SmoothL1 loss function is used to calculate the network's output. With dataset SOH label SOH label The loss between them is shown in equation (28).
[0194]
[0195] After obtaining the loss function, the Adam optimization algorithm is used to iteratively optimize the parameters of the neural network through backpropagation. The initial learning rate is set to 0.02, and every 200 iterations, the learning rate is reduced to half of the previous rate. After 600 training rounds, the training process of the charging feature extraction neural network, the cross-attention neural network, and the output neural network is completed. After the neural network is trained, the model parameters of the neural network are fixed, and the charging data and health indicators of the vehicle battery are input to predict the health status of the vehicle battery.
[0196] Step S620: Based on the attention weight S of health indicators h The main factors affecting the decline in health status were analyzed.
[0197] Attention weight S for health indicators h The analysis focuses on the attention weight S. h Specifically, based on equation (24), the main factors causing a decline in battery health are obtained. In calculating the attention weight, it represents the factors contributing to the decline in battery health index x. h Deep features of charging data F c Attention weight S of the most relevant weight h It was obtained. Therefore, S h Considered as the output of the network, the attention weights in this invention are further expressed as shown in equation (29).
[0198]
[0199] in, These represent the attention weights for the three aging modes. The attention weights for the six health indicators are respectively, corresponding to the health indicator x in equation (15). h There are nine variables. The top k health indicators are selected from largest to smallest value, and these k health indicators are the k factors that contribute the most to battery capacity degradation.
[0200] Accurate lithium-ion battery health status estimation is crucial for the safe and stable operation of electric vehicles. However, the shallow charging and discharging characteristics and random charging during battery use make it difficult to extract battery health indicators. Existing methods for extracting health indicators under laboratory conditions are no longer applicable to in-vehicle applications. Current health status estimation methods struggle to accurately establish the causal relationship between health indicators and battery health status, resulting in poor interpretability of the estimation results. To address these issues, this invention constructs health indicators reflecting battery aging patterns using segment charging capacity, sigmoid constraints, and 100% SOC internal resistance during random charging segments. Based on a cross-attention mechanism, it overcomes the limitation of traditional health indicator construction methods being unable to be calculated under actual in-vehicle application conditions. This invention fuses health indicators with deep features of charging data through a cross-attention mechanism, analyzing the main factors affecting battery health status decline based on attention weights. This solves the problem of poor interpretability in traditional battery health status estimation methods, helping vehicle operators and users improve battery usage and charging / discharging strategies, and has practical application value.
[0201] like Figure 4 As shown, the lithium-ion battery health state estimation method based on cross attention mechanism disclosed in this embodiment is more accurate and closer to the actual value of SOH label than the traditional convolutional neural network (CNN) and self attention neural network (self attention) battery health state estimation. Therefore, this invention can be applied to the health state estimation of vehicle lithium-ion batteries.
[0202] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for estimating the state of health of a lithium-ion battery based on a cross-attention mechanism, characterized in that, Includes the following steps: Step S100: Data preparation. During the use of lithium-ion batteries, obtain historical data on the total battery voltage, total current, temperature, and state of charge recorded by the battery management system. Step S200: Segmentation of charge / discharge segments, segmenting the charging and discharging segments in historical data according to the charging flag bit; Step S300: Calculate the health index x reflecting battery aging patterns and usage behavior. h It calculates health indicators reflecting three aging modes of the battery: loss of active materials, loss of lithium ions, and loss of conductivity, from the charging segment; it also calculates health indicators reflecting battery usage behavior from the charging and discharging segments, including six usage behavior health indicators: average charging rate, charge / discharge rate and temperature, depth of charge / discharge and temperature, cumulative battery cycle count, driving mileage, and discharge current information entropy. Step S300 specifically includes: Step S310: Calculate health indicators reflecting the aging pattern of battery active material loss from the charging segment. The approximate constant current charging current is extracted from the charging data of the charging segment and denoted as I. cc (k), the charging voltage is denoted as V. cc (k), for the charging voltage V of the approximately constant current segment cc (k) Perform smoothing and interpolation to obtain The incremental capacity curve is calculated using equation (2). Where, ΔQ cc (k) represents the charging capacity of the approximate constant current segment at time k, and sigmoid(·) is the sigmoid function; The health index reflecting the loss of battery active materials is calculated using equation (3). in, and These represent the first charge and the nth charge of the battery, respectively. The peak value of the curve, where max is the function that takes the maximum value; Step S320: Calculate health indicators reflecting the battery's lithium-ion loss aging mode from the charging segment. The battery lithium-ion loss aging pattern is quantitatively quantified by the capacity charged between fixed SOC intervals. A start SOC and a stop SOC are selected to cover most of the random charging cases in the dataset, denoted as . and The corresponding times are k1 and k2, respectively; then, the charging capacity Q between k1 and k2 is... s The calculation is shown in equation (4). Among them, I ch (j) represents the charging current at time j, and Δt is the current sampling time interval; then, the Q of the nth charging is calculated. s and initial Q s The rate of change between them is used as As shown in equation (5) Q s,1 and Q s,n The SOC during the first and nth charges of the battery are respectively... and The charging capacity between these portions; Step S330: Calculate health indicators reflecting the aging mode of battery conductivity loss from the charging segment; Battery conductivity loss is quantified by ohmic internal resistance. Since ohmic internal resistance varies with temperature and SOC, the relatively fixed ohmic internal resistance at 100% SOC is used as the quantitative index of battery conductivity loss aging mode, as shown in Equation (6). Among them, R ohm,1 and R ohm,k These are the internal resistances of the battery at 100% SOC during the first and kth charging processes, respectively; Step S400: Perform convolution operations on the charging segment using stacked convolutional neural networks to obtain the deep feature F of the charging data. c ; Step S400 specifically includes: The depth features of the charging data are calculated. Charging data with an initial SOC less than 81% and an ending SOC greater than 98% within a charging segment are considered valid charging data. The PCHIP interpolation method is used to interpolate the charging data of the charging segment to obtain the charging voltage V sampled at equal time intervals. ch (k), Current I ch (k), Temperature T ch (k) and SOC(k) are used as inputs to the charging data encoder subnetwork, as shown in Equation (13). x c ={[V ch (k),I ch (k),T ch (k),SOC(k)] i ,k=1,2,...,L} (13) For the charging data encoder, a stacked one-dimensional convolutional neural network is used for encoding. The calculation process of the one-dimensional convolutional neural network is shown in equation (14). Where, x j+m-1 For charging data x c The (j+m-1)th dimension feature, h m σ is the convolution kernel, b is the bias of the convolutional neural network, and σ(·) is the activation function; Step S500: Use a cross-attention mechanism to fuse the deep features F of the charging data. c With health indicators x h Based on the cross-attention mechanism, attention enhancement related to health indicators is applied to the deep features of charging data, and attention enhancement related to the deep features of charging data is applied to the health indicators, respectively, to obtain the fusion feature A most relevant to the battery health status. c and A h ; Step S600: Fuse feature A c and A h Input a fully connected neural network to predict the battery's health status; and evaluate the health metric x. h Attention weight S h The analysis was conducted to identify the main factors causing the decline in battery health.
2. The lithium-ion battery health state estimation method based on cross-attention mechanism according to claim 1, characterized in that, Step S200 specifically includes: When the charging flag of historical data is "charging" or "charging complete", the historical data is assigned to the charging segment; when the charging flag of historical data is "discharging", the historical data is assigned to the discharging segment.
3. The lithium-ion battery health state estimation method based on cross-attention mechanism according to claim 1, characterized in that, Step S300 also includes step S340: Step S340: Calculate health indicators reflecting battery usage behavior from the charging and discharging segments, denoted as HI1, HI2, HI3, HI4, HI5, and HI6, respectively; HI1 is the weighted average charging rate: In order to account for the non-constant current charging situation during random charging and discharging, a weighted average charging rate index is defined as shown in equation (7). Among them, I ch (k) represents the charging current at time k, L represents the length of the charging data for this charging segment, and Q0 represents the rated capacity of the battery. HI2 represents the charge / discharge rate and temperature: a health index related to the depth of charge / discharge and temperature is established, as shown in equation (8). Among them, T ch (k) represents the charging temperature, T min This is the lowest temperature at which the battery is allowed to operate. HI3 represents the depth of charge / discharge and temperature: A health index related to the depth of charge / discharge and temperature is established, defined as the product of the depth of charge / discharge and the average temperature, as shown in equation (9). Wherein, SOC(0) and SOC(L) represent the starting SOC and ending SOC of the charging segment, respectively; HI4 represents the cumulative number of battery cycles: defined as the cumulative number of cycles the battery has completed during the nth charge. The health index is the sum of the depth of charge from the first charge to the depth of charge during the nth charge, as shown in equation (10). Where i is the charging count index, and n is the current charging count; SOC i (0) and SOC i (L) represents the initial SOC and the final SOC of the i-th charge; HI5 represents the driving range: The vehicle's driving range is expressed as "mileage" and is directly used as one of the health indicators of the battery during use, as shown in formula (11). HI5 = mileage (11) HI6 represents the information entropy of the discharge current: the frequent changes in the vehicle's discharge current to some extent measure the intensity of the driver's acceleration and braking and the bumpiness of the road conditions; the entropy value is mathematically defined as the degree of disorder of the system, and is a suitable health indicator for measuring the frequency of changes in the discharge current. Its calculation method is shown in equation (12). Where p i Let i be the probability of a discharge segment occurring when the discharge current is i, and W be the length of the discharge data for this discharge segment.
4. The lithium-ion battery health state estimation method based on cross-attention mechanism according to claim 1, characterized in that, Step S500 specifically includes: Step S510: Process the deep features F of the charging data c Perform health indicators x h Related attention enhancement; Replacement index for the aging mode during the nth charging process The health indicators HI1, HI2, ..., HI6 during battery use are integrated together using vector concatenation to form a comprehensive health indicator x. h As shown in equation (15) x is calculated using a fully connected neural network. h Query weight Q h As shown in equation (16); then, the key K of the deep features of the charging data is calculated using a fully connected neural network. c Sum V c As shown in equations (17) and (18): Then, the query weight Q, which reflects the aging pattern, is calculated. h Key K c The attention weights are shown in Equation (19); The attention score S c This reflects the charging depth characteristic F c Medium and health indicators x h The most relevant weights; then, according to equation (20), S c For V c Weighted, A c For charging data deep features F c The updated fusion features are enhanced by the cross-attention mechanism; A c =S c ·V c (20) Based on the above calculations, the value V c Medium and health indicators x h The most relevant features were enhanced with attention; Step S520: For health indicators x h Perform deep feature analysis on charging data F c Related attention enhancement; The deep features of charging data are used to calculate the query weight Q through a deep neural network. c Calculate x using a fully connected neural network h The key K h Sum V h As shown in equations (21) to (23) Then, the query weight Q, which reflects the depth characteristics of the charging data, is calculated. c Key K h The attention weights are shown in Equation (24); The attention weight S h Reflects on health indicator x h Deep features of charging data F c The most relevant weights; then, according to equation (25), S h For V h Weighted, A h For health indicators x h The updated fusion features are enhanced by the cross-attention mechanism; A h =S h ·V h (25) Through equations (20) and (25), the mutual cross-attention of mechanism and data is achieved. This cross-attention mechanism, by calculating attention weights, gives different degrees of attention to different parts of the health indicators and charging data depth features, and can obtain more complementary mechanism and data fusion features A. c and A h .
5. The lithium-ion battery health state estimation method based on cross-attention mechanism according to claim 4, characterized in that, Step S600 specifically includes: Step S610: Use multiple stacked fully connected layers as the output neural network to predict the battery health status; Multiple stacked fully connected layers are used as the output neural network. Features that integrate mechanisms and data are concatenated, and then the concatenated fused features are input into the output sub-network and mapped to the battery health status label. The calculation formula is shown in Equation (26): in, The output of the neural network represents the predicted value of the battery SOH. concat(·) is a matrix concatenation operation, and LinearLayers(·) is a stack of multiple fully connected layers. The calculation method of each fully connected layer is shown in Equation (27). y o =σ(W i x i +b i ) (27) Where, x i W i and b i These represent the input, weights, and biases of a single fully connected layer, y. o This is the output of a single fully connected layer.
6. The lithium-ion battery health state estimation method based on cross-attention mechanism according to claim 5, characterized in that, Step S610 also includes: The SmoothL1 loss function is used to calculate the network output. With dataset SOH label SOH label The loss between them is shown in equation (28). After obtaining the loss, the Adam optimization algorithm is used to backpropagate and iteratively optimize the parameters of the neural network. The initial learning rate is set to 0.
02. Every 200 iterations, the learning rate is reduced to half of the previous one. After 600 training rounds, the training process of the charging data deep feature extraction neural network, the cross-attention neural network, and the output neural network is completed. After the neural network is trained, the model parameters of the neural network are fixed, and the charging data and health indicators of the vehicle battery are input to predict the health status of the vehicle battery.
7. The lithium-ion battery health state estimation method based on cross-attention mechanism according to claim 5, characterized in that, Step S600 further includes step S620: Step S620: Based on the attention weight S of health indicators h Analyze the main factors affecting the decline in health status; Attention weight S for health indicators h The analysis identifies the main factors causing a decline in battery health. In calculating the attention weight, this represents the influence of the health indicator x. h Deep features of charging data F c Attention weight S of the most relevant weight h S was obtained, therefore h The attention weights, which are considered as the output of the network, are further expressed as shown in Equation (29); in, These represent the attention weights for the three aging modes. The attention weights of the six health indicators are given respectively. The top k health indicators are selected from largest to smallest value. These k health indicators are the k factors that contribute the most to battery capacity degradation.
Citation Information
Patent Citations
Method and system for identifying and quantitatively analyzing lithium ion battery recession mechanism
CN110927607A
Lithium battery health state determination method and device, equipment and storage medium
CN117233636A