A lithium battery temperature prediction method based on wavelet packet transform and neural network

By preprocessing and modeling lithium battery temperature data using a hybrid model of wavelet packet transform and Transformer-LSTM, the problems of long-term and short-term dependence and noise interference in lithium battery temperature prediction are solved, achieving high-precision temperature prediction that is suitable for lithium battery thermal management in electric vehicles and energy storage power stations.

CN122173801APending Publication Date: 2026-06-09NANTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANTONG UNIV
Filing Date
2026-02-03
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing lithium battery temperature prediction technologies struggle to simultaneously and accurately capture both long-term and short-term dependencies in lithium battery temperature sequences and effectively suppress noise interference, resulting in insufficient prediction accuracy and impacting battery safety, stability, and lifespan.

Method used

Wavelet packet transform is used to preprocess lithium battery temperature data to remove noise and retain key features. Then, a Transformer-LSTM hybrid model is constructed, which combines the Adam optimizer and regularization strategy to achieve high-precision prediction of temperature sequences.

Benefits of technology

By combining wavelet packet transform and Transformer-LSTM, noise can be effectively removed, and the long-term and short-term characteristics of lithium battery temperature can be fully captured, improving prediction accuracy and stability. This method is suitable for lithium battery thermal management systems in scenarios such as electric vehicles and energy storage power stations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122173801A_ABST
    Figure CN122173801A_ABST
Patent Text Reader

Abstract

This invention provides a lithium battery temperature prediction method based on wavelet packet transform and neural networks, belonging to the field of lithium battery temperature prediction technology. It solves the technical problems of high noise interference in lithium battery surface temperature sequences and the difficulty of single models in simultaneously handling long-term and short-term dependencies. The technical solution includes the following steps: Step 1) Preprocessing the raw lithium battery temperature data using wavelet packet transform to remove noise and redundant information; Step 2) Constructing a Transformer-LSTM hybrid model, integrating the long-term dependency capture capability of Transformer with the short-term fluctuation modeling advantage of LSTM; Step 3) Improving the model's generalization ability through hyperparameter optimization and regularization strategies. This invention fully leverages the synergistic effect of data preprocessing and the hybrid model, enhancing noise resistance and achieving high-precision prediction of lithium battery surface temperature, providing reliable support for the optimization of battery thermal management systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of lithium battery temperature prediction technology, and specifically to a lithium battery temperature prediction method based on wavelet packet transform and neural network. Background Technology

[0002] Lithium-ion batteries, with their unique advantages such as high energy density, high cycle rate, long cycle life, and fast response speed, have become a core energy storage component in the new energy field. The paper "State of charge estimation of lithium-ion batteries based on PSO-TCN-Attention neural network" mentions that lithium-ion batteries are now widely used in mobile devices, electric vehicles, renewable energy storage systems, and other fields. The papers "Industry needs for practical lithium-metal battery designs in electric vehicles" and "A forecast on future raw material demand and recycling potential of lithium-ion batteries in electric vehicles" point out that electric vehicles and energy storage power stations, as core application scenarios for lithium-ion batteries, place extremely high demands on battery safety and stability. However, lithium-ion batteries generate a large amount of heat during fast charging, and their optimal operating temperature range is strictly controlled between 15℃ and 35℃. Once the temperature exceeds this "comfort zone," the battery will experience rapid aging, and the risk of fire, explosion, and other safety hazards will significantly increase, seriously affecting the safety and economy of the battery system. Therefore, this invention can provide a reliable method for predicting battery temperature, controlling the battery's operating temperature within a reasonable range, thereby improving battery performance and extending its service life.

[0003] Accurately predicting the dynamic changes in the surface temperature of lithium batteries, especially the short-term fluctuations and long-term trends during charging and discharging, is a key prerequisite for optimizing battery thermal management systems and ensuring the safe and efficient operation of batteries. Currently, common techniques for lithium battery temperature prediction include shallow neural networks (such as backpropagation neural networks and support vector machines) and single deep learning models (such as LSTM and Transformer). The paper "A method for state-of-charge estimation of lithium-ion batteries based on PSO-LST" proposes that, compared to shallow neural networks, deep learning, by constructing multi-layer nonlinear transformation networks, is better at extracting complex feature information from input data. Furthermore, the papers "Non-linear Time Series Prediction using Improved CEEMDAN, SVD and LSTM" and "Breast cancer classification based on hybrid CNN with LSTM model" point out that LSTM, as an improved version of recurrent neural networks, effectively solves the gradient vanishing and gradient exploding problems of traditional RNNs when processing long sequences by introducing a gating mechanism. It can capture long-term dependencies in time series and has broad application prospects in the field of sequence prediction. Khan et al., in their paper "Leveraging LSTMSMI and ARIMA architecture for robust wind power plant forecasting," combined LSTM with Seasonal Mean Interpolation (SMI) for wind power forecasting, achieving high accuracy. However, LSTM's ability to extract global long-term features remains insufficient, making it difficult to comprehensively capture dependencies across long time scales when processing complex time-series data such as lithium battery temperature sequences. Therefore, this invention combines the long-term dependency capture capabilities of LSTM and Transformer to address the problem of inaccurate long-term forecasts.

[0004] The Transformer model was initially applied in the field of natural language processing. Its core advantage lies in its self-attention mechanism, enabling parallel processing of long sequence data without being limited by sequence length, and efficiently capturing long-term dependent features. In recent years, papers such as "GiT: Graph Interactive Transformer for Vehicle Re-Identification" and "Anattention-based multiscale transformer network for remote sensing imagechange detection" indicate that the Transformer has gradually expanded into multiple fields such as computer vision and reinforcement learning, and its application in time series prediction tasks is also increasing. K. Han et al. pointed out in their paper "A Survey on VisionTransformer" that compared with traditional RNNs, the Transformer exhibits higher parallel computing power and efficiency when processing long sequence data, and can uncover complex patterns and trends hidden in the data. However, this model has low sensitivity to modeling short-term local fluctuations, making it difficult to accurately capture instantaneous temperature changes during the charging and discharging process in lithium battery temperature prediction. Therefore, the LSTM in this invention can compensate for the problem of sensitivity to short-term fluctuations. The Transformer-LSTM hybrid model can combine the strengths of both models to achieve accurate estimation of battery temperature.

[0005] Furthermore, lithium battery temperature data exhibits significant nonlinear and non-stationary characteristics, and contains a large amount of high-frequency noise caused by internal chemical reactions, contact resistance fluctuations, and other factors. Traditional filtering methods (such as Gaussian filtering mentioned by D. Wen et al. in their paper "Gaussian filtering method of evaluating the elastic / elasto-plastic properties of sintered nanocomposites with quasi-continuous volume distribution") struggle to effectively separate signal features at different scales, and noise interference directly affects the model's prediction accuracy. Wavelet packet transform (WPT), as an extended optimization technique of wavelet transform, overcomes the limitation of traditional wavelet transform, which only decomposes low-frequency subbands. It can simultaneously perform multi-resolution decomposition of both low-frequency and high-frequency components of the signal, providing an effective solution for denoising nonlinear and non-stationary signals. A successful example is the paper by Zhang et al., "An Adaptive Domain Adaptation Method for Rolling Bearings' Fault Diagnosis Using Deep Conversion and Self-Attention Networks," which combines wavelet packet transform with attention-enhanced ResNet for wind turbine gearbox fault diagnosis. By highlighting the fundamental frequency band of wavelet coefficients, they effectively extracted weak features of the vibration signal. This invention fully integrates the advantages of data preprocessing techniques and hybrid deep learning models, solving the problem of balancing noise interference and long-term / short-term dependencies, and achieving high-precision prediction of lithium battery surface temperature. Summary of the Invention

[0006] The purpose of this invention is to provide a lithium battery temperature prediction method based on wavelet packet transform and neural networks. First, core feature parameters strongly correlated with lithium battery surface temperature are selected. Wavelet packet transform is used to suppress noise and improve the quality of the original data. A hybrid deep learning model integrating the advantages of Transformer and LSTM is constructed. Hyperparameter optimization and regularization strategies are combined to solve the technical challenges of single models failing to simultaneously address the long-term and short-term dependencies of temperature sequences and the impact of noise interference on prediction accuracy. This invention focuses on lithium battery thermal management scenarios and, addressing the nonlinear, non-stationary, and significantly noise-interfered characteristics of temperature data, establishes a complete prediction system of "data preprocessing - hybrid model modeling - performance optimization." This provides a new technical solution for high-precision and robust prediction of lithium battery surface temperature. Through the synergistic effect of the multi-resolution decomposition capability of wavelet packet transform and the feature capture advantages of Transformer-LSTM, dynamic and accurate prediction of lithium battery surface temperature under different operating conditions is achieved.

[0007] The core idea of ​​this invention is to disclose a method for predicting the surface temperature of lithium batteries by integrating data preprocessing and hybrid deep learning. Lithium battery temperature sequences contain a large amount of high-frequency noise and exhibit both short-term local fluctuations and long-term trends. A single model struggles to fully capture these complex features, resulting in limited prediction accuracy. This invention focuses on the core challenges of lithium battery temperature prediction. First, wavelet packet transform is used to perform multi-resolution decomposition and threshold denoising on the original data, effectively removing noise redundancy while retaining key features. Then, the gating mechanism of LSTM is used to perform fine-grained modeling of short-term local fluctuations, and the self-attention mechanism of Transformer is used to efficiently capture long-term dependencies, constructing a hybrid model that captures both local details and global trends. Finally, the Adam optimizer, piecewise learning rate adjustment, and dual regularization strategy are used to improve the model's generalization ability and convergence speed. Simulation and experimental results show that the proposed method can effectively suppress noise interference, comprehensively mine the spatiotemporal features of the temperature sequence, and significantly outperform single models in prediction accuracy and stability. It is suitable for lithium battery temperature monitoring needs in various scenarios such as electric vehicles and energy storage power stations.

[0008] To achieve the above-mentioned objectives, the present invention employs the following technical solution: a lithium battery temperature prediction method based on wavelet packet transform and neural networks, comprising the following steps:

[0009] Step 1) Preprocess the raw temperature data of the lithium battery using wavelet packet transform to remove noise and redundant information;

[0010] Step 1-1) From the full life cycle charge and discharge data of lithium batteries, screen out the core features that are strongly correlated with temperature changes, including ampere-hours (Ah), watt-hours (Wh), voltage (V), time, and historical surface temperature;

[0011] Steps 1-2) Select the Daubechies (db4) wavelet basis function to perform 4-level wavelet packet decomposition on the original temperature data and core feature data, and project the original signal onto different frequency spaces;

[0012] Steps 1-3) employ the Rigrsure adaptive thresholding strategy to perform soft thresholding denoising on the decomposed frequency band coefficients, preserving the main features of the signal while suppressing high-frequency noise;

[0013] Steps 1-4) Perform inverse transformation on the denoised coefficients to reconstruct them into time series data. Use the standardization formula to eliminate the influence of different features on the dimensionality and obtain the standardized input data.

[0014] Step 2) Construct a Transformer-LSTM hybrid model to achieve temperature sequence prediction;

[0015] Step 2-1) Construct a multi-layer LSTM network. Through the synergistic effect of the forget gate, input gate, and output gate, perform fine-grained modeling of short-term local fluctuations in the temperature sequence and output a hidden state sequence containing short-term dependent features.

[0016] Step 2-2) Construct a Transformer encoder based on a multi-head self-attention mechanism. Take the hidden state sequence output by LSTM as input, capture long-term dependent features of different subspaces through multiple sets of parallel attention heads, and perform deep feature transformation through a feedforward neural network.

[0017] Steps 2-3) The output of the Transformer encoder is transformed into a dimension through a fully connected layer to output the predicted value of the lithium battery surface temperature.

[0018] Step 3) Optimize model performance and improve generalization ability;

[0019] Step 3-1) Use the Adam optimizer in combination with a piecewise decay learning rate strategy to achieve efficient iterative updates of model parameters;

[0020] Step 3-2) Use the mean squared error (MSE) as the loss function to quantify the deviation between the predicted value and the actual temperature value, and guide the optimization of model parameters;

[0021] Step 3-3) The Dropout mechanism is used to break the co-adaptation relationship between neurons, and L2 regularization is used to limit the weight magnitude, thus doubly inhibiting model overfitting;

[0022] Steps 3-4) For key hyperparameters such as the number of attention heads, the dimension of the LSTM hidden layer, and the number of iterations, perform a grid search based on the validation set loss to select the optimal parameter combination;

[0023] Steps 3-5) Input the test set data into the optimal model to obtain the temperature prediction results, calculate various evaluation indicators, and compare and analyze them with the actual temperature values ​​and other models.

[0024] This invention provides a further optimization scheme for a lithium battery temperature prediction method based on wavelet packet transform and neural network: Step 1) includes the following steps:

[0025] (1-1) From the full life cycle charge and discharge data of lithium batteries, the core features that are strongly correlated with temperature changes were screened out using Pearson heat map.

[0026] (1-2) Based on the extracted key feature data, the high-frequency components of the signal are further decomposed to achieve a more refined frequency band division. For discrete signals, the expression is as follows:

[0027]

[0028] in, It is the original temperature signal. These are the original decomposition coefficients. Denotes the wavelet packet basis functions. This indicates the number of decomposition layers; in this invention, the number of decomposition layers is 4. Indicates the translation factor. This represents the index of the discrete sampling point.

[0029] (1-3) The Rigrsure adaptive thresholding strategy is used to perform soft thresholding denoising on the decomposed frequency band coefficients, as follows:

[0030]

[0031] in, The threshold is used (the present invention uses the Birge-Massart adaptive threshold). This represents the coefficients after denoising. For symbolic functions, It is an absolute value function.

[0032] (1-4) The denoised coefficients are reconstructed by inverse transformation to restore the time series data; the standardization formula is used to eliminate the influence of different features on the units of measurement, and the standardized input data is obtained. The formula is as follows:

[0033]

[0034] in, This represents the signal after wavelet packet denoising. and These are the mean and standard deviation of the training set data, respectively. This represents the standardized signal.

[0035] A further optimization scheme for the lithium battery temperature prediction method based on wavelet packet transform and neural network is as follows: Step 2) includes the following steps:

[0036] (2-1) Construct a multi-layer LSTM network. Through the synergistic effect of the forget gate, input gate, and output gate, perform fine-grained modeling of short-term local fluctuations in the temperature sequence, and output a hidden state sequence containing short-term dependent features. The forget gate... The formula is as follows:

[0037]

[0038] in, Indicates the current moment. This represents the forget gate state of the LSTM. It is the sigmoid activation function. and These are the weight matrix and bias vector of the forget gate, respectively. for The hidden state at all times for The input vector at time step 1.

[0039] The input gate is a key component for updating cell state information. It filters and injects new information through a dual computation mechanism, involving two parts of computation:

[0040]

[0041]

[0042] in, The input gate activation value, Candidate cell state, and These are the weight matrix for the input gate and the weight matrix for cell state updates, respectively. and These are the bias terms for the input gate and the bias terms for cell state updates, respectively. This is the hyperbolic tangent function. Cell state updates are jointly regulated by the forgetting gate and the input gate, and their formula is as follows:

[0043]

[0044] in, Represents element-wise multiplication. Represented as Cellular state at any given moment Represented as The state of a cell at any given moment.

[0045] The output gate controls the output information of the cell state, and its formula is as follows:

[0046]

[0047]

[0048] in, This is the weight matrix of the output gate. This is the bias term for the output gate. Output gate Determines cell state How much information will be output for calculations at the current time step, and what is the hidden state? The output of the LSTM at the current moment includes five standardized core feature values ​​of the lithium battery at that moment: Ah, Wh, voltage, time, and historical surface temperature.

[0049] It also contains long-term information stored in the cell state. It includes five standardized core feature values ​​of the lithium battery at that moment: Ah, Wh, voltage, time, and historical surface temperature.

[0050] (2-2) Construct a Transformer encoder based on a multi-head self-attention mechanism, whose input is the hidden state sequence output by the LSTM module. Its dimensions are ,in The time step length, For the feature dimension, its mathematical expression is:

[0051]

[0052] Among them, the upper right corner This represents the transpose of a vector.

[0053] The first encoder, namely the multi-head self-attention sub-layer, is constructed. This sub-layer uses four parallel attention heads to synchronously capture long-term dependencies between different time steps. The specific process is as follows:

[0054] For the input sequence Perform learnable linear transformations to generate queries ( ),key( ),value( ) matrix, ensuring that the dimensions are consistent The formula is as follows:

[0055]

[0056]

[0057]

[0058] in, Both are 5 A learnable weight matrix of 5 is used to map input features to query, key, and value feature spaces, respectively. That is, dimension 256 The matrix of 5 represents the query, key, and value feature sets for each time step.

[0059] Will By attention head Divided into 4 independent submatrices, each submatrix having dimension 1. Parallel feature extraction is achieved, as shown in the following formula:

[0060]

[0061]

[0062]

[0063] in, The first The query, key, and value submatrix of each attention head ( (The dimensions are all 256) 2, For the index of attention heads.

[0064] Each attention head calculates the correlation weights between time steps using a "scaled dot product" and then weights the fused features, as shown in the following formula:

[0065]

[0066] in, Let represent the attention score matrix, and let represent the th . The degree of correlation between the features of a time step and all time steps. Represented as a normalization function, it converts attention scores into weight values ​​between 0 and 1, ensuring the sum of the weights is 1, while maintaining a dimension of 256. 256. Indicates the first The output matrix of each attention head has a dimension of 256. 2. Includes long-term dependency features within this subspace. For attention functions.

[0067] The outputs of the four attention heads are concatenated along the feature dimension to restore the original data. Dimensionality is then integrated through linear transformation of multi-subspace features, using a multi-head attention function. The calculation formula is as follows:

[0068]

[0069] in, The vector concatenation operation concatenates four 256×2 submatrices into a 256×5 matrix, achieving multi-subspace feature fusion. Indicates the first The output matrix of each attention head, It is represented as a 5×5 learnable linear transformation matrix, used to integrate the concatenated features, with an output dimension of 256×5.

[0070] To mitigate gradient vanishing in deep networks, residual connections are introduced, and the feature distribution is normalized through layer normalization to accelerate training convergence, as shown in the following formula:

[0071]

[0072] in, The representation layer normalization operation standardizes each column of the feature matrix (mean is 0, variance is 1). This represents the final output of the self-attention sublayer, with a dimension of 256×5.

[0073] A feedforward neural network (FFN) sublayer is constructed, which implements deep nonlinear transformation through a 128-dimensional hidden layer to enhance key temperature features. The specific formula is as follows:

[0074]

[0075] in, This represents the computation function of the feedforward neural network. This represents the final output of the feedforward neural network. This is the layer normalization function. express The input vector, This represents the weight matrix from the input layer to the hidden layer. It is represented as the hidden layer bias vector. Represented as the ReLU activation function, it introduces a nonlinear feature transformation to suppress invalid gradient propagation. Represented as the weight matrix from the hidden layer to the output layer. It is represented as the output layer bias vector.

[0076] The second-layer encoder repeats the "multi-head self-attention sublayer + FFN sublayer" process of the first-layer encoder, with the output of the first layer as its input. The output is a global long-term dependency feature sequence extracted through two layers of in-depth processing. The dimensions remain 256×5.

[0077] (2-3) After stacking 2 encoders, the output This sequence fully integrates the long-term dependence and global features of the lithium battery temperature sequence, and is directly input into the subsequent fully connected layer to be converted into a predicted value of the lithium battery surface temperature.

[0078] A further optimization scheme for the lithium battery temperature prediction method based on wavelet packet transform and neural network is as follows: Step 3) includes the following steps:

[0079] (3-1) The Adam optimizer is used to adaptively adjust the learning rate, optimize the model parameters, and thus achieve fast convergence and complex parameter optimization of the hybrid model. The core formula is as follows:

[0080] First-order moment estimation (gradient direction smoothing):

[0081]

[0082] Second-order moment estimation (gradient magnitude tracking):

[0083]

[0084] Deviation correction:

[0085]

[0086] Parameter update:

[0087]

[0088] in, and These are the current first and second moments, respectively. and These are the first and second moments from the previous moment, respectively. and These are the corrections for the first and second moments, respectively. For smoothing coefficients, This is the current gradient value. The initial learning rate, To prevent tiny values ​​with a denominator of 0, and These are the updated model parameters and the current model parameters, respectively.

[0089] (3-2) Using the mean squared error (MSE) as the loss function, the deviation between the predicted value and the actual temperature value is quantified, guiding the model to minimize the prediction error. The formula is as follows:

[0090]

[0091] in, To predict temperature for the model, This is the actual temperature. The total amount of sample data, For sample index.

[0092] (3-3) The Dropout mechanism is used to break the co-adaptation relationship between neurons. During training, 20% of neuron connections are randomly dropped, which is achieved through probability control. At the same time, L2 regularization is used to limit the weight magnitude. The two work together to suppress model overfitting. The learning rate is halved every 80 epochs, as shown in the following formula:

[0093]

[0094] in, For regularized output, is the regularization coefficient.

[0095] (3-4) Monitor the validation set loss in real time during training. When the validation set loss does not decrease for 20 consecutive epochs, stop training and save the optimal model.

[0096] (3-5) Input the test set data into the optimal model to obtain the temperature prediction results, calculate various evaluation indicators, and compare and analyze them with the actual temperature values ​​and other models. The formulas are as follows:

[0097]

[0098] Where MAE is the mean absolute error. This is a measure of the fit of a linear regression model. This indicates the average temperature.

[0099] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0100] (1) This invention establishes a method for predicting the surface temperature of lithium batteries by combining wavelet packet transform preprocessing with Transformer-LSTM hybrid modeling. Wavelet packet transform can perform fine multi-resolution decomposition of nonlinear and non-stationary temperature signals. Combined with the soft threshold denoising strategy of Rigrsure adaptive threshold, compared with traditional moving average, Gaussian filtering and other methods, it can more accurately separate the low-frequency trend component and high-frequency noise component in the temperature signal. While effectively removing redundant information such as sensor jitter and electromagnetic interference, it can completely retain the key dynamic features of temperature change, significantly improve the signal-to-noise ratio and reliability of the input data, and provide high-quality data support for subsequent modeling.

[0101] (2) This invention integrates the advantages of Transformer and LSTM to construct a hybrid prediction model that combines long-term dependency capture and short-term fluctuation modeling capabilities. This invention fully utilizes the parallel computing advantages of Transformer's self-attention mechanism, using multi-head attention to mine the global long-term dependencies of temperature sequences in parallel, breaking through the length limitations of traditional sequence models. Simultaneously, it combines the fine-grained modeling capabilities of LSTM gating mechanism for short-term local fluctuations, accurately capturing instantaneous temperature change characteristics during charging and discharging, thus solving the technical bottlenecks of insufficient long-term dependency capture by a single LSTM and low short-term detail sensitivity by a single Transformer. Furthermore, through the collaborative strategy of Adam adaptive optimizer, piecewise learning rate decay, and Dropout+L2 dual regularization, it effectively suppresses model overfitting and improves the model's generalization ability and prediction stability under different temperature environments and charging / discharging conditions. In summary, this invention cleverly integrates data preprocessing technology, a hybrid deep learning model, and multi-dimensional optimization strategies, achieving not only high-precision prediction of lithium battery surface temperature but also considering model training efficiency and engineering applicability, making it fully suitable for the temperature prediction needs of lithium battery thermal management systems in scenarios such as electric vehicles and energy storage power stations. Attached Figure Description

[0102] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.

[0103] Figure 1 This is a basic structural diagram of the Transformer and LSTM fusion model in this invention.

[0104] Figure 2 This is a Pearson correlation coefficient heatmap of the lithium-ion battery characteristics in this invention.

[0105] Figure 3 This is a basic flowchart of the model based on the fusion of Transformer and LSTM with wavelet packet transform preprocessing in this invention.

[0106] Figure 4 This is a comparison of the battery surface temperature prediction results on the test set of the Transformer and LSTM fusion model based on wavelet packet transform preprocessing at 0℃ in Embodiment 1 of this invention.

[0107] Figure 5 This is the relative error distribution curve of the Transformer and LSTM fusion model based on wavelet packet transform preprocessing at 0℃ on the test set in Embodiment 1 of this invention.

[0108] Figure 6This is a comparison chart of the battery surface temperature prediction results on the test set of the Transformer and LSTM fusion model based on wavelet packet transform preprocessing at -20℃ in Embodiment 2 of the present invention.

[0109] Figure 7 This is a graph showing the relative error distribution of the Transformer and LSTM fusion model based on wavelet packet transform preprocessing at -20℃ on the test set in Embodiment 2 of this invention. Detailed Implementation

[0110] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. Of course, the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0111] See Figures 1 to 3 The technical solution of this embodiment is a lithium battery temperature prediction method based on wavelet packet transform and neural network. This method is applied to the temperature prediction task in the lithium battery thermal management scenario, targeting the prediction of multi-feature lithium battery temperature sequences. The basic structure of the fusion model is described below. Figure 1 The experimental parameters were measured as follows: A Panasonic 18650PF lithium battery was used for charge-discharge experiments in a laboratory environment. The battery's nominal voltage was 3.6V and its typical capacity was 2900mAh. A high-precision temperature sensor (accuracy ±0.1℃) was used to collect battery surface temperature data, and a voltage / current acquisition module was used to synchronously record characteristic data such as Ah, Wh, and voltage during the charge-discharge process. The publicly available charge-discharge dataset from the University of Wisconsin-Madison (containing multiple ambient temperature conditions such as 0℃ and -20℃) was used as the experimental data source. The model was constructed and trained using programming languages ​​and deep learning frameworks.

[0112] Example 1: Considering all model parameters, Example 1 estimates the surface temperature of a lithium battery at an ambient temperature of 0°C. For prediction errors, mean squared error (MSE), mean absolute error (MAE), and coefficient of determination (COP) are used. The formula for measuring prediction accuracy is as follows:

[0113]

[0114] MATLAB software was used for the prediction process. The input data consisted of charge-discharge experimental data from a Panasonic 18650pF lithium battery (at 0℃). Noise was introduced during data acquisition via high-frequency interference. Experimental results showed that the model's MSE was 0.0024084℃ and MAE was 0.024782℃ at 0℃. The value is 0.93275. The degree of fit between the predicted and actual values ​​and the error distribution are as follows: Figure 4 and Figure 5 As shown.

[0115] Example 2: In Example 2, for the task of predicting the surface temperature of lithium batteries in a low temperature environment of -20℃, the same Transformer and LSTM fusion model parameters and training strategies as in Example 1 are used, and the input data is changed to lithium battery charging and discharging experimental data in a low temperature environment of -20℃.

[0116] In the experiment, the low-temperature environment led to increased fluctuations in battery internal resistance and enhanced data noise interference, but the method of this invention still maintained stable prediction performance: the model MSE was 0.0037852℃ and the MAE was 0.036743℃. The value is 0.98227, and the predicted value can accurately capture the slow upward trend of battery temperature at low temperatures. Its comparison with the actual value and the error fluctuation are also as follows... Figure 6 and Figure 7 As shown.

[0117] The lithium battery temperature prediction method based on wavelet packet transform and neural network in Examples 1 and 2 includes the following steps:

[0118] (1) Construct a preprocessing model for lithium battery temperature data based on wavelet packet transform. The specific steps are as follows:

[0119] Step 1: Analyze the nonlinear and non-stationary characteristics of lithium battery temperature data to obtain a comparative heatmap of key lithium battery features, such as... Figure 2 As shown, a multi-feature dataset is constructed, containing five features: ampere-hours (Ah), watt-hours (Wh), voltage (V), time, and historical surface temperature data.

[0120] Step 2: Based on this dataset, construct the temperature data preprocessing expression based on wavelet packet transform as follows:

[0121] (1)

[0122] in, It is the original temperature signal. These are the original decomposition coefficients. Denotes the wavelet packet basis functions. This indicates the number of decomposition layers; in this invention, the number of decomposition layers is 4. Indicates the translation factor. This represents the index of the discrete sampling point.

[0123] To obtain the denoised temperature signal Soft thresholding is applied to the decomposition coefficients:

[0124] (2)

[0125] in, The threshold is used (the present invention uses the Birge-Massart adaptive threshold). This represents the coefficients after denoising. For symbolic functions, It is an absolute value function.

[0126] The reconstructed data has been standardized.

[0127] (3)

[0128] in, This represents the signal after wavelet packet denoising. and These are the mean and standard deviation of the training set data, respectively. This represents the standardized temperature value.

[0129] Step 3: To improve data quality, the signal-to-noise ratio (SNR) loss function after denoising is defined as follows:

[0130] (4)

[0131] The loss function is constrained to ensure that SNR ≥ 110dB, where For signal length, The original signal, The signal after denoising. It is a logarithmic function.

[0132] (2) Construct a lithium battery surface temperature prediction model based on Transformer-LSTM. The specific steps are as follows:

[0133] Step 1: Construct an LSTM module to capture short-term local fluctuations. Its cell state update expression is:

[0134] (5)

[0135]

[0136]

[0137] in, This indicates the forget gate state of the LSTM. It is the sigmoid activation function. and These are the weight matrix and bias vector of the forget gate, respectively. for The hidden state at all times for The input vector at time t, The input gate activation value, Candidate cell state, and These are the weight matrix for the input gate and the weight matrix for cell state updates, respectively. and These are the bias terms for the input gate and the bias terms for cell state updates, respectively. It is the hyperbolic tangent function.

[0138] Step 2: Construct a Transformer encoder to capture long-term dependencies. The multi-head self-attention expression is as follows:

[0139]

[0140] in, For multi-head attention functions, The vector concatenation operation concatenates four 256×2 submatrices into a 256×5 matrix, achieving multi-subspace feature fusion. Indicates the first The output matrix of each attention head, It is represented as a 5×5 learnable linear transformation matrix, used to integrate the concatenated features, with an output dimension of 256×5; Both are 5 A learnable weight matrix of 5 is used to map input features to query, key, and value feature spaces, respectively. That is, dimension 256 The matrix of 5 represents the query, key, and value feature sets for each time step.

[0141] Step 3: Fuse the outputs of LSTM and Transformer, and obtain the temperature prediction value through a fully connected layer. .

[0142] Step 4: Define the mean squared error (MSE) loss function:

[0143] (12)

[0144] in, To predict temperature for the model, This is the actual temperature. The total amount of sample data, For sample index.

[0145] Step 5: Update parameters using the Adam optimizer:

[0146]

[0147] in, For the current moment, and These are the corrections for the first and second moments, respectively. The initial learning rate, To prevent tiny values ​​with a denominator of 0, and These are the updated model parameters and the current model parameters, respectively.

[0148] Step 6: Introduce Dropout (dropout probability 20%) and L2 regularization (coefficient 0.001) to suppress overfitting, and output the optimal model after 200 iterations.

[0149] (3) Based on the process of a lithium battery temperature prediction method based on wavelet packet transform and neural network, an optimization method for lithium battery temperature prediction based on wavelet packet transform and neural network is constructed as follows:

[0150]

[0151]

[0152]

[0153] See Figure 3 The specific steps of the above method are as follows:

[0154] (1) Construct a multi-feature dataset, initialize the ampere-hour (Ah), watt-hour (Wh), voltage (V), time and historical surface temperature data during the charging and discharging process of lithium battery, and perform wavelet packet decomposition on the original temperature signal using Equation (1);

[0155] (2) The decomposition coefficients are subjected to soft threshold denoising using equation (2) to obtain the denoised coefficients. After denoising, the coefficients are reconstructed, and then data standardization is completed through equation (3).

[0156] (3) Calculate the signal-to-noise ratio (SNR) after denoising using equation (4), and constrain SNR ≥ 110 dB;

[0157] (4) Construct an LSTM module, calculate the forget gate, input gate and candidate cell state through equations (5)-(7), and update the cell state through equation (14);

[0158] (5) Calculate the output gate and hidden state of LSTM using equations (15)-(16), and define the input sequence matrix using equation (17);

[0159] (6) Construct a Transformer encoder and generate queries using equations (9)-(11). ),key( ),value( ) matrix, By attention head Divide into submatrices The single-head attention is calculated using equation (21); the attention heads are concatenated and output using equation (8);

[0160] (7) The residual connection and layer normalization of the Transformer encoder are completed by equation (22);

[0161] (8) Calculate the output of the feedforward neural network (FFN) using equation (23);

[0162] (9) The residual connection and layer normalization of FFN are completed by equation (24);

[0163] (10) Input the FFN output into the fully connected layer to obtain the temperature prediction value. The mean squared error (MSE) loss function is calculated using equation (12), where, To predict temperature, The actual temperature is given; L2 regularization is introduced through equation (29) to obtain the total loss;

[0164] (11) The Adam optimizer is used to update the parameters. The first and second moment estimates are calculated by equations (25)-(26). The bias correction is completed by equations (27)-(28). The model parameters are updated by equation (13).

[0165] (12) Enable Dropout (dropout probability 20%), iterate training 200 times, and halve the learning rate every 80 epochs; evaluate model performance using equations (30)-(31); where, The actual average temperature is used; when the loss on the validation set does not decrease for 20 consecutive epochs, training is stopped and the optimal model is output.

[0166] The definitions of each variable are as follows:

[0167] definition The original temperature signal. These are the original decomposition coefficients. For wavelet packet basis functions, The number of decomposition layers is 4 in this invention. The translation factor is... For discrete sampling point indexes; defined The threshold is used (the present invention uses the Birge-Massart adaptive threshold). This represents the coefficients after denoising. For symbolic functions, It is an absolute value function; defined The signal after wavelet packet denoising. and These are the mean and standard deviation of the training set data, respectively. This represents the standardized temperature value; SNR is defined as the signal-to-noise ratio after denoising. For signal length, The signal after denoising. It is a logarithmic function.

[0168] definition For the current moment, This represents the forget gate state of the LSTM. It is the sigmoid activation function. and These are the weight matrix and bias vector of the forget gate, respectively. for The hidden state at all times for Input vector at time step; definition The input gate activation value, Candidate cell state, and These are the weight matrix for the input gate and the weight matrix for cell state updates, respectively. and These are the bias terms for the input gate and the bias terms for cell state updates, respectively. Let be the hyperbolic tangent function; defined This represents element-wise multiplication. For Cellular state at any given moment for Cell state at any given moment; definition This is the weight matrix of the output gate. The output gate's bias term, the output gate Determines cell state How much information will be output for calculations at the current time step, and what is the hidden state? The output of the LSTM at the current moment includes five standardized core feature values ​​of the lithium battery at that moment: Ah, Wh, voltage, time, and historical surface temperature, as well as long-term information stored in the cell state.

[0169] definition The hidden state sequence output by the LSTM. The time step length, For feature dimensions; define the top right corner. Represents the transpose of a vector; defined These are the query, key, and value matrices for the Transformer. Both are 5 A learnable weight matrix of 5 is used to map input features to query, key, and value feature spaces, respectively; Define The first Query, key, and value submatrix of attention heads ; For the number of attention heads, The dimension of the key vector. For the index of the attention head; defined Let be the attention score matrix, representing the first... The degree of correlation between the features of one time step and all time steps. Represented as a normalization function, it converts attention scores into weight values ​​between 0 and 1, ensuring the sum of the weights is 1, while maintaining a dimension of 256. 256; Definition For the first The output matrix of each attention head has a dimension of 256. 2. Includes long-term dependency features within this subspace. Let be the attention function. For multi-head attention functions, This represents a vector concatenation operation, which concatenates four 256×2 submatrices into a 256×5 matrix, achieving feature fusion across multiple subspaces. Indicates the first The output matrix of each attention head, It is represented as a 5×5 learnable linear transformation matrix, used to integrate the concatenated features, with an output dimension of 256×5; The representation layer normalization operation standardizes each column of the feature matrix (mean = 0, variance = 1); [Definition] This represents the final output of the self-attention sublayer, with a dimension of 256×5. For the computation function of the feedforward neural network, This is the final output of the feedforward neural network. For layer normalization function; defined for The input vector, This is the weight matrix from the input layer to the hidden layer. This is the hidden layer bias vector; Represented as the ReLU activation function, it introduces a nonlinear feature transformation to suppress invalid gradient propagation; This is the weight matrix from the hidden layer to the output layer. This is the output layer bias vector;

[0170] definition and These are the current first and second moments, respectively. and These are the first and second moments from the previous moment, respectively. and These are the corrections for the first and second moments, respectively. For smoothing coefficients, This is the current gradient value. The initial learning rate, To prevent tiny values ​​with a denominator of 0, and These are the updated model parameters and the current model parameters, respectively; (Definition) To predict temperature for the model, This is the actual temperature. This is the average actual temperature. Let MSE be the total amount of sample data; define MSE as the mean squared error loss function and MAE as the mean absolute error. This is a measure of the fit of a linear regression model. For regularized output, The regularization coefficient is . For sample index.

[0171] The experimental results of the lithium battery surface temperature prediction method of the present invention are shown in [reference]. Figure 4 , Figure 5 , Figure 6 and Figure 7 Based on the prediction results, the method of this invention has the following advantages in terms of prediction error, fitting accuracy, and adaptability to operating conditions: as the number of iterations increases, the prediction error gradually decreases and tends to stabilize; compared with a single LSTM or a single Transformer model, it has a lower mean squared error (MSE) and a higher coefficient of determination. It simultaneously captures both long-term trends and short-term fluctuations; under different ambient temperatures such as 0℃ and -20℃, the model's predicted values ​​closely match the actual temperature values, demonstrating excellent fitting performance. Furthermore, it exhibits strong adaptability to changes in battery characteristics under low-temperature conditions. Therefore, this prediction method can effectively achieve high-precision prediction of lithium battery surface temperature, and the prediction results accurately reflect the dynamic temperature changes during charging and discharging. It is fully applicable to lithium battery thermal management systems in scenarios such as electric vehicles and energy storage power stations.

[0172] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for predicting lithium battery temperature based on wavelet packet transform and neural network, characterized in that, Includes the following steps: Step 1) Wavelet packet transform is used to perform multi-resolution decomposition and reconstruction of the original temperature data of the lithium battery to complete the data preprocessing; Step 2) Construct a Transformer-LSTM hybrid model to combine the modeling advantages of Transformer and LSTM to achieve time series prediction of lithium battery surface temperature; Step 3) Improve the model’s generalization ability and prediction stability through hyperparameter optimization and regularization strategies.

2. The lithium battery temperature prediction method based on wavelet packet transform and neural network according to claim 1, characterized in that, Step 1) includes the following steps: Step 1-1) Select the Daubechies wavelet basis function and perform 4-level wavelet packet decomposition on the original temperature data and related feature data of the lithium battery; Steps 1-2) The Rigrsure thresholding strategy is used to perform soft thresholding denoising on the decomposed coefficients, as shown in the following formula: ; in, For Birge-Massart adaptive thresholding, These are the denoised coefficients. For symbolic functions, It is an absolute value function. These are the original decomposition coefficients; Steps 1-3) Reconstruct the denoised coefficients to obtain the denoised temperature and feature data; Steps 1-4) Standardization is used to eliminate the influence of dimensions, as shown in the following formula: ; in, For the denoised data, and These are the mean and standard deviation of the training set data, respectively. This is the standardized data.

3. The lithium battery temperature prediction method based on wavelet packet transform and neural network according to claim 1, characterized in that, Step 2) includes the following steps: Step 2-1) Select the core features from the lithium battery's full life cycle charge and discharge data, including ampere-hours (Ah), watt-hours (Wh), voltage (V), time, and historical surface temperature; Step 2-2) Construct a Transformer encoder module to capture the long-term dependency features of the temperature sequence through a multi-head self-attention mechanism. Multi-head self-attention computation... as follows: ; in, , The standardized feature sequence, For learnable weight matrix, This is a vector concatenation operation. To output the linear transformation matrix, For attention, For the number of attention heads; Steps 2-3) Construct an LSTM module to perform fine-grained modeling of short-term local fluctuations in the temperature sequence using a gating mechanism. The cell state update formula is as follows: ; in, Output for the forget gate. For input gate output, Candidate cell state, This represents the current state of the cell. This represents the cell state at the previous moment. This is element-wise multiplication; Steps 2-4) Design a hybrid model structure, using the hidden state sequence output by LSTM as the input of the Transformer encoder, and outputting the temperature prediction result through a fully connected layer after processing by the Transformer.

4. The lithium battery temperature prediction method based on wavelet packet transform and neural network according to claim 1, characterized in that, Step 3) includes the following steps: Step 3-1) Use the Adam optimizer to iteratively update the model parameters, setting the initial learning rate to 0.01, and halving the learning rate every 80 epochs; Step 3-2) Using the mean squared error (MSE) as the loss function, the formula is as follows: ; in, To predict temperature for the model, This is the actual temperature. For the sample size, Indicates the sample index; Step 3-3) Use a strategy combining Dropout and L2 regularization to suppress overfitting; Steps 3-4) Optimize model hyperparameters, including the number of attention heads, the dimension of LSTM hidden layers, and the number of iterations, and select the optimal model based on the validation set loss.

5. A lithium battery temperature prediction system based on wavelet packet transform and neural network, characterized in that, The system comprising the steps of applying the method according to any one of claims 1 to 4, wherein the system includes: The data preprocessing module is configured to perform the following process: using wavelet packet transform to perform multi-resolution decomposition and reconstruction of the raw temperature data of lithium batteries to complete data preprocessing; The Transformer-LSTM hybrid model building module is configured to perform the following process: integrate Transformer and LSTM modeling, build a Transformer-LSTM hybrid model, and realize time series prediction of lithium battery surface temperature; The hyperparameter optimization and regularization module is configured to perform the following process: improve the model's generalization ability and prediction stability through hyperparameter optimization and regularization strategies.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed, it implements the steps of the method as described in any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program is configured to implement the steps of the method according to any one of claims 1 to 4 when invoked by a processor.

8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 4.