Battery capacity prediction method and device and computer readable storage medium
Through the combination of dual prediction models, using battery charging and discharging feature information, the problem of large battery capacity deviation during prediction of a single model is solved, and the accuracy of battery capacity prediction is improved.
Patent Information
- Application Number
- CN202410962203.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-15
AI Technical Summary
Existing battery capacity prediction methods use a single fit calculation formula or model, resulting in a large deviation from the real capacity, reducing the accuracy of the prediction.
Using the dual prediction model method, firstly, the battery charge and discharge characteristic information is obtained through feature analysis, the first prediction model is input to obtain the reference predicted capacity, and then it and the characteristic information are input to the second prediction model to obtain the final target predicted capacity.
Through the combination of dual models, the deviation during prediction of a single model is reduced and the accuracy of battery capacity prediction is improved.
Smart Images

Figure CN118962450A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of battery technology, and in particular to a battery capacity prediction method, device and computer-readable storage medium. Background Art
[0002] With the rapid development of science and technology, battery technology has been widely used. In the process of battery production and application, battery capacity prediction is an indispensable link.
[0003] However, in the relevant technologies for battery capacity prediction, a single fitting calculation formula or model is usually used to predict the battery capacity, which may lead to a large deviation between the predicted battery capacity and the actual capacity, resulting in low accuracy of battery capacity prediction. Summary of the invention
[0004] The embodiments of the present application provide a battery capacity prediction method, device, and computer-readable storage medium, which can improve the accuracy of battery capacity prediction.
[0005] In a first aspect, an embodiment of the present application provides a battery capacity prediction method, the method comprising:
[0006] Obtaining battery process information of a target battery, wherein the battery process data includes battery charging information, battery discharging information, and battery core pack weight;
[0007] Performing feature analysis on the battery process information to determine battery charge and discharge feature information;
[0008] Inputting the battery charge and discharge characteristic information into a first prediction model to obtain a first reference prediction capacity;
[0009] The first reference battery predicted capacity and the battery charge and discharge characteristic information are input into a second prediction model to obtain a target predicted capacity.
[0010] In a second aspect, an embodiment of the present application further provides a battery capacity prediction device, comprising a memory storing a computer program; a processor loads the computer program from the memory to execute the steps of any battery capacity prediction method provided in the embodiment of the present application.
[0011] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for a processor to load to execute the steps of any battery capacity prediction method provided in the embodiment of the present application.
[0012] In a fourth aspect, an embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any battery capacity prediction method provided in the embodiment of the present application.
[0013] The scheme of the application embodiment is adopted to obtain the battery process information of the target battery, and the battery process data includes battery charging information, battery discharging information and battery core pack weight; the battery process information is feature analyzed to determine the battery charge and discharge feature information; the battery charge and discharge feature information is input into the first prediction model to obtain the first reference predicted capacity; the first reference battery predicted capacity and the battery charge and discharge feature information are input into the second prediction model to obtain the target predicted capacity. By inputting the battery process data into the first prediction model to obtain the first reference predicted capacity, and inputting the first reference battery predicted capacity and the battery charge and discharge feature information into the second prediction model to obtain the target predicted capacity, the problem of large deviation between the predicted battery capacity and the actual capacity caused by using a single model to predict the battery capacity is avoided, and the accuracy of the battery capacity prediction is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0015] Figure 1 It is a schematic diagram of the first embodiment of the battery capacity prediction method provided in the embodiments of the present application;
[0016] Figure 2 It is a schematic flow chart of a second embodiment of the battery capacity prediction method provided in the embodiments of the present application;
[0017] Figure 3 1 is a flow chart of a third embodiment of a battery capacity prediction method provided in an embodiment of the present application;
[0018] Figure 4 It is a structural schematic diagram of a battery capacity prediction device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0020] Embodiments of the present application provide a battery capacity prediction method, device, and computer-readable storage medium.
[0021] Specifically, this embodiment will be described from the perspective of a battery capacity prediction device, which can be integrated into a battery capacity prediction apparatus, that is, the battery capacity prediction method of the embodiment of the present application can be executed by the battery capacity prediction device.
[0022] The battery capacity prediction method provided in the embodiment of the present application can be applied to a battery capacity prediction device, and the battery capacity prediction device can be a smart terminal, a PC terminal, a mobile terminal and other devices.
[0023] The following is a detailed description in conjunction with the accompanying drawings. In this embodiment, the execution subject is a battery capacity prediction device as an example. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.
[0024] Please refer to Figure 1 , a first embodiment of the battery capacity prediction method is proposed, and the first embodiment includes the following steps:
[0025] Step 101, obtaining battery process information of a target battery, wherein the battery process data includes battery charging information, battery discharging information and battery core pack weight;
[0026] Step 102, performing feature analysis on the battery process information to determine battery charge and discharge feature information;
[0027] Step 103, inputting the battery charge and discharge characteristic information into a first prediction model to obtain a first reference prediction capacity;
[0028] Step 104: input the first reference battery predicted capacity and the battery charge and discharge characteristic information into a second prediction model to obtain a target predicted capacity.
[0029] In this embodiment, when it is necessary to predict the capacity of the target battery, the battery capacity prediction device obtains the battery process information of the target battery, and the battery process data includes battery charging information, battery discharging information and battery core pack weight, which are obtained by conducting relevant experiments on the target battery; the battery capacity prediction device performs feature analysis on the battery process information to determine the battery charging and discharging feature information; the battery charging and discharging feature information is input into the first prediction model to obtain the first reference predicted capacity; the first reference battery predicted capacity and the battery charging and discharging feature information are input into the second prediction model to obtain the target predicted capacity. It should be noted that the first prediction model can be one model or multiple models. When the first prediction model is one model, the first prediction model can be a random forest model, a gradient boosting machine model or a relevance vector machine model. When the first prediction model is multiple models, the first prediction model can be multiple or one of the random forest model, the gradient boosting machine model and the relevance vector machine model; the second prediction model is a model, including a multi-layer perceptron model, a long short-term memory model or a genetic algorithm model.
[0030] The battery capacity prediction device of this embodiment obtains a first reference predicted capacity by inputting battery process data into a first prediction model, and inputs the first reference battery predicted capacity and battery charge and discharge characteristic information into a second prediction model to obtain a target predicted capacity, thereby avoiding the problem of a large deviation between the predicted battery capacity and the actual capacity caused by using a single model to predict the battery capacity, and improving the accuracy of battery capacity prediction.
[0031] Specifically, each step is described in detail below:
[0032] Step 101, obtaining battery process information of a target battery, wherein the battery process data includes battery charging information, battery discharging information and battery core pack weight;
[0033] In this step, when the user needs to predict the capacity of the target battery, the battery process information of the target battery is input into the battery capacity prediction device, wherein the battery capacity prediction device includes a human-computer interaction interface, and the interface includes input boxes for the battery charging information, battery discharging information and battery core pack weight of the target battery. The user inputs the corresponding numerical value into the corresponding input box, and the battery capacity prediction device can obtain the battery process information of the target battery. Specifically, the battery charging information includes the battery charging capacity, the battery charging temperature and the battery charging voltage, and the battery discharging information includes the battery discharging capacity, the battery discharging temperature and the battery discharging voltage.
[0034] Step 102, performing feature analysis on the battery process information to determine battery charge and discharge feature information;
[0035] In this step, after the battery capacity prediction device obtains the battery process information of the target battery, it performs feature analysis on the battery charging information, battery discharging information and battery core pack weight in the battery process data to determine the battery charging and discharging feature information. Among them, the battery charging and discharging feature information includes the charging and discharging ratio, the temperature change rate and the voltage change rate. Charge and discharge ratio: refers to the rate at which the battery is charged or discharged per unit time. It is usually expressed as a C value, where 1C means that the charging or discharging time is 1 hour. If the capacity of a battery is 1000mAh, then when charging and discharging at 1C, it is charged and discharged at a current of 1000mA, and the charging time or discharge time is 1 hour; when charging and discharging at 2C, it is charged and discharged at a current of 2000mA, and the charging time or discharge time is 0.5 hours, and so on. Temperature change rate: refers to the rate of change of the battery temperature during the charging and discharging process. Voltage change rate: refers to the rate of change of the battery voltage during the charging and discharging process.
[0036] Specifically, step 102 includes:
[0037] Step 1021, extracting the battery charging capacity, battery charging temperature and battery charging voltage from the battery charging information, and extracting the battery discharging capacity, battery discharging temperature and battery discharging voltage from the battery discharging information;
[0038] In this step, the battery capacity prediction device extracts the battery charging capacity, the battery charging temperature, and the battery charging voltage from the battery charging information, and extracts the battery discharging capacity, the battery discharging temperature, and the battery discharging voltage from the battery discharging information.
[0039] Step 1022, determining the charge-discharge ratio according to the battery charge capacity, the battery discharge capacity and the battery core pack weight;
[0040] In this step, the battery capacity prediction device determines the charge and discharge ratio of the target battery based on the battery charging capacity, the battery discharging capacity and the battery cell pack weight; specifically, the formula for calculating the charge and discharge ratio of the target battery is: C_rate = (C_charge + C_discharge) / W_pack, wherein C_charge is the battery charging capacity, C_discharge is the battery discharging capacity, W_pack is the battery cell pack weight, and C_rate is the charge and discharge ratio of the target battery.
[0041] Step 1023, determining the temperature change rate according to the battery charging temperature, the battery discharging temperature and the battery core pack weight;
[0042] In this step, the battery capacity prediction device determines the temperature change rate of the target battery according to the battery charging temperature, the battery discharging temperature and the battery core pack weight; specifically, the formula for calculating the temperature change rate of the target battery is: T_rate=K*(T_charge-T_discharge) / W_pack, wherein T_charge is the battery charging temperature, T_discharge is the battery discharging temperature, W_pack is the battery core pack weight, T_rate is the temperature change rate of the target battery, and K is the proportionality coefficient, which represents the thermal characteristics and thermal conductivity performance of the target battery.
[0043] Step 1024, determining the voltage change rate according to the battery charging voltage, the battery discharging voltage and the battery core pack weight.
[0044] In this step, the battery capacity prediction device determines the voltage change rate based on the battery charging voltage, the battery discharging voltage and the battery cell pack weight; specifically, the formula for calculating the voltage change rate of the target battery is: V_rate = *(V_charge-V_discharge) / W_pack, wherein V_charge is the battery charging voltage, V_discharge is the battery discharging voltage, W_pack is the battery cell pack weight, and V_rate is the voltage change rate of the target battery.
[0045] It should be noted that the steps of calculating the charge and discharge ratio, temperature change rate and voltage change rate of the target battery can be performed by the battery capacity prediction device, or by the battery capacity prediction device through the first prediction model and the second prediction model, and are not limited here.
[0046] Step 103, inputting the battery charge and discharge characteristic information into a first prediction model to obtain a first reference prediction capacity;
[0047] In this step, after determining the battery charge and discharge characteristic information of the target battery, the battery capacity prediction device inputs the battery charge and discharge characteristic information into a first prediction model to obtain a first reference predicted capacity; wherein the first prediction model is a model for predicting battery capacity obtained by pre-training based on a random forest model, a gradient boosting machine model, and a related vector machine model.
[0048] Specifically, step 103 includes:
[0049] Step 1031, processing the charge-discharge ratio, the temperature change rate, and the voltage change rate by using the first prediction model to obtain a first predicted capacity, a second predicted capacity, and a third predicted capacity, respectively;
[0050] Step 1032: Perform calculations based on the first predicted capacity, the second predicted capacity, and the third predicted capacity to determine a first reference predicted capacity.
[0051] In step 1031 to step 1032, the battery capacity prediction device inputs the charge and discharge ratio, the temperature change rate and the voltage change rate into the first prediction model, and obtains the first predicted capacity, the second predicted capacity and the third predicted capacity respectively based on the charge and discharge ratio, the temperature change rate and the voltage change rate through the first prediction model; the battery capacity prediction device then performs corresponding calculations on the first predicted capacity, the second predicted capacity and the third predicted capacity to determine the first reference predicted capacity.
[0052] Exemplarily, the first prediction model includes a random forest model, a gradient boosting machine model, and a relevance vector machine model. The battery capacity prediction device inputs the charge and discharge ratio, the temperature change rate, and the voltage change rate into the random forest model, the gradient boosting machine model, and the relevance vector machine model, respectively, outputs the first predicted capacity through the random forest model, outputs the second predicted capacity through the gradient boosting machine model, and outputs the third predicted capacity through the relevance vector machine model. The battery capacity prediction device determines the first reference predicted capacity based on the first predicted capacity, the second predicted capacity, and the third predicted capacity by voting or averaging; or, the battery capacity prediction device adds the first predicted capacity, the second predicted capacity, and the third predicted capacity and takes the average to determine the first reference predicted capacity.
[0053] Specifically, the specific process of outputting the first predicted capacity through the random forest model is: the random forest model inputs the charge and discharge ratio, temperature change rate and voltage change rate into the corresponding decision trees respectively, each decision tree outputs the corresponding predicted capacity respectively, and the random forest model integrates the predicted capacity of each decision tree and outputs the first predicted capacity.
[0054] Specifically, the specific process of outputting the second predicted capacity through the gradient boosting model is as follows: the gradient boosting model organizes the charge-discharge ratio, the temperature change rate, and the voltage change rate into a feature matrix. The feature matrix is predicted in turn based on the three trained weak classifiers, each weak classifier outputs the corresponding predicted capacity, and the gradient boosting model adds the predicted capacities output by each weak classifier to output the second predicted capacity.
[0055] Specifically, the specific process of outputting the third predicted capacity through the correlation vector machine model is: the correlation vector machine model organizes the charge and discharge ratio, temperature change rate and voltage change rate into the form of a feature matrix, and directly determines the output of the third predicted capacity based on the feature matrix and the sparse weight vector learned from the training data.
[0056] It should be noted that the first prediction model may include only one of the random forest model, the gradient boosting machine model and the relevant vector machine model, and the first prediction model may include only two of the random forest model, the gradient boosting machine model and the relevant vector machine model, and there is no limitation here; no matter how many models are included in the first prediction model, the number of models in the first prediction model is multiple, and further calculation is required based on the prediction capacity output by each model to obtain the final first reference prediction capacity.
[0057] Step 104: input the first reference battery predicted capacity and the battery charge and discharge characteristic information into a second prediction model to obtain a target predicted capacity; the first prediction model and the second prediction model use different model algorithms.
[0058] In this step, after the battery capacity prediction device obtains the first reference predicted capacity, it inputs the first reference battery predicted capacity and the battery charge and discharge characteristic information into the second prediction model to obtain the target predicted capacity. Since there are usually multiple first prediction models, there are also multiple first reference predicted capacities, and all first reference predicted capacities need to be input into the second prediction model; the second prediction model is a model for predicting battery capacity obtained by pre-training a multi-layer perceptron model, a long short-term memory model, or a genetic algorithm model.
[0059] Specifically, step 104 includes:
[0060] Step 1041, using the second prediction model based on a preset weight and a preset bias, processing the first reference battery predicted capacity, the charge and discharge ratio, the temperature change rate, and the voltage change rate to obtain a fourth predicted capacity;
[0061] In this step, the battery capacity prediction device inputs the first reference battery predicted capacity, the charge and discharge ratio, the temperature change rate and the voltage change rate into the second prediction model to obtain a fourth predicted capacity.
[0062] Specifically, the second prediction model first preprocesses the predicted capacity, charge and discharge ratio, temperature change rate and voltage change rate of the first reference battery to ensure that its format meets the format requirements, and performs feature scaling, standardization or other necessary data conversion operations; the second prediction model constructs prediction feature data based on the preprocessed predicted capacity, charge and discharge ratio, temperature change rate and voltage change rate of the first reference battery, and then predicts the prediction feature data based on preset weights and preset biases to obtain a fourth predicted capacity.
[0063] Optionally, the battery capacity prediction device uses the fourth predicted capacity output by the second prediction model as the final predicted capacity value of the target battery.
[0064] Step 1042: Perform calculations based on the fourth predicted capacity and the first reference predicted capacity to determine a target predicted capacity.
[0065] In this step, after the battery capacity prediction device obtains the fourth predicted capacity based on the second prediction model, it performs calculation processing based on the fourth predicted capacity and the first reference predicted capacity to determine the target predicted capacity. Optionally, the battery capacity prediction device can use a weighted average method to output the target predicted capacity based on the fourth predicted capacity, the first reference predicted capacity and the corresponding weights; optionally, the battery capacity prediction device first averages the first reference predicted capacity, and then uses a voting method to perform a majority vote on the average of the first reference predicted capacity and the fourth predicted capacity, and the result with the most votes is used as the target predicted capacity.
[0066] The battery capacity prediction device of this embodiment obtains the battery process information of the target battery, and the battery process data includes battery charging information, battery discharging information and battery core pack weight; performs feature analysis on the battery process information to determine the battery charging and discharging feature information; inputs the battery charging and discharging feature information into the first prediction model to obtain the first reference predicted capacity; inputs the first reference battery predicted capacity and the battery charging and discharging feature information into the second prediction model to obtain the target predicted capacity. By inputting the battery process data into the first prediction model to obtain the first reference predicted capacity, and inputting the first reference battery predicted capacity and the battery charging and discharging feature information into the second prediction model to obtain the target predicted capacity, the problem of large deviation between the predicted battery capacity and the actual capacity caused by using a single model to predict the battery capacity is avoided, thereby improving the accuracy of the battery capacity prediction.
[0067] Further, refer to Figure 2 A second embodiment of the battery capacity prediction method is proposed. The difference between the second embodiment and the first embodiment is that before the battery charge and discharge characteristic information is input into the first prediction model to obtain the first reference predicted capacity, the method includes:
[0068] Step a, obtaining sample battery process information and sample battery real capacity, wherein the sample battery process data includes sample battery charging information, sample battery discharging information and sample battery core pack weight;
[0069] In this step, before making a prediction, it is necessary to train the first prediction model. At this time, the battery capacity prediction device obtains the sample battery process information and the actual capacity of the sample battery. The sample battery process data includes the sample battery charging information, the sample battery discharging information and the sample battery core pack weight.
[0070] Step b, training a first model to obtain a first prediction model according to the sample battery process information and the actual capacity of the sample battery, wherein the first model includes at least one of a random forest model, a gradient boosting machine model, and a relevance vector machine model;
[0071] In this step, the battery capacity prediction device trains the first model according to the sample battery process information and the actual capacity of the sample battery to obtain a first prediction model, and the first model includes at least one of a random forest model, a gradient boosting machine model and a relevance vector machine model.
[0072] Specifically, step b includes:
[0073] Step b1, dividing the sample battery process information and the sample battery actual capacity into a first training set and a second training set;
[0074] In this step, the battery capacity prediction device divides the sample battery process information and the sample battery real capacity into a first training set and a second training set, that is, a part of the sample battery process information and the corresponding sample battery real capacity are divided into the first training set, and the other part of the sample battery process information and the corresponding sample battery real capacity are divided into the second training set. Exemplarily, when the sample data amount of the sample battery process information and the sample battery real capacity is large, half of the sample battery process information and the corresponding sample battery real capacity can be divided into the first training set, and half of the sample battery process information and the corresponding sample battery real capacity can be divided into the second training set; when the sample data amount of the sample battery process information and the sample battery real capacity is small, two-thirds of the sample battery process information and the corresponding sample battery real capacity can be divided into the first training set, and one-third of the sample battery process information and the corresponding sample battery real capacity can be divided into the second training set.
[0075] Step b2, performing hyperparameter tuning on the first model based on the first training set to determine target hyperparameters of the first model, wherein the root mean square deviation and mean absolute error corresponding to the target hyperparameters are less than a preset threshold;
[0076] In this step, the battery capacity prediction device performs hyperparameter tuning on the first model based on the first training set to determine the target hyperparameters of the first model, and the root mean square deviation and mean absolute error corresponding to the target hyperparameters are less than a preset threshold.
[0077] Specifically, the battery capacity prediction device uses Python, imports the function library RandomForestRegressor, scikit-learn (GradientBoostingRegressor), and uses the first training set to optimize the hyperparameters of the random forest model, the gradient boosting machine model, and the related vector machine model through the grid search method, so that the loss function of the random forest model, the gradient boosting machine model, and the related vector machine model is less than the preset threshold, and then the target hyperparameters corresponding to each model are determined; the hyperparameters of the random forest model and the gradient boosting machine model include the learning rate, the decision The number of trees, the maximum depth of the tree, the minimum number of samples of the leaf node, the minimum sample split, etc. The hyperparameters of the RVM model include the number of iterations, the prior parameters of the weight vector, and the prior parameters of the noise; the model loss function is the root mean square error (RMSE) and the mean absolute error (MAE); the grid search method uses a numerical set to represent each hyperparameter of the model, for example: a numerical set is {'learning rate': [0.1, 0.01, 0.001], 'number of decision trees': [50, 100, 150], , 'maximum depth of the tree': [1, 2, 3], ...}, the purpose is to search for the optimal (minimum loss function) model parameters. In the process of training each model, not all models can be used. It is necessary to evaluate the evaluation indicators (loss function) of each model, and eliminate the model evaluation indicators that are too poor to avoid affecting the accuracy of the final prediction.
[0078] Step b3: Based on the second training set, training the first model for determining the target hyperparameters to obtain a first prediction model.
[0079] In this step, the battery capacity prediction device trains the first model for determining the target hyperparameter based on the second training set to obtain a first prediction model; specifically, the battery capacity prediction device trains the random forest model for determining the target hyperparameter, the gradient boosting machine model for determining the target hyperparameter, and the related vector machine model for determining the target hyperparameter based on the second training set to obtain the random forest model, the gradient boosting machine model for determining the target hyperparameter, and the related vector machine model for determining the target hyperparameter that can ultimately be used to predict the battery capacity.
[0080] Among them, the training process of the random forest model is as follows: Step 1, randomly divide the training set and the validation set from the second training set, and randomly obtain some samples and features in the training set; Step 2, use some samples in Step 1 to train a decision tree. When building a decision (CART decision tree), bootstrap sampling and random feature selection are usually used; When training a decision tree, the following process is performed: ① Feature selection: According to the information gain, information gain ratio, and Gini index evaluation indicators, the optimal feature is selected as the split feature of the current node; ② Sample partitioning: The samples of the current node are divided into different sub-nodes according to the value of the split feature; ③ Recursive partitioning: Recursively repeat the "feature selection" and "sample partitioning" steps for each sub-node until the termination condition is reached. The termination condition is that the depth of the tree reaches a certain value and the number of samples in the node is less than a certain threshold; ④ Pruning: In order to prevent overfitting, the generated decision tree can be pruned, that is, some unnecessary leaf nodes are removed to make the model simpler. The decision tree is not explained in detail here. You can use Python software to import the decision tree model and perform parameter testing and adjustment. In the third step, repeat steps 1 and 2 to build and train multiple decision trees (repeat according to the preset number of trees, which is determined in the aforementioned hyperparameter tuning process). In the fourth step, input the samples in the validation set into the random forest model to obtain the prediction results of each decision tree, and take the average of all the decision tree prediction results (regression problem) to obtain the prediction results of the random forest model. If the error between the prediction result and the actual measured capacity of the validation set meets the requirements, the trained random forest model is obtained. If the error between the prediction result and the actual measured capacity of the validation set does not meet the requirements, retraining is performed.
[0081] Among them, the process of GBM model training is: the first step is to calculate the mean of the measured capacity sample data in the second training set; the second step is to calculate the residual of each training sample, that is, the measured capacity of the sample minus the current model prediction value; the third step is to use the residual as the target variable to train a decision tree. During the training process, the gradient descent algorithm is used to minimize the sum of squares of the residuals. This can make the predicted value of the model closer to the target variable. The prediction result of the decision tree obtained by the current training is added to the initial prediction value to obtain a new prediction value; the fourth step is to determine the stopping condition: if the preset number of iterations is reached or the residual sum of squares is less than the preset threshold, if the stopping condition is not reached, then return to the second step and repeat the above steps.
[0082] The training process of the RVM model is as follows: the first step is to initialize the weight value of each input variable according to the data characteristics of the second training set; the second step is to calculate the noise accuracy through the current weight; the third step is to calculate the association vector using the current weight and accuracy, and the association vector represents the influence of each input variable on the output result; the fourth step is to set those vectors that have little influence on the output result as useless vectors; the fifth step is to solve the model parameters by maximizing the likelihood function or minimizing the regularized error function according to the determined useful vectors during training, thereby adjusting the model weights and thresholds to minimize the error function; determine whether the current model has converged: when the maximum number of iterations is reached or the model error has converged to the specified threshold, if not, return to the third step to continue iterating.
[0083] Furthermore, before inputting the first reference battery predicted capacity and the battery charge and discharge characteristic information into a second prediction model to obtain a target predicted capacity, the method further includes:
[0084] Step c, processing the sample battery process information by using the first prediction model to obtain a second reference prediction capacity;
[0085] In this step, after training the first prediction model, the battery capacity prediction device processes the sample battery process information through the first prediction model to obtain the second reference prediction capacity.
[0086] Step d: training a second model according to the sample battery process information, the actual capacity of the sample battery and the second reference predicted capacity to obtain a second prediction model, wherein the second model includes at least one of a multi-layer perceptron model, a long short-term memory model and a genetic algorithm model.
[0087] In this step, the battery capacity prediction device trains the second model according to the sample battery process information, the actual capacity of the sample battery and the second reference predicted capacity to obtain a second prediction model, wherein the second model includes at least one of a multi-layer perceptron model, a long short-term memory model and a genetic algorithm model.
[0088] Specifically, the battery capacity prediction device first divides a part of the sample battery process information, the corresponding sample battery actual capacity and the corresponding second reference predicted capacity into a first training set, and divides the other part of the sample battery process information, the corresponding sample battery actual capacity and the corresponding second reference predicted capacity into a second training set; the battery capacity prediction device uses Python to import the multi-layer perceptron model, the long short-term memory model and the genetic algorithm model in the function library TensorFlow, and uses the first training set to perform hyperparameter tuning on the multi-layer perceptron model, the long short-term memory model and the genetic algorithm model through a grid search method, so that the loss functions of the multi-layer perceptron model, the long short-term memory model and the genetic algorithm model are minimized, thereby finding the target hyperparameters of the model; the battery capacity prediction device trains the multi-layer perceptron model for determining the target hyperparameters, the long short-term memory model for determining the target hyperparameters and the genetic algorithm model for determining the target hyperparameters based on the second training set, and finally obtains the multi-layer perceptron model that can be used to predict the battery capacity, the long short-term memory model that can be used to predict the battery capacity and the genetic algorithm model that can be used to predict the battery capacity.
[0089] Among them, the multi-layer perceptron model, the long short-term memory model, and the genetic algorithm model all belong to the neural network model. The training process of the neural network model is as follows: the first step is to use the predicted capacity data, battery process sample data, and battery measured capacity sample data in the second training set to divide the second training set into a training set and a validation set. The second step is to select the network model structure, including the number of layers, the number of nodes, the activation function, etc., and initialize the network, where the number of layers, the number of nodes, and the activation function are determined in the above hyperparameter tuning steps. The third step is to input the input data into the network and calculate the output result through forward propagation. The fourth step is to compare the output result of the network with the actual result and calculate the value of the loss function. The fifth step is to use the loss function to back propagate, calculate the contribution of each weight to the loss function, and use the gradient descent algorithm to update the value of each weight. The sixth step is to use the validation set to verify the trained model to determine whether the model is overfitting or underfitting, and adjust the model; determine whether the current model converges: the number of iterations is reached or the model error has converged to the specified threshold. If not, return to the third step to continue iterating.
[0090] Before the battery capacity prediction device of this embodiment performs battery capacity prediction, the first model is trained according to the sample battery process information and the actual capacity of the sample battery to obtain the first prediction model, and the second model is trained according to the sample battery process information, the actual capacity of the sample battery and the second reference prediction capacity output by the first prediction model according to the sample battery process information to obtain the second prediction model. This helps to predict the target predicted capacity of the target battery based on the first prediction model and the second prediction model in the future, avoids the problem of large deviation between the predicted battery capacity and the actual capacity caused by using a single model to predict the battery capacity, and improves the accuracy of battery capacity prediction.
[0091] Further, refer to Figure 3 , a third embodiment of the battery capacity prediction method is proposed. The difference between the third embodiment and the first embodiment and the second embodiment is that after the second prediction model is obtained by training the second model according to the sample battery process information, the sample battery actual capacity and the second reference predicted capacity, the method includes:
[0092] Step e, according to a preset distribution rule, setting the number of trained random forest models, the number of trained gradient boosting machine models, and the number of trained related vector machine models included in the first prediction model;
[0093] Step f, predicting the sample battery process information based on the first prediction model and the second prediction model to obtain a fifth predicted capacity;
[0094] Step g, until the difference between the fifth predicted capacity and the actual capacity of the sample battery is less than a preset error, determine the number of trained random forest models, the number of trained gradient boosting machine models, and the number of trained related vector machine models included in the first prediction model.
[0095] In step e to step g, the battery capacity prediction device sets the number of random forest models that have been trained, the number of gradient boosting machine models that have been trained, and the number of related vector machine models that have been trained included in the first prediction model according to the preset distribution rule, and then predicts the sample battery process information based on the first prediction model and the second prediction model to obtain the fifth predicted capacity; the battery capacity prediction device predicts a fifth preset capacity each time after adjusting the number of random forest models that have been trained, the number of gradient boosting machine models that have been trained, and the number of related vector machine models that have been trained in the first prediction model. After executing according to the preset distribution rule, the fifth predicted capacity corresponding to multiple combinations of the first prediction models can be obtained. The battery capacity prediction device compares the difference between each fifth predicted capacity and the actual capacity of the sample battery with the preset error, and determines the number of random forest models that have been trained, the number of gradient boosting machine models that have been trained, and the number of related vector machine models that have been trained according to the combination of the first prediction models corresponding to which the difference between the fifth predicted capacity and the actual capacity of the sample battery is less than the preset error.
[0096] The battery capacity prediction device of this embodiment can determine the number of random forest models that have completed training, the number of gradient boosting machine models that have completed training, and the number of related vector machine models that have completed training included in the first prediction model, and can determine the best combination of the first prediction model and the second prediction model for predicting the target predicted capacity of the target battery, thereby avoiding the problem of a large deviation between the predicted battery capacity and the actual capacity caused by using a single model to predict the battery capacity, and improving the accuracy of battery capacity prediction.
[0097] Accordingly, the present application also provides a battery capacity prediction device, such as Figure 4 As shown, Figure 4 A schematic diagram of the structure of a battery capacity prediction device provided in an embodiment of the present application. The battery capacity prediction device 1100 includes a processor 1101 having one or more processing cores, a memory 1102 having one or more computer-readable storage media, and a computer program stored in the memory 1102 and executable on the processor. The processor 1101 is electrically connected to the memory 1102. Those skilled in the art will appreciate that the battery capacity prediction device structure shown in the figure does not constitute a limitation on the battery capacity prediction device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0098] The processor 1101 is the control center of the battery capacity prediction device 1100. It uses various interfaces and lines to connect various parts of the entire battery capacity prediction device 1100, and executes various functions and processes data of the battery capacity prediction device 1100 by running or loading software programs and / or units stored in the memory 1102, and calling data stored in the memory 1102, so as to monitor the battery capacity prediction device 1100 as a whole. The processor 1101 can be a processor CPU, a graphics processor GPU, a network processor (Network Processor, NP), etc., and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.
[0099] In an embodiment of the present application, the processor 1101 in the battery capacity prediction device 1100 will load the instructions corresponding to the processes of one or more applications into the memory 1102 according to the following steps, and the processor 1101 will run the application stored in the memory 1102 to implement various functions. The specific implementation can be found in the previous embodiments and will not be repeated here.
[0100] Optional, such as Figure 4 As shown, the battery capacity prediction device 1100 also includes: a touch screen 1103, a radio frequency circuit 1104, an audio circuit 1105, an input unit 1106 and a power supply 1107. Among them, the processor 1101 is electrically connected to the touch screen 1103, the radio frequency circuit 1104, the audio circuit 1105, the input unit 1106 and the power supply 1107 respectively. Those skilled in the art can understand that Figure 4 The battery capacity prediction device structure shown in the figure does not constitute a limitation on the battery capacity prediction device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0101] The touch display screen 1103 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 1103 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the battery capacity prediction device, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-EmittingDiode), etc. The touch panel can be used to collect the user's touch operation on or near it (such as the user uses any suitable object or accessory such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 1101, and can receive the command sent by the processor 1101 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 1101 to determine the type of touch event, and then the processor 1101 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 1103 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 1103 can also be used as a part of the input unit 1106 to realize the input function.
[0102] The RF circuit 1104 may be used to send and receive RF signals, so as to establish wireless communication with a network device or other battery capacity prediction devices through wireless communication, and to send and receive signals between the network device or other battery capacity prediction devices.
[0103] The audio circuit 1105 can be used to provide an audio interface between the user and the battery capacity prediction device through a speaker and a microphone. The audio circuit 1105 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 1105 and converted into audio data, and then the audio data is output to the processor 1101 for processing, and then sent to another battery capacity prediction device through the radio frequency circuit 1104, or the audio data is output to the memory 1102 for further processing. The audio circuit 1105 may also include an earplug jack to provide communication between an external headset and the battery capacity prediction device.
[0104] The input unit 1106 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0105] The power supply 1107 is used to supply power to various components of the battery capacity prediction device 1100. Optionally, the power supply 1107 can be logically connected to the processor 1101 through a power management device, so as to manage charging, discharging, and power consumption management through the power management device. The power supply 1107 can also include one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0106] although Figure 4 Not shown, the battery capacity prediction device 1100 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0107] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0108] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0109] To this end, the embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute any battery capacity prediction method provided in the embodiment of the present application. The computer program can execute the battery capacity prediction method, and the specific implementation can refer to the previous embodiment, which will not be repeated here.
[0110] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0111] Since the computer program stored in the computer-readable storage medium can execute any of the battery capacity prediction methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any of the battery capacity prediction methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0112] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. The processor of the battery capacity prediction device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the battery capacity prediction device performs the methods provided in various optional implementations in the above-mentioned embodiments.
[0113] In the above-mentioned battery capacity prediction device, computer-readable storage medium, battery capacity prediction equipment, and computer program product embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the battery capacity prediction device, computer-readable storage medium, computer program product, battery capacity prediction equipment and its corresponding units described above can refer to the description of the battery capacity prediction method in the above embodiment, and will not be repeated here.
[0114] The above is a detailed introduction to a battery capacity prediction method, device, computer-readable storage medium and computer program product provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A battery capacity prediction method, characterized in that: The battery capacity prediction method comprises: Obtaining battery process information of a target battery, wherein the battery process data includes battery charging information, battery discharging information, and battery core pack weight; Performing feature analysis on the battery process information to determine battery charge and discharge feature information; Inputting the battery charge and discharge characteristic information into a first prediction model to obtain a first reference prediction capacity; The first reference battery predicted capacity and the battery charge and discharge characteristic information are input into a second prediction model to obtain a target predicted capacity.
2. The battery capacity prediction method according to claim 1, characterized in that: The battery charge and discharge characteristic information includes a charge and discharge ratio, a temperature change rate, and a voltage change rate. The characteristic analysis of the battery process information to determine the battery charge and discharge characteristic information includes: extracting a battery charging capacity, a battery charging temperature and a battery charging voltage from the battery charging information, and extracting a battery discharging capacity, a battery discharging temperature and a battery discharging voltage from the battery discharging information; Determining the charge-discharge ratio according to the battery charge capacity, the battery discharge capacity and the battery core pack weight; Determining the temperature change rate according to the battery charging temperature, the battery discharging temperature and the battery core pack weight; The voltage change rate is determined according to the battery charging voltage, the battery discharging voltage and the battery core pack weight.
3. The battery capacity prediction method according to claim 2, characterized in that: The step of inputting the battery charge and discharge characteristic information into a first prediction model to obtain a first reference predicted capacity includes: Processing the charge-discharge ratio, the temperature change rate, and the voltage change rate through the first prediction model to obtain a first predicted capacity, a second predicted capacity, and a third predicted capacity, respectively; A calculation process is performed based on the first predicted capacity, the second predicted capacity, and the third predicted capacity to determine a first reference predicted capacity.
4. The battery capacity prediction method according to claim 1, characterized in that: The step of inputting the first reference battery predicted capacity and the battery charge and discharge characteristic information into a second prediction model to obtain a target predicted capacity includes: Processing the first reference battery predicted capacity, the charge and discharge ratio, the temperature change rate, and the voltage change rate by the second prediction model based on a preset weight and a preset bias to obtain a fourth predicted capacity; A target predicted capacity is determined by performing calculations based on the fourth predicted capacity and the first reference predicted capacity.
5. The battery capacity prediction method according to any one of claims 1 to 4, characterized in that: Before inputting the battery charge and discharge characteristic information into a first prediction model to obtain a first reference predicted capacity, the method includes: Obtaining sample battery process information and sample battery real capacity, wherein the sample battery process data includes sample battery charging information, sample battery discharging information and sample battery core pack weight; According to the sample battery process information and the actual capacity of the sample battery, a first model is trained to obtain a first prediction model, wherein the first model includes at least one of a random forest model, a gradient boosting machine model, and a relevance vector machine model; Before inputting the first reference battery predicted capacity and the battery charge and discharge characteristic information into a second prediction model to obtain a target predicted capacity, the method includes: Processing the sample battery process information by a first prediction model to obtain a second reference prediction capacity; According to the sample battery process information, the sample battery actual capacity and the second reference predicted capacity, the second model is trained to obtain a second prediction model, wherein the second model includes at least one of a multilayer perceptron model, a long short-term memory model and a genetic algorithm model.
6. The battery capacity prediction method according to claim 5, characterized in that: The step of training the first model according to the sample battery process information and the actual capacity of the sample battery to obtain the first prediction model includes: Dividing the sample battery process information and the sample battery actual capacity into a first training set and a second training set; Performing hyperparameter tuning on the first model based on the first training set to determine target hyperparameters of the first model, wherein the root mean square deviation and mean absolute error corresponding to the target hyperparameters are less than a preset threshold; Based on the second training set, a first model for determining the target hyperparameter is trained to obtain a first prediction model.
7. The battery capacity prediction method according to claim 5, characterized in that: After training the second model to obtain the second prediction model according to the sample battery process information, the sample battery actual capacity and the second reference predicted capacity, the method includes: According to a preset distribution rule, the number of random forest models that have completed training, the number of gradient boosting machine models that have completed training, and the number of related vector machine models that have completed training included in the first prediction model are set; Predicting the sample battery process information based on the first prediction model and the second prediction model to obtain a fifth predicted capacity; Until the difference between the fifth predicted capacity and the actual capacity of the sample battery is less than a preset error, the number of trained random forest models, the number of trained gradient boosting machine models, and the number of trained related vector machine models included in the first prediction model are determined.
8. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the battery capacity prediction method as described in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the battery capacity prediction method according to any one of claims 1 to 7.
