A lithium-ion battery state-of-charge state estimation method
Patent Information
- Application Number
- CN202410009389.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2044-01-02
AI Technical Summary
[0006]有鉴于现有技术存在的不足,本发明提供了一种基于源域选择和注意力机制的锂离子电池电荷状态估计方法,解决电池SOC估计中存在的数据量不足问题以及样本分布差异问题
[0065] 1. This invention proposes a method based on source domain selection and attention mechanisms for SOC estimation of lithium batteries. First, a joint network structure is established to extract bidirectional time-varying features from battery data under different operating conditions within the source domain, focusing the model on important information. Second, based on the similarity between the target domain data and the source domain data, different operating conditions are considered as different source domains. Source domains with high similarity to the target domain data are selected from multiple source domains, and the model is pre-trained. Finally, the distribution adaptation (MMD) method is used to calibrate the domain-shared features, reducing the distribution differences between the source and target domains at different scales.
Smart Images

Figure CN117825992B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of battery management system technology, and specifically proposes a method for estimating the state of charge of a lithium-ion battery. Background Technology
[0002] Given the severity of oil consumption and the deepening environmental impact of greenhouse gases, countries worldwide are actively promoting the development of electric vehicles. As an indispensable component in the practical use of electric vehicles, the Battery Management System (BMS) plays a particularly important role. Estimating the battery's state of charge (SOC) is one of the most crucial functions of an electric vehicle BMS, directly affecting battery performance. Therefore, accurate SOC estimation not only protects the battery from overcharging or over-discharging, extending its lifespan, but also provides reasonable control strategies for applications, thereby achieving energy conservation.
[0003] Battery state-of-charge (SOC) estimation has become a widely researched topic, leading to the development of numerous accurate SOC estimation methods. There are four main approaches: open-circuit voltage method, coulomb counting method, model-based methods, and data-driven methods. Among these, data-driven methods use battery current, voltage, and other data as features to learn the nonlinear relationship between these features and battery SOC, requiring no knowledge of battery-related fields or mathematical modeling.
[0004] Deep learning-based methods have demonstrated powerful capabilities in SOC estimation, but their generalization ability is weak in the real world due to difficulties in acquiring battery data and the diversity of battery usage environments. Transfer learning offers a solution to these problems, aiming to transfer knowledge from one domain to another related domain. By transferring learned knowledge and experience from one or more source domains to the target domain, it improves the performance and generalization ability of the target domain. Unlike traditional machine learning, transfer learning does not learn the target task from scratch, but rather leverages existing knowledge to accelerate the learning of the target task and improve its accuracy.
[0005] In transfer learning, three core questions need to be addressed: when to transfer, where to transfer, and how to transfer. However, current research on lithium-ion battery SOC estimation based on transfer learning often neglects the "where to transfer" question, i.e., it ignores the similarity between the source and target domains. This neglect may lead to insufficient screening or classification of pre-training data, treating all available data except the target domain as the source domain. In this case, the parameters of the resulting pre-trained model often differ significantly from the optimal solution, causing the domain adaptation phase to require more time for model training to converge. Ultimately, the accuracy of the resulting model may not reach the desired level. Therefore, future research needs to pay more attention to the "where to transfer" question to improve the effectiveness of transfer learning and the accuracy of the model. Summary of the Invention
[0006] In view of the shortcomings of the existing technology, the present invention provides a lithium-ion battery charge state estimation method based on source domain selection and attention mechanism, which solves the problems of insufficient data and sample distribution differences in battery SOC estimation.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is: a method for estimating the state of charge of a lithium-ion battery, comprising at least the following steps:
[0008] S1. Preprocess the collected lithium-ion battery feature data; define the source domain and target domain, and define the batteries other than the target battery as the source domain; cluster the features of the source domain batteries and the target batteries into two categories, and use the batteries belonging to the same category as the target battery as the pre-training dataset.
[0009] S2. Select a matching source domain for pre-training based on the similarity between the source domain and the target domain;
[0010] S3. Construct a neural network to extract bidirectional temporal features of the battery and process the extracted features based on an attention mechanism to capture important information in the temporal sequence;
[0011] S4. Use the MMD method for domain adaptation to reduce the distribution difference between the source and target domains;
[0012] S5. By reducing the distribution between domains through domain adaptation and optimizing the network parameters based on differences, the state of charge of the lithium-ion battery can be estimated.
[0013] Furthermore, step S2 also includes the following step: using a similarity-based source domain selection method, with DTW as the standard to measure the current and voltage sequences of the battery, to ensure the similarity between different domains.
[0014] Furthermore, step S4 also includes the steps of: performing domain adaptation using data from the target domain, backpropagating the calculated distribution error to the optimization objective using the MMD algorithm, optimizing the network parameters of the pre-trained estimator, and minimizing the feature distribution difference between the source and target domains by using a non-parametric distance metric.
[0015] Furthermore, the process includes the following steps: pre-training the model using the selected source domain cells, i.e., using Adam as the optimizer, evaluating the network's estimation results with MSE, and backpropagating the obtained Loss to optimize the network's parameters.
[0016] Furthermore, transfer learning is performed using target domain data, which involves transferring the model parameters trained in the source domain to the target domain as the initial model, and then using the target domain data for secondary training of the network.
[0017] The distribution difference between the source and target domains is measured using MMD, and domain adaptation is performed to optimize network parameters by reducing the distance between the source and target domains.
[0018] Furthermore, step S5 also includes the following step: during the estimation process, based on the attention mechanism and bidirectional network structure, the bidirectional time features of the battery are extracted and the significant information in the sequence is focused, thereby improving the estimation accuracy of the lithium battery SOC.
[0019] Furthermore, in step S1, the current and voltage data of the lithium battery are preprocessed, specifically as follows:
[0020] A sliding window approach is used to process battery data, transforming the original two-dimensional battery data into three-dimensional data. Let the sequence length be T and the time window size be W, then the training network data is {(x1,y1),…,(x...}. N ,y N )}, where N = T - W + 1; for the i-th input sequence x i ={Φ i,1 ,…,Φ i,W}, where Φ i,t = (Vt, It) represents the battery voltage and current measured at time step t; corresponding to battery characteristic x i Battery label y i The actual SOC of the battery at the last time step.
[0021] Furthermore, in step S2, a matching source domain is selected for pre-training based on the similarity between the source domain and the target domain. Specifically, the cluster size of the time series clustering algorithm is set to 2.
[0022] Initialize the cluster center by randomly selecting data from two batteries as the cluster center, denoted as {u1, u2};
[0023] Calculate the data x for each battery i The similarity with each cluster center is calculated, and the similarity is measured using the Dynamic Time Warping (DTW) algorithm. Data points are then assigned to the clusters with the closest proximity.
[0024]
[0025] Among them, c i It is battery data x i The index assigned to the cluster, DTW(x) i ,μ k ) is x i With cluster center μ k The DTW distance is calculated as follows:
[0026]
[0027] For each cluster, calculate the average of all battery data in that cluster and use it as the new cluster center;
[0028]
[0029] Among them, S k ={i|c i =k} represents the set of indices of the data points assigned to cluster k;
[0030] Repeatedly calculate the distance from the battery data to each cluster center, reallocate the clusters, and update the cluster centers until the cluster centers no longer change, or the predetermined number of iterations is reached;
[0031] All source and target domain data were divided into two clusters, and data of the same type as the target domain battery data were selected as pre-training data.
[0032] Furthermore, in step S3, a network is constructed to extract the bidirectional temporal features of the battery and highlight significant information within the sequence, and output the SOC value. The specific method is as follows:
[0033] For battery data X = {x1, x2, ..., x...} T}, perform forward and backward calculations separately. The forward calculation formula is as follows:
[0034] Input Gate:
[0035] i t =σ(W ix x t +W ih h t-1 +b i (4)
[0036] Forgotten Gate:
[0037] f t =σ(W fx x t +W fh h t-1 +b f (5)
[0038] Output gate:
[0039] o t =σ(W ox x t +W oh h t-1 +b o (6)
[0040] Renewal of memory cells:
[0041]
[0042] Update cell status:
[0043]
[0044] Update of hidden state:
[0045] h t =o t ☉tanh(C t (9)
[0046] The formula for backward computation is the same as that for forward computation, except that the sequence from T to 1 is input into the network;
[0047] Finally, the results of the forward and backward calculations are combined and output as follows:
[0048]
[0049]
[0050]
[0051] in, This represents the hidden state propagated forward at time t. h represents the hidden state propagated forward at time t; t The final hidden state is the concatenation of forward and backward propagation;
[0052] Then obtain the hidden state h at the i-th time step. i Calculate its attention score for all time steps:
[0053] u i =W a h i +b a (13)
[0054] Among them W a and b a These are learnable parameters used to adjust the hidden state h. i First, the attention scores are mapped to the attention score space. Then, the attention scores are normalized using the softmax function to obtain the attention weights.
[0055] a i =softmax(u i (14)
[0056] Finally, the hidden states at all time steps and their corresponding attention weights (ai) are summed in a weighted manner to obtain the final attention layer output:
[0057]
[0058] The final value of c is the estimated SOC value.
[0059] Furthermore, in step S4, the main purpose of the transfer learning method for SOC is to transfer knowledge learned in one domain to another. The existing knowledge is called the source domain, and the new knowledge to be learned is defined as the target domain. A kernel function maps the features of the source domain and the target domain to a higher-dimensional space, reducing their distance in that space. The distance is calculated using the Maximum Mean Difference (MMD), and its formula is as follows:
[0060]
[0061] x s x t N represents the source domain data and the target domain data, respectively. s and N t For x s and x t The length of the feature representation; the entire formula represents the maximum distance between two data domains in the reproducing kernel Hilbert space; the loss function in the transfer learning process is defined as:
[0062]
[0063] SOC r and SOC′ r For the estimated SOC and the true SOC at time step t, N t The total length of the observed data is taken as a hyperparameter. It is necessary to first calculate the importance of the distance and the estimation error to determine λ in order to obtain the best estimation results.
[0064] The present invention adopts the above technical solution, and the specific beneficial effects are as follows:
[0065] 1. This invention proposes a method based on source domain selection and attention mechanisms for SOC estimation of lithium batteries. First, a joint network structure is established to extract bidirectional time-varying features from battery data under different operating conditions within the source domain, focusing the model on important information. Second, based on the similarity between the target domain data and the source domain data, different operating conditions are considered as different source domains. Source domains with high similarity to the target domain data are selected from multiple source domains, and the model is pre-trained. Finally, the distribution adaptation (MMD) method is used to calibrate the domain-shared features, reducing the distribution differences between the source and target domains at different scales.
[0066] 2. This invention proposes a source domain selection and transfer learning scheme to address the problems of insufficient data and inconsistent sample distribution in battery SOC estimation. To address the inconsistency in data distribution between different battery domains and the question of where to transfer data, a domain-adaptive network model based on source domain selection is proposed. In this model, a suitable source domain is selected for network pre-training by measuring the similarity between the source and target domains, and this selection is backpropagated along with the error loss. The advantage of this method is that it avoids overfitting caused by excessive data, improves the model's convergence speed, better learns the common features between the source and target domains, and improves the accuracy of SOC estimation.
[0067] 3. A new estimation method is constructed based on the combination of attention mechanism and source domain selection. The percentage improvement in accuracy is evaluated by two indicators: mean absolute error and root mean square error. The experimental results show that the two error indicators of the new prediction method are smaller than those of the method without attention mechanism and without source domain selection, and the percentage improvement in accuracy is significant.
[0068] 4. The estimation algorithm implemented by this invention is applied to battery charge state estimation in actual battery health management systems, thereby improving the accuracy of battery charge state estimation. Attached Figure Description
[0069] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0070] Figure 1 This is a flowchart of the lithium-ion battery charge state estimation method of the present invention;
[0071] Figure 2 This is a diagram of the SOC estimation model based on source domain selection and transfer deep learning in this invention;
[0072] Figure 3 This is the battery data preprocessing diagram based on the sliding window algorithm of this invention;
[0073] Figure 4 This is a network structure diagram of the SOC estimator of this invention. Detailed Implementation
[0074] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0075] Example 1:
[0076] Please see Figure 1 This embodiment provides a method for estimating the state of charge of a lithium-ion battery, which includes at least the following steps:
[0077] S1. Preprocess the collected lithium-ion battery feature data; define the source domain and target domain, and define the batteries other than the target battery as the source domain; cluster the features of the source domain batteries and the target batteries into two categories, and use the batteries belonging to the same category as the target battery as the pre-training dataset.
[0078] S2. Select a matching source domain for pre-training based on the similarity between the source domain and the target domain;
[0079] S3. Construct a neural network to extract bidirectional temporal features of the battery and process the extracted features based on an attention mechanism to capture important information in the temporal sequence;
[0080] S4. Use the MMD method for domain adaptation to reduce the distribution difference between the source and target domains;
[0081] S5. By reducing the distribution between domains through domain adaptation and optimizing the network parameters based on differences, the state of charge of the lithium-ion battery can be estimated.
[0082] As a preferred implementation, step S2 in this embodiment also includes the following step: using a similarity-based source domain selection method, with DTW as the standard to measure the current and voltage sequences of the battery, to ensure the similarity between different domains.
[0083] In a preferred embodiment, step S4 further includes the following steps: performing domain adaptation using data from the target domain, backpropagating the calculated distribution error to the optimization objective using the MMD algorithm, optimizing the network parameters of the pre-trained estimator, and minimizing the feature distribution difference between the source domain and the target domain by using a non-parametric distance metric.
[0084] As a preferred implementation, this embodiment also includes the following steps: pre-training the model using the selected source domain cells, that is, using Adam as the optimizer, evaluating the network's estimation results with MSE, and backpropagating the obtained Loss to optimize the network's parameters.
[0085] As a preferred implementation, this embodiment uses target domain data for transfer learning, that is, the model parameters trained in the source domain are transferred to the target domain as the initial model, and the network is trained a second time using the target domain data; the distribution difference between the source and target domains is measured using MMD to perform domain adaptation, and the network parameters are optimized by reducing the distance between the source and target domains. Step S5 also includes the following step: during the estimation process, based on the attention mechanism and bidirectional network structure, bidirectional time features of the battery are extracted and significant information in the sequence is focused, which improves the estimation accuracy of lithium battery SOC.
[0086] This invention preprocesses the collected lithium-ion battery feature data, dividing batteries with different probability distributions into source and target domains. A suitable source domain is selected for pre-training based on the similarity between the source and target domains, constructing a network to extract bidirectional temporal features and focus on key information within the sequence. Domain adaptation is performed using data from the target domain, and the calculated distribution error is backpropagated using the MMD algorithm as the optimization objective to optimize the network parameters of the pre-trained estimator. The difference in feature distribution between the source and target domains is minimized by using a non-parametric distance metric. Finally, accurate SOC estimation is achieved on the samples requiring estimation. This invention can better extract features from battery sequence data and delivers better performance with less training data, achieving accurate and reliable estimation of lithium battery SOC.
[0087] Example 2:
[0088] like Figure 2 As shown in the figure, as a preferred embodiment, this embodiment discloses a method for estimating the health status of lithium-ion batteries based on transfer learning and deep learning. The specific process is as follows:
[0089] Step 1: Collect battery discharge datasets under different operating conditions; including 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, and SOC values under some other combinations of operating conditions.
[0090] Step 2: Define the source domain and the target domain, and define the batteries other than the target battery as the source domain;
[0091] Step 3: Cluster the features of the source battery and the target battery into two categories. The batteries that belong to the same category as the target battery are used as the pre-training dataset.
[0092] Step 4: Construct a neural network to obtain bidirectional time-varying features from battery current and voltage sequences;
[0093] Step 5: Process the extracted features based on the attention mechanism to capture important information in the time series and ignore unimportant information;
[0094] Step 6: Input the obtained features into the fully connected layer and output the estimated SOC value;
[0095] Step 7: Use the selected source domain cells to pre-train the model, that is, use Adam as the optimizer, evaluate the network's estimation results with MSE, and backpropagate the obtained Loss to optimize the network's parameters.
[0096] Step 8: Use target domain data for transfer learning, that is, transfer the model parameters trained in the source domain to the target domain as the initial model, and use the target domain data for secondary training of the network.
[0097] Step 9: Use MMD to measure the distribution difference between the source and target domains, perform domain adaptation, and optimize network parameters by reducing the distance between the source and target domains as the optimization function.
[0098] Step 10: Evaluate the network model using the remaining data in the target domain.
[0099] In this embodiment, a novel estimation method is constructed based on the combination of attention mechanism and source domain selection. The percentage improvement in accuracy is evaluated by two indicators through actual testing: mean absolute error and root mean square error. Experimental results show that the two error indicators of the novel prediction method are both smaller than those of methods without attention mechanism and without source domain selection, and the percentage improvement in accuracy is significant.
[0100] Example 3:
[0101] This embodiment proposes a method based on source domain selection and attention mechanisms for SOC estimation of lithium batteries. First, a joint network structure is established to extract bidirectional time-varying features from battery data under different operating conditions within the source domain, focusing the model on important information. Second, based on the similarity between the target domain data and the source domain data, different operating conditions are considered as different source domains. Source domains with high similarity to the target domain data are selected from multiple source domains, and the model is pre-trained. Finally, the distribution adaptation (MMD) method is used to calibrate the domain-shared features, reducing the distribution differences between the source and target domains at different scales.
[0102] The objective of this embodiment is achieved through the following technical solution:
[0103] Step 1: Preprocess the current, voltage, and other data of the lithium battery;
[0104] Step two: Measure the similarity between different domains of the battery to select the source domain;
[0105] Step 3: Construct a network to extract bidirectional temporal features of the battery and highlight significant information within the sequence, and perform pre-training;
[0106] Step 4: Use the MMD method for domain adaptation to reduce the distribution difference between the source and target domains;
[0107] Step 5: Output the results using root mean square error, absolute mean error, percentage of absolute error, and mean square error as evaluation indicators.
[0108] Step 6: Construct the complete model, and output the estimation results using mean absolute error and root mean square error as evaluation indicators.
[0109] like Figure 3 As shown, based on the above three embodiments, as a preferred implementation, in step S1 or step one, the current data and voltage data of the lithium battery are preprocessed. The specific method is as follows:
[0110] A sliding window approach is used to process battery data, transforming the original two-dimensional battery data into three-dimensional data. Let the sequence length be T and the time window size be W, then the training network data is {(x1,y1),…,(x...}. N ,y N )}, where N = T - W + 1; for the i-th input sequence x i ={Φ i,1 ,…,Φ i,W}, where Φ i,t = (Vt, It) represents the battery voltage and current measured at time step t; corresponding to battery characteristic x i Battery label y i The actual SOC of the battery at the last time step.
[0111] As a preferred implementation, in step S2 or step two, a matching source domain is selected for pre-training based on the similarity between the source domain and the target domain. Specifically, the cluster size of the time series clustering algorithm is set to 2.
[0112] Initialize the cluster center by randomly selecting data from two batteries as the cluster center, denoted as {u1, u2};
[0113] Calculate the data x for each battery i The similarity with each cluster center is calculated, and the similarity is measured using the Dynamic Time Warping (DTW) algorithm. Data points are then assigned to the clusters with the closest proximity.
[0114]
[0115] Among them, c i It is battery data x iThe index assigned to the cluster, DTW(x) i μ k ) is x i With cluster center μ k The DTW distance is calculated as follows:
[0116]
[0117] For each cluster, calculate the average of all battery data in that cluster and use it as the new cluster center;
[0118]
[0119] Among them, S k ={i|c i =k} represents the set of indices of the data points assigned to cluster k;
[0120] Repeatedly calculate the distance from the battery data to each cluster center, reallocate the clusters, and update the cluster centers until the cluster centers no longer change, or the predetermined number of iterations is reached;
[0121] All source and target domain data were divided into two clusters, and data of the same type as the target domain battery data were selected as pre-training data.
[0122] like Figure 4 As shown, in a preferred embodiment, in step S3 or step three, a network is constructed to extract the bidirectional temporal features of the battery and highlight the significant information within the sequence, and output the SOC value. The specific method is as follows:
[0123] For battery data X = {x1, x2, ..., x...} T}, perform forward and backward calculations separately. The forward calculation formula is as follows:
[0124] Input Gate:
[0125] i t =σ(W ix x t +W i h t-1 +b i (4)
[0126] Forgotten Gate:
[0127] f t =σ(W fx x t +W fh h t-1 +b f (5)
[0128] Output gate:
[0129] o t =σ(W ox x t +W oh h t-1 +b o (6)
[0130] Renewal of memory cells:
[0131]
[0132] Update cell status:
[0133]
[0134] Update of hidden state:
[0135] h t =o t ☉ttanh(C t (9)
[0136] The formula for backward computation is the same as that for forward computation, except that the sequence from T to 1 is input into the network;
[0137] Finally, the results of the forward and backward calculations are combined and output as follows:
[0138]
[0139]
[0140]
[0141] in, This represents the hidden state propagated forward at time t. h represents the hidden state propagated forward at time t; t The final hidden state is the concatenation of forward and backward propagation;
[0142] Then, for the hidden state hi obtained at time step i, calculate its attention score over all time steps:
[0143] u i =W a h i +b a (13)
[0144] Among them W a and b a These are learnable parameters used to adjust the hidden state h. i First, the attention scores are mapped to the attention score space. Then, the attention scores are normalized using the softmax function to obtain the attention weights.
[0145] a i =softmax(u i (14)
[0146] Finally, the hidden states at all time steps and their corresponding attention weights (ai) are summed in a weighted manner to obtain the final attention layer output:
[0147]
[0148] The final value of c is the estimated SOC value.
[0149] In a preferred implementation, in step S3 or step four, the main purpose of the transfer learning method for SOC is to transfer knowledge learned in one domain to another. The existing knowledge is called the source domain, and the new knowledge to be learned is defined as the target domain. A kernel function maps the features of the source domain and the target domain to a higher-dimensional space, reducing their distance in that space. The distance is calculated using the maximum mean difference (MMD), and its formula is as follows:
[0150]
[0151] x s x t N represents the source domain data and the target domain data, respectively. s and N t For x s and x t The length of the feature representation; the entire formula represents the maximum distance between two data domains in the reproducing kernel Hilbert space; the loss function in the transfer learning process is defined as:
[0152]
[0153] SOC t and SOC′ t For the estimated SOC and the true SOC at time step t, N t The total length of the observed data is taken as a hyperparameter. It is necessary to first calculate the importance of the distance and the estimation error to determine λ in order to obtain the best estimation results.
[0154] As a preferred implementation, the predicted values obtained above are used to obtain the results from the network updated in step five, and then tested using a test set. The evaluation metrics are as follows:
[0155]
[0156]
[0157] This invention proposes a source domain selection and transfer learning scheme to address the problems of insufficient data and inconsistent sample distribution in battery SOC estimation. To address the inconsistency in data distribution between different battery domains and the question of where to transfer data, a domain-adaptive network model based on source domain selection is proposed. In this model, a suitable source domain is selected for network pre-training by measuring the similarity between the source and target domains, and this selection is backpropagated along with the error loss. The advantages of this method are that it avoids overfitting caused by excessive data, improves the model's convergence speed, better learns the common features between the source and target domains, and improves the accuracy of SOC estimation.
[0158] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for estimating the state of charge of a lithium-ion battery, characterized in that: It should include at least the following steps: S1. Preprocess the collected lithium-ion battery feature data; define the source domain and target domain, and define the batteries other than the target battery as the source domain; cluster the features of the source domain batteries and the target batteries into two categories, and use the batteries belonging to the same category as the target battery as the pre-training dataset. S2. Select a matching source domain for pre-training based on the similarity between the source domain and the target domain; S3. Construct a neural network to extract bidirectional temporal features of the battery and process the extracted features based on an attention mechanism to capture important information in the temporal sequence; S4. Use the MMD method for domain adaptation to reduce the distribution difference between the source and target domains; S5. By reducing the distribution between domains through domain adaptation and optimizing the network parameters based on differences, the state of charge of the lithium-ion battery can be estimated.
2. The lithium-ion battery state of charge estimation method according to claim 1, characterized in that: Step S2 also includes the following step: a similarity-based source domain selection method is used, with DTW as the standard to measure the current and voltage sequences of the battery, to ensure the similarity between different domains.
3. The lithium-ion battery state of charge estimation method according to claim 2, characterized in that: Step S4 also includes the following steps: performing domain adaptation using data from the target domain, backpropagating the calculated distribution error to the optimization objective using the MMD algorithm, optimizing the network parameters of the pre-trained estimator, and minimizing the feature distribution difference between the source and target domains by using a non-parametric distance metric.
4. The lithium-ion battery state of charge estimation method according to claim 3, characterized in that: It also includes the following steps: pre-training the model using the selected source domain cells, i.e. using Adam as the optimizer, evaluating the network's estimation results with MSE, and backpropagating the obtained Loss to optimize the network's parameters.
5. The lithium-ion battery state of charge estimation method according to claim 4, characterized in that: Transfer learning using target domain data involves transferring the model parameters trained in the source domain to the target domain as the initial model, and then using the target domain data for secondary training of the network. The distribution difference between the source and target domains is measured using MMD, and domain adaptation is performed to optimize network parameters by reducing the distance between the source and target domains.
6. The lithium-ion battery state of charge estimation method according to claim 5, characterized in that: Step S5 also includes the following step: During the estimation process, based on the attention mechanism and bidirectional network structure, the bidirectional time features of the battery are extracted and the significant information in the sequence is focused, which improves the estimation accuracy of lithium battery SOC.
7. The method for estimating the state of charge of a lithium-ion battery according to any one of claims 1 to 6, characterized in that: In step S1, the current and voltage data of the lithium battery are preprocessed, specifically as follows: A sliding window approach is used to process battery data, transforming the original two-dimensional battery data into three-dimensional data. Let the sequence length be T and the time window size be W, then the training network data is {(x1,y1),…,(x...}. N ,y N )}, where N = T - W + 1; for the i-th input sequence x i ={Φ i,1 ,…,Φ i,w }, where Φ i,t = (Vt, It) represents the battery voltage and current measured at time step t; corresponding to battery characteristic x i Battery label y i The actual SOC of the battery at the last time step.
8. The lithium-ion battery state of charge estimation method according to claim 7, characterized in that: In step S2, a matching source domain is selected for pre-training based on the similarity between the source domain and the target domain. Specifically, the cluster size of the time series clustering algorithm is set to 2. Initialize the cluster center by randomly selecting data from two batteries as the cluster center, denoted as {u1, u2}; Calculate the data x for each battery i The similarity with each cluster center is calculated, and the similarity is measured using the Dynamic Time Warping (DTW) algorithm. Data points are then assigned to the clusters with the closest proximity. Among them, c i It is battery data x i The index assigned to the cluster, DTW(x) i ,μ k ) is x i With cluster center μ k The DTW distance is calculated as follows: For each cluster, calculate the average of all battery data in that cluster and use it as the new cluster center; Among them, S k ={i|c i =k} represents the set of indices of the data points assigned to cluster k; Repeatedly calculate the distance from the battery data to each cluster center, reallocate the clusters, and update the cluster centers until the cluster centers no longer change, or the predetermined number of iterations is reached; All source and target domain data were divided into two clusters, and data of the same type as the target domain battery data were selected as pre-training data.
9. The method for estimating the state of charge of a lithium-ion battery according to claim 8, characterized in that: In step S3, a network is constructed to extract the bidirectional temporal features of the battery and highlight the significant information within the sequence, and output the SOC value. The specific method is as follows: For battery data X = {x1, x2, ..., x...} T }, perform forward and backward calculations separately. The forward calculation formula is as follows: Input Gate: i t =σ(W ix x t +W ih h t-1 +b i ) (4) Forgotten Gate: f t =σ(W fx x t +W fh h t-1 +b f ) (5) Output gate: o t =σ(W ox x t +W oh h t-1 +b o ) (6) Renewal of memory cells: Update cell status: Update of hidden state: h t =o t ⊙tanh(C t ) (9) The formula for backward computation is the same as that for forward computation, except that the sequence from T to 1 is input into the network; Finally, the results of the forward and backward calculations are combined and output as follows: in, Represents the hidden state propagated forward at time t. h represents the hidden state propagated forward at time t; t The final hidden state is the concatenation of forward and backward propagation; Then, for the hidden state hi obtained at time step i, calculate its attention score over all time steps: u i =W a h i +b a (13) Among them W a and b a These are learnable parameters used to adjust the hidden state h. i First, the attention scores are mapped to the attention score space. Then, the attention scores are normalized using the softmax function to obtain the attention weights. a i =softmax(u i ) (14) Finally, the hidden states at all time steps and their corresponding attention weights (ai) are summed in a weighted manner to obtain the final attention layer output: The final value of c is the estimated SOC value.
10. The lithium-ion battery state-of-charge estimation method according to claim 9, characterized in that: In step S4, the main purpose of the transfer learning method for SOC is to transfer knowledge learned in one domain to another. The existing knowledge is called the source domain, and the new knowledge to be learned is defined as the target domain. A kernel function maps the features of the source domain and the target domain to a higher-dimensional space, reducing their distance in that space. The distance is calculated using the maximum mean difference (MMD), and its formula is as follows: x s x t N represents the source domain data and the target domain data, respectively. s and N t For x s and x t The length of the feature representation; the entire formula represents the maximum distance between two data domains in the reproducing kernel Hilbert space; the loss function in the transfer learning process is defined as: SOC t and SOC′ t For the estimated SOC and the true SOC at time step t, N t The total length of the observed data is a hyperparameter. We need to calculate the importance of the distance and the estimation error beforehand to determine λ in order to obtain the best estimation results.
Citation Information
Patent Citations
Lithium ion battery health state estimation method
CN114580262A
Lithium ion battery charge state estimation method based on Informer
CN116106751A