Lithium ion battery state-of-charge prediction method and model based on TimesNet
By using TimesNet deep learning model, multi-periodity in the SOC time series of lithium-ion batteries is captured, and the accuracy and robustness of lithium-ion batteries SOC estimation in the prior art is solved, and high-precision SOC estimation at different temperatures and good generalization capabilities are achieved.
Patent Information
- Application Number
- CN202411967763.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-18
AI Technical Summary
The prior art is difficult to accurately and in real time to estimate the state of charge (SOC) of lithium-ion batteries. Due to the complex dynamic composition and changes in environmental conditions inside the battery, SOC cannot be measured directly, and model-based estimation methods rely heavily on the quality of the battery model.
Using a deep learning model based on TimesNet, the TimesNet network architecture is constructed by acquiring and preprocessing the data sets, and the model is trained to capture the multi-periodity in the time series to achieve high-precision estimation of the SOC of Li-ion battery.
High-precision estimation of lithium-ion battery SOC at different temperatures is achieved, with robustness to unknown initial SOC values, able to learn the impact of ambient temperature, and exhibit excellent generalization ability on different data sets.
Smart Images

Figure CN119848461A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of lithium-ion battery state of charge prediction, and in particular to a lithium-ion battery state of charge prediction method and model based on TimesNet. Background Art
[0002] The state of charge (SOC) of a battery is one of the most important states that the battery management system (BMS) of an electric vehicle needs to monitor. Accurate and real-time estimation of SOC is very helpful for developing an effective BMS. However, due to the complex dynamics of lithium-ion batteries and the changing environmental conditions, SOC cannot be measured directly and essentially depends on many factors, such as current, voltage, and temperature. In addition, since lithium-ion batteries are highly time-varying and nonlinear systems, there is a great deal of dynamic instability, which is caused by different battery materials and different operating conditions.
[0003] The performance of existing model-based SOC estimation methods heavily depends on the quality of the battery model, so it is very challenging to accurately obtain SOC. Summary of the invention
[0004] The embodiment of the present application provides a lithium-ion battery state of charge prediction method and model based on TimesNet. Through the high robustness and effective capture of multi-periodicity of the TimesNet model algorithm, SOC estimation at different temperatures is achieved, and it is robust to unknown initial SOC values and can be trained to learn the impact of ambient temperature.
[0005] To solve the above technical problems, in the first aspect, an embodiment of the present application provides a lithium-ion battery state of charge prediction method based on TimesNet, the method comprising the following steps: first, obtaining a data set, and preprocessing the data set, dividing the preprocessed data set into a training set, a validation set, and a test set; then, based on the network architecture of TimesNet, building a deep learning model; next, inputting the training set and the validation set into the deep learning model, training the deep learning model, adjusting the model parameters, and obtaining an optimized deep learning model and optimized model parameters; then, inputting the test set into the optimized deep learning model, and based on the optimized model parameters, performing a performance evaluation on the optimized deep learning model, obtaining a trained deep learning model and updated model parameters; finally, inputting the lithium-ion battery data set to be predicted into the trained deep learning model to predict the state of charge of the lithium-ion battery.
[0006] In some exemplary embodiments, the data set is an electric vehicle driving condition data set including current, voltage and temperature data, and the current, voltage and temperature data are collected by sensors of the electric vehicle lithium-ion battery management system; wherein, the data set is preprocessed, including: extracting characteristic variables related to battery discharge in the driving cycle from the data set, fusing and randomly arranging the characteristic variables to obtain a preprocessed data set; the characteristic variables include power battery current, voltage, capacity and temperature.
[0007] In some exemplary embodiments, a deep learning model is constructed based on the network architecture of TimesNet, including: first, constructing the main network architecture of TimesNet; then, constructing the network front architecture of TimesNet; finally, based on the multi-periodic characteristics of the time series of the network front architecture of TimesNet, the training set and the test set are converted from one-dimensional time series data to two-dimensional tensors, so as to better capture the complex change information in the time series, and the feature variable data is input into the TimesNet network main architecture for training, the model parameters are adjusted to achieve model optimization, and the deep learning model is obtained according to the minimum loss value obtained by inputting the verification set.
[0008] In some exemplary embodiments, the main network architecture of TimesNet is constructed, including: setting an embedding layer; constructing TimesBlock; stacking TimesBlock and adding residual connections; wherein TimesBlock is the core component of TimesNet, and by stacking multiple TimesBlocks together, TimesNet can gradually extract multi-periodic features and complex change patterns in time series data, thereby achieving effective modeling and prediction of time series.
[0009] In some exemplary embodiments, each TimesBlock includes the following steps: performing a fast Fourier transform on the input one-dimensional time series data to identify different periods in the data; converting the time series from the time domain to the frequency domain through the fast Fourier transform to obtain the frequency and amplitude information of each period; reshaping the data according to the determined period to convert the one-dimensional time series into a two-dimensional tensor form; inputting the converted two-dimensional tensor into a parameter-efficient Inception module; in TimesNet, the Inception module is used to learn and predict its feature representation from the two-dimensional time series data to capture the two-dimensional changes in time; after the Inception module processes the two-dimensional data, an adaptive aggregation operation is used to reshape its deep representation back to a one-dimensional vector to match the dimension of the original data.
[0010] In some exemplary embodiments, before inputting the feature variable data into the TimesNet network main framework for training, it also includes: converting the working condition data into tensor variables, and transposing the tensor variables as input of the TimesNet network main framework.
[0011] In some exemplary embodiments, a lithium-ion battery data set to be predicted is input into a trained deep learning model, including: preprocessing the lithium-ion battery data set to be predicted to obtain a preprocessed two-dimensional time series data set; inputting the preprocessed two-dimensional time series data set into the trained deep learning model to predict the state of charge of the lithium-ion battery.
[0012] In some exemplary embodiments, the lithium-ion battery data set to be predicted is a driving condition data set to be predicted; the driving condition data set to be predicted includes: a new European driving cycle condition, a global light vehicle test cycle condition, a dynamic pressure test condition, and an urban dynamometer driving condition.
[0013] In some exemplary embodiments, the new European driving cycle includes an urban condition and a suburban condition; the urban condition is composed of four ECE cycle units, with a maximum speed of 50 km / h, an average speed of 19 km / h, each cycle time of 195 seconds, and a total driving distance of 4.052 km; the suburban condition is an EUDC cycle, with an average speed of 62.6 km / h, an effective driving time of 400 seconds, and a total driving distance of 6.955 km; the global light vehicle test cycle condition is used to assess the comprehensive performance of the vehicle, including the coordinated working effect of the power system, transmission system, and energy recovery system under different speed ranges and load conditions, as well as the overall energy consumption level and endurance of the vehicle, which can reflect the actual performance of the vehicle in actual use; the dynamic pressure test condition is used to assess the comprehensive performance of the battery, including the battery's capacity attenuation, internal resistance change, energy output capacity and thermal management performance, to ensure the reliability and durability of the battery in actual use; the urban dynamometer driving condition is used to assess the energy consumption level, cruising range, responsiveness of the power system, and efficiency of the battery management system of electric vehicles under urban conditions.
[0014] In a second aspect, an embodiment of the present application further provides a lithium-ion battery state of charge prediction model based on TimesNet, which uses the lithium-ion battery state of charge prediction method based on TimesNet described in the above embodiment to predict the battery state of charge, including: a data preprocessing module, a model construction module, a model training module, a model evaluation module and a prediction module connected in sequence; the data preprocessing module is used to obtain a data set, and preprocess the data set, and divide the preprocessed data set into a training set, a verification set and a test set; the model construction module is used to construct a deep learning model according to the network architecture of TimesNet; the model training module is used to input the training set and the verification set into the deep learning model, train the deep learning model, adjust the model parameters, and obtain an optimized deep learning model and optimized model parameters; the model evaluation module is used to input the test set into the optimized deep learning model, and based on the optimized model parameters, perform performance evaluation on the optimized deep learning model to obtain a trained deep learning model and updated model parameters; the prediction module is used to input the lithium-ion battery data set to be predicted into the trained deep learning model to predict the state of charge of the lithium-ion battery.
[0015] The technical solution provided by the embodiments of the present application has at least the following advantages:
[0016] The embodiment of the present application provides a method and model for predicting the state of charge of a lithium-ion battery based on TimesNet, and the method includes the following steps: first, obtaining a data set, and preprocessing the data set, dividing the preprocessed data set into a training set, a validation set, and a test set; then, based on the network architecture of TimesNet, building a deep learning model; next, inputting the training set and the validation set into the deep learning model, training the deep learning model, adjusting the model parameters, and obtaining an optimized deep learning model and optimized model parameters; then, inputting the test set into the optimized deep learning model, and based on the optimized model parameters, performing a performance evaluation on the optimized deep learning model, and obtaining a trained deep learning model and updated model parameters; finally, inputting the lithium-ion battery data set to be predicted into the trained deep learning model to predict the state of charge of the lithium-ion battery.
[0017] This application proposes a method and model for predicting the state of charge of lithium-ion batteries based on TimesNet, and uses the TimesNet model for training and prediction. Compared with other time series prediction models, TimesNet has the following advantages: Traditional time series prediction models such as RNN and its variants mainly focus on changes between adjacent moments and are insufficient in modeling long-term dependencies. However, TimesNet, from a multi-period perspective, can capture the multi-periodicity in time series and decompose complex time changes into changes within and between multiple cycles, so as to better handle long-term dependencies and is suitable for time series data with complex periodic changes; in addition, TimesNet adopts a modular design approach, where a module captures time series changes dominated by a specific cycle. This design can decouple complex time changes and is conducive to subsequent modeling. At the same time, the TimesBlock in the model uses the parameter-efficient Inception module, which can effectively extract features from two-dimensional data without significantly increasing model parameters, thereby improving the generalization ability and computational efficiency of the model. This application uses three different data sets to minimize random errors and verify the accuracy and generalization ability of the model. Experimental results show that this method can achieve high-precision estimation of battery SOC at different temperatures, and exhibits excellent generalization ability and convergence ability in handling initial errors for different data sets. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplifications do not constitute limitations on the embodiments. Unless otherwise stated, the pictures in the drawings do not constitute proportional limitations.
[0019] Figure 1 A flowchart of a method for predicting the state of charge of a lithium-ion battery based on TimesNet is provided in an embodiment of the present application.
[0020] Figure 2 The network architecture diagram of TimesNet provided in the embodiment of the present application.
[0021] Figure 3 A structure diagram of a prediction model based on TimesNet provided in an embodiment of the present application.
[0022] FIG. 4A to FIG. 4B A schematic diagram of the prediction results of SOC by the TimesNet-based lithium-ion battery state of charge prediction model provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] As can be seen from the background technology, as a key factor in extending the life of lithium-ion batteries, accurate SOC estimation is crucial to ensure the safety and efficiency of lithium-ion batteries, but it remains a challenging task due to the complex dynamics of lithium-ion batteries and the ever-changing environmental conditions. In addition, since the model-based SOC estimation method is heavily dependent on the quality of the battery model, once the data is biased, it will lead to a wide range of errors, while the neural network-based method is similar to a black box, which is purely data-driven and less affected by data bias.
[0024] Therefore, in response to the difficulties existing in the prior art, an embodiment of the present application provides a lithium-ion battery state of charge prediction method based on TimesNet, which includes the following steps: first, obtaining a data set, and preprocessing the data set, dividing the preprocessed data set into a training set, a validation set, and a test set; then, based on the network architecture of TimesNet, building a deep learning model; next, inputting the training set and the validation set into the deep learning model, training the deep learning model, adjusting the model parameters, and obtaining an optimized deep learning model and optimized model parameters; then, inputting the test set into the optimized deep learning model, and based on the optimized model parameters, performing a performance evaluation on the optimized deep learning model, obtaining a trained deep learning model and updated model parameters; finally, inputting the lithium-ion battery data set to be predicted into the trained deep learning model to predict the state of charge of the lithium-ion battery. The TimesNet-based lithium-ion battery state of charge prediction method and model provided in the embodiments of the present application achieve SOC estimation at different temperatures through the high robustness and effective capture of multi-periodicity of the TimesNet model algorithm, and are robust to unknown initial SOC values, and can be trained to learn the impact of ambient temperature.
[0025] The following will describe the various embodiments of the present application in detail with reference to the accompanying drawings. However, it will be appreciated by those skilled in the art that in the various embodiments of the present application, many technical details are provided in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solution claimed in the present application can be implemented.
[0026] See also Figure 1 The present application embodiment provides a method for predicting the state of charge of a lithium-ion battery based on TimesNet, the method comprising the following steps:
[0027] Step S101: obtain a data set, preprocess the data set, and divide the preprocessed data set into a training set, a validation set, and a test set.
[0028] Step S102: construct a deep learning model based on the TimesNet network architecture.
[0029] Step S103: input the training set and the validation set into the deep learning model, train the deep learning model, adjust the model parameters, and obtain an optimized deep learning model and optimized model parameters.
[0030] Step S104: input the test set into the optimized deep learning model, and based on the optimized model parameters, perform a performance evaluation on the optimized deep learning model to obtain a trained deep learning model and updated model parameters.
[0031] Step S105: input the lithium-ion battery data set to be predicted into the trained deep learning model to predict the state of charge of the lithium-ion battery.
[0032] In some embodiments, the data set in step S101 is an electric vehicle driving condition data set including current, voltage and temperature data, and the current, voltage and temperature data are collected by sensors of the electric vehicle lithium-ion battery management system. In step S101, the data set is preprocessed, including: extracting characteristic variables related to battery discharge in the driving cycle from the data set, fusing and randomly arranging the characteristic variables to form an input data set; the characteristic variables include power battery current, voltage and temperature.
[0033] Since the chemical reactions inside the battery are very complex, and the external characteristics are highly nonlinear. Therefore, in order to track the dynamic characteristics of the battery and accurately reflect its various working states, this application adopts a network architecture based on TimesNet, which converts one-dimensional time series data into two-dimensional tensors based on the multi-periodic characteristics of time series, so as to better capture the complex change information in the time series. Based on this, this application proposes a lithium-ion battery state of charge prediction method and model based on TimesNet, which can accurately predict the SOC of lithium-ion batteries in electric vehicles, thereby intelligently assisting the BMS to adjust the battery discharge, implement adaptive and precise control decisions for the entire vehicle, reduce damage to the power battery, and improve the working efficiency and service life of the battery.
[0034] Specifically, since the actual driving conditions of electric vehicles are complex and unstable, the actual driving conditions of electric vehicles should be simulated as much as possible. If possible, the training data should be extended to other driving conditions. This application uses the New European Driving Cycle (NEDC) as training data, and the Worldwide Harmonised Light Vehicles Test Cycle (WLTC) and the Dynamic Stress Test (DST) as test data. These operating curves are designed to simulate the discharge mode of lithium-ion batteries. Specifically, the World Light Vehicle Test Cycle (WLTC) takes into account the simulation of actual driving modes, and its test content consists of four parts: low speed, medium speed, high speed and ultra-high speed, while the New European Driving Cycle (NEDC) and the Dynamic Stress Test (DST) focus on the simulation of vehicle endurance and regenerative charging. Compared with the New European Driving Cycle (NEDC), the World Light Vehicle Test Cycle (WLTC) standard is closer to driving conditions under real road conditions. In the above test, the test object undergoes a complete charge and discharge cycle, during which the test curve is used to simulate the actual discharge process. During the entire test process, the sensor signals (including current, voltage and temperature) are recorded every 1 second.
[0035] It should be noted that the training and test data used in this application are based on the discharge data set in the vehicle driving condition, and the discharge is considered complete when the discharge reaches the cut-off voltage. In order to avoid repeated effects on the training effect, the time steps of all data sets are different, and the test set has not been learned by the neural network before testing, so as to maximize the test accuracy of the model.
[0036] This application uses three completely different driving conditions to verify the versatility of the model. Specifically, in step S101, the data set is preprocessed, including: selecting the NEDC condition as the training set, which is mainly divided into two parts: urban conditions and suburban conditions. The urban condition consists of four ECE cycle units, with a maximum speed of 50km / h, an average speed of 19km / h, each cycle time of 195s, and a total driving distance of 4.052km; the suburban condition is an extra urban driving condition (EUDC) cycle, with an average speed of 62.6km / h, an effective driving time of 400s, and a total driving distance of 6.955km. WLTC and DST conditions were selected as test sets. WLTC is a test cycle developed based on the actual driving conditions of vehicles in many regions around the world. It aims to more accurately reflect the actual driving conditions. It has been implemented in Europe and other places and has gradually become the mainstream automobile fuel consumption and emission test standard. This condition includes a wider range of driving scenarios and more complex dynamic driving behaviors, such as more frequent acceleration and deceleration, which is more in line with the technical level of modern cars and people's driving habits. Its test results can more accurately reflect the vehicle's performance indicators such as mileage, fuel consumption and emissions in actual use, providing consumers with more valuable information. DST is mainly used to evaluate the comprehensive performance of batteries under actual use conditions; the preprocessing process includes: extracting characteristic variables related to battery discharge in the driving cycle from the data set, fusing and randomly arranging the characteristic variables to form an input data set; the characteristic variables include power battery current, voltage, capacity and temperature.
[0037] In the data preprocessing process, according to the different working condition data sets, the useful characteristic variables in each data set, such as current, voltage and temperature, are screened out, and the initial value of the state of charge is calculated using the ampere-hour integration method, specifically:
[0038]
[0039] Among them, SOC(t) is the remaining battery capacity at time t, SOC(t0) is the remaining battery capacity at the initial time t0, C N is the rated capacity of the battery, and I(τ) is the current at time τ.
[0040] It should be noted that the initial value of SOC is also one of the characteristic variables. Since the value of SOC cannot be directly measured by the equipment, the operating condition test instrument calculates the initial value of SOC through the ampere-hour integration method. This enables the neural network to learn the relationship between voltage, current, temperature and SOC, and then perform SOC prediction.
[0041] In actual applications, the system will monitor the battery current in real time, collect current data at a certain time interval (such as every second), and then calculate the integral through the numerical integration method. The time is divided into many small time periods, and the current is approximately assumed to change linearly in each small time period. Then the power change in this small time period is calculated, and finally the power changes in all small time periods are accumulated.
[0042] After completing the calculation of the initial values, the data sets of each driving condition are intercepted to complete the preparation of the data set, including: for each driving cycle, each data set is divided into a discharge driving process and a charging process according to the different charge and discharge cycles. Specifically, the electric vehicle starts to discharge from the initial state until it is discharged to the cut-off voltage. This is a discharge driving cycle. This cycle is intercepted as the training and test data sets, and sampled at a fixed time step to complete the preparation of the data set.
[0043] Before dividing the training set, validation set and test set, it also includes: filtering out invalid data in the data set for removal; specifically, the 0 voltage and current data that appear before the discharge cut-off voltage is reached. This type of data is mainly caused by the sampling error of the sensor during the sampling process.
[0044] In fixed temperature sampling, the appropriate sampling frequency will be determined according to the needs of the research or application. Generally speaking, the higher the sampling frequency, the more detailed the data obtained, but it will also increase the amount of data and system costs. For example, for the battery management system of an electric vehicle, the battery temperature data may be collected every few seconds or minutes; therefore, a certain amount of error data will also appear in this process, which also needs to be removed.
[0045] After dividing the training set, validation set, and test set, a deep learning model is built based on the TimesNet network structure; then, based on the training set and validation set, the deep learning model is trained and the model parameters are adjusted to achieve the optimal model.
[0046] In some embodiments, in step S102, building a deep learning model based on the TimesNet network architecture includes:
[0047] Step S1021: construct the main network framework of TimesNet.
[0048] Step S1022: construct the front-end network framework of TimesNet.
[0049] Step S1023: Based on the multi-periodic characteristics of the time series of the TimesNet network front-end architecture, the training set and the test set are converted from one-dimensional time series data to two-dimensional tensors, so as to better capture the complex change information in the time series, and the feature variable data is input into the TimesNet network main architecture for training, and the model parameters are adjusted to achieve the optimal model. According to the minimum loss value obtained by the input verification set, a deep learning model is obtained.
[0050] Specifically, in step S1021, the main network framework of TimesNet is constructed, including the following steps:
[0051] Step S1021a, embedding layer setting.
[0052] Determine the parameters of the embedding layer, including the input dimension (i.e. the dimension of the original data) and the output dimension (the dimension of the converted vector).
[0053] Step S1021b, construct TimesBlock. TimesBlock is the core component of TimesNet. By stacking multiple TimesBlocks together, TimesNet can gradually extract multi-period features and complex change patterns in time series data, thereby achieving effective modeling and prediction of time series.
[0054] In some embodiments, each TimesBlock includes the following steps: performing a fast Fourier transform on the input one-dimensional time series data to identify different periods in the data; converting the time series from the time domain to the frequency domain through the fast Fourier transform to obtain the frequency and amplitude information of each period; reshaping the data according to the determined period to convert the one-dimensional time series into a two-dimensional tensor form; inputting the converted two-dimensional tensor into a parameter-efficient Inception module; in TimesNet, the Inception module is used to learn and predict its feature representation from the two-dimensional time series data to capture the two-dimensional changes in time; after the Inception module processes the two-dimensional data, an adaptive aggregation operation is used to reshape its deep representation back into a one-dimensional vector to match the dimension of the original data.
[0055] Specifically, the process of period extraction and one-dimensional to two-dimensional conversion is as follows: Perform fast Fourier transform (FFT) on the input one-dimensional time series. Calculate the frequency domain information through FFT, and select the most important p periods according to the amplitude of the frequency. For a sequence x[n] (n=0,1,…,N-1) of length N. Obtain the discrete Fourier transform X[k] (n=0,1,…,N-1) through the FFT algorithm, calculate the amplitude of X[k], and select the period length corresponding to the p frequencies with larger amplitudes. Fold the original one-dimensional time series based on the selected p periods and convert it into a two-dimensional tensor. In this way, the columns and rows of the two-dimensional tensor reflect the time series changes within and between periods, respectively.
[0056] 2D feature extraction (2D Representation): Select a suitable 2D convolutional network structure to extract 2D temporal change representation. You can use the Inception module or other similar structures (such as ResNeXt, ConvNeXt, etc.). For example, when using the Inception module, it contains multiple branches of convolution layers with convolution kernels of different sizes (such as 1×1, 3×3, 5×5) and pooling layers (such as 3×3 maximum pooling). These branches operate on the input 2D tensor at the same time, and then splice the outputs of each branch in the channel dimension to form the final output.
[0057] 2D-1D Aggregation: Expand the extracted 2D time series representation to a 1D space and remove the 0 added in the folding process. To fuse multi-period information, perform weighted summation on the extracted 2D time series representation. The selected summation weight is the corresponding frequency intensity obtained above, so as to realize the process of extracting 2D time series changes in multiple periods and then adaptively fusion time series change modeling.
[0058] Step S1021c, stack TimesBlocks and add residual connections: First, determine the number of TimesBlocks that need to be stacked based on the complexity of the model and task requirements. For more complex time series prediction tasks, it may be necessary to stack multiple TimesBlocks to fully extract features. Add residual connections between adjacent TimesBlocks. The residual connection method is to add the input of the previous TimesBlock directly to the output of the next TimesBlock, which can alleviate the gradient vanishing problem, making the network easier to train, and also helps to better retain and utilize the information in the input data.
[0059] The loss function used in the model training process is the criterion loss function. It is a function used to measure the difference between the model's prediction results and the true label. The smaller the value of the loss function, the closer the model's prediction results are to the true value. By minimizing the loss function, the model can continuously adjust its parameters to improve the accuracy of the prediction. Among them, Mean Squared Error (MSE), Mean Absolute Error (MAE) and Root Mean Square Error (RMSE) are the three main types of use. For a set of prediction values and the corresponding true value x t (t=1,2,…,T) The calculation methods are:
[0060]
[0061] The model parameters are adjusted according to the loss value after model training convergence, so as to minimize the loss value after convergence in model verification. Finally, the model parameters that minimize the loss value after convergence are selected and imported into the deep learning model, and then the model is tested using the test set.
[0062] In step S1021, based on the TimesNet network front framework constructed in step S1021b, the training set and the test set are converted into corresponding two-dimensional time series data, and the data is input into the TimesNet network main framework for training, and the model parameters are adjusted to achieve the optimal model. According to the minimum loss value obtained by inputting the verification set, a deep learning model is obtained.
[0063] Before inputting the data into the TimesNet network main framework for training, it also includes: converting the working condition data into tensor variables, and transposing the tensor variables as the input of the TimesNet network main framework.
[0064] In some embodiments, step S105 inputs the driving condition data set to be predicted into the trained deep learning model, including:
[0065] Step S1051 : preprocessing the driving condition data set to be predicted to obtain a preprocessed two-dimensional time series data set.
[0066] Step S1052: input the preprocessed data set into the trained deep learning model to predict the SOC of the lithium-ion battery.
[0067] In some embodiments, in step S1051, the operating condition data set to be predicted is preprocessed, including: performing feature extraction and data segmentation preprocessing operations on the operating condition data set to be predicted, so that the dimension of the preprocessed time series data set to be predicted is the same as the dimension of the data sets in the training set, the validation set and the test set.
[0068] Specifically, the preprocessing of the driving condition data set to be predicted is the same as the preprocessing of the training set, validation set and test set. The driving condition data set to be predicted is preprocessed by feature extraction, data segmentation and other preprocessing, so that the dimension of the preprocessed data set to be predicted is the same as the dimension of the data set in the training set, validation set and test set. The preprocessed data set is input into the trained deep learning model to obtain the prediction result, and the SOC value of the lithium-ion battery can be predicted.
[0069] In some embodiments, the electric vehicle driving condition data set used in step S105 mainly includes: NEDC, WLTC, DST and UDDS (ie, urban dynamometer driving condition) conditions.
[0070] Among them, NEDC conditions are selected as the training set. NEDC is the New European Driving Cycle, which is mainly divided into urban conditions and suburban conditions. The urban condition consists of four ECE cycle units, with a maximum speed of 50km / h, an average speed of 19km / h, each cycle time of 195s, and a total driving distance of 4.052km; the suburban condition is an EUDC cycle, with an average speed of 62.6km / h, an effective driving time of 400s, and a total driving distance of 6.955km; WLTC conditions and DST conditions are selected as test sets, among which WLTC is the World Light Vehicle Test Cycle, which is a test cycle developed based on the actual driving conditions of vehicles in many regions around the world. It aims to more accurately reflect actual driving conditions and is currently in Europe and other places took the lead in implementing and gradually became the mainstream automobile fuel consumption and emission test standard. This condition includes a wider range of driving scenarios and more complex dynamic driving behaviors, such as more frequent acceleration and deceleration, which is more in line with the technical level of modern automobiles and people's driving habits. Its test results can more accurately reflect the vehicle's performance indicators such as mileage, fuel consumption and emissions in actual use, providing consumers with more valuable information for reference; DST is a dynamic stress test, which is mainly used to evaluate the comprehensive performance of batteries under actual use conditions; UDDS condition (Urban Dynamometer Driving Schedule), that is, the urban dynamometer driving condition, is a standard driving cycle used to simulate the operating state of a car under actual driving conditions in the city. The speed-time curve of the UDDS condition shows obvious volatility. The vehicle speed range is generally between 0-91.2 kilometers per hour, and the acceleration, deceleration and idling stages are frequently alternating. In the entire test cycle, the idling time accounts for about 19% of the total time, which is consistent with the actual situation of waiting for traffic lights in urban traffic. For example, when a vehicle is driving on a city street, it may encounter an intersection every few hundred meters, requiring frequent parking and restarting.
[0071] The preprocessing process of the data set includes: extracting characteristic variables related to battery discharge during the driving cycle from the data set, fusing and randomly arranging the characteristic variables to form an input data set; the characteristic variables include power battery current, voltage, capacity and temperature. Specifically, the above working conditions collect training and test data at 10°C, 25°C and 40°C to improve the versatility of the model. In each experiment, the subjects went through a complete charge and discharge cycle, in which the test curve was applied to simulate the actual discharge process. During the test, the sensor signals, including current, voltage and temperature, were recorded every 1s.
[0072] See also Figure 2, the embodiment of the present application provides a network architecture diagram of TimesNet, including the main network architecture and pre-network architecture of TimesNet. The main network architecture of TimesNet includes multiple stacked TimesBlocks, each of which focuses on capturing information within a specific period range, while the combination of multiple TimesBlocks can cover a wider range of time scales and change patterns, so that the model can adapt to time series data of different types and characteristics, and calculate loss values and related prediction evaluation indicators in various time series analysis tasks; the pre-network architecture of TimesNet uses residual links to stack multiple TimesBlocks together, and the input sequence first passes through the embedding layer to obtain deep features, and then passes through each TimesBlock in turn for feature extraction and transformation; adjust the model parameters, optimize the model, and obtain the optimized deep learning model and optimized model parameters based on the minimum loss value obtained from the input validation set.
[0073] See also Figure 3 The present application embodiment also provides a lithium-ion battery state of charge prediction model based on TimesNet, which uses the lithium-ion battery state of charge prediction method based on TimesNet described in the above embodiment to predict the battery state of charge, including: a data preprocessing module 101, a model building module 102, a model training module 103, a model evaluation module 104 and a prediction module 105 connected in sequence; wherein the data preprocessing module 101 is used to obtain a data set, and preprocess the data set, and divide the preprocessed data set into a training set, a verification set and a test set; the model building module 102 is used to predict the state of charge of a lithium-ion battery based on TimesNet. Net network architecture, constructing a deep learning model; the model training module 103 is used to input the training set and the verification set into the deep learning model, train the deep learning model, adjust the model parameters, and obtain the optimized deep learning model and optimized model parameters; the model evaluation module 104 is used to input the test set into the optimized deep learning model, and based on the optimized model parameters, perform performance evaluation on the optimized deep learning model to obtain the trained deep learning model and updated model parameters; the prediction module 105 is used to input the lithium-ion battery data set to be predicted into the trained deep learning model to predict the charge state of the lithium-ion battery.
[0074] Specifically, the data preprocessing module 101 is used for data set feature extraction and transformation. TimesBlock first uses fast Fourier transform (FFT) to extract the period of the input one-dimensional time series feature, and then converts it into a two-dimensional time series change. Then, the Inception model or other visual backbone network is used to extract the features of the converted two-dimensional time series change, learn and predict the 2D representation of the series. The two-dimensional time series change representation is expanded to a one-dimensional space for subsequent multi-cycle fusion. Finally, according to the corresponding frequency intensity obtained, the extracted two-dimensional time series representation is weighted and summed to achieve the fusion of multi-cycle information, and the training set, verification set and test set are divided; the model construction module 102 is used to build a deep learning model according to the network architecture of TimesNet; the model training module 103 is used to train the deep learning model according to the training set and the verification set, adjust the model parameters, and obtain the optimized deep learning model and optimized model parameters; the model evaluation module 104 is used to perform performance evaluation on the optimized deep learning model according to the optimized model parameters and the test set, and obtain a trained deep learning model; the prediction module 105 is used to input the operating condition data set to be predicted into the trained deep learning model to predict SOC.
[0075] The TimesNet-based lithium-ion battery state of charge prediction model provided by the present application is described in detail below with respect to specific embodiments.
[0076] First of all, the TimesNet-based lithium-ion battery state of charge prediction method and model proposed in the embodiment of the present application is based on the Windows 11 system and implemented using Python 3.9.
[0077] In addition, it should be noted that the embodiments of the present application conduct analysis and evaluation based on comparisons of different working conditions and data sets.
[0078] First, the current and voltage values in the original data set are extracted through the data set module 101, and then the preliminary SOC value is calculated by the ampere-hour integration method for fitting.
[0079] Next, the preprocessed current and voltage data sets are divided into training sets, validation sets, and test sets. Based on the TimesNet network architecture, a deep learning model is constructed through the deep learning model module 102. The training set, validation set, and test set are converted into random sequence data, input into the established network main body architecture, trained through the model training module 103, and the model parameters are adjusted to achieve the optimal model. The model optimization module 104 selects the trained optimal deep learning model according to the minimum loss value obtained by inputting the validation set. The NEDC condition uses the TimesBlock layer network to train on the data for more than 100 epochs. The tracking results and estimated errors are calculated as the actual value minus the estimated value. Then, the above experimental process is repeated using the TimesNet network. MAE, RMSE, and MSE are obtained. Then the performance of the network is tested on the data sets of 10℃, 25℃, and 40℃, respectively. Among them, the test results for the DST condition on the 10℃, 25℃, and 40℃ data sets are as follows. Figure 4A Show.
[0080] Then, based on the test set, the performance of the deep learning model is evaluated by the prediction module 105. The evaluation indicators include mean absolute error (MAE) and root mean square error (RMSE) for evaluation. Among them, the SOC estimation results at different temperatures in the DST working condition of the embodiment are shown in Table 1.
[0081] Table 1 SOC estimation results at different temperatures in DST conditions of the embodiment
[0082]
[0083] Overall, the TimesBlock network shows commendable performance in estimating SOC. At a temperature of 25°C, the RMSE is 1.03%. However, as the temperature increases, the estimation accuracy gradually decreases, with RMSE values ranging from 1.01% to 1.07%. The most significant performance drop is at 40°C. This drop can be attributed to the intensification of chemical reactions of the battery at high temperatures, which complicates the dynamic characteristics and hinders the estimation of SOC. In general, the trained network is adaptable to temperatures outside the training set. In addition, the TimesBlock network demonstrates excellent generalization capabilities under various driving cycles and temperature conditions.
[0084] On the other hand, for SOC estimation, considering the influence of different driving environments and driving conditions, it is necessary to test the model under different working conditions to improve the reliability of the model. Taking WLTC and UDDS working conditions as examples, plus the aforementioned DST working condition, these three working conditions are very different in design purpose, speed characteristics, driving distance and time, load conditions and assessment focus. In terms of speed characteristics: the speed range of the UDDS condition is generally between 0-91.2 km / h, the speed changes frequently, and the acceleration, deceleration and idling stages alternate significantly. The idling time accounts for about 19% of the total time, which is closer to the frequent start-stop traffic conditions in the city; the speed changes in the DST condition are also relatively frequent, but its specific speed range and change pattern depend on the specific dynamic load conditions simulated, and usually cover various speed change scenarios that the vehicle may encounter in actual driving, so as to fully test the performance of the battery under different conditions; WLTC condition: divided into four parts: low speed, medium speed, high speed and ultra-high speed, with a maximum speed of 131.3 km / h and an average vehicle speed of 46.5 km / h. The test time is longer and the speed fluctuation is relatively small, but it can more comprehensively simulate complex driving conditions in the real world, including speed changes in different scenarios such as urban roads and highways. In terms of driving distance and time: the total driving distance of the UDDS condition is about 11.99 kilometers, and the test cycle time is about 1372 seconds (about 22.9 minutes); DST condition: there is no fixed standard for its driving distance and time, which is usually set according to the test needs and the specific requirements of the battery performance evaluation. Generally, multiple tests are carried out under different SOC states to comprehensively evaluate the performance of the battery in different power stages; WLTC condition: the test cycle time is 1800 seconds, the driving distance is relatively long, which is closer to the long-distance driving conditions in actual driving, and can better reflect the vehicle's energy consumption performance over a longer time and distance. In terms of load: UDDS conditions generally do not consider the additional load of the vehicle, but will simulate various resistances of the vehicle in urban driving, such as rolling resistance, air resistance, etc.; DST conditions: focus on the load changes of the battery, and evaluate the performance of the battery under complex load conditions by simulating different dynamic load conditions, such as large current discharge during acceleration, energy recovery during deceleration, etc., and usually do not involve load changes in other aspects of the vehicle; WLTC conditions: take into account various actual loads of the vehicle during use, such as the air conditioner is turned on, the vehicle load is 100kg, etc., and also consider the impact of factors such as vehicle configuration and tires on energy consumption, which is closer to the actual vehicle use environment.
[0085] In summary, these three working conditions have different focuses on the performance of electric vehicles. Therefore, the use of these three data sets with different focuses can well verify the generalization of the model. Among them, the test results for WLTC working condition and UDDS working condition are Figure 4B The SOC estimation results under three different working conditions in the embodiment are shown in Table 2.
[0086] Table 2 SOC estimation results under different working conditions in the embodiment
[0087]
[0088] Therefore, the accurate estimation of the SOC of the lithium-ion battery of the electric vehicle proposed in the embodiment of the present application can effectively improve the safety and reliability of the electric vehicle.
[0089] Based on the above technical scheme, the embodiment of the present application provides a lithium-ion battery state of charge prediction method and model based on TimesNet, and the method includes the following steps: first, obtaining a data set, and preprocessing the data set, dividing the preprocessed data set into a training set, a validation set and a test set; then, based on the network architecture of TimesNet, building a deep learning model; next, inputting the training set and the validation set into the deep learning model, training the deep learning model, adjusting the model parameters, and obtaining an optimized deep learning model and optimized model parameters; then, inputting the test set into the optimized deep learning model, and based on the optimized model parameters, performing a performance evaluation on the optimized deep learning model, obtaining a trained deep learning model and updated model parameters; finally, inputting the lithium-ion battery data set to be predicted into the trained deep learning model to predict the state of charge of the lithium-ion battery.
[0090] This application proposes a method and model for predicting the state of charge of lithium-ion batteries based on TimesNet, and uses the TimesNet model for training and prediction. Compared with other time series prediction models, TimesNet has the following advantages: Traditional time series prediction models such as RNN and its variants mainly focus on changes between adjacent moments and are insufficient in modeling long-term dependencies. However, TimesNet, from a multi-period perspective, can capture the multi-periodicity in time series and decompose complex time changes into changes within and between multiple cycles, so as to better handle long-term dependencies and is suitable for time series data with complex periodic changes; in addition, TimesNet adopts a modular design approach, where a module captures time series changes dominated by a specific cycle. This design can decouple complex time changes and is conducive to subsequent modeling. At the same time, the TimesBlock in the model uses a parameter-efficient Inception module, which can effectively extract features from two-dimensional data without significantly increasing model parameters, thereby improving the generalization ability and computational efficiency of the model. This application uses three different data sets to minimize random errors and verify the accuracy and generalization ability of the model. Experimental results show that this method can achieve high-precision estimation of battery SOC at different temperatures, and exhibits excellent generalization ability and convergence ability in handling initial errors for different data sets.
[0091] This application proposes a lithium-ion battery state of charge prediction method and model based on TimesNet, which can better estimate the SOC in lithium-ion batteries. BMS can monitor the SOC of the battery in real time to determine the current state of the battery and adjust the charging and discharging strategies accordingly, thereby extending the service life of the battery. Therefore, this application adopts the TimesNet model for training and prediction. By stacking multiple TimesBlocks together, TimesNet can gradually extract multi-cycle features and complex change patterns in time series data, thereby achieving effective modeling and prediction of time series. Each TimesBlock focuses on capturing information within a specific cycle range, while the combination of multiple TimesBlocks can cover a wider range of time scales and change patterns, so that the model can adapt to time series data of different types and characteristics, and achieve better results in various time series analysis tasks. Experimental results show that this method achieves high-precision estimation of battery SOC at different temperatures, and also shows strong generalization ability under different driving conditions.
[0092] Those skilled in the art can understand that the above-mentioned embodiments are specific examples for implementing the present application, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of the present application. Any person skilled in the art can make their own changes and modifications without departing from the spirit and scope of the present application, so the scope of protection of the present application shall be based on the scope defined in the claims.
Claims
1. A method for predicting the state of charge of a lithium-ion battery based on TimesNet, characterized in that: The following steps are involved: Obtaining a data set, preprocessing the data set, and dividing the preprocessed data set into a training set, a validation set, and a test set; Build a deep learning model based on the TimesNet network architecture; Inputting the training set and the validation set into the deep learning model, training the deep learning model, adjusting model parameters, and obtaining an optimized deep learning model and optimized model parameters; The test set is input into the optimized deep learning model, and based on the optimized model parameters, the performance of the optimized deep learning model is evaluated to obtain a trained deep learning model and updated model parameters; The lithium-ion battery data set to be predicted is input into the trained deep learning model to predict the state of charge of the lithium-ion battery.
2. The method for predicting the state of charge of a lithium-ion battery based on TimesNet according to claim 1, characterized in that: The data set is an electric vehicle driving condition data set including current, voltage and temperature data, and the current, voltage and temperature data are collected by sensors of the electric vehicle lithium-ion battery management system; The data set is preprocessed, including: Extracting characteristic variables related to battery discharge during a driving cycle from the data set, fusing and randomly arranging the characteristic variables to obtain a preprocessed data set; The characteristic variables include power battery current, voltage, capacity and temperature.
3. The method for predicting the state of charge of a lithium-ion battery based on TimesNet according to claim 1, characterized in that: Based on the TimesNet network architecture, we build a deep learning model, including: Construct the main network structure of TimesNet; Build the front-end architecture of TimesNet; Based on the multi-periodic characteristics of the time series of the TimesNet network front-end architecture, the training set and the test set are converted from one-dimensional time series data to two-dimensional tensors, so as to better capture the complex change information in the time series, and the characteristic variable data is input into the TimesNet network main architecture for training, and the model parameters are adjusted to achieve the optimal model. According to the minimum loss value obtained by inputting the verification set, a deep learning model is obtained.
4. The method for predicting the state of charge of a lithium-ion battery based on TimesNet according to claim 3, characterized in that: Build the main network architecture of TimesNet, including: Set the embedding layer; Construct TimesBlock; Stack TimesBlock and add residual connection; Among them, TimesBlock is the core component of TimesNet. By stacking multiple TimesBlocks together, TimesNet can gradually extract multi-period features and complex change patterns in time series data, thereby achieving effective modeling and prediction of time series.
5. The method for predicting the state of charge of a lithium-ion battery based on TimesNet according to claim 4, characterized in that: Each TimesBlock includes the following steps: Perform fast Fourier transform on the input one-dimensional time series data to identify different periods in the data; through fast Fourier transform, the time series is converted from the time domain to the frequency domain to obtain the frequency and amplitude information of each period; Reshape the data according to the determined period and convert the one-dimensional time series into a two-dimensional tensor form; The converted 2D tensor is fed into a parameter-efficient Inception module. In TimesNet, the Inception module is used to learn and predict feature representations from 2D time series data, capturing 2D changes in time. After the Inception module processes the two-dimensional data, an adaptive aggregation operation is used to reshape its deep representation back into a one-dimensional vector to match the dimension of the original data.
6. The method for predicting the state of charge of a lithium-ion battery based on TimesNet according to claim 3, characterized in that: Before inputting the feature variable data into the TimesNet network main framework for training, it also includes: The working condition data is converted into tensor variables, and the tensor variables are transposed as the input of the TimesNet network main framework.
7. The method for predicting the state of charge of a lithium-ion battery based on TimesNet according to claim 1, characterized in that: Input the lithium-ion battery data set to be predicted into the trained deep learning model, including: Preprocessing the lithium-ion battery data set to be predicted to obtain a preprocessed two-dimensional time series data set; The preprocessed two-dimensional time series data set is input into the trained deep learning model to predict the state of charge of the lithium-ion battery.
8. The method for predicting the state of charge of a lithium-ion battery based on TimesNet according to claim 1, characterized in that: The lithium-ion battery data set to be predicted is a driving condition data set to be predicted; the driving condition data set to be predicted includes: a new European driving cycle condition, a global light vehicle test cycle condition, a dynamic pressure test condition and an urban dynamometer driving condition.
9. The method for predicting the state of charge of a lithium-ion battery based on TimesNet according to claim 7, characterized in that: The new European driving cycle includes urban and suburban conditions; the urban condition consists of four ECE cycle units, with a maximum speed of 50 km / h, an average speed of 19 km / h, each cycle time of 195 seconds, and a total driving distance of 4.052 km; the suburban condition is an EUDC cycle, with an average speed of 62.6 km / h, an effective driving time of 400 seconds, and a total driving distance of 6.955 km; The GLAV test cycle is used to assess the comprehensive performance of a vehicle, including the coordinated working effect of the powertrain, transmission system, and energy recovery system at different speed ranges and load conditions, as well as the overall energy consumption level and endurance of the vehicle, and can reflect the actual performance of the vehicle in actual use. The dynamic pressure test condition is used to assess the comprehensive performance of the battery, including the capacity attenuation, internal resistance change, energy output capability and thermal management performance of the battery, so as to ensure the reliability and durability of the battery in actual use; The urban dynamometer driving condition is used to evaluate the energy consumption level, cruising range, responsiveness of the power system and efficiency of the battery management system of the electric vehicle under urban conditions.
10. A lithium-ion battery state of charge prediction model based on TimesNet, using the lithium-ion battery state of charge prediction method based on TimesNet as described in any one of claims 1 to 9 to predict the battery state of charge, characterized in that: include: A data preprocessing module, a model building module, a model training module, a model evaluation module and a prediction module connected in sequence; The data preprocessing module is used to obtain a data set, preprocess the data set, and divide the preprocessed data set into a training set, a validation set, and a test set; The model building module is used to build a deep learning model according to the network architecture of TimesNet; The model training module is used to input the training set and the validation set into the deep learning model, train the deep learning model, adjust the model parameters, and obtain an optimized deep learning model and optimized model parameters; The model evaluation module is used to input the test set into the optimized deep learning model, and based on the optimized model parameters, perform performance evaluation on the optimized deep learning model to obtain a trained deep learning model and updated model parameters; The prediction module is used to input the lithium-ion battery data set to be predicted into the trained deep learning model to predict the state of charge of the lithium-ion battery.
Citation Information
Patent Citations
Lithium battery health state prediction method
CN116679211A
Lithium battery charge state and energy state estimation method
CN118011211A
Battery charge state estimation method and device and computer equipment
CN118033432A
Method and device for predicting remaining capacity of battery and computer equipment
CN118096435A
Lithium battery SOH prediction method based on Times Net-BiGRU neural network
CN118962457A