Lithium battery charge state estimation method and system
By using a combined model of TCN, GRU and Transformer network layer in lithium battery SOC estimation, the data loss problem is handled, and the accuracy and robustness of lithium battery SOC estimation is improved, and the insufficient estimation caused by data loss in the prior art is solved. The problem.
Patent Information
- Application Number
- CN202411573431.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-01-07
AI Technical Summary
The prior art is difficult to effectively deal with data loss in lithium battery SOC estimation, resulting in insufficient estimation accuracy and robustness, especially in battery management systems, where traditional methods such as linear regression and deep learning models are fragile in the absence of data.
The basic model composed of TCN, GRU and Transformer network layers trained using forward propagation and backpropagation algorithms is used to extract short-term features through TCN, GRU processes missing data, and Transformer captures complex relationships to form a robust SOC estimation model.
It improves the accuracy and robustness of lithium battery SOC estimation, can provide more reliable prediction results in the absence of data, and enhances the stability and safety of the battery management system.
Smart Images

Figure CN119270099A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a battery management system, and more specifically to a lithium battery charge state estimation method and system. Background Art
[0002] With the widespread application of electric vehicles, robotic control and renewable energy storage systems, batteries have become ubiquitous, and accurate estimation of battery SOC has become one of the key technologies to ensure system performance, especially in battery management systems.
[0003] In practical applications, battery datasets often face the problem of missing data, which severely limits the accuracy and reliability of SOC estimation. Missing data may be caused by a variety of reasons such as sensor failure, communication interruption, data processing errors, etc. In battery management systems, temporary sensor failures, calibration problems, communication failures leading to data transmission interruptions, and battery management system (BMS) failures may lead to inaccurate, incomplete or missing data records. These will degrade the performance of the SOC estimation model, delay system response, and cause misoperation, affecting the stability and safety of the system. Therefore, designing a robust SOC estimation model that tolerates missing data is a critical and challenging research problem.
[0004] Traditional battery SOC estimation methods, such as linear regression, are suitable for stable battery characteristics. However, due to the nonlinear working process of the battery, linear regression often fails to capture complex relationships, especially in long-term time series predictions, resulting in limited accuracy. In the case of missing data, its robustness is poor, which greatly affects the estimation results. The Kalman filter is a state estimation algorithm that can handle nonlinear and noisy systems and update the state estimate in real time. However, missing data such as current or voltage will affect its state update, which may cause deviations from the true value of the SOC estimate, especially in long-term data sets.
[0005] Mainstream deep learning models for time series estimation, such as Transformer and RNN, show vulnerability to missing data despite performing relatively well with complete data. Transformer models exploit point-by-point query-key matching in self-attention and are insensitive to local context (e.g., SOC values prior to the missing data portion and covariates such as current, voltage, and temperature). This property hampers prediction stability under missing data, limiting their application in SOC estimation. In contrast, RNN models retain sequence history through internal recurrent connections but require high data continuity. Missing key data corrupts the RNN’s hidden state updates, hindering the effective use of prior information for subsequent estimation.
[0006] Therefore, it is necessary to design a new method to improve the accuracy of SOC estimation in the absence of data. Summary of the invention
[0007] The purpose of the present invention is to overcome the defects of the prior art and provide a method and system for estimating the state of charge of a lithium battery.
[0008] To achieve the above object, the present invention adopts the following technical solution: A method for estimating the state of charge of a lithium battery, comprising:
[0009] Acquiring battery operation data, wherein the battery operation data includes current, voltage, temperature and battery status;
[0010] Inputting the battery operation data into a state of charge estimation model to estimate the SOC of the lithium battery to obtain an estimation result;
[0011] outputting the estimation result;
[0012] Among them, the state of charge estimation model is obtained by using a number of battery operation data as a sample set to train a basic model consisting of a sequentially connected TCN network layer, a GRU network layer, a Transformer network layer and a fully connected layer using forward propagation, back propagation algorithm, and hyperparameter tuning.
[0013] The further technical solution is: the state of charge estimation model is obtained by training a basic model consisting of a sequentially connected TCN network layer, a GRU network layer, a Transformer network layer and a fully connected layer using a plurality of battery operation data as a sample set using forward propagation, back propagation algorithms, and hyperparameter tuning, including:
[0014] Acquire a number of battery operation data, and integrate and pre-process them to obtain a sample set;
[0015] Build a basic model consisting of sequentially connected TCN network layers, GRU network layers, Transformer network layers, and fully connected layers;
[0016] The basic model is trained according to the sample set using forward propagation, back propagation algorithms, and hyperparameter tuning to obtain a state of charge estimation model.
[0017] Its further technical solution is: the expression of the TCN network layer is o=Activation(x+F(x)), wherein x is the input data, F(x) is the result of the convolution operation, Activation is the activation function, and o is the output of the TCN network layer.
[0018] The further technical solution is: the GRU module regulates the flow of information through the update gate and reset gate mechanism, wherein the formulas of the update gate and reset gate are z t =σ(W(z) x t +U (z) h t-1 );r t =σ(W (r) x t +U (r) h t-1 ), where x t is the update gate output, r t is the reset gate output, σ is the sigmoid function, W (z) , U (z) , W (r) , U (r) is the weight matrix, x t is the current input, h t-1 is the hidden state at the previous moment.
[0019] Its further technical solution is: the Transformer network layer integrates a multi-head attention mechanism, wherein the multi-head attention mechanism is presented as Q represents the predicted value of SOC, K represents the information related to Q, including voltage, current and temperature, values and contains the actual data corresponding to the key. By calculating each query and all keys, the Transformer network layer assigns weights to the values and obtains the corresponding output value through weighted summation; d k is the dimension of each head, d model is the total model dimension; h is the number of heads in the multi-head attention mechanism.
[0020] A further technical solution is that during the training process of the state of charge estimation model, RMSE and MAE indicators are used to evaluate the performance of the model.
[0021] The present invention also provides a lithium battery charge state estimation system, comprising:
[0022] A data acquisition unit, used to acquire battery operation data, wherein the battery operation data includes current, voltage, temperature and battery status;
[0023] An estimation unit, used for inputting the battery operation data into a state of charge estimation model to estimate the SOC of the lithium battery to obtain an estimation result;
[0024] An output unit, used for outputting the estimation result;
[0025] It also includes: a model training unit, which is used to train a basic model consisting of a sequentially connected TCN network layer, a GRU network layer, a Transformer network layer and a fully connected layer using forward propagation, back propagation algorithm and hyperparameter tuning using a number of battery operation data as a sample set to obtain the charge state estimation model.
[0026] Its further technical solution is: the model training unit includes:
[0027] A sample set generation subunit, used for acquiring a number of battery operation data, integrating and preprocessing the data to obtain a sample set;
[0028] The basic model construction subunit is used to construct a basic model consisting of a TCN network layer, a GRU network layer, a Transformer network layer, and a fully connected layer connected in sequence;
[0029] The training subunit is used to train the basic model according to the sample set using forward propagation, back propagation algorithm, and hyperparameter tuning to obtain a state of charge estimation model.
[0030] The beneficial effects of the present invention compared with the prior art are: the present invention collects battery operation data including current, voltage, temperature and battery status, and handles missing values. Then, these data are input into the state of charge (SOC) estimation model to perform SOC estimation. The model is trained using a series of battery operation data through forward propagation and backpropagation algorithms, as well as hyperparameter tuning, to form an infrastructure including TCN, GRU, Transformer and fully connected layers. The TCN layer helps extract short-term features, and the GRU layer effectively copes with missing data through a gating mechanism. Finally, the Transformer layer further enhances the model's understanding of complex relationships, thereby improving the accuracy and robustness of SOC estimation, and achieving improved accuracy of SOC estimation in the absence of data.
[0031] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0033] Figure 1 A schematic diagram of an application scenario of a lithium battery state of charge estimation method provided by an embodiment of the present invention;
[0034] Figure 2 Schematic diagram of the process of estimating the state of charge of a lithium battery provided by an embodiment of the present invention Figure 1 ;
[0035] Figure 3 Schematic diagram of the process of estimating the state of charge of a lithium battery provided by an embodiment of the present invention Figure 2 ;
[0036] Figure 4 A schematic block diagram of a lithium battery state of charge estimation device provided by an embodiment of the present invention;
[0037] Figure 5 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0040] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0041] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0042] See also Figure 1 and Figure 2 , Figure 1 A schematic diagram of an application scenario of a lithium battery state of charge estimation method provided in an embodiment of the present invention. Figure 2A schematic flow chart of a lithium battery state of charge estimation method provided in an embodiment of the present invention. The lithium battery state of charge estimation method is applied in a server. The server interacts with the terminal for data, combining TCN (temporal convolutional network), GRU (gated recurrent unit) and Transformer to improve the accuracy of SOC estimation, especially in the case of missing data. TCN uses causal convolution and empty convolution mechanisms to effectively extract local features. As a variant of RNN, GRU regulates the flow of information through a gating mechanism, so that the model can effectively retain and utilize key information in the sequence when data is missing, thereby reducing the impact of data loss. The introduction of Transformer further enhances the global modeling capability of the model and captures important features in the sequence through a multi-head attention mechanism.
[0043] Figure 2 FIG. 1 is a flow chart of a method for estimating the state of charge of a lithium battery provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S130.
[0044] S110, obtaining battery operation data, wherein the battery operation data includes current, voltage, temperature and battery status.
[0045] In this embodiment, the goal of this stage is to collect various important parameters related to battery performance, including the following:
[0046] Current: Record the current value of the battery during operation to understand its charging and discharging status and power output.
[0047] Voltage: Measures the voltage level of a battery, which is critical in assessing the battery's state of health and charging efficiency.
[0048] Temperature: Monitor the temperature of the battery to ensure it is within a safe and efficient operating range, preventing performance degradation or safety hazards caused by overheating.
[0049] Battery Status: Comprehensively evaluates the overall status of the battery, including its remaining power, health status, number of charge cycles, etc., to help determine the battery's service life and reliability.
[0050] By comprehensively collecting this data, a reliable basis can be provided for subsequent analysis and processing, ensuring accurate evaluation and management of battery performance.
[0051] S120: Input the battery operation data into a state of charge estimation model to estimate the SOC of the lithium battery to obtain an estimation result.
[0052] In this embodiment, the estimation result refers to the estimated result of the SOC state of the lithium battery. Figure 3 shown.
[0053] In this embodiment, the state of charge estimation model is obtained by using a number of battery operation data as a sample set to train a basic model consisting of a sequentially connected TCN network layer, a GRU network layer, a Transformer network layer and a fully connected layer using forward propagation, back propagation algorithm, and hyperparameter tuning.
[0054] In one embodiment, the above-mentioned state of charge estimation model is obtained by using a plurality of battery operation data as a sample set to train a basic model consisting of a sequentially connected TCN network layer, a GRU network layer, a Transformer network layer and a fully connected layer using forward propagation, back propagation algorithm, and hyperparameter tuning, including steps S121 to S123.
[0055] S121. Acquire a number of battery operation data, and integrate and pre-process them to obtain a sample set.
[0056] Specifically, the operating data of the battery, including current, voltage, temperature and battery status, is collected. The data is divided into training set, test set and validation set according to temperature and operating conditions. Then, the data is linearly transformed to unify the dimensions of each feature, ensure the effectiveness of model training and evaluation, and form a sample set.
[0057] Specifically, the key data generated by lithium batteries during operation are systematically collected, including current, voltage, temperature, and direct battery status information. In order to ensure the consistency and efficiency of subsequent processing, the collected data is linearly transformed so that data of all dimensions can be analyzed under a unified framework.
[0058] S122. Build a basic model consisting of a TCN network layer, a GRU network layer, a Transformer network layer, and a fully connected layer connected in sequence.
[0059] In this embodiment, the TCN network layer uses temporal convolution to extract the short-term dynamic features of current, voltage and temperature and capture the local temporal dependencies.
[0060] The gating mechanism of GRU can balance the degree of forgetting past information and absorbing new information, thereby reducing the dependence on the period of missing data and enhancing the robustness to data missing.
[0061] The Transformer network layer, i.e., the transformer module, utilizes its multi-head attention mechanism to learn the complex interdependencies among voltage, current, temperature, and SOC.
[0062] Specifically, the TCN network layer exploits the local temporal dependencies of battery data to extract short-term dynamic features such as current, voltage, temperature, and SOC (state of capacity). It plays a key role in the estimation of SOC of lithium-ion batteries under different operating conditions. By adopting dilated causal convolution, TCN is able to expand the receptive field without increasing model parameters, thereby effectively handling the challenges of long historical information.
[0063] The TCN network layer ensures the time alignment of the battery data by stacking multiple one-dimensional convolutional layers, combined with appropriate padding and expansion. The receptive field of each layer is gradually expanded, allowing the model to capture information over a wider time range and learn the potential relationship between current, voltage, temperature and SOC. This ability is critical to accurately estimate SOC when considering short-term fluctuations and long-term trends.
[0064] In addition, the TCN network layer introduces a residual block structure between layers, which reduces the gradient vanishing problem that may be caused by deep networks, thereby improving the stability of the model and the training efficiency. This is especially important for accurately estimating SOC in the absence of measurement data. By integrating the TCN module, our model is able to effectively learn the complex temporal dynamics in battery behavior, thereby providing more reliable and accurate SOC estimation.
[0065] The expression of the TCN network layer is o=Activation(x+F(x)), where x is the input data, F(x) is the result of the convolution operation, Activation is the activation function, and o is the output of the TCN network layer.
[0066] Since the number of channels between x and F(x) may be different, a 1x1 convolution is designed here to simply transform x so that the transformed x and F(x) can be added together.
[0067] In one embodiment, the output of the TCN network layer is used as the input of the GRU network layer, and is further processed by the GRU network layer to reduce the impact of missing data on the prediction results and enhance the robustness of the model. As an advanced recurrent neural network, GRU (Gated Recurrent Unit) is particularly suitable for processing lithium battery operation data, especially showing a high tolerance when facing common data missing problems. This feature makes GRU particularly effective in the task of state of charge (SOC) estimation.
[0068] By combining the output of the TCN network layer, GRU can not only capture the short-term dependencies of the data, but also expand the understanding of long-term dependencies, thereby significantly improving the predictive ability. The operating mechanism of GRU relies on its unique gating design, including update gates and reset gates, which enables it to selectively process and retain important information in the battery operation data. Specifically, the update gate controls the degree to which the state information of the previous moment is retained at the current moment, while the reset gate determines the degree to which the state information of the previous moment is ignored. This design enables GRU to cope with the challenges of missing data more flexibly and effectively.
[0069] Specifically, the GRU module regulates the flow of information through the update gate and reset gate mechanism, where the formulas of the update gate and reset gate are z t =σ(W (z) z t +U (z) h t-1 );r t =σ(W (r) x t +U (r) h t-1 ), where z t is the update gate output, r t is the reset gate output, σ is the sigmoid function, W (z) , U (z) , W (r) , U (r) is the weight matrix, x t is the current input, h t-1 is the hidden state at the previous moment.
[0070] By adaptively adjusting the information flow, the GRU module can effectively retain the key features in the battery operation data while filtering out those data points that are obviously deviated from the norm. This ability enables the GRU to maintain high robustness when processing lithium battery operation data, even in the face of missing values and other data challenges.
[0071] In addition, the gating mechanism of GRU also enables it to deeply capture the intrinsic time dependency between current, voltage, temperature and SOC in battery operation data. This dependency is the key to understanding battery behavior and the basis for accurate SOC estimation. By capturing these mid-term time features, the GRU module provides a richer and more effective feature representation for the subsequent Transformer module, thereby further improving the accuracy and reliability of SOC estimation.
[0072] In one embodiment, the output of the GRU module is passed to the Transformer network layer as its input to capture global dependencies, thereby generating the final battery state prediction. In the specific implementation, the encoder is composed of multiple identical encoding layers stacked together, each of which contains two key sublayers: a multi-head attention sublayer and a feedforward network sublayer. In order to ensure the smooth transmission of information during the encoding process and the stability of training, we add residual connections and layer normalization after each sublayer. This design not only helps to retain the original information, but also effectively prevents model overfitting, thereby improving training efficiency.
[0073] The decoder is also constructed by stacking multiple identical decoding layers, with an additional encoder-decoder attention sublayer. This sublayer plays a critical role in processing the encoder output and ensuring that the decoder can fully pay attention to and effectively use this information during the generation process. This allows the decoder to more accurately capture the key information in the input sequence when generating text, thereby improving the accuracy and coherence of the generated text.
[0074] As the core component of the Transformer module, the multi-head attention mechanism plays an important role in the encoder and decoder. It fully captures and deeply mines the input information by dividing the input sequence into multiple subspaces and performing self-attention calculations independently in each subspace. This mechanism enables the Transformer model to more accurately understand the complex structure of the input sequence, thereby showing stronger performance and higher accuracy in natural language processing tasks.
[0075] The Transformer network layer integrates a multi-head attention mechanism, where the multi-head attention mechanism is presented as Q represents the predicted value of SOC, K represents the information related to Q, including voltage, current and temperature, values and contains the actual data corresponding to the key. By calculating each query and all keys, the Transformer network layer assigns weights to the values and obtains the corresponding output value through weighted summation; d k is the dimension of each head, d model is the total model dimension; h is the number of heads in the multi-head attention mechanism.
[0076] S123. According to the sample set, the basic model is trained using forward propagation, back propagation algorithm, and hyperparameter tuning to obtain a state of charge estimation model.
[0077] In this embodiment, the RMSE and MAE indicators are used to evaluate the performance of the model during the training process of the state of charge estimation model. The output of the Transformer module is processed by a carefully designed fully connected layer to generate the final predicted value of the battery state. Through hyperparameter tuning and training, the accuracy and reliability of the prediction results are ensured, and it is also convenient for subsequent systems to directly use these prediction information to achieve more efficient and intelligent battery management. Use the training set data to train the model, use the test set data to evaluate the performance of the model, and record key indicators such as RMSE and MAE. The calculation formulas for RMSE and MAE are:
[0078]
[0079] After the MAE and RMSE meet the requirements, the trained TGT model is used to estimate the state of charge of the lithium battery online.
[0080] The method of this embodiment is a lithium battery state of charge estimation method based on TCN-GRU-Transformer with data missing robustness, which significantly improves the accuracy of SOC prediction and the robustness to data missing, and is of great significance to the development of battery management technology.
[0081] S130, outputting the estimation result;
[0082] In this embodiment, the estimation result is output to the terminal for display.
[0083] The method of this embodiment solves the shortcomings of current technology in processing long time series data and missing data, thereby improving the accuracy and robustness of battery state estimation. First, the original data (including current, voltage, temperature and SOC) are dimensionally aligned through linear transformation for subsequent module processing. Next, the temporal convolutional network (TCN) is used to preliminarily learn short-term sequence features and capture local time dependencies.
[0084] After the TCN layer, a gated recurrent unit (GRU) is used to further process the data. The reset gate of the GRU is used to forget past information, which effectively addresses the problem of data interpolation and reduces the impact of missing data on the model. The update gate controls the integration of new information and the retention of old information, ensuring that the model can effectively learn useful information in the case of missing data. This design makes the GRU more robust when processing missing data.
[0085] Subsequently, the Transformer module was introduced to enhance the model's ability to capture the complex relationship between voltage, current, temperature, and SOC, leveraging the features extracted by the previous modules. Finally, the output of the Transformer passes through a fully connected layer to generate the final SOC prediction. This overall framework aims to improve the accuracy and stability of battery state estimation.
[0086] In summary, this method uses TCN (Temporal Convolutional Network), GRU (Gated Recurrent Unit), and Transformer to construct a TGT neural network. Combining the local feature extraction capability of TCN, the robustness of GRU to missing data, and the global dependency capture capability of Transformer, the accuracy of battery state estimation is effectively improved, especially in scenarios with missing data. It is robust to missing data and can achieve high-precision estimation when input data is missing.
[0087] The above-mentioned lithium battery state of charge estimation method collects battery operation data including current, voltage, temperature and battery status, and handles missing values. Then, these data are input into the state of charge (SOC) estimation model for SOC estimation. The model is trained using a series of battery operation data through forward propagation and backpropagation algorithms, as well as hyperparameter tuning, to form an infrastructure including TCN, GRU, Transformer and fully connected layers. The TCN layer helps extract short-term features, and the GRU layer effectively copes with missing data through a gating mechanism. Finally, the Transformer layer further enhances the model's understanding of complex relationships, thereby improving the accuracy and robustness of SOC estimation, and achieving improved accuracy of SOC estimation in the absence of data.
[0088] Figure 4 is a schematic block diagram of a lithium battery state of charge estimation system 300 provided in an embodiment of the present invention. Figure 4 As shown, corresponding to the above lithium battery state of charge estimation method, the present invention also provides a lithium battery state of charge estimation system 300. The lithium battery state of charge estimation system 300 includes a unit for executing the above lithium battery state of charge estimation method, and the system can be configured in a server. Figure 4 The lithium battery state of charge estimation system 300 includes a data acquisition unit 301, an estimation unit 302, and an output unit 303.
[0089] The data acquisition unit 301 is used to acquire battery operation data, wherein the battery operation data includes current, voltage, temperature and battery status; the estimation unit 302 is used to input the battery operation data into the state of charge estimation model to estimate the SOC of the lithium battery to obtain an estimation result; the output unit 303 is used to output the estimation result;
[0090] It also includes: a model training unit, which is used to train a basic model consisting of a sequentially connected TCN network layer, a GRU network layer, a Transformer network layer and a fully connected layer using forward propagation, back propagation algorithm and hyperparameter tuning using a number of battery operation data as a sample set to obtain the charge state estimation model.
[0091] In one embodiment, the model training unit includes:
[0092] The sample set generation subunit is used to obtain a number of battery operation data, integrate and preprocess them to obtain a sample set; the basic model construction subunit is used to construct a basic model consisting of a TCN network layer, a GRU network layer, a Transformer network layer and a fully connected layer connected in sequence; the training subunit is used to train the basic model according to the sample set using forward propagation, back propagation algorithm, and hyperparameter tuning to obtain a state of charge estimation model.
[0093] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the above-mentioned lithium battery state of charge estimation system 300 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and brevity of description, it will not be repeated here.
[0094] The lithium battery state of charge estimation system 300 can be implemented in the form of a computer program. Figure 5 Runs on the computer device shown.
[0095] See also Figure 5 , Figure 5 5 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of multiple servers.
[0096] See also Figure 5 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .
[0097] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a method for estimating the state of charge of a lithium battery.
[0098] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
[0099] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a method for estimating the state of charge of a lithium battery.
[0100] The network interface 505 is used to communicate with other devices over the network. Figure 5 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0101] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:
[0102] Acquire battery operation data, wherein the battery operation data includes current, voltage, temperature and battery state; input the battery operation data into a state of charge estimation model to estimate the SOC of the lithium battery to obtain an estimation result; and output the estimation result;
[0103] Among them, the state of charge estimation model is obtained by using a number of battery operation data as a sample set to train a basic model consisting of a sequentially connected TCN network layer, a GRU network layer, a Transformer network layer and a fully connected layer using forward propagation, back propagation algorithm, and hyperparameter tuning.
[0104] In one embodiment, when the processor 502 implements the step of training the basic model consisting of the sequentially connected TCN network layer, GRU network layer, Transformer network layer and fully connected layer by using a plurality of battery operation data as a sample set using forward propagation, back propagation algorithm and hyperparameter tuning to obtain the state of charge estimation model, the following steps are specifically implemented:
[0105] Acquire a number of battery operation data, integrate and preprocess them to obtain a sample set; construct a basic model consisting of a TCN network layer, a GRU network layer, a Transformer network layer and a fully connected layer connected in sequence; train the basic model according to the sample set using forward propagation, back propagation algorithms, and hyperparameter tuning to obtain a state of charge estimation model.
[0106] Among them, the expression of the TCN network layer is o=Activation(x+F(z)), where x is the input data, F(x) is the result of the convolution operation, Activation is the activation function, and o is the output of the TCN network layer.
[0107] The GRU module regulates the flow of information through the update gate and reset gate mechanism, where the formulas of the update gate and reset gate are z t =σ(W (z) x t +U (z) h t-1 );r t =σ(W (r) x t +U (r) h t-1 ), where z t is the update gate output, r t is the reset gate output, σ is the sigmoid function, W (z) , U (z) , W (r) , U (r) is the weight matrix, x t is the current input, h t-1 is the hidden state at the previous moment.
[0108] The Transformer network layer integrates a multi-head attention mechanism, where the multi-head attention mechanism is presented as Q represents the predicted value of SOC, K represents the information related to Q, including voltage, current and temperature, values and contains the actual data corresponding to the key. By calculating each query and all keys, the Transformer network layer assigns weights to the values and obtains the corresponding output value through weighted summation; d k is the dimension of each head, d model is the total model dimension; h is the number of heads in the multi-head attention mechanism.
[0109] During the training process of the state of charge estimation model, RMSE and MAE indicators are used to evaluate the performance of the model.
[0110] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0111] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0112] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor executes the following steps:
[0113] Acquire battery operation data, wherein the battery operation data includes current, voltage, temperature and battery state; input the battery operation data into a state of charge estimation model to estimate the SOC of the lithium battery to obtain an estimation result; and output the estimation result;
[0114] Among them, the state of charge estimation model is obtained by using a number of battery operation data as a sample set to train a basic model consisting of a sequentially connected TCN network layer, a GRU network layer, a Transformer network layer and a fully connected layer using forward propagation, back propagation algorithm, and hyperparameter tuning.
[0115] In one embodiment, when the processor executes the computer program to implement the step of training the state of charge estimation model using a plurality of battery operation data as a sample set using forward propagation, back propagation algorithm, and hyperparameter tuning to train a basic model consisting of a sequentially connected TCN network layer, a GRU network layer, a Transformer network layer, and a fully connected layer, the following steps are specifically implemented:
[0116] Acquire a number of battery operation data, integrate and preprocess them to obtain a sample set; construct a basic model consisting of a TCN network layer, a GRU network layer, a Transformer network layer and a fully connected layer connected in sequence; train the basic model according to the sample set using forward propagation, back propagation algorithms, and hyperparameter tuning to obtain a state of charge estimation model.
[0117] Among them, the expression of the TCN network layer is o=Activation(x+F(z)), where x is the input data, F(x) is the result of the convolution operation, Activation is the activation function, and o is the output of the TCN network layer.
[0118] The GRU module regulates the flow of information through the update gate and reset gate mechanism, where the formulas of the update gate and reset gate are z t =σ(W (z) x t +U (z) h t-1 );r t =σ(W (r) x t +U (r) h t-1 ), where z t is the update gate output, r t is the reset gate output, σ is the sigmoid function, W (z) , U (z) , W (r) , U (r) is the weight matrix, x t is the current input, h t-1 is the hidden state at the previous moment.
[0119] The Transformer network layer integrates a multi-head attention mechanism, where the multi-head attention mechanism is presented as Q represents the predicted value of SOC, K represents the information related to Q, including voltage, current and temperature, values and contains the actual data corresponding to the key. By calculating each query and all keys, the Transformer network layer assigns weights to the values and obtains the corresponding output value through weighted summation; d k is the dimension of each head, d model is the total model dimension; h is the number of heads in the multi-head attention mechanism.
[0120] During the training process of the state of charge estimation model, RMSE and MAE indicators are used to evaluate the performance of the model.
[0121] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, or any other computer-readable storage medium that can store program codes.
[0122] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0123] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0124] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the system of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0125] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0126] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for estimating the state of charge of a lithium battery, characterized in that: include: Acquiring battery operation data, wherein the battery operation data includes current, voltage, temperature and battery status; Inputting the battery operation data into a state of charge estimation model to estimate the SOC of the lithium battery to obtain an estimation result; outputting the estimation result; Among them, the state of charge estimation model is obtained by using a number of battery operation data as a sample set to train a basic model consisting of a sequentially connected TCN network layer, a GRU network layer, a Transformer network layer and a fully connected layer using forward propagation, back propagation algorithm, and hyperparameter tuning.
2. The method for estimating the state of charge of a lithium battery according to claim 1, characterized in that: The state of charge estimation model is obtained by using a plurality of battery operation data as a sample set to train a basic model consisting of a sequentially connected TCN network layer, a GRU network layer, a Transformer network layer and a fully connected layer using forward propagation, back propagation algorithm, and hyperparameter tuning, including: Acquire a number of battery operation data, and integrate and pre-process them to obtain a sample set; Build a basic model consisting of sequentially connected TCN network layers, GRU network layers, Transformer network layers, and fully connected layers; The basic model is trained according to the sample set using forward propagation, back propagation algorithms, and hyperparameter tuning to obtain a state of charge estimation model.
3. The method for estimating the state of charge of a lithium battery according to claim 2, characterized in that: The expression of the TCN network layer is o=Activation(x+F(x)), where x is the input data, F(x) is the result of the convolution operation, Activation is the activation function, and o is the output of the TCN network layer.
4. The method for estimating the state of charge of a lithium battery according to claim 2, characterized in that: The GRU module regulates the flow of information through the update gate and reset gate mechanism, where the formulas of the update gate and reset gate are z t =σ(W (z) x t +U (z) h t-1 );r t =σ(W (r) x t +U (r) h t-1 ), where z t is the update gate output, r t is the reset gate output, σ is the sigmoid function, W (z) , U (z) , W (r) , U (r) is the weight matrix, x t is the current input, h t-1 is the hidden state at the previous moment.
5. The method for estimating the state of charge of a lithium battery according to claim 2, characterized in that: The Transformer network layer integrates a multi-head attention mechanism, where the multi-head attention mechanism is presented as Q represents the predicted value of SOC, K represents the information related to Q, including voltage, current and temperature, values and contains the actual data corresponding to the key. By calculating each query and all keys, the Transformer network layer assigns weights to the values and obtains the corresponding output value through weighted summation; d k is the dimension of each head, d model is the total model dimension; h is the number of heads in the multi-head attention mechanism.
6. The method for estimating the state of charge of a lithium battery according to claim 2, characterized in that: During the training process of the state of charge estimation model, RMSE and MAE indicators are used to evaluate the performance of the model.
7. A lithium battery state of charge estimation system, characterized in that: include: A data acquisition unit, used to acquire battery operation data, wherein the battery operation data includes current, voltage, temperature and battery status; An estimation unit, used for inputting the battery operation data into a state of charge estimation model to estimate the SOC of the lithium battery to obtain an estimation result; An output unit, used for outputting the estimation result; It also includes: a model training unit, which is used to train a basic model consisting of a sequentially connected TCN network layer, a GRU network layer, a Transformer network layer and a fully connected layer using forward propagation, back propagation algorithm and hyperparameter tuning using a number of battery operation data as a sample set to obtain the charge state estimation model.
8. The lithium battery state of charge estimation system according to claim 7, characterized in that: The model training unit comprises: A sample set generation subunit, used for acquiring a number of battery operation data, integrating and preprocessing the data to obtain a sample set; The basic model construction subunit is used to construct a basic model consisting of a TCN network layer, a GRU network layer, a Transformer network layer, and a fully connected layer connected in sequence; The training subunit is used to train the basic model according to the sample set using forward propagation, back propagation algorithm, and hyperparameter tuning to obtain a state of charge estimation model.
Citation Information
Patent Citations
Energy storage power station SOC prediction method and device, virtual power plant and storage medium
CN116934529A
Lithium ion battery remaining service life prediction method based on TCN-GRU-BNDNN model
CN117172106A
Lithium battery discharge capacity estimation method without temperature sensor
CN118393361A
Method and system for detecting charge state of lithium battery
CN118425811A
Lithium ion battery SOC estimation method based on improved transformer
CN118858958A
Cited By
Lithium battery health state prediction method and system
CN119438958A
A lithium battery state of health prediction method and system
CN119438958B
Battery fault prediction method, model training method, equipment, system and medium
CN120470387A
Method and device for estimating state of charge of lithium ion battery
CN121299481A
Method and device for determining state of health of flow battery and electronic equipment
CN121348119A