Battery charge state prediction method and device, electronic equipment and readable storage medium
Through the battery state of charge prediction model based on transfer learning, combined with time distribution search and matching and Transformer model, the problem of low accuracy and time-consuming battery state of charge prediction in the prior art is solved, and high under different operating conditions is achieved Accuracy and rapid prediction improve the accuracy and timeliness of battery state of charge prediction.
Patent Information
- Application Number
- CN202411386640.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-03
AI Technical Summary
The existing battery state of charge prediction methods have low prediction accuracy or long time under the influence of noise, and cannot meet the real-time prediction needs.
Using a battery state of charge prediction model based on transfer learning, combining time distribution search and matching and Transformer model, the state of charge pseudo-label is generated through feature mapping matrix and particle filtering algorithm, reducing the distribution differences between source domain and target domain, and improving prediction accuracy and robustness.
It realizes high-precision and fast battery state of charge prediction under different working conditions, improves the accuracy and timeliness of prediction, and has strong model stability, which can quickly converge under large initial errors and reduces cumulative errors. .
Smart Images

Figure CN119247170A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of battery technology, and in particular to a battery state of charge prediction method, device, electronic device and computer-readable storage medium. Background Art
[0002] Accurate prediction of the battery's state of charge (SOC) is the basis of battery health management. Therefore, establishing an accurate battery SOC prediction model has always been a research hotspot at home and abroad. Common methods include the ampere-hour integration method, the open circuit voltage method, the optimized Kalman filter method, the timing neural network method, etc.
[0003] However, due to the influence of noise in the actual environment, the above methods either have low prediction accuracy and poor generalization ability, or have high prediction accuracy and strong generalization ability, but the prediction takes a long time and cannot meet the requirements of real-time prediction of battery SOC.
[0004] The preceding description is intended to provide general background information and does not necessarily constitute prior art. Summary of the invention
[0005] In response to the above technical problems, the present application provides a battery state of charge prediction method, device, electronic device and computer-readable storage medium, which can accurately and quickly predict the battery state of charge.
[0006] The present application provides a battery state of charge prediction method, comprising:
[0007] Step S1, obtaining the data to be predicted of the target battery, the data to be predicted including the terminal voltage, the terminal discharge current and the terminal voltage change rate;
[0008] Step S2, inputting the data to be predicted into a pre-trained battery state of charge prediction model based on transfer learning, and obtaining a state of charge prediction result corresponding to a target battery output by the battery state of charge prediction model;
[0009] Among them, the battery state of charge prediction model includes a transfer learning model based on time distribution search and matching and a Transformer model obtained by training with training data.
[0010] In one embodiment, the step S2 comprises:
[0011] Determine the feature mapping matrix between the data to be predicted and the training data through a transfer learning model based on time distribution search and matching;
[0012] Map the data to be predicted to the regenerated Hilbert space according to the feature mapping matrix to generate target data;
[0013] The target data is input into the Transformer model to obtain the state of charge prediction result corresponding to the target battery predicted by the Transformer model.
[0014] In one embodiment, the transfer learning model based on time distribution search and matching is specifically used for:
[0015] Performing time distribution matching of the data to be predicted with a preset number of basic subsequences to determine a target basic subsequence with the highest degree of matching with the data to be predicted; the preset number of basic subsequences is obtained based on the training data;
[0016] The state of charge pseudo labels corresponding to the data to be predicted filled by the particle filter algorithm are obtained, and a feature mapping matrix between the data to be predicted and the training data is generated according to the state of charge pseudo labels corresponding to the data to be predicted and the target basic subsequence.
[0017] In one embodiment, the transfer learning model based on time distribution search and matching is further used for:
[0018] After determining the preset number of basic subsequences, the training data is characterized by time distribution to obtain the preset number of basic subsequences; the training data includes the battery's historical terminal voltage, historical terminal discharge current, historical terminal voltage change rate and corresponding historical state of charge.
[0019] In one embodiment, the step of performing time distribution characterization on the training data to obtain a preset number of basic subsequences includes:
[0020] The particle swarm algorithm is used to search for the boundaries of basic subsequences in the time domain, and the training data is divided into a preset number of basic subsequences with the worst time distribution similarity.
[0021] In one embodiment, the formula for searching the boundary of the basic subsequence in the time domain by the particle swarm algorithm is:
[0022] v i (k+1)=v i (k)+c1r1(p i,best -x i (k))+c2r2(g best -x i (k))
[0023] x i (k+1)=x i (k)+v i (k+1)
[0024] Among them, x i (k) and v i(k) are the k-th iteration sub-sequence segmentation point and particle velocity, respectively, i,best is the local optimal value of the particle, g best is the global optimal value of the particle.
[0025] In one embodiment, it further comprises:
[0026] The battery state of charge prediction model is trained based on the training data until a convergence end condition is reached to obtain a trained battery state of charge prediction model.
[0027] The present application also provides a battery state of charge prediction device, the device comprising:
[0028] An acquisition module is used to acquire the data to be predicted of the target battery, the data to be predicted includes the terminal voltage, the terminal discharge current and the terminal voltage change rate;
[0029] The prediction module is used to input the data to be predicted into a pre-trained battery state of charge prediction model based on transfer learning, and obtain the state of charge prediction result corresponding to the target battery output by the battery state of charge prediction model; wherein the battery state of charge prediction model includes a transfer learning model based on time distribution search and matching obtained by training with training data and a Transformer model.
[0030] The present application also provides an electronic device, comprising: a memory and a processor, wherein the memory stores computer program instructions for execution on the processor, and when the processor executes the computer program instructions, the battery state of charge prediction method as described above is implemented.
[0031] The present application also provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the battery state of charge prediction method as described above are implemented.
[0032] As described above, the battery state of charge prediction method of the present application includes the steps of: obtaining the data to be predicted of the target battery, the data to be predicted including the terminal voltage, the terminal discharge current and the terminal voltage change rate; inputting the data to be predicted into a pre-trained battery state of charge prediction model based on transfer learning, and obtaining the state of charge prediction result corresponding to the target battery output by the battery state of charge prediction model; wherein the battery state of charge prediction model includes a transfer learning model based on time distribution search and matching obtained by training with training data and a Transformer model. In this way, the battery state of charge prediction model based on transfer learning fully exploits the distribution differences of time series information in the source domain data, and minimizes the distribution differences between the source domain and the target domain through the transfer learning model based on time distribution search and matching. At the same time, the time series information in the original data is preserved, which greatly enhances the prediction accuracy and robustness. The model can maintain high prediction accuracy under different working conditions, and its model stability is strong. In the case of large initial error, its prediction results can converge quickly, and its prediction cumulative error is reduced. It can maintain high prediction accuracy during a long prediction process, so it can realize real-time prediction of the battery state of charge and improve the accuracy and timeliness of the state of charge prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.
[0034] Figure 1 This is a schematic diagram of the architecture of the Transformer model in the embodiment of the present application;
[0035] Figure 2 A flowchart of a battery state of charge prediction method provided in an embodiment of the present application;
[0036] Figure 3 A timing diagram of a battery state of charge prediction method provided in an embodiment of the present application;
[0037] Figure 4 A schematic diagram of the structure of a battery state of charge prediction device provided in an embodiment of the present application;
[0038] Figure 5 This is a schematic diagram for comparing the prediction effects in the embodiments of the present application.
[0039] The realization of the purpose, functional features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. The above-mentioned drawings have shown clear embodiments of this application, which will be described in more detail later. These drawings and textual descriptions are not intended to limit the scope of the concept of this application in any way, but to illustrate the concept of this application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0040] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0041] The following is an explanation of the terms and algorithms involved in this application and the principle of using transfer learning to predict the battery state of charge:
[0042] 1. Transfer learning model based on time distribution search and matching
[0043] The transfer learning model based on time distribution search and matching (also called transfer learning framework) includes a time distribution search and matching part and a transfer learning part based on TDC and TDM.
[0044] 1) Time-distributed search and matching
[0045] Transfer learning regards the training set and prediction set as the source domain (D s ) and the target domain (D t ), the feature values and labels in the data set (i.e., training set and prediction set) are taken as feature data x in the domain space and y in the target space, and the prior probability distribution (MPD) of the feature values is P(x), and the posterior probability distribution (CPD) between the data feature values and the labels is P(y|x). Transfer learning mainly focuses on aligning the distribution of the source domain and the target domain, that is, by reducing the difference in the distribution of data features between the source domain and the target domain, domain knowledge can be transferred and reused. For time series data, the difference in data distribution in different domains is mainly reflected in the prior probability distribution P(x s )≠P(x t ) and the posterior probability distribution P(y s |x s )≠P(y t |x t), however, in practice, it is found that different environmental load conditions often cause the battery SOC distribution to be similar while the characteristic parameter distribution is quite different, that is, P(x s )≠P(x t ) and P(y s |x s )≈P(y t |x t ).
[0046] Time covariate shift (TCS) may mislead the SOC prediction model, resulting in a decrease in its prediction accuracy and robustness. To solve this problem, finding common knowledge about the SOC changes of batteries under different environmental and load conditions has become a feasible method. In general, although the distribution of characteristic parameters such as battery voltage, current, and temperature varies greatly under different conditions, there is still common knowledge that can be used to accurately predict features, such as the polarization degree of the battery and the open circuit potential of the electrode. Therefore, it can be assumed that there are several basic subsequences in the source domain data. The data distribution in each subsequence (i.e., basic subsequence) follows the same distribution, while the distributions between subsequences are very different. These subsequences are the worst case of time covariate shift and can represent the distribution characteristics of the battery in different periods and environments during the charging and discharging process. The basic subsequences obtained by segmentation are input into the prediction model, which not only enables the migration framework to better capture the distribution differences of battery charging and discharging sequences and enhance the generalization ability of the prediction model, but also has important significance for expanding the perception field of the prediction model and reducing the spatial complexity of the prediction algorithm.
[0047] Assume that the source domain data D s There are N subsequences in D s ={D1,D2......D n}, then it has N-1 split points, among which x i is the characteristic value of battery charging and discharging, which may include voltage, current, temperature, etc. i is the SOC value. However, when the trained model is predicted in real time, the input data to be tested does not have label quantity. Therefore, particle filtering can be used to generate some pseudo labels. The weight states of a large number of particles are regarded as the approximate posterior probability distribution of the target value. The original feature data is enhanced to obtain a feature enhancement matrix (also called feature mapping matrix) containing both MPD and CPD. In this way, finding a subsequence can be regarded as an optimization problem, as shown below:
[0048]
[0049] Among them, D i With D jis any subsequence, K is the number of segmented subsequences, K0 is the upper limit of the number of segmented subsequences, L1 is the minimum length of the segmented subsequence, L2 is the maximum length of the segmented subsequence, d(D i ,D j ) is a distance function used to measure the distribution difference of two groups of subsequences. Specifically, the maximum mean difference (MMD) can be selected to measure the distance between two groups of subsequences, as shown in the following formula:
[0050]
[0051] For the above optimization problem, the purpose is to maximize the average distribution distance of the segmented subsequences, so as to extract as many feature distributions as possible from the source domain data and enhance the diversity of the input data. However, the number and boundaries of the target subsequences are unknown quantities, and it is difficult to solve them directly. In this application, the particle swarm algorithm is selected to search the boundaries and number of the basic subsequences. The formula is as follows:
[0052] v i (k+1)=v i (k)+c1r1(p i,best -x i (k))+c2r2(g best -x i (k))
[0053] x i (k+1)=x i (k)+v i (k+1)
[0054] The particle swarm algorithm uses the above optimization problem as the optimization function, where x i (k) and v i (k) are the k-th iteration sub-sequence segmentation point and particle velocity, respectively, i,best is the local optimal value of the particle, g best is the global optimal value of the particle. According to the maximum entropy principle, the above optimization problem can be searched step by step. First, set the number of basic subsequences K, then the particle x i It contains K-1 segmentation points. Although the particle swarm algorithm performs poorly for high-dimensional variables in actual applications, its optimization effect is relatively good because the search space is only a one-dimensional time series. After multiple rounds of iterations, the K subsequences with the largest distribution difference are obtained, and their target values are recorded. At the same time, the K value is changed, and the search and optimization are continued. Finally, the basic subsequence with the largest distribution difference is obtained through comparison.
[0055] 2) Transfer learning based on TDC and TDM
[0056] Transfer learning maps source domain data and target domain data to a new space through a spatial mapping function, so that the distribution difference in the new space is reduced, which makes it easier for the prediction model to obtain accurate results. The basic subsequence obtained by segmenting the training set is regarded as the source domain data, and the model input is the target domain data. The spatial distribution of the source domain and target domain data is aligned. Considering that in the actual application process, the model needs to predict a long time series, which leads to a large dimension of the mapping matrix between the source domain and the target domain, consumes a lot of computing resources and makes it difficult to make real-time predictions. Therefore, time distribution matching (TDM) can be performed first to find the subsequence with the smallest spatial distribution difference with the input target domain sequence, thereby reducing the dimension of the spatial mapping matrix and saving computing resources.
[0057] The maximum mean difference between the aligned data reflects the difference in data distribution. Let the mapping matrix be W, where X is the feature data after the source domain and target domain data are concentrated, then there is a distribution difference after alignment:
[0058]
[0059] Among them, K is the Gaussian kernel matrix, and L is the center matrix of the matrix trace:
[0060]
[0061] It is worth noting that the source domain aligned CPD uses the real label quantity, and the target domain aligned CPD uses the feature enhanced label quantity. Generally speaking, the larger the value of the distribution difference, the smaller the difference in data distribution between domains. In order to solve the mapping matrix, according to the property that the kernel function is equal to the inner product of the mapping function, the Gaussian kernel function is selected to solve the mapping matrix, and the kernel function is replaced by the kernel matrix, which is defined as an optimization problem:
[0062]
[0063]
[0064] Where μW T W is a regularization term that controls the complexity of W. This optimization problem is a typical trace optimization problem, which is transformed into an optimization problem without constraints by the Lagrange multiplier method:
[0065] argmax(tr((W T (I+μKLK)W) -1 W T KHKW)
[0066] Obviously, the solution of W is (I+μKLK) -1The first m eigenvalues of KHK. Generally, m should be much smaller than n. s +n t , called feature compression, to avoid redundant information that causes the prediction model to not converge. Through the above process, the time series information containing CPD and MPD is mapped to the regenerated Hilbert space through the mapping matrix, thereby reducing the distribution difference between the source domain data and the target domain data, enabling the model to mine the implicit mapping relationship between the source domain and the target domain data, greatly enhancing the robustness and anti-interference ability of the model.
[0067] 2. Transformer Model
[0068] The Transformer model is an encoding and decoding structure model based on the self-attention mechanism. Its overall structure is as follows Figure 1 As shown in the figure, the encoder and decoder are stacked by N identical layers. Each encoder layer consists of a multi-head self-attention module and a fully connected feedforward network. Residual connections and standardization are introduced to prevent model degradation and improve convergence speed. On this basis, each decoder layer inserts a multi-head self-attention module to perform self-attention operations on the output of the encoder.
[0069] The self-attention module can be regarded as a fully connected layer that can dynamically update weights. Due to the small number of parameters, more information can be learned through multi-head attention. The self-attention module does not have the ability to capture time sequence information, so the position code is embedded in the input to add position information. The position code is shown in the following formula:
[0070]
[0071] Where t is the position in the sequence, d is the vector dimension, and k is a natural number used for indexing. Each position is mapped to a unique frequency through sine and cosine functions, and the frequency is converted into an element in the embedding vector using the corresponding sine and cosine functions. This allows the model to capture position information when processing the input sequence.
[0072] The core idea of the self-attention mechanism is weight distribution. In the self-attention mechanism, each element is compared with all elements, the attention score is calculated, and then the final output is obtained. The calculation method is shown in the following formula:
[0073]
[0074] In this example, in order to achieve accurate prediction of battery SOC in all environments, the Transformer model is combined with the transfer learning framework based on time distribution representation and matching (TDCM-TL) to predict the battery SOC. As a representative architecture that has made significant progress in the field of time series modeling in recent years, the Transformer model can effectively capture long-term dependencies and maintain the integrity of global information when processing input sequences, thereby significantly improving the generalization ability and prediction accuracy of the model. However, for the battery SOC prediction task, the distribution of its feature data in different environments is quite different, and it is sensitive to the distribution of input data. In addition, a large amount of data may be required to generalize to rare samples during the training process. Therefore, based on this shortcoming, TDCM-TL is designed to reduce the distribution differences of battery features in different environments by splitting the basic subsequences and matching reconstruction, while preserving the time series feature information in the original data. This not only greatly improves the generalization ability of the model, but also requires less computing resources than other transfer learning algorithms, and has stronger real-time performance.
[0075] like Figure 2 and Figure 3 As shown, this embodiment provides a battery state of charge prediction method, which can be used to predict the battery state of charge, including the following steps:
[0076] Step S1, obtaining the data to be predicted of the target battery, the data to be predicted including the terminal voltage, the terminal discharge current and the terminal voltage change rate.
[0077] Step S2, input the data to be predicted into a pre-trained battery state of charge prediction model based on transfer learning, and obtain the state of charge prediction result corresponding to the target battery output by the battery state of charge prediction model; wherein the battery state of charge prediction model includes a transfer learning model based on time distribution search and matching obtained by training the training data and a Transformer model.
[0078] Specifically, when the state of charge of the target battery needs to be predicted, the target battery's data to be predicted is first obtained, including the target battery's terminal voltage, terminal discharge current, and terminal voltage change rate; then, the target battery's data to be predicted is input as an input variable into a pre-trained battery state of charge prediction model based on transfer learning, and the state of charge prediction result corresponding to the target battery output by the battery state of charge prediction model is obtained. Among them, the battery includes but is not limited to nickel-cadmium batteries, etc. The target battery's data to be predicted can be the target battery's terminal voltage, terminal discharge current, and terminal voltage change rate at a certain moment.
[0079] In one embodiment, step S2 comprises:
[0080] Determine the feature mapping matrix between the data to be predicted and the training data through a transfer learning model based on time distribution search and matching;
[0081] Map the data to be predicted to the regenerated Hilbert space according to the feature mapping matrix to generate target data;
[0082] The target data is input into the Transformer model to obtain the state of charge prediction result corresponding to the target battery predicted by the Transformer model.
[0083] Specifically, the feature mapping matrix between the data to be predicted and the training data is first determined through a transfer learning model based on time distribution search and matching (also referred to as a transfer learning framework based on time distribution search and matching), and then the target data is input into the Transformer model to obtain the state of charge prediction result corresponding to the target battery obtained by the Transformer model predicting the target data. The generation process of the feature mapping matrix and the target data can refer to the above description and will not be repeated here.
[0084] In one embodiment, the transfer learning model based on time distribution search and matching is specifically used for:
[0085] Performing time distribution matching of the data to be predicted with a preset number of basic subsequences to determine a target basic subsequence with the highest degree of matching with the data to be predicted; the preset number of basic subsequences is obtained based on the training data;
[0086] The state of charge pseudo labels corresponding to the data to be predicted filled in by the particle filter algorithm are obtained, and the feature mapping matrix of the data to be predicted and the training data is generated according to the state of charge pseudo labels corresponding to the data to be predicted and the target basic subsequence.
[0087] Specifically, after the data to be predicted is input into the transfer learning model based on time distribution search and matching, the transfer learning model based on time distribution search and matching will first perform time distribution matching on the data to be predicted with a preset number of basic subsequences obtained based on the training data, and determine the target basic subsequence with the highest degree of matching with the data to be predicted based on the matching results obtained, and then obtain the state of charge pseudo-label corresponding to the data to be predicted filled by the particle filter algorithm, and generate the feature mapping matrix of the data to be predicted and the training data based on the state of charge pseudo-label corresponding to the data to be predicted and the target basic subsequence with the highest degree of matching with the data to be predicted. Among them, the generation process of the feature mapping matrix can refer to the above description, which will not be repeated here.
[0088] In one embodiment, the transfer learning model based on time distribution search and matching is also used to: after determining a preset number of basic subsequences, perform time distribution characterization on the training data to obtain a preset number of basic subsequences; the training data includes the battery's historical terminal voltage, historical terminal discharge current, historical terminal voltage change rate and corresponding historical state of charge.
[0089] Among them, the preset number can be set according to actual needs, such as combined with computing speed requirements. The training data can be obtained by collecting the historical operating parameters of the battery and the corresponding historical state of charge, which is not specifically limited here. The battery state of charge prediction model takes the terminal voltage, terminal discharge current, and terminal voltage change rate as input, and the state of charge as output. Here, after determining the preset number of basic subsequences, the training data is characterized by time distribution through a transfer learning model based on time distribution search and matching, so as to obtain a preset number of basic subsequences. The specific process can be referred to the previous description, which will not be repeated here.
[0090] In one embodiment, the step of performing time distribution characterization on the training data to obtain a preset number of basic subsequences includes:
[0091] The particle swarm algorithm is used to search for the boundaries of basic subsequences in the time domain, and the training data is divided into a preset number of basic subsequences with the worst time distribution similarity.
[0092] Here, the particle swarm algorithm can be used to search for the boundaries of the basic subsequences in the time domain, and after determining the boundaries of the basic subsequences, the training data can be divided into a preset number of basic subsequences with the worst time distribution similarity through a transfer learning model based on time distribution search and matching.
[0093] In one embodiment, the formula for searching the boundary of the basic subsequence in the time domain by the particle swarm algorithm is:
[0094] v i (k+1)=v i (k)+c1r1(p i,best -x i (k))+c2r2(g best -x i (k))
[0095] x i (k+1)=x i (k)+v i (k+1)
[0096] Among them, x i (k) and v i (k) are the k-th iteration sub-sequence segmentation point and particle velocity, respectively, i,bestis the local optimal value of the particle, g best is the global optimal value of the particle.
[0097] In one embodiment, it further comprises:
[0098] The battery state of charge prediction model is trained based on the training data until a convergence end condition is reached to obtain a trained battery state of charge prediction model.
[0099] Here, the convergence end condition may be that the prediction error of the model is less than a preset error threshold, etc., which is not specifically limited here. After the training of the battery state of charge prediction model is completed, the trained battery state of charge prediction model can be used to predict the battery data to be predicted to obtain the corresponding state of charge prediction result.
[0100] In summary, in the battery state of charge prediction method provided in the above embodiment, the battery state of charge prediction model based on transfer learning fully exploits the distribution difference of time series information in the source domain data, and reduces the distribution difference between the source domain and the target domain to the greatest extent through the TDCM-TL migration framework. At the same time, the time series information in the original data is preserved, which greatly enhances the prediction accuracy and robustness. The model can maintain a high prediction accuracy under different working conditions, and its model stability is strong. In the case of large initial error, its prediction result can converge quickly, and its prediction cumulative error is reduced. It can maintain a high prediction accuracy during a long prediction process, so it can realize real-time prediction of the battery state of charge, and improve the accuracy and timeliness of the state of charge prediction.
[0101] Based on the same inventive concept as the above embodiments, Figure 4 As shown, this embodiment also provides a battery state of charge prediction device, including:
[0102] An acquisition module is used to acquire the data to be predicted of the target battery, the data to be predicted includes the terminal voltage, the terminal discharge current and the terminal voltage change rate;
[0103] The prediction module is used to input the data to be predicted into a pre-trained battery state of charge prediction model based on transfer learning, and obtain the state of charge prediction result corresponding to the target battery output by the battery state of charge prediction model; wherein the battery state of charge prediction model includes a transfer learning model based on time distribution search and matching obtained by training with training data and a Transformer model.
[0104] In one embodiment, the prediction module is specifically used to:
[0105] Determine the feature mapping matrix between the data to be predicted and the training data through a transfer learning model based on time distribution search and matching;
[0106] Map the data to be predicted to the regenerated Hilbert space according to the feature mapping matrix to generate target data;
[0107] The target data is input into the Transformer model to obtain the state of charge prediction result corresponding to the target battery predicted by the Transformer model.
[0108] In one embodiment, the prediction module is specifically used to:
[0109] Performing time distribution matching of the data to be predicted with a preset number of basic subsequences to determine a target basic subsequence with the highest degree of matching with the data to be predicted; the preset number of basic subsequences is obtained based on the training data;
[0110] The state of charge pseudo labels corresponding to the data to be predicted filled in by the particle filter algorithm are obtained, and the feature mapping matrix of the data to be predicted and the training data is generated according to the state of charge pseudo labels corresponding to the data to be predicted and the target basic subsequence.
[0111] In one embodiment, the prediction module is specifically used to:
[0112] After determining the preset number of basic subsequences, the training data is characterized by time distribution to obtain the preset number of basic subsequences; the training data includes the battery's historical terminal voltage, historical terminal discharge current, historical terminal voltage change rate and corresponding historical state of charge.
[0113] In one embodiment, the prediction module is specifically used to:
[0114] The particle swarm algorithm is used to search for the boundaries of basic subsequences in the time domain, and the training data is divided into a preset number of basic subsequences with the worst time distribution similarity.
[0115] In one embodiment, the device further includes a training module for training the battery state of charge prediction model based on training data until a convergence end condition is reached to obtain a trained battery state of charge prediction model.
[0116] In summary, in the battery state of charge prediction device provided in the above embodiment, by combining transfer learning and the Transformer model to predict the battery state of charge, real-time prediction of the battery state of charge can be achieved, and the accuracy and timeliness of the state of charge prediction are improved.
[0117] The technical effect of the battery state of charge prediction method provided in the above embodiment is verified in combination with a specific experimental test scenario. In this example, the battery state of charge prediction model is called the TDCM-TL-Transformer model as an example.
[0118] 1. About the test platform and experimental methods
[0119] In this experiment, the energy storage facility battery pack is used as the experimental object. The battery pack is composed of four battery clusters connected in parallel, and each battery cluster is composed of 512 battery cells connected in series. The performance parameters of the battery cells are shown in Table 1.
[0120] Table 1
[0121]
[0122] Since there are inconsistencies between the individual cells when the battery pack is running, and the number of cells in the battery pack is huge, it is difficult to conduct performance test experiments on all the cells, and predicting all the cells will consume a lot of computing resources. Therefore, we first perform cluster analysis on the individual cells in the battery pack, and select the battery cell at the center of the cluster as the research object. According to the results of the cluster analysis, 16 battery cells are selected as the research objects.
[0123] The selected batteries are tested under different environments and load conditions. This experiment uses NEWARE's CTE-4000 battery tester to test the battery's load performance. The lower computer sensor obtains and stores the battery parameters for model training and testing.
[0124] The battery load performance test includes the following tests: pulse condition test (PCT), dynamic stress test (DST), and constant power test (CPT). The pulse condition test is mainly to allow the model to learn the battery polarization effect under different conditions; the DST test tests the battery's continuous discharge capability through rapid changes in discharge current, enriching the model training parameters; the constant power test is a commonly used charging and discharging condition for energy storage grids. The above tests were all carried out in a constant temperature box, and the experiments were carried out under different temperatures (0℃, 10℃, 20℃, 30℃, 40℃) and different SOH (100%, 97%, 95%) conditions. The specific experimental process is as follows:
[0125] For the DST test, the first step is to discharge the battery to the cut-off voltage (2.5V) at a constant current rate of 0.5C; the second step is to rest for one hour; the third step is to charge the battery to the cut-off voltage (3.65V) at a rate of 1C, and then charge to the cut-off current (14A) at a constant voltage; the fourth step is to set the charge and discharge cycle to 6 minutes, and perform charge and discharge experiments according to the DST power meter.
[0126] For the CPT test, the first step is to discharge the battery to the cut-off voltage (2.5V) at a constant current rate of 0.5C; the second step is to rest for one hour; the third step is to charge the battery to the cut-off voltage (3.65V) at a rate of 1C, and then charge it to the cut-off current (14A) at a constant voltage; the fourth step is to discharge the battery at a constant power of 496W.
[0127] For the PCT test, the first step is to discharge the battery to the cut-off voltage (2.5V) at a constant current rate of 0.5C; the second step is to rest for one hour; the third step is to charge the battery to the cut-off voltage (3.65V) at a rate of 1C, and then charge it to the cut-off current (14A) at a constant voltage; the fourth step is to set the discharge cycle to 15 minutes and conduct a pulse discharge experiment.
[0128] 2. Analysis of SOC prediction results
[0129] In order to measure the effect of the transfer learning framework, the temporal correlation between the source domain data and the target domain data is taken into account, so that the migrated data retains the temporal correlation of the original data as much as possible, so the following three evaluation indicators are introduced:
[0130]
[0131]
[0132]
[0133] There must be errors in the estimation of the SOC value of nickel-cadmium batteries. Error evaluation is an important means of analyzing the accuracy of prediction algorithms. When evaluating the effect of a prediction algorithm, only one error calculation form cannot be used to obtain the overall effect of the model. Multiple error calculation forms are often used for comprehensive evaluation. Therefore, in this embodiment, the mean relative error (MAE), root mean square error (MSE), and global maximum relative error (MAPE) are used to evaluate the model effect. The specific formula is as follows:
[0134]
[0135]
[0136]
[0137] In order to verify the accuracy and advantages of the model, the Origin algorithm, the temporal cluster analysis (TCA) algorithm, the BDA algorithm, the GFK algorithm, the MEDA algorithm and the TDCM-TL-Transformer were selected for comparison. Figure 5 : It is a schematic diagram for effect comparison, in which the three rectangles corresponding to each algorithm represent Pearson, Cosine, and MMD from left to right. It can be seen from the above experimental results that the TDCM-TL-Transformer model provided in this embodiment has the largest Pearson and Cosine and the smallest MMD, that is, it has higher prediction accuracy.
[0138] The above examples are only reference examples. In order to avoid redundancy, they are not listed one by one here. In actual development or application, they can be flexibly combined according to actual needs, but any combination belongs to the technical solution of this application and is covered within the scope of protection of this application.
[0139] An embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores computer program instructions for execution on the processor, and when the processor executes the computer program instructions, the battery state of charge prediction method as described above is implemented.
[0140] An embodiment of the present application further provides a storage medium storing computer instructions, wherein when the computer instructions are executed by a processor, the battery state of charge prediction method described above is implemented.
[0141] It is understood that the above scenarios are only examples and do not constitute a limitation on the application scenarios of the technical solutions provided in the embodiments of the present application. The technical solutions of the present application can also be applied to other scenarios. For example, it is known to those skilled in the art that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0142] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0143] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.
[0144] The units in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0145] In the present application, the same or similar terminology concepts, technical solutions and / or application scenario descriptions are generally described in detail only the first time they appear. When they appear again later, they are generally not repeated for the sake of brevity. When understanding the technical solutions and other contents of the present application, for the same or similar terminology concepts, technical solutions and / or application scenario descriptions that are not described in detail later, reference can be made to the previous related detailed descriptions.
[0146] In the present application, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0147] The various technical features of the technical solution of the present application can be arbitrarily combined. In order to make the description concise, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present application.
[0148] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, a controlled terminal, or a network device, etc.) to execute the method of each embodiment of the present application.
[0149] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a storage medium, or transmitted from one storage medium to another storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. Available media can be magnetic media, (e.g., floppy disk, storage disk, tape), optical media (e.g., DVD), or semiconductor media (e.g., solid-state storage disk Solid State Disk (SSD)), etc.
[0150] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for predicting a battery state of charge, characterized in that: The method comprises: Step S1, obtaining the data to be predicted of the target battery, the data to be predicted including the terminal voltage, the terminal discharge current and the terminal voltage change rate; Step S2, inputting the data to be predicted into a pre-trained battery state of charge prediction model based on transfer learning, and obtaining a state of charge prediction result corresponding to a target battery output by the battery state of charge prediction model; Among them, the battery state of charge prediction model includes a transfer learning model based on time distribution search and matching and a Transformer model obtained by training with training data.
2. The method according to claim 1, characterized in that The step S2 comprises: Determine the feature mapping matrix between the data to be predicted and the training data through a transfer learning model based on time distribution search and matching; Map the data to be predicted to the regenerated Hilbert space according to the feature mapping matrix to generate target data; The target data is input into the Transformer model to obtain the state of charge prediction result corresponding to the target battery predicted by the Transformer model.
3. The method according to claim 2, characterized in that The transfer learning model based on time distribution search and matching is specifically used for: Performing time distribution matching of the data to be predicted with a preset number of basic subsequences to determine a target basic subsequence with the highest degree of matching with the data to be predicted; the preset number of basic subsequences is obtained based on the training data; The state of charge pseudo labels corresponding to the data to be predicted filled in by the particle filter algorithm are obtained, and the feature mapping matrix of the data to be predicted and the training data is generated according to the state of charge pseudo labels corresponding to the data to be predicted and the target basic subsequence.
4. The method according to claim 3, characterized in that The transfer learning model based on time distribution search and matching is also used for: After determining the preset number of basic subsequences, the training data is characterized by time distribution to obtain the preset number of basic subsequences; the training data includes the battery's historical terminal voltage, historical terminal discharge current, historical terminal voltage change rate and corresponding historical state of charge.
5. The method according to claim 4, characterized in that The step of performing time distribution characterization on the training data to obtain a preset number of basic subsequences includes: The particle swarm algorithm is used to search for the boundaries of basic subsequences in the time domain, and the training data is divided into a preset number of basic subsequences with the worst time distribution similarity.
6. The method according to claim 5, characterized in that The formula for searching the boundary of the basic subsequence in the time domain by particle swarm algorithm is: v i (k+1)=v i (k)+c1r1(p i,best -x i (k))+c2r2(g best -x i (k)) x i (k+1)=x i (k)+v i (k+1) Among them, x i (k) and v i (k) are the k-th iteration sub-sequence segmentation point and particle velocity, respectively, i,best is the local optimal value of the particle, g best is the global optimal value of the particle.
7. The method according to claim 1, characterized in that Also includes: The battery state of charge prediction model is trained based on the training data until a convergence end condition is reached to obtain a trained battery state of charge prediction model.
8. A battery state of charge prediction device, characterized in that: The device comprises: An acquisition module is used to acquire the data to be predicted of the target battery, the data to be predicted includes the terminal voltage, the terminal discharge current and the terminal voltage change rate; The prediction module is used to input the data to be predicted into a pre-trained battery state of charge prediction model based on transfer learning, and obtain the state of charge prediction result corresponding to the target battery output by the battery state of charge prediction model; wherein the battery state of charge prediction model includes a transfer learning model based on time distribution search and matching obtained by training with training data and a Transformer model.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer program instructions for being executed on the processor, and when the processor executes the computer program instructions, the method for predicting the battery state of charge as claimed in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: It stores computer instructions, and when the computer instructions are executed by a processor, the battery state of charge prediction method as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Method and device for predicting state of charge of automobile battery
CN120030317A
New energy automobile secondary battery health state intelligent estimation method based on small sample transfer learning
CN120370166A
