Hyper-parameter optimization method of lithium battery charge state estimation model and electronic equipment

By extracting time-series features from lithium battery data and introducing a channel attention mechanism, the hyperparameters of the lithium battery state of charge estimation model are optimized. This solves the problems of low efficiency in hyperparameter tuning and insufficient utilization of feature information in existing methods, thereby improving the accuracy and adaptability of SOC estimation.

CN121878488APending Publication Date: 2026-04-17CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING UNIV OF POSTS & TELECOMM
Filing Date
2025-12-31
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing lithium battery state of charge (SOC) estimation methods suffer from low hyperparameter tuning efficiency and fail to fully utilize time series feature information, resulting in insufficient model accuracy and generalization ability, especially under complex operating conditions.

Method used

Time series features of current and voltage sequences in lithium battery datasets are extracted, including time dependence index TD, trend strength index TS, and irregularity index NR. Feature fusion is performed by constructing a variable-level weight extraction module based on channel attention mechanism, and a search space bias guidance mechanism is introduced to optimize the hyperparameter configuration of the lithium battery state of charge estimation model.

Benefits of technology

This improves the fitting ability and prediction accuracy of the lithium battery SOC estimation model under nonlinear and complex operating conditions, enhances the model's structural adaptability and generalization ability, and improves the practical value of lithium battery state assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121878488A_ABST
    Figure CN121878488A_ABST
Patent Text Reader

Abstract

The invention discloses a hyper-parameter optimization method of a lithium battery state-of-charge estimation model and electronic equipment, and the method comprises the steps: obtaining a lithium battery data set, and respectively extracting time sequence features of a current sequence and a voltage sequence in the lithium battery data set, the time sequence features comprising a time dependence index, a trend intensity index and an irregularity index; a variable weight extraction module based on a channel attention mechanism is constructed for feature fusion, and fused time sequence features are obtained and comprise a time dependence index, a trend intensity index and an irregularity index; performing deviation guidance of a search space on the fused time sequence features, reducing an input sequence length candidate space, and screening a large convolution kernel size range and a small convolution kernel size range; setting the input label length to be equal to the predicted label length, and setting the batch size; and carrying out SOC estimation model Bayesian optimization based on the hyper-parameters to obtain optimal parameter configuration. According to the invention, the parameter adjustment efficiency of the SOC estimation model parameters is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of lithium battery state of charge estimation technology, and particularly relates to hyperparameter optimization methods and electronic devices for lithium battery state of charge estimation models. Background Technology

[0002] Lithium-ion batteries are widely used in electric vehicles due to their advantages such as high energy density, long lifespan, and zero pollution. State of charge (SOC) is the ratio of a lithium-ion battery's current remaining charge to its maximum usable capacity. It reflects the battery's remaining capacity and is a key parameter in battery management system state analysis. Therefore, accurate estimation of SOC plays a crucial role in the safe and stable operation of lithium-ion batteries.

[0003] The State of Charge (SOC) value of lithium-ion batteries cannot be directly measured; it can only be estimated by monitoring operating parameters such as voltage and current. Currently, commonly used SOC estimation methods for lithium-ion batteries mainly include principle-based methods, model-based methods, and data-driven methods. Principle-based methods include the ampere-hour integration method and the open-circuit voltage method, but their estimation accuracy is not high. Model-based methods require strict battery models and are computationally complex, limiting their practical application. In recent years, SOC estimation methods based on deep learning have attracted much attention because they do not rely on complex electrochemical models. However, the performance of deep learning models is highly dependent on the reasonable setting of hyperparameters. Bayesian optimization (BO) is a sequential strategy used for global optimization of black-box functions.

[0004] While traditional Bayesian optimization methods can automatically adjust hyperparameters, they fail to fully utilize the rich structural information contained in time-series signals such as battery voltage and current. This leads to the risk of local optima and reduced tuning efficiency, affecting the final accuracy and generalization ability of the model. Furthermore, the diversity of battery operating environments makes it difficult for a fixed hyperparameter search space to adapt to different data characteristics, further limiting the tuning effect. Summary of the Invention

[0005] To address the problems of low hyperparameter tuning efficiency and insufficient utilization of time series feature information in existing lithium battery state of charge (SOC) estimation methods, this invention proposes a hyperparameter optimization method for lithium battery SOC estimation models and an electronic device.

[0006] In a first aspect, this invention proposes a hyperparameter optimization method for a lithium battery state-of-charge estimation model, the method comprising:

[0007] S1: Obtain the lithium battery dataset and extract the time series features of the current and voltage sequences. The time series features include the time dependence index TD, the trend strength index TS, and the irregularity index. .

[0008] S2: Construct a variable-level weight extraction module based on channel attention mechanism to perform feature fusion on current and voltage sequences respectively, obtaining fused time series features, including time dependence indicators. Trend strength index and Irregularity indicators .

[0009] S3: Set the length of the input sequence in the lithium battery state-of-charge estimation model A fixed search space is used to guide the search space of the fused time series features, thereby reducing the length of the input sequence. Candidate space.

[0010] S4: Initially define the candidate sets of large and small convolutional kernels for the lithium battery state of charge estimation model, based on the time dependence index after fusion. and trend strength indicators Select a large range of convolutional kernel sizes, based on the irregularity index after fusion. Small convolution kernel size range.

[0011] S5: Set the input label length label_len of the lithium battery state of charge estimation model to be equal to the predicted label length pred_len, and set the batch size batch_size.

[0012] S6: Based on the final input sequence length sen_len candidate space, predicted label length pred_len, input label length label_len, batch size batch_size, and convolutional kernel size range (large_size, small_size), the lithium battery state of charge estimation model is set and trained accordingly until the loss converges, thus obtaining the optimal parameter configuration of the lithium battery state of charge estimation model.

[0013] Furthermore, the time-series features of the current and voltage sequences are extracted, and the specific process includes:

[0014] S101: Calculate the autocorrelation coefficients of the central current and voltage sequences in the lithium battery dataset, respectively. The maximum absolute value of the top 5 autocorrelation coefficients is taken as the time dependence index TD, and its calculation formula is as follows:

[0015] ,

[0016]

[0017] in, This indicates finding the maximum value. This indicates finding the absolute value. This represents the first-order autocorrelation coefficient in the ranking. This represents the top-ranked second-order autocorrelation coefficients. This represents the top-ranked third-order autocorrelation coefficients. This represents the top-ranked fourth-order autocorrelation coefficients. This represents the top 5 autocorrelation coefficients.

[0018] This represents the autocorrelation coefficient when the lag order is k, and N is the total sampling length of the time series. For sequence Variables at time, Time series The mean of all samples.

[0019] S102: Calculate the trend intensity index TS of the centralized current series and voltage series of the lithium battery data respectively. The calculation formula is as follows:

[0020]

[0021] in, Let be the sequence sample values ​​at time t. Indicates the original sequence A smoothed sequence obtained by performing a moving average within a preset time window. This indicates that the variance is calculated for the sequence.

[0022] S103: Calculate the irregularity indices of the centralized current and voltage sequences in the lithium battery dataset, respectively. The calculation formula is as follows:

[0023]

[0024] in, , Represents a current sequence or voltage sequence. This represents the trend portion of a current or voltage series. This represents the periodic or seasonal portion of a current or voltage sequence. The residual components obtained from the additive model decomposition are those whose variations are not explained by trend and seasonal components. Calculate the variance of the sequence.

[0025] Furthermore, the feature fusion process is expressed as follows:

[0026]

[0027] in, Indicators representing the time dependence after fusion. Indicators representing the trend strength after fusion. Indicators representing irregularities after fusion. It is a time-dependent indicator of voltage. This is an indicator of the intensity of the time trend of voltage. It is an indicator of voltage irregularity. It is an indicator of the time dependence of current. This is an indicator of the trend intensity of the current. It is an indicator of the irregularity of current. The voltage-related channel weights output by the SE module are averaged, aggregated, and normalized to obtain the voltage variable-level attention coefficients. The current-related channel weights output by the SE module are averaged, aggregated, and normalized to obtain the current variable-level attention coefficients.

[0028] Furthermore, the fused time series features are biased in the search space to narrow down the candidate space for input sequence lengths. This specifically includes:

[0029] S301: Set the length of the input sequence in the lithium battery state-of-charge estimation model A fixed search space.

[0030] S302: Based on the trend strength index after fusion and time-dependent indicators Probabilistic guidance is applied to reduce the length of the input sequence. The candidate space, in its specific process, is represented as follows:

[0031]

[0032] in, Indicates the length of the input sequence. This indicates the strength of the trend after fusion. Indicators representing the time dependence after fusion. Indicates other.

[0033] S303: Based on the time dependence index after fusion The length of the input sequence is optimized and dynamically compensated in the second stage. Limit the length of the input sequence The upper and lower limits.

[0034] Secondly, the present invention provides an electronic device comprising:

[0035] At least one memory on which computer programs are stored;

[0036] At least one processor, which, when executing the computer program, implements the steps of the method as described in the first aspect of the invention.

[0037] Thirdly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect of the present invention.

[0038] The beneficial effects of this invention are:

[0039] 1. Extract time-series features from the concentrated current and voltage sequences of lithium battery datasets, including time dependence index (TD), trend strength index (TS), and irregularity index. The aforementioned features are statistical characteristics of the global time series. They do not participate in the model input prediction process, but rather serve as reference indicators for structural parameter tuning, enabling prior control of the neural network structural parameters.

[0040] 2. The extracted time series features are applied to the Bayesian optimization process of the original lithium battery state of charge (SOC) estimation model to guide the optimizer to dynamically adjust the structural parameters of the SOC estimation model, thereby enhancing the matching of structural parameters to the data.

[0041] 3. To further improve structural adaptability, a channel attention mechanism (SENet module) was introduced into the model. By learning different weights for variables, the model guides the weighted fusion ratio of different time series features, thereby enhancing the expressive power of key variables in specific scenarios.

[0042] Existing lithium battery state of charge (SOC) estimation models lack guidance on data characteristics for structure tuning, while the input data of these models exhibits strong time-series dependencies. This invention fully leverages the time-series characteristics of key lithium battery variables such as voltage and current, including trend strength indicators, time-dependency indicators, and irregularity indicators, and adaptively adjusts the hyperparameter search strategy accordingly. This method can quickly locate potentially advantageous hyperparameter combinations based on data characteristics in the early stages of optimization, thereby narrowing the search space, avoiding invalid search paths, and improving the matching degree between model structure and data characteristics. This invention can enhance the fitting ability and prediction accuracy of lithium battery SOC evaluation models under nonlinear and complex operating conditions, possessing good generalization and practical value. Attached Figure Description

[0043] Figure 1 This is a schematic diagram of the structure of a lithium battery state of charge (SOC) assessment model in the prior art.

[0044] Figure 2 This is a flowchart illustrating the steps of an embodiment of the present invention;

[0045] Figure 3 This is a flowchart illustrating the processing of an embodiment of the present invention. Detailed Implementation

[0046] The terms "first," "second," "third," "fourth," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application.

[0047] 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.

[0048] Figure 1 This is a schematic diagram of the structure of a lithium battery state of charge (SOC) assessment model in the prior art. Figure 1 As shown, the network structure of existing lithium battery SOC evaluation models includes: an input layer, a normalization layer, a convolutional layer, a block, a fully connected layer, an inverse normalization layer, and an output layer. Existing lithium battery SOC evaluation models typically employ Bayesian optimization (BO) during training. While traditional Bayesian optimization methods can automatically adjust hyperparameters (including input sequence length, prediction label length, input label length, batch size, and kernel size), they do not fully utilize the rich structural information contained in time-series signals such as battery voltage and current. This leads to the risk of local optima and reduced optimization efficiency during the tuning process, affecting the model's final accuracy and generalization ability.

[0049] Figure 3 This is a flowchart illustrating the processing of an embodiment of the present invention. Figure 3As shown, this invention improves upon the original lithium battery SOC evaluation model by introducing an attention mechanism module, SE. Before training the lithium battery SOC evaluation model, a feature extractor is used to extract time-series features from the current and voltage sequences in the lithium battery dataset. These features include the time dependence index TD, the trend strength index TS, and the irregularity index NR. The channel attention weights of different variables extracted by this module are then used for mean aggregation to obtain variable-level attention coefficients. Finally, the current and voltage sequences are fused to obtain fused features (i.e., fused time-series features), which include the time dependence index... Trend strength index and Irregularity indicators During the training of the lithium battery SOC evaluation model, a search space (optuna) for hyperparameters is defined. A Bayesian optimizer is used to suggest hyperparameter combinations for training, and bias guidance is provided based on fusion features to achieve prior control over the parameters of the lithium battery SOC evaluation model. Performance is evaluated on the validation set, and the loss is recorded until the loss converges or the preset number of experiments is reached to obtain the optimal hyperparameter combination.

[0050] This invention proposes a hyperparameter optimization method for a lithium battery state-of-charge estimation model, referring to... Figure 2 , 3 As shown, the method includes:

[0051] S1: Obtain the lithium battery dataset and extract the time series features of the current sequence and voltage sequence respectively. The time series features include the time dependence index TD, the trend strength index TS, and the irregularity index NR.

[0052] Preferably, the lithium battery dataset includes time data, voltage data, current data, and SOC tags of the lithium battery under different operating conditions and temperatures.

[0053] For example, this embodiment of the invention uses the University of Maryland's A123 lithium battery public dataset as the training sample set. This public dataset is a comprehensive lithium-ion battery test dataset released by the Battery Research Group of CALCE (Center for Advanced Life Cycle Engineering) at the University of Maryland, specifically for the A123 model lithium-ion iron phosphate battery (LiFePO4). The public dataset is divided into seven parts, with the first part (i.e., dataset 1) containing basic battery test data, such as charge-discharge cycles, voltage, current, and temperature.

[0054] Specifically, obtain the dynamic configuration file from the official website, and use MATLAB to use formula (1) to obtain lithium battery datasets under three different working conditions and at different temperatures: DST, FUDS, and US06. Each dataset includes relative time data, voltage data, current data, temperature data, and SOC label (the value of SOC is 0-1).

[0055] The formula for calculating the SOC label is:

[0056] (1)

[0057] in, Let t be the state of charge of the lithium battery at time t. Initial time The state of charge of a lithium battery at that time. This refers to the rated capacity of the lithium battery. For Coulomb efficiency, Also known as charge / discharge efficiency, for Current at any given moment.

[0058] By comparing the prediction results of the lithium battery state of charge estimation model with the SOC label, the model can be optimized, validated, and evaluated. During the training and optimization process, the SOC label is used to guide the model towards convergence with decreasing error.

[0059] The University of Maryland Lithium Battery A123 public dataset contains operating data of lithium-ion batteries acquired under various operating conditions and different ambient temperatures. Current and voltage signals are continuously collected as the battery's state of charge gradually decreases from full to complete discharge, forming current and voltage time series, providing foundational data for subsequent state assessment and model building. Specifically, the target data file is first read from a preset path; if the data file contains a time field "time", the time format is converted to ensure the consistency of the time series order; in the read dataset, columns unrelated to time or the target variable ['time', 'temperature', 'SOC'] are removed, retaining the numerical feature columns to be analyzed, such as the current and voltage series.

[0060] Preferably, the time series features of the current sequence and voltage sequence are extracted, and the specific process includes:

[0061] S101: Calculate the autocorrelation coefficients of the central current and voltage sequences in the lithium battery dataset, respectively. The maximum absolute value of the top 5 autocorrelation coefficients is used as the time dependence index TD.

[0062] There is a complex dynamic relationship between the external observable measurements of lithium batteries, such as voltage, current, and temperature, and their internal state of charge (SOC), and this relationship is time-dependent. For example, battery voltage and current sequences generally exhibit short-time lag correlation characteristics in actual measurements, with their significant autocorrelation structure mainly concentrated in the low-order region. According to the general rules of time series analysis, low-order (especially orders 1-5) autocorrelation best reflects the main dependent structure of the sequence, while high-order autocorrelation usually decays rapidly and contributes less to the sequence structure. Based on these characteristics, this invention selects the first 5 autocorrelation coefficients as reference indicators for time dependence characteristics.

[0063] The formula for calculating the autocorrelation coefficient is as follows:

[0064] (2)

[0065] in, This represents the autocorrelation coefficient when the lag order is k, and N is the total sampling length of the time series. For sequence Variables at time, Time series The mean of all samples.

[0066] In this embodiment of the invention, the maximum absolute value of the top 5 autocorrelation coefficients is extracted as the time dependence index TD (Temporal Dependence). The calculation formula for the time dependence index is as follows:

[0067] (3)

[0068] In the formula, This indicates finding the maximum value. This indicates finding the absolute value. This represents the first-order autocorrelation coefficient in the ranking. This represents the top-ranked second-order autocorrelation coefficients. This represents the top-ranked third-order autocorrelation coefficients. This represents the top-ranked fourth-order autocorrelation coefficients. This represents the top 5 autocorrelation coefficients in the ranking.

[0069] The time dependence index reflects the periodicity or continuity of voltage and current time series. The larger the value of the time dependence index, the stronger the time dependence of the current and voltage series in the lithium battery data, indicating that the current and voltage series have more "memory" during this period.

[0070] S102: Calculate the trend intensity index TS of the centralized current sequence and voltage sequence of the lithium battery data respectively.

[0071] In time series analysis and engineering modeling (such as lithium battery SOC estimation), trend strength (TS) is a dimensionless indicator used to quantify the significance of trend components in a time series, and its value is usually between 0 and 1.

[0072] Specifically, a moving average operation is performed on the voltage and current sequences within a preset time window (period = 48) to obtain a smoothed sequence; the variance between the smoothed sequence and the original voltage and current sequences is calculated respectively; and the ratio of the variance of the smoothed sequence to the original sequence is used as the trend strength index TS.

[0073] The formula for calculating the trend strength index TS is as follows:

[0074] (4)

[0075] in, Let be the sequence sample values ​​at time t. Indicates the original sequence A smoothed sequence obtained by performing a moving average within a preset time window is used to extract the trend component in the sequence. This indicates that the variance is calculated for the sequence.

[0076] The trend strength index (TS) typically ranges from [0, 1], with higher values ​​indicating a stronger trend. A trend strength index close to 1 indicates that the input time series is dominated by a clear, smooth long-term trend (such as monotonically rising or falling); a trend strength index close to 0 indicates that the input time series has almost no trend and is mainly composed of fluctuations or noise (approximately stationary or random walk).

[0077] Combining the time dependence index (autocorrelation coefficient) and trend strength index of current time series and voltage time series can be used to characterize the time series characteristics, providing a dual basis for hyperparameter optimization design.

[0078] S103: Calculate the irregularity indices of the centralized current and voltage sequences in the lithium battery dataset, respectively. .

[0079] In lithium-ion battery state-of-charge (SOC) estimation, the irregularity of the input sequence refers to the lack of regularity, stationarity, or predictable structure in the time dimension or numerical variation of the input signals used for modeling or observation (such as current, voltage, temperature, etc.). This irregularity may stem from factors such as the complexity of actual operating conditions, sensor noise, battery aging, and environmental disturbances. Understanding the "irregularity" of the input sequence is crucial for the design, robustness, and generalization ability of lithium-ion battery SOC estimation models.

[0080] To measure the level of random perturbation in voltage and current sequences, this invention employs the Seasonal-Trend Decomposition using Loose (STL) additive decomposition method. Specifically, STL is used to decompose current and voltage sequences... Perform seasonal decomposition, dividing the voltage and current sequences It is broken down into three parts: trend term, seasonal / cyclical term, and residual term, namely:

[0081] (5)

[0082] in, Represents a current sequence or voltage sequence. This represents the trend portion of a current or voltage series. This represents the periodic or seasonal portion of a current or voltage sequence. It represents the residual portion in a current or voltage sequence.

[0083] residual part This represents random fluctuations that cannot be eliminated after explaining trends and seasonal variations; it is the irregular component in a time series. The proportion of the variance of the residuals to the variance of the original series is selected as the irregularity index, also known as the irregularity index NR. The formula for calculating the irregularity index is as follows:

[0084] (6)

[0085] in, , Represents a current sequence or voltage sequence. This represents the trend portion of a current or voltage series. This represents the periodic or seasonal portion of a current or voltage sequence. The residual components obtained from the additive model decomposition are those whose variations are not explained by trend and seasonal components. Calculate the variance of the sequence. The higher the residual ratio, the more random or unmodelable components exist in this voltage and current range, i.e., the more noise points there are.

[0086] Using the above formulas (2)-(6), the current time series characteristic C is calculated respectively. feat and voltage time series characteristics V featEach feature includes a time dependence index (TD), a trend strength index (TS), and an irregularity index (NR). These three time-series feature indices allow for the construction of a complete time-series feature representation for each signal (current, voltage, etc.). This representation guides the selection and configuration of hyperparameters such as input window length, thereby optimizing feature engineering strategies, improving model performance and prediction accuracy, and enhancing the model's adaptability, robustness, and generalization ability under complex conditions.

[0087] S2: Construct a variable-level weight extraction module based on channel attention mechanism to perform feature fusion on current and voltage sequences respectively, obtaining fused time series features, including time dependence indicators. Trend strength index and Irregularity indicators .

[0088] To achieve effective fusion of time-series features of different physical variables, this embodiment of the invention introduces an attention mechanism (Squeeze-and-Excitation, SE) into the lithium battery state-of-charge estimation model to generate channel attention weights corresponding to current and voltage variables. The SE module first generates channel-level weights for all feature channels within each variable. Then, it groups the channel weights belonging to the same physical variable according to the variable dimension and aggregates the mean of these grouped channel weights to obtain the variable-level channel weights. .

[0089] The input to the SE module is denoted as X, which is an intermediate feature representation obtained from the current and voltage sequences through operations such as convolution, where X ∈  B×T×C Where B represents the batch size, T represents the time step, and C represents the number of channels (i.e., the number of physical variables × the number of feature channels).

[0090] For the c-th channel, its time series is: The time-average descriptor of this channel can be obtained through global average pooling, and its calculation formula is as follows:

[0091] (7)

[0092] in, This represents the time-averaged descriptor of the c-th channel, where T represents the time step. Indicates time, This represents the eigenvalue of the c-th channel at time step t.

[0093] Construct a tensor z∈ from the descriptors of all channels. B×C×1The data is then fed into a two-layer fully connected network for channel dependency modeling. The first layer performs dimensionality compression to generate an intermediate representation.

[0094] (8)

[0095] in, The intermediate channel feature representation of the output of the first fully connected layer Represents the ReLU activation function. This represents the first weight matrix of the fully connected layer. This represents the first bias term of the fully connected layer.

[0096] The second layer performs dimension restoration and generates the channel weight vector before normalization:

[0097] (9)

[0098] in, The non-normalized channel weight vector output by the second fully connected layer Sigmoid activation function This represents the weight matrix of the second fully connected layer. This represents the bias term of the second fully connected layer. After activation by the Sigmoid function, the weights of each channel are restricted to the (0,1) interval, but the weights of different channels are not yet normalized.

[0099] Considering that physical variables such as current and voltage may each correspond to multiple feature channels, this invention first uses the SE module to perform attention learning on all channels to obtain channel-level attention coefficients. Then, the coefficients of multiple channels belonging to the same physical variable are aggregated (using mean aggregation) to obtain the non-normalized attention value for that physical variable. Finally, the non-normalized attention values ​​of each physical variable are normalized to obtain variable-level attention weights that can be used for multivariate time series feature fusion. Let the current correspond to the set of channels. Voltage corresponding channel set Then the variable-level nonnormalized attention values ​​are as follows:

[0100]

[0101] in, is the nonnormalized attention coefficient of the k-th channel.

[0102] To ensure the comparability of weights among different variables, this invention normalizes the variable-level non-normalized attention values ​​to obtain the final variable-level attention weights, which are specifically expressed as follows:

[0103] in, , The voltage variable-level attention coefficients are obtained by averaging and normalizing the relevant channel weights. The current-related channel weights output by the SE module are averaged, aggregated, and normalized to obtain the current variable-level attention coefficients.

[0104] Introducing the SE attention mechanism can not only improve the model to increase its accuracy, but also fuse the sequence features of current and voltage by extracting channel weights.

[0105] Based on the calculated normalized variable level weights Current time series characteristics Voltage time series characteristics Feature fusion is performed to obtain the fused time series features.

[0106] Its feature fusion process is represented as follows:

[0107] (12)

[0108] in, Indicators representing the time dependence after fusion. This indicates the strength of the trend after fusion. Indicators representing irregularities after fusion. It is a time-dependent indicator of voltage. This is an indicator of the intensity of the time trend of voltage. It is an indicator of voltage irregularity. It is an indicator of the time dependence of current. This is an indicator of the trend intensity of the current. It is an indicator of the irregularity of current. The voltage-related channel weights output by the SE module are averaged, aggregated, and normalized to obtain the voltage variable-level attention coefficients. The current-related channel weights output by the SE module are averaged, aggregated, and normalized to obtain the current variable-level attention coefficients.

[0109] Through this weighted fusion mechanism, the model can dynamically adjust the fusion ratio of voltage and current characteristics according to the importance of different operating conditions, thereby achieving adaptive integration of multimodal time series features and further improving the accuracy and robustness of SOC prediction.

[0110] S3: Set the length of the input sequence in the lithium battery state-of-charge estimation model A fixed search space is used to guide the search space of the fused time series features, thereby reducing the length of the input sequence. Candidate space.

[0111] In the field of lithium-ion battery state of charge (SOC) assessment technology, determining the length of the input sequence is a crucial step in the optimization of the SOC assessment model. When constructing training samples for the SOC assessment model, the length of the input sequence determines the time dimension of each sample. When adapting to time-series modeling methods, state inference relies on historical data within a time window; the length of the input sequence determines how far back the SOC assessment model can "look," directly affecting its memory capacity and predictive performance. By introducing historical input sequences of a certain length, the SOC assessment model can capture the dynamic behavior of these input sequences, improving the accuracy of SOC estimation.

[0112] This invention comprehensively considers the statistical structure characteristics of current and voltage time series, such as trend strength, irregularity, and time dependence, and combines this with the prediction performance variation of the SOC evaluation model under different sequence lengths to establish principles for determining the input sequence length (seq_len) and convolution kernel size (kernel_large, kernel_small). After multiple rounds of experimental verification, it can stably improve the convergence speed and prediction accuracy of the SOC evaluation model under different data scenarios, thus forming the input sequence length determination scheme proposed in this invention. The specific process includes:

[0113] S301: Set the length of the input sequence in the lithium battery state-of-charge estimation model A fixed search space.

[0114] Specifically, the length of the input sequence The fixed search space is set as follows:

[0115]

[0116] During the optimization training of the SOC evaluation model, if the range of selectable hyperparameters is directly limited based solely on the fused time-series features during each hyperparameter sampling process, it will lead to an increase in the length of the input sequence. The search space is excessively shrunk, failing to cover potential optimal solution regions. To address this issue, embodiments of the present invention use random number generation to determine whether to enable the feature-guided strategy.

[0117] S302: Based on the trend strength index after fusion and time-dependent indicators Probabilistic guidance is applied to reduce the length of the input sequence. Candidate space.

[0118] Determining the length of the input sequence In this process, the present invention does not directly select a length value from a fixed interval, but rather guides the search space through probability triggering. Therefore, within the aforementioned fixed input sequence length search space [ Within the interval [0,1), the present invention first generates a random real number u in the interval [0,1) using a uniformly distributed random function, which serves as the initial sampling factor for the candidate length.

[0119] This invention, through statistical analysis and multiple rounds of experimental verification of data under different working conditions, found that triggering the feature guidance mechanism when the random sampled value is in the interval [0, 0.25) can ensure search diversity while enabling faster convergence of hyperparameter search and achieving optimal final model accuracy. Therefore, this invention sets the first 25% of the interval as the feature guidance trigger interval.

[0120] Reduce the length of the input sequence The candidate space is specifically represented as:

[0121] (13)

[0122] in, This indicates the strength of the trend after fusion. Indicators representing the time dependence after fusion. Indicates other situations, namely .

[0123] When the trend strength in the fusion features is large (i.e.) When the trend is weak (i.e., the model automatically selects a longer historical window to more fully capture obvious change patterns); when the trend is weak (i.e., the model selects a longer historical window to capture obvious change patterns); When the trend is at a moderate level (i.e., when the trend is at a moderate level), a shorter window is used to reduce the accumulation of invalid historical information; when the trend is at a moderate level (i.e., when the trend is at a moderate level), a shorter window is used to reduce the accumulation of invalid historical information. When, in other words, the trend is moderate but the time dependence is weak (i.e., when the trend is moderate but the time dependence is weak), a compromise window length is chosen to avoid information loss due to the window being too long or too short; When this is the case, the window should be extended appropriately to enhance the ability to depict slowly changing features.

[0124] By employing the dynamic window adjustment strategy based on fusion features, and combining multiple sets of experiments to verify and optimize each threshold and interval, the length of the input sequence can be adaptively matched with the current operating condition of the battery, thereby significantly improving the accuracy and stability of SOC prediction.

[0125] S303: Based on the time dependence index after fusion For the length of the input sequence The second stage of optimization and dynamic compensation adjustment is carried out to further limit the upper and lower limits of the input sequence length.

[0126] When the fused time series features have high autocorrelation ( When the autocorrelation of the fused time series features is extremely low, it indicates that the input sequence has a significant dependence on long-term history, and the sequence length should be appropriately increased; When ), it indicates that the input sequence is heavily dependent on history, and the window can be appropriately compressed; specifically, it is expressed as:

[0127]

[0128]

[0129] in, , These represent the upper and lower bounds of the window before adjustment; , These are the upper and lower bounds of the adjusted window, respectively. max(⋅) represents taking the larger value, and min(⋅) represents taking the smaller value.

[0130] By employing the two-stage dynamic window determination method proposed in step S3, based on a fixed search space, a probabilistic triggering mechanism, and feature fusion, this invention can ensure the sufficiency of the search space for the input sequence length while introducing statistical structural features such as trends, irregularities, and time dependencies to provide evidence-based bias guidance for window selection, thus achieving an effective balance between "exploration" and "utilization" in the hyperparameter search process. By enabling the feature-guided strategy under random sampling triggering conditions, the model can converge faster while maintaining search diversity, and adaptively adjust the input sequence length under different operating conditions such as significant trends, high noise, or obvious autocorrelation, ensuring that the selected time window matches the actual dynamic behavior of the battery. Furthermore, the secondary window boundary compensation optimization through autocorrelation index ensures that the final input sequence length simultaneously considers local trends and long-term dependencies, guaranteeing the sufficiency and effectiveness of the model's input information. Multiple sets of experiments have verified that this method can significantly improve the accuracy, stability, and cross-condition generalization ability of lithium battery SOC prediction, outperforming fixed window or purely random window strategies.

[0131] In the optimization of lithium-ion battery state of charge (SOC) assessment models, determining the kernel size is a key hyperparameter design decision when using one-dimensional convolutional neural networks (1D-CNN) or their variants (such as CNN-LSTM and Temporal Convolutional Network, TCN). The kernel size directly determines the receptive field, affecting the ability to extract local temporal patterns. The kernel size needs to be designed in conjunction with the input sequence length and sampling frequency.

[0132] S4: Initially define the candidate sets of large and small convolutional kernels for the lithium battery state of charge estimation model, based on the time dependence index after fusion. and trend strength indicators Select a large range of convolutional kernel sizes, based on the irregularity index after fusion. Small convolution kernel size range.

[0133] For example, the candidate set of large convolutional kernels is set as {13, 21, 27, 31}, and the trend intensity index in the fused time series features is used as the basis for selection. Time-dependent indicators The sampling probability of each convolutional kernel is dynamically adjusted. This is based on the following: when the time series exhibits a clear trend or long-term dependence, the model requires a larger receptive field to extract stable structures across time scales, thus favoring larger convolutional kernel sizes (e.g., 27 or 31). Conversely, when the sequence trend is weak and autocorrelation is low, the effective historical dependence in the input signal is limited; excessively large convolutional kernels not only increase computational cost but may also introduce additional noise, therefore smaller convolutional kernel sizes (e.g., 13 or 21) should be prioritized. Based on this, when... > 0.7 or When > 0.7, the probability of drawing from 27 / 31 of the candidate set is increased; when <0.4 and When the value is less than 0.4, the sampling probability is increased by 13 / 21; otherwise, the original sampling strategy is maintained.

[0134] Based on the time dependence index after fusion and trend strength indicators Selecting a large range of convolution kernel sizes is specifically expressed as follows:

[0135]

[0136] In the formula, This represents a candidate set of large convolutional kernel sizes to be determined, used for time-series feature extraction with large receptive fields. This indicates the strength of the trend after fusion. Indicators representing the time dependence after fusion. Indicates other situations.

[0137] For example, the above method is used to sample the convolutions corresponding to the four stages of the lithium battery SOC prediction model to obtain the set of large convolution kernel sizes: kernel_large = [k1, k2, k3, k4], where (i∈{1,2,3,4}) represents the large-scale convolutional kernel size determined by the i-th stage (this model has 4 stages) under the current fusion conditions. The above k1~k4 are not fixed values, but are dynamically sampled by the feature-guided convolutional kernel search mechanism proposed in this invention during each round of hyperparameter optimization. They are used to adaptively adjust the receptive field of each convolutional layer under different operating conditions, thereby improving the effective feature extraction capability of the SOC prediction model.

[0138] The candidate set of small convolutional kernels is set as {3,5,7}, based on the irregularity index in the fused time series features. Dynamically adjust the probability distribution of small convolutional kernel sizes. This is applied when fusing irregularities in time-series features. higher ( When the value is > 0.6, it indicates that there are many high-frequency perturbation components in the input sequence, and a smaller convolution kernel should be used. This helps reduce overfitting and improve local smoothness; otherwise, the input sequence is more stable, and a slightly larger small convolutional kernel can be used appropriately. Enhance the ability to extract fine-grained features.

[0139] Based on the irregularity index after fusion The range of small convolution kernel sizes is specifically represented as follows:

[0140] (16)

[0141] in, This represents the set of candidate small convolution kernel sizes to be determined. This indicates the irregularity index after fusion. Indicates other.

[0142] For example, the above method is used to sample the convolutions corresponding to the four stages of the lithium battery SOC prediction model to obtain the value range of the small convolution kernel: kernel_small=[s1,s2,s3,s4], where (i∈{1,2,3,4}) represents the small-scale convolutional kernel size determined by the i-th stage under the current fusion conditions. The above s1~s4 are not fixed values, but are dynamically sampled in each round of hyperparameter optimization through the feature-guided convolutional kernel search mechanism proposed in this invention. They are used to adaptively adjust the local receptive field of each convolutional layer under different operating conditions, thereby improving the feature extraction accuracy of the SOC prediction model.

[0143] S5: Set the input label length label_len of the lithium battery state of charge estimation model to be equal to the predicted label length pred_len, and set the batch size batch_size.

[0144] In the optimization of lithium-ion battery state of charge (SOC) prediction models, especially when using sequence-to-sequence (Seq2Seq) architectures (such as Encoder-Decoder, Transformer, TCN, LSTM, etc.), the settings of input label length (label_len) and prediction label length (pred_len) are crucial. These two parameters together define the training objective structure and prediction task form of the SOC prediction model, directly affecting the learning ability, generalization performance, and actual deployment effect of the SOC prediction model.

[0145] To ensure that the SOC prediction model can make full use of historical information and maintain consistency with the prediction time, the input label length label_len and the prediction label length pred_len of the lithium battery state of charge estimation model are set to be equal to ensure the continuity of time series features.

[0146] In the optimization of lithium battery state of charge (SOC) prediction models, batch size not only affects training efficiency and memory usage, but also has a deeper impact on the convergence, generalization ability, gradient estimation quality, and learning effect on the complex dynamic characteristics of batteries.

[0147] The embodiments of the present invention flexibly adjust the batch size by setting multiple levels, such as [128, 256, 512], under different computing resources and convergence requirements, thus taking into account both training efficiency and generalization ability.

[0148] It should be noted that when using a computer to process the above steps S3-S5, parallel processing can be performed to improve data processing speed and efficiency.

[0149] S6: Based on the candidate space of the input sequence length seq_len, the predicted label length pred_len, the input label length label_len, the batch size batch_size, and the range of large and small convolutional kernel sizes (large_size, small_size), the lithium battery state of charge estimation model is set and trained accordingly until the loss converges, and the optimal parameter configuration of the lithium battery state of charge estimation model is obtained.

[0150] Specifically, the fused time-series features (including trend strength features, time dependence features, and irregularity features) guide the sampling distribution of each hyperparameter, enabling dynamic adjustment of the search space and thus improving tuning efficiency and result stability. In each experiment, Bayesian optimization evaluates the SOC model performance (loss function on the validation set) by defining an objective function and feeds the evaluation results back to the next round of hyperparameter sampling. Ultimately, the optimization process can dynamically adjust key parameters such as input sequence length, convolution kernel size, and training batch size according to the current battery operating conditions, achieving adaptive matching of the model's receptive field, time window, and training configuration. This allows the SOC prediction model to achieve higher prediction accuracy, stability, and training convergence efficiency under different operating conditions, while ensuring the diversity and effectiveness of hyperparameter search.

[0151] This invention provides an electronic device, comprising:

[0152] At least one memory on which computer programs are stored;

[0153] At least one processor, which executes the computer program to implement the steps of the hyperparameter optimization method for the lithium battery state of charge estimation model as described in the above embodiments.

[0154] This invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the hyperparameter optimization method for the lithium battery state of charge estimation model as described in the above embodiments.

[0155] Simulation verification:

[0156] During simulation verification, the Modern TCN model was selected as the lithium battery state-of-charge estimation model. Modern TCN is a lightweight temporal convolutional network that employs depthwise separable convolution at its core. It decomposes traditional convolution into channel-wise depthwise convolution and pointwise convolution, significantly reducing parameters and computational cost, improving the efficiency of long-term and short-term dependency modeling, and making it suitable for resource-constrained scenarios. By adding the introduced Squeeze-and-Excitation (SE) attention mechanism to the Modern TCN model, the ModernTCN-SENet prediction model was obtained.

[0157] The optimization method of this invention is used to optimize the parameters of the ModernTCN-SENet prediction model. The performance comparison between the Modern TCN model and the ModernTCN-SENet prediction model when trained and validated using the DST dataset is shown in the table below (error metrics are based on percentage SOC values).

[0158] Table 1: Comparison of model performance on the DST dataset at different temperatures

[0159] Temperature (°C) Model Name MAE RMSE 0 Modern TCN 1.137 1.963 0 ModernTCN-SENet 1.133 1.954 20 Modern TCN 1.126 1.933 20 ModernTCN-SENet 1.108 1.916 30 Modern TCN 1.108 1.928 30 ModernTCN-SENet 1.086 1.908 50 Modern TCN 1.002 1.720 50 ModernTCN-SENet 1.001 1.719

[0160] In Table 1, MAE represents the mean absolute error and RMSE represents the root mean square error.

[0161] As shown in Table 1, under different temperature conditions (0°C, 20°C, 30°C, and 50°C for A123 lithium batteries under DST conditions), the performance of the ModernTCN-SENet model in the SOC estimation task was improved after introducing the attention mechanism SE module. Both MAE and RMSE of the ModernTCN-SENet model outperformed the control group (Modern TCN) without the SE module, demonstrating the effectiveness of the SE module in feature channel recalibration. Especially at typical operating temperatures such as 20°C and 30°C, the MAE of ModernTCN-SENet decreased to 1.108 and 1.086, respectively, showing a significant improvement compared to ModernTCN. This fully demonstrates that the SE module can enhance the model's ability to focus on key features and improve the accuracy of feature representation. Overall, the introduction of the SE module significantly enhances the model's generalization ability and robustness under various temperature environments, representing an important structural improvement for enhancing SOC estimation accuracy.

[0162] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include ROM, RAM, disk, or optical disk, etc.

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

Claims

1. A hyperparameter optimization method for a lithium battery state-of-charge estimation model, characterized in that, include: Obtain a lithium battery dataset and extract time-series features from the current and voltage sequences. These time-series features include the time dependence index (TD), the trend strength index (TS), and the irregularity index. ; A variable-level weight extraction module (SE) based on channel attention mechanism is constructed to perform feature fusion on current and voltage sequences respectively, obtaining fused time-series features, which include time-dependency indices. Trend strength index and Irregularity indicators ; A fixed search space for the length of the input sequence in the lithium battery state of charge estimation model is set, and the search space is biased to guide the fused time series features, thereby narrowing the candidate space for the length of the input sequence. Initially, candidate sets of large and small convolutional kernels for the lithium battery state of charge estimation model are defined, based on the time dependence index after fusion. and trend strength indicators The selected range of large convolutional kernel sizes is based on the irregularity index after fusion. The range of small convolutional kernel sizes; Set the input label length to be equal to the prediction label length for the lithium battery state of charge estimation model, and set the batch size; Based on the candidate space for input sequence length, predicted label length, input label length, batch size, and range of convolutional kernel size, the lithium battery state of charge estimation model is trained with corresponding parameter settings until the loss converges, thus obtaining the optimal parameter configuration of the lithium battery state of charge estimation model.

2. The hyperparameter optimization method for the lithium battery state-of-charge estimation model according to claim 1, characterized in that, Extracting time-series features from current and voltage sequences involves the following steps: Calculate the autocorrelation coefficients of the current and voltage sequences in the lithium battery dataset, respectively. The maximum absolute value of the top 5 autocorrelation coefficients is taken as the time dependence index TD, and its calculation formula is as follows: , , in, This indicates finding the maximum value. This indicates finding the absolute value. This represents the first-order autocorrelation coefficient in the ranking. This represents the top-ranked second-order autocorrelation coefficients. This represents the top-ranked third-order autocorrelation coefficients. This represents the top-ranked fourth-order autocorrelation coefficients. This represents the top 5 autocorrelation coefficients. This represents the autocorrelation coefficient when the lag order is k, and N is the total sampling length of the time series. For sequence Variables at time, Time series The mean of the entire sampling space; The trend intensity index TS of the centralized current series and voltage series of the lithium battery data are calculated separately. The calculation formula is as follows: , in, Let be the sequence sample values ​​at time t. Indicates the original sequence A smoothed sequence obtained by performing a moving average within a preset time window. This indicates that the variance is calculated for the sequence. Calculate the irregularity indices of the centralized current and voltage sequences in the lithium battery dataset, respectively. The calculation formula is as follows: , in, , Represents a current sequence or voltage sequence. This represents the trend portion of a current or voltage series. This represents the periodic or seasonal portion of a current or voltage sequence. This represents the residual components obtained from the additive model decomposition. This indicates that the variance is calculated for the sequence.

3. The hyperparameter optimization method for the lithium battery state-of-charge estimation model according to claim 1, characterized in that, The feature fusion process is represented as follows: , Wherein, represents the time dependence index after fusion, represents the trend strength index after fusion, represents the irregularity index after fusion, is the time dependence index of voltage, is the time trend strength index of voltage, is the irregularity index of voltage, is the time dependence index of current, is the trend strength index of current, is the irregularity index of current, is the voltage variable-level attention coefficient obtained by averaging and normalizing the voltage-related channel weights output by the attention mechanism module, and is the current variable-level attention coefficient obtained by averaging and normalizing the current-related channel weights output by the attention mechanism module.

4. The hyperparameter optimization method for the lithium battery state-of-charge estimation model according to claim 1, characterized in that, The process of biasing the search space of the fused time series features to narrow down the candidate space for input sequence length includes: A fixed search space with a fixed input sequence length is defined in the lithium battery state of charge estimation model; Based on the trend strength index after fusion and time-dependent indicators The length of the input sequence is guided by probability to narrow down the candidate space for the input sequence length; Based on the time dependence index after fusion The second stage of optimization and dynamic compensation adjustment is performed on the length of the input sequence to further limit the upper and lower limits of the length of the input sequence.

5. An electronic device, comprising: At least one memory on which computer programs are stored; At least one processor, which, when executing the computer program, implements the steps of the method as claimed in any one of claims 1 to 4.

6. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 4.