TFT-Based Lithium Battery Surface Temperature Prediction Method and System
The TFT model addresses the limitations of existing temperature prediction methods by dividing input data and using self-attention mechanisms to enhance adaptability and accuracy in lithium-ion battery temperature prediction, reducing hardware reliance and costs.
Patent Information
- Application Number
- CN202510364723.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-03-26
AI Technical Summary
The existing lithium battery temperature prediction methods have problems with lack of interpretability and insufficient generalization capabilities when dealing with multi-factor, nonlinear and long-term series. Especially in new energy vehicles and energy storage systems, traditional methods fail to fully consider the complex interactions and real-time changes of multiple factors.
Using the TFT-based lithium battery surface temperature prediction method, the Transformer model is constructed by dividing the battery operation data into observation input, known input and static input, combining multi-source timing feature fusion and self-attention mechanism, processing long-term dependence data, and improving model adaptability and interpretability through static encoding and physical constraint loss functions.
High-precision temperature prediction in complex multivariable environments is achieved, the dependence on physical sensors is reduced, the adaptability and interpretability of the model is improved, and the decision-making basis is provided for battery thermal management.
Smart Images

Figure CN119884609B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lithium battery management, and particularly to a method and system for predicting the surface temperature of a lithium battery based on TFT. Background Art
[0002] Lithium-ion batteries have been widely used in many fields such as consumer electronics, renewable energy storage, smart grids, and electric vehicles due to their excellent energy density, long life, and low environmental pollution. However, battery temperature management has always been a key factor in its safety and performance stability. During the charging and discharging process of the battery, due to internal resistance and electrochemical reactions, a large amount of heat is generated. If the heat cannot be dissipated in a timely and effective manner, the battery temperature will rise sharply, which may lead to safety accidents such as thermal runaway, expansion, and even explosion, seriously threatening the normal use of the battery and the safety of the surrounding environment. At the same time, the temperature of lithium-ion batteries is also closely related to their capacity, efficiency, and service life. Under extreme temperature conditions, the battery performance will decline significantly. Therefore, accurately predicting the battery temperature is crucial for ensuring its normal operation and extending its service life.
[0003] However, predicting the temperature of lithium batteries faces many challenges. Existing prediction methods mainly include physical modeling, traditional statistical methods, and data-driven models, etc. However, each method has certain limitations in practical applications:
[0004] (1) Battery temperature prediction based on physical models: This method usually relies on a detailed modeling of the internal thermal behavior of the battery, requires accurate acquisition of material parameters such as the thermal conductivity and heat capacity of the battery, and performs parameter identification through a large amount of experimental data. Physical models cannot predict in real time. Especially in the case of diverse battery types and complex working environments, the adaptability of physical models is poor, and the computational burden is heavy.
[0005] (2) Methods based on traditional statistics and time series analysis: This method has good effects when dealing with linear and stable data. However, for non-linear and non-stationary data, especially the large fluctuations that occur during the charging and discharging process of the battery, its prediction ability is limited, and the accuracy is difficult to guarantee.
[0006] (3) Methods based on machine learning: Although machine learning can capture complex non-linear relationships in data and improve the prediction accuracy to a certain extent, this method is very sensitive to noise and outliers, and often relies on a large amount of high-quality training data to optimize the model. In addition, many traditional machine learning methods are prone to overfitting or insufficient generalization ability when facing multi-variables, multi-factors, and dynamic changes.
[0007] In the practical application of lithium battery temperature prediction, especially in new energy vehicles and energy storage systems, the battery temperature is affected by multiple factors, including ambient temperature, charge and discharge current, electrochemical reactions inside the battery, etc. Traditional temperature prediction methods often ignore these complex interactions and real-time changes of multiple factors, thus reducing the accuracy and practicality of prediction results. In addition, most existing methods focus on prediction through a single data source (such as battery itself or environmental data), and fail to fully consider the influence of external factors such as driving behavior and load status on battery temperature. To overcome these limitations, in recent years, data-driven methods have gradually become a research hotspot for temperature prediction. Especially deep learning techniques, such as convolutional neural network (CNN), long short-term memory network (LSTM), and gated recurrent unit (GRU), etc., have shown good prospects in lithium battery temperature prediction because they can effectively process time series data and capture complex non-linear relationships. For example, in the Chinese invention patent application "A Method for Estimating Discharge Capacity of Lithium Battery without Temperature Sensor" with the publication number CN118393361A, a TCN-GRU model is used for temperature prediction. However, this model lacks interpretability and is difficult to process long time series. Especially in different working states, the generalization ability of a single model is poor. Summary of the Invention
[0008] The technical problem to be solved by the present invention is how to solve the problems that the existing data-driven methods have lack of interpretability of the model and difficulty in processing long time series when predicting the temperature of lithium batteries.
[0009] The present invention solves the above technical problems through the following technical solutions: A method for predicting the surface temperature of a lithium battery based on TFT, the method includes:
[0010] Obtain battery operation data, preprocess the battery operation data to obtain preprocessed battery operation data;
[0011] Divide the preprocessed battery operation data into observed input, known input, and static input;
[0012] Use the observed input, known input, and static input as inputs and the battery surface temperature as the output to train the TFT model. When the loss function is minimized, obtain the trained TFT model;
[0013] Input the operation data of the battery to be measured into the trained TFT model, and predict the surface temperature of the battery to be measured.
[0014] Beneficial effects: In combination with the actual battery operating conditions, the battery operating data used for model construction in the present invention is divided into observed inputs, known inputs, and static inputs. A TFT model is constructed through multi-source time-series feature fusion. The TFT combines the self-attention mechanism of the Transformer, can effectively process data with long-term dependencies, and adapts to different input data and working states through different sub-models, enabling it to show strong adaptability in complex multi-variable and non-linear environments. The TFT model can provide interpretability to help analyze and understand the influence of different factors on battery temperature changes, which is often difficult to achieve in traditional black-box models.
[0015] Preferably, the battery operating data includes the ambient temperature, voltage, current, and state of charge during battery charging and discharging. The process of preprocessing the battery operating data includes: successively performing filtering and noise reduction, normalization processing, and time series alignment on the battery operating data. Among them, the method of filtering and noise reduction is:
[0016]
[0017] Among them, is the data after filtering and noise reduction, is the original data point, are the polynomial coefficients;
[0018] The method of normalization processing is:
[0019]
[0020] Among them, and are the i th values before and after normalization respectively, and are the maximum and minimum values of the sequence respectively.
[0021] Preferably, the observed inputs include the voltage, current, and state of charge in the battery operating data before the prediction point, the known inputs include the ambient temperature after the prediction point, and the static inputs include the battery condition data obtained through one-hot encoding and the fixed ambient temperature data.
[0022] Beneficial effects: Combining with the actual battery operating conditions, the present invention divides the environmental temperature, voltage, current, and state of charge in the battery operating data, links the TFT model with various factors affecting the battery temperature, fully considers the synergistic effect of historical data and future known data in the time series, and at the same time uses static encoding to finely represent the battery operating conditions, realizing the efficient extraction and expression of data features. By introducing future known data and static encoding, not only the integrity and continuity of the input data are ensured, but also the response ability and prediction accuracy of the model under various battery operating conditions and complex environments are significantly improved.
[0023] Preferably, the TFT model includes a VSN layer, an LSTM encoder-decoder layer, a GRN layer, and a multi-head interpretable attention layer. The known input passes through the VSN layer, the LSTM encoder, the gated unit, batch normalization, and the GRN layer. The observed input passes through the VSN layer, the LSTM encoder, the gated unit, batch normalization, and the GRN layer. The static input passes through the VSN layer, the static covariance encoder, the gated unit, batch normalization, and the GRN layer. The outputs of the three GRN layers are jointly input into the multi-head interpretable attention layer to obtain an output space. The output space passes through the gated unit, batch normalization, the GRN layer, the gated unit, batch normalization, and the fully connected layer to obtain the output result.
[0024] Preferably, the VSN layer includes an embedding layer, a GRN unit, and a linear layer. After the input vector enters the embedding layer, it enters a GRN unit respectively. The output of one of the GRN units generates a normalized weight vector through the Softmax function. Each feature of the input vector is processed by another GRN unit and then sent to the linear layer for fusion output together with the weight vector. The GRN layer includes two fully connected layers, an ELU function unit, and a gated unit. The output data after batch normalization passes through the fully connected layer, the ELU function unit, the fully connected layer, the Dropout unit, the gated unit, and batch normalization to obtain the output data.
[0025] Beneficial effects: The TFT model constructed by the present invention combines a variable selection network and a gated residual mechanism, adaptively screens the non-linear correlation features of key parameters such as voltage, current, and SOC, effectively overcomes the problems of environmental noise interference and multi-variable coupling, dynamically analyzes the dominant factors of heat generation in different charge and discharge stages through static covariate encoding and spatio-temporal feature decoupling, provides a traceable decision-making basis for the battery thermal management strategy, and can synchronously capture the local fluctuations and long-range dependence relationships of the battery thermal characteristics by integrating the LSTM encoding-decoding layer and the multi-head self-attention mechanism, improving the prediction robustness under complex operating conditions.
[0026] Preferably, softmax The function expression is:
[0027]
[0028] Among them, is the output value of the i th neuron, N is the number of neurons;
[0029] The ELU function expression is as follows
[0030]
[0031] Among them, x is the input value, is the hyperparameter.
[0032] Preferably, the output space output by the multi-head interpretable attention layer is calculated as follows:
[0033]
[0034] Among them, represents the output of each attention head, is the number of attention heads, is the weight matrix, are the query, key, and relational pair values respectively.
[0035] Beneficial effects: The TFT model of the present invention uses a multi-head attention mechanism. Each head is responsible for processing different representation subspaces. By concatenating the outputs of all heads and mapping them to obtain the final output space, the expression ability of the model can be further improved.
[0036] Preferably, the loss function adopts the mean squared error:
[0037]
[0038] Among them, is the temperature prediction value, is the actual temperature value, N is the number of samples.
[0039] Preferably, the loss function adopts a total loss function combining a physical constraint loss term and a data fitting term :
[0040]
[0041] Among them, is the temperature prediction value, is the actual temperature value, is the physical constraint residual, , are the weights, N is the number of samples.
[0042] Beneficial effects: By designing the total loss function for TFT model training, the model not only learns the data patterns but is also explicitly constrained to comply with the first law of thermodynamics, thus balancing the data and physical constraints, adapting to the time series model, and significantly improving the prediction reliability under extreme working conditions.
[0043] The present invention also provides a lithium battery surface temperature prediction system based on TFT, which includes:
[0044] A data processing module, configured to obtain battery operation data, preprocess the battery operation data, and obtain the preprocessed battery operation data;
[0045] A data division module, configured to divide the preprocessed battery operation data into observed inputs, known inputs, and static inputs;
[0046] A model training module, configured to take the observed inputs, known inputs, and static inputs as inputs and the battery surface temperature as the output to train the TFT model, and obtain the trained TFT model when the loss function is minimized;
[0047] A prediction module, configured to input the battery operation data to be measured into the trained TFT model and predict the surface temperature of the battery to be measured.
[0048] The advantages provided by the present invention are as follows: Through multi-source time series feature fusion modeling, the present invention can achieve accurate prediction of the surface temperature only relying on battery operation parameters, can eliminate the hardware dependence on physical sensors, significantly reduce the system deployment cost, and improve the reliability. Description of the Drawings
[0049] Figure 1 It is a flowchart of the method for predicting the surface temperature of a lithium battery based on TFT provided by an embodiment of the present invention;
[0050] Figure 2 It is an architecture diagram of the TFT model in the method for predicting the surface temperature of a lithium battery based on TFT provided by an embodiment of the present invention;
[0051] Figure 3 It is an architecture diagram of the variable selection network of the TFT model in the method for predicting the surface temperature of a lithium battery based on TFT provided by an embodiment of the present invention;
[0052] Figure 4 It is an architecture diagram of the gated residual network of the TFT model in the method for predicting the surface temperature of a lithium battery based on TFT provided by an embodiment of the present invention;
[0053] Figure 5 It is a schematic diagram of the system for predicting the surface temperature of a lithium battery based on TFT provided by an embodiment of the present invention;
[0054] Figure 6 The prediction effect diagram of the surface temperature prediction method of a lithium battery based on TFT provided by an embodiment of the present invention at an ambient temperature of 30 °C;
[0055] Figure 7 The schematic diagram of the comparison of the prediction accuracies of the surface temperature prediction method of a lithium battery based on TFT provided by an embodiment of the present invention with those of GRU, LSTM, N-Beats, and N-Hits. Detailed implementation manners
[0056] To make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the following describes the technical solutions of the present invention clearly and completely in conjunction with specific embodiments and with reference to the accompanying drawings. Obviously, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0057] Embodiment 1
[0058] Refer to Figure 1 , this embodiment provides a surface temperature prediction method for a lithium battery based on a temporal fusion transformer (TFT), and the method includes the following steps:
[0059] Step 1: Obtain the operation data during battery charging and discharging. The battery operation data includes ambient temperature, voltage, current, and state of charge (SOC). Record the above data as the original input data, and perform preprocessing on the original input data. The preprocessing includes filtering and noise reduction, normalization processing, and time series alignment to obtain the preprocessed battery operation data.
[0060] The filtering process is implemented through Savitzky-Golay filtering, and the calculation method is:
[0061]
[0062] Among them, is the original data point, is the polynomial coefficient, which can be obtained by least squares fitting. The window size is 2m + 1, and the window size of the present invention is taken as 5.
[0063] The normalization processing is implemented through normalization transformation, and the normalization transformation formula is:
[0064]
[0065] Among them, , are respectively the i th values before and after normalization, , are the maximum and minimum values of the sequence respectively.
[0066] Step 2: Divide the preprocessed battery operation data into observed input, known input, and static input. The observed input includes the voltage, current, and state of charge in the battery operation data before the prediction point. The known input includes the ambient temperature after the prediction point. In the present invention, the ambient temperature after the prediction point can be approximately replaced by the ambient temperature data or the battery coolant inlet temperature data before the prediction point. The static input includes the battery operating condition data obtained by one-hot encoding and the fixed ambient temperature data.
[0067] If there are multiple mutually exclusive operating conditions, such as "constant current charging", "constant current discharging", "standing still", convert them into binary vectors using one-hot encoding: constant current charging → [1, 0, 0]; constant current discharging → [0, 1, 0]; standing still → [0, 0, 1].
[0068] If the temperature is a fixed value (such as 25°C), directly input it as a continuous static feature and perform normalization (such as scaling to the interval [0, 1]). If the temperature is divided into ranges (such as "low temperature / normal temperature / high temperature"), then perform one-hot encoding as a categorical variable.
[0069] Step 3: Use the observed input, known input, and static input as inputs and the battery surface temperature as the output to train the TFT model. When the loss function is minimized, the trained TFT model is obtained.
[0070] Figure 2 is the architecture diagram of the TFT model. For a specific time point , the backtracking window and the leading window , where , the inputs of the model include the observed input, known input, and static input. The observed input is the historical data within the time period , the known input is the known future data within the time period , and the target variable spans the time window .
[0071] The present invention adopts a method of hierarchical division of battery operation data, which divides the input data into observed input, known input, and static input. Among them, the observed input covers the battery operation data (such as voltage, current, state of charge) before the prediction point, the known input includes the environmental temperature data after the prediction point (which can be approximately replaced by the environmental temperature or the battery coolant inlet temperature data before the prediction point), and the static input is obtained by one-hot encoding conversion of the battery operating conditions data and the fixed environmental temperature data. This method fully considers the synergistic effect of historical data and future known data in the time series, and at the same time uses static encoding to finely represent the battery operating conditions, realizing the efficient extraction and expression of data features.
[0072] Compared with the existing prediction models, traditional models usually only rely on historical data and fail to fully encode and process future known data and static data, thus having certain limitations in capturing the system state and environmental impacts. By introducing future known data and static encoding, the present invention not only ensures the integrity and continuity of the input data, but also significantly improves the response ability and prediction accuracy of the model under various battery operating conditions and complex environments, overcomes the deficiencies of traditional methods, and has high application value and technical advantages.
[0073] The TFT model includes a VSN layer, an LSTM encoder-decoder layer, a GRN layer, and a multi-head interpretable attention layer. The known input passes through the VSN layer, LSTM encoder, gated unit, batch normalization, and GRN layer, the observed input passes through the VSN layer, LSTM encoder, gated unit, batch normalization, and GRN layer, and the static input passes through the VSN layer, static covariance encoder, gated unit, batch normalization, and GRN layer. The outputs of the three GRN layers are jointly input into the multi-head interpretable attention layer to obtain an output space, and the output space passes through the gated unit, batch normalization, GRN layer, gated unit, batch normalization, and fully connected layer to obtain the output result.
[0074] See Figure 3 , the VSN layer is a variable selection network, including an embedding layer, a GRN unit, and a linear layer. After the input vector enters the embedding layer, it enters a GRN unit respectively. The output of one GRN unit generates a normalized weight vector through the Softmax function. Each feature of the input vector is processed by another GRN unit and then sent to the linear layer for fusion output with the weight vector. The VSN layer is responsible for selecting the most influential features from multi-source inputs. Since the TFT model needs to process inputs from different sources, the present invention has three independent variable selection networks, each network uses different weights to screen features, and each variable selection network filters features through GRN units. At each time step , all past input vectors Ξ tIt will enter a GRN unit, and generate a normalized weight vector through the Softmax function , each feature is also processed by an independent GRN, and finally each feature and the weight vector are sent to the linear layer for fusion output. It should be noted that although each feature has an independent GRN, within the same lookback period, the GRN structure of each feature remains consistent, which enables the model to share information in the time dimension.
[0075] softmax The function expression is:
[0076]
[0077] Among them, is the output value of the i th neuron, N is the number of neurons.
[0078] See Figure 4 , the GRN layer is a gated residual network, including two fully connected layers, an ELU function unit, and a gating unit. The output data after batch normalization passes through a fully connected layer, an ELU function unit, a fully connected layer, a Dropout unit, a gating unit, and batch normalization to obtain the output data. The gated residual network is used multiple times in the TFT model to solve the vanishing gradient problem in deep networks and enhance the learning ability of the network. The gated residual network includes two fully connected layers and two activation functions, which are the exponential linear unit (ELU) and the gated linear unit (GLU) respectively. The gated linear unit is used in the TFT model to select the features that are most critical for predicting the next time step. The use of activation functions enables the network to effectively extract simple or complex patterns from the input data. The output is processed by standard layer normalization. The GRN also includes a residual connection to ensure the smooth flow of information in the deep network and avoid training difficulties caused by an increasing number of layers.
[0079] The ELU function expression is as follows
[0080]
[0081] Among them, x is the input value, is a hyperparameter that can take the value of 1.
[0082] The LSTM encoder-decoder layer in the TFT model is used to generate context-aware time series embeddings, which is similar to the positional encoding used in the classical Transformer. By adding sine and cosine signals, different time steps are distinguished. The LSTM encoder is used to process known input data, while the decoder processes future prediction data. In the TFT model, static information and dynamic time series information are processed differently. Static information does not pass through the LSTM network but generates exogenous information combined with the time series through a static covariance encoder. The initial hidden state and cell state of the LSTM layer will be initialized to the and output by the static covariance encoder, thus ensuring the effective integration of static information.
[0083] The TFT model adopts a self-attention mechanism to capture long-term dependencies between different time steps. To improve the interpretability of the model, the TFT model modifies the multi-head attention mechanism in the standard Transformer architecture to make it more transparent. The traditional attention mechanism weights and sums the values ( ) through the relationship between the query ( ) and the key ( ), and the calculation formula is as follows:
[0084]
[0085] Among them, represents the regularization function, usually adopting the dot-product attention mechanism, and the calculation method is:
[0086]
[0087] Among them, is the dimension of the key, and the function is used to standardize the result of the dot product into a probability distribution so that the sum of the attention weights is 1.
[0088] The TFT model of the present invention uses a multi-head attention mechanism. Each head is responsible for processing different representation subspaces. By concatenating the outputs of all heads and mapping them to obtain the final output space, the expression ability of the model can be further improved.
[0089] The calculation method of the final output space is:
[0090]
[0091] Among them, represents the output of each attention head, is the number of attention heads, is the weight matrix.
[0092] The calculation formula for each head is:
[0093]
[0094] where, represents the output of the h th attention head, represents the query matrix multiplied by the query weight matrix of the h th head, and represents the key matrix multiplied by the key weight matrix of the h th head, and represents the relation pair value matrix multiplied by the relation pair value weight matrix of the h th head, and
[0095] Each attention head uses different weights for queries, keys, and values. Finally, the outputs of each head are linearly combined to obtain the final result. In the TFT model, to further enhance the model's attention to specific features, the output weights of all heads are shared. This sharing strategy enhances the model's ability to learn and interpret common features in time series.
[0096] The loss function for training the TFT model in the present invention can adopt the mean square error or the total loss function combining the physical constraint loss term and the data fitting term. When using the mean square error model training loss function, the loss function is calculated as:
[0097]
[0098] where, is the predicted temperature value, is the actual temperature value, N is the number of samples.
[0099] Through in-depth analysis of the heat conduction of lithium-ion batteries, the present invention takes the physical constraint loss term into consideration because the temperature change of lithium batteries follows the law of conservation of energy, that is, heat generation minus heat dissipation is equal to specific heat capacity multiplied by the temperature change rate, and the mathematical expression is:
[0100]
[0101] where, is the heat generation term, is the heat dissipation term, is the battery specific heat capacity, with the unit of J / (kg·K), is a known physical parameter, which is calibrated by measuring the temperature change per unit energy input of the battery in an adiabatic environment during the adiabatic temperature rise experiment .
[0102]
[0103]
[0104] Among them, is the real-time current, is the internal resistance of the battery, which is calculated in real time according to the formula by establishing the SOC-OCV curve , is the entropy heat term, with the unit of W, which can be calculated by the formula , is the entropy change coefficient, is the convective heat dissipation coefficient, with the unit of W / (m²·K), which is obtained by back-calculating the stable temperature value recorded at a constant power during the steady-state heat dissipation experiment , , is the battery surface area, is the battery surface temperature, is the ambient temperature
[0105] Thus, the equation is obtained:
[0106]
[0107] After discretizing the equation, we get:
[0108]
[0109] Define the physical residual, and calculate the physical constraint residual for the model predicted temperature :
[0110]
[0111] Take the sum of the squares of the residual as the physical constraint loss term :
[0112]
[0113] Combine the physical constraint loss term with the data fitting term:
[0114]
[0115] Among them, 、 represent weights, which can be dynamically adjusted according to the working conditions α / β The ratio increases the physical constraint weight when the current fluctuates greatly (such as pulsed discharge) and decreases the physical constraint weight under steady-state conditions.
[0116]
[0117] Among them, represents a weight that changes over time and is adjusted by the variance of the current change (the ratio to the square of the rated current) within the current time period. is a constant representing the initial weight. represents a certain point in time value of the current or other relevant parameters. represents the time interval to variance of the current change between them. is the rated current of the device or system, which usually represents the maximum current that the device can withstand under normal operating conditions.
[0118] By designing the total loss function for TFT model training, the model not only learns the data patterns but is also explicitly constrained to comply with the first law of thermodynamics, significantly improving the prediction reliability under extreme conditions.
[0119] During the calculation process, by dealing with the numerical stability, gradient explosion can be prevented, specifically including: applying a gradient threshold to the term to achieve gradient clipping, and by dividing by the maximum time interval ( ), time step normalization is achieved, and by applying a moving average filter (window length = 3) to the predicted temperature temperature smoothing is achieved.
[0120] Step 4: Input the operating data of the battery to be measured into the trained TFT model, and predict the surface temperature of the battery to be measured.
[0121] Combined with the actual battery operating conditions, the present invention divides the battery operating data used for model construction into observed input, known input, and static input, constructs a TFT model through multi-source time series feature fusion. TFT combines the self-attention mechanism of Transformer, can effectively process data with long-term dependencies, and adapts to different input data and working states through different sub-models, making it show strong adaptability in complex multi-variable and non-linear environments. In addition, TFT can provide interpretability to a certain extent, helping to analyze and understand the influence of different factors on battery temperature changes, which is often difficult to achieve in traditional black-box models.
[0122] The TFT model constructed in the present invention combines a variable selection network with a gated residual mechanism, adaptively screens the non-linear correlation features of key parameters such as voltage, current, and SOC, effectively overcomes environmental noise interference and multi-variable coupling problems, dynamically analyzes the dominant factors of heat generation in different charge and discharge stages through static covariate encoding and spatio-temporal feature decoupling, provides a traceable decision-making basis for battery thermal management strategies, and can simultaneously capture the local fluctuations and long-range dependence relationships of battery thermal characteristics by integrating the LSTM encoding-decoding layer with a multi-head self-attention mechanism, improving the prediction robustness under complex working conditions.
[0123] Through multi-source time-series feature fusion modeling, the present invention can achieve accurate prediction of the surface temperature only relying on battery operating parameters, eliminate the hardware dependence on physical sensors, significantly reduce the system deployment cost and improve the reliability.
[0124] Embodiment 2
[0125] See Figure 5 , the present invention also provides a lithium battery surface temperature prediction system based on TFT, including:
[0126] A data processing module, configured to obtain battery operation data, preprocess the battery operation data to obtain preprocessed battery operation data; the battery operation data includes the environmental temperature, voltage, current, and state of charge during battery charging and discharging, and the process of preprocessing the battery operation data includes: sequentially performing filter denoising, normalization processing, and time series alignment on the battery operation data, wherein the method of filter denoising is:
[0127]
[0128] Wherein, is the data after filter denoising, is the original data point, is the polynomial coefficient;
[0129] The method of normalization processing is:
[0130]
[0131] Wherein, 、 are the i th values before and after normalization respectively, 、 are the maximum and minimum values of the sequence respectively.
[0132] The data division module is used to divide the pre - processed battery operation data into observed inputs, known inputs, and static inputs. The observed inputs include voltage, current, and state of charge in the battery operation data before the prediction point. The known inputs include the ambient temperature after the prediction point. The static inputs include the battery working condition data obtained through one - hot encoding and the fixed ambient temperature data.
[0133] The model training module is used to train the TFT model with the observed inputs, known inputs, and static inputs as inputs and the battery surface temperature as the output. When the loss function is minimized, the trained TFT model is obtained. The TFT model includes a VSN layer, an LSTM encoder - decoder layer, a GRN layer, and a multi - head interpretable attention layer. The known inputs pass through the VSN layer, LSTM encoder, gated unit, batch normalization, and GRN layer. The observed inputs pass through the VSN layer, LSTM encoder, gated unit, batch normalization, and GRN layer. The static inputs pass through the VSN layer, static covariance encoder, gated unit, batch normalization, and GRN layer. The outputs of the three GRN layers are jointly input into the multi - head interpretable attention layer to obtain an output space. The output space passes through a gated unit, batch normalization, GRN layer, gated unit, batch normalization, and fully - connected layer to obtain the output result.
[0134] The VSN layer includes an embedding layer, GRN units, and a linear layer. After the input vector enters the embedding layer, it enters a GRN unit respectively. The output of one of the GRN units generates a normalized weight vector through the Softmax function. Each feature of the input vector is processed by another GRN unit and then sent to the linear layer together with the weight vector for fusion output. The GRN layer includes two fully - connected layers, an ELU function unit, and a gated unit. The output data after batch normalization passes through the fully - connected layer, ELU function unit, fully - connected layer, Dropout unit, gated unit, and batch normalization to obtain the output data.
[0135] Among them, softmax The function expression is:
[0136]
[0137] Among them, is the output value of the i th neuron, N is the number of neurons;
[0138] The ELU function expression is as follows
[0139]
[0140] Among them, x is the input value, is the hyperparameter.
[0141] Output space of the multi-head interpretable attention layer output is calculated as follows:
[0142]
[0143] Among them, represents the output of each attention head, is the number of attention heads, is the weight matrix, are the query, key, and relation pair values respectively.
[0144] Loss function adopts the mean squared error:
[0145]
[0146] Among them, is the predicted temperature value, is the actual temperature value, N is the number of samples.
[0147] The loss function also adopts the total loss function combining the physical constraint loss term and the data fitting term :
[0148]
[0149] Among them, is the predicted temperature value, is the actual temperature value, is the physical constraint residual, , are the weights, N is the number of samples.
[0150] Prediction module, used to input the operating data of the battery to be tested into the trained TFT model to predict the surface temperature of the battery to be tested.
[0151] Example 3
[0152] The dataset used in this example comes from the University of Maryland battery test dataset. A lithium iron phosphate battery cell with a capacity of 1100 mAh is charged to an SOC of 100% and the voltage is maintained at 3.6 V. A unique dynamic profile is executed on the battery cell until the specified cut-off voltage (2.0 V) is reached, including multiple cycles at ambient temperatures of (-10°C, 0°C, 25°C, 30°C, 50°C), Figure 6 is the prediction effect diagram at an ambient temperature of 30°C.
[0153] Data preprocessing: Filter and normalize the model input data, including voltage, current, ambient temperature, and SOC.
[0154] Dataset division: Divide the first 50% of the time series data as training data, 50% - 70% of the data as validation data, and 70% - 100% of the data as test data. The training data, validation data, and test data respectively include observed inputs, known inputs, and static inputs.
[0155] Set the number of attention heads to 4, corresponding to four features. Select a basic TFT hyperparameter table, delimit the hyperparameter optimization space, and use the optuna library in python to optimize the TFT hyperparameters on a partial training set through the Bayesian method.
[0156] After optimization, determine the hyperparameters of TFT. Set the loss function to RMSE, and set the early stopping condition as: the RMSE decrease is less than 1e - 4 after 10 epochs, and the maximum number of epochs is 300. Train the TFT model on the training - validation set according to the variable classification method described in the invention content, and record the model weights obtained after training.
[0157] According to the same hyperparameter selection logic, train the GRU, LSTM, N - Beats, and N - Hits models, and record the model weights obtained after training.
[0158] Quantify and compare the prediction accuracies of TFT with GRU, LSTM, N - Beats, and N - Hits through RMSE. Among them, GRU (Gated Recurrent Units) is a variant of the recurrent neural network (RNN), mainly used to process time series data. The design of GRU simplifies the structure of LSTM (Long Short - Term Memory), and controls the flow of information through a gating mechanism. LSTM (Long Short - Term Memory) is another variant of the recurrent neural network (RNN), specifically designed to overcome the vanishing gradient problem of the standard RNN and is good at dealing with long - term dependence problems. N - Beats is a deep - learning - based time series prediction model that captures different time series patterns by stacking multiple network blocks and does not rely on traditional statistical methods. N - Hits is an enhanced version of the N - Beats model, specifically designed for time series prediction tasks and can automatically learn and predict multiple time series patterns. TFT (Temporal Fusion Transformer) is a Transformer - based model, specifically used for time series prediction, combining the ability of long - term and short - term dependence and pattern recognition of complex time series.
[0159] The error metrics include MAE, RMSE, and MAXE. Among them, MAE (Mean Absolute Error) is the mean absolute error, representing the average absolute difference between the predicted value and the actual value, and the smaller the better. RMSE (Root Mean Squared Error) is the root mean square error, representing the square root of the error between the predicted value and the actual value, which can pay more attention to larger errors. MAXE (Maximum Absolute Error) is the maximum absolute error, representing the maximum absolute error between the predicted value and the actual value, which can reflect the most serious prediction errors. As Figure 7 shown, compared with the existing prediction methods, the TFT-based lithium battery surface temperature prediction method of the present invention has the lowest values in the three error metrics of MAE, RMSE, and MAXE.
[0160] Extract the weights of the attention heads and perform visual analysis on the importance of each input variable.
[0161] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A TFT-based method for predicting the surface temperature of a lithium battery, characterized in that: The method includes: Obtaining battery operation data, preprocessing the battery operation data to obtain preprocessed battery operation data; The battery operation data includes the ambient temperature, voltage, current, and state of charge during battery charging and discharging; Dividing the preprocessed battery operation data into observed inputs, known inputs, and static inputs; Taking the observation input, known input, and static input as inputs and the battery surface temperature as the output, the TFT model is trained. When the loss function is minimized, the trained TFT model is obtained; the loss function adopts the total loss function combining the physical constraint loss term and the data fitting term : Physical constraint residual is as follows: Among them, and are the temperature prediction values at time respectively, is the actual temperature value, is the ambient temperature, and are the current and internal resistance of the battery at time respectively, and are weights, is the specific heat capacity of the battery, is the entropy heat term, is the convective heat dissipation coefficient, is the surface area of the battery, N is the number of samples; Inputting the battery operation data to be measured into the trained TFT model to predict the surface temperature of the battery to be measured.
2. The method for predicting the surface temperature of a lithium battery based on TFT according to claim 1, wherein: The process of preprocessing the battery operation data includes: successively performing filtering and noise reduction, standardization processing, and time series alignment on the battery operation data. Among them, the method of filtering and noise reduction is: Among them, is the data after filtering and noise reduction, is the original data point, is the polynomial coefficient; The method of standardization processing is: Among them, , are the i th values before and after normalization respectively, and , are the maximum and minimum values of the sequence respectively.
3. The method for predicting the surface temperature of a lithium battery based on TFT according to claim 1, wherein: The observed inputs include the voltage, current, and state of charge in the battery operation data before the prediction point, the known inputs include the ambient temperature after the prediction point, and the static inputs include the battery condition data obtained through one-hot encoding and the fixed ambient temperature data.
4. The method for predicting the surface temperature of a lithium battery based on TFT according to claim 1, wherein: The TFT model includes a VSN layer, an LSTM encoder-decoder layer, a GRN layer, and a multi-head interpretable attention layer. The known inputs pass through the VSN layer, LSTM encoder, gated unit, batch normalization, and GRN layer. The observed inputs pass through the VSN layer, LSTM encoder, gated unit, batch normalization, and GRN layer. The static inputs pass through the VSN layer, static covariance encoder, gated unit, batch normalization, and GRN layer. The outputs of the three GRN layers are jointly input into the multi-head interpretable attention layer to obtain an output space. The output space passes through a gated unit, batch normalization, GRN layer, gated unit, batch normalization, and fully connected layer to obtain the output result.
5. The method for predicting the surface temperature of a lithium battery based on TFT according to claim 4, wherein: The VSN layer includes an embedding layer, a GRN unit, and a linear layer. After the input vector enters the embedding layer, it enters a GRN unit respectively. The output of one GRN unit generates a standardized weight vector through the Softmax function. Each feature of the input vector is processed by another GRN unit and then sent to the linear layer for fusion output with the weight vector. The GRN layer includes two fully connected layers, an ELU function unit, and a gated unit. The output data after batch normalization passes through a fully connected layer, an ELU function unit, a fully connected layer, a Dropout unit, a gated unit, and batch normalization to obtain the output data.
6. The method for predicting the surface temperature of a lithium battery based on TFT according to claim 5, wherein: softmax The function expression is: Among them, is the output value of the i th neuron, N where is the number of neurons; The ELU function expression is as follows Among them, x is the input value, is the hyperparameter.
7. The method for predicting the surface temperature of a lithium battery based on TFT according to claim 4, wherein: Output space of the output of the multi-head interpretable attention layer is calculated as follows: Among them, represents the output of each attention head, is the number of attention heads, is the weight matrix, are the query, key, and relative pair values respectively.
8. TFT-based lithium battery surface temperature prediction system, characterized in that: The system includes: A data processing module for obtaining battery operation data, preprocessing the battery operation data to obtain preprocessed battery operation data; The battery operation data includes the ambient temperature, voltage, current, and state of charge during battery charging and discharging; A data division module for dividing the preprocessed battery operation data into observed inputs, known inputs, and static inputs; The model training module is used to train the TFT model with the observed input, known input, and static input as the inputs and the battery surface temperature as the output. When the loss function is minimized, the trained TFT model is obtained. The loss function adopts the total loss function combining the physical constraint loss term and the data fitting term : Physical constraint residual is as follows: Among them, , are the predicted temperature values at time respectively, is the actual temperature value, is the ambient temperature, , are the current and internal resistance of the battery at time respectively, , are the weights, is the specific heat capacity of the battery, is the entropy heat term, is the convective heat dissipation coefficient, is the surface area of the battery, N is the number of samples; A prediction module for inputting the battery operation data to be measured into the trained TFT model to predict the surface temperature of the battery to be measured.
9. The TFT-based surface temperature prediction system for lithium batteries according to claim 8, wherein: The process of preprocessing the battery operation data includes: successively performing filtering and noise reduction, standardization processing, and time series alignment on the battery operation data. Among them, the method of filtering and noise reduction is: Among them, is the data after filtering and noise reduction, is the original data point, is the polynomial coefficient; The method of standardization processing is: Among them, , are the i -th values before and after normalization respectively, and , are the maximum and minimum values of the sequence respectively.
10. The TFT-based lithium battery surface temperature prediction system according to claim 8, wherein: The observation input includes the voltage, current, and state of charge in the battery operation data before the prediction point. The known input includes the ambient temperature after the prediction point. The static input includes the battery operating condition data obtained by one-hot encoding and the fixed ambient temperature data.
Citation Information
Patent Citations
Lithium battery discharge capacity estimation method without temperature sensor
CN118393361A
Lithium ion battery charge state estimation method based on time domain fusion converter
CN117538783A