Multi-period new energy automobile data battery temperature prediction method based on PatchTST network

Through the multi-phase new energy vehicle data battery temperature prediction method based on the PatchTST network, the problem of inaccurate battery temperature prediction in the existing technology is solved, and the accurate prediction of the future temperature change trend of the battery is achieved, and the accuracy and real-time prediction are improved.

CN120178041AActive Publication Date: 2025-06-20SUZHOU BLACK SHIELD ENVIRONMENTAL CO LTD

Patent Information

Application Number
CN202510254908.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2025-06-20
Estimated Expiration
2045-03-05

AI Technical Summary

Technical Problem

The prior art is difficult to accurately predict the complex changes in battery temperature in new energy vehicles, especially when there is interruption and jumpiness in battery temperature data, and common prediction methods are susceptible to noise, resulting in overfitting.

Method used

Using a multi-phase new energy vehicle data battery temperature prediction method based on the PatchTST network, the PatchTST model is constructed to jointly train and verify the data related to historical battery temperature changes. The Transformer encoding layer is used to capture the long-distance dependence and local features in the time series data, and the data is divided into multiple small blocks through the Patch Embedding layer to reduce the computational complexity.

Benefits of technology

It realizes accurate prediction of the future temperature change trend of the battery, improves the accuracy and real-timeness of battery temperature prediction of new energy vehicle, reduces the computing power and power resource consumption during the training process, and adapts to the real-timeness and hardware configuration requirements of battery temperature prediction of new energy vehicle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120178041A_ABST
    Figure CN120178041A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-stage new energy automobile data battery temperature prediction method based on a PatchTST network, relates to the technical field of new energy automobiles, and effectively solves the problem that the multi-stage new energy automobile data is discontinuous and cannot jointly use the PatchTST network to predict the battery temperature. According to the multi-period new energy automobile data battery temperature prediction method based on the PatchTST network, time sequence blocks formed by segmentation are used as input, and each time sequence block captures local region information in new energy battery temperature, so that a PatchTST model can pay attention to characteristics of different regions to identify special behaviors of different sequences, and the prediction accuracy of the new energy automobile data battery temperature is improved. The PatchTST network optimization is carried out by combining the multi-period new energy automobile data, the battery temperature prediction model adapted to various environments and various working conditions is obtained, the generalization performance is high, the complex mode and long-distance dependency relationship in the battery temperature data can be fully captured, and the accurate prediction of the future temperature change trend of the battery is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of new energy vehicles, and particularly to a multi-phase new energy vehicle data battery temperature prediction method based on the PatchTST network. Background Art

[0002] As an important part of future transportation, the performance and safety of the battery system of new energy vehicles are crucial. Battery temperature is one of the key factors affecting battery performance. Too high or too low temperature may damage the battery, affecting its service life and safety. Therefore, accurately predicting the battery temperature and taking effective thermal management measures are of great significance for ensuring the safe operation of new energy vehicles.

[0003] In recent years, deep learning technology has achieved remarkable results in various fields with its powerful data processing and pattern recognition capabilities. As a new type of deep learning architecture, the Transformer model has demonstrated excellent performance in fields such as natural language processing, image recognition, and time series analysis. The PatchTST (Patch-based Transformer for Time Series) network is an application of the Transformer model in the field of time series analysis. By dividing time series data into multiple small blocks (Patches) and using the Transformer model to process these small blocks, efficient modeling and prediction of time series data are achieved.

[0004] The battery temperature data of new energy vehicles has its own unique characteristics. During its use, it often drives for a period of time, stops driving when reaching the destination, charges or rests, and then drives again. During the two driving periods, its data is discontinuous and there are jumps. The battery temperature change within the same period of new energy vehicles is related to time, but the battery temperature change in different periods is independent of the size of the time interval. Common processing methods such as LSTM, grey model, convolutional neural network, ARIMA, etc. adopt point-by-point prediction methods, which do not divide the energy storage battery data into blocks and do not analyze this discontinuous characteristic. Their feature processing often uses the method of channel mixing. The battery temperature data change of new energy vehicles is related to factors such as the external environment, vehicle driving conditions, and electricity demand, belonging to a multi-variable prediction method, and different variable data have different change laws. However, previous methods often project all-dimensional vector information into the embedding space. When there is noise in one channel, it often affects other channels and is prone to overfitting.

[0005] To use the advanced Patch strategy in the battery temperature prediction of new energy vehicles, direct Patch operations can be performed on all periods of data, or interpolation methods can be used, or only single-period driving data can be processed. However, analyzing only single-period data is difficult to reflect the complex change process in the battery temperature change of electric vehicles; using interpolation methods or directly performing Patch operations does not conform to the temperature change law of electric vehicles, and the vehicle temperature prediction is inaccurate. How to handle the discontinuous positions is the current difficulty. The multi-period new energy battery temperatures do not have time series characteristics. In order to migrate the Patch strategy to the battery temperature prediction of new energy vehicles, a battery temperature prediction method for multi-period new energy vehicle data based on the PatchTST network is proposed, a PatchTST model is constructed, and all the collected historical data related to the battery temperature change is jointly trained and verified to achieve accurate prediction of the future temperature change trend of the battery and provide reliable prediction information for the battery thermal management system. Summary of the Invention

[0006] Aiming at the deficiencies of the prior art, the present invention provides a battery temperature prediction method for multi-period new energy vehicle data based on the PatchTST network, which solves the problems raised in the above background technology.

[0007] To achieve the above objectives, the present invention is realized through the following technical solutions: A battery temperature prediction method for multi-period new energy vehicle data based on the PatchTST network specifically includes the following steps:

[0008] S1. Historical data acquisition: Acquire single-period environmental data, battery data, and driving data related to the battery temperature change of new energy vehicles under different working conditions, and obtain several groups of single-period data;

[0009] S2. Construct the PatchTST model: Construct the PatchTST model and perform hyperparameter settings;

[0010] S3. Optimize data preparation: Perform data preprocessing on the single-period data, divide the single-period data into a training set and a validation set according to a preset ratio, and make time-series Patches and position Patches in units of time to obtain training set Patch data and validation set Patch data;

[0011] S4. Model training and optimization: Use the training set Patch data and validation set Patch data corresponding to the multi-period data to jointly train and optimize the PatchTST model to obtain the optimal PatchTST model;

[0012] S5. Battery temperature prediction: Input the new battery temperature-related data into the optimal PatchTST model to obtain the predicted battery temperature;

[0013] S6. Temperature control strategy adjustment: Develop a temperature control strategy for the corresponding temperature environment and adopt the corresponding temperature control strategy according to the predicted temperature to control the battery temperature.

[0014] The present invention is further configured that: the PatchTST model includes an input layer, a Patch Embedding layer, a Transformer encoding layer, a flattening 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 the 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 results of the PatchTST model.

[0020] The present invention is further configured that: 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 status 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 marker length, and a prediction sequence length;

[0024] The PatchTST model specific parameters include the dropout size of the fully connected layer, the dropout size of the attention head, the block length, the stride, and the decomposition kernel size;

[0025] The Formers-related hyperparameters include an encoder input size, a decoder output size, an output size, a model dimension, the number of attention heads, the number of encoding layers, the number of decoding layers, the feed-forward network dimension, and a moving average window size;

[0026] The hyperparameters for model training and optimization include activation function, number of training epochs, batch size, optimizer learning rate, loss function, and learning rate adjustment method;

[0027] The hyperparameters for hardware resource allocation include whether to use GPU, GPU number, and whether to use multiple GPUs.

[0028] The present invention is further configured such that the data preprocessing in S3 includes: feature deduplication, feature screening, feature merging, data partitioning, normalization, and random shuffling.

[0029] The present invention is further configured such that the method for dividing several 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 the single-period data, C1 is the length of the training set, a is the 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 intercept position of the training set, and P2 is the intercept position of the validation set.

[0035] The present invention is further configured such that when jointly training and optimizing the PatchTST model in S4, an adaptive weight is formulated for the single-period data according to the data length and working conditions, and the PatchTST network model parameters are jointly corrected using a global optimal solution search method.

[0036] The present invention is further configured such that the formula for setting the adaptive weight 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 the influence factor for measuring the influence of the total length of each period of data on the PatchTST model, (1 - c t ) γis a regulation factor used to regulate the influence of different working conditions on the PatchTST model, and γ is a focusing parameter determined by the number of working condition categories;

[0039] α t is the influence of the data length of new energy vehicles in the t-th period on the regulation factor, and the specific calculation method includes:

[0040]

[0041] In the formula, P t is the data length in the t-th period, and max(P) is the maximum value of the number of periods in all the data of new energy vehicles;

[0042] b t is an influence factor, and its solution method includes:

[0043]

[0044] In the formula, b t is the result of normalizing c t using the tanh function.

[0045] The present invention is further configured that: the output layer of the PatchTST model uses a fully connected layer to output the predicted temperature value, and during model training, the model parameters are optimized through the backpropagation algorithm and regularization processing is performed.

[0046] The present invention provides a method for predicting the battery temperature of multi-period new energy vehicle data based on the PatchTST network. It has the following beneficial effects:

[0047] (1) By using the segmented time series blocks as inputs, each time series block captures the local area information in the new energy battery temperature, enabling the PatchTST model to focus on the characteristics of different regions. Utilizing the feature of independent channels in PatchTST, it can effectively resist the influence of noise in each channel. Different channels will have different attention score distributions, enabling the model to identify the special behaviors of different sequences. The PatchTST network is optimized by jointly using multi-period new energy vehicle data to obtain a battery temperature prediction model suitable for 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 achieve accurate prediction of the future temperature change trend of the battery.

[0048] (2) The present invention implements batch processing by dividing it into multiple small pieces. The total amount of samples used in the training process changes from the size of the overall dataset to the result obtained by dividing the dataset size by the step size of each batch processing. Under the same backtracking window, the calculation of the attention map and the memory usage show a quadratic decrease, significantly reducing the computing power required during the training process and the consumption of server power resources, and better meeting the real-time and hardware configuration requirements for new energy vehicle battery temperature prediction.

[0049] (3) The present invention makes full use of the historical temperature data of the battery and combines the PatchTST network to accurately predict the future temperature change trend of the battery, improving the accuracy and real-time performance of new energy vehicle battery temperature prediction, providing reliable prediction information for the battery thermal management system, and thus ensuring the safety and endurance of new energy vehicles. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 is a flowchart of the battery temperature prediction method for multi-period new energy vehicle data based on the PatchTST network in an embodiment of the present invention;

[0051] Figure 2 is a comparison schematic diagram of the predicted temperature and the actual measured temperature in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention.

[0053] Please refer to Figure 1-2 , the embodiments of the present invention provide the following technical solutions:

[0054] Embodiment 1

[0055] A battery temperature prediction method for multi-period new energy vehicle data based on the PatchTST network specifically includes the following steps:

[0056] 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 historical working conditions, and obtain several groups of single-period data;

[0057] S2. Construct a PatchTST model: Construct a PatchTST model, which includes an input layer, a PatchEmbedding layer, a Transformer encoding layer, a flattening and linear attention, an output layer, and a loss function;

[0058] The input layer is used to receive the preprocessed temperature-related data;

[0059] The Patch Embedding layer is used to divide the time series data into multiple small pieces and embed each small piece into a high-dimensional space;

[0060] The Transformer encoding layer is used to capture the long-range dependencies and local features in the time series data;

[0061] The output layer is used to output the predicted temperature value. The output layer uses 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 prediction results of the PatchTST model.

[0063] And hyperparameter settings are carried out. The hyperparameters 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;

[0064] The basic configuration hyperparameters include random seed, status flag, 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 marker length, and prediction sequence length;

[0067] The PatchTST model specific parameters include fully connected layer dropout size, attention head dropout size, block length, stride, 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, feed-forward network dimension, and moving average window size;

[0069] The model training and optimization hyperparameters include activation function, number of training epochs, 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 multiple GPUs.

[0071] S3. Optimize data preparation: Perform data preprocessing on single-period data including feature deduplication, feature screening, feature merging, data partitioning, normalization, and random shuffling. Divide the single-period data into a training set and a validation set according to a preset ratio. The specific partitioning methods include:

[0072] C1 = C 总 × 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 truncation position of the training set, and P2 is the truncation position of the validation set.

[0077] Make time - series Patches and position Patches in units of time to obtain training - set Patch data and validation - set Patch data;

[0078] S4. Model training and optimization: Use the training - set Patch data and validation - set Patch data corresponding to multiple - period data to jointly train and optimize the PatchTST model. During model training, input the data of each period into the pre - constructed PatchTST network, and the predicted battery temperature value of the current period can be obtained. The loss value can be calculated using the predicted temperature value and the corresponding true battery temperature. Since the data lengths and working conditions of each period of new - energy vehicles are different, to avoid under - fitting, it is necessary to divide according to the data length and working conditions, set corresponding weights, design an adaptive loss function to automatically amplify the weights of the minority classes, and use the search method for the global optimal solution to jointly correct the PatchTST network model parameters to obtain the optimal PatchTST model.

[0079] Further explanation, the formula for setting the adaptive weight includes:

[0080] a t = b t (1 - α t ) γ t = 1, 2, …, n

[0081] In the formula, a t is the adaptive weight, b t is the influence factor, used to measure the influence of the total length of each - period data on the PatchTST model, (1 - c t ) γ is the adjustment factor, used to adjust the influence of different working conditions on the PatchTST model, γ is the focusing parameter, determined by the number of working - condition categories;

[0082] α tThe influence of the data length of new energy vehicles in the t-th period on the adjustment factor, and the specific calculation method includes:

[0083]

[0084] In the formula, P t is the data length in the t-th period, and max(P) is the maximum value of the period length in all the data of new energy vehicles;

[0085] b t is the influence factor, and its solution method includes:

[0086]

[0087] In the formula, b t is the result of normalizing c t using the tanh function.

[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: Develop a temperature control strategy for the corresponding temperature environment, and adopt the corresponding temperature control strategy according to the predicted temperature to control the battery temperature.

[0090] Example 2

[0091] A method for predicting the battery temperature of multi-period new energy vehicle data based on the PatchTST network, specifically including the following steps:

[0092] S1. Historical data acquisition: 38 sets of real driving data of BMW new energy vehicles collected between 2019 and 2020 are used. These data are from new energy vehicles equipped with multiple sensors. The driving data are collected in real time through the in-vehicle data acquisition system and stored in the database. The obtained data set contains the following 47 types of parameters: time [seconds], 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 at intake [°C], coolant flow +500 [l / h], heat exchanger temperature [°C], cabin temperature sensor [°C], coolant heater intake temperature [°C], coolant heater outlet temperature [°C], heat exchanger outlet temperature [°C], defrost left lateral temperature [°C], defrost right lateral temperature [°C], defrost central temperature [°C], defrost central left temperature [°C], defrost central right temperature [°C], footwell vent temperature [°C], footwell vent co-driver temperature [°C], footwell vent temperature [°C] co-driver's cab temperature [°C], co-driver's cab foot temperature [°C], co-driver's cab head temperature [°C], driver's head partial temperature [°C], vent right side temperature [°C], vent central right side temperature [°C], vent central left side temperature [°C], vent left side temperature [°C].

[0093] S2. Construct the PatchTST model: Construct the PatchTST model, which includes an input layer, a PatchEmbedding layer, a Transformer encoding layer, flattening and linear attention, an output layer, and a loss function;

[0094] The input layer is used to receive the preprocessed temperature-related data. The shape of the input data X is [Batch, Inputlength, Channel], where 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 pieces and embed each small piece into a high-dimensional space, specifically including temporal encoding and positional encoding: Temporal encoding mainly includes the moving average block and the sequence decomposition block of the time series. Among them, temporal encoding is a PyTorch module used to decompose the time series into a trend term and a residual term. In this embodiment, the moving average is calculated using the moving average block as the trend, and then the trend is subtracted from the original sequence to obtain the residual. According to the temporal 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, a positional encoding function can be made. The positional encoding process includes: initializing the position matrix, generating position indices, and calculating the scaling factor. Then, the sine and cosine functions are applied to the position indices and the scaling factor respectively, and the results are stored at the index positions of the positional encoding function;

[0096] The Transformer encoding layer is used to capture the long-range dependencies and local features in the time series data using the self-attention mechanism. In this embodiment, the trend and the residual are respectively input into the corresponding Transformer encoding layers for processing. The Transformer encoding layer is set as follows: Initialize various parameters of the model, including the number of input channels, the context window size, the target window size, the Patch length, the stride, etc.; Calculate the number of Patches, and create the corresponding head network 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] Analyze the user's battery temperature prediction accuracy and real-time requirements, hardware configuration, and data volume size, and set 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 according to the above situations, as shown in Table 1 specifically:

[0100]

[0101]

[0102] Table 1

[0103] S3. Optimize data preparation: Perform data preprocessing on single-phase data. Preprocess the collected temperature data, including feature deduplication, feature screening, feature merging, data partitioning, normalization, and random shuffling. In this embodiment, through the integrity and logical consistency check of all collected features, it is found that the feature "speed [km / h]" is inconsistent before and after. Therefore, this feature is removed. In this embodiment, the original data time interval is 0.1 second. To meet the user's requirement of second-level response, average calculation is performed for every 10 data, and the time unit is converted into seconds. To screen out the features most relevant to the temperature change of new energy vehicle batteries, the correlation between all feature vectors and the battery temperature is calculated. With the condition that the correlation coefficient is greater than 0.2, 20 feature vectors are screened out, specifically as follows: time [s], throttle opening [%], battery voltage [V], battery temperature [°C], maximum battery temperature [°C], CAN heating power [KW], LIN heating power [W], requested heating power [W], heater voltage [V], heater current [A], ambient temperature [°C], ambient temperature sensor [°C], heater core coolant temperature [°C], coolant inlet temperature [°C], cockpit temperature sensor [°C], coolant heater outlet temperature [°C], driver's foot temperature [°C], co-pilot's foot temperature [°C], co-pilot's head temperature [°C], driver's head temperature [°C]. This embodiment is an invention related to battery temperature prediction. Therefore, in this embodiment, the two target feature variables, battery temperature [°C] and maximum battery temperature [°C], are excluded.

[0104] After the above processing, if the total data length is less than the input sequence length plus the start marker length set in S2, then discard this phase of data. In this embodiment, there are 8 phases that need to be discarded as follows: Phase 10, Phase 11, Phase 13, Phase 24, Phase 27, Phase 29, Phase 30, and Phase 31. In this embodiment, 80% of the data in each phase is used as the training set, and the remaining 20% of the data is used as the training set. To save data and avoid the data length of the validation set being less than the input sequence length plus the start marker length set in S2, a position truncation setting is specifically made for the data. Among them, the truncation position of the training set is [0, C1], and the truncation position of the validation set is [C1 - C3, C1 + C2].

[0105] To accelerate the model convergence speed and enhance the algorithm stability, the data normalization method is adopted to convert data with different dimensions into 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 series patches are made for time units. The time series units adopted are six scales: year, month, day, hour, minute, and second. In the temperature prediction of new energy electric vehicles, it is sliced into patches according to the window size and step length. Among them, the patch length is P, and the step length is S. Through the patch strategy, the number of inputs can be reduced from L to approximately L / S. Therefore, the memory usage and computational complexity of the attention mechanism are reduced quadratically.

[0106] S4. Model training and optimization: The PatchTST model is jointly trained and optimized using the training set patches and validation set patches corresponding to multiple periods of data to obtain the optimal PatchTST model. Specifically:

[0107] A1. Initialize the preprocessing parameters, including specifying the root directory path and data type. During model training, first create and load the training and validation sets, set training strategies such as the learning rate scheduler, early stopping, and Dropout to prevent model overfitting. For each training epoch, traverse the training data loader and perform the following steps:

[0108] 1) Load the data into the device, which is a GPU or CPU;

[0109] 2) Perform forward propagation calculation and output according to the model type and data format.

[0110] 3) Calculate the loss for each period through the processed temperature data and the corresponding label data, i.e., the actual temperature value, calculate the length of each period of data, and count the working conditions. Set the weights through adaptive weights, and jointly correct the PatchTST network model parameters using the global optimal solution search method. In this embodiment, the output layer uses a fully connected layer to output the predicted temperature value;

[0111] 4) Perform backpropagation to update the model parameters;

[0112] 5) Record the training loss and adjust the learning rate as needed;

[0113] 6) Use the early stopping EarlyStopping strategy to save the best model state according to the validation loss, where patience is 100.

[0114] A2. Create a validation data loader and use it 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 based on the validation loss. In this embodiment, to comprehensively predict the temperature of new energy batteries, each period is verified. The validation set is the last 20% of the data in each period. In this embodiment, the mean squared error MSE is 0.178905, the mean absolute error MAE is 0.201334, and the residual standard error RSE is 0.26011. It can be seen from the experimental results that the accuracy indicators in the present invention are all less than 0.3, with high accuracy and good prediction effects. Finally, save the model parameters after training 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: Develop a temperature control strategy corresponding to the temperature environment and adopt the corresponding temperature control strategy based on the predicted temperature to control the battery temperature. For example, when it is predicted that the battery temperature will exceed the safety threshold, start the cooling system to lower the battery temperature; or when it is predicted that the battery temperature will be too low, adjust the charging and discharging strategy of the battery to increase the battery temperature.

[0117] In this embodiment, the data of the last period is used as the input to predict the development trend of the next 96 time steps. The prediction results are as shown in the appendix Figure 2 As shown, where the light gray circles represent the correct temperature values, and the black solid-line pentagrams represent the predicted values. It can be easily seen that the difference between the black solid line and the light-colored circles is small, which indicates that the predicted temperature in this example is close to 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 III

[0119] The difference between this embodiment and Embodiment II is that in the feature extraction step, in addition to extracting time series features, driving features, and battery physical data, more external factor features are introduced, such as target distance, wind speed, light intensity, etc. These external factor features can be obtained through on-vehicle sensors or external meteorological data. Inputting the external factor features together with other features into the PatchTST network model can further improve the accuracy of model prediction.

[0120] Embodiment IV

[0121] This embodiment provides an implementation method of a new energy vehicle battery temperature prediction system based on the PatchTST network. The system includes a data acquisition module, a data preprocessing module, a feature extraction module, a PatchTST network model construction module, a model training module, a temperature prediction module, etc. The data interaction and processing flow between each module are the same as the steps described in Embodiment 2. By integrating this system into the battery management system of a new energy vehicle, real-time prediction and monitoring of the battery temperature can be achieved, providing reliable prediction information for the battery thermal management system.

[0122] In summary, the present invention provides a multi-period new energy vehicle data battery temperature prediction method based on the PatchTST network, which can make full use of the historical temperature data of the battery and combine the powerful modeling ability of the PatchTST network to accurately predict the future temperature change trend of the battery. By implementing the present invention, the accuracy and real-time performance of the new energy vehicle battery temperature prediction can be improved, providing reliable prediction information for the battery thermal management system, thereby ensuring the safety and endurance of the new energy vehicle.

[0123] Although the embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A multi-period new energy vehicle data battery temperature prediction method based on PatchTST network, characterized by: The specific steps include: S1. Historical data acquisition: Acquire single-period environmental data, battery data, and driving data related to the temperature changes of new energy vehicle batteries under different historical working conditions, and acquire several groups of single-period data; S2. Build PatchTST model: Build PatchTST model and set hyperparameters; S3. Optimize data preparation: perform data preprocessing on single-period data, divide the single-period data into a training set and a validation set according to a preset ratio, make time series patches and position patches in units of time, and obtain training set patch data and validation set patch data; S4, model training and optimization: Use the training set Patch data and validation set Patch data corresponding to multiple periods of data to jointly train and optimize the PatchTST model to obtain the optimal PatchTST model; S5. Battery temperature prediction: input new battery temperature related data into the optimal PatchTST model to obtain the battery predicted temperature; S6. Adjustment of temperature control strategy: Formulate a temperature control strategy for the corresponding temperature environment, and adopt the corresponding temperature control strategy to control the battery temperature according to the predicted temperature.

2. According to claim 1, a multi-period new energy vehicle data battery temperature prediction method based on PatchTST network is characterized in that: The PatchTST model includes an input layer, a Patch Embedding layer, a Transformer encoding layer, straightening and linear attention, an output layer, and a loss function; The input layer is used to receive the pre-processed temperature-related data; 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; The Transformer encoding layer is used to capture long-distance dependencies and local features in time series data; The output layer is used to output the predicted temperature value; The loss function is used to evaluate the accuracy of the prediction results of the PatchTST model.

3. According to claim 1, a multi-period new energy vehicle data battery temperature prediction method based on PatchTST network is characterized in that: 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; The basic configuration hyperparameters include random seed, state identifier and model identifier; The data loading hyperparameters include file directory, data type, feature type, target identifier and encoding frequency; The prediction task configuration hyper parameters include input sequence length, start tag length and prediction sequence length; The PatchTST model-specific parameters include fully connected layer dropout size, attention head dropout size, block length, step size, and decomposition kernel size; 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; The model training and optimization hyperparameters include activation function, number of training cycles, batch size, optimizer learning rate, loss function and learning rate adjustment method; The hardware resource allocation hyperparameters include whether to use a GPU, a GPU number, and whether to use multiple GPUs.

4. According to claim 1, a multi-period new energy vehicle data battery temperature prediction method based on PatchTST network is characterized in that: The data preprocessing in S3 includes: feature deduplication, feature screening, feature merging, data partitioning, normalization and random shuffling.

5. According to claim 4, a multi-period new energy vehicle data battery temperature prediction method based on PatchTST network is characterized in that: The method of dividing a plurality of groups of single-period data into training sets and validation sets according to a preset ratio in S3 includes: C1=C 总 ×a C2=C 总 -C1 P1=[0,C1] P2=[C1-C 3, C1+C2] In the formula, C 总 is the total length of a single period of data, C1 is the length of the training set, a is the 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 cut position, and P2 is the validation set cut position.

6. The method for predicting battery temperature of multi-period new energy vehicle data based on PatchTST network according to claim 1 is characterized in that: When the PatchTST model is jointly trained and optimized in S4, adaptive weights are formulated for single-period data according to data length and working conditions, and the PatchTST network model parameters are jointly corrected using a global optimal solution search method.

7. The method for predicting battery temperature of multi-period new energy vehicle data based on PatchTST network according to claim 6 is characterized in that: The adaptive weight setting formula includes: a t =b t (1-a t ) γ t=1,2,L,n In the formula, a t is the adaptive weight, b t is the impact factor, which is used to measure the impact of the total length of each period of 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, and γ is the focusing parameter, which is determined by the number of working condition categories; α t The influence of the length of the new energy vehicle data in the tth period on the adjustment factor is calculated by: Where P t is the length of the t-th period data, and max(P) is the maximum period length of all the data of new energy vehicles; b t is the influencing factor, and its solution methods include: Where b t It is for c t The result after normalization using the tanh function.

8. According to claim 2, a multi-period new energy vehicle data battery temperature prediction method based on PatchTST network is characterized in that: 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 through a back propagation algorithm and regularization 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

  • Smart tie for monitoring school students to predict from kidnappers

    IN202141001076A

Cited By

  • Performance detection method and device for thermal management system of electric vehicle

    CN120820857A