A multi-period new energy vehicle data battery temperature prediction method based on a PatchTST network
By using the PatchTST network to perform block processing and adaptive weight setting on the battery temperature data of new energy vehicles, the problem of inaccurate temperature prediction of new energy vehicles batteries is solved, accurate prediction of future battery temperature changes is achieved, and the accuracy and real-time performance of battery temperature prediction are improved.
Patent Information
- Application Number
- CN202510254908.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-03-05
AI Technical Summary
Existing technologies make it difficult to accurately predict the battery temperature of new energy vehicles, especially under intermittent and multivariate data conditions, resulting in inaccurate battery temperature predictions, affecting battery service life and safety.
The PatchTST network is used to process the battery temperature data of new energy vehicles in blocks, and a PatchTST model is constructed. Through adaptive weight setting and global optimal solution search method, combined with the Transformer encoding layer to capture long-distance dependencies and local features, multi-period battery temperature prediction is achieved.
It achieves accurate prediction of future battery temperature change trends, improves the accuracy and real-time performance of battery temperature prediction, and ensures the safety and endurance of new energy vehicles.
Smart Images

Figure CN120178041B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of new energy vehicles, in particular to a multi-period new energy vehicle data battery temperature prediction method based on a PatchTST network. BACKGROUND
[0002] New energy vehicles are an important part of future transportation, and the performance and safety of their battery systems are crucial. Battery temperature is one of the key factors affecting battery performance, and both excessively high or low temperatures can damage the battery and affect its service life and safety. Therefore, accurately predicting battery temperature and taking effective thermal management measures are of great significance to ensuring the safe operation of new energy vehicles.
[0003] In recent years, deep learning technology has made remarkable achievements in various fields due to its powerful data processing and pattern recognition capabilities. The Transformer model, as a new type of deep learning architecture, has shown excellent performance in natural language processing, image recognition, and time series analysis. PatchTST (Patch-based Transformer for Time Series) network is an application of the Transformer model in time series analysis, which divides time series data into multiple small blocks (Patches) and uses the Transformer model to process these small blocks, achieving efficient modeling and prediction of time series data.
[0004] New energy vehicle battery temperature data has its own unique characteristics, and its usage process is often to drive for a period of time, stop driving at the destination, charge or rest, and then drive again. During the two driving periods, the data is discontinuous, and there are jumps. The battery temperature change in the same period is related to time, but the battery temperature change in different periods is not related to the size of the time interval. Common processing methods such as LSTM, gray model, convolutional neural network, ARIMA, etc. use point-by-point prediction methods, which fail to block the energy storage battery data and analyze the discontinuity characteristics. The feature processing often uses a channel mixing method, and the new energy battery temperature data change is related to external environment, vehicle driving conditions, power demand, etc., which belongs to a multivariate prediction method, and different variable data has different change rules. The previous method often projects all dimension vector information to the embedding space, which often affects other channels when there is noise in a channel, and is prone to overfitting.
[0005] In order to use the advanced Patch strategy in new energy vehicle battery temperature prediction, all period data can be directly subjected to Patch operation or subjected to interpolation method, or only single period driving data is processed. However, only single period data is analyzed, and it is difficult to reflect the complex change process in the change of the battery temperature of the electric vehicle; the interpolation method or direct Patch operation does not conform to the temperature change rule of the electric vehicle, the vehicle temperature prediction is not accurate, and how to process the discontinuous position is the difficulty currently faced. The multi-period new energy battery temperature does not have the time series characteristics, in order to migrate the Patch strategy to the new energy battery temperature prediction, a multi-period new energy vehicle data battery temperature prediction method based on PatchTST network is proposed, a PatchTST model is constructed, all collected historical battery temperature change related data are jointly trained and verified, and the future temperature change trend of the battery is accurately predicted, and reliable prediction information is provided for the battery thermal management system. SUMMARY
[0006] In view of the deficiencies of the prior art, the present application provides a multi-period new energy vehicle data battery temperature prediction method based on PatchTST network, which solves the problems in the above background art.
[0007] In order to achieve the above purpose, the present application is realized by the following technical scheme: a multi-period new energy vehicle data battery temperature prediction method based on PatchTST network, specifically comprising the following steps:
[0008] S1, historical data acquisition: acquire single period environmental data, battery data and driving data related to the change of the battery temperature of the new energy vehicle under different working conditions, and acquire several groups of single period data;
[0009] S2, constructing PatchTST model: constructing PatchTST model and setting hyperparameters;
[0010] S3, optimizing data preparation: data preprocessing is performed on the single period data, the single period data is divided into a training set and a validation set according to a preset proportion, time sequence Patch and position Patch are made in units of time, training set Patch data and validation set Patch data are acquired;
[0011] S4, model training and optimization: the training set Patch data and the validation set Patch data corresponding to the multi-period data are used to jointly train and optimize the PatchTST model, and the optimal PatchTST model is acquired;
[0012] S5, battery temperature prediction: inputting new battery temperature related data into the optimal PatchTST model to obtain the predicted battery temperature;
[0013] S6, temperature control strategy adjustment: a temperature control strategy corresponding to the temperature environment is formulated, and a corresponding temperature control strategy is adopted according to the predicted temperature to control the battery temperature.
[0014] The application is further provided as follows: the PatchTST model comprises an input layer, a Patch Embedding layer, a Transformer encoding layer, a straightening and linear attention, an output layer and a loss function.
[0015] The input layer is used to receive the preprocessed temperature-related data.
[0016] The Patch Embedding layer is used to divide the time series data into multiple small blocks and embed each small block into a high-dimensional space.
[0017] The Transformer encoding layer is used to capture long-distance dependencies and local features in the time series data.
[0018] The output layer is used to output the predicted temperature value.
[0019] The loss function is used to evaluate the accuracy of the prediction result of the PatchTST model.
[0020] The application is further provided as follows: the hyperparameters in S2 include: basic configuration hyperparameters, data loading hyperparameters, prediction task configuration hyperparameters, PatchTST model specific parameters, Formers related hyperparameters, model training and optimization hyperparameters and hardware resource allocation hyperparameters.
[0021] The basic configuration hyperparameters include a random seed, a state identifier and a model identifier.
[0022] The data loading hyperparameters include a file directory, a data type, a feature type, a target identifier and an encoding frequency.
[0023] The prediction task configuration hyperparameters include an input sequence length, a start token length and a prediction sequence length.
[0024] The PatchTST model specific parameters include a fully connected layer dropout size, an attention head dropout size, a block length, a step length and a decomposition kernel size.
[0025] The Formers related hyperparameters include an encoder input size, a decoder output size, an output size, a model dimension, an attention head number, an encoding layer number, a decoding layer number, a feedforward network dimension and a moving average window size.
[0026] The model training and optimization hyperparameters include activation functions, training cycle numbers, batchsize sizes, optimizer learning rates, loss functions and learning rate adjustment methods.
[0027] The hardware resource allocation hyperparameters include whether to use GPU, GPU number and whether to use multi-GPU.
[0028] The application further provides that the data preprocessing in S3 includes feature deduplication, feature screening, feature merging, data division, normalization and random shuffling.
[0029] The application further provides that the manner of dividing the plurality of groups of single-period data into a training set and a validation set according to a preset ratio in S3 includes:
[0030] C1=C 总 ×a
[0031] C2=C 总 -C1
[0032] P1=[0,C1]
[0033] P2=[C1-C 3, C1+C2]
[0034] In the formula, C 总 is the total length of single-period data, C1 is the training set length, a is the preset ratio, a=0.6-0.95, C2 is the validation set length, C3 is the input sequence length, P1 is the training set cutting position, and P2 is the validation set cutting position.
[0035] The application further provides that in S4, when the PatchTST model is jointly trained and optimized, the single-period data is adaptively weighted according to the data length and the working condition, and the global optimal solution searching method is used to jointly correct the PatchTST network model parameters.
[0036] The application further provides that the adaptive weight setting formula includes:
[0037] a t =b t (1-α t ) γ t=1,2,L,n
[0038] In the formula, a t is the adaptive weight, b t is an influence factor for measuring the influence of the total length of each period data on the PatchTST model, (1-c t ) γis the adjustment factor, which is used to adjust the impact of different working conditions on the PatchTST model. γ is the focusing parameter, which is determined by the number of working condition categories.
[0039] α t The impact of the length of new energy vehicle data in period t on the adjustment factor is calculated using the following method:
[0040]
[0041] Where, P t is the length of the t-th period data, and max(P) is the maximum period length among all the data of new energy vehicles;
[0042] b t is the impact factor, and its solution methods include:
[0043]
[0044] Where b t It is c t The result after normalization using the tanh function.
[0045] The present invention is further configured as follows: the output layer of the PatchTST model uses a fully connected layer to output the predicted temperature value; during model training, the model parameters are optimized by a back propagation algorithm, and regularization processing is performed.
[0046] The present invention provides a method for predicting battery temperature based on multi-period new energy vehicle data using the PatchTST network. This method has the following beneficial effects:
[0047] (1) The present invention takes the time series blocks formed by segmentation as input. Each time series block captures the local area information in the new energy battery temperature, so that the PatchTST model can focus on the characteristics of different areas. The independent characteristics of PatchTST channels are used to effectively resist the influence of noise in each channel. Different channels will have different attention score distributions, which enables the model to recognize special behaviors of different sequences. Multiple periods of new energy vehicle data are jointly used to optimize the PatchTST network to obtain a battery temperature prediction model that adapts to various environments and working conditions. While having strong generalization performance, it can fully capture the complex patterns and long-distance dependencies in the battery temperature data, and realize accurate prediction of future temperature change trends of the battery.
[0048] (2) The present application implements batch processing by dividing into multiple small blocks, and the total amount of samples used for the training process is changed from the size of the whole data set to the result obtained by dividing the data set size by the step length of each batch processing. Under the same backtracking window, the calculation and memory usage of the attention diagram are reduced by two, significantly reducing the required computing power and the consumption of server power resources during the training process, and more in line with the real-time and hardware configuration requirements of new energy vehicle battery temperature prediction.
[0049] (3) The present application makes full use of the historical temperature data of the battery, and realizes accurate prediction of the future temperature change trend of the battery by combining the PatchTST network, improves the accuracy and real-time performance of the new energy vehicle battery temperature prediction, and provides reliable prediction information for the battery thermal management system, thereby ensuring the safety and endurance of the new energy vehicle. BRIEF DESCRIPTION OF DRAWINGS
[0050] Figure 1 A flowchart of a multi-period new energy vehicle data battery temperature prediction method based on a PatchTST network in an embodiment of the present application is shown.
[0051] Figure 2 A comparison diagram of predicted temperature and actual measured temperature in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0052] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application.
[0053] Please refer to Figures 1-2 The technical solutions provided by the embodiments of the present application are as follows:
[0054] Embodiment one
[0055] A multi-period new energy vehicle data battery temperature prediction method based on a PatchTST network, specifically comprising the following steps:
[0056] S1, historical data acquisition: acquire single-period environmental data, battery data and driving data related to new energy vehicle battery temperature changes under different working conditions, and acquire several groups of single-period data;
[0057] S2, constructing a PatchTST model: constructing a PatchTST model, the PatchTST model including an input layer, a PatchEmbedding layer, a Transformer encoding layer, a straightening and linear attention, an output layer and a loss function;
[0058] The input layer is used to receive preprocessed temperature-related data;
[0059] The Patch Embedding layer is used to divide the time series data into multiple small blocks and embed each small block into a high-dimensional space;
[0060] The Transformer encoding layer is used to capture long-distance dependencies and local features in the time series data;
[0061] The output layer is used to output the predicted temperature value, and the output layer adopts a fully connected layer to output the predicted temperature value. During model training, the model parameters are optimized through the backpropagation algorithm, and regularization processing is performed to improve the generalization ability of the model;
[0062] The loss function is used to evaluate the accuracy of the PatchTST model prediction results.
[0063] And perform hyperparameter setting, including: basic configuration hyperparameters, data loading hyperparameters, prediction task configuration hyperparameters, PatchTST model specific parameters, Formers related hyperparameters, model training and optimization hyperparameters, and hardware resource allocation hyperparameters;
[0064] The basic configuration hyperparameters include random seed, state identifier, and model identifier;
[0065] The data loading hyperparameters include file directory, data type, feature type, target identifier, and encoding frequency;
[0066] The prediction task configuration hyperparameters include input sequence length, start token length, and prediction sequence length;
[0067] The PatchTST model specific parameters include fully connected layer dropout size, attention head dropout size, block length, step size, and decomposition kernel size;
[0068] The Formers related hyperparameters include encoder input size, decoder output size, output size, model dimension, number of attention heads, number of encoding layers, number of decoding layers, feedforward network dimension, and moving average window size;
[0069] The model training and optimization hyperparameters include activation function, number of training cycles, batchsize size, optimizer learning rate, loss function, and learning rate adjustment method;
[0070] The hardware resource allocation hyperparameters include whether to use GPU, GPU number, and whether to use multi-GPU.
[0071] S3, optimize data preparation: feature deduplication, feature selection, feature merging, data division, normalization, and random data preprocessing on single-period data. According to the preset proportion, the single-period data is divided into training set and validation set, and the specific division method includes:
[0072] C1=C 总 x a
[0073] C2=C 总 -C1
[0074] P1=[0,C1]
[0075] P2=[C1-C 3, C1+C2]
[0076] In the formula, C 总 is the total length of single-period data, C1 is the length of the training set, a is a preset ratio, a = 0.6-0.95, C2 is the length of the validation set, C3 is the length of the input sequence, P1 is the training set cutting position, and P2 is the validation set cutting position.
[0077] The time sequence Patch and the position Patch are made in time units to obtain the training set Patch data and the validation set Patch data;
[0078] S4, model training and optimization: the training set Patch data and the validation set Patch data corresponding to the multi-period data are used to jointly train and optimize the PatchTST model. During model training, the data of each period is input into the PatchTST network that has been constructed, so that the battery temperature prediction value of the current period can be obtained. The loss value can be calculated by using the temperature prediction value and the corresponding real battery temperature. Since the data length and the working condition of each period of the new energy vehicle are different, in order to avoid underfitting, the data length and the working condition are divided according to the data length and the working condition, and the corresponding weight is set. An adaptive loss function is designed to automatically amplify the weight of the minority class. A global optimal solution search method is used to jointly correct the PatchTST network model parameters to obtain the optimal PatchTST model.
[0079] Further, the adaptive weight setting formula includes:
[0080] a t = b t (1-a t ) γ t = 1, 2, L, n
[0081] In the formula, a t is the adaptive weight, b t is an influence factor for measuring the influence of the total length of each period of data on the PatchTST model, (1-c t ) γ is an adjustment factor for adjusting the influence of different working conditions on the PatchTST model, and γ is a focusing parameter determined by the number of working condition categories.
[0082] a tThe influence of the length of the tth period new energy vehicle data on the adjustment factor is calculated as follows:
[0083]
[0084] where P t is the length of the tth period data, and max(P) is the maximum length of the period data among all the new energy vehicle data.
[0085] b t is the influence factor, and the solution method includes:
[0086]
[0087] where b t is the influence factor, and the solution method includes: t is the result of the tanh function normalization processing.
[0088] S5, battery temperature prediction: input the new battery temperature related data into the optimal PatchTST model to obtain the predicted battery temperature.
[0089] S6, temperature control strategy adjustment: formulate the temperature control strategy corresponding to the temperature environment, and adopt the corresponding temperature control strategy for battery temperature control according to the predicted temperature.
[0090] Embodiment two
[0091] A multi-period new energy vehicle data battery temperature prediction method based on PatchTST network, specifically including the following steps:
[0092] S1, historical data acquisition: 38 real driving data of BMW new energy vehicles collected from 2019 to 2020 are adopted, which are collected from new energy vehicles equipped with multiple sensors through a vehicle-mounted data acquisition system in real time, and stored in a database. The obtained data set contains the following 47 parameters: time [s], speed [km / h], altitude [m], throttle opening [%], motor torque [N.M], longitudinal acceleration [m / s 2], regenerative braking signal, battery voltage [V], battery current [A], battery temperature [°C], maximum battery temperature [°C], state of charge [%], displayed state of charge [%], minimum state of charge [%], maximum state of charge [%], heating power CAN [kW], heating power [W], requested heating power [W], air conditioning power [kW], heater signal, heater voltage [V], heater current [A], ambient temperature [°C], ambient temperature sensor [°C], coolant temperature (heating core) [°C], requested coolant temperature [°C], coolant temperature intake [°C], coolant flow + 500 [l / h], heat exchanger temperature [°C], passenger compartment temperature sensor [°C], coolant heater intake temperature [°C], coolant heater outlet temperature [°C], heat exchanger outlet temperature [°C], defrosting transverse left temperature [°C], defrosting transverse right temperature [°C], defrosting central temperature [°C], defrosting central left temperature [°C], defrosting central right temperature [°C], foot vent temperature [°C], foot vent passenger temperature [°C], foot vent temperature [°C] passenger temperature [°C], passenger foot temperature [°C], passenger head temperature [°C], driver head temperature [°C], vent right temperature [°C], vent central right temperature [°C], vent central left temperature [°C], vent left temperature [°C].
[0093] S2, constructing a PatchTST model: constructing a PatchTST model, the PatchTST model comprising an input layer, a PatchEmbedding layer, a Transformer encoding layer, a flatten and linear attention, an output layer, and a loss function;
[0094] The input layer is used to receive the pre-processed temperature-related data, and the shape of the input data X is [Batch, Inputlength, Channel], wherein Batch is the batch size, Input_length is the input sequence length, and Channel is the number of channels;
[0095] The Patch Embedding layer is used to divide the time series data into multiple small blocks and embed each small block into a high-dimensional space, which specifically includes time series encoding and position encoding: the time series encoding mainly includes moving average blocks and sequence decomposition blocks of the time series, wherein the time series encoding is a PyTorch module used to decompose the time series into two parts of trend and residual, in this embodiment, the moving average block is used to calculate the moving average as the trend, and then the residual is obtained by subtracting the trend from the original sequence, according to the time series encoding, the training set time series Patch and the validation set time series Patch can be made, finally, the dimensions of the trend and residual parts need to be rearranged to match the input requirements [Batch, Channel, Input length], based on the time series Patch, the position encoding function can be made, the position encoding process includes: initializing the position matrix, generating the position index, and calculating the scaling factor, then applying the sine and cosine functions to the position index and the scaling factor respectively, and storing the results in the index position of the position encoding function;
[0096] The Transformer encoding layer is used to capture long-distance dependencies and local features in the time series data by using the self-attention mechanism, in this embodiment, the trend and the residual are respectively input into the corresponding Transformer encoding layer for processing, the Transformer encoding layer is set as follows: the various parameters of the model are initialized, including the input channel number, the context window size, the target window size, the Patch length, the step, etc.; the number of Patches is calculated, and the corresponding head network is created according to the pre-training head and the pre-training head type parameters;
[0097] The output layer is used to output the predicted temperature value.
[0098] The loss function is used to evaluate the accuracy of the prediction results of the PatchTST model.
[0099] The user's battery temperature prediction accuracy and real-time demand, hardware configuration and data size are analyzed, and according to the above conditions, the basic configuration hyperparameters, data loading hyperparameters, prediction task configuration hyperparameters, PatchTST model specific parameters, Formers related hyperparameters, model training and optimization hyperparameters and hardware resource allocation hyperparameters are set, as shown in Table 1:
[0100]
[0101]
[0102] Table 1
[0103] S3, optimizing data preparation: data preprocessing is performed on single-period data, and the collected temperature data is preprocessed, including feature deduplication, feature screening, feature merging, data division, normalization and random shuffling. In this embodiment, through the integrity and logical consistency check of all collected features, it is found that the feature of "speed [km / h]" is inconsistent before and after, therefore, this feature is removed. In this embodiment, the time interval of the original data is 0.1 seconds, in order to meet the requirement of second-level response of the user, the time unit is converted into seconds by averaging every 10 data. In order to screen out the features most related to the temperature change of the new energy vehicle battery, the correlation coefficient of all feature vectors and the battery temperature is calculated, and 20 feature vectors are screened out under the condition that the correlation coefficient is greater than 0.2, as follows: time [seconds], throttle opening [%], battery voltage [V], battery temperature [℃], maximum battery temperature [℃], CAN heating power [KW], LIN heating power [W], requested heating power [W], heater voltage [V], heater current [A], ambient temperature [℃], ambient temperature sensor [℃], heater core coolant temperature [℃], coolant inlet temperature [℃], cabin temperature sensor [℃], coolant heater outlet temperature [℃], driver's foot temperature [℃], copilot's foot temperature [℃], copilot's head temperature [℃], driver's head temperature [℃], this embodiment is an invention related to battery temperature prediction, therefore, the battery temperature [℃] and the maximum battery temperature [℃] are excluded as target feature variables.
[0104] After the above processing, if the total data length is less than the input sequence length set in S2 plus the start mark length, the period data is discarded. In this embodiment, a total of 8 periods need to be discarded, as follows: period 10, period 11, period 13, period 24, period 27, period 29, period 30 and period 31. In this embodiment, 80% of the data in each period is used as the training set, and the remaining 20% of the data is used as the training set. In order to save data and avoid the length of the validation set data being less than the input sequence length set in S2 plus the start mark length, the data is specially set for position cutting, wherein the training set cutting position is [0, C1], and the validation set cutting position is [C1-C3, C1+C2].
[0105] In order to accelerate the convergence speed of the model and enhance the stability of the algorithm, the data normalization method is used to convert the data of different dimensions to the same dimension. In this embodiment, the StandardScaler function in the Sklearn.precessing library is used to standardize the features in the data, and time sequence patches are made for time units. The time sequence units used are year, month, day, hour, minute and second. In the temperature prediction of new energy electric vehicles, the data is divided into patches according to the window size and step length, where the patch length is P and the step length is S. The number of inputs through the patch strategy can be reduced from L to about L / S. Therefore, the memory usage and computational complexity of the attention mechanism are reduced in quadratic.
[0106] S4, model training and optimization: using the training set patch data and the validation set patch data corresponding to the multi-period data to jointly train and optimize the PatchTST model, and obtaining the optimal PatchTST model, specifically:
[0107] A1, initialize the preprocessing parameters, including setting the root directory path, data type, etc. In the model training, first create the training and validation sets for loading, set the learning rate scheduler, early stopping and Dropout to prevent model overfitting, etc. Training strategies. For each training cycle epoch, traverse the training data loader and execute the following steps:
[0108] 1) load the data to the device, which is GPU or CPU;
[0109] 2) according to the model type and data format, execute forward propagation calculation output.
[0110] 3) calculate the loss of each period by processing the temperature data and the corresponding label data, i.e. the actual temperature value, calculate the length of each period data, and count the working condition. Set the weight value by using the adaptive weight value, and use the global optimal solution search method to jointly correct the PatchTST network model parameters. In this embodiment, the output layer uses a fully connected layer to output the predicted temperature value;
[0111] 4) execute back propagation and update model parameters;
[0112] 5) record the training loss and adjust the learning rate as needed;
[0113] 6) save the best model state according to the validation loss using the early stopping EarlyStopping strategy, where patience is 100.
[0114] A2, create a validation data loader, and use the validation data loader to traverse the validation set, for each batch of data, perform forward propagation to calculate the output and record the validation loss, finally, evaluate the performance of the model according to the validation loss, in this embodiment, in order to comprehensively predict the temperature of the new energy battery, each period is verified, and the verification set is the last 20% data in each period, in this embodiment, the mean square error MSE is 0.178905, the mean absolute error MAE is 0.201334, and the residual standard error RSE is 0.26011. According to the experimental results, the precision index in the present application is less than 0.3, the precision is high, and the prediction effect is good. Finally, the model parameters after training are saved to obtain the optimal PatchTST model.
[0115] S5, battery temperature prediction: input the new battery temperature related data into the optimal PatchTST model to obtain the predicted battery temperature;
[0116] S6, temperature control strategy adjustment: formulate a temperature control strategy corresponding to the temperature environment, and adopt the corresponding temperature control strategy for battery temperature control according to the predicted temperature, such as starting the cooling system to reduce the battery temperature when it is predicted that the battery temperature will exceed the safety threshold; or adjusting the charge and discharge strategy of the battery to increase the battery temperature when it is predicted that the battery temperature will be too low.
[0117] In this embodiment, the last period data is used as input to predict the development trend of the next 96 time steps, and the prediction result is as shown in the attached Figure 2 figure, wherein the light gray circles represent the correct temperature values, and the black solid line pentagrams represent the predicted values. It can be seen that the difference between the black solid line and the light color circle is small, which indicates that the predicted temperature in this example is small compared with the actual measured temperature. Therefore, the multi-period new energy vehicle data battery temperature prediction method based on the PatchTST network has good prediction accuracy.
[0118] Embodiment three
[0119] The difference between this embodiment and embodiment two is that in the feature extraction step, in addition to extracting time series features, driving features and battery physical data, more external factor features such as target distance, wind speed, light intensity, etc. are introduced. These external factor features can be obtained through vehicle-mounted sensors or external meteorological data. The external factor features and other features are input into the PatchTST network model together, which can further improve the accuracy of model prediction.
[0120] Embodiment four
[0121] The embodiment provides an implementation mode of a new energy vehicle battery temperature prediction system based on a PatchTST network, the system comprises a data acquisition module, a data preprocessing module, a feature extraction module, a PatchTST network model construction module, a model training module and a temperature prediction module, and data interaction and processing procedures between the modules are the same as steps described in the embodiment two, through integration of the system into a battery management system of the new energy vehicle, real-time prediction and monitoring of the battery temperature can be realized, and reliable prediction information is provided for the battery thermal management system.
[0122] In conclusion, the application provides a multi-period new energy vehicle data battery temperature prediction method based on a PatchTST network, historical temperature data of the battery can be fully utilized, strong modeling capability of the PatchTST network is combined, accurate prediction of a future temperature change trend of the battery is realized, through implementation of the application, the precision and real-time performance of new energy vehicle battery temperature prediction can be improved, reliable prediction information is provided for the battery thermal management system, and therefore the safety and endurance of the new energy vehicle are ensured.
[0123] Although the embodiments of the application have been shown and described, it is to be understood that the application is not limited to these embodiments. It will be obvious to a person skilled in the art that various changes, modifications, replacements and modifications can be made to these embodiments without departing from the principles and spirit of the application, and the scope of the application is defined by the appended claims and their equivalents.
Claims
1. A multi-period new energy vehicle data battery temperature prediction method based on a PatchTST network, characterized by: Specifically comprising the following steps: S1, historical data acquisition: acquire single-period environmental data, battery data and driving data related to the temperature change of new energy vehicle batteries under different working conditions in history, and acquire several groups of single-period data; S2, constructing a PatchTST model: constructing a PatchTST model and setting hyperparameters; S3, optimizing data preparation: data preprocessing is performed on single-period data, the single-period data is divided into a training set and a validation set according to a preset proportion, time sequence patches and position patches are made in units of time, and training set patch data and validation set patch data are acquired; S4, model training and optimization: the training set patch data and the validation set patch data corresponding to the multi-period data are used to jointly train and optimize the PatchTST model, and an optimal PatchTST model is acquired; S5, battery temperature prediction: inputting new battery temperature related data into the optimal PatchTST model to obtain a predicted battery temperature; S6, temperature control strategy adjustment: formulating a temperature control strategy corresponding to the temperature environment, and adopting a corresponding temperature control strategy for battery temperature control according to the predicted temperature; The PatchTST model comprises an input layer, a Patch Embedding layer, a Transformer encoding layer, a straightening and linear attention, an output layer and a loss function; The input layer is used to receive preprocessed temperature related data; The Patch Embedding layer is used to divide time sequence data into multiple small blocks and embed each small block into a high-dimensional space; The Transformer encoding layer is used to capture long-distance dependency relationships and local features in time sequence data; The output layer is used to output a predicted temperature value; The loss function is used to evaluate the accuracy of the prediction results of the PatchTST model; In S4, when the PatchTST model is jointly trained and optimized, adaptive weight setting is performed on single-period data according to data length and working condition, and a global optimal solution search method is used to jointly correct PatchTST network model parameters; The adaptive weight setting formula comprises: wherein, is an adaptive weight, is an impact factor, used to measure the impact of the total length of each period data on the PatchTST model, is an adjustment factor, used to adjust the impact of different working conditions on the PatchTST model, is a focus parameter, determined by the number of working condition categories; For the first The influence of the length of the new energy vehicle data on the adjustment factor, the specific calculation method includes: In the formula, is the first period data length, is the maximum value of the period length among all data of the new energy vehicle. The influence factors are solved by the following method: Where, Yes The result after normalization using the tanh function.
2. The multi-period new energy vehicle data battery temperature prediction method based on the PatchTST network according to claim 1, characterized in that: The hyperparameters in S2 comprise basic configuration hyperparameters, data loading hyperparameters, prediction task configuration hyperparameters, PatchTST model specific parameters, Formers related hyperparameters, model training and optimization hyperparameters and hardware resource allocation hyperparameters; The basic configuration hyperparameters comprise a random seed, a state identifier and a model identifier; The data loading hyperparameters comprise a file directory, a data type, a feature type, a target identifier and a coding frequency; The prediction task configuration hyperparameters comprise an input sequence length, a start token length and a prediction sequence length; The PatchTST model specific parameters comprise a fully connected layer dropout size, an attention head dropout size, a block length, a step and a decomposition kernel size; The Formers-related hyperparameters include an encoder input size, a decoder output size, an output size, a model dimension, a number of attention heads, a number of encoding layers, a number of decoding layers, a feedforward network dimension, and a moving average window size. The model training and optimization hyperparameters include an activation function, a number of training epochs, a batchsize size, an optimizer learning rate, a loss function, and a learning rate adjustment method. The hardware resource allocation hyperparameters include whether to use a GPU, a GPU number, and whether to use multiple GPUs.
3. The multi-period new energy vehicle data battery temperature prediction method based on the PatchTST network according to claim 1, characterized in that: The data preprocessing in the S3 includes feature deduplication, feature screening, feature merging, data division, normalization, and random shuffling.
4. The multi-period new energy vehicle data battery temperature prediction method based on the PatchTST network according to claim 3, characterized in that: The manner of dividing a plurality of groups of single-period data into a training set and a validation set according to a preset ratio in the S3 includes: C1 = C 总 x a C2 = C 总 - C1 P1 = [0, C1] P2 = [C1 - C 3, C1 + C2] In the formula, C 总 C1 is the length of the training set, a is a preset ratio, a = 0.6-0.95, C2 is the length of the verification set, C3 is the length of the input sequence, P1 is the training set intercept position, and P2 is the verification set intercept position.
5. The multi-period new energy vehicle data battery temperature prediction method based on the PatchTST network according to claim 1, characterized in that: The output layer of the PatchTST model adopts a fully connected layer to output a predicted temperature value. During model training, the model parameters are optimized through a back propagation algorithm, and regularization processing is performed.
Citation Information
Patent Citations
Battery SOH estimation method based on Ada-MLP and PatchTST model
CN118465551A
Multi-source data fused new energy vehicle battery temperature combination model prediction method
CN118520429A