Method for predicting state of charge of vehicle battery, electronic equipment and storage medium
By obtaining multiple sets of battery parameters and using genetic algorithms to optimize prediction model parameters, the problem of low accuracy and slow training speed of battery state-of-charge estimation methods is solved, and high-precision and fast state-of-charge prediction is achieved.
Patent Information
- Application Number
- CN202410787596.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-08-30
AI Technical Summary
Existing battery state-of-charge estimation methods have low accuracy and slow training speed, and cannot meet the needs of high-precision and fast prediction.
By obtaining multiple sets of battery parameters of the sample vehicle battery, the genetic algorithm is used to optimize the parameters of the prediction model to accelerate the training process and improve the adaptability and generalization ability of the model.
It improves the accuracy of battery state-of-charge estimation and speeds up training, making the model more adaptable and generalizable to meet the needs of high-precision and fast prediction.
Smart Images

Figure CN118566756A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery state of charge estimation, and in particular to a method for predicting the state of charge of a vehicle battery, an electronic device and a storage medium. Background Art
[0002] As a battery system for new energy powertrains, it is of great significance to accurately estimate the battery state of charge (SOC). SOC represents the percentage of the remaining available power of the battery to the total capacity, and provides an important basis for the high-voltage power control, charge and discharge control, battery life evaluation, vehicle energy management and other functions of electric vehicles. Therefore, it is of great significance to estimate SOC with high precision.
[0003] There are many methods for estimating SOC, including ampere-hour integration method, open circuit voltage method, internal resistance method, Kalman filter method, neural network method, etc. However, the estimation accuracy of ampere-hour integration method, open circuit voltage method, internal resistance method, and Kalman filter method is not high, and the training speed of neural network method is slow. Therefore, it is necessary to improve the existing SOC estimation method. Summary of the invention
[0004] The present invention provides a method for predicting the state of charge of a vehicle battery, an electronic device and a storage medium, so as to accelerate the training speed of a battery state of charge prediction model and improve the training accuracy.
[0005] According to one aspect of the present invention, a method for predicting a state of charge of a vehicle battery is provided, comprising:
[0006] Acquire at least two groups of battery parameters of a sample vehicle battery, wherein each group of battery parameters includes a battery state value and a battery charge value corresponding to the battery state value;
[0007] Training the prediction model to be trained by using at least two groups of battery parameters, and optimizing the model parameters of the prediction model to be trained by using a genetic algorithm during the training process, so as to obtain a target prediction model at the end of the training;
[0008] According to another aspect of the present invention, a device for predicting the state of charge of a vehicle battery is provided, comprising:
[0009] A battery parameter acquisition module, used to acquire at least two groups of battery parameters of a sample vehicle battery, wherein each group of battery parameters includes a battery status value and a battery charge value corresponding to the battery status value;
[0010] A prediction model determination module, used to train the prediction model to be trained using at least two groups of battery parameters, and optimize the model parameters of the prediction model to be trained using a genetic algorithm during the training process, so as to obtain a target prediction model at the end of the training;
[0011] A state of charge prediction module is used to predict the state of charge of a battery to be predicted based on the target prediction model. According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0012] at least one processor; and
[0013] a memory communicatively connected to the at least one processor; wherein,
[0014] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for predicting the vehicle battery state of charge described in any embodiment of the present invention.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for predicting the vehicle battery state of charge described in any embodiment of the present invention when executed.
[0016] The technical solution of the embodiment of the present invention is, first, to obtain at least two groups of battery parameters of the sample vehicle battery, wherein each group of the battery parameters includes a battery status value and a battery charge value corresponding to the battery status value; then, the prediction model to be trained is trained by using at least two groups of the battery parameters, and the model parameters of the prediction model to be trained are optimized by a genetic algorithm during the training process, so as to obtain a target prediction model at the end of the training; finally, the state of charge of the battery to be predicted is predicted based on the target prediction model. The technical solution of the embodiment of the present invention introduces a genetic algorithm to determine the optimal model parameters during the training process of the battery state of charge prediction model, which solves the problems of low accuracy and slow training speed of the existing battery state of charge estimation method, and realizes the acceleration of training speed and improvement of training accuracy, so that the trained model has higher adaptability and generalization ability, thereby improving the estimation accuracy of the battery state of charge.
[0017] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A flowchart of a method for predicting the state of charge of a vehicle battery provided in Embodiment 1 of the present invention;
[0020] Figure 2 A flowchart of a method for predicting the state of charge of a vehicle battery provided in Embodiment 2 of the present invention;
[0021] Figure 3 A flowchart of another method for predicting the state of charge of a vehicle battery provided in Embodiment 2 of the present invention;
[0022] Figure 4 A schematic diagram of the structure of a device for predicting the state of charge of a vehicle battery provided in Embodiment 3 of the present invention;
[0023] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] Embodiment 1
[0027] Figure 1 This is a flow chart of a method for predicting the state of charge of a vehicle battery provided in the first embodiment of the present invention. This embodiment is applicable to the case of predicting and estimating the state of charge of a vehicle battery. The method can be executed by a device for predicting the state of charge of a vehicle battery. The device can be implemented in the form of hardware and / or software and can be configured in a vehicle. Figure 1 As shown, the method includes:
[0028] S1. Obtain at least two groups of battery parameters of a sample vehicle battery.
[0029] The sample vehicle battery may be a sample battery of the same model as the battery to be predicted.
[0030] It can be understood that in order to predict the state of charge of the battery to be predicted, a sample vehicle battery of the same model as the battery to be predicted can be obtained, and then the battery parameters of the sample vehicle battery can be obtained. The corresponding neural network model is trained based on the battery parameters to obtain a neural network model that can ultimately accurately predict the state of charge of the battery to be predicted.
[0031] The number of battery parameter groups is at least two. Preferably, the number of battery parameter groups can be multiple groups, and each group of battery parameters includes a battery status value and a battery charge value corresponding to the battery status value. The battery status value refers to a parameter value related to the battery status, and the battery status value includes at least one of the battery cell voltage, the battery cell temperature and the current. The battery charge value can be a battery state of charge value corresponding to the battery status value. The battery state of charge value is a parameter that describes the ratio of the current remaining charge of the vehicle battery to the charge in its fully charged state. When SOC=0, it means that the battery has been fully discharged, that is, there is no remaining power in the battery. When SOC=1, it means that the battery is in a fully charged state, that is, the power in the battery has reached its maximum capacity.
[0032] Specifically, at least two sets of battery parameters of the sample vehicle battery can be obtained through voltage, current and other sensing devices. For example, the input parameters of one set of battery parameters are battery cell voltage 3.65V, battery cell temperature 25°C, current 10A; the output parameter is battery state of charge (SOC) 80%.
[0033] S2. Training the prediction model to be trained by using at least two groups of the battery parameters, and optimizing the model parameters of the prediction model to be trained by using a genetic algorithm during the training process, so as to obtain a target prediction model at the end of the training.
[0034] The prediction model to be trained can be understood as an untrained neural network model. The prediction model to be trained is iterated, and finally the target prediction model for predicting the vehicle state of charge can be obtained. Genetic Algorithm (GA) is an optimization search method that simulates natural selection and genetics mechanisms. Genetic algorithm is used to determine the optimal model parameters of the prediction model to be trained.
[0035] Specifically, the prediction model to be trained is trained using multiple groups of battery parameters, and the model parameters of the prediction model to be trained are optimized using a genetic algorithm during the training process, thereby determining the optimal model parameters as the model parameters of the prediction model to be trained, so as to obtain a target prediction model at the end of the training.
[0036] Based on the above scheme, the prediction model to be trained is an LSTM neural network model; wherein, the number of input layer and output layer units of the LSTM neural network model corresponds to the number of parameters, and the number of hidden layer units is twice the number of output layer units plus a preset value, and the preset value can be 1.
[0037] Specifically, an LSTM neural network model can be pre-constructed as a prediction model to be trained. For example, the prediction model to be trained has a units in the input layer, b units in the output layer, and c=2a+1 in the hidden layer. The number of units in the input layer and the output layer is determined by the number of input parameters and output parameters. In order to reduce the difficulty of convergence, the present invention adopts a single hidden layer to reduce the number of hidden layer units.
[0038] In an embodiment of the present invention, after obtaining at least two groups of battery parameters of the sample vehicle battery, it also includes: dividing the at least two groups of battery parameters into a training set and a test set based on a preset division ratio; and normalizing each group of battery parameters in the training set and the test set based on the same normalization relationship.
[0039] Specifically, after obtaining multiple groups of battery parameters of sample vehicle batteries, the multiple groups of battery parameters can be divided into a training set and a test set, and the number of groups of battery parameters in the training set and the number of groups of battery parameters in the test set can be a preset ratio, for example, the preset ratio is 7:3.
[0040] In order to ensure the accuracy of subsequent training and testing of the prediction model, each group of battery parameters in the training set and the test set can be normalized, and each group of battery parameters in the training set can be normalized by Min-Max. The formula is as follows:
[0041]
[0042] Among them, Xmax is the maximum value in the training set, and Xmin is the minimum value in the training set.
[0043] After the training set is normalized, its normalization relationship can be extracted and assigned to the test set to perform the same rule normalization on each group of battery parameters in the test set.
[0044] S3. Predicting the state of charge of the battery to be predicted based on the target prediction model.
[0045] The battery to be predicted may be a battery for which a battery state of charge value prediction is required.
[0046] In an embodiment of the present invention, the charge state prediction of the battery to be predicted based on the target prediction model may include: determining a battery state value corresponding to the battery to be predicted, inputting the battery state value into the target prediction model, and obtaining a battery charge prediction value corresponding to the battery to be predicted output by the target prediction model.
[0047] Specifically, after the vehicle battery has been used for a period of time, if the battery state of charge needs to be predicted, the sensor equipment on the vehicle can be used to obtain the battery state value corresponding to the battery to be predicted at the current time or in the historical time period, for example, the battery cell voltage value, cell temperature and current value of the battery to be predicted. The obtained battery state value is then used as the input of the target prediction model to obtain the output result of the target prediction model, which is the battery state of charge prediction value corresponding to the battery to be predicted.
[0048] The technical solution of the embodiment of the present invention is, first, to obtain at least two groups of battery parameters of the sample vehicle battery, wherein each group of the battery parameters includes a battery status value and a battery charge value corresponding to the battery status value; then, the prediction model to be trained is trained by using at least two groups of the battery parameters, and the model parameters of the prediction model to be trained are optimized by a genetic algorithm during the training process, so as to obtain a target prediction model at the end of the training; finally, the state of charge of the battery to be predicted is predicted based on the target prediction model. The technical solution of the embodiment of the present invention introduces a genetic algorithm to determine the optimal model parameters during the training process of the battery state of charge prediction model, which solves the problems of low accuracy and slow training speed of the existing battery state of charge estimation method, and realizes the acceleration of training speed and improvement of training accuracy, so that the trained model has higher adaptability and generalization ability, thereby improving the estimation accuracy of the battery state of charge.
[0049] Embodiment 2
[0050] Figure 2 This is a flow chart of a method for predicting the state of charge of a vehicle battery provided in the second embodiment of the present invention. This embodiment is a preferred embodiment of the above embodiment, and further refines the training of the prediction model to be trained and the optimization process of the model parameters. Figure 2 As shown, the method includes:
[0051] S210: Determine a value range of model parameters corresponding to the prediction model to be trained, and generate at least two groups of initial model parameters within the value range.
[0052] Among them, the value range may include the value range of the weight parameter and the threshold parameter of the prediction model to be trained; the initial model parameters include the weight parameter and the threshold parameter corresponding to the prediction model to be trained, for example, a set of initial model parameters includes a weight parameter of 0.6 and a threshold parameter of 0.4.
[0053] Specifically, we can first determine the number of weights and thresholds, for example, the number of weights = ac + bc; the number of thresholds = b + c; assign an initial value between (0, 1) to each weight and threshold; and assign initial values to other hyperparameters such as the number of iterations, learning rate (transition from a large learning rate to a small learning rate to help the model converge better).
[0054] It should be noted that the weight parameter is a parameter used to connect the input and output in the prediction model to be trained, and the threshold parameter is also called a bias term, which is used to adjust the activation level of the prediction model to be trained.
[0055] Before training the prediction model to be trained with at least two sets of battery parameters, it is necessary to randomly generate multiple sets of initial model parameters within the value range of weight parameters and threshold parameters. The multiple sets of initial model parameter groups constitute the initial population of the genetic algorithm, and each individual in the population corresponds to each set of initial model parameters.
[0056] S220: For each group of the initial model parameters, substitute the initial model parameters into the prediction model to be trained, and train the prediction model to be trained based on at least two groups of the battery parameters, and obtain a candidate prediction model corresponding to the initial model parameters at the end of the training.
[0057] It is understandable that, based on the generation of multiple groups of initial model parameters, each group of initial model parameters can be substituted into a corresponding prediction model to be trained. Exemplarily, if there are five groups of initial model parameters, five prediction models to be trained are prepared in advance, and the initial model parameters are further substituted into the prediction models to be trained corresponding to the group of initial model parameters, so that five prediction models to be trained with different initial model parameters can be obtained.
[0058] Furthermore, for each prediction model to be trained, it can be trained by at least two groups of battery parameters and the model parameters can be corrected, and a candidate prediction model corresponding to each prediction model to be trained can be obtained when the training iteration stops.
[0059] On the basis of the above technical solution, the prediction model to be trained is trained based on at least two groups of the battery parameters, and a candidate prediction model corresponding to the initial model parameters is obtained at the end of the training, including: inputting the battery status value of each group of the battery parameters in the training set into the prediction model to be trained to obtain the charge prediction value output by the model to be trained; based on the battery charge value and the charge prediction value corresponding to the battery parameters, correcting the initial model parameters of the prediction model to be trained to obtain the candidate prediction model.
[0060] The charge prediction value is a value indicating the battery charge state.
[0061] Specifically, the battery state values corresponding to the battery parameters in the training set are input into the prediction model to be trained to obtain the charge prediction value output by the model to be trained, and the charge prediction value is used to represent the prediction result of the battery state of charge output by the model to be trained. Then, the loss function of the prediction model to be trained is calculated based on the charge prediction value and the actual battery charge value. The initial model parameters of the prediction model to be trained are corrected based on the loss function, and it is detected whether the loss function currently reaches the convergence condition. If it is detected that the convergence condition is met, it indicates that the training of the prediction model to be trained is completed, and the iterative training can be stopped at this time. If it is detected that the convergence condition is not met at present, the prediction model to be trained can continue to be trained in sequence through the remaining multiple groups of battery parameters until the training error of the loss function reaches convergence, and the prediction model to be trained at this time can be used as a candidate prediction model.
[0062] S230: Testing the prediction error of the candidate prediction model.
[0063] The prediction error refers to the error when the candidate prediction model predicts the battery state of charge.
[0064] In this embodiment, the test of the prediction error of the candidate prediction model includes: testing the candidate prediction model through the battery status value corresponding to each group of the battery parameters in the test set to obtain the test output value of the candidate prediction model output; calculating the root mean square error based on the battery charge value of the battery parameters in the test set and the test output value, and using the root mean square error as the prediction error of the candidate prediction model.
[0065] The test output value may be a predicted value of the battery state of charge obtained by predicting the battery state value corresponding to the battery parameter in the test set by the candidate prediction model.
[0066] In order to test the prediction accuracy of each candidate prediction model, each candidate prediction model can be tested through a test set, and the battery state value corresponding to the battery parameter is input into the candidate prediction model, and the candidate prediction model can output a test output value. Further, the root mean square error is calculated based on the battery charge value corresponding to the battery parameter in the test set and the test output value, and the root mean square error is used as the prediction error of the candidate prediction model.
[0067] Specifically, the candidate prediction model (SOC i,训 ) and test output parameters (SOC i,输出 ) to obtain the root mean square error, the formula is:
[0068]
[0069] S240: Taking the prediction error of the candidate prediction model as the fitness of the initial model parameters, and updating the initial model parameters through a genetic algorithm according to the fitness of each group of the initial model parameters.
[0070] Among them, fitness can be understood as the fitness of individuals in the genetic algorithm, and each set of initial model parameters can be used as each individual.
[0071] Specifically, the prediction error of the candidate prediction model is used as the fitness of the initial model parameters, that is, new individuals are generated through a genetic algorithm according to the fitness of each individual, and better individuals are selected from the new individuals to update the original individuals, that is, new multiple groups of initial model parameters are generated to update the original initial model parameters.
[0072] In an embodiment of the present invention, the prediction error of the candidate prediction model is used as the fitness of the initial model parameters, and the initial model parameters are updated through a genetic algorithm according to the fitness of each group of the initial model parameters, including: determining a preset number of groups of model parameters to be used from at least two groups of the initial model parameters according to the fitness of each group of the initial model parameters; crossover and mutation of the preset number of group of model parameters to be used through a genetic algorithm to obtain at least two groups of target model parameters, and updating the initial model parameters based on the at least two groups of target model parameters.
[0073] The preset number of groups may be a preset number.
[0074] Specifically, the prediction error of the candidate prediction model can be used as the fitness of the initial model parameters to sort the fitness of all groups of initial model parameters. For example, if there are 10 groups of initial model parameters, 5 groups of initial model parameters with high fitness rankings are selected from the 10 groups as the model parameters to be used.
[0075] Then, the five groups of model parameters to be used are processed by a genetic algorithm. First, the five groups of initial model parameters are used as five individuals, and the five individuals are used as parents for subsequent crossover and mutation operations.
[0076] Crossover operation: Randomly select two parent individuals, exchange some of their genes (i.e., some weights and threshold parameters) according to a certain crossover strategy (such as single-point crossover, multi-point crossover, etc.) to generate new offspring individuals.
[0077] Mutation operation: Randomly mutate some genes in the newly generated offspring individuals (i.e. change the values of some weights and threshold parameters) to increase the diversity of the population.
[0078] Iterative evolution: Repeat the selection, crossover and mutation operations to generate a new population. That is, generate at least two sets of target model parameters, such as generating 5 sets of target model parameters.
[0079] Furthermore, the initial model parameters are updated based on at least two sets of target model parameters, that is, the original initial model parameters are replaced, and then the new initial model parameters are substituted into the new prediction model to be trained, and a new candidate prediction model is obtained by training, and the prediction error of the new candidate prediction model is determined.
[0080] S250, repeatedly executing the training process of the prediction model to be trained and the updating process of the initial model parameters until the number of repetitions is greater than a preset number threshold or the prediction error is less than a preset error threshold, and determining a target prediction model from the candidate prediction models.
[0081] The preset number threshold may be a preset number of repetitions, and the preset error may be a preset error value.
[0082] Specifically, the purpose of repeatedly executing the training process of the prediction model to be trained and the updating process of the initial model parameters is to determine the optimal initial model parameters through a genetic algorithm, and then the candidate prediction model constructed based on the initial model parameter training is also better, and has a higher accuracy in predicting the battery state of charge. Set a preset number threshold or a preset error threshold. When the number of repetitions exceeds the preset number threshold, it means that the number of repetitions is sufficient. In order to avoid endless repetitions to increase computing power, the repetition can be stopped. If the prediction error is less than the preset error threshold, it means that there is a candidate prediction model with a smaller prediction error, and the repetition can also be stopped.
[0083] In a preferred embodiment, determining the target prediction model from the candidate prediction models may include: taking the candidate prediction model with the smallest prediction error as the target prediction model; inputting the battery parameters of the battery to be predicted into the target prediction model to obtain the battery state of charge value output by the target prediction model.
[0084] Specifically, among all candidate prediction models, the candidate prediction model with the smallest prediction error can be selected as the target prediction model, indicating that the candidate prediction model performs best on the training data and the test data and has the smallest prediction deviation. Then, the battery parameters of the battery to be predicted are collected. The battery parameters are consistent with the parameter types used when training the prediction model to be trained. For example, the battery parameters of the battery to be predicted include at least one of the battery cell voltage, battery cell temperature and current. The battery parameters of the battery to be predicted are input into the determined target prediction model. The target prediction model is calculated based on the input battery parameters and outputs the predicted battery charge prediction value. By determining the optimal target prediction model from the candidate prediction models, it is possible to accurately predict the state of charge of the battery to be predicted.
[0085] In the embodiment of the present invention, the ability of the GA genetic algorithm to find the optimal solution globally is utilized to obtain the optimal network weight value and threshold value as the initial network weight value and threshold value of the subsequent LSTM neural network model. Compared with the traditional method of estimating SOC through neural network, it not only overcomes the defect of easily falling into the local minimum, but also can improve the estimation accuracy of SOC.
[0086] Figure 3 A flow chart of another method for predicting the state of charge of a vehicle battery provided in Example 2 of the present invention. In this embodiment of the present invention, the SOC root mean square error is used as the fitness function of the GA genetic algorithm, and the optimal solution of the weight and threshold is obtained through operations such as selection, crossover, and mutation, and is brought into the constructed LSTM neural network model as the initial value. After iteration, testing and verification, a stable neural network structure is obtained for SOC estimation.
[0087] The technical solution of the embodiment of the present invention is, first, to obtain at least two groups of battery parameters of the sample vehicle battery, wherein each group of the battery parameters includes a battery status value and a battery charge value corresponding to the battery status value; then, the prediction model to be trained is trained by using at least two groups of the battery parameters, and the model parameters of the prediction model to be trained are optimized by a genetic algorithm during the training process, so as to obtain a target prediction model at the end of the training; finally, the state of charge of the battery to be predicted is predicted based on the target prediction model. The technical solution of the embodiment of the present invention introduces a genetic algorithm to determine the optimal model parameters during the training process of the battery state of charge prediction model, which solves the problems of low accuracy and slow training speed of the existing battery state of charge estimation method, and realizes the acceleration of training speed and improvement of training accuracy, so that the trained model has higher adaptability and generalization ability, thereby improving the estimation accuracy of the battery state of charge.
[0088] Embodiment 3
[0089] Figure 4 This is a schematic diagram of the structure of a vehicle battery state of charge prediction device provided by the third embodiment of the present invention. Figure 4 As shown, the device comprises:
[0090] A battery parameter acquisition module 310 is used to acquire at least two groups of battery parameters of a sample vehicle battery, wherein each group of battery parameters includes a battery status value and a battery charge value corresponding to the battery status value;
[0091] A prediction model determination module 320, configured to train the prediction model to be trained using at least two sets of battery parameters, and to optimize the model parameters of the prediction model to be trained using a genetic algorithm during the training process, so as to obtain a target prediction model at the end of the training;
[0092] The state of charge prediction module 330 is used to predict the state of charge of the battery to be predicted based on the target prediction model.
[0093] The technical solution of the embodiment of the present invention is, first, to obtain at least two groups of battery parameters of the sample vehicle battery, wherein each group of the battery parameters includes a battery status value and a battery charge value corresponding to the battery status value; then, the prediction model to be trained is trained by using at least two groups of the battery parameters, and the model parameters of the prediction model to be trained are optimized by a genetic algorithm during the training process, so as to obtain a target prediction model at the end of the training; finally, the state of charge of the battery to be predicted is predicted based on the target prediction model. The technical solution of the embodiment of the present invention introduces a genetic algorithm to determine the optimal model parameters during the training process of the battery state of charge prediction model, which solves the problems of low accuracy and slow training speed of the existing battery state of charge estimation method, and realizes the acceleration of training speed and improvement of training accuracy, so that the trained model has higher adaptability and generalization ability, thereby improving the estimation accuracy of the battery state of charge.
[0094] Optionally, the device further includes: a model parameter initialization module, used to determine the value range of the model parameters corresponding to the prediction model to be trained before training the prediction model to be trained by using at least two groups of the battery parameters, and generate at least two groups of initial model parameters within the value range;
[0095] Among them, the initial model parameters include weight parameters and threshold parameters corresponding to the prediction model to be trained.
[0096] Optionally, the prediction model determination module 320 includes:
[0097] A training and testing submodule, for substituting the initial model parameters into the prediction model to be trained for each set of the initial model parameters, and training the prediction model to be trained based on at least two sets of the battery parameters, and obtaining a candidate prediction model corresponding to the initial model parameters at the end of the training, and testing the prediction error of the candidate prediction model;
[0098] A parameter updating submodule, used for taking the prediction error of the candidate prediction model as the fitness of the initial model parameters, and updating the initial model parameters through a genetic algorithm according to the fitness of each group of the initial model parameters;
[0099] The target model determination submodule is used to repeatedly execute the training process of the prediction model to be trained and the updating process of the initial model parameters until the number of repetitions is greater than a preset number threshold or the prediction error is less than a preset error threshold, and then determine the target prediction model from the candidate prediction models.
[0100] Optionally, the device further includes a data processing module, specifically configured to:
[0101] A data processing submodule, configured to divide the at least two groups of battery parameters of the sample vehicle battery into a training set and a test set based on a preset division ratio after obtaining the at least two groups of battery parameters of the sample vehicle battery;
[0102] Each group of the battery parameters in the training set and the test set is normalized based on the same normalization relationship.
[0103] Optionally, the training submodule includes a training unit and a testing unit;
[0104] The training unit is used to input the battery state value of each group of battery parameters in the training set into the prediction model to be trained, so as to obtain the charge prediction value output by the model to be trained;
[0105] Based on the battery charge value and the charge prediction value corresponding to the battery parameter, the initial model parameters of the prediction model to be trained are corrected to obtain the candidate prediction model.
[0106] The testing unit is used to test the candidate prediction model through the battery state value corresponding to each group of the battery parameters in the test set to obtain a test output value output by the candidate prediction model;
[0107] A root mean square error is calculated based on the battery charge value of the battery parameter in the test set and the test output value, and the root mean square error is used as the prediction error of the candidate prediction model.
[0108] Optionally, the parameter updating submodule is specifically used to: determine a preset number of groups of model parameters to be used from at least two groups of the initial model parameters according to the fitness of each group of the initial model parameters;
[0109] A preset number of groups of the model parameters to be used are crossovered and mutated by a genetic algorithm to obtain at least two groups of target model parameters, and the initial model parameters are updated based on the at least two groups of target model parameters.
[0110] Optionally, the state of charge prediction module 330 is specifically used for:
[0111] A battery state value corresponding to the battery to be predicted is determined, and the battery state value is input into the target prediction model to obtain a battery charge prediction value corresponding to the battery to be predicted output by the target prediction model.
[0112] The vehicle battery state of charge prediction device provided in the embodiment of the present invention can execute the vehicle battery state of charge prediction method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0113] Embodiment 4
[0114] Figure 5 A schematic diagram of the structure of an electronic device provided for Embodiment 4 of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0115] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0116] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0117] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for predicting the state of charge of a vehicle battery.
[0118] In some embodiments, the method for predicting the state of charge of the vehicle battery may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for predicting the state of charge of the vehicle battery described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the method for predicting the state of charge of the vehicle battery by any other appropriate means (e.g., by means of firmware).
[0119] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0120] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0121] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0122] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0123] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0124] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0125] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0126] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for predicting the state of charge of a vehicle battery, characterized in that: include: Acquire at least two groups of battery parameters of a sample vehicle battery, wherein each group of battery parameters includes a battery state value and a battery charge value corresponding to the battery state value; Training the prediction model to be trained by using at least two groups of battery parameters, and optimizing the model parameters of the prediction model to be trained by using a genetic algorithm during the training process, so as to obtain a target prediction model at the end of the training; The state of charge of the battery to be predicted is predicted based on the target prediction model.
2. The method according to claim 1, characterized in that Before training the prediction model to be trained by using at least two groups of battery parameters, the method further includes: Determine a value range of a model parameter corresponding to the prediction model to be trained, and generate at least two sets of initial model parameters within the value range; Among them, the initial model parameters include weight parameters and threshold parameters corresponding to the prediction model to be trained.
3. The method according to claim 2, characterized in that The method of training the prediction model to be trained by using at least two groups of battery parameters and optimizing the model parameters of the prediction model to be trained by using a genetic algorithm during the training process to obtain a target prediction model at the end of the training includes: For each set of the initial model parameters, substitute the initial model parameters into the prediction model to be trained, and train the prediction model to be trained based on at least two sets of the battery parameters, and obtain a candidate prediction model corresponding to the initial model parameters at the end of the training, and test the prediction error of the candidate prediction model; Taking the prediction error of the candidate prediction model as the fitness of the initial model parameters, and updating the initial model parameters by a genetic algorithm according to the fitness of each group of the initial model parameters; Repeat the training process of the prediction model to be trained and the updating process of the initial model parameters until the number of repetitions is greater than a preset number threshold or the prediction error is less than a preset error threshold, and determine the target prediction model from the candidate prediction models.
4. The method according to claim 3, characterized in that After obtaining at least two groups of battery parameters of the sample vehicle battery, the method further includes: Dividing at least two groups of the battery parameters into a training set and a test set based on a preset division ratio; Each group of the battery parameters in the training set and the test set is normalized based on the same normalization relationship.
5. The method according to claim 4, characterized in that The training of the prediction model to be trained based on at least two groups of battery parameters and obtaining a candidate prediction model corresponding to the initial model parameters at the end of the training includes: Inputting the battery state value of each group of the battery parameters in the training set into the prediction model to be trained to obtain the charge prediction value output by the model to be trained; Based on the battery charge value and the charge prediction value corresponding to the battery parameter, the initial model parameters of the prediction model to be trained are corrected to obtain the candidate prediction model.
6. The method according to claim 4, characterized in that The testing of the prediction error of the candidate prediction model comprises: Testing the candidate prediction model by using the battery state value corresponding to each group of the battery parameters in the test set to obtain a test output value output by the candidate prediction model; A root mean square error is calculated based on the battery charge value of the battery parameter in the test set and the test output value, and the root mean square error is used as the prediction error of the candidate prediction model.
7. The method according to claim 4, characterized in that The step of taking the prediction error of the candidate prediction model as the fitness of the initial model parameters and updating the initial model parameters by a genetic algorithm according to the fitness of each group of the initial model parameters comprises: Determining a preset number of groups of model parameters to be used from at least two groups of the initial model parameters according to the fitness of each group of the initial model parameters; A preset number of groups of model parameters to be used are crossovered and mutated by a genetic algorithm to obtain at least two groups of target model parameters, and the initial model parameters are updated based on the at least two groups of target model parameters.
8. The method according to claim 1, characterized in that The predicting the state of charge of the battery to be predicted based on the target prediction model includes: A battery state value corresponding to the battery to be predicted is determined, and the battery state value is input into the target prediction model to obtain a battery charge prediction value corresponding to the battery to be predicted output by the target prediction model.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method for predicting the state of charge of a vehicle battery according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for predicting the state of charge of a vehicle battery according to any one of claims 1 to 8 when executed.
Citation Information
Cited By
Charge state prediction method and device, computer equipment and storage medium
CN121232040A
