Battery state-of-charge estimation method and device based on local weighted regression

Through the combination of local weighted regression and enhanced convolutional hybrid neural network, the high volatility problem of lithium-ion battery state of charge estimation is solved, more accurate and stable SOC prediction is achieved, and the performance of the battery management system is improved.

CN119199557AActive Publication Date: 2024-12-27STATE GRID SICHUAN ELECTRIC POWER CORP ELECTRIC POWER RES INST +2
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411558352.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2024-12-27
Estimated Expiration
2044-11-04

AI Technical Summary

Technical Problem

Existing lithium-ion battery state of charge estimation methods are difficult to accurately capture the relationship between battery input data and state of charge, resulting in high volatility and instability of state of charge estimation, limiting the practical application of lithium-ion battery state evaluation.

Method used

The battery state of charge estimation method based on local weighted regression is used to smooth the current and voltage data through the local weighted regression algorithm, and merge it with the original current and voltage input to enhance the convolutional hybrid neural network for regression prediction, combining the multi-layer self-attention mechanism and Group convolution operation generates SOC prediction values ​​and reduces output fluctuations.

Benefits of technology

It improves the accuracy and stability of state-of-charge estimation of lithium-ion batteries, reduces fluctuations in SOC output, enhances the model's understanding of internal characteristics of the battery and captures long-term dependencies, and is suitable for battery SOC estimation modeling tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119199557A_ABST
    Figure CN119199557A_ABST
Patent Text Reader

Abstract

The invention discloses a battery state-of-charge estimation method and device based on local weighted regression, and the method employs local weighted regression smooth current and voltage as neural network training extension input, enhances the implicit relation between data and the actual SOC value of a lithium ion battery, improves the prediction capability of a model, and effectively reduces the SOC output fluctuation. A grouping convolutional neural network prediction model with a multi-layer self-attention mechanism is provided, so that the parameter quantity and the calculation quantity of the model are effectively reduced, and local feature information is better captured; a multi-layer self-attention mechanism is introduced, so that the network can dynamically establish association among different positions, the long-distance dependency relationship in a voltage and current sequence is better captured, and meanwhile, the method has good flexibility and interpretability and is very suitable for a battery SOC estimation modeling task; proportional integral and differential search algorithms are introduced to carry out hyper-parameter optimization, and iterative optimization is continuously carried out to obtain optimal network parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of lithium-ion battery state prediction, and in particular to a battery state of charge estimation method and device based on local weighted regression. Background Art

[0002] With the gradual depletion of non-renewable fossil fuels and the frequent occurrence of extreme climate events, the world has paid more attention to clean energy since the 21st century. Thanks to the continuous advancement of technology and effective cost control, lithium-ion batteries have become one of the key driving forces of global energy transformation. More and more countries and regions are increasing their investment and R&D in this technology to promote the innovation and application of green energy technology and meet the dual challenges of climate change and energy security. In the development and application of lithium-ion batteries, the battery management system (BMS) is crucial to ensure the safety, stability and performance of batteries. It has become a core component of key technologies such as electric vehicles, portable electronic devices and energy storage systems. BMS can monitor battery voltage, current, temperature and state of charge in real time, manage and control the charging and discharging process of lithium-ion batteries, avoid overcharging, over-discharging and thermal runaway, and ensure the long-term safe and stable operation of lithium-ion batteries. In particular, the state of charge, as a core parameter of BMS, is related to the performance and service life of lithium-ion batteries. If the SOC estimation result is less than the actual value, the full power of the lithium-ion battery cannot be fully utilized and the efficiency cannot be improved. On the contrary, if the SOC estimation value is greater than the actual value, it will be misleading and easily cause the lithium-ion battery to over-discharge. Therefore, its accurate estimation is of great significance to ensure the safe and reliable operation of the battery.

[0003] Although the current state of charge prediction using machine learning technology can achieve high accuracy, the model used is difficult to accurately capture the relationship between lithium-ion battery input data and state of charge, resulting in high volatility and instability in state of charge estimation. Therefore, the short-term output fluctuation of lithium-ion battery state evaluation using this method is large, which seriously restricts its practical application. Therefore, it is urgent to develop an estimation method with high accuracy and low volatility to solve this problem. Summary of the invention

[0004] Based on the problems raised by the above background technology, the purpose of the present invention is to provide a battery state of charge estimation method and device based on local weighted regression, which solves the problem that the existing model is difficult to accurately capture the relationship between lithium-ion battery input data and the state of charge, thereby causing high volatility and instability in the state of charge estimation.

[0005] The present invention is achieved through the following technical solutions:

[0006] A first aspect of the present invention provides a battery state of charge estimation method based on local weighted regression, comprising the following steps:

[0007] Obtaining the original current and voltage of the battery, and smoothing the original current and voltage using a local weighted regression algorithm to obtain a smoothed current and voltage;

[0008] The original current and voltage are combined with the smoothed current and voltage into extended data and input into the enhanced convolutional hybrid neural network for regression prediction to obtain the SOC prediction value; wherein,

[0009] The enhanced convolution hybrid neural network sequentially performs common convolution and grouped convolution operations on the extended data to generate a feature map;

[0010] The feature map is processed based on a multi-layer self-attention mechanism, and the processed feature map is linked to a fully connected layer for nonlinear combination to obtain a SOC prediction value.

[0011] In the above technical solution, the current and voltage under different working conditions and temperatures are obtained through the experimental platform, and then the current and voltage are smoothed using local weighted regression, and merged with the original current and voltage data to form a new extended neural network input. This extended input can help the neural network learn the relevant internal characteristics of the battery when the battery parameters change rapidly, and effectively reduce the fluctuation of the network output SOC.

[0012] The extended input is subjected to convolution operation to form a feature map, and then grouped convolution is performed. Grouped convolution divides the input feature map into several groups, each group is subjected to independent convolution operation, and the results are recombined to form the final output feature map. Each group of convolutions improves the performance of the model on unseen data by limiting the number of parameters and the connections within different groups, which has the characteristic of reducing the risk of overfitting. After grouped convolution, a multi-layer self-attention mechanism is introduced, in which the self-attention layer is composed of multiple layers stacked in the form of each layer receiving input from the previous layer and passing it to the next layer. The output of this hierarchical structure not only reflects the network's in-depth understanding of the current data point, but also integrates the information of the previous layer, thereby enhancing the network model's ability to capture complex patterns and long-term dependencies in time series. Finally, the output is linked to the fully connected layer for nonlinear combination to obtain the final SOC prediction value.

[0013] In an optional embodiment, the smoothing process of the original current and voltage using a local weighted regression algorithm comprises the following steps:

[0014] Dividing the original current and voltage into a plurality of intervals, determining a proportional parameter covered by the fitting of each interval, wherein the proportional parameter is used to determine the proportion of current and voltage data points contained in a local neighborhood around each current and voltage data point;

[0015] For each current and voltage data point, calculate the weights of each current and voltage data point in its domain;

[0016] A quadratic term model is generated by fitting using a weighted least square method, and a weighted error process is performed on the quadratic term model using the weights of each current and voltage data point in the field to obtain a weighted least square equation;

[0017] The weighted least squares equation is used to solve the smoothing parameter to obtain the smoothed value of the current and voltage data points.

[0018] In an optional embodiment, the enhanced convolution hybrid neural network sequentially performs convolution and group convolution operations on the extended data, including:

[0019] Performing ordinary convolution on the extended data to generate a first feature map;

[0020] The first feature map is divided into g groups of sub-feature maps, wherein the size S of the sub-feature map is:

[0021]

[0022] Among them, W is the width of the input feature map, H is the height of the input feature map, and C is the number of channels of the input feature map;

[0023] The convolution kernels of the grouped convolution are divided into g groups, where the kernel size of each group of convolution kernels is S k for:

[0024]

[0025] Among them, k is the convolution kernel size;

[0026] The sub-feature map is input into the convolution kernel of the corresponding group convolution for group convolution, and the sub-feature maps obtained by each group convolution are combined to obtain a second feature map, wherein the feature map size S of the second feature map is f for:

[0027] S f =W'×H'×g

[0028] Wherein, W' is the width of the second feature map, and H' is the height of the second feature map.

[0029] In an optional embodiment, processing the feature map based on a multi-layer self-attention mechanism includes the following steps:

[0030] Flattening the feature graph into sequence data, performing linear transformation on the sequence data to generate a query matrix, a key matrix and a value matrix;

[0031] calculating an attention score between the query matrix, the key matrix, and the value matrix;

[0032] The attention scores are calculated using a softmax function to obtain an attention weight matrix, and the attention weight matrix is ​​multiplied by the value matrix to obtain a weighted matrix;

[0033] Constructing a multi-layer self-attention layer based on a multi-layer attention mechanism, wherein the self-attention mechanism of each layer of the self-attention layer is constructed using the weighted matrix;

[0034] The sequence data is input into the multi-layer self-attention layer, the output data of each layer is spliced, and the spliced ​​output data is linearly transformed to obtain the final output data.

[0035] In an optional embodiment, a mask operation is used to set the attention weights of the filled positions in the query matrix, the key matrix and the value matrix to zero before calculating the attention scores between the query matrix, the key matrix and the value matrix.

[0036] In an optional embodiment, the enhanced convolutional hybrid neural network performs hyperparameter adjustment through a search algorithm based on a PID algorithm, wherein the hyperparameter adjustment process includes the following steps:

[0037] Initialize the population:

[0038] x ij =(u j -l j )·round1,i=1,2,...,n; j=1,2,...,d

[0039] Among them, x ij represents the jth hyperparameter of the i-th population individual, u j is the upper limit of the jth hyperparameter, l j is the lower limit of the jth hyperparameter, and round1 is a random number between 0 and 1;

[0040] The individual corresponding to the historical minimum value of the population at the tth iteration is taken as the best individual x * (t) Calculate the system deviation:

[0041]

[0042] Among them, e k represents the overall deviation of the kth iteration, e k-1 represents the overall deviation of the k-1th iteration;

[0043] The system deviation is adjusted in the simulated PID algorithm, and the population is updated: wherein the adjustment formula is as follows:

[0044] Δu(t)=Kp ·r1·[e k (t)-e k-1 (t)]+K i ·r2·e k (t)+K d ·r3·[e k (t)-2e k-1 (t)+e k-2 (t)]

[0045] Among them, K p ,K i ,K d They are the adjustment coefficients of the proportional factor, integral factor and differential factor respectively. r1, r2, r3 are random number vectors with n rows and 1 column values ​​between 0 and 1.

[0046] In an optional embodiment, a zero-input condition factor is introduced into the PID algorithm, wherein the zero-input condition factor is as shown in the following formula:

[0047] o(t)=(cos(1-t / T)+λr4·L)·e k (t)

[0048] λ=[ln(T-t+2) / ln(T)] 2

[0049] Among them, o(t) is the conditional factor of zero input, r4 is a random number vector with n rows and 1 column values ​​between 0 and 1, λ is the adjustment coefficient, T is the sampling period, t is the discrete independent variable, and L is the Levy flight function.

[0050] A second aspect of the present invention provides a battery state of charge estimation system based on local weighted regression, comprising:

[0051] A smoothing module, the smoothing module is used to obtain the original current and voltage of the battery, and use a local weighted regression algorithm to smooth the original current and voltage to obtain a smoothed current and voltage;

[0052] A prediction module is used to combine the original current and voltage with the smoothed current and voltage into extended data and input it into an enhanced convolutional hybrid neural network for regression prediction to obtain a predicted SOC value; wherein the prediction module includes:

[0053] A convolution unit, wherein the convolution unit is used for the enhanced convolution hybrid neural network to sequentially perform common convolution and group convolution operations on the extended data to generate a feature map;

[0054] A self-attention unit is used to process the feature map based on a multi-layer self-attention mechanism, link the processed feature map to a fully connected layer for nonlinear combination, and obtain a SOC prediction value.

[0055] A third aspect of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a battery state of charge estimation method based on local weighted regression when executing the program.

[0056] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a battery state of charge estimation method based on local weighted regression.

[0057] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0058] 1. Use local weighted regression smoothed current and voltage as extended input for neural network training. This extended input information has a slow time-varying characteristic, which helps the neural network understand the mapping relationship of the internal characteristics of the battery when the battery voltage and current change dramatically, and fuses it with the original voltage and current data, enhancing the implicit connection between the data and the actual SOC value of the lithium-ion battery, improving the prediction ability of the model, and effectively reducing SOC output fluctuations;

[0059] 2. A grouped convolutional neural network prediction model with a multi-layer self-attention mechanism is proposed. Grouped convolution divides the input feature map and convolution kernel into several groups. The convolution kernel in each group only performs convolution operations with the input feature map in the corresponding group, instead of convolution with the entire input feature map, which effectively reduces the number of model parameters and computation, while better capturing local feature information;

[0060] 3. The introduction of a multi-layer self-attention mechanism enables the network to dynamically establish associations between different positions, thereby better capturing the long-distance dependencies within the voltage and current series. It also has good flexibility and interpretability, making it very suitable for battery SOC estimation modeling tasks;

[0061] 4. Introduce proportional integral and differential search algorithms to optimize hyperparameters, and continuously iterate to obtain the optimal network parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative work. In the drawings:

[0063] Figure 1 A schematic diagram of a flow chart of a battery state of charge estimation method based on local weighted regression provided in Embodiment 1 of the present invention;

[0064] Figure 2 The SOC estimation result and error diagram of the BBDST condition at 25 degrees Celsius provided in Example 1 of the present invention;

[0065] Figure 3 The SOC estimation result and error diagram of the DST condition at 25 degrees Celsius provided in Example 1 of the present invention;

[0066] Figure 4 A schematic diagram of the structure of an electronic device provided in Example 2 of the present invention. DETAILED DESCRIPTION

[0067] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.

[0068] Example 1

[0069] Figure 1 A schematic diagram of a flow chart of a battery state of charge estimation method based on local weighted regression provided in Example 1 of the present invention, such as Figure 1 As shown, the battery state of charge estimation method based on local weighted regression includes the following steps:

[0070] Obtaining the original current and voltage of the battery, and smoothing the original current and voltage using a local weighted regression algorithm to obtain a smoothed current and voltage;

[0071] The original current and voltage are combined with the smoothed current and voltage into extended data and input into the enhanced convolutional hybrid neural network for regression prediction to obtain the SOC prediction value; wherein,

[0072] The enhanced convolution hybrid neural network sequentially performs common convolution and grouped convolution operations on the extended data to generate a feature map;

[0073] The feature map is processed based on a multi-layer self-attention mechanism, and the processed feature map is linked to a fully connected layer for nonlinear combination to obtain a SOC prediction value.

[0074] It should be noted that the battery state of charge estimation method provided in Example 1 of the present invention obtains the current and voltage under different working conditions and temperatures through an experimental platform, and then uses local weighted regression to smooth the current and voltage, and merges them with the original current and voltage data to form a new extended neural network input. The extended input can help the neural network learn the relevant internal characteristics of the battery when the battery parameters change rapidly, and effectively reduce the fluctuation of the network output SOC.

[0075] The extended input is subjected to convolution operation to form a feature map, and then grouped convolution is performed. Grouped convolution divides the input feature map into several groups, each group is subjected to independent convolution operation, and the results are recombined to form the final output feature map. Each group of convolutions improves the performance of the model on unseen data by limiting the number of parameters and the connections within different groups, which has the characteristic of reducing the risk of overfitting. After grouped convolution, a multi-layer self-attention mechanism is introduced, in which the self-attention layer is composed of multiple layers stacked in the form of each layer receiving input from the previous layer and passing it to the next layer. The output of this hierarchical structure not only reflects the network's in-depth understanding of the current data point, but also integrates the information of the previous layer, thereby enhancing the network model's ability to capture complex patterns and long-term dependencies in time series. Finally, the output is linked to the fully connected layer for nonlinear combination to obtain the final SOC prediction value.

[0076] In an optional embodiment, the smoothing process of the original current and voltage using a local weighted regression algorithm comprises the following steps:

[0077] Dividing the original current and voltage into a plurality of intervals, determining a proportional parameter covered by the fitting of each interval, wherein the proportional parameter is used to determine the proportion of current and voltage data points contained in a local neighborhood around each current and voltage data point;

[0078] For each current and voltage data point, calculate the weights of each current and voltage data point in its domain;

[0079] A quadratic term model is generated by fitting using a weighted least square method, and a weighted error process is performed on the quadratic term model using the weights of each current and voltage data point in the field to obtain a weighted least square equation;

[0080] The weighted least squares equation is used to solve the smoothing parameter to obtain the smoothed value of the current and voltage data points.

[0081] It should be noted that when using machine learning methods to estimate the SOC of lithium-ion batteries, battery current and voltage are usually selected as network training inputs. However, since the current and voltage required by the test conditions will change dramatically in a short period of time, the neural network can only learn the mapping relationship between input data and output data, but cannot learn the internal characteristics of lithium-ion batteries. As a result, the final output SOC has a good fitting trend and accuracy, but also has the disadvantage of drastic fluctuations in a short period of time.

[0082] Based on the above defects, the embodiment of the present invention proposes a local regression (Loess) network input extension using weighted linear least squares and quadratic polynomial models. By using the Loess smoothing algorithm for the sharply fluctuating current and voltage, a current and voltage with slow time-varying information are obtained, named L-Current and L-Voltage respectively. Finally, it is merged with the current and voltage data to obtain the final network input extension.

[0083] The Loess curve smoothing algorithm is a non-parametric method for local regression analysis. It mainly divides the samples into small intervals, performs polynomial fitting on the samples in the intervals, and repeats this process to obtain weighted regression curves in different intervals. Finally, the centers of these regression curves are connected together to synthesize a complete regression curve.

[0084] Specifically, the sampled raw current and voltage data are first divided into a number of small intervals, and a ratio parameter is determined, which determines the ratio of the current and voltage data points included in the local neighborhood around each current and voltage data point. For example, if the ratio parameter is 0.5, each local neighborhood includes approximately half of the current and voltage data points in the raw current and voltage data set.

[0085] For each current and voltage data point, calculate the weight of each current and voltage data point in its neighborhood. The weight is usually inversely proportional to the distance between the data points, that is, the closer the distance, the greater the weight. The calculation formula is as follows:

[0086]

[0087] where w i (x) is the weight function, x i is the current and voltage data point, the bandwidth is h, if the observation point x j If the distance exceeds the bandwidth h, the weight is 0.

[0088] The quadratic term model is obtained by fitting using the weighted least squares method. The quadratic term model is shown as follows:

[0089] y=β0+β1(xx i )+β2(xx i) 2

[0090] Here β0, β1, β2 are the parameters of the local quadratic model, which need to be solved by minimizing the weighted sum of squared errors.

[0091] The weighted sum of squared errors of the quadratic polynomial model is minimized to obtain the weighted least squares equation, which is shown as follows:

[0092]

[0093] Use the normal equation of weighted least squares to solve for the parameters β0, β1, β2:

[0094]

[0095] Finally, we get i Smoothing value at

[0096]

[0097] This process is repeatedly applied to each current and voltage data point in the original current and voltage data set, and finally a smooth curve of the entire original current and voltage data set is obtained to generate a smooth current and voltage. The Loess algorithm can generate a smooth curve while maintaining the local characteristics of the data, effectively capturing the overall trend and local changes of the data.

[0098] In an optional embodiment, the enhanced convolution hybrid neural network sequentially performs convolution and group convolution operations on the extended data, including:

[0099] Performing ordinary convolution on the extended data to generate a first feature map;

[0100] The first feature map is divided into g groups of sub-feature maps, wherein the size S of the sub-feature map is:

[0101]

[0102] Among them, W is the width of the input feature map, H is the height of the input feature map, and C is the number of channels of the input feature map;

[0103] The convolution kernels of the grouped convolution are divided into g groups, where the kernel size of each group of convolution kernels is S k for:

[0104]

[0105] Among them, k is the convolution kernel size;

[0106] The sub-feature map is input into the convolution kernel of the corresponding group convolution for group convolution, and the sub-feature maps obtained by each group convolution are combined to obtain a second feature map, wherein the feature map size S of the second feature map is f for:

[0107] S f =W'×H'×g

[0108] Wherein, W' is the width of the second feature map, and H' is the height of the second feature map.

[0109] It should be noted that the extended data is first subjected to ordinary convolution to generate a first feature map, and then the first feature map is grouped and input into the convolution kernel of the corresponding group convolution for separate convolution, and the second feature map, that is, the feature map required by the present invention, is obtained by splicing the sub-feature maps generated by all separate convolutions.

[0110] The number of parameters params of grouped convolution is as follows:

[0111]

[0112] The total computational FLOPs is as follows:

[0113] FLOPs = k 2 ×C×W×H'

[0114] Compared with traditional convolution, grouped convolution reduces the number of parameters and the total amount of computation by (g-1) / g, making it more lightweight. Grouped convolution also allows convolution operations to be performed in parallel on multiple groups, which can fully utilize the parallel computing capabilities of the hardware, especially in scenarios that need to balance model performance and computing resources. These advantages can effectively reduce the hardware resource consumption of the battery management system.

[0115] In an optional embodiment, processing the feature map based on a multi-layer self-attention mechanism includes the following steps:

[0116] Flattening the feature graph into sequence data, performing linear transformation on the sequence data to generate a query matrix, a key matrix and a value matrix;

[0117] calculating an attention score between the query matrix, the key matrix, and the value matrix;

[0118] The attention scores are calculated using a softmax function to obtain an attention weight matrix, and the attention weight matrix is ​​multiplied by the value matrix to obtain a weighted matrix;

[0119] Constructing a multi-layer self-attention layer based on a multi-layer attention mechanism, wherein the self-attention mechanism of each layer of the self-attention layer is constructed using the weighted matrix;

[0120] The sequence data is input into the multi-layer self-attention layer, the output data of each layer is spliced, and the spliced ​​output data is linearly transformed to obtain the final output data.

[0121] It should be noted that the attention mechanism is a technology widely used in neural networks in recent years. The attention mechanism improves the performance of the model when processing long sequence data by assigning different weights to different parts of the input data. The present invention introduces multiple different self-attention heads to capture the relationship between different positions in the input sequence, so that the model can fully capture various dependencies and feature representations in the input sequence, while enhancing the expressiveness of the model.

[0122] Input sequence data X∈R in the multi-layer self-attention mechanism n×d , where n is the sequence length, d is the dimension of each input vector, and the input data undergoes three different linear transformations to generate query, key, and value matrices, as shown in the following formula:

[0123]

[0124] Among them, W q ,W k ,W v is a trainable weight matrix.

[0125] Then calculate the attention score score(Q,K) between each vector in the input sequence, as shown in the following formula:

[0126]

[0127] Where W is the weight matrix between the input layer and the hidden layer, and U is the weight matrix between the hidden layers. L ] T is a matrix composed of L query matrices, K=[k1,k2,...,k L ] T is a matrix composed of L key matrices, V = [v1, v2, ..., v L ] T is a matrix of L value matrices, L is the time step, d k is the scale factor, controlling the scaling.

[0128] After obtaining the attention score, the attention weight matrix α is obtained through the softmax function, as shown in the following formula:

[0129] α=softmax(score(Q,K))

[0130] The attention weight matrix is ​​multiplied by the value matrix to obtain the weighted value Attention, as shown in the following formula:

[0131] Attention(Q,K,V)=αV

[0132] Multi-layer self-attention extracts features from the input time series by constructing multiple layers of self-attention. Each layer of self-attention mechanism i As shown below:

[0133] Layer i =Attention(Q,W i Q ,K,W i K ,V,W i V ),1<i<h

[0134] Among them, W i Q ,W i K ,W i V is the parameter matrix of the i-th layer, and h is the number of attention layers.

[0135] Finally, the outputs of all layers are concatenated together and transformed by linear transformation W. o The final output is as follows:

[0136]

[0137] Where H represents the matrix containing the outputs of all layers.

[0138] Through multiple attention heads, the network model can capture the relationships between different levels and positions in the input sequence, thereby obtaining richer feature representations, and by flexibly allocating attention, the model can more effectively capture long-range dependencies and complex structures.

[0139] In an optional embodiment, a mask operation is used to set the attention weights of the filled positions in the query matrix, the key matrix and the value matrix to zero before calculating the attention scores between the query matrix, the key matrix and the value matrix.

[0140] It should be noted that when processing long sequence data, the input sequence may contain some invalid filled positions. These filled positions should not affect the attention calculation. The mask operation can be used to set the attention weights of these filled positions to zero, thereby shielding their influence on the results. The mask operation is shown in the following formula:

[0141]

[0142] Among them, mask ij Represents the element in the i-th row and j-th column of the mask matrix.

[0143] In an optional embodiment, the enhanced convolutional hybrid neural network performs hyperparameter adjustment through a search algorithm based on a PID algorithm, wherein the hyperparameter adjustment process includes the following steps:

[0144] Initialize the population:

[0145] x ij =(u j -l j )·round1,i=1,2,...,n; j=1,2,...,d

[0146] Among them, x ij represents the jth hyperparameter of the i-th population individual, u j is the upper limit of the jth hyperparameter, l j is the lower limit of the jth hyperparameter, and round1 is a random number between 0 and 1;

[0147] The individual corresponding to the historical minimum value of the population at the tth iteration is taken as the best individual x * (t) Calculate the system deviation:

[0148]

[0149] Among them, e k represents the overall deviation of the kth iteration, e k-1 represents the overall deviation of the k-1th iteration;

[0150] The system deviation is adjusted in the simulated PID algorithm, and the population is updated: wherein the adjustment formula is as follows:

[0151] Δu(t)=K p ·r1·[e k (t)-e k-1 (t)]+K i ·r2·e k (t)+K d ·r3·[e k (t)-2e k-1 (t)+e k-2 (t)]

[0152] Among them, K p ,K i ,K d They are the adjustment coefficients of the proportional factor, integral factor and differential factor respectively. r1, r2, r3 are random number vectors with n rows and 1 column values ​​between 0 and 1.

[0153] In this embodiment, the objective function f of the i-th population individual in the enhanced convolutional hybrid neural network is i The build is as follows:

[0154] f i =MSE train +MSE test

[0155] Among them, MSE train Represents the mean square error of the training set, MSE test represents the mean square error of the test set.

[0156] In this embodiment, the adjustment coefficients of the proportional factor, the integral factor and the differential factor are set to 1, 0.5 and 1.2 respectively.

[0157] The formula for updating the population is as follows:

[0158]

[0159] Among them, r5 is a random matrix.

[0160] It should be noted that hyperparameter adjustment is a key process, the purpose of which is to find the best network configuration to improve the performance and generalization ability of the model. In order to solve complex real-world optimization problems, people have proposed meta-heuristic algorithms to solve optimization problems by simulating observed phenomena. The PID search algorithm used in this method is inspired by the classic incremental PID algorithm in the control field. The algorithm is based on an incremental proportional integral and differential algorithm. By continuously adjusting the system deviation, the entire population converges to the optimal state to obtain the optimal network parameters. The enhanced group convolutional hybrid neural network prediction method for lithium-ion battery state of charge estimation is named EI-PSA-GCNN-MSA.

[0161] In Example 1 of the present invention, the parameters of the enhanced group convolutional hybrid neural network for lithium-ion battery state of charge estimation are set as shown in Table 1:

[0162] Table 1 Parameter settings of enhanced group convolutional hybrid neural network for lithium-ion battery state of charge estimation

[0163]

[0164] In this algorithm, the historical best individual of the population is abstracted as the target value, and each individual is abstracted as the true value. By simulating the PID adjustment process, the deviation of each individual relative to the best individual is corrected, so that the entire group can reach a better state. In this study, the PID search algorithm is introduced to adjust the initial learning rate and L2 regularization parameter of the neural network model, avoiding the tedious process of manual parameter adjustment. The PID search algorithm continuously adjusts the control amount so that the output of the system gradually approaches the target value algorithm. It has a strong global search capability and can effectively avoid the problem of local optimal solution.

[0165] In an optional embodiment, a zero-input condition factor is introduced into the PID algorithm, wherein the zero-input condition factor is as shown in the following formula:

[0166] o(t)=(cos(1-t / T)+λr4·L)·e k (t)

[0167] λ=[ln(T-t+2) / ln(T)] 2

[0168] Among them, o(t) is the conditional factor of zero input, r4 is a random number vector with n rows and 1 column values ​​between 0 and 1, λ is the adjustment coefficient, T is the sampling period, t is the discrete independent variable, and L is the Levy flight function.

[0169] It should be noted that the purpose of introducing the zero input conditional factor is to prevent the PID algorithm from falling into the local optimal solution. λ decreases with the increase of t, which is conducive to the PID search algorithm to find the global optimal solution.

[0170] Among them, the Levy flight function is as follows:

[0171]

[0172] Among them, u and v are random number matrices and conform to the normal distribution, and β is set to 1.5.

[0173] The PID search optimization algorithm has great application potential in neural network parameter adjustment. Its powerful global search capability, adaptive adjustment and good robustness can effectively improve the training effect and performance of neural networks. The combination of PID search algorithm and neural network can further give play to the advantages of PID control algorithm and realize a more efficient and stable neural network training process.

[0174] To verify the effectiveness of the method provided by the present invention, Example 1 built a lithium-ion battery operating condition test platform, the core of which is a lithium-ion battery power cell tester (NEWARE-CT-4016), with a constant voltage control range of 0.025V to 5V, and a current output range of 0.5A to 100A per channel. The constant temperature control device (DGBELL-BTT-331C) is used to simulate a constant temperature environment, which can control the ambient temperature of the lithium-ion battery charge and discharge test within the set temperature range. Both devices are connected to a control computer, and the experimental data of the lithium-ion battery under the set working conditions are set, monitored and recorded through the TCP / IP protocol.

[0175] The experiment selected 3.7V / 75Ah lithium-ion batteries as the test object. Its parameters are shown in Table 2. Beijing Bus Dynamic Test Conditions (BBDST) and Dynamic Stress Test (DST) conditions were tested. BBDST is a test method designed to evaluate and optimize the performance of urban buses under actual operating conditions. This condition simulates various driving conditions of urban bus lines, such as starting, stopping, acceleration, deceleration, idling, etc., and is a test condition that conforms to common conditions in real use. DST is a test method for evaluating the performance of a vehicle under different stress conditions. By simulating various dynamic stress conditions that the vehicle may encounter in actual operation, such as high load, steep slope, high-speed driving, etc., the structural strength, power system reliability and comprehensive performance of the vehicle are tested.

[0176] The built test platform was used to obtain the current and voltage data of the BBDST and DST test conditions at ambient temperatures of -5°C, 10°C, 25°C, and 35°C, and then a data set was formed. The holdout method was used to take 70% of the samples as training data and 30% of the samples as test data. The SOC estimation results and error diagram are shown in the figure below. Figure 2 , Figure 3 As shown in Figure 2, an ablation experiment was designed to verify the performance of the proposed lithium-ion battery SOC estimation algorithm, and the performance was compared with the commonly used long short-term memory neural network to verify the effectiveness of the proposed algorithm.

[0177] Table 2 3.7V / 75Ah lithium-ion battery parameters

[0178]

[0179] Example 2

[0180] Embodiment 2 of the present invention provides a battery state of charge estimation system based on local weighted regression, including:

[0181] A smoothing module, the smoothing module is used to obtain the original current and voltage of the battery, and use a local weighted regression algorithm to smooth the original current and voltage to obtain a smoothed current and voltage;

[0182] A prediction module is used to combine the original current and voltage with the smoothed current and voltage into extended data and input it into an enhanced convolutional hybrid neural network for regression prediction to obtain a predicted SOC value; wherein the prediction module includes:

[0183] A convolution unit, wherein the convolution unit is used for the enhanced convolution hybrid neural network to sequentially perform common convolution and group convolution operations on the extended data to generate a feature map;

[0184] A self-attention unit is used to process the feature map based on a multi-layer self-attention mechanism, link the processed feature map to a fully connected layer for nonlinear combination, and obtain a SOC prediction value.

[0185] Example 3

[0186] Figure 4 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention is shown in FIG. Figure 4 As shown, the electronic device includes a processor 21, a memory 22, an input device 23 and an output device 24; the number of processors 21 in the computer device can be one or more. Figure 4 A processor 21 is taken as an example; the processor 21, the memory 22, the input device 23 and the output device 24 in the electronic device can be connected by a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0187] The memory 22 is a computer-readable storage medium that can be used to store software programs, computer executable programs, and modules. The processor 21 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 22, that is, the battery state of charge estimation method based on local weighted regression of Example 1 is implemented.

[0188] The memory 22 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 22 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 22 may further include a memory remotely arranged relative to the processor 21, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0189] The input device 23 can be used to receive the ID and password input by the user, etc. The output device 24 is used to output the network configuration page.

[0190] Example 4

[0191] Embodiment 4 of the present invention further provides a computer-readable storage medium, wherein the computer-executable instructions are used to implement the battery state of charge estimation method based on local weighted regression as provided in Embodiment 1 when executed by a computer processor.

[0192] An embodiment of the present invention provides a storage medium containing computer executable instructions, and its computer executable instructions are not limited to the method operations provided in Example 1, and can also execute related operations in the battery state of charge estimation method based on local weighted regression provided in any embodiment of the present invention.

[0193] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A battery state of charge estimation method based on local weighted regression, characterized in that: The steps include: Obtaining the original current and voltage of the battery, and smoothing the original current and voltage using a local weighted regression algorithm to obtain a smoothed current and voltage; The original current and voltage are combined with the smoothed current and voltage into extended data and input into the enhanced convolutional hybrid neural network for regression prediction to obtain the SOC prediction value; wherein, The enhanced convolution hybrid neural network sequentially performs common convolution and grouped convolution operations on the extended data to generate a feature map; The feature map is processed based on a multi-layer self-attention mechanism, and the processed feature map is linked to a fully connected layer for nonlinear combination to obtain a SOC prediction value.

2. The method for estimating battery state of charge based on local weighted regression according to claim 1, characterized in that: The smoothing process of the original current and voltage using the local weighted regression algorithm includes the following steps: Dividing the original current and voltage into a plurality of intervals, determining a proportional parameter covered by the fitting of each interval, wherein the proportional parameter is used to determine the proportion of current and voltage data points contained in a local neighborhood around each current and voltage data point; For each current and voltage data point, calculate the weights of each current and voltage data point in its domain; A quadratic term model is generated by fitting using a weighted least square method, and a weighted error process is performed on the quadratic term model using the weights of each current and voltage data point in the field to obtain a weighted least square equation; The weighted least squares equation is used to solve the smoothing parameter to obtain the smoothed value of the current and voltage data points.

3. The battery state of charge estimation method based on local weighted regression according to claim 1, characterized in that: The enhanced convolution hybrid neural network sequentially performs convolution and group convolution operations on the extended data, including: Performing ordinary convolution on the extended data to generate a first feature map; The first feature map is divided into g groups of sub-feature maps, wherein the size S of the sub-feature map is: Among them, W is the width of the input feature map, H is the height of the input feature map, and C is the number of channels of the input feature map; The convolution kernels of the grouped convolution are divided into g groups, where the kernel size of each group of convolution kernels is S k for: Among them, k is the convolution kernel size; The sub-feature map is input into the convolution kernel of the corresponding group convolution for group convolution, and the sub-feature maps obtained by each group convolution are combined to obtain a second feature map, wherein the feature map size S of the second feature map is f for: S f =W'×H'×g Wherein, W' is the width of the second feature map, and H' is the height of the second feature map.

4. The battery state of charge estimation method based on local weighted regression according to claim 1, characterized in that: Processing the feature map based on the multi-layer self-attention mechanism includes the following steps: Flattening the feature graph into sequence data, performing linear transformation on the sequence data to generate a query matrix, a key matrix and a value matrix; calculating an attention score between the query matrix, the key matrix, and the value matrix; The attention scores are calculated using a softmax function to obtain an attention weight matrix, and the attention weight matrix is ​​multiplied by the value matrix to obtain a weighted matrix; Constructing a multi-layer self-attention layer based on a multi-layer attention mechanism, wherein the self-attention mechanism of each self-attention layer is constructed using the weighted matrix; The sequence data is input into the multi-layer self-attention layer, the output data of each layer is spliced, and the spliced ​​output data is linearly transformed to obtain the final output data.

5. The method for estimating battery state of charge based on local weighted regression according to claim 4, characterized in that: A mask operation is used to set the attention weights of the filled positions in the query matrix, the key matrix, and the value matrix to zero before calculating the attention scores between the query matrix, the key matrix, and the value matrix.

6. The battery state of charge estimation method based on local weighted regression according to claim 1, characterized in that: The enhanced convolutional hybrid neural network performs hyperparameter adjustment through a search algorithm based on the PID algorithm, wherein the hyperparameter adjustment process includes the following steps: Initialize the population: x ij =(u j -l j )·round1,i=1,2,...,n;j=1,2,...,d Among them, x ij represents the jth hyperparameter of the i-th population individual, u j is the upper limit of the jth hyperparameter, l j is the lower limit of the jth hyperparameter, and round1 is a random number between 0 and 1; The individual corresponding to the historical minimum value of the population at the tth iteration is taken as the best individual x * (t) Calculate the system deviation: Among them, e k represents the overall deviation of the kth iteration, e k-1 represents the overall deviation of the k-1th iteration; The system deviation is adjusted in the simulated PID algorithm, and the population is updated: wherein the adjustment formula is as follows: Δu(t)=K p ·r1·[e k (t)-e k-1 (t)]+K i ·r2·e k (t)+K d ·r3·[e k (t)-2e k-1 (t)+e k-2 (t)] Among them, K p ,K i ,K d They are the adjustment coefficients of the proportional factor, integral factor and differential factor respectively. r1, r2, r3 are random number vectors with n rows and 1 column values ​​between 0 and 1.

7. The method for estimating battery state of charge based on local weighted regression according to claim 6, characterized in that: The PID algorithm introduces a zero input condition factor, wherein the zero input condition factor is as follows: o(t)=(cos(1-t / T)+λr4·L)·e k (t) λ=[ln(T-t+2) / ln(T)] 2 Among them, o(t) is the conditional factor of zero input, r4 is a random number vector with n rows and 1 column values ​​between 0 and 1, λ is the adjustment coefficient, T is the sampling period, t is the discrete independent variable, and L is the Levy flight function.

8. A battery state of charge estimation system based on local weighted regression, characterized in that: include: A smoothing module, the smoothing module is used to obtain the original current and voltage of the battery, and use a local weighted regression algorithm to smooth the original current and voltage to obtain a smoothed current and voltage; A prediction module is used to combine the original current and voltage with the smoothed current and voltage into extended data and input it into an enhanced convolutional hybrid neural network for regression prediction to obtain a predicted SOC value; wherein the prediction module includes: A convolution unit, wherein the convolution unit is used for the enhanced convolution hybrid neural network to sequentially perform common convolution and group convolution operations on the extended data to generate a feature map; A self-attention unit is used to process the feature map based on a multi-layer self-attention mechanism, link the processed feature map to a fully connected layer for nonlinear combination, and obtain a SOC prediction value.

9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for estimating the state of charge of a battery based on local weighted regression as claimed in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the battery state of charge estimation method based on local weighted regression as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • BGP anomaly detection method and system based on graph attention network

    CN114221790A

  • Method for automatically setting PID (Proportion Integration Differentiation) parameters in AGV (Automatic Guided Vehicle) speed regulation based on genetic algorithm convolutional neural network

    CN116165880A

  • Lithium ion battery SOC, SOE and SOH joint estimation method based on hybrid neural network

    CN117214755A

  • Method and device for estimating state of charge of marine lithium ion power battery and electronic equipment

    CN117590260A

  • Battery charge state estimation method and device and computer equipment

    CN118033432A