A single-step iteration-based future soh timing prediction optimization method

By constructing SOH time series sequences using NGBoost and GAM algorithms, building a multi-head self-attention Transformer model, and optimizing hyperparameters, the problems of gradient vanishing and insufficient generalization ability in SOH time series prediction of power batteries are solved, and high-precision SOH prediction is achieved.

CN122451280APending Publication Date: 2026-07-24GUANGXI LIUGONG MASCH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGXI LIUGONG MASCH CO LTD
Filing Date
2026-05-07
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing power battery SOH time series prediction methods suffer from problems such as gradient vanishing, weak ability to capture long sequence dependencies, insufficient model input quality, and inability to adapt hyperparameters, resulting in limited prediction accuracy and insufficient generalization ability, making it difficult to adapt to complex and ever-changing real vehicle operating conditions.

Method used

A future SOH time series prediction method based on single-step iteration is adopted. The SOH time series is constructed by using the NGBoost capacity estimation model, combined with the GAM algorithm for smoothing and denoising, and a multi-head self-attention Transformer model is built. The PSO algorithm is used for global hyperparameter optimization to achieve adaptive matching of the model.

Benefits of technology

It improves the fitting ability to the nonlinear degradation law of battery aging, enhances the generalization and prediction accuracy of the model, adapts to the aging differences of different vehicles, and provides high-quality SOH time series prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122451280A_ABST
    Figure CN122451280A_ABST
Patent Text Reader

Abstract

The application discloses a kind of future SOH timing prediction optimization methods based on single-step iteration, comprising the following steps: step one, data preprocessing;Step two, construct SOH timing label sequence;Step three, divide timing dataset;Step four, build prediction model;Step five, hyperparameter global optimization;Step six, model training;Step seven, SOH prediction;The application introduces the architecture of Transform into real car SOH timing prediction, constructs single-step iteration model, and improves the fitting ability of the model to the nonlinear decay law of battery aging by parallel processing sequence through multi-head self-attention mechanism and capturing long-term dependence;Adopt PSO algorithm combined with timing characteristics, global optimization is verified by training set 5-fold cross-validation, adapts to different vehicle aging differences, and improves generalization;Rely on pre-training NGBoost model to complete non-complete charging segment SOH, combined with GAM algorithm smoothing denoising, improves label data quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, specifically to a future SOH time series prediction optimization method based on single-step iteration. Background Technology

[0002] As the core energy device of new energy vehicles, the State of Health (SOH) of power batteries directly determines the vehicle's driving range, operational safety, and life-cycle value. Therefore, accurate time-series prediction of power battery SOH is crucial for optimizing battery operation and maintenance strategies, reducing failure risks, and improving the efficiency of secondary utilization. Current power battery SOH time-series prediction optimization methods are mainly divided into model-based methods and data-driven methods. Model-based methods rely on complex electrochemical mechanism modeling, requiring extremely high characterization of the internal reaction laws of the battery. Moreover, the model parameters are easily affected by the real vehicle environment, have weak generalization ability, and are difficult to adapt to complex and ever-changing real vehicle operating conditions. Although data-driven methods do not require explicit mechanism modeling and only rely on historical data to mine decay patterns, they still have the following drawbacks: 1. Existing SOH time-series prediction optimization methods mostly use recurrent neural networks, but recurrent neural networks rely on recurrent structures to process time-series information, and have inherent defects such as gradient vanishing and weak ability to capture long-sequence dependencies, which cannot fully adapt to the long-term non-linearity of battery SOH. 1. Linear decay characteristics; 2. Real vehicle operation data is characterized by low sampling frequency, high noise interference, uneven charging segment depth, and complex and variable operating conditions. Existing data preprocessing methods are difficult to effectively construct high-quality full-cycle SOH time series, resulting in insufficient model input quality and limited prediction accuracy; 3. Existing technologies lack adaptive hyperparameter adjustment mechanisms for the differences in battery aging characteristics of different vehicles. Existing methods mostly use fixed hyperparameter combinations applied to all vehicles, which cannot match the diverse aging modes caused by differences in operating conditions, charging habits, and environmental conditions of different vehicles. Ultimately, this results in large fluctuations in the predictive performance of the model on different vehicles, insufficient generalization ability, and difficulty in meeting the needs of large-scale real vehicle application scenarios. Summary of the Invention

[0003] The purpose of this invention is to provide a future SOH time series prediction optimization method based on single-step iteration to solve the problems mentioned in the background art.

[0004] To achieve the above objectives, the present invention provides the following technical solution: a future SOH time series prediction optimization method based on single-step iteration, comprising the following steps: Step 1, data preprocessing; Step 2, constructing SOH time series label sequences; Step 3, partitioning the time series dataset; Step 4, building a prediction model; Step 5, global optimization of hyperparameters; Step 6, model training; Step 7, SOH prediction;

[0005] In step one above, raw data from actual vehicle operation is collected and preprocessed to construct a charging dataset;

[0006] In step two above, based on the charging dataset obtained in step one, the NGBoost capacity estimation model is trained, and the trained NGBoost capacity estimation model is used to perform batch estimation of SOH values ​​for the full charging segment, construct the SOH time series sequence of the full charging cycle, smooth and denoise the sequence using the GAM algorithm, extract the nonlinear decay trend of battery capacity, and generate the SOH time series label sequence.

[0007] In step three above, based on the SOH time-series label sequence obtained in step two, the training set and test set are divided according to the time dependency characteristics of the time-series data. A time sliding window for single-step iterative prediction is designed to complete the structured construction of training and test samples from the sequence to the point, and the sample data is normalized.

[0008] In step four above, a Transformer single-step iterative prediction model based on a multi-head self-attention mechanism is built.

[0009] In step five above, the PSO algorithm is used in combination with 5-fold cross-validation to globally adaptively optimize the hyperparameters of the Transformer model and determine the optimal combination of hyperparameters.

[0010] In step six above, the supervised training of the Transformer single-step iterative model is completed based on the optimal hyperparameter combination obtained in step five. The quantitative verification of the model performance is completed through the test set, and the future SOH time series prediction model is obtained.

[0011] In step seven above, the future SOH time-series prediction model obtained in step six is ​​deployed to the new energy vehicle battery management system. The future SOH time-series prediction model is based on vehicle charging operation data and outputs the predicted SOH value and degradation trend curve of the power battery for a specified number of future charging cycles.

[0012] In step one, the raw data of the actual vehicle operation comes from the National Monitoring and Management Platform for New Energy Vehicles.

[0013] In step one, the raw data includes time, cumulative mileage, vehicle speed, total battery voltage, total battery current, SOC, maximum temperature of a single cell, and minimum temperature of a single cell.

[0014] In step one, data preprocessing includes data cleaning, data segmentation, and data reconstruction. Data cleaning includes handling duplicate values, missing values, and outliers. Data segmentation and reconstruction are based on the vehicle's operating status, dividing and reconstructing the data into charging segments, driving segments, and parking segments to obtain a charging dataset. The specific methods are as follows:

[0015] Preliminary determination: When the vehicle is in charging mode, it meets the conditions of zero vehicle speed and total current less than zero. Based on this, the initial charging dataset is extracted. ;

[0016] Fragment segmentation: Calculate the initial charging dataset The time interval between two consecutive frames of data ,when When the previous frame is used as the end point of the current charging segment and the next frame is used as the start point of the next charging segment, the independent charging segment is divided.

[0017] Valid charging segment selection: For the initial charging dataset The charging segments in the dataset are then further filtered to obtain the charging dataset. .

[0018] The secondary screening condition is: retain , The charging segment, in which, For the first SOC value of each sample The SOC difference at the beginning and end of a single segment charge.

[0019] Step two specifically includes the following steps:

[0020] S2.1 Basic SOH Estimation Model Pre-training: Based on the charging dataset obtained in Step 1 The usable battery capacity for each segment is calculated through inverse ampere-hour integration. Outliers are removed using a box plot method, and the capacity is smoothed by a Savitzky-Golay filter to obtain a reference capacity. Using the reference capacity as a label and health features extracted from each charging segment as input, an NGBoost capacity estimation model is pre-trained. The discrete calculation formula for usable battery capacity is as follows:

[0021]

[0022] In the formula, This represents the current available capacity of the battery. For the first The charging current of each sample The sampling interval is... The SOC interval length for a single charging segment;

[0023] S2.2 Full Charge Cycle SOH Value Completion: This involves correcting the SOH value in step one. For the remaining charging segments that are not sufficiently charged, the corresponding health features are extracted and input into the pre-trained NGBoost capacity estimation model to obtain the SOH estimate of the corresponding segment. The reference capacity of the deep charging segment and the SOH estimate of the remaining charging segment are merged in the order of charging time to obtain the initial full charging cycle SOH time series sequence.

[0024] S2.3 Time Series Smoothing and Denoising: The GAM algorithm is used to smooth the initial full-charge cycle SOH time series, eliminating data noise and abnormal fluctuations, and extracting the nonlinear decay trend of battery capacity with the number of charging cycles. The sequence corrected by the GAM algorithm is used as the final SOH time series label sequence. The basic expression of the GAM algorithm is:

[0025]

[0026] In the formula, For the first Battery capacity per charging cycle For the join function, For the intercept term, It is a nonparametric smoothing function. For the first The first sample One predictor variable.

[0027] Step three specifically includes the following steps:

[0028] S3.1 Time Series Dataset Partitioning: Based on the SOH time series label sequence obtained in step two, the training set and test set are divided in a 4:1 ratio according to the time order. The SOH sequences corresponding to the first 4 / 5 charging cycles are used as the training set for the model to learn the decay law of battery SOH; the SOH sequences corresponding to the last 1 / 5 charging cycles are used as the test set for verifying the model's prediction performance and generalization ability.

[0029] S3.2 Sliding Window Construction for Single-Step Iteration Samples: A time sliding window method is used to construct the predicted samples for each point in the single-step iteration sequence. The specific rule is as follows: the time window length is set to... , in continuous The SOH value of the historical charging cycle is used as the model input feature, with the first historical charging cycle as the input feature. The SOH value of each charging cycle is the model prediction label. By traversing the entire SOH time series through a sliding window, the structured construction of all training and test samples is completed.

[0030] S3.3 Data Normalization Processing: The max-min normalization method is used to linearly transform the input feature and label data of all samples, uniformly scaling the values ​​to a minimum. Interval.

[0031] Step four specifically includes the following steps:

[0032] S4.1 Input Position Encoding Module Design: Sine-cosine position encoding is added to the input layer to inject temporal position information into the input sequence. The position encoding formula is as follows:

[0033]

[0034]

[0035] In the formula, This represents the dimension index of the position encoding vector. Indicates location, The dimension of the word embedding is represented; the positional encoding is added element by element to the word embedding result of the input sequence to obtain the final model input vector;

[0036] S4.2 encoder module setup: The encoder consists of... The system consists of stacked identical coding layers. Each coding layer contains two core sub-layers: a multi-head self-attention sub-layer and a feedforward fully connected sub-layer. Each sub-layer employs a structure combining residual connections and layer normalization. The multi-head self-attention sub-layer uses a scaled dot product attention mechanism to map the input vector to a query matrix Q, a key matrix K, and a value matrix V. It performs h independent attention calculations in parallel, and the outputs of each head are concatenated and linearly transformed to obtain the final output. The formula for calculating the scaled dot product attention is:

[0037]

[0038] In the formula, Key matrix The dimension is used to scale the dot product result to avoid the value being too large;

[0039] The feedforward fully connected sublayer consists of two linear transformation layers and an intermediate ReLU activation function, which performs feature transformation and nonlinear mapping on the output of the attention sublayer. The expression is as follows:

[0040]

[0041] In the formula, , The weight matrix is ​​a linear transformation matrix. , It is the bias vector;

[0042] S4.3 decoder module setup: The decoder consists of... The system consists of stacked decoding layers with identical structures. Each decoding layer contains three core sublayers: a masked multi-head self-attention sublayer, an encoder-decoder attention sublayer, and a feedforward fully connected sublayer. Each sublayer employs a residual connection combined with a layer normalization structure. The masked multi-head self-attention sublayer ensures that the prediction of the current position relies only on existing historical sequence information by masking information about future positions, which conforms to the logic of autoregressive prediction. The encoder-decoder attention sublayer uses the encoder output as the key matrix K and the value matrix V, and the output of the masked attention sublayer as the query matrix Q, to achieve global information fusion of the encoder output.

[0043] S4.4 Output Prediction Module Design: The final output of the decoder is mapped to a single-dimensional output vector through a linear transformation layer, corresponding to the SOH value of the next charging cycle predicted in a single step iteration, thus completing the closed loop of the sequence-to-point prediction logic.

[0044] Step five specifically includes the following steps:

[0045] S5.1 Hyperparameters to be optimized and search range settings: Setting the time window length Number of encoder stacking layers Number of decoder stacking layers and the number of training rounds of the model;

[0046] S5.2 Particle Swarm Optimization Algorithm Initialization: Initialize the particle swarm, where each particle represents a set of hyperparameter combinations. Set the particle swarm size, maximum number of iterations, and inertia weight. Individual learning factors Group learning factor The fitness function is the root mean square error of the model prediction results. The smaller the fitness value, the better the performance of the hyperparameter combination corresponding to the particle.

[0047] S5.3 Fitness calculation based on 5-fold cross-validation: The training set is evenly divided into 5 non-overlapping subsets. Each time, 4 subsets are selected as training subsets and 1 subset is selected as validation subset. The cross-validation is completed in 5 cycles. The average RMSE of the 5 validation results is used as the fitness value of the particle.

[0048] S5.4 Particle Iterative Update and Optimal Solution Optimization: In each iteration, the particle's velocity and position are updated based on the individual historical best position and the group's global best position. The update formula is as follows:

[0049]

[0050]

[0051] in, and It is a particle In the In the nth iteration Dimensional velocity and position, and It is a particle and groups in In the next iteration Dimension's historical best position and It is a particle In the In the nth iteration Dimensional velocity and position, It is inertial weight. and It consists of individual learning factors and group learning factors. and yes Random numbers within a certain range;

[0052] S5.5 Determination of the optimal hyperparameter combination: After iterating to the termination condition, select the hyperparameter combination corresponding to the global optimal position as the optimal hyperparameter combination of the Transformer single-step iterative prediction model; where the termination condition is either the maximum number of iterations or the convergence of the fitness value.

[0053] In step six, the quantitative verification uses MAPE and RMSE as evaluation indicators, as shown in the following formula:

[0054]

[0055]

[0056] In the formula, For the first The true SOH value of each sample. These are the model's predicted values. This represents the total number of test samples.

[0057] Compared with existing technologies, the beneficial effects of this invention are as follows: This invention introduces the Transformer architecture into real-vehicle SOH time-series prediction, constructs a single-step iterative model, and improves the model's ability to fit the nonlinear degradation law of battery aging by using a multi-head self-attention mechanism to process sequences in parallel and capture long-term dependencies; it adopts the PSO algorithm combined with time-series characteristics, and uses 5-fold cross-validation on the training set for global optimization to adapt to the aging differences of different vehicles and improve generalization; it relies on the pre-trained NGBoost model to complete incomplete charging segment SOH, and combines the GAM algorithm for smoothing and denoising, thereby improving the quality of the labeled data. Attached Figure Description

[0058] Figure 1This is a framework for SOH point estimation based on the NGBoost algorithm;

[0059] Figure 2 This is a schematic diagram of the charging segment processing flow;

[0060] Figure 3 The results of using box plots to filter the calculated capacity data; (a) before box plot filtering; (b) after box plot filtering;

[0061] Figure 4 This is a schematic diagram of the box-type structure;

[0062] Figure 5 A schematic diagram of the NGBoost algorithm;

[0063] Figure 6 This is a diagram illustrating 5-fold cross-validation;

[0064] Figure 7 A schematic diagram of NGBoost hyperparameter optimization;

[0065] Figure 8 The graph shows the number of iterations versus evaluation metrics during the NGBoost training process.

[0066] Figure 9 The image shows the prediction results of the NGBoost capacity estimation model based on the optimal hyperparameters.

[0067] Figure 10 Comparison of hyperparameter optimization results for other machine learning models; (a) AdaBoost; (b) CatBoost; (c) GBDT; (d) LGBM; (e) XGBoost; (f) RFR;

[0068] Figure 11 Comparison of estimation results of other machine learning models on a test set of vehicles; (a) AdaBoost; (b) RFR; (c) GBDT; (d) XGBoost; (e) LGBM; (f) CatBoost;

[0069] Figure 12 A comparison plot of the estimation errors of all optimized models across the entire test set; (a) MAPE; (b) RMSE;

[0070] Figure 13 This is the uncertainty estimation result of the NGBoost capacity estimation model on a certain test set of vehicles;

[0071] Figure 14 The following are the uncertainty estimation results of the competing model on a certain test set of vehicles; (a) BR; (b) GPR;

[0072] Figure 15The uncertainty estimation results for all models across the entire test set;

[0073] Figure 16 Comparison of GAM algorithm correction results: (a) SOH estimation of battery pack during full charge cycle (I); (b) Capacity correction results (I); (c) SOH estimation of battery pack during full charge cycle (II); (d) Capacity correction results (II).

[0074] Figure 17 This is a schematic diagram of the overall structure of the Transformer;

[0075] Figure 18 This is a schematic diagram of the single-step iterative training and prediction phases;

[0076] Figure 19 For the prediction performance of all models on two different vehicles; (a) prediction start point is 993 cycles; (b) prediction start point is 995 cycles;

[0077] Figure 20 The average prediction performance of different models across all vehicles;

[0078] Figure 21 This is a flowchart of the method of the present invention. Detailed Implementation

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

[0080] Please see the appendix Figure 1 -Appendix Figure 21 The present invention provides an embodiment of a future SOH time series prediction optimization method based on single-step iteration, comprising the following steps: Step 1, data preprocessing; Step 2, constructing SOH time series label sequences; Step 3, partitioning the time series dataset; Step 4, building a prediction model; Step 5, global optimization of hyperparameters; Step 6, model training; Step 7, SOH prediction.

[0081] In step one above, raw data from actual vehicle operation is collected and preprocessed to construct a charging dataset. The raw data comes from the National Monitoring and Management Platform for New Energy Vehicles and includes time, cumulative mileage, vehicle speed, total battery voltage, total battery current, SOC, maximum temperature of individual cells, and minimum temperature of individual cells. Data preprocessing includes data cleaning, data segmentation, and data reconstruction. Data cleaning includes handling duplicate values, missing values, and outliers. Data segmentation and reconstruction are based on the vehicle's operating status, dividing and reconstructing the data into charging segments, driving segments, and parking segments to obtain the charging dataset. The specific methods are as follows:

[0082] Preliminary determination: When the vehicle is in charging mode, it meets the conditions of zero vehicle speed and total current less than zero. Based on this, the initial charging dataset is extracted. ;

[0083] Fragment segmentation: Calculate the initial charging dataset The time interval between two consecutive frames of data ,when When the previous frame is used as the end point of the current charging segment and the next frame is used as the start point of the next charging segment, the independent charging segment is divided.

[0084] Valid charging segment selection: For the initial charging dataset The charging segments in the dataset are then further filtered to obtain the charging dataset. The secondary screening criteria are: retain , The charging segment, in which, For the first SOC value of each sample The SOC difference at the beginning and end of a single-segment charge;

[0085] In step two above, based on the charging dataset obtained in step one, the NGBoost capacity estimation model is trained. The trained NGBoost capacity estimation model is then used to perform batch estimation of the SOH value for the full charging segment, constructing a full charging cycle SOH time series sequence. The sequence is then smoothed and denoised using the GAM algorithm to extract the nonlinear decay trend of battery capacity, generating an SOH time series label sequence. Specifically, this includes the following steps:

[0086] S2.1 Basic SOH Estimation Model Pre-training: Based on the charging dataset obtained in Step 1 The usable battery capacity for each segment is calculated through inverse ampere-hour integration. Outliers are removed using a box plot method, and the capacity is smoothed by a Savitzky-Golay filter to obtain a reference capacity. Using the reference capacity as a label and health features extracted from each charging segment as input, an NGBoost capacity estimation model is pre-trained. The discrete calculation formula for usable battery capacity is as follows:

[0087]

[0088] In the formula, This represents the current available capacity of the battery. For the first The charging current of each sample The sampling interval is... The SOC interval length for a single charging segment;

[0089] S2.2 Full Charge Cycle SOH Value Completion: This involves correcting the SOH value in step one. For the remaining charging segments that are not sufficiently charged, the corresponding health features are extracted and input into the pre-trained NGBoost capacity estimation model to obtain the SOH estimate of the corresponding segment. The reference capacity of the deep charging segment and the SOH estimate of the remaining charging segment are merged in the order of charging time to obtain the initial full charging cycle SOH time series sequence.

[0090] S2.3 Time Series Smoothing and Denoising: The GAM algorithm is used to smooth the initial full-charge cycle SOH time series, eliminating data noise and abnormal fluctuations, and extracting the nonlinear decay trend of battery capacity with the number of charging cycles. The sequence corrected by the GAM algorithm is used as the final SOH time series label sequence. The basic expression of the GAM algorithm is:

[0091]

[0092] In the formula, For the first Battery capacity per charging cycle For the join function, For the intercept term, It is a nonparametric smoothing function. For the first The first sample One predictor variable;

[0093] In step three above, based on the SOH time-series label sequence obtained in step two, the training and test sets are divided according to the time dependency characteristics of the time-series data. A time sliding window for single-step iterative prediction is designed to complete the structured construction of training and test samples from the sequence to the point, and the sample data is normalized. Specifically, the steps include:

[0094] S3.1 Time Series Dataset Partitioning: Based on the SOH time series label sequence obtained in step two, the training set and test set are divided in a 4:1 ratio according to the time order. The SOH sequences corresponding to the first 4 / 5 charging cycles are used as the training set for the model to learn the decay law of battery SOH; the SOH sequences corresponding to the last 1 / 5 charging cycles are used as the test set for verifying the model's prediction performance and generalization ability.

[0095] S3.2 Sliding Window Construction for Single-Step Iteration Samples: A time sliding window method is used to construct the predicted samples for each point in the single-step iteration sequence. The specific rule is as follows: the time window length is set to... , in continuous The SOH value of the historical charging cycle is used as the model input feature, with the first historical charging cycle as the input feature. The SOH value of each charging cycle is the model prediction label. By traversing the entire SOH time series through a sliding window, the structured construction of all training and test samples is completed.

[0096] S3.3 Data Normalization Processing: The max-min normalization method is used to linearly transform the input feature and label data of all samples, uniformly scaling the values ​​to a minimum. interval;

[0097] In step four above, a Transformer single-step iterative prediction model based on a multi-head self-attention mechanism is built; specifically, the following steps are included:

[0098] S4.1 Input Position Encoding Module Design: Sine-cosine position encoding is added to the input layer to inject temporal position information into the input sequence. The position encoding formula is as follows:

[0099]

[0100]

[0101] In the formula, This represents the dimension index of the position encoding vector. Indicates location, The dimension of the word embedding is represented; the positional encoding is added element by element to the word embedding result of the input sequence to obtain the final model input vector;

[0102] S4.2 encoder module setup: The encoder consists of... The system consists of stacked identical coding layers. Each coding layer contains two core sub-layers: a multi-head self-attention sub-layer and a feedforward fully connected sub-layer. Each sub-layer employs a structure combining residual connections and layer normalization. The multi-head self-attention sub-layer uses a scaled dot product attention mechanism to map the input vector to a query matrix Q, a key matrix K, and a value matrix V. It performs h independent attention calculations in parallel, and the outputs of each head are concatenated and linearly transformed to obtain the final output. The formula for calculating the scaled dot product attention is:

[0103]

[0104] In the formula, Key matrix The dimension is used to scale the dot product result to avoid the value being too large;

[0105] The feedforward fully connected sublayer consists of two linear transformation layers and an intermediate ReLU activation function, which performs feature transformation and nonlinear mapping on the output of the attention sublayer. The expression is as follows:

[0106]

[0107] In the formula, , The weight matrix is ​​a linear transformation matrix. , It is the bias vector;

[0108] S4.3 decoder module setup: The decoder consists of... The system consists of stacked decoding layers with identical structures. Each decoding layer contains three core sublayers: a masked multi-head self-attention sublayer, an encoder-decoder attention sublayer, and a feedforward fully connected sublayer. Each sublayer employs a residual connection combined with a layer normalization structure. The masked multi-head self-attention sublayer ensures that the prediction of the current position relies only on existing historical sequence information by masking information about future positions, which conforms to the logic of autoregressive prediction. The encoder-decoder attention sublayer uses the encoder output as the key matrix K and the value matrix V, and the output of the masked attention sublayer as the query matrix Q, to achieve global information fusion of the encoder output.

[0109] S4.4 Output Prediction Module Design: The final output of the decoder is mapped to a single-dimensional output vector through a linear transformation layer, corresponding to the SOH value of the next charging cycle predicted in a single step iteration, thus completing the closed loop of the sequence-to-point prediction logic.

[0110] In step five above, the PSO algorithm, combined with 5-fold cross-validation, is used to globally adaptively optimize the hyperparameters of the Transformer model and determine the optimal combination of hyperparameters. Specifically, this includes the following steps:

[0111] S5.1 Hyperparameters to be optimized and search range settings: Setting the time window length Number of encoder stacking layers Number of decoder stacking layers and the number of training rounds of the model;

[0112] S5.2 Particle Swarm Optimization Algorithm Initialization: Initialize the particle swarm, where each particle represents a set of hyperparameter combinations. Set the particle swarm size, maximum number of iterations, and inertia weight. Individual learning factors Group learning factor The fitness function is the root mean square error of the model prediction results. The smaller the fitness value, the better the performance of the hyperparameter combination corresponding to the particle.

[0113] S5.3 Fitness calculation based on 5-fold cross-validation: The training set is evenly divided into 5 non-overlapping subsets. Each time, 4 subsets are selected as training subsets and 1 subset is selected as validation subset. The cross-validation is completed in 5 cycles. The average RMSE of the 5 validation results is used as the fitness value of the particle.

[0114] S5.4 Particle Iterative Update and Optimal Solution Optimization: In each iteration, the particle's velocity and position are updated based on the individual historical best position and the group's global best position. The update formula is as follows:

[0115]

[0116]

[0117] in, and It is a particle In the In the nth iteration Dimensional velocity and position, and It is a particle and groups in In the next iteration Dimension's historical best position and It is a particle In the In the nth iteration Dimensional velocity and position, It is inertial weight. and It consists of individual learning factors and group learning factors. and yes Random numbers within a certain range;

[0118] S5.5 Determination of the optimal hyperparameter combination: After iterating to the termination condition, the hyperparameter combination corresponding to the global optimal position is selected as the optimal hyperparameter combination of the Transformer single-step iterative prediction model; where the termination condition is either the maximum number of iterations or the convergence of the fitness value.

[0119] In step six above, supervised training of the Transformer single-step iterative model is completed based on the optimal hyperparameter combination obtained in step five. The model performance is then quantitatively validated using a test set to obtain the future SOH time-series prediction model. The quantitative validation uses MAPE and RMSE as evaluation metrics, as shown in the following formulas:

[0120]

[0121]

[0122] In the formula, For the first The true SOH value of each sample. These are the model's predicted values. The total number of test samples;

[0123] In step seven above, the future SOH time-series prediction model obtained in step six is ​​deployed to the new energy vehicle battery management system. The future SOH time-series prediction model is based on vehicle charging operation data and outputs the predicted SOH value and degradation trend curve of the power battery for a specified number of future charging cycles.

[0124] Experimental Example 1:

[0125] To verify the effectiveness of the proposed NGBoost capacity estimation model, it was compared with six other machine learning models, including categorical boosting (CatBoost), adaptive boosting (AdaBoost), lightweight gradient boosting machine (LGBM), random forest regression (RFR), gradient boosting decision tree (GBDT), and extreme gradient boosting (XGBoost). To ensure the objectivity and reliability of the evaluation results, all algorithms were trained on the same training set using particle swarm optimization (PSO) for hyperparameter optimization, and their accuracy was compared on the same test set using an error metric. Figure 10The results of hyperparameter optimization are shown; unoptimized parameters are set to their default values. The capacity estimation results of all optimized models on a specific test set of vehicles and the estimation errors across the entire test set are shown below. Figure 11 and Figure 12 As shown, the proposed NGBoost capacity estimation model achieved the highest estimation accuracy, with MAPE and RMSE of 0.817% and 1.156 Ah, respectively. In contrast, XGBoost performed the worst on the test set, with MAPE and RMSE of 1.149% and 1.587 Ah, respectively. The experimental results validate the effectiveness and superiority of the NGBoost capacity estimation model, demonstrating better point estimation and generalization capabilities compared to other methods.

[0126] Experimental Example 2:

[0127] To verify the uncertainty estimation performance of the NGBoost capacity estimation model proposed in this invention, it was compared with the GPR and BR models. To ensure the objectivity and credibility of the evaluation results, all models were trained and tested on the same training and test sets, and a unified evaluation metric, weighted combined loss (WCL), was used for performance comparison. WCL can be obtained by weighted summation of PICP and PINAW, with each weight set to 0.5. The smaller the WCL value, the better the model's prediction performance. PICP measures the proportion of the predicted interval containing the true value, reflecting the reliability of the uncertainty estimation. The closer this proportion is to the preset confidence level, the higher the accuracy of the predicted interval. Its calculation formula is as follows:

[0128]

[0129] in, For the sample size, It is the first The true value of each sample and They are the first The lower and upper limits of the prediction interval for each sample. It is an indicator function; it takes the value 1 if the condition inside the parentheses is true, and 0 otherwise.

[0130] PINAW measures the average width of the prediction interval and normalizes it to the range of true values. The smaller the value, the narrower the prediction interval and the higher the prediction accuracy. It is expressed as:

[0131]

[0132] in, and These are the maximum and minimum values ​​of the actual value, respectively.

[0133] Depend on Figure 13 , Figure 14 and Figure 15 It can be seen that the BR model performs best on PICP, reaching 0.933. However, its PINAW value is 0.517, indicating that the prediction interval is relatively wide, resulting in a high WCL (0.292), which indicates an overly conservative problem. Although the GPR model has the smallest PINAW (0.144) and a more compact prediction interval, its PICP is only 0.482, which is much lower than the other models. This indicates that its confidence interval cannot effectively cover the true value, resulting in poor prediction reliability. Ultimately, it has the highest WCL (0.331). Considering all three indicators, the NGBoost model achieves a good balance between PICP and PINAW, with PICP of 0.803 and PINAW of 0.329. It controls the interval width while ensuring a high coverage of the prediction interval, resulting in the lowest WCL value of only 0.263. Therefore, compared with the other two models, NGBoost has a better overall performance in uncertainty estimation tasks, providing a prediction interval that is both reliable and discriminative, demonstrating strong practicality and generalization ability.

[0134] Experimental Example 3:

[0135] To verify the effectiveness of the GAM algorithm proposed in this invention, the reference capacity values ​​before and after the GAM algorithm correction are compared. Figure 16 As can be seen, after correction by the GAM algorithm, the nonlinear degradation trend of the battery is more accurately characterized, while eliminating the interference of outliers and noise.

[0136] Experiment Example 4:

[0137] To verify the effectiveness of the proposed Transformer single-step iterative prediction model, the prediction performance of the Transformer model was compared with that of four other popular temporal prediction algorithms, including Temporal Convolutional Network (TCN), Recurrent Neural Network (RNN), Long Short-Term Memory Model (LSTM), and Gated Recurrent Unit (GRU). To improve the credibility of the comparison, all algorithms were trained on the same training set and their accuracy was compared using the error metrics MAPE and RMSE on the same test set. Figure 19The prediction performance of all models on two different vehicles is shown. As can be seen from the figure, the Transformer model is closest to the actual situation in restoring the battery capacity trend, and the prediction results are basically consistent with the actual capacity changes. In contrast, the prediction accuracy of LSTM and GRU is slightly lower, while TCN and RNN perform relatively poorly. This shows that Transformer has a stronger ability to extract information when processing input sequences, thus achieving better prediction results. Figure 20 The results demonstrate the prediction performance of all models on the test set using data from 50 real vehicles. It can be seen that the proposed Transformer model achieves the highest prediction accuracy, with average MAPE and RMSE of 0.173% and 0.431 Ah for the 50 vehicles, respectively. GRU and LSTM perform next, with MAPE and RMSE of 0.229% and 0.565 Ah, and 0.201% and 0.501 Ah, respectively. RNN performs poorly, with MAPE and RMSE of 0.455% and 1.110 Ah, respectively. TCN performs the worst on the test set, with MAPE and RMSE of 0.596% and 1.389 Ah, respectively. The experimental results validate the effectiveness and superiority of the Transformer model, demonstrating better prediction performance and generalization ability compared to other methods.

[0138] Based on the above, the advantages of this invention are as follows: When used, the Transformer architecture is introduced into the real-world vehicle SOH timing prediction task to construct a single-step iterative prediction model from sequence to point; parallel processing of the input sequence is achieved through a multi-head self-attention mechanism, effectively capturing the long-term dependencies of the SOH decay sequence, solving the inherent defects of recurrent neural network models such as gradient vanishing, difficulty in learning long-sequence dependencies, and inability to perform parallel computation, significantly improving the model's ability to fit the nonlinear decay law of battery aging; and the PSO algorithm is adopted, combined with the timing dependency characteristics of timing data, to optimize key hyperparameters on the training set. The model employs global optimization with 50% cross-validation to achieve adaptive optimal matching of model hyperparameters, addressing the issue of insufficient generalization performance caused by differences in battery aging characteristics across different vehicles. Based on a pre-trained NGBoost capacity estimation model, it achieves batch completion of SOH values ​​for incomplete charging segments. Combined with the GAM algorithm, it smooths and denoises the SOH sequence, accurately extracting the nonlinear decay trend of battery capacity. This solves the pain points of uneven charging segment depth, missing SOH labels, and data noise interference in real vehicle operation data, making it difficult to construct effective samples for time series prediction. It provides high-quality, full-cycle labeled data for time series prediction models.

[0139] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

Claims

1. A future SOH time series prediction optimization method based on single-step iteration, comprising the following steps: Step 1: Data preprocessing; Step 2: Constructing SOH time-series label sequences; Step 3: Dividing the time-series dataset; Step 4: Building a prediction model; Step 5: Global hyperparameter optimization; Step 6: Model training; Step 7: SOH prediction; Its key feature is: In step one above, raw data from actual vehicle operation is collected and preprocessed to construct a charging dataset; In step two above, based on the charging dataset obtained in step one, the NGBoost capacity estimation model is trained, and the trained NGBoost capacity estimation model is used to perform batch estimation of SOH values ​​for the full charging segment, construct the SOH time series sequence of the full charging cycle, smooth and denoise the sequence using the GAM algorithm, extract the nonlinear decay trend of battery capacity, and generate the SOH time series label sequence. In step three above, based on the SOH time-series label sequence obtained in step two, the training set and test set are divided according to the time dependency characteristics of the time-series data. A time sliding window for single-step iterative prediction is designed to complete the structured construction of training and test samples from the sequence to the point, and the sample data is normalized. In step four above, a Transformer single-step iterative prediction model based on a multi-head self-attention mechanism is built. In step five above, the PSO algorithm is used in combination with 5-fold cross-validation to globally adaptively optimize the hyperparameters of the Transformer model and determine the optimal combination of hyperparameters. In step six above, the supervised training of the Transformer single-step iterative model is completed based on the optimal hyperparameter combination obtained in step five. The quantitative verification of the model performance is completed through the test set, and the future SOH time series prediction model is obtained. In step seven above, the future SOH time-series prediction model obtained in step six is ​​deployed to the new energy vehicle battery management system. The future SOH time-series prediction model is based on vehicle charging operation data and outputs the predicted SOH value and degradation trend curve of the power battery for a specified number of future charging cycles.

2. The future SOH time series prediction optimization method based on single-step iteration according to claim 1, characterized in that: In step one, the raw data of the actual vehicle operation comes from the National Monitoring and Management Platform for New Energy Vehicles.

3. The future SOH time series prediction optimization method based on single-step iteration according to claim 1, characterized in that: In step one, the raw data includes time, cumulative mileage, vehicle speed, total battery voltage, total battery current, SOC, maximum temperature of a single cell, and minimum temperature of a single cell.

4. The future SOH time series prediction optimization method based on single-step iteration according to claim 1, characterized in that: In step one, data preprocessing includes data cleaning, data segmentation, and data reconstruction. Data cleaning includes handling duplicate values, missing values, and outliers. Data segmentation and reconstruction are based on the vehicle's operating status, dividing and reconstructing the data into charging segments, driving segments, and parking segments to obtain a charging dataset. The specific methods are as follows: Preliminary determination: When the vehicle is in charging mode, it meets the conditions of zero vehicle speed and total current less than zero. Based on this, the initial charging dataset is extracted. ; Fragment segmentation: Calculate the initial charging dataset The time interval between two consecutive frames of data ,when When the previous frame is used as the end point of the current charging segment and the next frame is used as the start point of the next charging segment, the independent charging segment is divided. Valid charging segment selection: For the initial charging dataset The charging segments in the dataset are then further filtered to obtain the charging dataset. .

5. The future SOH time series prediction optimization method based on single-step iteration according to claim 4, characterized in that: The secondary screening condition is: retain , The charging segment, in which, For the first SOC value of each sample The SOC difference at the beginning and end of a single-segment charge.

6. The future SOH time series prediction optimization method based on single-step iteration according to claim 1, characterized in that: Step two specifically includes the following steps: S2.1 Basic SOH Estimation Model Pre-training: Based on the charging dataset obtained in Step 1 The usable battery capacity for each segment is calculated through inverse ampere-hour integration. Outliers are removed using a box plot method, and the capacity is smoothed by a Savitzky-Golay filter to obtain a reference capacity. Using the reference capacity as a label and health features extracted from each charging segment as input, an NGBoost capacity estimation model is pre-trained. The discrete calculation formula for usable battery capacity is as follows: In the formula, This represents the current available capacity of the battery. For the first The charging current of each sample The sampling interval is... The SOC interval length for a single charging segment; S2.2 Full Charge Cycle SOH Value Completion: This involves correcting the SOH value in step one. For the remaining charging segments that are not sufficiently charged, the corresponding health features are extracted and input into the pre-trained NGBoost capacity estimation model to obtain the SOH estimate of the corresponding segment. The reference capacity of the deep charging segment and the SOH estimate of the remaining charging segment are merged in the order of charging time to obtain the initial full charging cycle SOH time series sequence. S2.3 Time Series Smoothing and Denoising: The GAM algorithm is used to smooth the initial full-charge cycle SOH time series, eliminating data noise and abnormal fluctuations, and extracting the nonlinear decay trend of battery capacity with the number of charging cycles. The sequence corrected by the GAM algorithm is used as the final SOH time series label sequence. The basic expression of the GAM algorithm is: In the formula, For the first Battery capacity per charging cycle For the join function, For the intercept term, It is a nonparametric smoothing function. For the first The first sample One predictor variable.

7. The future SOH time series prediction optimization method based on single-step iteration according to claim 1, characterized in that: Step three specifically includes the following steps: S3.1 Time Series Dataset Partitioning: Based on the SOH time series label sequence obtained in step two, the training set and test set are divided in a 4:1 ratio according to the time order. The SOH sequences corresponding to the first 4 / 5 charging cycles are used as the training set for the model to learn the decay law of battery SOH; the SOH sequences corresponding to the last 1 / 5 charging cycles are used as the test set for verifying the model's prediction performance and generalization ability. S3.2 Sliding Window Construction for Single-Step Iteration Samples: A time sliding window method is used to construct the predicted samples for each point in the single-step iteration sequence. The specific rule is as follows: the time window length is set to... , in continuous The SOH value of the historical charging cycle is used as the model input feature, with the first historical charging cycle as the input feature. The SOH value of each charging cycle is the model prediction label. By traversing the entire SOH time series through a sliding window, the structured construction of all training and test samples is completed. S3.3 Data Normalization Processing: A max-min normalization method is used to linearly transform the input feature and label data of all samples, uniformly scaling the values ​​to a minimum. Interval.

8. The future SOH time series prediction optimization method based on single-step iteration according to claim 1, characterized in that: Step four specifically includes the following steps: S4.1 Input Position Encoding Module Design: Sine-cosine position encoding is added to the input layer to inject temporal position information into the input sequence. The position encoding formula is as follows: In the formula, This represents the dimension index of the position encoding vector. Indicates location, The dimension of the word embedding is represented; the positional encoding is added element by element to the word embedding result of the input sequence to obtain the final model input vector; S4.2 encoder module setup: The encoder consists of... The system consists of stacked identical coding layers. Each coding layer contains two core sub-layers: a multi-head self-attention sub-layer and a feedforward fully connected sub-layer. Each sub-layer employs a structure combining residual connections and layer normalization. The multi-head self-attention sub-layer uses a scaled dot product attention mechanism to map the input vector to a query matrix Q, a key matrix K, and a value matrix V. It performs h independent attention calculations in parallel, and the outputs of each head are concatenated and linearly transformed to obtain the final output. The formula for calculating the scaled dot product attention is: In the formula, Key matrix The dimension is used to scale the dot product result to avoid the value being too large; The feedforward fully connected sublayer consists of two linear transformation layers and an intermediate ReLU activation function, which performs feature transformation and nonlinear mapping on the output of the attention sublayer. The expression is as follows: In the formula, , The weight matrix is ​​a linear transformation matrix. , It is the bias vector; S4.3 decoder module setup: The decoder consists of... The system consists of stacked decoding layers with identical structures. Each decoding layer contains three core sublayers: a masked multi-head self-attention sublayer, an encoder-decoder attention sublayer, and a feedforward fully connected sublayer. Each sublayer employs a residual connection combined with a layer normalization structure. The masked multi-head self-attention sublayer ensures that the prediction of the current position relies only on existing historical sequence information by masking information about future positions, which conforms to the logic of autoregressive prediction. The encoder-decoder attention sublayer uses the encoder output as the key matrix K and the value matrix V, and the output of the masked attention sublayer as the query matrix Q, to achieve global information fusion of the encoder output. S4.4 Output Prediction Module Design: The final output of the decoder is mapped to a single-dimensional output vector through a linear transformation layer, corresponding to the SOH value of the next charging cycle predicted in a single step iteration, thus completing the closed loop of the sequence-to-point prediction logic.

9. The future SOH time series prediction optimization method based on single-step iteration according to claim 1, characterized in that: Step five specifically includes the following steps: S5.1 Hyperparameters to be optimized and search range settings: Setting the time window length Number of encoder stacking layers Number of decoder stacking layers and the number of training rounds of the model; S5.2 Particle Swarm Optimization Algorithm Initialization: Initialize the particle swarm, where each particle represents a set of hyperparameter combinations. Set the particle swarm size, maximum number of iterations, and inertia weight. Individual learning factors Group learning factor The fitness function is the root mean square error of the model prediction results. The smaller the fitness value, the better the performance of the hyperparameter combination corresponding to the particle. S5.3 Fitness calculation based on 5-fold cross-validation: The training set is evenly divided into 5 non-overlapping subsets. Each time, 4 subsets are selected as training subsets and 1 subset is selected as validation subset. The cross-validation is completed in 5 cycles. The average RMSE of the 5 validation results is used as the fitness value of the particle. S5.4 Particle Iterative Update and Optimal Solution Optimization: In each iteration, the particle's velocity and position are updated based on the individual historical best position and the group's global best position. The update formula is as follows: in, and It is a particle In the In the nth iteration Dimensional velocity and position, and It is a particle and groups in the In the next iteration Dimension's historical best position and It is a particle In the In the nth iteration Dimensional velocity and position, It is inertial weight. and It consists of individual learning factors and group learning factors. and yes A random number within a given range; S5.5 Determination of the optimal hyperparameter combination: After iterating to the termination condition, select the hyperparameter combination corresponding to the global optimal position as the optimal hyperparameter combination of the Transformer single-step iterative prediction model; where the termination condition is either the maximum number of iterations or the convergence of the fitness value.

10. The future SOH time series prediction optimization method based on single-step iteration according to claim 1, characterized in that: In step six, the quantitative verification uses MAPE and RMSE as evaluation indicators, as shown in the following formula: In the formula, For the first The true SOH value of each sample. These are the model's predicted values. This represents the total number of test samples.