XGboost model-based lithium ion battery state of charge estimation

文档序号:1002294 发布日期:2020-10-23 浏览:28次 中文

阅读说明:本技术 基于XGboost模型的锂离子电池荷电状态估算 (XGboost model-based lithium ion battery state of charge estimation ) 是由 宋树祥 潘凯 费陈 夏海英 于 2020-07-17 设计创作,主要内容包括:本发明涉及锂离子电池预测领域,是基于XGboost模型的锂离子电池荷电状态估算,包括以下步骤:将锂离子电池放电的数据划分为训练数据集和测试数据集,将训练数据集数据集中的电压、电流、温度作为特征输入XGBoost模型;设置XGBoost模型的参数;利用XGBoost模型对训练数据集进行训练;判定训练数据集的预测SOC与训练数据集真实的SOC误差,若误差最小,设置的XGBoost模型参数为最优参数;并将测试数据集中的电压、电流、温度作为特征输入XGBoost模型,利用得到XGBoost模型的最优参数对测试数据集进行预测,获得测试数据的预测SOC;提高估算精度和鲁棒性。(The invention relates to the field of lithium ion battery prediction, in particular to a lithium ion battery charge state estimation based on an XGboost model, which comprises the following steps: dividing the discharge data of the lithium ion battery into a training data set and a testing data set, and inputting the voltage, the current and the temperature in the training data set as characteristics into an XGboost model; setting parameters of the XGboost model; training a training data set by using an XGboost model; judging the error between the predicted SOC of the training data set and the real SOC of the training data set, and if the error is minimum, setting the XGboost model parameter as an optimal parameter; inputting the voltage, the current and the temperature in the test data set into the XGboost model as characteristics, predicting the test data set by using the optimal parameters of the XGboost model, and obtaining the predicted SOC of the test data; and the estimation precision and robustness are improved.)

1. The XGBoost model-based lithium ion battery state of charge estimation is characterized by comprising the following steps of:

step A, data preprocessing: dividing the discharge data of the lithium ion battery into a training data set and a testing data set to obtain the real SOC of the training data set, and inputting the voltage, the current and the temperature in the training data set as characteristics into an XGboost model;

b, setting XGboost model parameters: setting parameters of the XGboost model;

step C, training an XGboost model: training the training data set by using the XGboost model to obtain a prediction SOC of the training data set;

step D, outputting optimal parameters: judging the error between the predicted SOC of the training data set and the real SOC of the training data set, if the error is not the minimum, returning to the step B to reset all parameters, then performing the step C to train the training data set by using an XGboost model, and fitting the predicted SOC of the training data set again; if the error is minimum, the set XGboost model parameter is the optimal parameter;

step E, testing the XGboost model: and inputting the voltage, the current and the temperature in the test data set into the XGboost model as characteristics, predicting the test data set by using the optimal parameters of the XGboost model, and obtaining the predicted SOC of the test data.

2. The XGboost model-based lithium ion battery state of charge estimation according to claim 1, wherein the lithium ion battery discharge data is derived from the charge and discharge data of the lithium ion battery at steady state in the NASA Ames research center.

3. The XGboost model-based lithium ion battery state of charge estimation of claim 1, wherein the training dataset is a 9 th to 14 th set of discharge datasets from a B0006 dataset of lithium ion batteries at 1C discharge rate; the test data set is the discharge data set of the 15 th group in the lithium ion battery B0006 data set under the discharge rate of 1C.

4. The XGboost model-based lithium ion battery state of charge estimation of claim 1, wherein the training dataset is a 2C discharge rate lithium ion battery B0029 dataset comprising groups 8 through 12 discharge datasets; the test data set is a discharge data set of the 13 th group in the lithium ion battery B0029 data set under the 2C discharge rate.

5. The XGboost model-based state of charge estimation for lithium ion batteries according to claim 1, wherein the true SOC is obtained by:

Figure FDA0002588764000000021

wherein, the residual capacity is the capacity of the lithium ion battery when the voltage of the lithium ion battery reaches 4.2 in a constant current mode of 1.5A, the lithium ion battery is continuously charged under a constant voltage level of 4.2 until the current is reduced to 2A, and the lithium ion battery is discharged under a constant current of 2A until the voltage is reduced to 2.7V;

the rated capacity is the capacity when the lithium ion battery is continuously charged to the current reduced to 2A at the 4.2 constant voltage level after reaching the 4.2 voltage in the 1.5A constant current mode.

6. The XGboost model-based state of charge estimation for lithium ion batteries according to claim 1, wherein the voltage, current and temperature are actual voltages, currents and temperatures during steady-state discharge of the lithium ion batteries.

7. The XGboost model-based state of charge estimation for lithium ion batteries according to claim 1, wherein setting the parameters of the XGboost model comprises:

eta represents the learning rate;

max _ depth represents the maximum depth of the tree in the model;

min _ child _ weight represents the smallest sum of leaf weights in the model;

seed represents a random seed number;

colsample _ byte represents the column number ratio of random sampling of each tree;

gamma represents a punishment item and a leaf node combination item;

max _ leaf _ nodes represents the number of leaf nodes on the tree;

the n _ tree represents the number of trees in the model.

8. The XGboost model-based state of charge estimation for lithium ion batteries according to claim 1, wherein the XGboost model is used to obtain the predicted SOC by the following steps:

d1 modeling tree

Wherein the content of the first and second substances,is the predicted value of the model in the t-th round;

d2 constructing an objective function

Wherein the content of the first and second substances,

Figure FDA0002588764000000034

Figure FDA0002588764000000036

The regularization term is:

wherein T represents the number of leaf nodes, W represents the fraction of the leaf nodes, gamma can control the number of the leaf nodes, and gamma can control the fraction of the leaf nodes;

d3 training objective function

And (3) performing second-order Taylor expansion on the target function:

Figure FDA0002588764000000041

wherein, giAnd hiIs defined as:

Figure FDA0002588764000000042

removing the constant term to obtain the objective function of the t step:

Figure FDA0002588764000000043

the new objective function may be defined as:

Figure FDA0002588764000000044

wherein the content of the first and second substances,

the optimal weight of leaf node j can be calculated

Figure FDA0002588764000000046

Figure FDA0002588764000000047

Optimal objective function solution obj(*)

Since it is not possible to enumerate the structure q of all possible trees, instead branches are iteratively added to the trees using a greedy algorithm, calculating the corresponding gains:

Figure FDA0002588764000000049

Technical Field

The invention relates to the field of lithium ion battery prediction, in particular to XGboost model-based lithium ion battery state of charge estimation.

Background

The lithium ion battery has high efficiency, long service life, large capacity, no memory effect and environmental friendliness, and is widely applied to new energy electric vehicles. Moreover, the lithium ion battery is widely used in high-tech products such as mobile phones, various portable information processing terminals, and the like, but the service life of the lithium ion battery is closely related to the use and popularization of the lithium ion battery. State of charge (SOC) is a crucial indicator of a lithium ion battery, and it represents the remaining capacity of the battery in the current state. The SOC estimation of the high-precision lithium ion battery can avoid overcharge, overdischarge and overheating of the battery, so that the service life of the battery is prolonged, but the charge and discharge process of the lithium ion battery is an extremely complex electrochemical reaction process, has nonlinearity and time-varying property and is extremely sensitive to temperature and aging. Therefore, it appears to be extremely difficult to accurately and robustly estimate the SOC of a lithium ion battery.

In order to solve the problems, a coulomb counting method, an open-circuit voltage method, a Kalman filtering method, an internal resistance method and the like are adopted for SOC estimation of the lithium ion battery at present. The coulomb counting method is an original method and has the advantages of simplicity and reliability, but the method depends on an initial charge state, changes of factors such as temperature and internal resistance in the battery in the charge-discharge process are easy to ignore, and initial errors and accumulated error effects exist. The open circuit voltage method has accurate estimation result and is easy to operate, but the method necessarily requires the battery to stop working for several hours or even dozens of hours, and the SOC cannot be easily estimated on line. The kalman filter method has been widely used for SOC estimation, but its estimation result is not ideal due to temperature variation during charge and discharge and high nonlinearity of the battery system. The internal resistance method is not widely used because the relationship between the internal resistance and the SOC cannot be established due to the difficulty in measuring the internal resistance of the battery.

Disclosure of Invention

The technical problem to be solved by the invention is to provide a lithium ion battery charge state prediction method based on an XGboost (extreme gradient boosting) model, which solves the problems of nonlinearity, time-varying property, extreme sensitivity to temperature and aging and the like of a lithium ion battery in the prediction process, and also solves the problems of low prediction precision and the like. XGboost performs second-order Taylor expansion on the target function, and can support a user-defined cost function; the XGboost blocks and sequences each feature, so that calculation can be performed in a parallelization mode when an optimal division point is found, meanwhile, the CPU cache is fully utilized for reading acceleration by setting the reasonable block size, and the data reading speed is higher.

In order to solve the technical problems, the technical scheme adopted by the invention is as follows: a lithium ion charge state prediction method based on XGboost includes the steps of firstly selecting discharge data of a lithium ion battery from a NASA Ames research center, conducting data preprocessing on the discharge data, calculating out a real SOC, inputting the voltage, the current and the temperature in a data set as characteristics to describe the discharge process of the lithium ion battery, then dividing the data set into a training data set and a testing data set, setting parameters of the XGboost, training an XGboost model by the training data set until optimal parameters are output, finishing training, and finally predicting the data of the testing set by the optimal parameters of the model. The specific technical content is as follows.

The XGBoost model-based lithium ion battery state of charge estimation comprises the following steps:

step A, data preprocessing: dividing the discharge data of the lithium ion battery into a training data set and a testing data set to obtain the true SOC of the training data set, and inputting the voltage, the current and the temperature in the training data set as characteristics into an XGboost model to describe the discharge process of the lithium ion battery;

b, setting XGboost model parameters: setting parameters of the XGboost model;

step C, training an XGboost model: training the training data set by using the XGboost model to obtain a prediction SOC of the training data set;

step D, outputting optimal parameters: judging the error between the predicted SOC of the training data set and the real SOC of the training data set, if the error is not the minimum, returning to the step B to reset all parameters, then performing the step C to train the training data set by using an XGboost model, and fitting the predicted SOC of the training data set again; if the error is minimum, the set XGboost model parameter is the optimal parameter;

step E, testing the XGboost model: and inputting the voltage, the current and the temperature in the test data set into the XGboost model as characteristics, predicting the test data set by using the optimal parameters of the XGboost model, and obtaining the predicted SOC of the test data.

Further, the discharge data of the lithium ion battery adopts charge and discharge data of the lithium ion battery under a steady state of NASA Ames research center, and 5 groups of the discharge data of the lithium ion battery are B0005, B0006, B0007, B0018, B0029 and the like.

Further, the training data set is a discharge data set from the 9 th group to the 14 th group in the lithium ion battery B0006 data set under the discharge rate of 1C; the test data set is the discharge data set of the 15 th group in the lithium ion battery B0006 data set under the discharge rate of 1C.

Further, the training data set is a discharge data set from group 8 to group 12 in a lithium ion battery B0029 data set at a 2C discharge rate; the test data set is a discharge data set of the 13 th group in the lithium ion battery B0029 data set under the 2C discharge rate.

Further, the true SOC is obtained by:

Figure BDA0002588765010000041

wherein, the residual capacity is the capacity of the lithium ion battery when the voltage of the lithium ion battery reaches 4.2 in a constant current mode of 1.5A, the lithium ion battery is continuously charged under a constant voltage level of 4.2 until the current is reduced to 2A, and the lithium ion battery is discharged under a constant current of 2A until the voltage is reduced to 2.7V;

the rated capacity is the capacity when the lithium ion battery is continuously charged to the current reduced to 2A at the 4.2 constant voltage level after reaching the 4.2 voltage in the 1.5A constant current mode.

Further, the voltage, the current and the temperature are the real voltage, the current and the temperature in the steady-state discharge process of the lithium ion battery.

Further, setting parameters of the XGBoost model includes:

eta represents the learning rate;

max _ depth represents the maximum depth of the tree in the model;

min _ child _ weight represents the smallest sum of leaf weights in the model;

seed represents a random seed number;

colsample _ byte represents the column number ratio of random sampling of each tree;

gamma represents a punishment item and a leaf node combination item;

max _ leaf _ nodes represents the number of leaf nodes on the tree;

the n _ tree represents the number of trees in the model.

Further, the specific steps of obtaining the predicted SOC by using the XGBoost model are as follows:

d1 modeling tree

Figure BDA0002588765010000051

Wherein the content of the first and second substances,is the predicted value of the model in the t-th round;

d2 constructing an objective function

Wherein the content of the first and second substances,as a loss function, yiThe actual value is represented by the value of,indicating the predicted value.

The regularization term is:

wherein T represents the number of leaf nodes, W represents the fraction of the leaf nodes, gamma can control the number of the leaf nodes, and gamma can control the fraction of the leaf nodes;

d3 training objective function

And (3) performing second-order Taylor expansion on the target function:

wherein, giAnd hiIs defined as:

removing the constant term to obtain the objective function of the t step:

Figure BDA0002588765010000063

the new objective function may be defined as:

wherein the content of the first and second substances,

the optimal weight of leaf node j can be calculated

Figure BDA0002588765010000066

Figure BDA0002588765010000067

Optimal objective function solution obj(*)

Since it is not possible to enumerate the structure q of all possible trees, instead branches are iteratively added to the trees using a greedy algorithm, calculating the corresponding gains:

and finishing the prediction training of the charge state of the lithium ion battery based on the XGboost model.

Due to the adoption of the scheme, the technical progress achieved by the invention is as follows:

1. according to the XGboost-based lithium ion charge state prediction method provided by the invention, the problems that the charge and discharge process of a lithium ion battery of the lithium ion battery is an extremely complex electrochemical reaction process, has nonlinearity and time-varying property, is extremely sensitive to temperature and aging, is difficult to predict the charge state, has low prediction precision and the like are fully considered, the voltage, the current and the temperature are taken as characteristic inputs to describe the discharge process of the lithium ion battery, the SOC is taken as an output, an XGboost model is established, and the problems that the lithium ion battery is nonlinear and time-varying property, is extremely sensitive to temperature and aging and the like in the prediction process are solved. Meanwhile, the estimation precision and robustness are improved;

2. according to the XGboost-based lithium ion charge state prediction method provided by the invention, a regular term is added in each iteration of a target function, so that the complexity of a model is controlled and overfitting is prevented. XGboost performs second-order Taylor expansion on the target function, and can support a user-defined cost function; the XGboost blocks and sequences each feature, so that calculation can be performed in a parallelization mode when an optimal division point is found, meanwhile, the CPU cache is fully utilized for reading acceleration by setting the reasonable block size, and the data reading speed is higher.

Drawings

FIG. 1 is a flow chart of a system for predicting the state of charge of lithium ions by an XGboost model according to the present invention;

FIG. 2 is a graph of discharge data for algorithm examples 1 and 2 of the XGboost-based lithium ion state of charge prediction method of the present invention;

FIG. 3 is an algorithm flow chart of the lithium ion state of charge prediction method based on XGboost.

Detailed Description

The present invention will be described in further detail with reference to examples.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种电池储能电站巡检机器人

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类