Segmented model-based battery endurance prediction method
By using a combination method of segmented model and stacking stacking model in battery life prediction, the problem of insufficient prediction accuracy in the prior art is solved, and higher prediction accuracy and accurate analysis of battery discharge curves are achieved.
Patent Information
- Application Number
- CN202411651273.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-02-28
AI Technical Summary
The prior art has problems with insufficient accuracy in battery life prediction, especially because the battery discharge data is affected by the environment, usage frequency and random disturbances, resulting in poor model prediction results and prone to overfitting.
The battery life prediction method based on the segmented model is adopted. By obtaining the discharge current data of the battery, the total discharge time prediction model and the stacking stacking model are constructed, and the results of multiple prediction models are combined to reduce the risk of overfitting.
It improves the accuracy of battery life prediction, reduces the model's dependence on the total discharge time, enhances the accurate analysis ability of the battery discharge curve, and predicts the remaining discharge time more in line with the actual situation.
Smart Images

Figure CN119535224A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery detection and analysis, and in particular to a battery endurance prediction method based on a segmentation model. Background Art
[0002] There are many existing methods that apply neural network technology to the field of energy batteries, including scenarios and directions such as battery life prediction and remaining vehicle mileage prediction. However, there are certain deficiencies in the prediction of battery life, because the total discharge time of the battery changes irregularly with the increase of service life. The main reason is that the battery is also affected by factors that are difficult to quantify during use, such as the environment, frequency of use, maintenance level, and random disturbances. Therefore, it is impossible to input the service life as an effective feature into the model to predict the battery life. The existing technology is more about calculating the remaining discharge time, and then using the total discharge time minus the discharge time. This method has the following defects:
[0003] 1. The accuracy of the total discharge time seriously affects the remaining discharge time. However, the total discharge time is generally determined based on the time required to discharge to a certain threshold. This method is heavily dependent on the accuracy of the model. Once the model has a slight deviation, it will be multiplied to the remaining discharge time.
[0004] 2. The actual discharge data of the battery is affected by the actual situation, so the discharge curve of the battery voltage is not smooth. As time goes by, the change in voltage in a unit time is sometimes large and sometimes small. This leads to insufficient data, which affects the prediction effect of the model and causes overfitting, resulting in deviation from the actual results. Summary of the invention
[0005] The purpose of the present invention is to provide a battery life prediction method based on a segmentation model, which can solve the above problems. In order to achieve the above purpose, a battery life prediction method based on a segmentation model is provided, comprising the following steps:
[0006] S1. Obtaining discharge current data of a battery, inputting the current data into a total discharge duration prediction model, and outputting the total discharge duration of the battery;
[0007] S2, obtaining the discharged time of the battery, and arranging the corresponding current data and the total discharge time into a data set; randomly extracting different data subsets from the data set, and constructing a stacking model, wherein the stacking model includes multiple prediction models; inputting the discharged time, current data and total discharge time of the battery to be tested into the corresponding prediction model to obtain multiple voltage prediction data corresponding to the discharge voltage;
[0008] S3. Input multiple voltage prediction data into the stacking model combination to obtain the final prediction result of the discharge voltage; obtain the discharge curve of the battery according to the final prediction result of the discharge voltage and the discharge time, and predict the remaining discharge time according to the discharge curve.
[0009] Further, analyzing the battery life according to the discharge curve in step S3 specifically includes the following steps:
[0010] S301, using the discharge curve of the known current to fill in the discharge curves under other currents;
[0011] S302, seeking a corresponding discharge curve according to the known current battery voltage and discharge time;
[0012] S303 , obtaining a remaining discharge time by subtracting the discharged time from the maximum discharge time of the discharge curve corresponding to the current.
[0013] Further, in step S2, different data subsets are randomly extracted from the data set, and the data set is specifically divided into two data subsets according to the voltage threshold, namely the first data subset and the second data subset. The discharge voltage of the first data subset is greater than the voltage threshold, and the discharge voltage of the second data subset is less than the voltage threshold. Corresponding prediction models are trained according to the data set, the first data subset and the second data subset respectively; the voltage prediction data corresponding to the discharge voltages are respectively the above-threshold prediction results, the below-threshold prediction results and the full-data prediction results.
[0014] Furthermore, in step S2, pre-processing is performed according to the discharge curve data to delete input data that causes voltage instability, wherein the input data corresponds to the discharge time, current data and total discharge time.
[0015] Furthermore, in step S2, feature cross processing is performed on the features to convert the low-dimensional features into high-dimensional features.
[0016] Furthermore, the prediction model is any one of a linear regression model, a tree classification regression model, a logistic regression model and a feedforward neural network regression model.
[0017] Furthermore, the prediction model is preferably a feedforward neural network regression model, and the parameters that need to be adjusted include the number of hidden layers, the number of neurons, the activation function and the learning rate. The optimal parameter combination is traversed to find the optimal value of the evaluation index.
[0018] Furthermore, the stacking model in step S3 is any one of an xgboost regression model, a linear regression model, and a logistic regression model.
[0019] Principles and advantages:
[0020] 1. This solution predicts the total discharge time of the model separately. When calculating the remaining discharge time, you can generally use the total discharge time minus the discharged time to get a slightly accurate remaining discharge time, but it is heavily dependent on the accuracy of the model. Once the model has a slight deviation, it will be multiplied to the remaining discharge time. The total discharge time prediction model of this solution can obtain the accurate total discharge time under each current. If you do not pursue the accuracy of calculating the remaining discharge time too high, you can use the total discharge time minus the discharged time to get an accurate remaining discharge time. This solution uses it as a feature input into the next step of the stacking model, and does not directly calculate the remaining discharge time, so that the remaining discharge time can be accurately analyzed and predicted later.
[0021] 2. The stacking model constructed in this solution is a segmented model. In essence, it builds multiple models through random sampling, and finally uses the stacking model to combine the results of multiple models, which can solve the problem of model overfitting. Because the battery discharge data itself will fluctuate, if a highly complex neural network model is used for training, the trend of the model will be completely consistent with the fluctuation of the discharge data, so the random sampling method is introduced, and multiple models are combined together to average out the fluctuation of the data itself.
[0022] 3. Through practice, it is found that the fitting results of a simple neural network model are not satisfactory. After increasing the complexity of the model, not only the training efficiency of the model is reduced, but also the improvement of the results is not obvious. Through the fitting results, it is found that due to the rapid voltage drop in the third stage of the discharge curve, the fitting result of this stage is always greater than the actual discharge voltage. In order to increase the weight of the voltage below the threshold and not affect the results of the model above the threshold, this scheme divides the data set into two parts, one data subset is greater than the voltage threshold, and the other data subset is less than the voltage threshold. A neural network model is trained using the two data subsets to obtain the corresponding discharge voltage prediction results. Finally, a data set consisting of three model results, namely the above-threshold prediction result, the below-threshold prediction result, and the full-data prediction result, can be obtained. Then the optimal regression model training data set is selected to obtain the final model stacked by three models, thereby improving the accuracy of the model and finally obtaining a remaining discharge time that is more in line with the actual situation.
[0023] 4. This solution builds a machine learning model to deeply mine discharge curves at a finer granularity, and uses limited data to fill in discharge curves under other currents. It expands the original 1A discharge curve into a 0.1A, 0.01A or even 0.001A discharge curve, and reversely searches for the current battery current discharge curve, and finally conveniently obtains the precise remaining discharge time under other current conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A flowchart of a battery life prediction method based on a segmentation model according to an embodiment of the present invention;
[0025] Figure 2 A graph showing the variation of total discharge time and current in a total discharge time prediction model of the prior art;
[0026] Figure 3 A diagram showing the variation of total discharge time and current in the total discharge time prediction model of the embodiment;
[0027] Figure 4 This is the flow chart of the feedforward neural network model;
[0028] Figure 5 It is the discharge curve diagram of the battery at different currents;
[0029] Figure 6 The comparison chart of the discharge curve results at 20A current;
[0030] Figure 7 This is the combined flow chart of the stacking model. DETAILED DESCRIPTION
[0031] The following is further described in detail through specific implementation methods:
[0032] Example
[0033] A battery life prediction method based on a segmented model is suitable for constant current power supply. The current mainstream batteries, such as lead-acid batteries and lithium batteries, all use constant current discharge, which is basically Figure 1 As shown, the following steps are included:
[0034] S1. Obtain the discharge current data of the battery, input the current data into the total discharge time prediction model, and output the total discharge time of the battery; the total discharge time prediction model is a polynomial model under different currents, and the formula is as follows:
[0035] y=a n x n +a n-1 x n-1 +a n-2 x n-2 …a1x+a0
[0036] Among them, x is the current, y is the total discharge time, and the optimal n value is selected by calculating the residual sum of squares;
[0037] The total discharge time and current variation rules in the existing total discharge time prediction model are as follows: Figure 2 As shown;
[0038] The total discharge time prediction model of this scheme has the following rules for total discharge time and current changes: Figure 3 shown.
[0039] S2, obtaining the discharged time of the battery, and arranging the corresponding current data and the total discharge time into a data set; randomly extracting different data subsets from the data set, and constructing a stacking model, wherein the stacking model includes multiple prediction models; inputting the discharged time, current data and total discharge time of the battery to be tested into the corresponding prediction model to obtain multiple voltage prediction data corresponding to the discharge voltage;
[0040] By establishing multiple models through random sampling and combining the results of multiple models using a stacking model, the problem of model overfitting can be solved. Because the battery discharge data itself will fluctuate, if a highly complex neural network model is used for training, the trend of the model will be completely consistent with the fluctuation of the discharge data. Therefore, the random sampling method is introduced and multiple models are combined to average out the fluctuation of the data itself.
[0041] In step S2, different data subsets are randomly selected from the data set, and the data set is specifically divided into two data subsets according to the voltage threshold, namely a first data subset and a second data subset, wherein the discharge voltage of the first data subset is greater than the voltage threshold, and the discharge voltage of the second data subset is less than the voltage threshold (corresponding to Figure 1 The voltage is 1.9V), and the corresponding prediction model is obtained by training the data set, the first data subset and the second data subset respectively; the prediction model is any one of a linear regression model, a tree classification regression model, a logistic regression model and a feedforward neural network regression model. The present embodiment is preferably a feedforward neural network regression model. That is, Figure 1 Model 1, Model 2 and Model 3 in are all feedforward neural network regression models.
[0042] The voltage prediction data corresponding to the discharge voltage are respectively the upper threshold prediction results (corresponding to Figure 1 Voltage 2), prediction results under threshold (corresponding to Figure 1 Voltage 3) and full data prediction results (corresponding to Figure 1 voltage 1); increase the weight of data below the voltage threshold;
[0043] The construction of a feedforward neural network regression model requires data preprocessing, feature engineering, model selection, and parameter adjustment.
[0044] (1) Data preprocessing
[0045] The input data of the model include current, discharge time, and total discharge time. The total discharge time is taken from the output result of the total discharge time prediction model. This set of features will be used to train the model and fit the predicted voltage value.
[0046] like Figure 5 As shown in FIG. 1 , the voltage of the discharge curve is erratic at the beginning of discharge, which is not conducive to the curve fitting, and the range of this part of the data is not wide, which does not affect the overall application of the model, so the input data with unstable voltage is deleted. The input data is the data set in step S2, and the input data corresponds to the discharge time, current data and total discharge time.
[0047] (2) Feature Engineering
[0048] The data are all standard numerical data, and no extra data processing is required. However, the data features are relatively few, so feature cross-processing is required in advance to convert low-dimensional features into high-dimensional features to improve the accuracy of the model.
[0049] (3) Model selection
[0050] The feedforward neural network model was finally chosen. The main reasons are: a. Feedforward neural networks are more conducive to processing static data; b. Feedforward neural networks can automatically extract and select features; c. Feedforward neural networks can process more complex data.
[0051] The feedforward neural network is a classic and powerful machine learning model that imitates the process of mutual communication between human neurons. The model consists of an input layer, a hidden layer, and an output layer. The features enter the neural network from the input layer, undergo a series of transformations in the hidden layer, and are finally output from the output layer. Except for the input layer, the neurons in other layers are connected to all neurons in the previous layer. In the process of passing to the next layer, it is necessary to calculate the transfer weight and activation function conversion. The weight can be obtained using optimization algorithms such as batch gradient descent, stochastic gradient descent, and mini-batch gradient descent. The activation function can choose the Sigmoid function:
[0052]
[0053] Tanh function:
[0054]
[0055] ReLU function:
[0056]
[0057] The purpose of the activation function is to convert the original linear output results into nonlinear results, thereby increasing the application scope of the model. In actual applications, due to the different characteristics, data volume, and convergence speed of each set of data, you can flexibly select it according to your needs, or use the activation function as a hyperparameter to flexibly adjust it for the purpose of obtaining the best model effect.
[0058] The gradients related to the bias and weight are calculated through back propagation, and the weight values are adjusted according to the gradients. The bias is minimized in continuous iterations, and the final feedforward neural network model is obtained. The feedforward neural network model process is as follows Figure 4 shown.
[0059] (4) Parameter adjustment
[0060] The premise of adjusting parameters is to find appropriate evaluation indicators. The parameters that need to be adjusted include the number of hidden layers, the number of neurons, the activation function, and the learning rate. The optimal value of the evaluation indicator is the goal, and the best parameter combination is traversed. The model of this solution is a regression model, so the evaluation indicators can be selected from RMSE function and R 2 function;
[0061] RMSE function:
[0062]
[0063] When RMSE is smaller, it means the model fits better;
[0064] R 2 function:
[0065]
[0066] in, When R 2 The closer it is to 1, the better the model fit is.
[0067] S3, such as Figure 7 As shown, multiple voltage prediction data are input into the stacking model combination to obtain the final prediction result of the discharge voltage; the discharge curve of the battery is obtained according to the final prediction result of the discharge voltage and the discharge time, and the remaining discharge time is predicted according to the discharge curve. The analysis of the battery life according to the discharge curve in step S3 specifically includes the following steps:
[0068] S301, using the discharge curve of the known current to fill in the discharge curves under other currents;
[0069] S302, according to the known current battery voltage and discharge time, find the corresponding discharge curve; for example, use limited data to fill in the discharge curves under other currents, and expand the original 1A discharge curve into 0.1A, 0.01A or even 0.001A discharge curves;
[0070] S303 , obtaining a remaining discharge time by subtracting the discharged time from the maximum discharge time of the discharge curve corresponding to the current.
[0071] The stacking model uses a regression model, which can be flexibly selected according to actual needs, such as the xgboost regression model, linear regression model, logistic regression model, etc. To verify the model effect, the 20A prediction results are intercepted and drawn into a table, as shown in Figure 6 shown.
[0072] It can be seen that except for the large fluctuations in the initial data, which were not used for model training and resulted in large differences in the results, the data for the remaining time periods basically overlapped and could meet the requirements of model application.
[0073] This solution takes into account the battery aging, steep discharge curve at low voltage, and fluctuations in battery discharge data when calculating the remaining discharge time of the battery. However, it does not evaluate the degree of battery aging, but reversely deduce the battery discharge curve based on the actual performance of the battery. A more accurate discharge curve at different voltages is obtained. Through the discharge curve, the remaining discharge time can be calculated by subtracting the discharge time from the maximum discharge time corresponding to the current.
[0074] This solution predicts the total discharge time through separate model training, which does not rely on the training results of the final model. It only needs to simply calculate the remaining discharge time, and use the total discharge time to subtract the discharged time to get an accurate remaining discharge time. When training the neural network model, the total discharge time can be used as an important feature input to improve the accuracy of the feedforward neural network regression model and the regression model.
[0075] This solution separates the low voltage data with obvious differences to train the machine learning model, and uses the stacking model to fuse the results of multiple models to finally obtain results that are more in line with the actual situation.
[0076] This solution aims to address the fluctuations in battery discharge data, which may lead to model overfitting. It proposes to introduce a random sampling method to extract multiple training sets and train multiple models. Finally, multiple models are stacked together to average out the fluctuations in the data itself, avoiding the impact of the fluctuations in the data itself, so as to obtain results that are more in line with the actual situation.
[0077] The above is only an embodiment of the present invention. The common sense such as the known specific structure and characteristics in the scheme is not described in detail here. The ordinary technicians in the relevant field know all the common technical knowledge in the technical field of the invention before the application date or priority date, can obtain all the existing technologies in the field, and have the ability to apply the conventional experimental means before that date. The ordinary technicians in the relevant field can improve and implement this scheme in combination with their own abilities under the enlightenment given by this application. Some typical known structures or known methods should not become obstacles for ordinary technicians in the relevant field to implement this application. It should be pointed out that for those skilled in the art, without departing from the structure of the present invention, several deformations and improvements can be made, which should also be regarded as the protection scope of the present invention, which will not affect the effect of the implementation of the present invention and the practicality of the patent. The protection scope required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.
Claims
1. A battery life prediction method based on a segmentation model, characterized in that: The following steps are involved: S1. Obtaining discharge current data of a battery, inputting the current data into a total discharge duration prediction model, and outputting the total discharge duration of the battery; S2, obtaining the discharged time of the battery, and arranging the corresponding current data and the total discharge time into a data set; randomly extracting different data subsets from the data set, and constructing a stacking model, wherein the stacking model includes multiple prediction models; inputting the discharged time, current data and total discharge time of the battery to be tested into the corresponding prediction model to obtain multiple voltage prediction data corresponding to the discharge voltage; S3. Input multiple voltage prediction data into the stacking model combination to obtain the final prediction result of the discharge voltage; obtain the discharge curve of the battery according to the final prediction result of the discharge voltage and the discharge time, and predict the remaining discharge time according to the discharge curve.
2. The method for predicting battery life based on a segmented model according to claim 1, characterized in that: Analyzing the battery life according to the discharge curve in step S3 specifically includes the following steps: S301, using the discharge curve of the known current to fill in the discharge curves under other currents; S302, seeking a corresponding discharge curve according to the known current battery voltage and discharge time; S303 , obtaining a remaining discharge time by subtracting the discharged time from the maximum discharge time of the discharge curve corresponding to the current.
3. The method for predicting battery life based on a segmented model according to claim 2, characterized in that: In step S2, different data subsets are randomly extracted from the data set, and the data set is specifically divided into two data subsets according to the voltage threshold, namely the first data subset and the second data subset. The discharge voltage of the first data subset is greater than the voltage threshold, and the discharge voltage of the second data subset is less than the voltage threshold. Corresponding prediction models are trained according to the data set, the first data subset and the second data subset respectively; the voltage prediction data corresponding to the discharge voltages are respectively the above-threshold prediction results, the below-threshold prediction results and the full-data prediction results.
4. The method for predicting battery life based on a segmented model according to claim 3, characterized in that: In step S2, pre-processing is performed according to the discharge curve data to delete input data that causes voltage instability, wherein the input data corresponds to the discharge time, current data and total discharge time.
5. The method for predicting battery life based on a segmented model according to claim 4, characterized in that: In step S2, feature cross processing is performed on the features to convert low-dimensional features into high-dimensional features.
6. The method for predicting battery life based on a segmented model according to claim 1, characterized in that: The prediction model is any one of a linear regression model, a tree classification regression model, a logistic regression model and a feedforward neural network regression model.
7. The method for predicting battery life based on a segmented model according to claim 6, characterized in that: The prediction model is preferably a feedforward neural network regression model. The parameters that need to be adjusted include the number of hidden layers, the number of neurons, the activation function and the learning rate. The optimal parameter combination is traversed to find the optimal value of the evaluation index.
8. The method for predicting battery life based on a segmented model according to claim 1, characterized in that: The stacking model in step S3 is any one of an xgboost regression model, a linear regression model, and a logistic regression model.