A pure electric vehicle residual driving range prediction method based on LSTM-KANFormer

CN122946952APending Publication Date: 2026-10-20KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611437036.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-16
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0003]现有续航里程估计技术普遍存在以下问题:一是工况或驾驶行为统计可能引入未来信息;二是静态工况标签难以反映工况切换及驾驶操作变化引起的能耗机制变化;三是单一时序模型难以同时兼顾长期依赖、局部非线性表达和训练稳定性;四是直接回归绝对里程还可能产生负值、超过车辆合理续航上限等不符合物理规律的结果

Benefits of technology

本发明通过引入工况软概率、切换状态和驾驶行为上下文,使模型随运行条件变化调节特征响应,有助于改善复杂工况下的预测适应能力;采用单向LSTM、FiLM调制及FFN-KAN门控KANFormer协同提取时序依赖和非线性特征,有助于控制剩余续驶里程平均预测误差及较大偏差;结合SOH、目标SOC阈值以上可用能量和单位里程能耗率构建物理基础里程,并通过受约束KAN残差修正限制负值及超出合理续驶范围的结果,增强物理一致性,使物理基准贡献与数据驱动修正量能够分别追溯;通过辅助监督、Dropout、早停和TPE-ASHA参数优化,提高训练稳定性和参数选择效率,降低过拟合风险。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention discloses a method for predicting the remaining driving range of pure electric vehicles based on LSTM-KANFormer, belonging to the field of new energy vehicle range estimation technology. The method includes: acquiring raw real-vehicle operating data and vehicle static parameters of the pure electric vehicle, and dividing the continuous discharge process after preprocessing; constructing a context feature sequence and a basic state sequence, extracting the temporal evolution features of the basic state using a unidirectional LSTM, and dynamically modulating them using a FiLM module; constructing an encoder, extracting long-term dependencies and local nonlinear features through multi-head self-attention and gated hybrid feedforward collaborative extraction; performing nonlinear correction and range constraints on the KAN residual output head, and outputting a predicted remaining driving range value with a physically consistent SOC of 30%. This invention has high prediction accuracy, strong physical consistency, and can effectively adapt to complex operating conditions and changes in driving behavior.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of new energy vehicle range estimation technology, specifically a method for predicting the remaining driving range of a pure electric vehicle based on LSTM-KANFormer. Background Technology

[0002] With the increasing number of pure electric vehicles and their expanding application scenarios, remaining driving range has become a crucial factor for drivers in planning trips, determining when to recharge, and ensuring safe driving when the battery is low. Currently, driving range estimation mainly employs rule-based methods based on State of Charge (SOC) or historical average energy consumption, mechanistic methods based on the energy relationship between the battery and the vehicle, and data-driven methods based on networks such as LSTM, GRU, and Transformer. Rule-based methods are computationally simple but struggle to respond promptly to changes in operating conditions and driving behavior; mechanistic methods offer some physical interpretation but require high precision in parameter identification and model integrity. Existing data-driven methods often use a single time-series model or directly concatenate multiple features for end-to-end prediction. While these methods can learn the nonlinear relationship between vehicle state and remaining driving range, they struggle to simultaneously consider local state changes, long-term time-series dependencies, the modulating effect of operating conditions and driving behavior on energy consumption mechanisms, and the physical consistency of prediction results. Compared to a single model, simply increasing network depth or changing the time-series structure cannot fully address these issues; hierarchical representation and collaborative modeling of battery state, vehicle operating state, operating condition switching, driving behavior, and energy consumption characteristics are still necessary.

[0003] Existing driving range estimation techniques generally suffer from the following problems: First, statistical data on operating conditions or driving behavior may introduce future information; second, static operating condition labels are insufficient to reflect changes in energy consumption mechanisms caused by changes in operating conditions and driving operations; third, a single time-series model cannot simultaneously account for long-term dependence, local nonlinearity, and training stability; and fourth, directly regressing absolute mileage may produce negative values ​​or results exceeding the vehicle's reasonable range limit, which are inconsistent with physical laws. Therefore, there is an urgent need for a method to predict the remaining driving range of pure electric vehicles that can collaboratively represent the impact of vehicle state, operating condition switching, and driving behavior, while also considering temporal causality, nonlinear modeling capabilities, training stability, and physical consistency of the output. Summary of the Invention

[0004] To address the aforementioned issues, this invention proposes a method for predicting the remaining driving range of pure electric vehicles based on LSTM-KANFormer. This method constructs supervised samples using the continuous discharge process of the vehicle when it actually reaches the target SOC threshold, and strictly relies on current and historical data to form causal temporal inputs, avoiding the influence of future information on the prediction results. It constructs an operational context through soft probability of operating conditions, operating condition switching states, and multi-timescale driving behavior features to characterize the dynamic impact of changes in operating conditions and driving operations on vehicle energy consumption. A unidirectional LSTM is used to extract the temporal evolution features of the vehicle state, and a FiLM module is used to conditionally modulate the temporal features based on the operational context. Furthermore, an improved KANFormer incorporating multi-head attention and an FFN-KAN hybrid gated feedforward structure is used to collaboratively extract long-term dependencies and local nonlinear features. Finally, a physical baseline mileage is constructed by combining available energy above the target SOC threshold and energy consumption rate per unit mileage, and residual correction is performed using a constrained nonlinear output head, achieving a remaining driving range prediction with high prediction accuracy, training stability, and physical consistency.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for predicting the remaining driving range of a pure electric vehicle based on LSTM-KANFormer, specifically including the following steps: S1. Obtain the original pure electric vehicle real-vehicle operation data and vehicle static parameters. Perform field standardization, anomaly cleaning, missing value repair and smoothing on the original data to obtain vehicle time-series data. Divide the continuous discharge process according to vehicle identification and time sequence. Divide the training set, validation set and test set with the continuous discharge process as the smallest unit. Select the effective continuous discharge process that actually reaches 30% SOC in each dataset. Construct the main supervision target of the real remaining driving range with SOC of 30%, the short-term driving distance target of the next 1% SOC, the energy consumption rate target per unit mileage in the next 300 seconds and 600 seconds, and the label of the next operating condition. Construct causal time-series samples based on the current time and its historical data.

[0006] S1.1 Unify the time, SOC, vehicle speed, cumulative mileage, total battery voltage, total current, single cell voltage, temperature, and pedal opening into a preset format and unit of measurement. Delete invalid and duplicate time records. Mark data that exceeds the physical reasonable range or has isolated abrupt changes as abnormal. Perform local interpolation on short-term continuous missing intervals and perform light smoothing on continuous features suitable for smoothing. Preserve the true change trend of SOC and cumulative mileage to obtain vehicle time-series data.

[0007] S1.2. Based on the vehicle's operating status, charging and discharging status, time continuity, cumulative mileage continuity, and SOC change direction, the continuous discharge process is divided, and quality is screened according to the minimum number of samples, the shortest duration, and the minimum driving distance. The continuous discharge process is divided into training set, validation set, and test set in 7:1:2 according to the time sequence for each vehicle, so that all samples generated by the same continuous discharge process belong to only one dataset.

[0008] S1.3. In each dataset, retain continuous discharge processes where the initial SOC is higher than 30% and the subsequent actual observation shows the SOC dropping to 30% or below for the first time, and remove processes where the SOC is still higher than 30% at the end of the observation. Determine the SOC as the mileage corresponding to 30% based on the cumulative mileage before and after the SOC crosses 30%, and use the difference between this mileage and the current cumulative mileage as the true remaining driving range. Further construct the short-term driving distance of the next 1% SOC, the energy consumption rate per unit mileage in the next 300 seconds and 600 seconds, and the auxiliary target for the next operating condition, forming a time-series window containing only current and historical information within the same vehicle and the same continuous discharge process.

[0009] S2. Based on the causal time-series samples obtained in S1, construct contextual features of operating conditions and driving behavior; based on the average vehicle speed of the 60-second historical window and the preset speed boundary, form four types of operating conditions: urban congestion, urban smooth traffic, suburbs, and highways. Use continuous soft probability to represent the uncertainty of operating conditions near the boundary. After dwell confirmation, obtain stable operating condition labels, operating condition switching markers, switching directions, and the time since the most recent switching. At the same time, extract driving operation features, multi-time-scale statistical features, and historical energy consumption rate per unit mileage to form a contextual feature sequence.

[0010] S2.1 Calculate the average vehicle speed and maximum acceleration within a 60-second historical window. Divide the driving conditions into four categories using three increasing speed boundaries of 16.10 km / h, 40.26 km / h, and 72.40 km / h. Apply these three boundaries to the validation set, test set, and data to be predicted. Generate soft probabilities for the four categories of driving conditions based on the relative position of the average vehicle speed and each speed boundary. Select the category with the highest probability as the candidate driving condition.

[0011] S2.2 When the candidate working condition continuously meets the preset dwell conditions, update the stable working condition label and record the working condition dwell time, switching mark, category before and after switching, switching direction and time since the most recent switching; use the stable working condition at the subsequent preset time domain position as the auxiliary supervision label for the next working condition.

[0012] S2.3 Construct driving operation vectors based on the mean, standard deviation, and rate of change of the accelerator and brake pedals, and form discrete driving behavior labels through a clustering model fitted only to the training set; statistically analyze the mean and standard deviation of vehicle speed, acceleration, jerk, pedal opening, and vehicle power within historical windows of 60 seconds, 150 seconds, and 300 seconds, respectively, and combine them with the soft probability of operating conditions, operating condition switching status, long-term historical statistics, and historical energy consumption rate per unit mileage to obtain the context feature sequence of operating conditions and driving behavior.

[0013] S3. The SOC, vehicle speed, total current of the power battery, total voltage, single cell voltage, cumulative mileage, temperature and vehicle static parameters are combined into a basic state sequence. The operating conditions and driving behavior features obtained in S2 are combined into a context feature sequence. The missing values ​​are filled and standardized using training set statistics. The basic state sequence is temporally encoded using a one-way LSTM. Feature-level scaling and bias are generated from the context feature sequence. The LSTM hidden sequence is dynamically modulated using the FiLM mechanism (Feature Linear Modulation Mechanism) to output the fused feature sequence.

[0014] S3.1 Establish basic state sequences and context feature sequences within the same historical window. All windows are limited to the same vehicle and the same continuous discharge process. The validation set, test set, and data to be predicted use only the fill parameters and standardized parameters determined by the training set.

[0015] S3.2 Input the standardized basic state sequence into a unidirectional LSTM in chronological order to extract the temporal dependency of the vehicle's operating state as it evolves with the discharge process; input the standardized context feature sequence into a linear mapping layer to obtain scaling and bias values ​​consistent with the LSTM's hidden dimension.

[0016] S3.3. The scaling amount, bias amount and LSTM hidden state at the same time are linearly modulated at the feature level. While retaining the basic time series information, the working condition, switching state and driving behavior information are injected to obtain the fused feature sequence for KANFormer encoding.

[0017] S4. Input the fused feature sequence output from S3 into the KANFormer encoder. After pre-normalization, multi-head self-attention extracts the dependencies between different historical moments and retains the original temporal information through residual connections. Input the self-attention features into a gated hybrid feedforward sub-layer composed of standard feedforward network branches and KAN branches. After being processed layer by layer by multiple KANFormer coding blocks, attention pooling is performed to obtain a global representation of the vehicle's current state. Based on this global representation, predict the positive unit mileage energy consumption rate. Combine the vehicle's rated energy, battery health status, current SOC, and full-charge reference driving range to calculate the physical base mileage. Then, the KAN residual output head performs nonlinear correction and range constraint to output the predicted remaining driving range when the SOC drops to 30%.

[0018] S4.1 Add temporal location information to the fused feature sequence, and generate query, key and value features after layer normalization; each attention head independently calculates scaled dot product attention, and after concatenation, obtains self-attention feature sequence through linear mapping and residual connection.

[0019] S4.2 Input the self-attention features into the standard feedforward network branch and the KAN branch respectively; the standard feedforward network branch provides a stable global feature transformation path, and the KAN branch learns local nonlinear relationships through a weighted combination of basic activation and B-spline basis functions, and controls the correction strength of the KAN branch with learnable gating coefficients; after the two branches are fused, the encoded features are output through residual connection.

[0020] S4.3. Perform attention pooling on the output of each time step of the last KANFormer encoding block to obtain the global representation; output a positive unit mileage energy consumption rate from the energy consumption rate prediction head, and determine the physical base mileage and mileage limit based on the available energy with SOC higher than 30% and the full charge reference range.

[0021] S4.4 Input the global representation into the KAN residual output head, learn the nonlinear deviation of vehicle state, operating conditions and driving behavior on the physical base mileage, add the deviation to the physical base mileage and apply non-negative constraints and upper limit constraints to obtain the final remaining driving range prediction value.

[0022] S5. Based on the LSTM-KANFormer model, the main task is to predict the remaining driving range. The auxiliary tasks are to construct a joint loss function based on the short-term driving distance of 1% SOC, the energy consumption rate per unit mileage in the next 300 seconds, the energy consumption rate per unit mileage in the next 600 seconds, and the classification of the next driving condition. The AdamW optimizer, gradient pruning, Dropout, and early stop are used to train the model. The TPE-ASHA is used to select the model structure parameters and training parameters on the validation set. The test set does not participate in parameter learning or selection. The MAE, RMSE, and coefficient of determination R² are used to evaluate the final model, thereby achieving the prediction of the remaining driving range of 30% SOC under different driving conditions, driving condition switching, and driving behaviors.

[0023] LSTM-KANFormer stands for Long Short-Term Memory - Kolmogorov-Arnold Network Transformer.

[0024] Compared with the prior art, the present invention has the following beneficial effects: This invention introduces soft probabilities of operating conditions, switching states, and driving behavior context, enabling the model to adjust its feature responses according to changes in operating conditions, thus improving its predictive adaptability under complex operating conditions. It employs unidirectional LSTM, FiLM modulation, and FFN-KAN gated KANFormer to collaboratively extract temporal dependencies and nonlinear features, helping to control the average prediction error and large deviations of remaining driving range. It constructs a physical baseline mileage by combining SOH, available energy above the target SOC threshold, and energy consumption rate per unit mileage, and enhances physical consistency by limiting negative values ​​and results exceeding the reasonable driving range through constrained KAN residual correction, allowing for separate tracking of physical baseline contributions and data-driven corrections. Finally, it improves training stability and parameter selection efficiency and reduces the risk of overfitting through assisted supervision, Dropout, early stopping, and TPE-ASHA parameter optimization. Attached Figure Description

[0025] Figure 1 This is a flowchart of the method for predicting the remaining driving range of a pure electric vehicle according to the present invention. Figure 2 These are sample diagrams of four types of driving conditions according to the present invention; Figure 3 These are vehicle speed time-series curves for four typical driving conditions according to the present invention, wherein... Figure 3 (a) Urban congestion conditions Figure 3 (b) Suburban working conditions Figure 3 (c) Urban traffic conditions Figure 3 Medium (d) high-speed operating conditions; Figure 4This is a schematic diagram of the unidirectional LSTM timing coding and FiLM context modulation structure of the present invention, wherein, Figure 4 (a) is a modulation flowchart showing how context features are used to generate scaling and bias vectors through linear mapping. Figure 4 (b) is a diagram showing the process of unidirectional LSTM recursively extracting the temporal dependencies of the basic state sequence by time step; Figure 5 This is a schematic diagram of the KANFormer encoder and FFN-KAN hybrid gating structure of the present invention, wherein, Figure 5 (a) is the overall architecture diagram of the KANFormer encoder, which includes a pre-normalized multi-head self-attention layer and a hybrid feedforward sub-layer; Figure 5 (b) is a structural diagram of the multi-head self-attention mechanism; Figure 5 (c) is a diagram of the gated fusion structure of the standard feedforward network branch and the KAN branch in the hybrid feedforward sublayer; Figure 5 (d) shows the nonlinear mapping structure based on B-spline basis functions within the KAN branch; Figure 6 This is a comparison chart of the predicted trajectories of the remaining driving range at a SOC of 30% under different initial SOC states according to the present invention. Figure 6 In section (a), the initial SOC section is approximately 100%. Figure 6 In section (b), the initial SOC section is approximately 90%. Figure 6 In section (c), the initial SOC section is approximately 80%. Figure 6 The middle (d) corresponds to a SOC initial section of approximately 70%; Figure 7 This is an evaluation chart showing the consistency between the predicted and actual SOC (Standard Operating Range) values ​​of the present invention (SOC) at 30% remaining driving range. Detailed Implementation

[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. The described embodiments are only some embodiments of the present invention, and not all embodiments. Other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are all within the scope of protection of the present invention.

[0027] Please see Figure 1 A method for predicting the remaining driving range of a pure electric vehicle based on LSTM-KANFormer, specifically including the following steps: S1. Obtain real-world operating data and vehicle static parameters of pure electric vehicles for three consecutive months. Perform field standardization, anomaly cleaning, missing value repair, and smoothing on the original data. Divide the continuous discharge process according to the vehicle's operating status, discharge status, and the continuity of time and mileage. Take the cumulative mileage when the SOC first drops to 30% as the prediction endpoint. Construct the main supervision target of SOC as 30% of the actual remaining driving range and multiple auxiliary supervision targets. Form a causal time series sample that does not cross vehicles or continuous discharge processes and only contains current and historical information.

[0028] Specifically, the following steps are included: S1.1 Establish vehicle time-series data according to vehicle identification, unify time, SOC, vehicle speed, cumulative mileage, total battery voltage, total current, single cell voltage, temperature, and pedal opening into a preset format and unit of measurement, and arrange them in ascending order of timestamp. Delete invalid and duplicate records, and set features that exceed the physical range or show isolated abrupt changes to null values; perform local interpolation on short missing intervals of no more than 6 sampling points, and use a 5-point window for light smoothing of vehicle speed, voltage, current, temperature, and pedal opening; do not perform rolling smoothing on SOC and cumulative mileage to retain the threshold arrival time and actual driving distance.

[0029] S1.2 Identify driving discharge records; when the vehicle changes, the time interval between adjacent discharges exceeds 600 seconds, the accumulated mileage is rolled back, the operating state does not meet the driving discharge conditions, or there is an abnormal SOC transition, establish a new continuous discharge process. Preferably, retain processes with no fewer than 30 samples, a duration of no less than 5 minutes, and a driving distance of no less than 1 km. Using the complete process as a unit, allocate the first 70%, the subsequent 10%, and the remaining 20% ​​to the training set, validation set, and test set respectively, based on the vehicle and start time, ensuring that the same process does not cross datasets.

[0030] S1.3. Within the training, validation, and test sets, select continuous discharge processes where the initial SOC is higher than 30% and subsequently reaches or falls below 30%. Processes where the SOC remains higher than 30% at the end of the observation are not used in the construction of the 30% SOC supervision sample in this embodiment. Let the continuous discharge process be... The and the first Each sampling point spans 30% of the SOC, and their SOCs are respectively and The cumulative mileage is as follows: and The cumulative mileage when SOC reaches 30% for: In the formula, , , The unit is km. For any valid prediction time earlier than the arrival time at 30% SOC... The actual remaining driving range is: In the formula, For a moment Cumulative mileage The primary objective of supervision.

[0031] The auxiliary supervision objective is: from time point Determine the position where the State of Charge (SOC) first decreases by 1 percentage point, and obtain the short-term driving distance for the next 1% SOC. Construct the energy consumption rate per unit mileage based on the forward energy consumption and driving distance within the next 300 seconds and 600 seconds, and use the stable operating condition at the preset forward-looking position as the label for the next operating condition. If the future time domain is incomplete, the corresponding auxiliary label is marked as invalid.

[0032] S1.4. Capture current and historical data windows only within the same vehicle and the same continuous discharge process, without crossing charging, long-term breakpoints, or mileage rollback boundaries, and align basic state features and context features with the same endpoints.

[0033] S2. Based on the causal time-series samples formed in S1, construct contextual features of driving conditions and driving behavior; identify four types of driving conditions—urban congestion, urban smooth traffic, suburbs, and highways—by using the average vehicle speed and maximum acceleration within the historical window, generate soft probabilities of driving conditions, stable driving condition labels, and driving condition switching states, and combine pedal operation features, multi-time-scale operational statistical features, and historical energy consumption rate per unit mileage to form a contextual feature sequence for characterizing changes in the vehicle's external driving environment and driving behavior.

[0034] Specifically, the following steps are included: S2.1. For the vehicle data after 30 seconds of resampling, construct a 60-second historical window covering the current moment and preceding moments, and calculate the average vehicle speed within the window. And maximum acceleration. With km / h km / h and km / h is used as the boundary for increasing operating conditions. To avoid abrupt changes in the operating condition label near the boundary of increasing average vehicle speed, a temperature parameter is introduced. Define cumulative probability ,in, Indicates the first The cumulative probability function corresponding to each velocity boundary For the boundary index of increasing average vehicle speed, This represents the average vehicle speed within the historical window of 60 seconds prior to time t. This indicates the classification of four types of working conditions. An increasing average vehicle speed boundary; The soft probabilities for the four types of operating conditions are: In the formula, This represents the normalized soft probability that time t belongs to the first type of working condition. This represents the normalized soft probability that time t belongs to the second type of working condition. This represents the normalized soft probability that time t belongs to the third type of working condition. This represents the normalized soft probability that time t belongs to the fourth type of working condition. Let represent the normalized soft probability that time t belongs to the c-th working condition. For the Sigmoid function; The terms represent, in order, urban congestion, smooth urban traffic, suburbs, and highways. This represents the unnormalized soft probability that time t belongs to the r-th type of working condition. For temporary working condition category index; To normalize the soft probability, the candidate operating conditions are: . Figure 2 The distribution of four types of samples is shown using average vehicle speed and maximum acceleration: the speed boundaries form continuous partitions, and the dispersion of acceleration within the same partition reflects the differences in driving dynamics.

[0035] S2.2 The stable operating condition label is updated only when new candidate operating condition labels are continuously maintained for a preset number of steps. Let the stable operating condition be... Then switch the flag. and switching directions for: In the formula, To switch the marker, Categories before and after encoding switch This indicates the stable operating condition label after time t has been confirmed; it also includes the cumulative operating condition dwell time and the time since the most recent switchover. Figure 3 (a) to Figure 3 (d) shows typical vehicle speed curves for urban congestion, suburbs, urban smooth traffic, and highways, respectively, exhibiting characteristics of frequent starts and stops, stable medium speed, fluctuations at medium and low speeds, and small fluctuations at high speeds.

[0036] S2.3. An eight-dimensional driving operation vector is constructed using the mean, standard deviation, average rate of change, and maximum rate of change of the accelerator and brake pedals within a 60-second window. Standardized parameters and K-means cluster centers are fitted using only the training set and fixed for other data to obtain four discrete driving behavior labels. The mean and standard deviation of vehicle speed, acceleration, jerk, pedal opening, and vehicle power within 60-second, 150-second, and 300-second windows are then statistically analyzed. These, along with operating condition soft probability, dwell and switching information, historical extended statistics, and historical energy consumption per unit mileage, form a contextual feature sequence of operating conditions and driving behavior.

[0037] S3. Construct a unidirectional LSTM timing coding and FiLM context modulation module; input the vehicle basic state sequence into the unidirectional LSTM, extract the causal temporal dependency of the vehicle state during the discharge process according to the historical to the current direction, and map the context feature sequence composed of operating conditions, operating condition switching states and driving behavior into scaling vectors and bias vectors, perform feature-level modulation on the LSTM hidden state, and obtain a fusion feature sequence that contains both vehicle basic state information and operating condition driving behavior information.

[0038] Specifically, the following steps are included: S3.1, The basic state sequence consists of SOC, vehicle speed, total current, total voltage, cell voltage extreme value, cumulative mileage, average temperature, rated energy, and full-charge reference driving range. The context feature sequence is composed of S2 features. The imputation and standardization parameters are determined using only the training set and fixed for the remaining data.

[0039] S3.2, such as Figure 4 As shown in (b), the standardized base state sequence is input into the one-way LSTM in chronological order from the historical time to the current time. At each time step, the one-way LSTM calculates the forget gate, input gate, candidate memory, output gate, memory unit state, and hidden state based on the current base state features and the hidden state from the previous time step. The recursive process is as follows: In the formula, For time step index; This is the standardized basic state feature vector at the current time step; and These are the hidden states of the previous time step and the current time step, respectively. and These are the memory cell states of the previous time step and the current time step, respectively. , , and These are the forget gate, input gate, candidate memory, and output gate, respectively. , , and These are the weight matrices for the corresponding gating structures; , , and These are the bias vectors corresponding to the forget gate, input gate, candidate memory, and output gate, respectively. This represents the concatenation of vectors representing the current basic state features and the hidden state from the previous time step. Use the Sigmoid activation function; It is the hyperbolic tangent activation function; This indicates element-wise multiplication.

[0040] The forget gate determines the retention ratio of the memory information from the previous time step, the input gate and candidate memories jointly determine the amount of current basic state information written, and the output gate controls the output ratio of the memory cell state to the hidden state. After processing each time step within the history window according to the above recursive relationship, the hidden states of each time step are arranged in chronological order to obtain the hidden state sequence for the FiLM context modulation module to process.

[0041] S3.3, such as Figure 4 As shown in (a), the context vectors at the same time step Input a linear mapping layer to obtain a scaling vector and bias vector and with modulation intensity FiLM modulation of the LSTM hidden state: In the formula, and These are the weight and bias parameters for the linear mapping; This represents element-wise multiplication; The modulation intensity is set to 0.1 in this embodiment; To modulate the hidden state. Each Composition of fusion feature sequence .

[0042] S4. Construct the KANFormer encoder and physical constraint output head. First, use multi-head self-attention to extract the dependencies between different historical moments in the fused feature sequence. Then, learn the global feature transformation and local nonlinear relationships simultaneously through gating hybridization of standard feedforward network branches and KAN branches. Perform attention pooling on the encoding results, and combine the predicted energy consumption rate per unit mileage, available energy with SOC higher than 30%, and full-charge reference driving range to determine the physical base mileage. Finally, use the KAN residual output head for nonlinear correction and boundary constraints to obtain the predicted driving range value with SOC of 30%.

[0043] Specifically, the following steps are included: S4.1, such as Figure 5 (a) and Figure 5 As shown in (b), after adding temporal positional information to the fused feature sequence, pre-normalized multi-head self-attention is used to extract the dependencies between different historical moments. Let the first... Each coded block input is ,but: In the formula, Representation layer normalization; , and For the attention head, the query matrix, key matrix, and value matrix; , and Generate a linear mapping matrix of queries, keys, and values ​​for the attention head; The dimension of the key vector; Indicates the first The input feature sequence of a KANFormer encoded block, To represent the KANFormer encoded block index, This represents the scaled dot product attention output of the attention heads. The attention heads are concatenated, linearly mapped, and then connected via residuals to obtain the self-attention feature sequence, as shown in the following expression: In the formula, For the number of attention heads, This is the output mapping matrix after multi-head attention concatenation. This is the output of the self-attention sublayer, i.e., the self-attention feature sequence.

[0044] S4.2, such as Figure 5 (a) Figure 5 (c) and Figure 5 As shown in (d), the self-attention features are simultaneously input into both the standard feedforward network branch and the KAN branch. The KAN branch mapping is represented as: In the formula, Represents the KAN mapping function. For the KAN mapping, the first Each input feature Input feature index; and These are the basic activation weights and spline weights, respectively. For order is B-spline basis functions; Number of grid cells; For the index of the B-spline basis functions, This is the index of the B-spline order. The gated hybrid and coded block outputs of the standard feedforward network branch and the KAN branch are: In the formula, The output characteristics of the gated hybrid feedforward sublayer. For KANFormer encoded block index, The output of the self-attention sublayer. For learnable gating parameters, Indicates the first KAN branch gating coefficients for each coded block; For standard feedforward mapping, It is a two-layer KAN mapping. For layer normalization, For Dropout regularization operations For the first The final output of each encoded block This is the Sigmoid activation function.

[0045] S4.3, Denote the output of the last coded block as Attention pooling weights are calculated for each historical moment, and a global representation is obtained: In the formula, The length of the historical window sequence; This indicates that time t corresponds to the th time in the history window. Encoded features at each time step, This indicates that time t corresponds to the th time in the history window. Encoded features at each time step, and The index is the sequence length; , and These are the attention pooling parameters; Indicates the first Attention weights for each time step; This provides a global representation of the vehicle's current state. The Softplus function outputs a positive energy consumption rate per unit distance. In the formula, To predict energy consumption per unit distance, the unit is kWh / km; and This represents the weights and bias parameters of the energy consumption rate prediction head per unit mileage; To avoid the extremely small positive number set for zero energy consumption, this embodiment uses 0.05.

[0046] S4.4, Assume the vehicle's rated energy is The estimated battery health status is as follows: The reference driving range on a full charge is: The current SOC is The target SOC is ,but: In the formula, The available energy up to 30% of the current state of charge (SOC) is expressed in kWh. Indicates the vehicle's rated energy; This is a reference mileage limit, in km. This indicates the vehicle's reference driving range when fully charged; A value of 1 represents a nominal healthy state. The physical baseline mileage is: In the formula, These are baseline predictions constrained by both available energy and reference driving range. This is a reference mileage limit.

[0047] S4.5. Input the global representation into the KAN residual output head to obtain the nonlinear corrected residual. And impose nonnegativity and upper bound constraints on the correction results: In the formula, This represents the nonlinear odometer correction residual predicted by the KAN residual output head. and This represents the projection parameters of the KAN residual output head. This refers to the KAN residual mapping in the KAN residual output header; and These are projection parameters; The SOC is 30% of the predicted remaining driving range. This represents the model's final predicted remaining driving range. Use it as the base activation function.

[0048] S5. Train and evaluate the LSTM-KANFormer model. The primary task is to predict the remaining driving range at 30% SOC, with auxiliary tasks including short-term driving distance at -1% SOC, energy consumption rate per unit mile in the next 300 and 600 seconds, and prediction of the next driving condition. A joint loss function is constructed, and training is completed using AdamW optimization, gradient pruning, Dropout, and early stop mechanisms. TPE-ASHA is used to select the model's hyperparameters. The optimized model is then input into a unified test sample set, and MAE, RMSE, and coefficient of determination R are used for evaluation. 2The prediction accuracy and error stability are evaluated.

[0049] Specifically, the following steps are included: S5.1. With remaining driving range prediction as the primary task, and prediction of the next 1% SOC short-term driving distance, energy consumption rate per unit mileage in the next 300 seconds, energy consumption rate per unit mileage in the next 600 seconds, and the next operating condition as auxiliary tasks, a joint loss function is constructed: In the formula, , , , and The losses are, in order: main forecast loss, short-term driving distance loss at the next 1% SOC, energy consumption rate loss per unit mileage in the next 300 seconds, energy consumption rate loss per unit mileage in the next 600 seconds, and loss classified under the next operating condition. The main predicted loss, the short-term driving distance loss at the next 1% SOC, the energy consumption rate loss per unit mileage in the next 300 seconds, the energy consumption rate loss per unit mileage in the next 600 seconds, and the loss corresponding to the next operating condition classification are all included. Non-negative weights; The number of valid test endpoints; For Huber functions; For sample index, For prediction error, This is the threshold parameter for Huber loss. When the auxiliary label is invalid, the corresponding sample is not included in the calculation of the corresponding auxiliary loss.

[0050] S5.2. The AdamW optimizer is used for backpropagation, and the gradient norm is clipped to 5.00 before updating. Dropout is set, and early stopping is performed based on the validation set MAE. If there is no improvement after 4 consecutive rounds, the parameters with the lowest validation set MAE are restored. The test set is not used for training or parameter selection.

[0051] S5.3. Hyperparameter optimization using TPE-ASHA: 40 candidate trials were executed, with a maximum of 12 rounds per trial, and the optimal combination was ultimately tested in a maximum of 20 rounds. The preferred parameters were sequence length 15, hidden dimension 96, batch size 384, and learning rate. Weight decay coefficient The Dropout value is 0.27, the number of KANFormer encoding blocks is 2, the number of KAN grids is 3, and the B-spline order is 3. The above values ​​are only for this embodiment.

[0052] S5.4. Optimize the LSTM-KANFormer with unified test sample set input parameters, and then use MAE, RMSE, and coefficient of determination R0 to measure the results. 2 Evaluate the predictive performance.

[0053] The formula for calculating the Mean Absolute Error (MAE) is: The formula for calculating the root mean square error (RMSE) is: Coefficient of determination R 2 The calculation formula is: Among them, the actual remaining driving range The average value is expressed as: In the formula, and The first The true and predicted values ​​of each test endpoint; This represents the average of the actual values ​​at the test endpoints. To effectively test the number of endpoints, To effectively test the endpoint index.

[0054] To further observe the model's prediction of the vehicle's remaining driving range in test sets with initial SOC values ​​of 100%, 90%, 80%, and 70%, consecutive representative test journeys were selected from a unified test sample set. For the preset SOC starting section... Its corresponding start time is defined as: The three-dimensional trajectory from the initial cross-section to the first drop in SOC to 30% is represented as follows: In the formula, This represents the SOC value at time t; This indicates the preset SOC initial cross-sectional value. This refers to the moment when the SOC first drops to the preset starting cross-section; This marks the first time that SOC has dropped to 30%. For a moment The total voltage of the power battery; and The actual SOC at that moment was 30% of the remaining driving range, and the predicted SOC was 30% of the remaining driving range, respectively. This is the set of continuous trajectory points corresponding to the initial section of the SOC.

[0055] like Figure 6As shown, the four sub-plots correspond to the initial SOC sections of approximately 100%, 90%, 80%, and 70%, respectively. The figures use the total battery voltage, SOC, and remaining driving range at 30% SOC to form a three-dimensional coordinate system. Actual values ​​are represented by scatter plots, while predicted values ​​are represented by broken lines. During the SOC decrease, the total battery voltage does not decrease monotonically but fluctuates with changes in vehicle load, short-term parking, and operating conditions. Under these non-monotonic voltage change conditions, the model's predicted trajectory still follows the overall trend of the actual remaining driving range at 30% SOC. This model can continuously predict the remaining driving range at 30% SOC under different initial SOC sections by combining the total battery voltage, SOC, and vehicle operating characteristics. In this invention, SOC30 refers to a SOC of 30%.

[0056] Experimental results show that the method of the present invention has high accuracy in predicting the driving range on different vehicle models, and the prediction error remains at a low level. Figure 7 As shown, the horizontal axis represents the actual remaining driving range at 30% SOC, the vertical axis represents the model-predicted remaining driving range at 30% SOC, the dashed line represents the ideal prediction line where the predicted value equals the actual value, and the scatter plot color represents the relative point density of the test endpoints. Most test endpoints are distributed near the ideal prediction line, indicating that the LSTM-KANFormer model can maintain good consistency between the actual and predicted values ​​across different remaining driving ranges. The overall MAE of the prediction model is 2.67 km, RMSE is 4.25 km, and R... 2 It is 0.99.

[0057] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the described technical solutions or make equivalent substitutions for some of the technical features; these modifications or substitutions do not cause the substance of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for predicting the remaining driving range of a pure electric vehicle based on LSTM-KANFormer, characterized in that, Includes the following steps: S1. Obtain the original real vehicle operation data and vehicle static parameters. After performing preprocessing operations, divide the continuous discharge process according to the vehicle identification and time sequence. Divide the training set, validation set and test set according to the preset ratio with the continuous discharge process as the smallest unit. Construct a monitoring target, then construct a window by extracting current and historical data during the continuous discharge process, and output causal time series samples; S2. Construct context feature sequences of driving conditions and driving behavior based on causal time-series samples. Identify four types of driving conditions by average vehicle speed and maximum acceleration within the historical window. Generate soft probability of driving conditions, stable driving condition labels and driving condition switching status. Combine pedal operation features, multi-time-scale operation statistical features and historical energy consumption rate per unit mileage to form context feature sequences that characterize changes in the vehicle's external driving environment and driving behavior. S3. The SOC, vehicle speed, total current of the power battery, total voltage, single cell voltage, cumulative mileage, temperature and vehicle static parameters are combined into a basic state sequence. The basic state sequence and the context feature sequence are imputed and standardized using training set statistics, respectively. The basic state sequence is temporally encoded using a one-way LSTM, and feature-level scaling and bias are generated from the context feature sequence. The LSTM hidden sequence is dynamically modulated using the FiLM mechanism to output the fused feature sequence. S4. Input the fused feature sequence into the KANFormer encoder, extract the dependencies between different historical moments through pre-normalized multi-head self-attention, and retain the original temporal information through residual connections to obtain the self-attention feature sequence; input the self-attention feature into a gated hybrid feedforward sub-layer composed of standard feedforward network branches and KAN branches, process it layer by layer through a preset number of KANFormer coding blocks, and then perform attention pooling to obtain the global representation of the current state of the vehicle. Based on the global representation, the positive unit mileage energy consumption rate is predicted. The physical base mileage is calculated by combining the vehicle's rated energy, battery health status, current SOC, and full charge reference range. Then, the KAN residual output head performs nonlinear correction and range constraint to output the final remaining range prediction value, thus completing the construction of the LSTM-KANFormer model. S5. Construct a joint loss function to train the LSTM-KANFormer model, obtain the trained LSTM-KANFormer model, and complete the new energy vehicle range prediction method.

2. The method for predicting the remaining driving range of a pure electric vehicle based on LSTM-KANFormer according to claim 1, characterized in that, S1 includes the following steps: S1.1 Perform field standardization, anomaly cleaning, missing value repair, and smoothing on the original real vehicle operation data and vehicle static parameters, and output vehicle time series data; S1.2 Based on vehicle time series data, the continuous discharge process is divided according to vehicle operating status, charging and discharging status, time continuity, cumulative mileage continuity and SOC change direction. The quality is screened according to the minimum number of samples, the shortest duration and the minimum driving distance. The continuous discharge process is divided into training set, validation set and test set in 7:1:2 according to time sequence for each vehicle. S1.

3. Select continuous discharge processes that meet the preset conditions in the training set, validation set and test set respectively, and construct the main supervision target and the auxiliary supervision target; The primary monitoring target is the actual remaining driving range; The actual remaining driving range is: In the formula, The main monitoring target For a moment Cumulative mileage This refers to the cumulative mileage when the State of Charge (SOC) reaches 30%. S1.

4. Only capture current and historical data to construct a window within the same vehicle and the same continuous discharge process, without crossing charging, long-term breakpoints or mileage rollback boundaries, and align basic state features and context features according to the same endpoints to obtain causal time series samples.

3. The method for predicting the remaining driving range of a pure electric vehicle based on LSTM-KANFormer according to claim 1, characterized in that, S2 includes the following steps: S2.1 Based on the vehicle time series data in the causal time series sample, calculate the average vehicle speed and maximum acceleration within a 60-second historical window for the vehicle time series after 30 seconds of resampling. Divide the vehicle into four types of working conditions using three preset increasing speed boundaries. Generate soft probabilities for the four types of working conditions based on the relative position of the average vehicle speed and each speed boundary. The category with the highest probability is selected as the candidate working condition. To avoid abrupt changes in the operating condition label near the boundary of the increasing speed, a temperature parameter is introduced. Define cumulative probability ,in, Indicates the first The cumulative probability function corresponding to each vehicle speed boundary. For the boundary index of increasing average vehicle speed, This represents the average vehicle speed within the historical window of 60 seconds prior to time t. This indicates the classification of four types of working conditions. An increasing average vehicle speed boundary, Use the Sigmoid activation function; S2.2 When a candidate operating condition continuously meets the preset dwell conditions, update the stable operating condition label and record the operating condition dwell time, switching mark, category before and after switching, switching direction and time since the most recent switching; use the stable operating condition at the subsequent preset time domain position as the auxiliary monitoring label for the next operating condition; S2.3 Construct an 8-dimensional driving operation vector based on the mean, standard deviation, and rate of change of the accelerator and brake pedals. Form four discrete driving behavior labels through a clustering model fitted only to the training set. Statistically calculate the mean and standard deviation of vehicle speed, acceleration, jerk, pedal opening, and vehicle power within historical windows of 60 seconds, 150 seconds, and 300 seconds, respectively. Combine these with the soft probability of operating conditions, operating condition switching status, long-term historical statistics, and historical energy consumption rate per unit mileage to obtain the contextual feature sequence of operating conditions and driving behavior.

4. The method for predicting the remaining driving range of a pure electric vehicle based on LSTM-KANFormer according to claim 1, characterized in that, S3 includes the following steps: S3.

1. Establish basic state sequences and context feature sequences within the same historical window. All windows are limited to the same vehicle and the same continuous discharge process. The validation set, test set, and data to be predicted use only the fill parameters and standardized parameters determined by the training set. Output the standardized basic state sequence and standardized context feature sequence. S3.2 Input the standardized basic state sequence into a unidirectional LSTM in chronological order to extract the temporal dependency of the vehicle's operating state as it evolves with the discharge process; input the standardized context feature sequence into a linear mapping layer to obtain scaling and bias values ​​consistent with the LSTM's hidden dimension. S3.

3. The scaling amount, bias amount and LSTM hidden state at the same time are linearly modulated at the feature level. While retaining the basic time series information, the working condition, switching state and driving behavior information are injected to obtain the fused feature sequence for KANFormer encoding.

5. The method for predicting the remaining driving range of a pure electric vehicle based on LSTM-KANFormer according to claim 1, characterized in that, S4 includes the following steps: S4.1 Add temporal position information to the fused feature sequence, and generate query, key and value features after layer normalization; each attention head independently calculates scaled dot product attention, and after concatenation, obtains self-attention feature sequence through linear mapping and residual connection; S4.2 Input the self-attention features into the standard feedforward network branch and the KAN branch respectively; the standard feedforward network branch provides a stable global feature transformation path, and the KAN branch learns local nonlinear relationships through a weighted combination of basic activation and B-spline basis functions, and controls the correction strength of the KAN branch with learnable gating coefficients; after the two branches are fused, the encoded features are output through residual connection. S4.

3. Perform attention pooling on the output of each time step of the last KANFormer encoding block to obtain the global representation; output a positive energy consumption rate per unit mileage from the energy consumption rate prediction head, and determine the physical base mileage and mileage limit based on the available energy with SOC higher than 30% and the full charge reference driving range. S4.4 Input the global representation into the KAN residual output head, learn the nonlinear deviation of vehicle state, operating conditions and driving behavior on the physical base mileage, add the deviation to the physical base mileage and apply non-negative constraints and upper limit constraints to obtain the final remaining driving range prediction value.

6. The method for predicting the remaining driving range of a pure electric vehicle based on LSTM-KANFormer according to claim 5, characterized in that, In S4.2, the KAN branch mapping is represented as follows: In the formula, Represents the KAN mapping function; For the KAN mapping, the first One input feature; Input feature index; and These are the basic activation weights and spline weights, respectively. For order is B-spline basis functions; Number of grid cells; For the index of the B-spline basis functions, The index of the B-spline order. Basic activation function; The expression for the output encoded features after the two branches are fused and then connected via residuals is as follows: In the formula, The output characteristics of the gated hybrid feedforward sublayer. For KANFormer encoded block index, The output of the self-attention sublayer. For learnable gating parameters, Indicates the first KAN branch gating coefficients for each coded block; For standard feedforward mapping, It is a two-layer KAN mapping. For layer normalization, For Dropout regularization operations For the first The final output of each encoded block This is the Sigmoid activation function.

7. The method for predicting the remaining driving range of a pure electric vehicle based on LSTM-KANFormer according to claim 5, characterized in that, In S4.4, the formula for calculating the final predicted remaining driving range is as follows: In the formula, This represents the nonlinear odometer correction residual predicted by the KAN residual output head. and This represents the projection parameters of the KAN residual output head. This refers to the KAN residual mapping in the KAN residual output header; and These are projection parameters; The SOC is 30% of the predicted remaining driving range. This represents the model's final predicted remaining driving range. This is a reference mileage limit.

8. The method for predicting the remaining driving range of a pure electric vehicle based on LSTM-KANFormer according to claim 1, characterized in that, In S5, the joint loss function The expression is as follows: In the formula, , , , and The losses are, in order: main forecast loss, short-term driving distance loss at the next 1% SOC, energy consumption rate loss per unit mileage in the next 300 seconds, energy consumption rate loss per unit mileage in the next 600 seconds, and loss classified under the next operating condition. The main predicted loss, the short-term driving distance loss at the next 1% SOC, the energy consumption rate loss per unit mileage in the next 300 seconds, the energy consumption rate loss per unit mileage in the next 600 seconds, and the loss corresponding to the next operating condition classification are all included. Non-negative weights; The number of valid test endpoints; For Huber functions; For sample index, For prediction error, This is the threshold parameter for Huber loss.

9. The method for predicting the remaining driving range of a pure electric vehicle based on LSTM-KANFormer according to claim 1, characterized in that, In step S5, during the training of the LSTM-KANFormer model, the training parameters are sequence length 15, hidden dimension 96, batch size 384, and learning rate. Weight decay coefficient Dropout is 0.27, KANFormer encoding blocks are 2, KAN grids are 3, and B-spline order is 3.