Lithium battery charging duration prediction method, system and device and storage medium
By using the hybrid model of CNN-BiLSTM-XGBoost, feature extraction and timing analysis of lithium battery charging data is solved, and the problem of poor feature extraction of lithium battery charging time prediction data in the prior art is achieved, achieving higher prediction accuracy and robustness.
Patent Information
- Application Number
- CN202510002838.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-05-06
AI Technical Summary
In the prediction of charging time of lithium batteries, the data feature extraction effect is poor, resulting in a large deviation from the prediction results.
Using the mixed model of CNN-BiLSTM-XGBoost, feature extraction and dimensionality reduction are performed through CNN, BiLSTM captures timing dependencies, and XGBoost optimizes the loss function to form the final regression prediction model.
It improves the accuracy and robustness of lithium battery charging time prediction, improves prediction performance, and can more accurately predict the charging time, improves charging efficiency, reduces energy consumption, and extends battery life.
Smart Images

Figure CN119936665A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lithium battery charging time prediction, and in particular to a lithium battery charging time prediction method, system, device and storage medium. Background Art
[0002] As the new energy vehicle industry continues to advance, ultra-high-speed charging technology is increasingly becoming a key technology field. This technology can enhance the operating efficiency of new energy vehicles and speed up the charging process, thereby significantly optimizing the energy replenishment system and improving the overall charging efficiency. Lithium batteries have been the first choice for new energy vehicles in recent years due to their long life, no memory effect, and high energy density. In order to optimize the user's charging experience and improve the efficiency of vehicle use, it is particularly important to accurately predict the remaining charging time of lithium batteries.
[0003] At present, the research on lithium battery charging time prediction has become an important method to avoid the insecurity of lithium battery overcharging and ensure the stability of lithium batteries. With the development of artificial intelligence, machine learning algorithms have been widely used in various prediction methods. Compared with physical battery models, machine learning methods have lower computational costs, and data-driven machine learning models represent the latest development of prediction methods. The industry generally uses algorithms based on historical data and simple models to predict the charging time of lithium batteries for new energy vehicles. These methods usually combine real-time parameters provided by the battery management system, such as the remaining battery power, charging current, voltage, and temperature, and estimate the remaining charging time through linear or nonlinear regression analysis. However, the existing machine learning methods for predicting charging time are not effective in extracting data features, which leads to a large deviation between the prediction results and the actual situation. Summary of the invention
[0004] In order to overcome the defects of the above-mentioned prior art, the purpose of the present invention is to provide a lithium battery charging time prediction method, system, device and storage medium, using the local correlation and weight sharing characteristics of CNN to perform feature extraction and data dimensionality reduction on the fluctuating input such as charging time, and use BiLSTM to further explore the intrinsic connection between the data, and then introduce the adaptive enhancement algorithm XGBoost to improve the accuracy and robustness of the prediction, thereby improving the prediction performance.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is:
[0006] A method for predicting charging time of a lithium battery comprises the following steps:
[0007] S1: Collect lithium battery charging data and sort the charging data in chronological order;
[0008] S2: performing preprocessing operation on the lithium battery charging data;
[0009] S3: Divide the preprocessed charging data: select a part of the data as a training set and another part of the data as a test set;
[0010] S4: Perform Spearman correlation analysis on the charging data, select the appropriate number of features, and extract key features. The extracted features are the starting SOC (the proportion of remaining power of the lithium battery), the SOC variation range, and the charging time;
[0011] S5: Establish a CNN-BiLSTM-XGBoost prediction model for charging time;
[0012] S6. Importing the three types of feature data, namely, starting SOC, SOC variation range and charging time, into the charging time CNN-BiLSTM-XGBoost prediction model to verify the stability and prediction performance of the model;
[0013] S7. Use the constructed CNN-BiLSTM-XGBoost prediction model to predict the charging time of the lithium battery, input the charging data into the storage medium, and output the predicted data.
[0014] In S1, charging data of three vehicles (01, 02, and 03) are collected from the actual operating data of electric vehicles on the market. The charging data includes drive motor data, fuel cell data, engine data, vehicle position data, extreme value data, and alarm data.
[0015] In S2, data preprocessing is performed on the charging data, including removing duplicate data and processing missing values;
[0016] The steps to remove duplicate data are as follows:
[0017] If the mileage difference is 0, delete the data of this cycle; if the maximum mileage of this cycle and the next cycle is the same, delete it;
[0018] The steps for handling missing values are as follows:
[0019] When the missing ratio is less than 5%, linear interpolation is used to fill in the missing data; when the missing ratio exceeds 85%, the variable is deleted, and the linear interpolation calculation formula is formula (1):
[0020]
[0021] In the formula, the points (x0, y0) and (x1, y1) are the previous and next non-missing values closest to the current point (x, y), respectively. The calculated y value is filled into the corresponding position in the original data set to complete the missing value filling.
[0022] In S4, in order to verify the correlation between the selected features and the charging time, the most representative features were selected by eliminating redundant information. The Spearman correlation coefficient analysis method was used to analyze the correlation of the selected 13 features (starting SOC, SOC change range, average temperature, average power, maximum temperature, minimum temperature, average current, maximum power, mileage change, maximum current, maximum voltage, minimum voltage, temperature difference and charging time). The Spearman correlation coefficient calculation formula is as follows:
[0023]
[0024] In the formula, R(x i ) and R(y i ) are the positions of x and y respectively, and are the average ranks of x and y respectively, and n is the total number of observed samples.
[0025] S5;
[0026] Step 1: Use CNN to extract and reduce the three features (starting SOC, SOC variation range, and charging time) selected from the charging data of new energy vehicles, and output the processed features;
[0027] Step 2: Input the processed features into the BiLSTM layer, and combine the forward and backward LSTM units to enable the model to obtain more comprehensive time series information;
[0028] Step 3: Introduce XGBoost to repeatedly train the output of BiLSTM and optimize the loss function to improve the prediction performance and form the final regression prediction model CNN-BiLSTM-XGBoost.
[0029] It is a hybrid model that combines the advantages of convolutional neural network (CNN), bidirectional long short-term memory network (BiLSTM) and extreme gradient boosting tree (XGBoost), and is suitable for processing complex time series data and nonlinear relationships.
[0030] In the step 1, CNN is used to extract local features of the charging data (starting SOC, SOC variation range and charging time) using a convolutional layer (CL), which can effectively capture the nonlinear characteristics of the data;
[0031] CNN uses convolutional layers to extract features and reduce dimensionality of features selected from charging data;
[0032] (1) CNN feature extraction method:
[0033] This method introduces CNN to extract local features using convolutional layers (CL), which can effectively capture the nonlinear characteristics of data. Its local correlation and weight sharing characteristics enable it to extract and reduce the dimensions of the three features selected from the charging data (starting SOC, SOC variation range, and charging time), thereby reducing the number and complexity of the model's feature parameters. After feature extraction and dimensionality reduction, it can be directly connected to the BiLSTM network in series.
[0034] The BiLSTM layer in step 2 inputs the feature data processed by CNN into the BiLSTM layer. The output of the BiLSTM layer is a hidden state vector, which contains the dynamic change information of the time series. Formula (3) is the definition of the forward calculation process:
[0035]
[0036] In the formula, the signal input part is defined as X t , the output is Y t Calculate each X in the positive direction t The corresponding forget gate, input gate and output gate, H t-1 For short-term memory, and They are respectively the forget gate, input gate, output gate and the H in the feature extraction process. t-1 With X t The weight coefficient matrix, and They are the bias values in the forget gate, input gate, output gate and feature extraction process respectively;
[0037] Wherein formula (4) is the definition of the backward calculation process:
[0038]
[0039] In the formula, the signal input part is defined as X t , the output is Y t Calculate each X in the reverse direction t The corresponding forget gate, input gate and output gate, H t-1 For short-term memory, and They are respectively the forget gate, input gate, output gate and the H in the feature extraction process. t-1 With X t The weight coefficient matrix, and They are the bias values in the forget gate, input gate, output gate and feature extraction process respectively.
[0040] The step 3 is specifically as follows: the hidden state vector output by BiLSTM and the original charging feature data (starting SOC, SOC variation range and charging time) are input into the XGBoost model. The XGBoost model is responsible for the final regression prediction. The expression of the XGBoost model and the objective function L is:
[0041]
[0042] Where: and are the true value and predicted value of the nth data respectively; f e is the e-th decision tree function in the decision tree space F, corresponding to the structure of the e-th tree and the relevant situation of leaf weights; l() is the training error function; ω(f e ) is f e Regularization term that controls complexity.
[0043] In S6, the charging time prediction model is verified: the three features (starting SOC, SOC variation range and charging time) selected from the collected charging data of three energy vehicles are input into the CNN-BiLSTM-XGBoost prediction model to verify the robustness of the model; then the three vehicles are compared with the prediction indicators (proportional deviation, mean absolute percentage error and determination coefficient) of the CNN-BiLSTM-Adaboost, CNN-LSTM and BiLSTM models respectively to verify the accuracy of the model.
[0044] Evaluation indicators of the quality of the prediction results of the CNN-BiLSTM-XGBoost model:
[0045] To verify the effect of the CNN-BiLSTM-XGBoost model in predicting the charging time of lithium-ion batteries, the following three statistics are used for evaluation:
[0046] The proportional deviation (RPD), mean absolute percentage error (MAPE) and coefficient of determination (R 2 );
[0047] RPD: is an indicator used to evaluate the predictive performance of regression models, especially common in chemometrics and other fields that require quality assessment. RPD judges the prediction effect of the model by comparing the standard deviation of the data with the model prediction error.
[0048] RPD>2: The model has good prediction ability and is suitable for rough prediction tasks;
[0049] RPD>3: The model has excellent prediction performance and is suitable for accurate prediction;
[0050] RPD<1.5: The model has poor prediction ability, which means that the model does not capture the data characteristics well;
[0051] The calculation formula is:
[0052]
[0053] In the formula, SD V is the difference between the actual value and the target value of the lithium battery charging time, and RMSEP is the target value of the lithium battery charging time;
[0054] MAPE: It is a commonly used indicator to measure the prediction accuracy of regression models, especially for time series prediction models. MAPE reflects the accuracy of prediction by calculating the relative error between the predicted value and the true value, and its value is expressed as a percentage. The closer MAPE is to 0, the better the performance of the model. Its calculation formula is as follows:
[0055]
[0056] Where n samples The number of charging data for each new energy vehicle, y i is the actual value of the charging data, y i is the i-th predicted value of the charging data.
[0057] R 2 : It is an indicator used to evaluate the goodness of fit of the model in regression analysis. 2 The values range from 0 to 1 and indicate how well the model explains the data:
[0058] R 2 =1: The model can perfectly explain the changes in the data, indicating that the predicted value is completely consistent with the actual value.
[0059] R 2 =0: The model cannot explain the changes in the data, which means that the predicted value is the same as the mean of the data and has no predictive ability at all.
[0060] 0 <R 2 <1: The model can partially explain the variation of the data, R 2 The closer it is to 1, the better the model fit is.
[0061] The calculation formula is as follows:
[0062]
[0063] Where n is the number of charging data for each new energy vehicle, MSE is the mean square error of the prediction result, and y i is the ith actual value of the charging data, is the i-th predicted value of charging data, is the average of the actual values of the charging data.
[0064] A lithium battery charging time prediction system, the prediction system comprising a data processing module, a model training module and a model testing module;
[0065] The data processing module is used to clean, convert and extract features from the original data to provide high-quality data for subsequent model training and testing;
[0066] The model training module is used to construct and train a prediction model based on the processed data; the model testing module is used to evaluate the generalization performance and prediction accuracy of the model.
[0067] A lithium battery charging time prediction device, comprising:
[0068] Memory: used to store a computer program for realizing the prediction of charging time of a lithium battery;
[0069] Processor: used to implement the method for predicting the charging time of a lithium battery when executing the computer program.
[0070] A computer-readable storage medium comprising:
[0071] The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, a method for predicting the charging time of a lithium battery can be implemented.
[0072] Beneficial effects of the present invention:
[0073] 1. The present invention uses a lithium battery charging time prediction model using CNN-BiLSTM and XGBoost. On the basis of preprocessing the lithium battery charging time data with Spearman correlation coefficient analysis, CNN is used to extract features and reduce the dimension of the initial SOC volatility input of new energy vehicles; these features are input into the BiLSTM layer to capture timing dependencies. Combining forward and backward LSTM units, the model obtains more comprehensive timing information. XGBoost is introduced to repeatedly train the output of BiLSTM and optimize the loss function to improve the prediction performance, forming the final regression prediction model to predict the charging time of lithium batteries, which has the advantages of improving charging efficiency, reducing energy consumption, extending battery life, and bringing significant cost savings to enterprises and individual users.
[0074] 2. The lithium battery charging time prediction method of the present invention can establish a prediction model by analyzing the lithium battery charging time data set, thereby making the detection more accurate, fast, simple, and efficient, requiring fewer samples and being less susceptible to environmental factors. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 It is an operation flow chart of the present invention.
[0076] Figure 2 This figure illustrates data preprocessing.
[0077] Figure 3 This is the Spearman correlation heat map.
[0078] Figure 4 This is the schematic diagram of the CNN-BiLSTM-XGBoost hybrid model.
[0079] Figure 5 This is a schematic diagram of the structure of an electronic device used in the present invention. DETAILED DESCRIPTION
[0080] The present invention will be further described in detail below in conjunction with the accompanying drawings.
[0081] Example 1
[0082] like Figure 1 As shown, a method for predicting the charging time of a lithium battery comprises the following steps:
[0083] S1. Collect lithium battery charging data: The data is sorted in chronological order, and the charging data of three vehicles (01, 02, 03) are collected, including drive motor data, fuel cell data, engine data, vehicle position data, extreme value data and alarm data. Table 1 is a description of the data fields in the data set.
[0084] Table 1 Data Field Description
[0085]
[0086]
[0087] S2. Lithium battery charging data preprocessing: Data preprocessing is performed on the original data, including removing duplicate data and missing value processing. The steps for removing duplicate data are as follows: if the mileage difference is 0, delete the data of this cycle; if the maximum mileage of this cycle is the same as that of the next cycle, delete it. The steps for processing missing values are as follows: when the missing ratio is less than 5%, use linear interpolation to fill it; when the missing ratio exceeds 85%, delete the variable. Data preprocessing instructions are as follows Figure 2 shown.
[0088] S3. Extract and divide charging data: After extracting charging cycle fragments from the preprocessed data, the processed data of car 01, car 02 and car 03 in 2023 are 92, 88 and 68 respectively, and the processed data of car 01, car 02 and car 03 in 2024 are 95, 66 and 28 respectively. The data of 2023 are selected as the training set, and the data of 2024 are selected as the test set.
[0089] S4. Key feature extraction: In order to verify the correlation between the selected features and the charging time, the most representative features were selected by eliminating redundant information, and the Spearman correlation coefficient analysis method was used to perform correlation analysis on the selected 13 features. The Spearman correlation coefficient calculation formula is formula (1):
[0090]
[0091] In the formula, R(x i ) and R(y i ) are the positions of x and y respectively, and are the average ranks of x and y respectively, and n is the total number of observed samples. Figure 3 This is a correlation analysis chart of the filtered features and charging time.
[0092] S5. Establish a charging time prediction model: Use CNN to extract features and reduce the dimensionality of the starting SOC volatility input of new energy vehicles; then, input these features into the BiLSTM layer to capture timing dependencies. Combining forward and backward LSTM units, the model obtains more comprehensive timing information. Finally, XGBoost is introduced to repeatedly train the output of BiLSTM and optimize the loss function to improve the prediction performance, forming the final regression prediction model CNN-BiLSTM-XGBoost. The input of the input layer consists of three features: starting SOC (State of Charge), SOC variation range, and charging time. The input features are extracted and processed by the neural network to achieve the prediction of charging time.
[0093] CNN:
[0094] (1) Convolutional layer:
[0095] Extract local correlations in input features and extract patterns or trends through filters. The activation function uses tanh, which has the advantage of being able to handle negative values and provide nonlinear transformations.
[0096] (2) Pooling layer:
[0097] Max Pooling is used to reduce the size of feature maps, retain important features, and reduce computational complexity. After convolution and pooling operations, features are compressed and efficient representations are extracted.
[0098] (3) Dropout layer:
[0099] Dropout is a regularization technique used to prevent overfitting. It randomly discards the output of some neurons to ensure the robustness of the model.
[0100] BiLSTM:
[0101] It consists of forward and backward LSTM units, which capture the past and future information of time series features respectively. The forward LSTM extracts features from the head to the tail of the time series, and the backward LSTM extracts features from the tail to the head.
[0102] This design can more comprehensively capture the dynamic characteristics of time series data. The output feature representation integrates bidirectional time series information and has higher predictive ability.
[0103] XGBoost (fully connected layer):
[0104] Receive the output features of the BiLSTM layer and further learn the deep nonlinear relationship of the features. Use XGBoost to process the high-dimensional features output by the fully connected layer. XGBoost is an efficient machine learning algorithm based on gradient boosting decision trees. It can handle the nonlinear relationship of features well and improve the prediction accuracy. The final output is the predicted lithium battery charging time.
[0105] Through the model's multi-stage feature extraction and fusion process, the ability to model complex relationships is improved, thereby achieving high-precision charging time prediction.
[0106] Figure 4 This is the schematic diagram of the CNN-BiLSTM-XGBoost hybrid model.
[0107] Table 2 is the prediction flow chart of the CNN-BiLSTM-XGBoost model.
[0108] Table 2 Prediction flow chart of CNN-BiLSTM-XGBoost model
[0109]
[0110] (1) CNN feature extraction method:
[0111] This method introduces CNN to extract local features using convolutional layers (CL), which can effectively capture the nonlinear characteristics of data. Its local correlation and weight sharing characteristics enable it to extract features and reduce data dimension for the fluctuating input of charging time, thereby reducing the number and complexity of the model's feature parameters. After the time series data feature information is extracted and transformed through dimensionality reduction, it can be directly connected in series to the BiLSTM network.
[0112] (2) BiLSTM captures temporal dependency method:
[0113] This method introduces BiLSTM to perform forward and backward propagation of time series information to further explore the intrinsic connection between data, combining a single forward LSTM model and a single backward LSTM model. BiLSTM calculation includes forward and backward processes. The forward calculation method is similar to that of a single LSTM model. BiLSTM analyzes the "past to future" and "future to past" directions of data flow, which can better explore the time characteristics in the data, improve data utilization efficiency and model prediction accuracy. Formula (2) defines the forward calculation process:
[0114]
[0115] In the formula, the signal input part is defined as X t , the output is Y t Calculate each X in the positive direction t The corresponding forget gate, input gate and output gate, H t-1 For short-term memory, and They are respectively the forget gate, input gate, output gate and the H in the feature extraction process. t-1 With X t The weight coefficient matrix, and They are the bias values in the forget gate, input gate, output gate and feature extraction process respectively.
[0116] Formula (3) is the definition of the backward calculation process:
[0117]
[0118] In the formula, the signal input part is defined as X t , the output is Y t Calculate each X in the reverse direction t The corresponding forget gate, input gate and output gate, H t-1 For short-term memory, and They are respectively the forget gate, input gate, output gate and the H in the feature extraction process. t-1 With X t The weight coefficient matrix, and They are the bias values in the forget gate, input gate, output gate and feature extraction process respectively.
[0119] (3) Gradient boosting decision tree algorithm method
[0120] This method introduces the XGBoost boosting algorithm to improve the accuracy of classification or regression models. XGBoost is one of the Boosting algorithms. The idea of the Boosting algorithm is to integrate many weak classifiers together to form a strong classifier. And there is a sequence between these decision trees that make up XGBoost: the generation of the latter decision tree will take into account the prediction results of the previous decision tree, that is, the deviation of the previous decision tree is taken into account, so that the training samples that the previous decision tree made mistakes will receive more attention in the future, and then the next decision tree will be trained based on the adjusted sample distribution. The expression of the XGBoost model and the objective function L is:
[0121]
[0122] Where: and are the true value and predicted value of the nth data respectively; f e is the e-th decision tree function in the decision tree space F, corresponding to the structure of the e-th tree and the relevant situation of leaf weights; l() is the training error function; ω(f e ) is f e Regularization term that controls complexity.
[0123] S6. Verification of charging time prediction model: Import data into the established prediction model to verify the stability and prediction performance of the model.
[0124] Evaluation indicators of the quality of CNN-BiLSTM-XGBoost model prediction results:
[0125] To verify the effect of the CNN-BiLSTM-XGBoost model in predicting the charging time of lithium-ion batteries, the following three statistics are used for evaluation: proportional deviation (RPD), mean absolute percentage error (MAPE) and coefficient of determination (R 2 ).
[0126] RPD: is an indicator used to evaluate the predictive performance of regression models, especially common in chemometrics and other fields that require quality assessment. RPD judges the prediction effect of the model by comparing the standard deviation of the data with the model prediction error.
[0127] RPD>2: The model has good prediction ability and is suitable for rough prediction tasks.
[0128] RPD>3: The model has excellent prediction performance and is suitable for accurate prediction.
[0129] RPD<1.5: The model has poor predictive ability, which means that the model does not capture the data characteristics well.
[0130] The calculation formula is:
[0131]
[0132] In the formula, SD V is the difference between the actual value and the target value, and RMSEP is the target value.
[0133] MAPE: It is a commonly used indicator to measure the prediction accuracy of regression models, especially for time series prediction models. MAPE reflects the accuracy of prediction by calculating the relative error between the predicted value and the true value, and its value is expressed as a percentage. The closer MAPE is to 0, the better the performance of the model. Its calculation formula is as follows:
[0134]
[0135] Where n samples is the number of samples, y i is the ith actual value, y i is the i-th predicted value.
[0136] R 2 : It is an indicator used to evaluate the goodness of fit of the model in regression analysis. 2 The values range from 0 to 1 and indicate how well the model explains the data:
[0137] R 2 =1: The model can perfectly explain the changes in the data, indicating that the predicted value is completely consistent with the actual value.
[0138] R 2 =0: The model cannot explain the changes in the data, which means that the predicted value is the same as the mean of the data and has no predictive ability at all.
[0139] 0 <R 2 <1: The model can partially explain the variation of the data, R 2 The closer it is to 1, the better the model fit is.
[0140] The calculation formula is as follows:
[0141]
[0142] In the formula, n represents the number of sample sets, MSE is the mean square error, and y i is the ith actual value, is the i-th predicted value, The mean of the actual values.
[0143] The preprocessed lithium battery charging time data set is imported into the established prediction model to verify the stability and prediction performance of the model.
[0144] Figure 5The comparison of the prediction accuracy of lithium battery charging time using CNN-BiLSTM-XGBoost, CNN-LSTM and BiLSTM models for the data of car 01, car 02 and car 03 is shown in Table 3. The proportional deviation RPD, mean absolute percentage error MAPE and determination coefficient R of the prediction results of the prediction model for car 01, car 02 and car 03 are shown in Table 3. 2 The larger the proportional deviation RPD is than 2, the closer the mean absolute percentage error MAPE is to 0, and the coefficient of determination R 2 The closer it is to 1, the better the model fits the observed data. The results show that it is effective to use the CNN-BiLSTM-XGBoost model to establish a model for predicting the charging time of lithium batteries.
[0145] Table 3 Proportional deviation RPD, mean absolute percentage error MAPE and determination coefficient R of predicted data 2 value
[0146]
[0147] S7. Predicting the charging time of a lithium battery using the constructed CNN-BiLSTM-XGBoost model: inputting charging data into a storage medium, and outputting predicted data: comprising a memory, a processor, and a computer program stored in the memory and executable in the processor, wherein when the processor executes the computer program, the steps of the method for predicting the remaining life of a lithium-ion battery are implemented, and when the computer program is executed by the processor, the steps of the method for predicting the remaining life of a lithium-ion battery are implemented.
[0148] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in a computer storage medium to implement a corresponding method flow or corresponding function; the processor described in an embodiment of the present invention can be used for the operation of a method for predicting the remaining life of a lithium-ion battery.
[0149] The present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in a computer device and, of course, an extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of a lithium-ion battery remaining life prediction method provided in the above embodiment.
[0150] The above embodiments are only for illustrating the technical idea of the present invention, and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for predicting charging time of a lithium battery, characterized in that: The steps include: S1: Collect lithium battery charging data and sort the charging data in chronological order; S2: performing preprocessing operation on the lithium battery charging data; S3: Divide the preprocessed charging data: select a part of the data as a training set and another part of the data as a test set; S4: Perform Spearman correlation analysis on the charging data, select the appropriate number of features, and extract key features. The extracted features are starting SOC, SOC variation range, and charging time; S5: Establish a CNN-BiLSTM-XGBoost prediction model for charging time; S6. Importing the three types of feature data, namely, starting SOC, SOC variation range and charging time, into the charging time CNN-BiLSTM-XGBoost prediction model to verify the stability and prediction performance of the model; S7. Use the constructed CNN-BiLSTM-XGBoost prediction model to predict the charging time of the lithium battery, input the charging data into the storage medium, and output the predicted data.
2. A lithium battery charging time prediction method according to claim 1, characterized in that: In S1, the charging data of the vehicle is collected from the actual operation data of electric vehicles on the market. The charging data includes drive motor data, fuel cell data, engine data, vehicle position data, extreme value data and alarm data.
3. A lithium battery charging time prediction method according to claim 1, characterized in that: In S2, data preprocessing is performed on the charging data, including removing duplicate data and processing missing values; The steps to remove duplicate data are as follows: If the mileage difference is 0, delete the data of this cycle; if the maximum mileage of this cycle and the next cycle is the same, delete it; The steps for handling missing values are as follows: When the missing ratio is less than 5%, linear interpolation is used to fill in the missing data; when the missing ratio exceeds 85%, the variable is deleted, and the linear interpolation calculation formula is formula (1): In the formula, the points (x0, y0) and (x1, y1) are the previous and next non-missing values closest to the current point (x, y), respectively. The calculated y value is filled into the corresponding position in the original data set to complete the missing value filling.
4. A lithium battery charging time prediction method according to claim 1, characterized in that: In S4, the Spearman correlation coefficient analysis method is used to perform correlation analysis on the features. The Spearman correlation coefficient calculation formula is formula (2): In the formula, R(x i ) and R(y i ) are the ranks of x and y, R(x) and R(y) are the average ranks of x and y, and n is the total number of observed samples.
5. A lithium battery charging time prediction method according to claim 1, characterized in that: S5; Step 1: Use CNN to extract and reduce the features selected from the charging data of new energy vehicles, and output the processed features; Step 2: Input the processed features into the BiLSTM layer, and combine the forward and backward LSTM units to enable the model to obtain more comprehensive time series information; Step 3: Introduce XGBoost to repeatedly train the output of BiLSTM and optimize the loss function to improve the prediction performance, thus forming the final regression prediction model CNN-BiLSTM-XGBoost; In the step 1, CNN is used to extract local features of the charging data using a convolutional layer to capture the nonlinear characteristics of the data; CNN uses convolutional layers to extract features and reduce dimensionality of features selected from charging data; The BiLSTM layer in step 2 inputs the feature data processed by CNN into the BiLSTM layer. The output of the BiLSTM layer is a hidden state vector, which contains the dynamic change information of the time series. Formula (3) is the definition of the forward calculation process: In the formula, the signal input part is defined as X t , the output is Y t Calculate each X in the positive direction t The corresponding forget gate, input gate and output gate, H t-1 For short-term memory, and They are respectively the forget gate, input gate, output gate and the H in the feature extraction process. t-1 With X t The weight coefficient matrix, and They are the bias values in the forget gate, input gate, output gate and feature extraction process respectively; Wherein formula (4) is the definition of the backward calculation process: In the formula, the signal input part is defined as X t , the output is Y t Calculate each X in the reverse direction t The corresponding forget gate, input gate and output gate, H t-1 For short-term memory, and They are respectively the forget gate, input gate, output gate and the H in the feature extraction process. t-1 With X t The weight coefficient matrix, and They are the bias values in the forget gate, input gate, output gate and feature extraction process respectively; The step 3 is specifically as follows: the hidden state vector output by BiLSTM is input into the XGBoost model together with the original charging feature data. The XGBoost model is responsible for the final regression prediction. The expression of the XGBoost model and the objective function L is: Where: and are the true value and predicted value of the nth data respectively; f e is the e-th decision tree function in the decision tree space F, corresponding to the structure of the e-th tree and the relevant situation of leaf weights; l() is the training error function; ω(f e ) is f e Regularization term that controls complexity.
6. A lithium battery charging time prediction method according to claim 1, characterized in that: In S6, the charging time prediction model is verified: the feature data selected from the collected charging data of energy vehicles is input into the CNN-BiLSTM-XGBoost prediction model to verify the robustness of the model; then the vehicle is compared with the prediction indicators of the CNN-BiLSTM-Adaboost, CNN-LSTM and BiLSTM models respectively to verify the accuracy of the model.
7. A lithium battery charging time prediction method according to claim 6, characterized in that: Evaluation indicators of the quality of the prediction results of the CNN-BiLSTM-XGBoost model: The following three statistics are used for evaluation: The proportional deviation (RPD), mean absolute percentage error (MAPE) and coefficient of determination (R 2 ); RPD: It is an indicator used to evaluate the prediction performance of the regression model. It judges the prediction effect of the model by comparing the standard deviation of the data with the model prediction error. RPD>2: The model has good prediction ability and is suitable for rough prediction tasks; RPD>3: The model has excellent prediction performance and is suitable for accurate prediction; RPD<1.5: The model has poor prediction ability, which means that the model does not capture the data characteristics well; The calculation formula is: In the formula, SD V is the difference between the actual value and the target value of the lithium battery charging time, and RMSEP is the target value of the lithium battery charging time; MAPE: It reflects the accuracy of the prediction by calculating the relative error between the predicted value and the true value. Its value is expressed as a percentage. The closer the MAPE is to 0, the better the performance of the model. Its calculation formula is as follows: Where n samples The number of charging data for each new energy vehicle, y i is the actual value of the charging data, y i is the i-th predicted value of charging data; R 2 : It is an indicator used to evaluate the goodness of fit of the model in regression analysis. 2 The values range from 0 to 1 and indicate how well the model explains the data: R 2 =1: The model can perfectly explain the changes in the data, indicating that the predicted value is completely consistent with the actual value; R 2 =0: The model cannot explain the changes in the data, indicating that the predicted value is the same as the mean of the data and has no predictive ability at all; 0 <R 2 <1: The model can partially explain the variation of the data, R 2 The closer it is to 1, the better the model fit is; The calculation formula is as follows: Where n is the number of charging data for each new energy vehicle, MSE is the mean square error of the prediction result, and y i is the ith actual value of the charging data, is the i-th predicted value of charging data, is the average of the actual values of the charging data.
8. A lithium battery charging time prediction system based on the method according to any one of claims 1 to 7, characterized in that: The prediction system includes a data processing module, a model training module and a model testing module; The data processing module is used to clean, convert and extract features from the original data to provide high-quality data for subsequent model training and testing; The model training module is used to build and train a prediction model based on the processed data; The model testing module is used to evaluate the generalization performance and prediction accuracy of the model.
9. A lithium battery charging time prediction device, characterized in that: include: Memory: used to store a computer program for realizing the prediction of charging time of a lithium battery; Processor: used to implement the lithium battery charging time prediction method described in any one of claims 1-8 when executing the computer program.
10. A computer-readable storage medium, characterized in that: include: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it can implement a lithium battery charging time prediction method as described in any one of claims 1-8.
Citation Information
Cited By
Thermal runaway risk assessment method and device and storage medium
CN120405484A
Efficient lithium battery life prediction method and system based on machine learning
CN121186621A