A battery life prediction method, apparatus, device and medium based on TDA
By combining topological data analysis and random forest models, physical and TDA features are extracted from battery cycling data, and hyperparameters are optimized, solving the accuracy and cost problems of traditional battery life prediction and achieving efficient and accurate battery life prediction.
Patent Information
- Application Number
- CN202411619615.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-11-13
AI Technical Summary
Traditional battery life prediction methods struggle to accurately describe the degradation process of batteries under different usage conditions, have high computational costs, and are difficult to apply in real time to battery management systems.
By combining Topological Data Analysis (TDA) and a Random Forest model, a feature matrix is formed by extracting physical features and TDA features from battery cycling data. Hyperparameters are optimized using 5-fold cross-validation, and a random forest model is trained to predict battery life.
It improves the accuracy and robustness of battery remaining life prediction, reduces computational costs, and is suitable for quickly assessing battery health status, extending battery life and reducing maintenance costs.
Smart Images

Figure CN119619848B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of battery management, and in particular to a battery life prediction method and device based on TDA, equipment and medium. BACKGROUND
[0002] With the rapid development of electric vehicles and consumer electronics, lithium-ion batteries as the main energy storage device have been widely used in various fields. However, the cycle life of the battery limits the durability and stability of the battery in practical applications. Traditional battery life prediction methods usually rely on complex physical models, which not only are difficult to accurately describe the degradation process of the battery under different use conditions, but also have high computational cost and are difficult to be applied in real-time in actual battery management systems.
[0003] In recent years, data-driven machine learning methods have shown great potential in battery life prediction. These methods can analyze historical battery data to extract key features and establish high-precision prediction models. Topological Data Analysis (TDA) as an effective geometric and topological tool can extract persistent homology features from the cycle data of the battery and identify hidden trends in the battery degradation process. Combined with traditional physical features, these topological features can provide more comprehensive information for accurate battery life prediction. Random forest model as an integrated learning algorithm can handle high-dimensional data and is suitable for capturing complex feature relationships.
[0004] Therefore, a battery life prediction method, device, equipment and medium based on TDA are proposed to solve the technical problems of diversity and redundancy between features in predicting battery life in the prior art. SUMMARY
[0005] To overcome the problems in the related art, the present disclosure provides a battery life prediction method, device, equipment and medium based on TDA to solve the technical problems of diversity and redundancy between features in predicting battery life in the related art.
[0006] One or more embodiments of the present specification provide a battery life prediction method based on TDA, comprising the following steps:
[0007] Obtain the cycle data of the battery and preprocess it;
[0008] Extract physical features and TDA features from the cycle data of the battery to form a feature matrix as an input data set;
[0009] Train a random forest model through the input data set, optimize the hyperparameters through 5-fold cross-validation, and obtain a trained random forest model;
[0010] Based on the trained random forest model, the remaining cycle life of the battery is predicted, and the predicted life value of the battery is output.
[0011] Preferably, the TDA features in the cycle data of the battery are extracted, specifically including the following steps:
[0012] The average discharge capacity, average internal resistance and average charging time of each cycle in the cycle data of the battery are extracted, and point cloud data is constructed;
[0013] The point cloud data is subjected to persistent homology analysis to calculate the TDA features.
[0014] Preferably, the hyperparameters are optimized by 5-fold cross-validation, specifically including the following steps:
[0015] The input data set is divided into 5 folds, and each fold is used as a validation set in turn, and the rest is used as a training set;
[0016] The hyperparameters of the random forest model are set, including the number of trees, the minimum leaf node number and the maximum tree depth;
[0017] For each set of hyperparameter combinations, the training set is used to train the model and the validation set is used to predict the model in the 5 folds, and the root mean square error is calculated;
[0018] The root mean square errors of all hyperparameter combinations are obtained, and the hyperparameter combination with the lowest root mean square error is used as the best model configuration.
[0019] Preferably, the following steps are further included:
[0020] The random forest model is trained on the input data set using the best hyperparameter configuration;
[0021] The trained random forest model is used to predict the test set, and the root mean square error and the relative error between the predicted life value and the actual life value are calculated to evaluate the prediction performance of the model.
[0022] Preferably, the following steps are further included:
[0023] The predicted life value and the actual life value of the model are compared by visualizing the chart.
[0024] One or more embodiments of the present specification provide a TDA-based battery life prediction device, comprising a preprocessing module, a feature matrix module, a model training module and a prediction module;
[0025] The preprocessing module is used to obtain and preprocess the cycle data of the battery;
[0026] The feature matrix module is configured to extract physical features and TDA features in the cycle data of the battery to form a feature matrix as an input data set.
[0027] The model training module is configured to train a random forest model by using the input data set, optimize hyperparameters by 5-fold cross-validation, and obtain a trained random forest model.
[0028] The prediction module is configured to predict the remaining cycle life of the battery based on the trained random forest model, and output a predicted life value of the battery.
[0029] Preferably, the feature matrix module is specifically configured to extract the average discharge capacity, the average internal resistance, and the average charging time of each cycle in the cycle data of the battery, and construct point cloud data.
[0030] The point cloud data is subjected to persistent homology graph analysis to calculate TDA features.
[0031] Preferably, the model training module is specifically configured to divide the input data set into 5 folds, and each fold is used as a validation set in turn, and the remaining folds are used as training sets.
[0032] The hyperparameters of the random forest model are set, including the number of trees, the minimum leaf node number, and the maximum tree depth.
[0033] For each set of hyperparameter combinations, the training set is used to train the model and the validation set is used to predict the model in the 5 folds, and the root mean square error is calculated.
[0034] The root mean square errors of all hyperparameter combinations are obtained, and the hyperparameter combination with the lowest root mean square error is used as the best model configuration.
[0035] One or more embodiments of the present specification provide a computer device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the TDA-based battery life prediction method as described above when executing the computer program.
[0036] One or more embodiments of the present specification provide a computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the TDA-based battery life prediction method as described above.
[0037] The battery life prediction method, device, equipment and medium based on TDA provided by the present disclosure have the advantages that the cycle data of the battery are acquired and preprocessed, the data sets can be combined to form a complete data set, the physical features and TDA features in the cycle data of the battery are extracted to form a feature matrix as an input data set, so as to ensure that the model can make full use of the early cycle data of the battery, the random forest model is trained by using the input data set, the hyperparameters are optimized by 5-fold cross-validation, and a trained random forest model is obtained, so as to effectively improve the accuracy and robustness of the prediction of the remaining life of the battery, the remaining cycle life of the battery is predicted based on the trained random forest model, and the predicted life value of the battery is output, the method has a low calculation cost, is suitable for quickly evaluating the state of health of the battery, can provide an accurate prediction basis for the battery management system, prolongs the service life of the battery, and reduces the maintenance cost. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the one or more embodiments of the present specification or the prior art, the drawings needed to be used in the embodiment or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments described in the present specification, and other drawings can also be obtained by those skilled in the art without creative labor.
[0039] Figure 1 A flowchart of a battery life prediction method based on TDA provided by one or more embodiments of the present specification;
[0040] Figure 2 A persistent homology graph generated by some battery point cloud data provided by one or more embodiments of the present specification;
[0041] Figure 3 A persistent image generated by PD based on Figure 2 provided by one or more embodiments of the present specification;
[0042] Figure 4 A complete flowchart of a battery life prediction method provided by one or more embodiments of the present specification;
[0043] Figure 5 A trend graph of the out-of-bag mean squared error of the final random forest model provided by one or more embodiments of the present specification with the increase of the number of trees;
[0044] Figure 6 A comparison graph between the battery cycle life prediction result and the actual cycle life provided by one or more embodiments of the present specification;
[0045] Figure 7A structural schematic diagram of a TDA-based battery life prediction device provided for one or more embodiments of the present specification is shown in the following figure:
[0046] Figure 8 A structural schematic diagram of a computer device provided for one or more embodiments of the present specification is shown in the following figure. DETAILED DESCRIPTION
[0047] In order to enable those skilled in the art to better understand the technical solutions in the one or more embodiments of the present specification, the technical solutions in the one or more embodiments of the present specification will be described clearly and completely in conjunction with the accompanying drawings of the one or more embodiments of the present specification. Obviously, the described embodiments are only a part of the embodiments of the present specification, rather than all the embodiments. Based on the one or more embodiments of the present specification, all other embodiments obtained by those skilled in the art without creative labor should belong to the protection scope of the present invention.
[0048] The present invention will be described in detail below in conjunction with the specific embodiments and the accompanying drawings.
[0049] Method embodiment
[0050] According to the embodiments of the present application, a TDA-based battery life prediction method is provided, as shown in the following figure: Figure 1 A flowchart of the TDA-based battery life prediction method provided for the present embodiment is shown in the following figure. According to the TDA-based battery life prediction method of the embodiments of the present application, the following steps are included:
[0051] S110, load the data set of the cycle data of the battery, including the training set (train Data), the validation set (valData) and the test set (test Data), and perform preprocessing, and combine the three data sets after preprocessing into one complete data set (all Data). The data set contains cycle data of multiple batteries, and the data of each battery includes key parameters such as discharge capacity, internal resistance, charging time, etc. In order to ensure that the model can fully utilize the early cycle data of the battery, only the data of the first 100 cycles of each battery is extracted.
[0052] In the data processing process, the load function of MATLAB is used to import the data set, and the data of each battery is saved in a structure array. The data structure of each battery includes summary information (such as discharge capacity, internal resistance) of each cycle and detailed voltage and time data measured during the cycle process. The specific steps are as follows:
[0053] Load data: use load('battery Discharge Data.mat') to import the MAT file containing training, validation and test data.
[0054] Merge datasets: Merge the training set, validation set, and test set one by one into a unified structure array allData to ensure that all battery data is centralized together for easier subsequent processing.
[0055] Initialize the feature matrix: Determine the number of batteries (num Batteries) and the number of cycles (numCyclesToUse) (set to 100). Initialize the matrix basic Features (size numBatteries x 10) for storing physical features and the matrix tda Features (size num Batteries x 3) for storing TDA features.
[0056] S120. Extract the physical features and TDA features from the battery's cyclic data to form a feature matrix as the input dataset.
[0057] The extraction of physical features is performed from the battery's cycling data, primarily selecting features related to battery health. Ten physical features are extracted from the cycling data of each battery. For each battery, the following features are extracted from the first 100 cycles:
[0058] (1) Discharge capacity in the second cycle: represents the early battery performance.
[0059] (2) Average internal resistance and standard deviation of internal resistance: reflect the stability of the battery's internal resistance.
[0060] (3) Standard deviation and maximum and minimum values of capacity: measure the range of fluctuation of discharge capacity.
[0061] (4) Capacity difference: the difference in discharge capacity between the 100th cycle and the 2nd cycle, reflecting the capacity decay trend.
[0062] (5) The average charging time of the first 100 cycles: reflects the change in charging efficiency.
[0063] The aforementioned features comprehensively reflect the battery's health status and degradation trend during early cycles, providing crucial information for predicting remaining lifespan. The physical feature extraction process is implemented in the `extract_physical_features` function and applied to data from all batteries.
[0064] Extracting TDA features:
[0065] To further improve the accuracy of battery life prediction, TDA (Temporal Data Acquisition) technology was introduced. TDA can capture subtle changes during battery aging by analyzing the geometric structure of battery cycling data. TDA features are mainly based on persistent coherent H1 features, which are calculated by constructing a point cloud composed of feature means.
[0066] The specific steps include:
[0067] 1. Constructing point cloud data: Based on the data of the first 100 cycles of each battery, the average discharge capacity, average internal resistance, and average charging time of each cycle are extracted to form three-dimensional point cloud data. These averages represent the key performance indicators of the battery at each cycle and can reflect the overall health of the battery.
[0068] 2. Persistent homology calculation: Use the ripser library in Python to perform persistent homology analysis on the constructed point cloud data and calculate topological features.
[0069] Specifically, the H1 homology graph is calculated, and the following features are extracted:
[0070] Total persistence of H1 homology: The sum of the persistence of all H1 homology features, reflecting the overall stability of the topological structure.
[0071] Maximum persistence of H1 homology: The value of the largest persistence in H1 homology features, representing the most significant topological feature.
[0072] Number of H1 homology features: The number of topological features in the H1 homology graph, reflecting the complexity.
[0073] Feature integration: Combine the extracted H1 persistent homology features with physical features to form a complete feature matrix, providing comprehensive input data for subsequent model training.
[0074] The TDA feature extraction process is implemented in the extract_TDA_features_new function, and the Python libraries ripser and persim are used to calculate persistent homology.
[0075] As shown in Figure 2 , the Persistence Diagram (PD) generated from the point cloud data of a certain battery provided in this embodiment is shown. The vertical axis represents the Death time of the feature, and the horizontal axis represents the Birth time of the feature. The graph shows H2 (blue points) and H1 (orange points) persistent homology features. H0 represents the topological features of connected components, while H1 represents the topological features of one-dimensional ring structures. The dashed line in the graph is the "Death = Birth" line. The farther the points are from this line, the more stable the corresponding topological feature is. This graph is used to analyze the topological structure in the battery voltage data and provides a basis for subsequent TDA feature extraction.
[0076] As shown in Figure 3 , the TDA feature matrix based on Figure 2The PD generates a Persistence Image (PI) of the topological features. By converting the persistent homology features into density distributions, the colors in the image represent the persistence strength of the topological features, with brighter colors indicating more significant topological features in that region. This image is used to extract the topological features from the battery data, providing input for the subsequent machine learning model.
[0077] S130, train a random forest model to predict battery life using the input dataset, combining the extracted physical features and TDA features. Optimize hyperparameters through 5-fold cross-validation to train and tune the model, resulting in a trained random forest model.
[0078] S140, based on the trained random forest model, predict the remaining cycle life of the battery, output the predicted life value of the battery, and evaluate on the test set. Evaluation indicators include Root Mean Square Error (RMSE) and relative error. The specific steps are as follows:
[0079] S1401, train the final model: use the best hyperparameter configuration to train the final random forest regression model finalMdl on all feature data.
[0080] S1402, model performance evaluation: use the trained random forest model to predict the test set, calculate the RMSE and relative error between the predicted life value and the actual life value, and evaluate the prediction performance of the model. RMSE reflects the average deviation between the predicted life value and the actual life value, and the smaller the value, the more accurate the model prediction. Relative error represents the deviation between the predicted life value and the actual life value as a proportion of the actual value, providing a relative measure of prediction accuracy.
[0081] S1403, result visualization: out-of-bag error plot: draw the out-of-bag error curve to evaluate the performance change of the model under different tree numbers. Out-of-bag error is used to evaluate the generalization ability of the random forest model. Predicted vs. actual plot: generate a scatter plot showing the comparison between the predicted life value and the actual life value, and add an ideal reference line. Through visual comparison, the prediction effect and accuracy of the model are intuitively displayed. Experimental results show that the RMSE of the method on the test set is about 70, and the average relative error is controlled within 8%. This indicates that the random forest regression model of the present application combined with topological data analysis features has high efficiency and accurate battery life prediction capability. Figure 4 The complete flowchart of the battery life prediction method provided in this embodiment.
[0082] The method provided by the embodiment can collect and form a complete data set by obtaining and preprocessing the cycle data of the battery, extract physical features and TDA features in the cycle data of the battery to form a feature matrix as an input data set, so as to ensure that the model can fully utilize the early cycle data of the battery, train the random forest model by using the input data set, optimize hyperparameters by using 5-fold cross validation, obtain the trained random forest model, and effectively improve the accuracy and robustness of the prediction of the remaining life of the battery, and predict the remaining cycle life of the battery based on the trained random forest model, and output the predicted life value of the battery. The method has low calculation cost, is suitable for quickly evaluating the health state of the battery, can provide an accurate prediction basis for a battery management system, prolongs the service life of the battery, and reduces maintenance cost.
[0083] In one embodiment, the step of optimizing the hyperparameters by using 5-fold cross validation specifically includes the following steps.
[0084] 1. Defining cross validation: dividing the input data set into 5 folds, and taking each fold as a validation set in turn and the remaining folds as training sets.
[0085] 2. Defining a hyperparameter search space: setting the hyperparameters of the random forest model, including the number of trees (200, 300, 500), the minimum leaf node number (2, 4, 6), and the maximum tree depth (10, 20, 30).
[0086] For each set of hyperparameter combinations, the following operations are performed: training the model by using the training set in each of the 5 folds, predicting the model by using the validation set, and calculating the root mean square error (RMSE).
[0087] 3. Selecting the best hyperparameters: obtaining the root mean square errors of all the hyperparameter combinations, recording the RMSE of each set of hyperparameters in each fold, calculating the average RMSE, and taking the hyperparameter combination with the lowest root mean square error as the best model configuration.
[0088] The method provided by the embodiment trains and optimizes the hyperparameters of the model by using the 5-fold cross validation method, and ensures the generalization ability and prediction accuracy of the model.
[0089] In one embodiment, the method further includes the following steps.
[0090] S1501. Training the final model: training the random forest model final-Mdl on the input data set by using the best hyperparameter configuration.
[0091] S1502, using the trained random forest model to predict the test set, calculate the root mean square error and relative error between the predicted life value and the actual life value, and evaluate the prediction performance of the model. RMSE reflects the average deviation between the predicted life value and the actual life value, and the smaller the value, the more accurate the model prediction. Relative error represents the deviation between the predicted life value and the actual life value as a proportion of the actual value, providing a relative measure of prediction accuracy.
[0092] In one embodiment, the following steps are also included:
[0093] S160, compare the predicted life value and the actual life value of the model through a visual chart.
[0094] Out-of-bag error chart: Draw the out-of-bag error curve to evaluate the performance change of the model under different tree numbers. Out-of-bag error is used to evaluate the generalization ability of the random forest model. Prediction vs. actual comparison chart: Generate a scatter plot to show the comparison between the predicted life value and the actual life value, and add an ideal reference line. Through visual comparison, the prediction effect and accuracy of the model are intuitively displayed. Experimental results show that the RMSE of the method on the test set is about 70, and the average relative error is controlled within 8%. This shows that the random forest regression model of the present application combined with topological data analysis features has efficient and accurate battery life prediction capability.
[0095] As shown in Figure 5 , the out-of-bag mean squared error (OOB MSE) of the final random forest model provided by the present embodiment is shown as a function of the number of trees. The vertical axis is the out-of-bag mean squared error, and the horizontal axis is the number of trees generated. As the number of trees increases, the out-of-bag error decreases rapidly and stabilizes, indicating that the model reaches its best generalization performance after increasing a certain number of trees. The out-of-bag error of the final model stabilizes at a low value when there are 200 trees, indicating that the model has good prediction ability.
[0096] As shown in Figure 6 , the comparison chart between the battery cycle life prediction results and the actual cycle life in the embodiment of the present application is shown. The blue points represent the battery life values predicted using the random forest regression model, the horizontal axis is the actual cycle life of the battery, and the vertical axis is the battery cycle life predicted by the model. The red dotted line is the ideal diagonal line, which represents the ideal state where the predicted life value and the actual life value are completely consistent. As shown in the figure, most of the blue points are close to the red ideal line, indicating that the model has good prediction accuracy in the range of 500 to 1200 cycles. When the actual cycle life exceeds 1200 times, the model may slightly underestimate the remaining life of the battery in some cases, but the overall trend still maintains good consistency.
[0097] Device Examples
[0098] According to embodiments of the present invention, a battery life prediction device based on TDA is provided, such as... Figure 1 The diagram shown is a schematic representation of the TDA-based battery life prediction system provided in this embodiment. The TDA-based battery life prediction device according to this embodiment includes a preprocessing module, a feature matrix module, a model training module, and a prediction module.
[0099] The preprocessing module 71 is used to acquire and preprocess the battery's cycle data.
[0100] Feature matrix module 72 is used to extract physical features and TDA features from the battery's cyclic data to form a feature matrix as the input dataset.
[0101] The model training module 73 is used to train the random forest model using the input dataset, optimize the hyperparameters through 5-fold cross-validation, and obtain the trained random forest model.
[0102] The prediction module 74 is used to predict the remaining cycle life of the battery based on the trained random forest model and output the predicted life value of the battery.
[0103] The apparatus provided in this embodiment acquires and preprocesses battery cycling data through a preprocessing module 71, which merges various datasets to form a complete dataset. A feature matrix module 72 extracts physical features and TDA features from the battery cycling data to form a feature matrix as the input dataset, ensuring that the model can fully utilize the early cycling data of the battery. A model training module 73 trains a random forest model using the input dataset, optimizes hyperparameters through 5-fold cross-validation, and obtains a trained random forest model, effectively improving the accuracy and robustness of battery remaining life prediction. A prediction module 74 predicts the remaining cycle life of the battery based on the trained random forest model and outputs the predicted battery life value. This method has low computational cost, is suitable for quickly assessing battery health status, and can provide accurate prediction basis for the battery management system, extending battery life and reducing maintenance costs.
[0104] In one embodiment, the feature matrix module 72 is specifically configured to extract the average discharge capacity, average internal resistance, and average charging time of each cycle from the battery's cycle data to construct point cloud data;
[0105] The point cloud data is subjected to persistent coherence map analysis to calculate TDA features, thereby further analyzing the set structure of battery cycle data and capturing subtle changes during battery aging.
[0106] In one embodiment, the model training module 73 is specifically configured to divide the input data set into 5 folds, each of which is used as a validation set in turn, and the rest is used as a training set.
[0107] The hyperparameters of the random forest model are set, including the number of trees, the minimum leaf node number and the maximum tree depth.
[0108] For each combination of hyperparameters, the model is trained using the training set in 5 folds respectively, and the model is predicted using the validation set, and the root mean square error is calculated.
[0109] The root mean square error of all hyperparameter combinations is obtained, and the hyperparameter combination with the lowest root mean square error is used as the optimal model configuration.
[0110] The device provided in the embodiment trains and optimizes the model by using the 5-fold cross-validation method, thereby ensuring the generalization ability and prediction accuracy of the model.
[0111] The embodiment of the application is a device embodiment corresponding to the above-mentioned method embodiment, and the specific operations of each module processing step can be understood with reference to the description of the method embodiment, which will not be repeated here.
[0112] As shown in Figure 8 The application also provides a computer readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the TDA-based battery life prediction method in the above embodiment, or the computer program is executed by a processor to implement the TDA-based battery life prediction method in the above embodiment.
[0113] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, database or other medium used in each embodiment provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0114] Each embodiment in the specification is described in a progressive manner, and the same or similar parts between each embodiment can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the device or system embodiment, since it is basically similar to the method embodiment, it is described more simply, and the relevant part can be referred to the part of the method embodiment. The above-described device and system embodiments are only illustrative, and the units described as separate components can be or can not be physically separated, and the components displayed as units can be or can not be physical units, that is, they can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0115] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions recorded in the above embodiments can still be modified, or some or all of the technical features can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and the contents not described in detail in the specification of the present application are the known technology of those skilled in the art.
Claims
1. A TDA-based battery life prediction method, characterized by, The method comprises the following steps: obtaining and preprocessing cycle data of the battery; extracting physical features and TDA features in the cycle data of the battery to form a feature matrix as an input data set; training a random forest model based on the input data set, optimizing hyperparameters through 5-fold cross-validation, and obtaining a trained random forest model; based on the trained random forest model, predicting the remaining cycle life of the battery and outputting the predicted life value of the battery.
2. The battery life prediction method of claim 1, wherein, The TDA features in the cycle data of the battery are extracted, specifically including the following steps: extracting the average discharge capacity, average internal resistance and average charging time of each cycle in the cycle data of the battery to construct point cloud data; performing persistent homology analysis on the point cloud data to calculate TDA features.
3. The battery life prediction method of claim 1, wherein, The 5-fold cross-validation is used to optimize the hyperparameters, specifically including the following steps: divide the input data set into 5 folds, and each fold is used as a validation set in turn, and the remaining is used as a training set; set the hyperparameters of the random forest model, including the number of trees, the minimum leaf node number and the maximum tree depth; for each set of hyperparameter combinations, use the training set to train the model and use the validation set to predict the model in 5 folds, and calculate the root mean square error; obtain the root mean square error of all hyperparameter combinations, and use the hyperparameter combination with the lowest root mean square error as the best model configuration.
4. The battery life prediction method of claim 3, wherein, The method further comprises the following steps: train the random forest model on the input data set using the best hyperparameter configuration; use the trained random forest model to predict the test set, calculate the root mean square error and relative error between the predicted life value and the actual life value, and evaluate the prediction performance of the model.
5. The battery life prediction method of claim 3, wherein, The method further comprises the following steps: compare the predicted life value and the actual life value of the model through a visual chart.
6. A TDA-based battery life prediction apparatus, characterized by, The method comprises a preprocessing module, a feature matrix module, a model training module and a prediction module; The preprocessing module is used to obtain and preprocess the cycle data of the battery; The feature matrix module is used to extract physical features and TDA features in the cycle data of the battery to form a feature matrix as an input data set; The model training module is used to train a random forest model based on the input data set, optimize hyperparameters through 5-fold cross-validation, and obtain a trained random forest model; The prediction module is used to predict the remaining cycle life of the battery based on the trained random forest model and output the predicted life value of the battery.
7. The battery life prediction apparatus of claim 6, wherein The feature matrix module is specifically configured to extract the average discharge capacity, average internal resistance and average charging time of each cycle in the cycle data of the battery to construct point cloud data; performing persistent homology analysis on the point cloud data to calculate TDA features.
8. The battery life prediction apparatus of claim 6, wherein The model training module is specifically configured to divide the input data set into 5 folds, and each fold is used as a validation set in turn, and the remaining is used as a training set; set the hyperparameters of the random forest model, including the number of trees, the minimum leaf node number and the maximum tree depth; for each set of hyperparameter combinations, use the training set to train the model and use the validation set to predict the model in 5 folds, and calculate the root mean square error; Obtain the root mean square error of all hyperparameter combinations, and take the hyperparameter combination with the lowest root mean square error as the optimal model configuration.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor implements the TDA-based battery life prediction method according to any one of claims 1-5 when executing the computer program.
10. A computer-readable storage medium storing a computer program, the computer-readable storage medium comprising: The computer program, when executed by the processor, implements the steps of the TDA-based battery life prediction method according to any one of claims 1-5.
Citation Information
Patent Citations
Method for predicting residual cycle life of lithium battery based on random forest model
CN111965562A
Lithium battery state prediction method and system based on hybrid machine learning method, and medium
CN114742203A