A pure electric vehicle remaining driving range prediction method based on real vehicle data

CN120207123BActive Publication Date: 2026-10-16KUNMING UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510283895.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-11
Publication Date
2026-10-16
Estimated Expiration
2045-03-11

AI Technical Summary

Technical Problem

目前基于数据驱动的方法在实车剩余行驶里程预测的研究较少,现有一些集成学习方法如随机森林回归算法、梯度提升回归算法用于里程预测但其模型的解释性较差、训练时间较长、超参数调节敏感、容易出现过拟合等问题,传统的LSTM训练时间长、难以处理长时间依赖、参数较多、在长时间序列数据中仍然可能会遇到梯度爆炸或梯度消失的情况

Benefits of technology

[0112]This invention utilizes Spearman correlation analysis based on real-world operating data of pure electric vehicles in low-temperature environments to select features relevant to vehicle mileage. Furthermore, it applies the whale optimization algorithm to a bidirectional long short-term neural network model to construct a model for estimating the remaining mileage of pure electric vehicles. This invention can directly extract highly correlated feature factors from the charging and discharging process, significantly reducing the number of features and effectively improving the training speed and accuracy of the model. The established model can accurately predict the remaining mileage for different vehicle models, demonstrating good generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120207123B_ABST
    Figure CN120207123B_ABST
Patent Text Reader

Abstract

The application discloses a pure electric vehicle residual driving range prediction method based on real vehicle data, and belongs to the fields of power batteries and new energy vehicles, and comprises the following steps: collecting real vehicle operation data of a pure electric vehicle under a low-temperature environment, complementing the data, and then pre-processing the data to obtain an actual state of charge; obtaining high-correlation features and real vehicle operation data sets of a residual driving range through vehicle endurance grade division and Spearman correlation analysis; performing hyperparameter optimization on a bidirectional long short-term neural network model of a residual adaptive gating mechanism through a whale optimization algorithm after the data sets are divided; training the optimized model by using a training set, predicting the residual driving range of the model by using a test set, and finally verifying the generalization of the model by using different vehicle types. The application reduces the number of features, effectively improves the training speed and accuracy of the model, and the established residual driving range estimation model can accurately predict the residual driving range of different vehicle types.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of power battery technology and new energy vehicles, and particularly relates to a method for predicting the remaining driving range of a pure electric vehicle based on real vehicle data. Background Technology

[0002] Lithium-ion batteries, with their advantages of long lifespan, fast charging speed, and no memory effect, have become the preferred energy storage solution for pure electric vehicles and hybrid electric vehicles, and have been widely adopted in electric vehicles. However, due to their chemical characteristics, lithium batteries experience reduced usable capacity and increased internal resistance at low temperatures, leading to reduced actual driving range and slower charging speeds in electric vehicles operating in cold environments. While the low-temperature degradation of batteries is unavoidable, automakers have made significant progress in technological breakthroughs in recent years. Consumers in cold-climate regions are increasingly accepting of new energy vehicles, and the number of new energy vehicles connected to the grid in these regions has maintained a rapid growth trend over the years. Accurately predicting the driving range of electric vehicles in low-temperature environments can enhance drivers' confidence in the vehicle's range, improve energy utilization, and is of great significance for the promotion and use of new energy vehicles in cold-climate regions.

[0003] Existing methods for predicting remaining driving range mainly include those based on battery SOC, historical energy consumption, model prediction, and data-driven methods. Battery SOC-based and historical energy consumption-based methods do not consider factors such as driving behavior and ambient temperature, resulting in low estimation accuracy. Model-based methods establish mathematical models of the battery and vehicle, leading to high computational complexity. Data-driven methods, however, only require data from electric vehicle charging and discharging segments to capture complex nonlinear relationships and achieve accurate prediction of remaining driving range. Currently, there is limited research on data-driven methods for predicting remaining driving range in real-world vehicles. Some ensemble learning methods, such as random forest regression and gradient boosting regression, are used for range prediction, but their models suffer from poor interpretability, long training times, sensitivity to hyperparameter tuning, and a tendency to overfit. Traditional LSTM methods have long training times, difficulty handling long-term dependencies, numerous parameters, and may still encounter gradient explosion or vanishing gradient issues in long-term data series. Summary of the Invention

[0004] To address the aforementioned issues, this invention provides a method for predicting the remaining driving range of pure electric vehicles based on real-vehicle data. By combining an improved Bi-LSTM algorithm with the whale optimization algorithm, the remaining driving range of electric vehicles in low-temperature environments can be predicted with high accuracy.

[0005] To solve the above technical problems, the following steps are specifically included:

[0006] S1. Collect real-world vehicle operation data of pure electric vehicles in low-temperature environments using open-source datasets;

[0007] Real-world vehicle operating data includes: vehicle status, charging status, vehicle speed, mileage, total current, total voltage, maximum battery voltage, minimum battery voltage, maximum battery temperature, and minimum battery temperature.

[0008] S2. Complete the collected real vehicle operation data, preprocess the completed data to obtain the actual charge state; classify the vehicle's range level through cluster analysis, and obtain highly correlated features with the remaining driving range through Spearman correlation analysis; normalize the highly correlated features to obtain the real vehicle operation dataset, and divide the real vehicle operation dataset into training set and test set.

[0009] The steps are as follows:

[0010] S2.1 Complete the dataset based on the obtained real vehicle data;

[0011] The completion method is as follows: Missing and outlier values ​​are detected in the real vehicle dataset. If missing or outlier values ​​are found, the outliers are deleted, and completion is performed using the level interpolation method. The interpolation calculation formula is as follows:

[0012]

[0013] In the formula, K t K represents the actual vehicle operation data at time t. t-1 This represents the actual vehicle operation data at the current time t-1; K t+1 This is the actual vehicle operation data at the current time t+1;

[0014] S2.2 Extract the current from the completed data and calculate the battery's actual state of charge (SOC). The calculation formula is as follows:

[0015]

[0016] In the formula, Ca represents the battery capacity; SOC t and SOC t-1 Represent the actual state of charge at time t and time t-1, respectively; η represents the Coulomb efficiency; i t Δt represents the current at time t; Δt represents the sampling time interval.

[0017] S2.3. Perform K-means cluster analysis on the vehicles based on their driving range. Vehicles that can travel a distance less than a first threshold under full charge conditions are classified as low-range vehicles; vehicles that can travel a distance greater than the first threshold but less than a second threshold are classified as medium-range vehicles; and vehicles that can travel a distance greater than the second threshold are classified as high-range vehicles. The first threshold is less than the second threshold.

[0018] S2.4. Spearman correlation coefficient analysis was performed on the divided vehicles to obtain the characteristics of high correlation with the remaining driving mileage.

[0019] The expression for Spearman's correlation coefficient analysis is as follows:

[0020]

[0021] In the formula, ρ is the Spearman correlation coefficient; d i The difference in rank between corresponding values ​​of two variables; n is the sample size.

[0022] The Spearman correlation coefficient analysis method was used to analyze the correlation between variables and remaining driving mileage in real vehicle operation data. Correlation features with Spearman correlation coefficients higher than the correlation threshold were selected. Data related to low temperature environment were selected as high correlation features and used as feature variables.

[0023] Highly relevant characteristics include: minimum voltage, discharge state of charge (SOC), and minimum temperature;

[0024] S2.5. The Min-Max method is used to normalize the highly correlated features to obtain the real vehicle operation dataset;

[0025] The normalized data range is [0,1], and the expression is as follows:

[0026]

[0027] In the formula, x n This represents the highly correlated features to be normalized; x min and x max represent the minimum and maximum data values ​​in the normalized data, respectively; x represents the result after normalization.

[0028] S2.6. Divide the real vehicle operation dataset into training set and test set according to the proportion.

[0029] S3. Construct a bidirectional long short-term neural network model (Bi-LSTM);

[0030] S3.1. The Bi-LSTM model consists of two independent LSTM layers. The first LSTM layer is used for forward propagation, and the second LSTM layer is used for backward propagation.

[0031] The core of an LSTM layer includes the input gate, forget gate, output gate, and cell state; the expression for the input gate at a single time step t is as follows:

[0032] i t =σ(W i .[h t-1 ,xt ]+b i );

[0033] C t ′=tanh(W C .[h t-1 ,x t ]+b C );

[0034] In the formula, i t It is the output of the input gate; σ is the Sigmoid activation function; W i and W C It is the weight matrix of the input gate and the candidate state; h t-1 It is the hidden state at time t-1; x t It is the input at the current moment; b i and b C It is the bias of the input gate and the candidate state;

[0035] The expression for the forget gate is as follows:

[0036] f t =σ(W f .[h t-1 ,x t ]+b f );

[0037] In the formula, f t It is the output of the forget gate; W f This is the weight matrix of the forget gate; b f It is the bias of the forgetting gate;

[0038] The expression for the output gate is as follows:

[0039] o t =σ(W o .[h t-1 ,x t ]+b o );

[0040] h t =o t .tanh(C t );

[0041] In the formula, o t The output of the output gate determines the current hidden state; W o This is the weight matrix of the output gate; b o It is the bias of the output gate; C t It represents the current state of the cell;

[0042] The expression for cell state is as follows:

[0043] Ct =f t .C t-1 +i t .C t ′;

[0044] In the formula, C t-1 It represents the cell state at time t-1;

[0045] S3.2 After the data is input into the Bi-LSTM, it is input into the first LSTM layer and the second LSTM layer respectively, and the data is spliced ​​at each time step t.

[0046] The first LSTM layer is used for forward propagation, and its expression is as follows:

[0047]

[0048] In the formula, It is the hidden state of the forward-propagating LSTM at time t; Forward propagation of the LSTM's hidden state at time t-1;

[0049] The second LSTM layer is used for reverse transmission, and its expression is as follows:

[0050]

[0051] In the formula, It is the hidden state of the reverse-transmission LSTM at time t; Reverse propagation of the hidden state of the LSTM at time t-1;

[0052] The expression for concatenating hidden states is as follows:

[0053]

[0054] In the formula, [,] is a vector concatenation operation, used to capture the dependencies between sequential data at the same time;

[0055] S4. Introduce a gate control mechanism into the bidirectional long short-term neural network model to construct a bidirectional long short-term neural network model network with residual adaptive gate control mechanism;

[0056] The construction steps are as follows:

[0057] S4.1. Add a gate variable to each Bi-LSTM layer to control whether residual connections are performed;

[0058] The gating variable expression is as follows:

[0059] r t =σ(W r .[O t-1 ,x t ]+br );

[0060] In the formula, r t It is a gating variable that determines whether residual connection is performed; W r and b r These are the weights and biases of the gated variables, used to train the gated variables;

[0061] S4.2. Set residual connections after each Bi-LSTM layer, as shown in the following expression:

[0062] O' t =Bi-LSTM(h) t-1 ,x t )+r t .x t ;

[0063] In the formula, O' t It is the final output of each Bi-LSTM layer; r t It is a gated variable, which obtains a value between 0 and 1 through a gating mechanism to control the strength of the residual connection; x t It is the input at the current moment;

[0064] S4.3 The gated variable controls whether residual join is performed through forward propagation, and updates the weight W of the gated variable through backpropagation. r and bias b r The steps are as follows:

[0065] S4.3.1 Initialize the weights W of the gating variables r and bias b r ;

[0066] S4.3.2 After each Bi-LSTM layer, the weights W of the gated variables are calculated. r and bias b r To determine whether to use residual join;

[0067] The judgment method is as follows:

[0068] When r t When = 1, residual connections are fully utilized;

[0069] When r t When = 0, residual connectivity is ignored;

[0070] When r t When the value is between 0 and 1, the residual connection is partially used, as shown in the following expression:

[0071] Residual connection output = r t ×Bi-LSTM input + current layer computation result;

[0072] S4.3.3, Update the weights W of the gating mechanism through backpropagation. r and bias b r ;

[0073] Backpropagation of gating variables: During training, the loss function is calculated based on the model's output and the true labels, and the weights W of the gating mechanism are updated through backpropagation. r and bias b r ;

[0074] During backpropagation, the gate variable r t The gradients are calculated and used to update the weights; these gradients are derived from the output of the Bi-LSTM and the network's final loss, progressively adjusting the gate weights W. r This allows it to better determine the role of residual connections;

[0075] Loss function calculation: The mean squared error (MSE) is used as the loss function L, and its calculation formula is as follows;

[0076]

[0077] In the formula, y t This is the final output of the model after passing through the fully connected layer; Indicates the actual label value; N represents the total number of batches; i represents the batch number;

[0078] During backpropagation, the gradient of the loss function is passed to the parameter weights W of the gate variable via the chain rule. r and bias b r Update;

[0079] The loss function affects the output y t The gradient calculation expression is as follows:

[0080]

[0081] Loss function with respect to gate variable r t The gradient calculation expression is as follows:

[0082]

[0083] Loss function with respect to W r and b r The gradient calculation expression is as follows:

[0084]

[0085] In the formula, z = W r .[h t-1 ,x t ]+b r ;

[0086] Update W using gradient descent. r and b r The expression is as follows:

[0087]

[0088] In the formula, w represents the learning rate; W' r Indicates the updated weight; b' r Indicates the updated bias;

[0089] S4.4. Perform residual concatenation between the input data and the output data of Bi-LSTM using the updated gating variables;

[0090] S4.5. The output obtained in S4.4 is mapped through a fully connected layer and then output.

[0091] The fully connected layer (FC layer) maps the output of the last time step to obtain the final output, as shown in the following expression:

[0092] y t =W FC .O tt +b FC ;

[0093] In the formula, y t This is the final output of the model after passing through the fully connected layer; O tt W represents the output after concatenating the output vectors of each layer; FC b represents the weights of the fully connected layer. FC This is used for biasing the fully connected layer.

[0094] S5. The hyperparameters of the bidirectional long short-term neural network model with residual adaptive gating mechanism are optimized using the whale algorithm. The steps are as follows:

[0095] S5.1 Set the hyperparameters to be optimized, including: number of hidden layers, number of hidden layer nodes, time step, number of batches, and number of training generations (epochs).

[0096] S5.2 Setting the search space for the whale algorithm;

[0097] The whale optimization algorithm requires defining the search space of hyperparameters and determining the minimum and maximum values ​​of the hyperparameters;

[0098] S5.3 Use the root mean square error (RMSE) to evaluate the quality of each set of hyperparameters in the search space;

[0099] The evaluation method is as follows: the root mean square error (RMSE) is used as the fitness function to evaluate the quality of each candidate solution; the smaller the RMSE, the better the solution.

[0100] The goal of the whale optimization algorithm is to find a set of hyperparameters from the hyperparameters after quality evaluation that minimizes the RMSE of the improved Bi-LSTM model.

[0101] S5.4. Perform a global search in the hyperparameter space using the whale optimization algorithm to find the optimal hyperparameter combination, and input the hyperparameter combination into the improved Bi-LSTM model.

[0102] The global search is conducted by simulating the hunting behavior of whales (encircling prey, spiral bubble net attack, random search);

[0103] Repeat step S5.4 until the maximum number of iterations is reached, and finally output the optimal combination of hyperparameters.

[0104] S6. Use the training set to train the optimized model to obtain the trained model;

[0105] S7. Use the test set to predict the remaining driving mileage of the model in S6, obtain the prediction results, evaluate the prediction results, and obtain the evaluation index.

[0106] Evaluation indicators include: coefficient of determination R-squared(R²) 2 The maximum absolute error (MAE) and root mean square error (RMSE) are expressed as follows:

[0107] R-squared:

[0108] Maximum absolute error:

[0109] Root mean square error:

[0110] In the formula, n' is the length of the test data; ii is the sequence number of the test data; y ii The remaining mileage is the actual value of the test data; The average remaining mileage for all test data; y iihat This represents the predicted remaining mileage from the test data.

[0111] The beneficial effects of this invention are:

[0112] This invention utilizes Spearman correlation analysis based on real-world operating data of pure electric vehicles in low-temperature environments to select features relevant to vehicle mileage. Furthermore, it applies the whale optimization algorithm to a bidirectional long short-term neural network model to construct a model for estimating the remaining mileage of pure electric vehicles. This invention can directly extract highly correlated feature factors from the charging and discharging process, significantly reducing the number of features and effectively improving the training speed and accuracy of the model. The established model can accurately predict the remaining mileage for different vehicle models, demonstrating good generalization ability. Attached Figure Description

[0113] Figure 1 This is a flowchart of the steps of the present invention;

[0114] Figure 2 This is a schematic diagram illustrating the process of implementing the present invention;

[0115] Figure 3 This is a schematic diagram of the bidirectional long short-term neural network model of the residual adaptive gating mechanism of the present invention;

[0116] Figure 4 This is a schematic diagram of the hyperparameters of the bidirectional long short-term neural network model network for optimizing the residual adaptive gating mechanism using the whale optimization algorithm of this invention;

[0117] Figure 5 The diagram shows the predicted remaining driving range of vehicles; (a) represents the predicted remaining driving range of vehicles with low driving range; (b) represents the predicted remaining driving range of vehicles with medium driving range; and (c) represents the predicted remaining driving range of vehicles with high driving range. Detailed Implementation

[0118] The present invention will be further described in detail below with reference to specific embodiments.

[0119] like Figure 1 and Figure 2 As shown, a method for predicting the remaining driving range of a pure electric vehicle based on real vehicle data includes the following steps:

[0120] S1. Collect real-world vehicle operation data of pure electric vehicles in low-temperature environments using open-source datasets;

[0121] Real-world vehicle operating data includes: vehicle status, charging status, vehicle speed, mileage, total current, total voltage, maximum battery voltage, minimum battery voltage, maximum battery temperature, and minimum battery temperature.

[0122] In this embodiment, the open-source dataset consists of real-world driving data of 30 pure electric vehicles with different ranges provided by the 2024 National College New Energy Vehicle Big Data Innovation and Entrepreneurship Competition, recording charging and discharging data in real time from January to March.

[0123] S2. Complete the collected real vehicle operation data, preprocess the completed data to obtain the actual charge state; classify the vehicle's range level through cluster analysis, and obtain highly correlated features with the remaining driving range through Spearman correlation analysis; normalize the highly correlated features to obtain the real vehicle operation dataset, and divide the real vehicle operation dataset into training set and test set.

[0124] The steps are as follows:

[0125] S2.1 Complete the dataset based on the obtained real vehicle data;

[0126] The completion method is as follows: Missing and outlier values ​​are detected in the real vehicle dataset. If missing or outlier values ​​are found, the outliers are deleted, and completion is performed using the level interpolation method. The interpolation calculation formula is as follows:

[0127]

[0128] In the formula, K t This represents the actual vehicle operation data at time t; K t-1 This represents the actual vehicle operation data at the current time t-1; K t+1 This is the actual vehicle operation data at the current time t+1;

[0129] S2.2 Extract the current from the completed data and calculate the battery's actual state of charge (SOC). The calculation formula is as follows:

[0130]

[0131] In the formula, Ca represents the battery capacity; SOC t and SOC t-1 Represent the actual state of charge at time t and time t-1, respectively; η represents the Coulomb efficiency; i t The value Δt represents the current at time t, and is 1; Δt represents the sampling time interval.

[0132] S2.3. Perform K-means cluster analysis on the vehicles based on their driving range. Vehicles that can travel a distance less than a first threshold under full charge conditions are classified as low-range vehicles; vehicles that can travel a distance greater than the first threshold but less than a second threshold are classified as medium-range vehicles; and vehicles that can travel a distance greater than the second threshold are classified as high-range vehicles. The first threshold is less than the second threshold.

[0133] The first threshold is set to 200 km; the second threshold is set to 500 km.

[0134] Vehicles with a range of S≤200KM are classified as low-range vehicles, vehicles with a range of 200≤S≤500KM are classified as medium-range vehicles, and vehicles with a range of S≥500KM are classified as high-range vehicles.

[0135] S2.4. Spearman correlation coefficient analysis was performed on the divided vehicles to obtain the characteristics of high correlation with the remaining driving mileage.

[0136] The expression for Spearman's correlation coefficient analysis is as follows:

[0137]

[0138] In the formula, ρ is the Spearman correlation coefficient, ranging from -1 to 1; d i The difference in rank between corresponding values ​​of two variables; n is the sample size.

[0139] The Spearman correlation coefficient analysis method was used to analyze the correlation between variables and remaining driving mileage in real vehicle operation data. Correlation features with Spearman correlation coefficients higher than the correlation threshold were selected. Data related to low temperature environment were selected as high correlation features and used as feature variables.

[0140] The correlation threshold is set to 0.6;

[0141] Highly relevant characteristics include: minimum voltage, discharge state of charge (SOC), and minimum temperature;

[0142] In this embodiment, taking vehicle number 6 as an example, the correlation between speed and remaining driving range is only 0.04, and the correlation between total current and remaining driving range is only 0.25, so these are removed, as shown in Table 1:

[0143] Table 1: Spearman correlation coefficient of car No. 6

[0144]

[0145] As can be seen from Table 1, the data related to low temperature environment selected from the correlation features are: minimum voltage, discharge SOC, and minimum temperature, which meet the selection criteria for high correlation features.

[0146] S2.5. The Min-Max method is used to normalize the highly correlated features to obtain the real vehicle operation dataset;

[0147] The normalized data range is [0,1], and the expression is as follows:

[0148]

[0149] In the formula, x n This represents the highly correlated features to be normalized; x min and x maxrepresent the minimum and maximum data values ​​in the normalized data, respectively; x represents the result after normalization.

[0150] S2.6. Divide the real vehicle operation dataset into training set and test set according to the proportion;

[0151] The ratio is set to 7:3;

[0152] S3. Construct a bidirectional long short-term neural network model (Bi-LSTM);

[0153] S3.1. The Bi-LSTM model consists of two independent LSTM layers. The first LSTM layer is used for forward propagation, and the second LSTM layer is used for backward propagation.

[0154] The core of an LSTM layer includes the input gate, forget gate, output gate, and cell state; the expression for the input gate at a single time step t is as follows:

[0155] i t =σ(W i .[h t-1 ,x t ]+b i );

[0156] C t ′=tanh(W c .[h t-1 ,x t ]+b C );

[0157] In the formula, i t It is the output of the input gate; σ is the Sigmoid activation function; W i and W C It is the weight matrix of the input gate and the candidate state; h t-1 It is the hidden state at time t-1; x t It is the input at the current moment; b i and b C It is the bias of the input gate and the candidate state;

[0158] The expression for the forget gate is as follows:

[0159] f t =σ(W f .[h t-1 ,x t ]+b f );

[0160] In the formula, f t It is the output of the forget gate; W f This is the weight matrix of the forget gate; b f It is the bias of the forgetting gate;

[0161] The expression for the output gate is as follows:

[0162] o t =σ(W o .[h t-1 ,x t ]+b o );

[0163] h t =o t .tanh(C t );

[0164] In the formula, o t The output of the output gate determines the current hidden state; W o This is the weight matrix of the output gate; b o It is the bias of the output gate; C t It represents the current state of the cell;

[0165] The expression for cell state is as follows:

[0166] C t =f t .C t-1 +i t .C t ′;

[0167] In the formula, C t-1 It represents the cell state at time t-1;

[0168] S3.2 After the data is input into the Bi-LSTM, it is input into the first LSTM layer and the second LSTM layer respectively, and the data is spliced ​​at each time step t.

[0169] The first LSTM layer is used for forward propagation, and its expression is as follows:

[0170]

[0171] In the formula, It is the hidden state of the forward-propagating LSTM at time t; Forward propagation of the LSTM's hidden state at time t-1;

[0172] The second LSTM layer is used for reverse transmission, and its expression is as follows:

[0173]

[0174] In the formula, It is the hidden state of the reverse-transmission LSTM at time t; Reverse propagation of the hidden state of the LSTM at time t-1;

[0175] The expression for concatenating hidden states is as follows:

[0176]

[0177] In the formula, [,] is a vector concatenation operation, used to capture the dependencies between sequential data at the same time;

[0178] like Figure 2 The diagram shows a state of charge prediction model based on a bidirectional long short-term memory neural network. In this embodiment, the input head of the state of charge prediction model of the bidirectional long short-term memory neural network is 3.

[0179] S4, such as Figure 3 As shown, a gate control mechanism is introduced into the bidirectional long short-term neural network model to construct a bidirectional long short-term neural network model network with residual adaptive gate control mechanism;

[0180] The residual connection is to add the input to the output of the Bi-LSTM layer after each Bi-LSTM layer. This invention introduces a learnable gating unit in each Bi-LSTM layer to determine whether to add the input of the previous layer to the output of the current layer, dynamically controlling the residual connection of each layer, thereby realizing the automatic adjustment of the use of residuals according to the training process and data characteristics.

[0181] The construction steps are as follows:

[0182] S4.1. Add a gate variable to each Bi-LSTM layer to control whether residual connections are performed;

[0183] The gating variable expression is as follows:

[0184] r t =σ(W r .[O t-1 ,x t ]+b r );

[0185] In the formula, r t It is a gating variable that determines whether residual connection is performed; W r and b r These are the weights and biases of the gated variables, used to train the gated variables;

[0186] S4.2. Set residual connections after each Bi-LSTM layer, as shown in the following expression:

[0187] O' t =Bi-LSTM(h) t-1 ,x t )+r t .x t ;

[0188] In the formula, O' t It is the final output of each Bi-LSTM layer; r t It is a gated variable, which obtains a value between 0 and 1 through a gating mechanism to control the strength of the residual connection; x t It is the input at the current moment;

[0189] S4.3 The gated variable controls whether residual join is performed through forward propagation, and updates the weight W of the gated variable through backpropagation. r and bias b r The steps are as follows:

[0190] S4.3.1 Initialize the weights W of the gating variables r and bias b r ;

[0191] S4.3.2 After each Bi-LSTM layer, the weights W of the gated variables are calculated. r and bias b r To determine whether to use residual join;

[0192] The judgment method is as follows:

[0193] When r t When = 1, residual connections are fully utilized;

[0194] When r t When = 0, residual connectivity is ignored;

[0195] When r t When the value is between 0 and 1, the residual connection is partially used, as shown in the following expression:

[0196] Residual connection output = r t ×Bi-LSTM input + current layer computation result;

[0197] S4.3.3, Update the weights W of the gating mechanism through backpropagation. r and bias b r ;

[0198] Backpropagation of gating variables: During training, the loss function is calculated based on the model's output and the true labels, and the weights W of the gating mechanism are updated through backpropagation. r and bias b r ;

[0199] During backpropagation, the gate variable r t The gradients are calculated and used to update the weights; these gradients are derived from the output of the Bi-LSTM and the network's final loss, progressively adjusting the gate weights W. r This allows it to better determine the role of residual connections;

[0200] Loss function calculation: The mean squared error (MSE) is used as the loss function L, and its calculation formula is as follows;

[0201]

[0202] In the formula, y t This is the final output of the model after passing through the fully connected layer; Indicates the actual label value; N represents the total number of batches; i represents the batch number;

[0203] During backpropagation, the gradient of the loss function is passed to the parameter weights W of the gate variable via the chain rule. r and bias b r Update;

[0204] The loss function affects the output y t The gradient calculation expression is as follows:

[0205]

[0206] Loss function with respect to gate variable r t The gradient calculation expression is as follows:

[0207]

[0208] Loss function with respect to W r and b r The gradient calculation expression is as follows:

[0209]

[0210] In the formula, z = W r .[h t-1 ,x t ]+b r ;

[0211] Update W using gradient descent. r and b r The expression is as follows:

[0212]

[0213] In the formula, e represents the learning rate; W' r Indicates the updated weight; b' r Indicates the updated bias;

[0214] S4.4. Perform residual concatenation between the input data and the output data of Bi-LSTM using the updated gating variables;

[0215] S4.5. The output obtained in S4.4 is mapped through a fully connected layer and then output.

[0216] The fully connected layer (FC layer) maps the output of the last time step to obtain the final output, as shown in the following expression:

[0217] y t =W FC .O tt +b FC ;

[0218] In the formula, y t This is the final output of the model after passing through the fully connected layer; O tt W represents the output after concatenating the output vectors of each layer; FC b represents the weights of the fully connected layer. FC This is used for biasing the fully connected layer.

[0219] S5. The hyperparameters of the bidirectional long short-term neural network model with residual adaptive gating mechanism are optimized using the whale algorithm. The steps are as follows:

[0220] S5.1, such as Figure 4 As shown, set the hyperparameters that need to be optimized, including: number of hidden layers, number of hidden layer nodes, time step, number of batches, and number of training generations (epochs).

[0221] S5.2 Setting the search space for the whale algorithm;

[0222] The whale optimization algorithm requires defining the search space of hyperparameters, determining the minimum and maximum values ​​of hyperparameters, defining the number of layers of the Bi-LSTM network as [1,5], the number of neurons in each LSTM unit (i.e., the number of LSTM hidden layer units) as [32,512], and the number of batches as [32,128].

[0223] S5.3 Use the root mean square error (RMSE) to evaluate the quality of each set of hyperparameters in the search space;

[0224] The evaluation method is as follows: the root mean square error (RMSE) is used as the fitness function to evaluate the quality of each candidate solution; the smaller the RMSE, the better the solution.

[0225] The goal of the whale optimization algorithm is to find a set of hyperparameters from the hyperparameters after quality evaluation that minimizes the RMSE of the improved Bi-LSTM model.

[0226] S5.4. Perform a global search in the hyperparameter space using the whale optimization algorithm to find the optimal hyperparameter combination, and input the hyperparameter combination into the improved Bi-LSTM model.

[0227] The global search is conducted by simulating whale hunting behavior (encircling prey, spiral bubble web attack, random search), as detailed below:

[0228] S5.4.1. Use the prey encirclement method to search for hyperparameters after quality evaluation;

[0229] Since the optimal position in the data sample is uncertain, the "whale" will set a locally optimal hunting direction. Therefore, the position of the sample with the highest fitness is assumed to be the target position, and it is used as a reference for other samples to update their own positions, as shown in the following formula:

[0230]

[0231] In the formula, A vector representing the location of the "prey"; The vector representing the position of the "whale"; tt is the number of iterations; and As a coefficient vector, during calculation, it will be used for... and Vectors are used for debugging to find The location around the optimal solution and The calculation formula is as follows:

[0232]

[0233] in, The value of decreases linearly from 2 to 0. and It is a random vector taken from [0,1];

[0234] S5.4.2, Use a spiral bubble net attack method to search for hyperparameters after quality evaluation;

[0235] The spiral bubble network attack simulates updating the distance between other sample positions and the optimal sample position by using a spiral position update and shrinking wrapping mechanism.

[0236] The initial step is to calculate the distance between the "whale's" position and the "prey's" position, and then establish a spiral equation between the two positions to simulate the spiral movement of a humpback whale during hunting:

[0237]

[0238] In the formula, b represents the helical constant; l is a random number in the interval [-1, 1]; a helical constant b is used to define the shape of the helix; This refers to the distance between the "whale" and its "prey"; the whale swims in a spiral towards its prey while simultaneously tightening its encirclement.

[0239] S5.4.3. Use a random search method to search for hyperparameters after quality evaluation;

[0240] Random search is used to enhance its global search capabilities when... At that time, it randomly updates the location of individual samples based on the characteristics of the data samples;

[0241]

[0242] In the formula, Individuals are randomly selected from the current group;

[0243] Repeat step S5.4 until the maximum number of iterations is reached, and finally output the optimal combination of hyperparameters.

[0244] The maximum number of iterations can be set to: 50, 100, 150, and 200.

[0245] Based on the whale optimization algorithm, the hyperparameters of the improved Bi-LSTM model are determined to be 3 hidden layers, 36 hidden layer nodes, 50 time steps, 128 batches, and 50 training epochs.

[0246] S6. Use the training set to train the optimized model to obtain the trained model;

[0247] S7. Use the test set to predict the remaining driving mileage of the model in S6, obtain the prediction results, evaluate the prediction results, and obtain the evaluation index.

[0248] Evaluation indicators include: coefficient of determination R-squared(R²) 2 The maximum absolute error (MAE) and root mean square error (RMSE) are expressed as follows:

[0249] R-squared:

[0250] Maximum absolute error:

[0251] Root mean square error:

[0252] In the formula, n' is the length of the test data; ii is the sequence number of the test data; y ii The remaining mileage is the actual value of the test data; The average remaining mileage for all test data; y iihat The remaining driving range is the predicted value for the test data;

[0253] This invention compares and analyzes the prediction results of different data-driven methods for remaining driving mileage. The comparison results are shown in Table 1. The algorithm R of this invention... 2 The results show that the prediction performance of this invention is better than other machine learning algorithms, with an accuracy of 0.997, MAE of 0.633, and RMSE of 1.157.

[0254] Table 1: Prediction Results and Errors of Different Methods

[0255]

[0256] S8. Perform generalization verification on the S7 model using different vehicle models;

[0257] like Figure 5 As shown in sections a, b, and c, the present invention can accurately predict the remaining driving range of pure electric vehicles. The predicted values ​​are well distributed near the true values, and the model can predict the remaining driving range well. Further comparative analysis of the remaining driving range prediction results for high-range, medium-range, and low-range vehicles validated the model. As shown in Table 2, the proposed method has both good prediction accuracy and generalization, demonstrating its predictive ability and showing broad application prospects in the field of pure electric vehicle mileage prediction.

[0258] Table 2: Prediction Results and Errors for Different Vehicle Models

[0259]

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

Claims

1. A method for predicting the remaining driving range of a pure electric vehicle based on real vehicle data, characterized in that, Includes the following steps: S1. Collect real-world vehicle operation data of pure electric vehicles in low-temperature environments using open-source datasets; The actual vehicle operation data includes: vehicle status, charging status, vehicle speed, mileage, total current, total voltage, maximum battery voltage, minimum battery voltage, maximum battery temperature, and minimum battery temperature. S2. Complete the collected real vehicle operation data, preprocess the completed data to obtain the actual state of charge; classify the vehicle's range level through cluster analysis, and obtain the highly correlated features with the remaining driving range through Spearman correlation coefficient analysis; normalize the highly correlated features to obtain the real vehicle operation dataset, and divide the real vehicle operation dataset into training set and test set. S3. Construct a bidirectional long short-term neural network model Bi-LSTM; S4. Introduce a gate control mechanism into the bidirectional long short-term neural network model Bi-LSTM to construct a bidirectional long short-term neural network model Bi-LSTM with residual adaptive gate control mechanism; S5. Hyperparameter optimization of the Bi-LSTM bidirectional long short-term neural network model with residual adaptive gating mechanism is performed using the whale optimization algorithm. S6. Use the training set to train the optimized model to obtain the trained model; S7. Use the test set to predict the remaining driving mileage of the model in S6, obtain the prediction results, and evaluate the prediction results to obtain the evaluation indicators, including: coefficient of determination R-squared, maximum absolute error and root mean square error. S8. Perform generalization verification on the S7 model using different vehicle models.

2. The method for predicting the remaining driving range of a pure electric vehicle based on real vehicle data according to claim 1, characterized in that: The process involves supplementing the collected real vehicle operation data, preprocessing the supplemented data to obtain the actual state of charge, classifying the vehicle's range level through cluster analysis, and obtaining highly correlated features with the remaining driving range through Spearman correlation coefficient analysis. After normalizing the highly correlated features, the real-vehicle operation dataset is obtained. The steps to divide the real-vehicle operation dataset into training and testing sets are as follows: S2.1 Complete the data based on the obtained actual vehicle operation data; The method for completion is as follows: detect missing and outlier values ​​in the actual vehicle operation data. If there are missing or outlier values, delete the outlier values ​​and complete the data using the horizontal average interpolation method. S2.2 Extract the current from the completed data and calculate the actual state of charge of the battery; S2.

3. Perform K-means cluster analysis on the vehicles based on their driving range. Vehicles that can travel a distance less than a first threshold under full charge conditions are classified as low-range vehicles; vehicles that can travel a distance greater than the first threshold but less than a second threshold are classified as medium-range vehicles; and vehicles that can travel a distance greater than the second threshold are classified as high-range vehicles. The first threshold is less than the second threshold. S2.

4. Spearman correlation coefficient analysis was performed on the divided vehicles to obtain the characteristics of high correlation with the remaining driving mileage. Spearman correlation coefficient analysis was used to analyze the correlation between variables and remaining driving mileage in real vehicle operation data. Correlation features with Spearman correlation coefficients higher than the correlation threshold were selected. Data related to low temperature environment were selected as high correlation features and used as feature variables. Highly relevant characteristics include: minimum voltage, discharge state of charge (SOC), and minimum temperature; S2.

5. The Min-Max method is used to normalize the highly correlated features to obtain the real vehicle operation dataset; S2.

6. Divide the real vehicle operation dataset into training set and test set according to the proportion.

3. The method for predicting the remaining driving range of a pure electric vehicle based on real vehicle data according to claim 1, characterized in that: The steps for constructing the bidirectional long short-term neural network model Bi-LSTM are as follows: S3.1 The Bi-LSTM bidirectional long short-term neural network model consists of two independent LSTM layers. The first LSTM layer is used for forward propagation, and the second LSTM layer is used for backward propagation. S3.2, After inputting data into the Bi-LSTM bidirectional long short-term neural network model, the data is fed into the first LSTM layer and the second LSTM layer respectively, and at each time step... t Then, the parts are assembled.

4. The method for predicting the remaining driving range of a pure electric vehicle based on real vehicle data according to claim 1, characterized in that: The steps for constructing the Bi-LSTM bidirectional long short-term neural network model with residual adaptive gating by introducing a gating mechanism are as follows: S4.

1. Add a gate variable to each Bi-LSTM layer of the bidirectional long short-term neural network model; S4.

2. Set residual connections after each Bi-LSTM layer of the bidirectional long short-term neural network model; S4.3 The gated variables control whether residual joins are performed through forward propagation, and update the weights of the gated variables through backpropagation. and bias The steps are as follows: S4.3.1 Initialize the weights of the gating variables and bias ; S4.3.2 After each Bi-LSTM layer, the weights of the gated variables are calculated. and bias To determine whether to use residual join; The judgment method is as follows: When the gate variable When =1, the residual connection is fully utilized; When the gate variable When = 0, residual connectivity is ignored; When the gate variable When the value is between 0 and 1, the residual connection is partially used, as shown in the following expression: Residual connection output = The input of ×Bi-LSTM plus the computation result of the current layer; S4.3.3 Update the weights of the gating variables through backpropagation and bias ; S4.

4. Perform residual concatenation between the input data and the output data of Bi-LSTM using the updated gating variables; S4.

5. The output obtained in S4.4 is mapped through a fully connected layer and then output.

5. The method for predicting the remaining driving range of a pure electric vehicle based on real vehicle data according to claim 1, characterized in that: The steps for hyperparameter optimization of the Bi-LSTM bidirectional long short-term neural network model with residual adaptive gating mechanism using the whale optimization algorithm are as follows: S5.1 Set the hyperparameters to be optimized, including: number of hidden layers, number of hidden layer nodes, time step, number of batches, and number of training generations; S5.2, Set the search space for the whale optimization algorithm; S5.3 Use the root mean square error (RMSE) to evaluate the quality of each set of hyperparameters in the search space; S5.

4. Perform a global search in the hyperparameter space using the whale optimization algorithm to find the optimal combination of hyperparameters, and input the hyperparameter combination into the improved bidirectional long short-term neural network model Bi-LSTM. Repeat step S5.4 until the maximum number of iterations is reached, and finally output the optimal combination of hyperparameters.

Citation Information

Patent Citations

  • Algorithm for estimating state of charge of power battery based on improved random forest joint volumetric Kalman

    CN110888059A

  • Lithium battery remaining service life prediction method and system based on optimized neural network

    CN117665627A