A method for estimating state of charge of lithium batteries
By constructing a multi-source domain adaptive joint network structure, the problem of multi-source domain distribution differences in lithium battery state of charge estimation is solved, accurate SOC estimation under different working conditions and materials is achieved, and the estimation accuracy and generalization ability are improved.
Patent Information
- Application Number
- CN202410915659.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-07-09
AI Technical Summary
Existing deep transfer learning methods only consider a single source domain in lithium battery state of charge estimation, and fail to effectively handle the distribution differences of multiple data sets from different materials and working conditions, resulting in negative transfer problems and affecting estimation accuracy.
A multi-source domain adaptation method is adopted to construct a joint network structure consisting of a bidirectional LSTM and an attention mechanism. Pre-training and transfer learning are performed on the lithium battery dataset. The feature extractor is used to capture long-term dependencies and align the distribution in multiple feature spaces to generate accurate SOC estimation results.
The accuracy and generalization ability of lithium battery state of charge estimation are improved, and it can accurately estimate SOC under different working conditions and materials without the need for large amounts of data and analysis of the battery's internal structure, which is superior to traditional methods.
Smart Images

Figure CN118759375B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery management systems, and in particular to a method for estimating the state of charge of a lithium battery. Background Art
[0002] As countries around the world pay more attention to environmental issues and seek to develop more clean energy, lithium-ion batteries, as a common clean energy technology for storage and use, are widely used in electric vehicles, energy storage systems and other fields. As an indispensable part of battery operation, the battery management system (BMS) is used to monitor battery status, temperature control, charge and discharge balance, and other functions, aiming to extend battery life and improve battery performance. Battery SOC estimation is a key function in the BMS. The SOC of a lithium battery refers to the ratio between the current charge stored in the battery and its total capacity. Accurate SOC estimation is crucial for the safe operation and proper use of the battery. However, SOC cannot be measured directly and usually relies on the monitoring and analysis of measurable parameters such as the battery's current and voltage.
[0003] A large number of studies have been conducted on lithium-ion battery SOC estimation, which can be categorized into the following categories: lookup table methods, coulomb counting methods, observer-based methods, model-driven methods, methods using state estimation filters, and data-driven methods. Data-driven methods use data such as battery current and voltage as features and learn the nonlinear relationship between these features and battery SOC, without requiring knowledge of the battery field or mathematical modeling.
[0004] Deep learning-based methods have demonstrated strong capabilities in SOC estimation, but in the real world, the difficulty in acquiring battery data and the diversity of battery usage environments result in weak model generalization capabilities. Transfer learning provides a solution to this problem. It aims to apply knowledge learned from one task (source task) to another task (target task), improving the performance of the target task and achieving better generalization capabilities when the amount of data is limited. Domain adaptation is an important branch of transfer learning, focusing on solving the problem of knowledge transfer between different domains and addressing the distribution differences between the source and target domains. Unlike traditional machine learning, transfer learning does not learn the target task from scratch, but instead leverages existing knowledge to accelerate the learning of the target task and improve the accuracy of the target task.
[0005] However, existing deep transfer learning methods only consider the case of a single source domain, i.e., single-source domain adaptation. In real-world scenarios, multiple datasets may come from batteries made of different materials and operating under different conditions. These datasets may not only differ from the target domain but also have distributional differences between each other. Simply treating multiple source domain data as a single source domain does not achieve optimal results. This failure to consider the distributional differences and correlations between source domains can lead to negative transfer issues. Summary of the Invention
[0006] The purpose of the present invention is to provide a lithium battery state of charge estimation method for lithium-ion battery cross-domain SOC estimation in multi-source domains.
[0007] The technical solution adopted in the present invention is:
[0008] A lithium battery state-of-charge estimation method obtains a battery dataset under different operating conditions, pre-processes it, divides it into multiple source domain data and one target domain data, and constructs multiple joint network structures consisting of bidirectional LSTMs and attention mechanisms to process the battery dataset in pre-training and transfer stages to obtain lithium battery state-of-charge estimation results. The joint network structure includes a feature extractor and an estimator.
[0009] During the pre-training phase, the feature extractor of the joint network structure captures the long-term dependencies between battery feature sequences in multiple source domains, allowing the model to focus on the important parts of the input features and mapping the battery data into different feature spaces.
[0010] In the migration stage, the definition of multi-source domain adaptation is given, and then the target domain data is input into the joint neural network for transfer learning. After passing through the feature extractor, the distributions of the source domain and the target domain are aligned in multiple feature spaces to learn multiple domain-invariant features; the SOC estimators of each domain are aligned. Multiple estimators have different mapping relationships between battery features and SOC values, and ultimately different estimation results are obtained; by constraining the estimation results of different estimators, the estimation results of multiple estimators are aligned to form the lithium battery state of charge estimation result.
[0011] Furthermore, the pre-training performance of the joint network structure was evaluated in the pre-training stage; the Pan battery dataset was selected as the training set and test set of the model, one driving cycle was used as the test set, and the remaining operating cycle data were used as the training set of the model; in the joint network structure, the number of layers of each BiLSTM layer was 1, the number of hidden units was set to 50, and there were 50 neurons in the FC layer.
[0012] Furthermore, the specific method includes the following steps:
[0013] Step 1: obtain a battery data set of lithium batteries under different working conditions and pre-process it into multiple source domain data and one target domain data;
[0014] Step 2: Construct multiple joint network structures consisting of bidirectional LSTM and attention mechanism, and process the battery dataset by the joint network structure; the joint network structure includes feature extractor and estimator;
[0015] Step 3: Input multiple source domain data into their respective joint neural networks for pre-training;
[0016] Step 4: Define multi-source domain adaptation, where the feature extractor captures the long-term dependencies between battery feature sequences in multiple source domains, focuses the model on the important parts of the input features, and maps the battery data into different feature spaces.
[0017] Step 5: Input the target domain data into the joint neural network for transfer learning. After passing through the feature extractor, the distributions of the source and target domains are aligned in multiple feature spaces to learn multiple domain-invariant features.
[0018] In step 6, different estimators obtain their own estimation results, and the estimation results of multiple estimators are aligned to obtain a final SOC estimation as a lithium battery state of charge estimation result.
[0019] Furthermore, the specific steps of step 1 are as follows:
[0020] Step 1-1, collecting battery data sets of lithium batteries under different operating conditions; the battery data sets include urban dynamometer driving schedule (UDDS), highway fuel economy driving schedule (HWFET), Los Angeles 92 (LA92) and Supplemental Federal Test Procedure driving schedule (US06), as well as current, voltage, temperature, and SOC values;
[0021] Step 1-2, preprocessing the battery data using sliding window and normalization methods;
[0022] In steps 1-3, the battery dataset is classified into multiple source domain data and one target domain data.
[0023] Furthermore, in step 1-2, the raw data of the lithium battery is preprocessed using a sliding window method, including the following steps:
[0024] In step 1-2-1, let the length of the data sequence be T and the length of the time window be W. The data used to train the network is:
[0025] {(x1,y1),…,(x N ,y N )}, where N = T - W + 1;
[0026] Step 1-2-2, for the i-th input sequence x i ={Φ i,1 ,…,Φ i,W}, where Φ i,t =(Vt, It, Tt) represents the battery voltage, current, and temperature measured at time step t;
[0027] Steps 1-2-3, corresponding to battery characteristics x i Battery label i For the real SOC of the battery in the last time step, applying the sliding window algorithm to SOC estimation enables the network to better learn past information and better understand the model and trend of the time series.
[0028] Furthermore, the joint network structure in step 2 performs the following steps:
[0029] Step 2-1: For the pre-processed battery data X={x1,x2,…,x T}, perform hidden state calculation, the formula is as follows:
[0030]
[0031] where h i,t is the hidden state of time slice i at time t, f Bi represents the model of the BiLSTM layer, c i,t is the input feature at time t, represents the forward hidden state, Represents the backward hidden state;
[0032] Step 2-2, for the hidden state h i,t , calculate the final state information vector, the formula is as follows:
[0033]
[0034]
[0035] Among them, c t is the final state information vector, represents the attention coefficient, is the function for calculating the attention score;
[0036] In steps 2-3, the final state information vector ct of each time step is input into the FC layer to calculate the regression label. The final SOC estimate is generated as follows:
[0037]
[0038] in represents the predicted label, f FC Represents the model of the FC layer.
[0039] Furthermore, step 3 specifically includes the following steps:
[0040] Step 3-1, the learning objectives of the pre-training phase can be defined as:
[0041]
[0042] where θ s represents the parameters of the source pre-trained model, are the true value label and the predicted label, and l is the loss function.
[0043] In step 3-2, we select mean square error (MSE) as the loss function. The MSE formula is as follows:
[0044]
[0045] Furthermore, step 4 includes the following steps:
[0046] Step 4-1: define the battery discharge data under different battery types, different discharge strategies or different usage environments as source domain and target domain; in multi-source domain transfer learning, there are N different source domain distributions, denoted as The formula for the j-th source domain data and target domain data is as follows:
[0047]
[0048] is the jth source domain data, is the target domain data, N sj and N T are the number of samples of the jth source domain data and target domain data, x i is the characteristic vector of the lithium-ion battery, which is the voltage, current and temperature of the lithium battery in this work, y j is with x i The corresponding label is the SOC value of the lithium battery.
[0049] Step 4-2, define multi-source domain adaptation: given multiple source domains and a target domain D T ,The goal of domain adaptation is when the feature space and the category space are the same, that is, XSj=XT, YSj=YT;
[0050] Step 4-3: When the joint probability distribution is different, that is, PSj(x,y)≠PT(x,y), use the source domain data to learn a prediction function on the target domain: f:xT→yT, so that f has the smallest prediction error on the target domain;
[0051] In step 4-4, multi-source domain adaptation is described as the following optimization problem:
[0052]
[0053] in, Represents the loss function in the target domain, which is used to measure the error of the prediction; λ is a tuning parameter used to balance the target domain loss and the distribution difference between the source domain and the target domain; Used to measure the distribution difference between them; F is the function space of the mapping function, which consists of neural networks or other machine learning models; the solution f* of the optimization problem represents the optimal mapping function found, which is used to make predictions in the target domain.
[0054] Furthermore, step 5 includes the following steps:
[0055] In step 5-1, the BiLSTM layer and the self-attention layer serve as feature extractors. The target domain data is input into the two feature extractors to generate their respective feature spaces. The feature distribution of the source domain and the target domain is expressed as follows:
[0056]
[0057] in, is the feature distribution of the j-th source domain, F T is the feature distribution of the target domain, n Sj is the number of features of the j-th source domain, n T is the number of features of the target domain;
[0058] Step 5-2: Align the feature distribution between the source domain and the target domain in each feature space to reduce the domain difference;
[0059] In step 5-3, MDG constructs a joint loss function for feature alignment. The loss function includes the contributions of Coral and MMD to address the distribution differences between domains. Specifically, the steps are as follows:
[0060] In step 5-3-1, the loss function of the Coral method is as follows:
[0061]
[0062] Among them, C S Represents the covariance matrix of the source domain features, C T represents the covariance matrix of the target domain, |||| F represents the Frobenius norm, d represents the dimension of the feature;
[0063] In step 5-3-2, the formula for the MMD between the feature distribution of the j-th source domain and the feature distribution of the target domain is expressed as follows:
[0064]
[0065] in represents the binorm operation in the reproducing kernel Hilbert space (RKHS), φ() is the mapping function in the RKHS, usually a kernel function;
[0066] In step 5-3-3, the joint loss function constructed in the MDG method includes the contributions of both Coral and MMD, so the loss function for minimizing the domain difference is as follows:
[0067]
[0068] Where N is the number of source domains.
[0069] Furthermore, the specific steps of step 6 are as follows:
[0070] In step 6-1, a method of minimizing the estimated difference is used to take the square value of the difference between the outputs of all estimators of the target domain data as the difference loss. The loss function is as follows:
[0071]
[0072] Where N is the number of estimators, and The scores are the estimated values output by the i-th and j-th estimators;
[0073] In step 6-2, the estimation differences between multiple estimators are reduced by minimizing the loss value, and the average value of the outputs of all estimators is calculated as the final estimation result.
[0074] Furthermore, it also includes step 7, evaluating the output result by using the root mean square error and the mean absolute error as performance evaluation indicators.
[0075] Furthermore, step 7 includes the following steps:
[0076] In the migration phase, the loss function of the present invention consists of three parts: prediction loss, minimizing domain difference loss, and minimizing estimation difference loss. By minimizing the prediction loss, the network can accurately estimate the data. By minimizing the domain difference loss, the domain invariant representation is learned. By minimizing the estimation difference loss, the difference between estimators is reduced. The total loss function of the migration phase is:
[0077]
[0078] The present invention uses root mean square error (RMSE) and mean absolute error (MAE) as performance evaluation indicators to evaluate the performance of the proposed method in cross-domain SOC estimation:
[0079]
[0080] The present invention adopts the above technical solution to obtain the battery data set of lithium batteries under different working conditions, which is divided into multiple source domain data and one target domain data after pre-processing, and construct multiple joint network structures composed of bidirectional LSTM and attention mechanism to process the battery data set in the pre-training stage and the migration stage to obtain the lithium battery state of charge estimation result. In the pre-training stage, the source domain data are respectively input into the feature extractor composed of bidirectional long short-term memory network and self-attention mechanism to obtain the feature value of each source domain. In the migration stage, the final SOC estimation value of the target domain is generated by aligning multiple spatial features and minimizing the estimation difference. In the migration scenarios under different temperatures, different material batteries, and changing ambient temperatures, the SOC estimation effect of the present invention is better than other traditional methods, and can achieve accurate and reliable SOC estimation.
[0081] The present invention uses a multi-source domain migration network for cross-domain SOC estimation of lithium-ion batteries in a multi-source domain situation. Compared with the traditional open circuit voltage method, ampere-hour integration method and Kalman filter method, the present invention does not need to analyze the internal structure of the battery, and does not require knowledge of professional battery methods. Compared with the deep learning method, it does not require a large amount of data for experiments. This method adopts a domain-adaptive multi-source domain method, which can effectively reduce the distribution differences between different source domains. By training on multiple source domains, this method is more likely to learn common features, so that the model has better generalization capabilities on unseen target domains, greatly improving the accuracy of SOC estimation. The estimation algorithm of the present invention can be applied to the state of charge estimation of lithium batteries in actual battery management systems, thereby improving the accuracy of battery state of charge estimation. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments;
[0083] Figure 1 Schematic diagram of the SOC estimation model based on the multi-source domain migration network;
[0084] Figure 2 Schematic diagram of the network structure of the feature extractor and estimator. DETAILED DESCRIPTION
[0085] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0086] like Figure 1As shown in 2, the present invention discloses a method for estimating the state of charge of a lithium battery, which obtains a battery data set under different working conditions, pre-processes it and divides it into multiple source domain data and one target domain data, and constructs multiple joint network structures composed of bidirectional LSTM and attention mechanism to perform pre-training and migration phases on the battery data set to obtain the lithium battery state of charge estimation result, and the joint network structure includes a feature extractor and an estimator;
[0087] During the pre-training phase, the feature extractor of the joint network structure captures the long-term dependencies between battery feature sequences in multiple source domains, allowing the model to focus on the important parts of the input features and mapping the battery data into different feature spaces.
[0088] In the migration stage, the definition of multi-source domain adaptation is given, and then the target domain data is input into the joint neural network for transfer learning. After passing through the feature extractor, the distributions of the source domain and the target domain are aligned in multiple feature spaces to learn multiple domain-invariant features; the SOC estimators of each domain are aligned. Multiple estimators have different mapping relationships between battery features and SOC values, and ultimately different estimation results are obtained; by constraining the estimation results of different estimators, the estimation results of multiple estimators are aligned to form the lithium battery state of charge estimation result.
[0089] Furthermore, the pre-training performance of the joint network structure was evaluated in the pre-training stage; the Pan battery dataset was selected as the training set and test set of the model, one driving cycle was used as the test set, and the remaining operating cycle data were used as the training set of the model; in the joint network structure, the number of layers of each BiLSTM layer was 1, the number of hidden units was set to 50, and there were 50 neurons in the FC layer.
[0090] Furthermore, the specific method includes the following steps:
[0091] Step 1: obtain a battery data set of lithium batteries under different working conditions and pre-process it into multiple source domain data and one target domain data;
[0092] Step 2: Construct multiple joint network structures consisting of bidirectional LSTM and attention mechanism, and process the battery dataset by the joint network structure; the joint network structure includes feature extractor and estimator;
[0093] Step 3: Input multiple source domain data into their respective joint neural networks for pre-training;
[0094] Step 4: Define multi-source domain adaptation, where the feature extractor captures the long-term dependencies between battery feature sequences in multiple source domains, focuses the model on the important parts of the input features, and maps the battery data into different feature spaces.
[0095] Step 5: Input the target domain data into the joint neural network for transfer learning. After passing through the feature extractor, the distributions of the source and target domains are aligned in multiple feature spaces to learn multiple domain-invariant features.
[0096] In step 6, different estimators obtain their own estimation results, and the estimation results of multiple estimators are aligned to obtain a final SOC estimation as a lithium battery state of charge estimation result.
[0097] Furthermore, the specific steps of step 1 are as follows:
[0098] Step 1-1, collecting battery data sets of lithium batteries under different operating conditions; the battery data sets include urban dynamometer driving schedule (UDDS), highway fuel economy driving schedule (HWFET), Los Angeles 92 (LA92) and Supplemental Federal Test Procedure driving schedule (US06), as well as current, voltage, temperature, and SOC values;
[0099] Step 1-2, preprocessing the battery data using sliding window and normalization methods;
[0100] In steps 1-3, the battery dataset is classified into multiple source domain data and one target domain data.
[0101] Furthermore, in step 1-2, the raw data of the lithium battery is preprocessed using a sliding window method, including the following steps:
[0102] In step 1-2-1, let the length of the data sequence be T and the length of the time window be W. The data used to train the network is:
[0103] {(x1,y1),…,(x N ,y N )}, where N = T - W + 1;
[0104] Step 1-2-2, for the i-th input sequence x i ={Φ i,1 ,…,Φ i,W}, where Φ i,t =(Vt, It, Tt) represents the battery voltage, current, and temperature measured at time step t;
[0105] Steps 1-2-3, corresponding to battery characteristics x i Battery label i For the real SOC of the battery in the last time step, applying the sliding window algorithm to SOC estimation enables the network to better learn past information and better understand the model and trend of the time series.
[0106] Furthermore, the joint network structure in step 2 performs the following steps:
[0107] Step 2-1: For the pre-processed battery data X={x1,x2,…,x T}, perform hidden state calculation, the formula is as follows:
[0108]
[0109] where h i,t is the hidden state of time slice i at time t, f Bi represents the model of the BiLSTM layer, c i,t is the input feature at time t, represents the forward hidden state, Represents the backward hidden state;
[0110] Step 2-2, for the hidden state h i,t , calculate the final state information vector, the formula is as follows:
[0111]
[0112]
[0113] Among them, c t is the final state information vector, β t k represents the attention coefficient, is the function for calculating the attention score;
[0114] In steps 2-3, the final state information vector ct of each time step is input into the FC layer to calculate the regression label. The final SOC estimate is generated as follows:
[0115]
[0116] in represents the predicted label, f FC Represents the model of the FC layer.
[0117] Furthermore, step 3 specifically includes the following steps:
[0118] Step 3-1, the learning objectives of the pre-training phase can be defined as:
[0119]
[0120] where θ S represents the parameters of the source pre-trained model, are the true value label and the predicted label, and l is the loss function.
[0121] In step 3-2, we select mean square error (MSE) as the loss function. The MSE formula is as follows:
[0122]
[0123] Furthermore, step 4 includes the following steps:
[0124] Step 4-1: define the battery discharge data under different battery types, different discharge strategies or different usage environments as source domain and target domain; in multi-source domain transfer learning, there are N different source domain distributions, denoted as The formula for the j-th source domain data and target domain data is as follows:
[0125]
[0126] is the jth source domain data, is the target domain data, N Sj and N T are the number of samples of the jth source domain data and target domain data, x i is the characteristic vector of the lithium-ion battery, which is the voltage, current and temperature of the lithium battery in this work, y j is with x i The corresponding label is the SOC value of the lithium battery.
[0127] Step 4-2, define multi-source domain adaptation: given multiple source domains and a target domain D T ,The goal of domain adaptation is when the feature space and the category space are the same, that is, XSj=XT, YSj=YT;
[0128] Step 4-3: When the joint probability distribution is different, that is, PSj(x,y)≠PT(x,y), use the source domain data to learn a prediction function on the target domain: f:xT→yT, so that f has the smallest prediction error on the target domain;
[0129] In step 4-4, multi-source domain adaptation is described as the following optimization problem:
[0130]
[0131] in, Represents the loss function in the target domain, which is used to measure the error of the prediction; λ is a tuning parameter used to balance the target domain loss and the distribution difference between the source domain and the target domain; Used to measure the distribution difference between them; F is the function space of the mapping function, which consists of neural networks or other machine learning models; the solution f* of the optimization problem represents the optimal mapping function found, which is used to make predictions in the target domain.
[0132] Furthermore, step 5 includes the following steps:
[0133] In step 5-1, the BiLSTM layer and the self-attention layer serve as feature extractors. The target domain data is input into the two feature extractors to generate their respective feature spaces. The feature distribution of the source domain and the target domain is expressed as follows:
[0134]
[0135] in, is the feature distribution of the j-th source domain, F T is the feature distribution of the target domain, n Sj is the number of features of the j-th source domain, n T is the number of features of the target domain;
[0136] Step 5-2: Align the feature distribution between the source domain and the target domain in each feature space to reduce the domain difference;
[0137] In step 5-3, MDG constructs a joint loss function for feature alignment. The loss function includes the contributions of Coral and MMD to address the distribution differences between domains. Specifically, the steps are as follows:
[0138] In step 5-3-1, the loss function of the Coral method is as follows:
[0139]
[0140] Among them, C S Represents the covariance matrix of the source domain features, C T represents the covariance matrix of the target domain, |||| F represents the Frobenius norm, d represents the dimension of the feature;
[0141] In step 5-3-2, the formula for the MMD between the feature distribution of the j-th source domain and the feature distribution of the target domain is expressed as follows:
[0142]
[0143] in represents the binorm operation in the reproducing kernel Hilbert space (RKHS), φ() is the mapping function in the RKHS, usually a kernel function;
[0144] In step 5-3-3, the joint loss function constructed in the MDG method includes the contributions of both Coral and MMD, so the loss function for minimizing the domain difference is as follows:
[0145]
[0146] Where N is the number of source domains.
[0147] Furthermore, the specific steps of step 6 are as follows:
[0148] In step 6-1, a method of minimizing the estimated difference is used to take the square value of the difference between the outputs of all estimators of the target domain data as the difference loss. The loss function is as follows:
[0149]
[0150] Where N is the number of estimators, and The scores are the estimated values output by the i-th and j-th estimators;
[0151] In step 6-2, the estimation differences between multiple estimators are reduced by minimizing the loss value, and the average value of the outputs of all estimators is calculated as the final estimation result.
[0152] Furthermore, it also includes step 7, evaluating the output result by using the root mean square error and the mean absolute error as performance evaluation indicators.
[0153] Furthermore, step 7 includes the following steps:
[0154] In the migration phase, the loss function of the present invention consists of three parts: prediction loss, minimizing domain difference loss, and minimizing estimation difference loss. By minimizing the prediction loss, the network can accurately estimate the data. By minimizing the domain difference loss, the domain invariant representation is learned. By minimizing the estimation difference loss, the difference between estimators is reduced. The total loss function of the migration phase is:
[0155]
[0156] The present invention uses root mean square error (RMSE) and mean absolute error (MAE) as performance evaluation indicators to evaluate the performance of the proposed method in cross-domain SOC estimation:
[0157]
[0158] The present invention adopts the above technical solution and uses the multi-source domain migration network for cross-domain SOC estimation of lithium-ion batteries in multi-source domain situations. Compared with the traditional open circuit voltage method, ampere-hour integration method and Kalman filter method, the present invention does not need to analyze the internal structure of the battery, and does not require knowledge of professional battery methods. Compared with deep learning methods, it does not require a large amount of data for experiments. This method adopts a domain-adaptive multi-source domain method, which can effectively reduce the distribution differences between different source domains. By training on multiple source domains, this method is more likely to learn common features, so that the model has better generalization capabilities on unseen target domains, greatly improving the accuracy of SOC estimation. The estimation algorithm of the present invention can be applied to the state of charge estimation of lithium batteries in actual battery management systems, thereby improving the accuracy of battery state of charge estimation.
[0159] Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of the present application is not intended to limit the scope of the application for protection, but merely represents the selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
Claims
1. A method for estimating the state of charge of a lithium battery, characterized by: A battery dataset of lithium batteries under different operating conditions is obtained and preprocessed into multiple source domain data and one target domain data. Multiple joint network structures consisting of bidirectional LSTM and attention mechanisms are constructed to process the battery dataset in the pre-training and transfer stages to obtain the lithium battery state of charge estimation results. The joint network structure includes a feature extractor and an estimator. During the pre-training phase, the feature extractor of the joint network structure captures the long-term dependencies between battery feature sequences in multiple source domains, allowing the model to focus on the important parts of the input features and mapping the battery data into different feature spaces. In the transfer phase, we define multi-source domain adaptation. Then, we input the target domain data into a joint neural network for transfer learning. After passing through a feature extractor, we align the distributions of the source and target domains in multiple feature spaces to learn multiple domain-invariant features. Align the SOC estimators in each domain. Multiple estimators have different mapping relationships between battery characteristics and SOC values, ultimately obtaining different estimation results. By constraining the estimation results of different estimators, the estimation results of multiple estimators are aligned to form a lithium battery state of charge estimation result; The method specifically comprises the following steps: Step 1: Obtain a battery data set of lithium batteries under different working conditions and pre-process it into multiple source domain data and one target domain data. The specific steps of step 1 are as follows: Step 1-1, collect battery data sets of lithium batteries under different working conditions; The battery data set includes the Urban Dynamometer Driving Schedule (UDDS), Highway Fuel Economy Driving Schedule (HWFET), Los Angeles 92 (LA92), and Supplemental Federal Test Procedure Driving Schedule (US06), as well as current, voltage, temperature, and SOC values. In steps 1-2, the battery data is preprocessed using a sliding window and normalization method. Steps 1-3: classify the battery dataset into multiple source domain data and one target domain data; Step 2: Construct multiple joint network structures consisting of bidirectional LSTM and attention mechanism, and process the battery dataset by the joint network structure; the joint network structure includes feature extractor and estimator; Step 3: Input multiple source domain data into their respective joint neural networks for pre-training; Step 4: Define multi-source domain adaptation, where the feature extractor captures the long-term dependencies between battery feature sequences in multiple source domains, focuses the model on the important parts of the input features, and maps the battery data into different feature spaces. Step 5: Input the target domain data into the joint neural network for transfer learning. After passing through the feature extractor, the distributions of the source and target domains are aligned in multiple feature spaces to learn multiple domain-invariant features. In step 6, different estimators obtain their own estimation results, and the estimation results of multiple estimators are aligned to obtain a final SOC estimation as a lithium battery state of charge estimation result.
2. The method for estimating the state of charge of a lithium battery according to claim 1, wherein: The pre-training performance of the joint network structure was evaluated in the pre-training stage. The Pan battery dataset was selected as the training and test sets of the model, with one driving cycle as the test set and the remaining operating cycle data as the training set of the model. In the joint network structure, the number of layers of each BiLSTM layer was 1, the number of hidden units was set to 50, and there were 50 neurons in the FC layer.
3. The method for estimating the state of charge of a lithium battery according to claim 1, wherein: In step 1-2, the sliding window method is used to preprocess the raw data of lithium batteries, including the following steps: Step 1-2-1, let the length of the data sequence be T, the length of the time window be W, and the data used to train the network are: {(x1,y1),…,(x N ,y N )}, where N = T - W + 1; Step 1-2-2, for the i-th input sequence x i ={Φ i,1 ,…,Φ i,W }, where Φ i,t =(Vt, It, Tt) represents the battery voltage, current, and temperature measured at time step t; Steps 1-2-3, corresponding to battery characteristics x i Battery label i For the real SOC of the battery in the last time step, applying the sliding window algorithm to SOC estimation enables the network to better learn past information and better understand the model and trend of the time series.
4. The method for estimating the state of charge of a lithium battery according to claim 1, wherein: In step 2, the joint network structure performs the following steps: Step 2-1: For the pre-processed battery data X={x1,x2,…,x T }, perform hidden state calculation, the formula is as follows: where h i,t is the hidden state of time slice i at time t, f Bi represents the model of the BiLSTM layer, c i,t is the input feature at time t, represents the forward hidden state, Represents the backward hidden state; Step 2-2, for the hidden state h i,t , calculate the final state information vector, the formula is as follows: Among them, c t is the final state information vector, represents the attention coefficient, is the function for calculating the attention score; In steps 2-3, the final state information vector ct of each time step is input into the FC layer to calculate the regression label. The final SOC estimate is generated as follows: in represents the predicted label, f FC Represents the model of the FC layer.
5. The method for estimating the state of charge of a lithium battery according to claim 1, wherein: Step 3 specifically includes the following steps: Step 3-1, the learning objectives of the pre-training phase can be defined as: where θ S represents the parameters of the source pre-trained model, y, are the true value labels and predicted labels, l is the loss function; In step 3-2, we select mean square error (MSE) as the loss function. The MSE formula is as follows:
6. The method for estimating the state of charge of a lithium battery according to claim 1, wherein: Step 4 includes the following steps: Step 4-1: define the battery discharge data under different battery types, different discharge strategies or different usage environments as source domain and target domain; in multi-source domain transfer learning, there are N different source domain distributions, denoted as The formula for the j-th source domain data and target domain data is as follows: is the jth source domain data, is the target domain data, N Sj and N T are the number of samples of the jth source domain data and target domain data, x i is the characteristic vector of lithium-ion battery, y j is with x i The corresponding label is the SOC value of the lithium battery; Step 4-2, define multi-source domain adaptation: given multiple source domains and a target domain D T , the goal of domain adaptation is to make the feature space and the category space the same, that is, X Sj =X t ,Y Sj =Y T ; Step 4-3, when the joint probability distribution is different, that is, P Sj (x,y)≠P T (x,y), use the source domain data to learn a prediction function on the target domain: f:xT→yT, so that f has the smallest prediction error on the target domain; In step 4-4, multi-source domain adaptation is described as the following optimization problem: in, Represents the loss function in the target domain, which is used to measure the error of the prediction; λ is a tuning parameter used to balance the target domain loss and the distribution difference between the source domain and the target domain; Used to measure the distribution difference between them; F is the function space of the mapping function, which consists of neural networks or other machine learning models; the solution f* of the optimization problem represents the optimal mapping function found, which is used to make predictions in the target domain.
7. The method for estimating the state of charge of a lithium battery according to claim 1, wherein: Step 5 includes the following steps: In step 5-1, the BiLSTM layer and the self-attention layer serve as feature extractors. The target domain data is input into the two feature extractors to generate their respective feature spaces. The feature distribution of the source domain and the target domain is expressed as follows: in, is the feature distribution of the j-th source domain, F T is the feature distribution of the target domain, n Sj is the number of features of the j-th source domain, n T is the number of features of the target domain; Step 5-2: Align the feature distribution between the source domain and the target domain in each feature space to reduce the domain difference; In step 5-3, MDG constructs a joint loss function for feature alignment. The loss function includes the contributions of Coral and MMD to address the distribution differences between domains. Specifically, the steps are as follows: In step 5-3-1, the loss function of the Coral method is as follows: Among them, C S Represents the covariance matrix of the source domain features, C T represents the covariance matrix of the target domain, |||| F represents the Frobenius norm, d represents the dimension of the feature; In step 5-3-2, the formula for the MMD between the feature distribution of the j-th source domain and the feature distribution of the target domain is expressed as follows: in represents the binorm operation in the reproducing kernel Hilbert space (RKHS), φ() is the mapping function in the RKHS, usually a kernel function; In step 5-3-3, the joint loss function constructed in the MDG method includes the contributions of both Coral and MMD, so the loss function for minimizing the domain difference is as follows: Where N is the number of source domains.
8. The method for estimating the state of charge of a lithium battery according to claim 1, wherein: The specific steps of step 6 are as follows: In step 6-1, a method of minimizing the estimated difference is used to take the square value of the difference between the outputs of all estimators of the target domain data as the difference loss. The loss function is as follows: Where N is the number of estimators, and The scores are the estimated values output by the i-th and j-th estimators; In step 6-2, the estimation differences between multiple estimators are reduced by minimizing the loss value, and the average value of the outputs of all estimators is calculated as the final estimation result.
Citation Information
Patent Citations
Electric vehicle lithium battery SOH estimation method based on multi-source transfer learning
CN116859247A
Lithium ion battery capacity estimation method based on multi-source weighted domain self-adaption
CN117169728A