Lithium battery surface temperature prediction method and system based on TFT
By adopting a TFT-based method in lithium battery temperature prediction, processing battery operation data and combining Transformer's self-attention mechanism, the problem of lack of interpretability and difficulty in dealing with long time series is solved, and high accuracy and adaptive temperature prediction in complex environments is achieved.
Patent Information
- Application Number
- CN202510364723.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-26
AI Technical Summary
Existing data-driven methods have problems in the prediction of lithium battery temperatures that lack interpretability and difficulty in dealing with long time series.
The surface temperature prediction method of lithium battery based on TFT is adopted to obtain battery operation data for pre-processing and divide it into observation input, known input, and static input. The TFT model combined with Transformer's self-attention mechanism is used to process long-term dependence data and adapt to different input data and working states.
It realizes temperature prediction with strong adaptability in complex multivariable and nonlinear environments, provides interpretability, helps analyze the impact of different factors on battery temperature changes, and significantly improves prediction accuracy and response capabilities.
Smart Images

Figure CN119884609A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lithium battery management, and in particular to a TFT-based lithium battery surface temperature prediction method and system. Background Art
[0002] Lithium-ion batteries are 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, a large amount of heat is generated due to internal resistance and electrochemical reactions. If the heat cannot be dissipated in a timely and effective manner, the battery temperature will rise sharply, which may cause 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, battery performance will drop significantly, so accurately predicting battery temperature is crucial to ensure its normal operation and extend its service life.
[0003] However, lithium battery temperature prediction faces many challenges. Existing prediction methods mainly include physical modeling, traditional statistical methods and data-driven models, but each method has certain limitations in practical applications: (1) Battery temperature prediction based on physical models: This method usually relies on detailed modeling of the thermal behavior inside the battery, requires accurate acquisition of material parameters such as the thermal conductivity and heat capacity of the battery, and parameter identification through a large amount of experimental data. Physical models cannot make real-time predictions, especially when battery types are diverse and the working environment is complex. Physical models have poor adaptability and heavy computational burden.
[0004] (2) Methods based on traditional statistics and time series analysis: This method works well when processing linear and stable data, but for nonlinear and non-stationary data, especially the large fluctuations that occur during the battery charging and discharging process, its predictive ability is limited and its accuracy is difficult to guarantee.
[0005] (3) Machine learning-based methods: Although machine learning can capture complex nonlinear relationships in data and improve 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 when faced with multiple variables, multiple factors, and dynamic changes.
[0006] In the practical application of lithium battery temperature prediction, especially in new energy vehicles and energy storage systems, battery temperature is affected by multiple factors, including ambient temperature, charge and discharge current, and electrochemical reactions inside the battery. Traditional temperature prediction methods often ignore the complex interactions and real-time changes of these multiple factors, which reduces the accuracy and practicality of the prediction results. In addition, most existing methods focus on prediction through a single data source (such as the battery itself or environmental data), and fail to fully consider the impact of external factors such as driving behavior and load status on battery temperature. In order to overcome these limitations, data-driven methods have gradually become a hot topic in temperature prediction research in recent years. In particular, deep learning techniques, such as convolutional neural networks (CNNs), long short-term memory networks (LSTMs), and gated recurrent units (GRUs), have shown good prospects in lithium battery temperature prediction because they can effectively process time series data and capture complex nonlinear relationships. For example, the Chinese invention patent application "A method for estimating the discharge capacity of a lithium battery without a temperature sensor" with publication number CN118393361A uses the TCN-GRU model for temperature prediction. However, the model lacks interpretability and has difficulty processing long time series, especially under different working conditions. The generalization ability of a single model is poor. Summary of the invention
[0007] The technical problem to be solved by the present invention is how to solve the problem of lack of interpretability and difficulty in processing long time series in the existing data-driven method for lithium battery temperature prediction.
[0008] 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 comprising: Acquire battery operation data, pre-process the battery operation data, and obtain pre-processed battery operation data; Divide the preprocessed battery operation data into observed input, known input, and static input; The TFT model is trained with observed input, known input and static input as input and the battery surface temperature as output. When the loss function is minimized, the trained TFT model is obtained. The operating data of the battery to be tested is input into the trained TFT model to predict the surface temperature of the battery to be tested.
[0009] Beneficial effects: The present invention combines actual battery operating conditions, divides the battery operating data used for model construction into observed inputs, known inputs, and static inputs, and constructs a TFT model by fusing multi-source time series features. TFT combines the self-attention mechanism of Transformer, which can effectively process long-term dependent data, and adapts to different input data and working states through different sub-models, making it more adaptable in complex multivariate and nonlinear environments. The TFT model can provide interpretability, helping to analyze and understand the impact of different factors on battery temperature changes, which is often difficult to do in traditional black box models.
[0010] Preferably, the battery operation data includes the ambient temperature, voltage, current, and state of charge of the battery during charging and discharging. The process of preprocessing the battery operation data includes: filtering and denoising the battery operation data, standardizing the battery operation data, and aligning the time series in sequence. The filtering and denoising method is:
[0011] in, is the data after filtering and noise reduction, is the original data point, are the polynomial coefficients; The standardization process is as follows:
[0012] in, , They are the first and second i values, , are the maximum and minimum values of the sequence respectively.
[0013] Preferably, 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, and the static input includes the battery operating condition data and fixed ambient temperature data obtained by one-hot encoding.
[0014] Beneficial effects: The present invention divides the ambient temperature, voltage, current, and state of charge in the battery operation data in combination with the actual battery operating conditions, links the TFT model with various factors affecting the battery temperature, and fully considers the synergistic effect of historical data and future known data in the time series. At the same time, static coding is used to accurately represent the battery operating conditions, thereby achieving efficient extraction and expression of data features. By introducing future known data and static coding, not only the integrity and continuity of the input data are guaranteed, but also the responsiveness and prediction accuracy of the model under various battery operating conditions and complex environments are significantly improved.
[0015] 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 gating unit, batch normalization, and the GRN layer. The observed input passes through the VSN layer, the LSTM encoder, the gating unit, batch normalization, and the GRN layer. The static input passes through the VSN layer, the static covariance encoder, the gating 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 the output space. The output space passes through the gating unit, batch normalization, the GRN layer, the gating unit, batch normalization, and the fully connected layer to obtain the output result.
[0016] 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, wherein the output of one GRN unit generates a standardized weight vector through a Softmax function, and each feature of the input vector is processed by another GRN unit and sent to the linear layer with the weight vector for fusion output; the GRN layer includes two fully connected layers, an ELU function unit, and a gating unit. The output data processed by batch normalization is processed by 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.
[0017] Beneficial effects: The TFT model constructed by the present invention combines the variable selection network with the gated residual mechanism to adaptively screen the nonlinear correlation characteristics of key parameters such as voltage, current, SOC, etc., effectively overcome the problems of environmental noise interference and multivariate coupling, and dynamically analyze the dominant factors of heat generation in different charging and discharging stages through static covariate encoding and spatiotemporal feature decoupling, so as to provide a traceable decision-making basis for battery thermal management strategies. By integrating the LSTM encoding and decoding layer with the multi-head self-attention mechanism, it can simultaneously capture the local fluctuations and long-range dependencies of the battery thermal characteristics, and improve the prediction robustness under complex working conditions.
[0018] Preferably, softmax The function expression is:
[0019] in, It is i The output value of a neuron, N is the number of neurons; The ELU function expression is as follows
[0020] in, x is the input value, is a hyperparameter.
[0021] Preferably, the output space of the multi-headed attention layer output can be explained The calculation method is:
[0022] in, represents the output of each attention head, is the number of attention heads, is the weight matrix, They are query, key, and relation pair values respectively.
[0023] Beneficial effect: The TFT model of the present invention uses a multi-head attention mechanism, where each head is responsible for processing a different representation subspace. By concatenating and mapping the outputs of all heads to obtain the final output space, the expressive power of the model can be further improved.
[0024] Preferably, the loss function Using mean square error:
[0025] in, is the predicted temperature value, is the actual temperature value, N is the sample size.
[0026] Preferably, the loss function adopts the total loss function combining the physical constraint loss term and the data fitting term :
[0027] in, is the predicted temperature value, is the actual temperature value, is the physical constraint residual, , is the weight, N is the sample size.
[0028] Beneficial effect: By designing the total loss function for TFT model training, the model not only learns the data rules, but is also explicitly constrained to obey the first law of thermodynamics, thereby balancing data and physical constraints, adapting the timing model, and significantly improving the prediction reliability under extreme working conditions.
[0029] The present invention also provides a lithium battery surface temperature prediction system based on TFT, the system comprising: A data processing module, used for acquiring battery operation data, preprocessing the battery operation data, and obtaining preprocessed battery operation data; A data partitioning module, used for partitioning the pre-processed battery operation data into observation input, known input, and static input; The model training module is used to train the TFT model with observed input, known input, and static input as input and the battery surface temperature as output. When the loss function is minimized, the trained TFT model is obtained. The prediction module is 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.
[0030] The advantages provided by the present invention are: the present invention can achieve accurate prediction of surface temperature by relying only on battery operating parameters through multi-source time series feature fusion modeling, can eliminate hardware dependence on physical sensors, significantly reduce system deployment costs and improve reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A flow chart of a method for predicting the surface temperature of a lithium battery based on TFT provided in an embodiment of the present invention; Figure 2 A diagram of the TFT model architecture in the TFT-based lithium battery surface temperature prediction method provided in an embodiment of the present invention; Figure 3 A network architecture diagram of variable selection of a TFT model in a TFT-based lithium battery surface temperature prediction method provided in an embodiment of the present invention; Figure 4 A gated residual network architecture diagram of a TFT model in a TFT-based lithium battery surface temperature prediction method provided in an embodiment of the present invention; Figure 5 A schematic diagram of a TFT-based lithium battery surface temperature prediction system provided by an embodiment of the present invention; Figure 6 A diagram showing the prediction effect of the TFT-based lithium battery surface temperature prediction method provided in an embodiment of the present invention when the ambient temperature is 30°C; Figure 7 A schematic diagram comparing the prediction accuracy of the lithium battery surface temperature prediction method based on TFT provided in an embodiment of the present invention with that of GRU, LSTM, N-Beats, and N-Hits. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the technical solution of the present invention is clearly and completely described below in combination with specific embodiments and with reference to the accompanying drawings. 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.
[0033] Example 1 See also Figure 1This embodiment provides a lithium battery surface temperature prediction method based on a temporal fusion transformer (TFT), the method comprising the following steps: Step 1: Obtain the operating data of the battery during charging and discharging. The battery operating data includes ambient temperature, voltage, current, and state of charge (SOC). The above data is recorded as the original input data, and the original input data is preprocessed. The preprocessing includes filtering and noise reduction, standardization, and time series alignment to obtain the preprocessed battery operating data.
[0034] The filtering process is implemented by Savitzky-Golay filtering, and the calculation method is:
[0035] in, is the original data point, are polynomial coefficients, which can be obtained by least squares fitting. The window size is 2m+1, and the window size of the present invention is 5.
[0036] Standardization is achieved through normalization transformation, and the normalization transformation formula is:
[0037] in, , They are the first and second i values, , are the maximum and minimum values of the sequence respectively.
[0038] 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 before the prediction point or the battery coolant inlet temperature data. The static input includes the battery operating condition data and fixed ambient temperature data obtained by one-hot encoding.
[0039] If there are multiple mutually exclusive working conditions, such as "constant current charging", "constant current discharging", and "stationary", use one-hot encoding to convert them into binary vectors: constant current charging → [1,0,0]; constant current discharging → [0,1,0]; stationary → [0,0,1].
[0040] If the temperature is a fixed value (such as 25°C), it is directly input as a continuous static feature and needs to be normalized (such as scaling to the [0,1] interval). If the temperature is divided into different levels (such as "low temperature / normal temperature / high temperature"), it is encoded as a categorical variable.
[0041] Step 3: Take the observed input, known input, and static input as input and the battery surface temperature as output to train the TFT model. When the loss function is minimized, the trained TFT model is obtained.
[0042] Figure 2 This is the architecture diagram of the TFT model, for a specific time point , Lookback Window and the look-ahead window ,in The input of the model includes observation input, known input, and static input. The observation input is the time period Historical data within, given that the input is a time period The target variable spans the time window .
[0043] The present invention adopts a hierarchical division method for battery operation data, dividing the input data into observed input, known input and static input, where the observed input covers the battery operation data before the prediction point (such as voltage, current, state of charge), the known input includes the ambient temperature data after the prediction point (which can be approximately replaced by the ambient temperature before the prediction point or the battery coolant inlet temperature data), and the static input is converted into battery operating condition data and fixed ambient temperature data through one-hot encoding. This method fully considers the synergy between historical data and future known data in the time series, and uses static encoding to finely represent the battery operating condition, realizing efficient extraction and expression of data features.
[0044] Compared with existing prediction models, traditional models usually rely only on historical data and fail to fully encode future known data and static data, which results in certain limitations in capturing system status and environmental impacts. The present invention not only ensures the integrity and continuity of input data by introducing future known data and static coding, but also significantly improves the model's responsiveness and prediction accuracy under a variety of battery operating conditions and complex environments, overcoming the shortcomings of traditional methods and having high application value and technical advantages.
[0045] 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 gating unit, batch normalization, and the GRN layer. The observed input passes through the VSN layer, the LSTM encoder, the gating unit, batch normalization, and the GRN layer. The static input passes through the VSN layer, the static covariance encoder, the gating 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 the output space. The output space passes through the gating unit, batch normalization, the GRN layer, the gating unit, batch normalization, and the fully connected layer to obtain the output result.
[0046] See also 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 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 with the weight vector for fusion output. 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 of which uses different weights to screen features. Each variable selection network filters features through the GRN unit. At each time step, , all past input vectors Ξ t It will enter a GRN unit and generate a standardized weight vector through the Softmax function , each feature It is also processed by an independent GRN, and finally each feature and weight vector It is sent to the linear layer for fusion output. It should be noted that although each feature has an independent GRN, the GRN structure of each feature remains consistent within the same lookback period, which enables the model to share information in the time dimension.
[0047] softmax The function expression is:
[0048] in, It is i The output value of a neuron, N is the number of neurons.
[0049] See also Figure 4, the GRN layer is a gated residual network, which includes two fully connected layers, ELU functional units, and gated units. The output data processed by batch normalization is processed by fully connected layers, ELU functional units, fully connected layers, Dropout units, gated units, and batch normalization to obtain the output data. Gated residual networks are used many times in TFT models to solve the gradient vanishing problem in deep networks and enhance the learning ability of the network. Gated residual networks include two fully connected layers and two activation functions, the activation functions are exponential linear units (ELU) and gated linear units (GLU). Gated linear units are used in TFT models to select the most critical features 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. GRN also includes residual connections to ensure that information can flow smoothly in deep networks and avoid training difficulties caused by the increase in the number of layers.
[0050] The ELU function expression is as follows
[0051] in, x is the input value, It is a hyperparameter and can take a value of 1.
[0052] The LSTM encoder-decoder layer is used in the TFT model to generate context-aware time series embeddings. This process is similar to the positional encoding used in the classic Transformer, which distinguishes the time steps by adding sine and cosine signals. The LSTM encoder is used to process known input data, while the decoder processes future predicted data. In the TFT model, static information is processed differently from dynamic time series information. Static information does not pass through the LSTM network, but rather through the static covariance encoder to generate exogenous information combined with the time series. The initial hidden state of the LSTM layer and cell status will be initialized to the output of the static covariance encoder and , thereby ensuring the effective integration of static information.
[0053] The TFT model uses a self-attention mechanism to capture long-term dependencies between different time steps. In order 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 is to query ( ) and keys ( ) of the relationship between the values ( ) is weighted summed, and the calculation formula is as follows:
[0054] in, represents the regularization function, which usually adopts the dot product attention mechanism and is calculated as:
[0055] in, is the dimension of the key, The function is used to normalize the result of the dot product into a probability distribution so that the sum of the attention weights is 1.
[0056] The TFT model of the present invention uses a multi-head attention mechanism, where each head is responsible for processing a different representation subspace. The outputs of all heads are concatenated and mapped to obtain the final output space, which can further improve the expressiveness of the model.
[0057] The final output space is calculated as:
[0058] in, represents the output of each attention head, is the number of attention heads, is the weight matrix.
[0059] The calculation formula for each head is:
[0060] in, Indicates h The output of an attention head is Represents the query matrix With h The query weight matrix of each head Multiply, Represents the key matrix With h The key weight matrix of each head Multiply, Represents the relationship pair matrix With h The relationship value weight matrix of each head Multiply.
[0061] Each attention head uses different query, key, and value weights, and finally linearly combines the outputs of each head to get the final result. In the TFT model, in order to further improve 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 explain common features in time series.
[0062] The loss function for training the TFT model in the present invention can adopt the total loss function combining the mean square error or the physical constraint loss term with the data fitting term. When the loss function of the mean square error model training is adopted, the loss function The calculation method is:
[0063] in, is the predicted temperature value, is the actual temperature value, N is the sample size.
[0064] The present invention takes into account the physical constraint loss term through an in-depth analysis of the heat conduction of lithium-ion batteries, because the temperature change of lithium batteries follows the law of conservation of energy, that is, heat generation minus heat dissipation equals specific heat capacity multiplied by the temperature change rate, and the mathematical expression is:
[0065] in, is the heat production item, For heat dissipation, is the specific heat capacity of the battery, in J / (kg·K), It is a known physical parameter. In the adiabatic temperature rise experiment, it is calibrated by measuring the temperature change of the battery per unit energy input in an adiabatic environment. .
[0066]
[0067]
[0068] in, is the real-time current, is the internal resistance of the battery. By establishing the SOC-OCV curve, according to the formula Calculated in real time, is the entropy heat term, with the unit of W, which can be expressed by the formula Calculated, is the entropy change coefficient, is the convection heat dissipation coefficient, in W / (m²·K). In the steady-state heat dissipation experiment, it is obtained by recording the temperature stability value at constant power. , , is the battery surface area, is the battery surface temperature, is the ambient temperature.
[0069] This gives the equation:
[0070] After discretizing the equation, we get:
[0071] Define the physical residuals and predict the temperature for the model Calculating Physical Constraint Residuals :
[0072] The residual The sum of squares is used as the physical constraint loss term :
[0073] Combine the physical constraint loss term with the data fitting term:
[0074] in, , Indicates weight, which can be adjusted dynamically according to working conditions α / β When the current fluctuates greatly (such as pulse discharge), the physical constraint weight is increased, and when the current fluctuates greatly (such as pulse discharge), the physical constraint weight is reduced.
[0075]
[0076] in, represents a weight that changes over time, which is adjusted by the variance of the current change in the current period (ratio to the square of the rated current). is a constant, indicating the initial weight, Indicates a point in time The value of the current or other relevant parameters, Indicates time interval arrive The variance of the current change between The rated current of a device or system usually represents the maximum current that the device can withstand under normal working conditions.
[0077] The present invention designs a total loss function for TFT model training. The model not only learns data patterns but is also explicitly constrained to obey the first law of thermodynamics, thereby significantly improving the prediction reliability under extreme working conditions.
[0078] During the calculation process, the gradient explosion can be prevented by processing numerical stability, including: The term applies a gradient threshold to achieve gradient clipping by Divide by the maximum time interval ( ), to achieve time step normalization, by predicting the temperature A sliding average filter (window length = 3) is applied to achieve temperature smoothing.
[0079] Step 4: 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.
[0080] The present invention combines the actual battery operating conditions, divides the battery operating data used for model construction into observation input, known input and static input, and constructs the TFT model by fusing multi-source time series features. TFT combines the self-attention mechanism of Transformer, which can effectively process long-term dependent data, and adapts to different input data and working states through different sub-models, so that it shows strong adaptability in complex multivariate and nonlinear environments. In addition, TFT can provide interpretability to a certain extent, helping to analyze and understand the impact of different factors on battery temperature changes, which is often difficult to do in traditional black box models.
[0081] The TFT model constructed by the present invention combines the variable selection network with the gated residual mechanism, adaptively screens the nonlinear correlation characteristics of key parameters such as voltage, current, SOC, etc., effectively overcomes the problems of environmental noise interference and multivariate coupling, and dynamically analyzes the dominant factors of heat generation in different charging and discharging stages through static covariate encoding and spatiotemporal feature decoupling, providing a traceable decision-making basis for battery thermal management strategies. By integrating the LSTM encoding and decoding layer with the multi-head self-attention mechanism, it can synchronously capture the local fluctuations and long-range dependencies of the battery thermal characteristics, thereby improving the prediction robustness under complex working conditions.
[0082] The present invention realizes accurate prediction of surface temperature by fusion modeling of multi-source time series features relying only on battery operating parameters, which can eliminate hardware dependence on physical sensors, significantly reduce system deployment costs and improve reliability.
[0083] Example 2 See also Figure 5 The present invention also provides a lithium battery surface temperature prediction system based on TFT, comprising: The data processing module is used to obtain the battery operation data, pre-process the battery operation data, and obtain the pre-processed battery operation data; the battery operation data includes the ambient temperature, voltage, current, and charge state of the battery during charging and discharging. The process of pre-processing the battery operation data includes: filtering and denoising the battery operation data, standardizing the battery operation data, and aligning the time series in sequence, wherein the filtering and denoising method is:
[0084] in, is the data after filtering and noise reduction, is the original data point, are the polynomial coefficients; The standardization process is as follows:
[0085] in, , They are the first and second i values, , are the maximum and minimum values of the sequence respectively.
[0086] The data partitioning module is used to 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, and the static input includes the battery operating condition data and fixed ambient temperature data obtained by one-hot encoding.
[0087] The model training module is used to train the TFT model with observed input, known input and static input as input and battery surface temperature as 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 input passes through the VSN layer, the LSTM encoder, the gating unit, the batch normalization, and the GRN layer. The observed input passes through the VSN layer, the LSTM encoder, the gating unit, the batch normalization, and the GRN layer. The static input passes through the VSN layer, the static covariance encoder, the gating unit, the 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 the output space. The output space passes through the gating unit, batch normalization, the GRN layer, the gating unit, the batch normalization, and the fully connected layer to obtain the output result.
[0088] 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 sent to the linear layer with the weight vector for fusion output; the GRN layer includes two fully connected layers, an ELU function unit, and a gating unit. The output data processed by batch normalization is processed by the fully connected layer, the ELU function unit, the fully connected layer, the Dropout unit, the gating unit, and the batch normalization to obtain the output data.
[0089] in, softmax The function expression is:
[0090] in, It is i The output value of a neuron, N is the number of neurons; The ELU function expression is as follows
[0091] in, x is the input value, is a hyperparameter.
[0092] Output space of multi-head interpretable attention layer outputs The calculation method is:
[0093] in, represents the output of each attention head, is the number of attention heads, is the weight matrix, They are query, key, and relation pair values respectively.
[0094] Loss Function Using mean square error:
[0095] in, is the predicted temperature value, is the actual temperature value, N is the sample size.
[0096] The loss function also uses a total loss function that combines the physical constraint loss term with the data fitting term :
[0097] in, is the predicted temperature value, is the actual temperature value, is the physical constraint residual, , is the weight, N is the sample size.
[0098] The prediction module is 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.
[0099] Example 3 The data set used in this example comes from the University of Maryland battery test data set. A lithium-ion phosphate battery cell with a capacity of 1100mAh is charged to 100% SOC and the voltage is maintained at 3.6V. A unique dynamic profile is executed on the battery cell until the specified cut-off voltage (2.0V) is reached, including multiple cycles at ambient temperatures (-10°C, 0°C, 25°C, 30°C, 50°C). Figure 6This is the predicted effect diagram when the ambient temperature is 30°C.
[0100] Data preprocessing: Filter and normalize the model input data, including voltage, current, ambient temperature, and SOC.
[0101] Data set division: The first 50% of the data in the time series is divided into training data, 50%-70% of the data is divided into verification data, and 70%-100% of the data is divided into test data. The training data, verification data, and test data include observed inputs, known inputs, and static inputs, respectively.
[0102] The number of attention heads is set to 4, corresponding to four features. A basic TFT hyperparameter table is selected and the hyperparameter optimization space is defined. The Python optuna library is used to optimize the TFT hyperparameters on part of the training set using the Bayesian method.
[0103] After optimization, the hyperparameters of TFT are determined, the loss function is set to RMSE, the early stopping condition is set to: the RMSE decreases by less than 1e-4 after 10 epochs, the maximum epoch is 300, and the TFT model is trained on the training-validation set according to the variable classification method described in the invention content, and the model weights obtained after training are recorded.
[0104] According to the same hyperparameter selection logic, the GRU, LSTM, N-Beats, and N-Hits models are trained, and the model weights obtained after training are recorded.
[0105] The prediction accuracy of TFT is quantified and compared with that of GRU, LSTM, N-Beats, and N-Hits by RMSE. Among them, GRU (Gated Recurrent Units) is a variant of recurrent neural network (RNN) mainly used to process time series data. The design of GRU simplifies the structure of LSTM (Long Short-Term Memory Network) and controls the flow of information through a gating mechanism. LSTM (Long Short-Term Memory) is another variant of recurrent neural network (RNN) that is specifically designed to overcome the gradient vanishing problem of standard RNN and is good at dealing with long-term dependency problems. N-Beats is a time series prediction model based on deep learning. It 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, which is specially designed to handle 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 pattern recognition capabilities of long-term and short-term dependencies and complex time series.
[0106] Error metrics include MAE, RMSE, and MAXE. MAE (Mean Absolute Error) is the mean absolute error, which indicates the average absolute difference between the predicted value and the actual value. The smaller the better. RMSE (Root Mean Squared Error) is the root mean square error, which indicates the square root of the error between the predicted value and the actual value. It can pay more attention to larger errors. MAXE (Maximum Absolute Error) is the maximum absolute error, which indicates the maximum absolute error between the predicted value and the actual value. It can reflect the most serious prediction errors. Figure 7 As shown, compared with the existing prediction methods, the lithium battery surface temperature prediction method based on TFT of the present invention has the lowest error indicators MAE, RMSE and MAXE.
[0107] Extract the weights of the attention heads and perform a visual analysis of the importance of each input variable.
[0108] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A TFT-based lithium battery surface temperature prediction method, characterized in that: Methods include: Acquire battery operation data, pre-process the battery operation data, and obtain pre-processed battery operation data; Divide the preprocessed battery operation data into observed input, known input, and static input; The TFT model is trained with observed input, known input and static input as input and the battery surface temperature as output. When the loss function is minimized, the trained TFT model is obtained. The operating data of the battery to be tested is input into the trained TFT model to predict the surface temperature of the battery to be tested.
2. The TFT-based lithium battery surface temperature prediction method according to claim 1, characterized in that: The battery operation data includes the ambient temperature, voltage, current, and state of charge during battery charging and discharging. The process of preprocessing the battery operation data includes: filtering and denoising the battery operation data, standardizing the data, and aligning the time series. The filtering and denoising methods are as follows: in, is the data after filtering and noise reduction, is the original data point, are the polynomial coefficients; The standardization process is as follows: in, , They are the first and second i values, , 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, characterized in that: 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, and the static input includes the battery operating condition data and fixed ambient temperature data obtained by one-hot encoding.
4. The method for predicting the surface temperature of a lithium battery based on TFT according to claim 1, characterized in that: 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 gating unit, batch normalization, and the GRN layer. The observed input passes through the VSN layer, the LSTM encoder, the gating unit, batch normalization, and the GRN layer. The static input passes through the VSN layer, the static covariance encoder, the gating 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 the output space. The output space passes through the gating unit, batch normalization, the GRN layer, the gating unit, batch normalization, and the 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, characterized in that: 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 sent to the linear layer with the weight vector for fusion output; the GRN layer includes two fully connected layers, an ELU function unit, and a gating unit. The output data processed by batch normalization is processed by the fully connected layer, the ELU function unit, the fully connected layer, the Dropout unit, the gating unit, and the 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, characterized in that: softmax The function expression is: in, It is i The output value of a neuron, N is the number of neurons; The ELU function expression is as follows in, x is the input value, is a hyperparameter.
7. The method for predicting the surface temperature of a lithium battery based on TFT according to claim 4, characterized in that: Output space of multi-head interpretable attention layer outputs The calculation method is: in, represents the output of each attention head, is the number of attention heads, is the weight matrix, They are query, key, and relation pair values respectively.
8. The method for predicting the surface temperature of a lithium battery based on TFT according to claim 1, characterized in that: Loss Function Using mean square error: in, is the predicted temperature value, is the actual temperature value, N is the sample size.
9. The method for predicting the surface temperature of a lithium battery based on TFT according to claim 1, characterized in that: The loss function uses the total loss function that combines the physical constraint loss term and the data fitting term. : in, is the predicted temperature value, is the actual temperature value, is the physical constraint residual, , is the weight, N is the sample size.
10. TFT-based lithium battery surface temperature prediction system, characterized by: The system includes: A data processing module, used for acquiring battery operation data, preprocessing the battery operation data, and obtaining preprocessed battery operation data; A data partitioning module, used for partitioning the pre-processed battery operation data into observation input, known input, and static input; The model training module is used to train the TFT model with observed input, known input, and static input as input and the battery surface temperature as output. When the loss function is minimized, the trained TFT model is obtained. The prediction module is 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.
Citation Information
Patent Citations
Lithium battery discharge capacity estimation method without temperature sensor
CN118393361A
Battery temperature estimation method based on thermal-neural network coupling model
CN114325404A
Battery thermal process space-time modeling prediction method, system, equipment and medium
CN115221798A
Battery temperature prediction method and system
CN116391131A
Battery cell temperature prediction method and device, storage medium and electronic equipment
CN116500449A
Cited By
Method and system for checking electrical fault high-risk points of underground pipe gallery
CN120317864A
A method and system for troubleshooting high-risk points of electrical faults in underground pipe corridors
CN120317864B
Forklift battery SOC prediction method and device based on neural network
CN120971980A
Lithium battery charge state estimation method and system based on TLM model
CN121656850A
Battery thermal state detection method and related device
CN122193947A