[go: up one dir, main page]

CN117538783A - A lithium-ion battery state-of-charge estimation method based on time-domain fusion converter - Google Patents

A lithium-ion battery state-of-charge estimation method based on time-domain fusion converter Download PDF

Info

Publication number
CN117538783A
CN117538783A CN202311574912.5A CN202311574912A CN117538783A CN 117538783 A CN117538783 A CN 117538783A CN 202311574912 A CN202311574912 A CN 202311574912A CN 117538783 A CN117538783 A CN 117538783A
Authority
CN
China
Prior art keywords
time
data
model
lithium
input
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311574912.5A
Other languages
Chinese (zh)
Inventor
刘勋川
韩松
贺国刚
李红磊
黄乾礼
荣娜
蓝浪
杨迪亮
姜盛
张舜
杨瀛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guizhou Jinyuan Smart Energy Co ltd
Guizhou Jinyuan Green Chain Logistics Development Co ltd
Guizhou University
Original Assignee
Guizhou Jinyuan Smart Energy Co ltd
Guizhou Jinyuan Green Chain Logistics Development Co ltd
Guizhou University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guizhou Jinyuan Smart Energy Co ltd, Guizhou Jinyuan Green Chain Logistics Development Co ltd, Guizhou University filed Critical Guizhou Jinyuan Smart Energy Co ltd
Priority to CN202311574912.5A priority Critical patent/CN117538783A/en
Publication of CN117538783A publication Critical patent/CN117538783A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/36Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
    • G01R31/385Arrangements for measuring battery or accumulator variables
    • G01R31/387Determining ampere-hour charge capacity or SoC
    • G01R31/388Determining ampere-hour charge capacity or SoC involving voltage measurements
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/36Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
    • G01R31/3644Constructional arrangements
    • G01R31/3648Constructional arrangements comprising digital calculation means, e.g. for performing an algorithm
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/36Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
    • G01R31/389Measuring internal impedance, internal conductance or related variables
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/36Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
    • G01R31/396Acquisition or processing of data for testing or for monitoring individual cells or groups of cells within a battery

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Secondary Cells (AREA)

Abstract

The invention relates to a lithium ion battery state of charge estimation method based on a time domain fusion converter, which comprises data acquisition and preprocessing; firstly, acquiring battery data in a period of time by utilizing a sliding window technology, then performing multi-step prediction by utilizing a prediction model, simultaneously establishing a correlation model between a battery state and voltage, current and temperature by utilizing a quantile regression method, then comparing a prediction result with actual data, and performing weighted average or statistical learning fusion processing to obtain a comprehensive battery state estimation result; constructing a TFT model; feature extraction and coding; estimating SOC; model training and performance evaluation, calculating an estimation error, and evaluating the accuracy and the robustness of an estimation method. The invention has the characteristics of high accuracy, robustness, real-time performance and expandability.

Description

一种基于时域融合变换器的锂离子电池荷电状态估计方法A method for estimating state of charge of lithium-ion batteries based on time-domain fusion converter

技术领域Technical Field

本发明属于锂离子电池检测技术领域,特别是涉及一种基于时域融合时域融合变换器的锂离子电池荷电状态估计方法。The present invention belongs to the technical field of lithium-ion battery detection, and in particular relates to a lithium-ion battery charge state estimation method based on a time-domain fusion converter.

背景技术Background Art

电池储能系统(BESS)由于能够提供多种电网服务,并适应可再生发电资源的变化和间歇性行为,正成为配电网的重要组成部分。但在固定电化学BESS中,由于老化和不良的工作模式不可避免地会导致性能和容量的下降。因此,电池荷电状态(SOC)是一个重要的表示电池剩余容量的参数,需要电池管理系统(BMS)连续准确跟踪,以优化电池性能,延长电池寿命。即使对于成熟的BESS技术,如锂离子电池,在广泛的运行条件下准确可靠的SOC估计也是一个挑战,只能依靠间接方法。Battery Energy Storage Systems (BESS) are becoming an essential component of distribution networks due to their ability to provide multiple grid services and adapt to the variability and intermittent behavior of renewable generation resources. However, in fixed electrochemical BESS, performance and capacity degradation is inevitable due to aging and poor operating modes. Therefore, the battery state of charge (SOC) is an important parameter that represents the remaining capacity of the battery and needs to be continuously and accurately tracked by the battery management system (BMS) to optimize battery performance and extend battery life. Even for mature BESS technologies, such as lithium-ion batteries, accurate and reliable SOC estimation under a wide range of operating conditions is a challenge and can only rely on indirect methods.

根据电池类型的不同,SOC估计方法也有所不同,可分为三种:一非基于模型或直接测量的、二基于模型的方法、三数据驱动的方法。Depending on the battery type, the SOC estimation method is different and can be divided into three types: one is non-model-based or direct measurement, two is model-based method, and three is data-driven method.

一直接测量的包括多种测量方法,如开路电压法(OCV)、安时积分法(Ah)、内阻测量法。在某些情况下,OCV方法可以提供较好的精度,但在非平衡态中面临严峻挑战。由于电池内部电解质分布均匀,电池需要很长时间才能达到平衡点,因此很难实时测量OCV。另一种测量电池荷电状态的方法是使用Ah积分,或库仑计数法,它将电池电流随时间积分,但由于初始参数值的确定、开环性质、充放电迟滞效应、电流传感器对噪声和漂移的灵敏度等方面存在误差,因此该方法也缺乏准确性。Direct measurement includes a variety of measurement methods, such as open circuit voltage (OCV), ampere-hour integration (Ah), and internal resistance measurement. In some cases, the OCV method can provide good accuracy, but it faces severe challenges in non-equilibrium states. Since the electrolyte is evenly distributed inside the battery, it takes a long time for the battery to reach the equilibrium point, so it is difficult to measure OCV in real time. Another method to measure the state of charge of the battery is to use Ah integration, or coulomb counting, which integrates the battery current over time, but due to errors in the determination of initial parameter values, open-loop properties, charge and discharge hysteresis effects, and the sensitivity of the current sensor to noise and drift, this method also lacks accuracy.

二基于模型的方法包括状态观测器和基于滤波器的方法,这取决于底层的控制原理。状态观测器方法虽然发展比较复杂,但适用于模型不确定性较高的情况。另一方面,基于滤波器的方法首先应用滤波器去噪,然后估计系统的状态,尽管基于滤波器的方法在电池模型与闭环SOC估计迭代过程中具有可靠的实时准确性和实用性,但对于复杂系统而言,其实施可能受制于滤波器处理过程中的潜在计算负担。The second model-based approach includes state observer and filter-based methods, depending on the underlying control principle. Although the state observer method is more complex to develop, it is suitable for situations with high model uncertainty. On the other hand, the filter-based method first applies a filter to denoise and then estimates the state of the system. Although the filter-based method has reliable real-time accuracy and practicality in the iterative process between the battery model and the closed-loop SOC estimation, its implementation for complex systems may be limited by the potential computational burden of the filter processing.

三数据驱动的方法基于机器学习算法,只依赖传感器测量和运行数据,而不是电池的电化学模型。考虑到电池参数、运行条件和SOC之间高度非线性的相互依赖性,可以定制机器学习算法来模拟电池参数、运行条件和SOC之间的关系。有几种类型的数据驱动技术,如支持向量回归(SVR)、神经网络(NN)。神经网络技术在锂离子电池SOC的估算中得到了广泛的应用。神经网络组进一步细分为普通神经网络、深度神经网络,如循环神经网络-长短期记忆(RNN-LSTM)模型和自监督变压器模型,深度神经网络在评估指标方面优于普通神经网络,但在计算上要求更高。The three data-driven methods are based on machine learning algorithms and rely only on sensor measurements and operating data, rather than the electrochemical model of the battery. Considering the highly nonlinear interdependence between battery parameters, operating conditions, and SOC, machine learning algorithms can be customized to simulate the relationship between battery parameters, operating conditions, and SOC. There are several types of data-driven techniques, such as support vector regression (SVR) and neural networks (NN). Neural network technology has been widely used in the estimation of lithium-ion battery SOC. The neural network group is further subdivided into ordinary neural networks, deep neural networks, such as recurrent neural network-long short-term memory (RNN-LSTM) models and self-supervised transformer models. Deep neural networks are superior to ordinary neural networks in terms of evaluation indicators, but are more computationally demanding.

目前,工业界当前普遍采用安时积分法估计荷电状态。该方法简单易实现,但是具有较强的局限性。主要在于:安时积分法模型中考虑的因子单一,缺乏反馈校正能力,随着电池使用次数增加,预估精度大幅下降。At present, the industry generally uses the ampere-hour integration method to estimate the state of charge. This method is simple and easy to implement, but it has strong limitations. The main reasons are: the factors considered in the ampere-hour integration method model are single, lacking feedback correction capabilities, and as the number of battery uses increases, the estimation accuracy drops significantly.

发明内容Summary of the invention

本发明的目的在于克服上述缺点而提供的一种高准确性、鲁棒性、实时性、可扩展性的基于时域融合变换器的锂离子电池荷电状态估计方法。The purpose of the present invention is to overcome the above disadvantages and provide a lithium-ion battery state of charge estimation method based on a time domain fusion converter with high accuracy, robustness, real-time performance and scalability.

本发明的一种基于时域融合变换器的锂离子电池荷电状态估计方法,包括以下步骤:A method for estimating the state of charge of a lithium-ion battery based on a time domain fusion converter of the present invention comprises the following steps:

步骤1:数据采集和预处理Step 1: Data acquisition and preprocessing

采集动力电池电压Vk、电流Ik和温度Tk的实时数据,并由数据采集模块进行数字化处理,在数据预处理阶段,进行噪声过滤、异常值处理,以保证数据的准确性和一致性;Collect the real-time data of the power battery voltage Vk , current Ik and temperature Tk , and digitally process them by the data acquisition module. In the data preprocessing stage, perform noise filtering and outlier processing to ensure the accuracy and consistency of the data;

步骤2:时域融合(又称时间尺度融合)Step 2: Time domain fusion (also known as time scale fusion)

首先利用滑动窗口技术获取一段时间内的电池数据,然后使用预测模型进行多步预测,同时利用分位数回归方法建立电池状态与电压、电流、温度之间的关联模型,接着,将预测结果与实际数据进行比较,并经过加权平均或统计学习融合处理,以获得综合的电池状态估计结果;First, the sliding window technology is used to obtain battery data within a period of time, and then the prediction model is used to perform multi-step predictions. At the same time, the quantile regression method is used to establish a correlation model between the battery state and voltage, current, and temperature. Then, the prediction results are compared with the actual data, and weighted average or statistical learning fusion processing is performed to obtain a comprehensive battery state estimation result;

步骤3:TFT模型构建Step 3: TFT Model Construction

基于Transformer模型的结构,构建Temporal Fusion Transformers(TFT),TFT由多个模块组成,每个模块用于学习不同时间尺度下的特征表示,模型的输入包括时域融合后的数据和其他相关信息;Based on the structure of the Transformer model, Temporal Fusion Transformers (TFT) are constructed. TFT consists of multiple modules, each of which is used to learn feature representations at different time scales. The input of the model includes the data after time domain fusion and other related information.

步骤4:特征提取和编码Step 4: Feature extraction and encoding

TFT模型通过多层注意力机制和自注意力机制,对时域融合后的数据进行特征提取和编码,这些特征包括电流的平均值、电压的波动性、温度的变化率等,编码后的特征表示能够更好地捕捉电池系统的动态特性;The TFT model uses a multi-layer attention mechanism and a self-attention mechanism to extract and encode features of the time-domain fused data. These features include the average current, voltage volatility, temperature change rate, etc. The encoded feature representation can better capture the dynamic characteristics of the battery system.

步骤5:SOC估计Step 5: SOC estimation

利用TFT模型学习到的特征表示,通过全连接层和输出层,进行锂离子电池荷电状态的估计,估计的结果为荷电状态百分比、剩余电量;Using the feature representation learned by the TFT model, the state of charge of the lithium-ion battery is estimated through the fully connected layer and the output layer. The estimated results are the state of charge percentage and the remaining power.

步骤6:模型训练和性能评估Step 6: Model training and performance evaluation

使用历史数据对TFT模型进行训练和优化,将TFT估计的SOC值与实际测量的SOC进行比较,计算估计误差;使用均方根误差(RMSE)和平均绝对误差(MAE),来评估估计方法的准确性和鲁棒性。The TFT model is trained and optimized using historical data. The SOC value estimated by TFT is compared with the actually measured SOC, and the estimation error is calculated. The root mean square error (RMSE) and mean absolute error (MAE) are used to evaluate the accuracy and robustness of the estimation method.

上述的一种基于时域融合变换器的锂离子电池荷电状态估计方法,其中:步骤1所述的数据采集,包括:The above-mentioned method for estimating the state of charge of a lithium-ion battery based on a time-domain fusion converter, wherein: the data collection described in step 1 includes:

获取锂离子电池的电流数据、电压数据和电池表面温度数据,对所述数据进行预处理,输入TFT的特征为归一化后的归一化后的电池电压V、电流I和温度T。The current data, voltage data and battery surface temperature data of the lithium-ion battery are obtained, and the data are preprocessed. The characteristics of the input TFT are the normalized battery voltage V, current I and temperature T.

上述的一种基于时域融合变换器的锂离子电池荷电状态估计方法,其中:步骤2所述的时域融合是在给定的时间序列数据集中存在唯一的SOC实际值,每一个实体i在每个时间步长t∈[0,Ti]都与一组静态协变量,即充电电流Iin,锂离子电池内阻Rin和放电深度χin相关联,依赖于时间的输入特征被细分为两类:一类是锂离子电池内阻Rin和放电深度χin,;一类是已知输入充电电流Iin,;The above-mentioned lithium-ion battery state of charge estimation method based on time domain fusion converter, wherein: the time domain fusion described in step 2 is that there is a unique SOC actual value in a given time series data set, and each entity i is associated with a set of static covariates, namely, charging current I in , lithium-ion battery internal resistance R in and discharge depth χ in at each time step t∈[0,T i ], and the time-dependent input features are subdivided into two categories: one is the lithium-ion battery internal resistance R in and discharge depth χ in ; the other is the known input charging current I in ;

采用分位数预测,对于多步预测问题的定义,可以简化成如下的公式:Using quantile forecasting, the definition of the multi-step forecasting problem can be simplified into the following formula:

式中,为在时间t下,预测未来第τ步下的分位数值q,fq(.)为预测模型,yi,t-k:t为历史目标变量,zi,t-k:t为过去可观测变量,xi,t-k:t+τ为先验已知未来的时变变量,si为静态协变量。In the formula, is the quantile value q predicted at the τth step in the future at time t, f q (.) is the prediction model, y i,tk:t is the historical target variable, z i,tk:t is the past observable variable, xi ,tk:t+τ is the a priori known time-varying variable in the future, and s i is the static covariate.

上述的一种基于时域融合变换器的锂离子电池荷电状态估计方法,其中:步骤3所述的TFT模型通过分位数损失函数来实现分位数的预测:The above-mentioned lithium-ion battery state of charge estimation method based on time domain fusion converter, wherein: the TFT model described in step 3 realizes the prediction of quantiles through the quantile loss function:

式中,Ω为包含M个样本的训练数据域,W为TFT的权值,Q为输出分位数集合(Q={0.1,0.5,0.9}),L(Ω,W)是平均单条时序且平均预测点下的分位数损失,由于几乎会一正一负,所以公式可转换为:Where Ω is the training data domain containing M samples, W is the weight of TFT, Q is the output quantile set (Q = {0.1, 0.5, 0.9}), and L(Ω, W) is the quantile loss under the average single time series and average prediction point. and There will be almost one positive and one negative, so the formula can be converted to:

拟合分位数为0.9的目标值,带入上述公式得:The fitting quantile is a target value of 0.9, and the above formula is substituted to obtain:

则会出现两种情况:There are two situations:

即模型预测偏小,Loss增加会更多;like That is, if the model prediction is too small, the loss will increase more;

即模型预测偏大,Loss增加会更少。like That is, the model prediction is too large and the loss increase will be less.

进行正则化处理,表示为:Regularization is performed, which is expressed as:

TFT的主要组成部分是:The main components of TFT are:

(1)门控残差网络(GRN),跳过架构中任何未使用的组件,提供自适应深度和网络复杂性,以适应广泛的数据集和场景;(1) Gated Residual Network (GRN), which skips any unused components in the architecture and provides adaptive depth and network complexity to accommodate a wide range of datasets and scenarios;

(2)变量选择网络(VSN),在每个时间步中选择相关的输入变量;(2) variable selection network (VSN), which selects relevant input variables at each time step;

(3)静态协变量编码器(SCE),将静态特征整合到网络中,通过编码上下文向量来调整时间动态;(3) Static Covariate Encoder (SCE), which integrates static features into the network and adjusts the temporal dynamics by encoding the context vector;

(4)时间处理,从观察到的和已知的时变输入中学习长期和短期的时间关系,局部处理采用序列-序列层,而长期依赖关系则采用一种新的可解释的多头注意块来捕获;(4) Temporal processing, which learns long-term and short-term temporal relationships from observed and known time-varying inputs. Sequence-to-sequence layers are used for local processing, while long-term dependencies are captured using a novel interpretable multi-head attention block;

(5)预测区间,通过分位数预测来确定在每个预测水平上可能的目标值的范围。(5) Prediction interval, which determines the range of possible target values at each prediction level through quantile prediction.

上述的一种基于时域融合变换器的锂离子电池荷电状态估计方法,其中:步骤4所述的特征提取和编码,首先是门控残差网络接受一个主要输入a和一个可选的上下文向量c,得到:The above-mentioned lithium-ion battery state of charge estimation method based on time domain fusion converter, wherein: the feature extraction and encoding described in step 4, first, the gated residual network accepts a main input a and an optional context vector c, and obtains:

GRNω(a,c)=LayerNorm(a+GLUω1)) (6)GRN ω (a,c)=LayerNorm(a+GLU ω1 )) (6)

η1=W1,ωη2+b1,ω (7)η 1 =W 1,ω η 2 +b 1,ω (7)

η2=ELU(W2,ωa+W3,ωc+b2,ω) (8)η 2 =ELU(W 2,ω a+W 3,ω c+b 2,ω ) (8)

式中,ELU为指数线性单位激活函数,为中间层,LayerNorm为标准层归一化,ω为表示权重的指数,当W2,ωa+W3,ωc+b2,ω>>0时,ELU激活将作为一个identity函数;当W2,ωa+W3,ωc+b2,ω<<0,ELU激活将产生一个恒定的输出,导致线性层行为;使用基于门控线性单元(GLUs)的组件门控层,以提供抑制体系结构中任何给定数据集不需要的部分的灵活性;令为输入,则GLU可表示为:Where ELU is the exponential linear unit activation function, is the middle layer, LayerNorm is the standard layer normalization, ω is the exponent representing the weight, when W 2,ω a+W 3,ω c+b 2,ω >>0, ELU activation will act as an identity function; when W 2,ω a+W 3,ω c+b 2,ω <<0, ELU activation will produce a constant output, resulting in linear layer behavior; a component gating layer based on gated linear units (GLUs) is used to provide the flexibility to suppress the unwanted parts of the architecture for any given dataset; let As input, GLU can be expressed as:

GLUω(γ)=σ(W4,ωγ+b4,ω)⊙(W5,ωγ+b5,ω) (9)GLU ω (γ)=σ(W 4,ω γ+b 4,ω )⊙(W 5,ω γ+b 5,ω ) (9)

式中,σ(.)是sigmoid激活函数,为权重,为偏差,⊙为元素的Hadamard乘积,dmodel是隐藏状态大小,GLU允许TFT控制GRN对原始输入的贡献程度在没有上下文向量的情况下,GRN简单地将上下文输入视为零,式(5)中的c=0;在训练过程中,在门控层和归一化层之前应用dropout,式(3)中的η1Where σ(.) is the sigmoid activation function, is the weight, is the bias, ⊙ is the element-wise Hadamard product, dmodel is the hidden state size, and GLU allows TFT to control the contribution of GRN to the original input. In the absence of a context vector, GRN simply treats the context input as zero, c = 0 in (5); during training, dropout is applied before the gating layer and the normalization layer, η 1 in (3);

对分类变量使用实体嵌入作为特征表示,将每个输入变量转换为(dmodel)维向量,该维向量与后续层次的维度相匹配,用于跳过连接;所有静态、过去和未来的输入都使用独立的变量选择网络;表示t时刻第j个变量的变换后的输入,是T时刻所有过去的输入的扁平向量。变量选择权是由通过GRN输入Ξt和外部上下文向量cs生成的,然后是Softmax层:Entity embeddings are used as feature representations for categorical variables. Each input variable is converted into a (dmodel)-dimensional vector that matches the dimension of subsequent layers for skip connections. Independent variable selection networks are used for all static, past, and future inputs. represents the transformed input of the j-th variable at time t, is the flattened vector of all past inputs at time T. The variable selection weights are generated by passing the GRN input Ξt and the external context vector cs , followed by a Softmax layer:

式中,是变量选择权值的向量,cs从静态协变量编码器获得;In the formula, is the vector of variable selection weights, c s is obtained from the static covariate encoder;

在每一个时间步长,附加一层非线性处理,将输入到它自己的GRN中,表示为:At each time step, an additional layer of nonlinear processing is added Input into its own GRN, represented as:

式中,是变量j的处理后的特征向量。注意到每个变量都有自己的在所有时间步t上共享权值。然后,处理后的特征按其变量选择权值进行加权,并合并,表示为:In the formula, is the processed eigenvector of variable j. Note that each variable has its own The weights are shared across all time steps t. Then, the processed features are weighted by their variable selection weights and merged, expressed as:

式中,是向量vχt的第j个元素;In the formula, is the jth element of the vector v χt ;

使用单独的GRN编码器生成四个不同的上下文向量cs,ce,cc和ch,这些联系向量被连接到时域融合解码器的各个位置,包括:A separate GRN encoder is used to generate four different context vectors cs , ce , cc , and ch . These context vectors are connected to various positions of the temporal fusion decoder, including:

(1)时间变量选择(cs);(1) Time variable selection (c s );

(2)时间特征的局部处理(cc,ch);(2) Local processing of temporal features (c c , c h );

(3)用静态信息丰富时间特征(ce);(3) enriching temporal features (c e ) with static information;

注意力机制根据关键和查询之间的关系,将值标度如下:The attention mechanism is based on the key and query The relationship between The scale is as follows:

Attention(Q,K,V)=A(Q,K)V (13)Attention(Q,K,V)=A(Q,K)V (13)

其中A(.)是一个标准化函数。一个常见的选择是缩放的点积注意力:Where A(.) is a normalization function. A common choice is the scaled dot product attention:

为了提高标准注意机制的学习能力,提出了多头注意,对不同的表示子空间采用不同的头,表示为:In order to improve the learning ability of the standard attention mechanism, multi-head attention is proposed, using different heads for different representation subspaces, expressed as:

式中,是关键、查询和值与头相关的权重,而是线性组合从所有头Hh连接起来的输出;In the formula, are the weights of the key, query, and value associated with the header, and is the linear combination of the outputs from all heads H h connected;

修改多头注意力,使每个头共享值,并对所有头进行相加聚合,表示为:Modify the multi-head attention so that each head shares the value and all heads are summed, expressed as:

式中,是所有头共享的值权重,用于最终的线性映射。In the formula, is the value weight shared by all heads, Used for the final linear mapping.

上述的一种基于时域融合变换器的锂离子电池荷电状态估计方法,其中:步骤5所述的SOC估计,用可用的SOC值估算出电池充放电期间的容量值,表示为:The above-mentioned method for estimating the state of charge of a lithium-ion battery based on a time-domain fusion converter, wherein: the SOC estimation described in step 5 uses the available SOC value to estimate the capacity value of the battery during charging and discharging, expressed as:

Edk=∫IkVkdt (20)E dk =∫I k V k dt (20)

式中,Ck是第k次循环的电池容量,Edk为同一循环的放电能量,SOCkmax,SOCkmin分别为该循环的SOC最大值和最小值;Where C k is the battery capacity of the kth cycle, Edk is the discharge energy of the same cycle, SOC kmax and SOC kmin are the maximum and minimum SOC values of the cycle respectively;

在已构建好的TFT模型将电池电压V、电流I和温度T作为未来输入,充电电流Iin为静态协变量输入,锂离子电池内阻Rin和放电深度χin,它们在每一步测量,作为未知输入,最终输入SOC。In the constructed TFT model, the battery voltage V, current I and temperature T are taken as future inputs, the charging current I in is the static covariate input, and the lithium-ion battery internal resistance R in and the discharge depth χ in , which are measured at each step, are taken as unknown inputs and finally input to SOC.

上述的一种基于时域融合变换器的锂离子电池荷电状态估计方法,其中:步骤6所述的均方根误差(RMSE)和平均绝对误差(MAE),表示为:The above-mentioned lithium-ion battery state of charge estimation method based on time domain fusion converter, wherein: the root mean square error (RMSE) and mean absolute error (MAE) described in step 6 are expressed as:

其中,N是训练样本总数,SOCk为模型在时间步长k时估计的SOC,为时间步长k时的SOC实际值。Where N is the total number of training samples, SOC k is the SOC estimated by the model at time step k, is the actual SOC value at time step k.

本发明与现有方法相比,具有明显的有益效果,从以上技术方案可知:本发明采用了多步预测并设置分位数回归,由于权重是9:1,所以训练时,模型会越来越趋向于预测出大的数字,这样Loss下降的更快,则模型的整个拟合的超平面会向上移动,这样便能很好的拟合出目标变量的90分位数值。因此具有如下优点:Compared with the existing methods, the present invention has obvious beneficial effects. From the above technical solutions, it can be seen that the present invention adopts multi-step prediction and sets quantile regression. Since the weight is 9:1, during training, the model will tend to predict larger numbers more and more, so that the Loss decreases faster, and the entire fitting hyperplane of the model will move upward, so that the 90th percentile value of the target variable can be well fitted. Therefore, it has the following advantages:

(1)高准确性:考虑到锂离子电池每一次充放电,以及单次充电不同时间段,电池内部特性都会发生微妙变化,如内阻,放电深度都会通过影响锂离子电池内部特性继而影响锂离子电池使用寿命,导致每一次估计锂离子电池的结果都会有微妙变化,从而影响锂离子电池估计精度,因此,本发明采用分时分区估计锂离子电池,设置分位数估计,从而提高了估计精度;(1) High accuracy: Considering that every time a lithium-ion battery is charged and discharged, and in different time periods of a single charge, the internal characteristics of the battery will undergo subtle changes, such as internal resistance and discharge depth, which will affect the service life of the lithium-ion battery by affecting the internal characteristics of the lithium-ion battery, resulting in subtle changes in the results of each estimation of the lithium-ion battery, thereby affecting the estimation accuracy of the lithium-ion battery. Therefore, the present invention adopts time-sharing and partitioning to estimate the lithium-ion battery and sets quantile estimation, thereby improving the estimation accuracy;

(2)鲁棒性:该方法对于不同类型的锂离子电池和工作条件具有较好的适应性和鲁棒性,能够在多种应用场景下可靠地估计荷电状态。(2) Robustness: This method has good adaptability and robustness to different types of lithium-ion batteries and working conditions, and can reliably estimate the state of charge in a variety of application scenarios.

(3)实时性:由于采用了高效的TFT网络结构,该方法能够在实时性要求较高的应用中实现快速的荷电状态估计。(3) Real-time performance: Due to the use of an efficient TFT network structure, this method can achieve fast state of charge estimation in applications with high real-time requirements.

(4)可扩展性:该方法可以与其他电池管理算法和系统集成,提供更完整的电池管理解决方案。(4) Scalability: This method can be integrated with other battery management algorithms and systems to provide a more complete battery management solution.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1本发明流程图;Fig. 1 is a flow chart of the present invention;

图2TFT模型结构图;Figure 2 TFT model structure diagram;

图3试验例中基于TFT的锂离子电池SOC估计结果图;FIG3 is a graph showing the SOC estimation results of a lithium-ion battery based on TFT in a test example;

图4试验例中基于TFT的锂离子电池SOC估计误差结果图。FIG4 is a graph showing the SOC estimation error results of a TFT-based lithium-ion battery in an experimental example.

具体实施方式DETAILED DESCRIPTION

实施例:Example:

如图1所示,一种基于时域融合变换器的锂离子电池荷电状态估计方法,包括以下步骤:As shown in FIG1 , a method for estimating the state of charge of a lithium-ion battery based on a time domain fusion converter includes the following steps:

步骤1:数据采集和预处理Step 1: Data acquisition and preprocessing

采集动力电池电压Vk、电流Ik和温度Tk等实时数据,并由数据采集模块进行数字化处理。在数据预处理阶段,进行噪声过滤、异常值处理,以保证数据的准确性和一致性。Real-time data such as power battery voltage Vk , current Ik and temperature Tk are collected and digitized by the data acquisition module. In the data preprocessing stage, noise filtering and outlier processing are performed to ensure the accuracy and consistency of the data.

具体地,Specifically,

对电池样本数据P中的电流、电压、电池表面温度三个特征数据进行Z-Score标准化,其转化函数为:The three characteristic data of current, voltage and battery surface temperature in the battery sample data P are Z-Score standardized, and the conversion function is:

其中μ是样本数据(分别为电流、电压、电池表面温度)的均值,σ是样本数据的标准差。Where μ is the mean of the sample data (current, voltage, and battery surface temperature, respectively), and σ is the standard deviation of the sample data.

将原本的二维特征数据格式的电池样本数据,构建成三维数据格式,用于作为网络的输入。三维数据格式为[time_step,input_size,batch_size],time_step表示时间步长,例如使用前6个时刻的数据预测第四个时刻,那么time_step=6。input_size表示输入特征维度,本实施例中input_size=6,表示电流、电压、电池表面温度、内阻、充电电流、放电深度三个维度。batch_size表示样本数目,即放入网络中样本的数量。The original two-dimensional feature data format of the battery sample data is constructed into a three-dimensional data format for use as the input of the network. The three-dimensional data format is [time_step, input_size, batch_size], where time_step represents the time step. For example, if the data of the first 6 moments are used to predict the fourth moment, then time_step = 6. Input_size represents the input feature dimension. In this embodiment, input_size = 6, which represents three dimensions: current, voltage, battery surface temperature, internal resistance, charging current, and discharge depth. Batch_size represents the number of samples, that is, the number of samples put into the network.

步骤2:时域融合(又称时间尺度融合)Step 2: Time domain fusion (also known as time scale fusion)

首先利用滑动窗口技术获取一段时间内的电池数据,然后使用预测模型进行多步预测,同时利用分位数回归方法建立电池状态与电压、电流、温度之间的关联模型。接着,将预测结果与实际数据进行比较,并经过加权平均或统计学习融合处理,以获得综合的电池状态估计结果。时间尺度融合主要进行多步预测、设置分位数回归、融合数据处理。First, the sliding window technology is used to obtain battery data within a period of time, and then the prediction model is used for multi-step prediction. At the same time, the quantile regression method is used to establish the correlation model between the battery state and the voltage, current, and temperature. Next, the prediction results are compared with the actual data, and the weighted average or statistical learning fusion processing is performed to obtain a comprehensive battery state estimation result. Time scale fusion mainly performs multi-step prediction, sets quantile regression, and fusion data processing.

具体地,所述的时间尺度融合是在给定的时间序列数据集中存在唯一的SOC实际值,每一个实体i在每个时间步长t∈[0,Ti]都与一组静态协变量,即充电电流Iin,锂离子电池内阻Rin和放电深度χin相关联,依赖于时间的输入特征被细分为两类:一类是锂离子电池内阻Rin和放电深度χin,它们只能在每一步测量,且事先是未知的;一类是已知输入充电电流Iin它是可以预先确定的(可以直接测出)。Specifically, the time scale fusion is that there is a unique SOC actual value in a given time series data set, and each entity i is associated with a set of static covariates, namely, the charging current I in , the lithium-ion battery internal resistance R in and the discharge depth χ in, at each time step t∈[0,T i ]. The time-dependent input features are subdivided into two categories: one is the lithium-ion battery internal resistance R in and the discharge depth χ in , which can only be measured at each step and are unknown in advance; the other is the known input charging current I in, which can be determined in advance (can be directly measured).

所述的分位数预测,对于多步预测问题的定义,可以简化成如下的公式:The definition of the quantile forecast for the multi-step forecast problem can be simplified into the following formula:

式中,为在时间t下,预测未来第τ步下的分位数值q,fq(.)为预测模型,yi,t-k:t为历史目标变量,zi,t-k:t为过去可观测,xi,t-k:t+τ为先验已知未来的时变变量,si为静态协变量。In the formula, is the quantile value q predicted at the τth step in the future at time t, f q (.) is the prediction model, y i,tk:t is the historical target variable, z i,tk:t is the past observable, xi ,tk:t+τ is the a priori known time-varying variable in the future, and s i is the static covariate.

步骤3:TFT模型构建Step 3: TFT Model Construction

基于Transformer模型的结构,构建Temporal Fusion Transformers(TFT),TFT由多个模块组成,每个模块用于学习不同时间尺度下的特征表示,模型的输入包括时域融合后的数据和其他相关信息,模型结构如图2所示。Based on the structure of the Transformer model, Temporal Fusion Transformers (TFT) is constructed. TFT consists of multiple modules, each of which is used to learn feature representations at different time scales. The input of the model includes the data after time domain fusion and other related information. The model structure is shown in Figure 2.

具体地,所述的TFT模型通过设计分位数损失函数来实现分位数的预测:Specifically, the TFT model realizes quantile prediction by designing a quantile loss function:

式中,Ω为包含M个样本的训练数据域,W为TFT的权值,Q为输出分位数集合(Q={0.1,0.5,0.9}),L(Ω,W)是平均单条时序且平均预测点下的分位数损失,由于几乎会一正一负,所以公式可转换为:Where Ω is the training data domain containing M samples, W is the weight of TFT, Q is the output quantile set (Q = {0.1, 0.5, 0.9}), and L(Ω, W) is the quantile loss under the average single time series and average prediction point. and There will be almost one positive and one negative, so the formula can be converted to:

拟合分位数为0.9的目标值,带入上述公式得:The fitting quantile is a target value of 0.9, and the above formula is substituted to obtain:

则会出现两种情况:There are two situations:

即模型预测偏小,Loss增加会更多;like That is, if the model prediction is too small, the loss will increase more;

即模型预测偏大,Loss增加会更少。like That is, the model prediction is too large and the loss increase will be less.

为了避免不同预测点下的预测量纲不一致问题,进行正则化处理,表示为:In order to avoid the problem of inconsistent prediction dimensions at different prediction points, regularization processing is performed, which is expressed as:

TFT模型设计为使用规范组件来高效地为每种输入类型(即静态、已知、观察到的输入)构建特征表示,以在广泛的问题上获得高预测性能。TFT的主要组成部分是:The TFT model is designed to use canonical components to efficiently build feature representations for each input type (i.e., static, known, observed inputs) to achieve high predictive performance on a wide range of problems. The main components of TFT are:

(1)门控残差网络(GRN),跳过架构中任何未使用的组件,提供自适应深度和网络复杂性,以适应广泛的数据集和场景;(1) Gated Residual Network (GRN), which skips any unused components in the architecture and provides adaptive depth and network complexity to accommodate a wide range of datasets and scenarios;

(2)变量选择网络(VSN),在每个时间步中选择相关的输入变量;(2) variable selection network (VSN), which selects relevant input variables at each time step;

(3)静态协变量编码器(SCE),将静态特征整合到网络中,通过编码上下文向量来调整时间动态;(3) Static Covariate Encoder (SCE), which integrates static features into the network and adjusts the temporal dynamics by encoding the context vector;

(4)时间处理,从观察到的和已知的时变输入中学习长期和短期的时间关系,局部处理采用序列-序列层,而长期依赖关系则采用一种新的可解释的多头注意块来捕获;(4) Temporal processing, which learns long-term and short-term temporal relationships from observed and known time-varying inputs. Sequence-to-sequence layers are used for local processing, while long-term dependencies are captured using a novel interpretable multi-head attention block;

(5)预测区间,通过分位数预测来确定在每个预测水平上可能的目标值的范围。(5) Prediction interval, which determines the range of possible target values at each prediction level through quantile prediction.

步骤4:模型训练与特征提取和编码Step 4: Model training, feature extraction and encoding

TFT模型通过多层注意力机制和自注意力机制,对时域融合后的数据进行特征提取和编码,这些特征包括电流的平均值、电压的波动性、温度的变化率等,编码后的特征表示能够更好地捕捉电池系统的动态特性。The TFT model uses a multi-layer attention mechanism and a self-attention mechanism to extract and encode features of the time-domain fused data. These features include the average current, voltage volatility, temperature change rate, etc. The encoded feature representation can better capture the dynamic characteristics of the battery system.

具体地,所述的特征提取和编码首先是门控残差网络接受一个主要输入a和一个可选的上下文向量c,得到:Specifically, the feature extraction and encoding is first a gated residual network accepting a main input a and an optional context vector c to obtain:

GRNω(a,c)=LayerNorm(a+GLUω1)) (7)GRN ω (a,c)=LayerNorm(a+GLU ω1 )) (7)

η1=W1,ωη2+b1,ω (8)η 1 =W 1,ω η 2 +b 1,ω (8)

η2=ELU(W2,ωa+W3,ωc+b2,ω) (9)η 2 =ELU(W 2,ω a+W 3,ω c+b 2,ω ) (9)

式中,ELU为指数线性单位激活函数,为中间层,LayerNorm为标准层归一化,ω为表示权重的指数。当W2,ωa+W3,ωc+b2,ω>>0时,ELU激活将作为一个identity函数;当W2,ωa+W3,ωc+b2,ω<<0,ELU激活将产生一个恒定的输出,导致线性层行为。使用基于门控线性单元(GLUs)的组件门控层,以提供抑制体系结构中任何给定数据集不需要的部分的灵活性。令为输入,则GLU可表示为:Where ELU is the exponential linear unit activation function, is the middle layer, LayerNorm is the standard layer normalization, and ω is the exponent representing the weight. When W 2,ω a+W 3,ω c+b 2,ω >>0, the ELU activation will act as an identity function; when W 2,ω a+W 3,ω c+b 2,ω <<0, the ELU activation will produce a constant output, resulting in linear layer behavior. A component gating layer based on gated linear units (GLUs) is used to provide the flexibility to suppress unwanted parts of the architecture for any given dataset. Let As input, GLU can be expressed as:

GLUω(γ)=σ(W4,ωγ+b4,ω)⊙(W5,ωγ+b5,ω) (10)GLU ω (γ)=σ(W 4,ω γ+b 4,ω )⊙(W 5,ω γ+b 5,ω ) (10)

式中,σ(.)是sigmoid激活函数,为权重,为偏差,⊙为元素的Hadamard乘积,dmodel是隐藏状态大小(TFT中常见的)。GLU允许TFT控制GRN对原始输入的贡献程度——如果有必要,可能会完全跳过这一层,因为GLU输出可能都接近于0,以抑制非线性贡献。在没有上下文向量的情况下,GRN简单地将上下文输入视为零,即式(5)中的c=0。在训练过程中,在门控层和归一化层之前应用dropout,即式(3)中的η1Where σ(.) is the sigmoid activation function, is the weight, is the bias, ⊙ is the element-wise Hadamard product, and dmodel is the hidden state size (common in TFT). GLU allows TFT to control how much the GRN contributes to the original input - if necessary, this layer may be skipped entirely, as GLU outputs are likely to be close to 0 to suppress nonlinear contributions. In the absence of a context vector, the GRN simply treats the context input as zero, i.e. c = 0 in (5). During training, dropout is applied before the gating layer and the normalization layer, i.e. η 1 in (3).

对分类变量使用实体嵌入作为特征表示,对连续变量使用线性转换—将每个输入变量转换为(dmodel)维向量,该维向量与后续层次的维度相匹配,用于跳过连接。所有静态、过去和未来的输入都使用了独立的变量选择网络。表示t时刻第j个变量的变换后的输入,是T时刻所有过去的输入的扁平向量。变量选择权是由通过GRN输入Ξt和外部上下文向量cs生成的,然后是Softmax层:We use entity embeddings as feature representations for categorical variables and linear transformations for continuous variables — transforming each input variable into a (dmodel)-dimensional vector that matches the dimensions of subsequent layers for skip connections. Separate variable selection networks are used for all static, past, and future inputs. represents the transformed input of the j-th variable at time t, is the flattened vector of all past inputs at time T. The variable selection weights are generated by passing the GRN input Ξt and the external context vector cs , followed by a Softmax layer:

式中,是变量选择权值的向量,cs从静态协变量编码器获得。In the formula, is the vector of variable selection weights, and cs is obtained from the static covariate encoder.

在每一个时间步长,附加一层非线性处理,将输入到它自己的GRN中,表示为:At each time step, an additional layer of nonlinear processing is added Input into its own GRN, represented as:

式中,是变量j的处理后的特征向量。注意到每个变量都有自己的在所有时间步t上共享权值。然后,处理后的特征按其变量选择权值进行加权,并合并,表示为:In the formula, is the processed eigenvector of variable j. Note that each variable has its own The weights are shared across all time steps t. Then, the processed features are weighted by their variable selection weights and merged, expressed as:

式中,是向量vχt的第j个元素。In the formula, is the j-th element of the vector v χt .

使用单独的GRN编码器生成四个不同的上下文向量cs,ce,cc,和ch。这些联系向量被连接到时域融合解码器的各个位置,其中静态变量在处理中发挥重要作用。具体来说,这包括:Four different context vectors cs , ce , cc , and ch are generated using separate GRN encoders. These context vectors are connected to various locations in the temporal fusion decoder, where static variables play an important role in the processing. Specifically, this includes:

(1)时间变量选择(cs);(1) Time variable selection (c s );

(2)时间特征的局部处理(cc,ch);(2) Local processing of temporal features (c c , c h );

(3)用静态信息丰富时间特征(ce)。(3) Enriching temporal features ( ce ) with static information.

例如,将ζ作为静态变量选择网络的输出,时域变量选择的上下文将按照进行编码。For example, taking ζ as the output of the static variable selection network, the context of temporal variable selection will be as follows to encode.

采用一种自我注意机制来学习不同时间步骤之间的长期关系,对基于变压器的架构中的多头注意进行了修改,以增强可解释性。一般来说,注意机制根据关键和查询之间的关系,将值标度如下:A self-attention mechanism is adopted to learn long-term relationships between different time steps. The multi-head attention in the transformer-based architecture is modified to enhance interpretability. In general, the attention mechanism is based on the key and query The relationship between The scale is as follows:

Attention(Q,K,V)=A(Q,K)V (14)Attention(Q,K,V)=A(Q,K)V (14)

其中A(.)是一个标准化函数。一个常见的选择是缩放的点积注意力:Where A(.) is a normalization function. A common choice is the scaled dot product attention:

为了提高标准注意机制的学习能力,提出了多头注意,对不同的表示子空间采用不同的头,表示为:In order to improve the learning ability of the standard attention mechanism, multi-head attention is proposed, using different heads for different representation subspaces, expressed as:

式中,是关键、查询和值与头相关的权重,而是线性组合从所有头Hh连接起来的输出。In the formula, are the weights of the key, query, and value associated with the header, and is the linear combination of the outputs from all heads H h connected together.

考虑到每个头部都使用不同的值,注意力权重本身并不能表明某一特定功能的重要性。因此,修改多头注意力,使每个头共享值,并对所有头进行相加聚合,表示为:Considering that each head uses different values, the attention weight alone cannot indicate the importance of a particular feature. Therefore, the multi-head attention is modified so that each head shares the value and all heads are summed, expressed as:

式中,是所有头共享的值权重,用于最终的线性映射,从式(15)可以看到每个头可以学习不同的时间模式,同时关注输入特征的公共集合,这可以被解释将注意力加权的简单集合到合并矩阵与式(11)中的A(Q,K)相比,以一种有效的方式增加了表示容量。In the formula, is the value weight shared by all heads, For the final linear mapping, it can be seen from Equation (15) that each head can learn different temporal patterns while focusing on a common set of input features, which can be interpreted as a simple collection of attention weights into the merge matrix Compared with A(Q,K) in formula (11), The representation capacity is increased in an efficient manner.

步骤5:SOC估计Step 5: SOC estimation

利用TFT模型学习到的特征表示,通过全连接层和输出层,进行锂离子电池荷电状态的估计,估计的结果为荷电状态百分比、剩余电量。The feature representation learned by the TFT model is used to estimate the state of charge of the lithium-ion battery through the fully connected layer and the output layer. The estimated results are the state of charge percentage and the remaining power.

具体地,所述的SOC估计利用可用的SOC值估算出电池充放电期间的容量值,表示为:Specifically, the SOC estimation uses the available SOC value to estimate the capacity value of the battery during charging and discharging, which is expressed as:

Edk=∫IkVkdt (21)E dk =∫I k V k dt (21)

式中,Ck是第k次循环的电池容量,Edk为同一循环的放电能量,SOCkmax,SOCkmin分别为该循环的SOC最大值和最小值。Where C k is the battery capacity of the kth cycle, Edk is the discharge energy of the same cycle, SOC kmax and SOC kmin are the maximum and minimum SOC values of the cycle, respectively.

在已构建好的TFT模型将电池电压V、电流I和温度T作为未来输入,充电电流Iin为静态协变量输入,锂离子电池内阻Rin和放电深度χin,它们只能在每一步测量,作为未知输入,最终输入SOC。In the constructed TFT model, the battery voltage V, current I and temperature T are taken as future inputs, the charging current I in is input as a static covariate, and the lithium-ion battery internal resistance R in and discharge depth χ in , which can only be measured at each step, are taken as unknown inputs and finally input into SOC.

步骤6:模型训练和性能评估Step 6: Model training and performance evaluation

为了提高估计的准确性,使用历史数据对TFT模型进行训练和优化,将TFT估计的SOC值与实际测量的SOC进行比较,计算估计误差,使用均方根误差(RMSE)和平均绝对误差(MAE),来评估估计方法的准确性和鲁棒性。In order to improve the accuracy of the estimation, the TFT model is trained and optimized using historical data. The SOC value estimated by TFT is compared with the actually measured SOC, and the estimation error is calculated. The root mean square error (RMSE) and mean absolute error (MAE) are used to evaluate the accuracy and robustness of the estimation method.

具体地,采用均方根误差(RMSE)和平均绝对误差(MAE)评估模型性能,表示为:Specifically, the root mean square error (RMSE) and mean absolute error (MAE) are used to evaluate the model performance, expressed as:

其中,N是训练样本总数,SOCk为模型在时间步长k时估计的SOC,为时间步长k时的SOC实际值。Where N is the total number of training samples, SOC k is the SOC estimated by the model at time step k, is the actual SOC value at time step k.

试验例Test example

对一块锂离子电池,标称电压为3.7V,充电截止电压为4.2V,额定容量为3000mAh,在每次充电深度为20%,即剩余电量还有600mAh,测量锂离子电池不同表面温度下的电压,电流,以及内阻值,见表1。For a lithium-ion battery, the nominal voltage is 3.7V, the charging cut-off voltage is 4.2V, the rated capacity is 3000mAh, and the charging depth is 20%, that is, the remaining power is 600mAh. The voltage, current, and internal resistance of the lithium-ion battery at different surface temperatures are measured, see Table 1.

表1不同温度下电压,电流,内阻值Table 1 Voltage, current, internal resistance at different temperatures

表面温度(℃)Surface temperature(℃) 电流(mA)Current (mA) 电压(V)Voltage (V) 放电深度(%)Discharge depth (%) 内阻(mΩ)Internal resistance(mΩ) 25℃25℃ 8080 3.4323.432 2020 8.0138.013 35℃35℃ 7979 3.3693.369 2020 8.2568.256 45℃45℃ 7575 3.3063.306 2020 8.3338.333

从表中可以看出,不同温度下的电池内阻有微妙的不同,且温度越高,内阻也随之升高,电池使用时长也不同。As can be seen from the table, the internal resistance of the battery at different temperatures is subtly different, and the higher the temperature, the higher the internal resistance, and the battery usage time is also different.

将这些变量输入构建好的TFT模型,最后输出SOC值,如图3所示,估计误差如图4所示,可以看出,分时分段输入电池数据得到的结果更精确。These variables are input into the constructed TFT model, and finally the SOC value is output, as shown in Figure 3. The estimated error is shown in Figure 4. It can be seen that the result obtained by inputting the battery data in time and segment is more accurate.

以上所述,TFT能够较佳地实现锂离子电池荷电状态的较精确估计,仅是本发明的较佳实施例而已,并非对本发明作任何形式上的限制,任何未脱离本发明技术方案内容,依据本发明的技术实质对以上实施例所作的任何简单修改、等同变化与修饰,均仍属于本发明技术方案的范围内。As described above, TFT can better realize a more accurate estimation of the state of charge of the lithium-ion battery. This is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of the technical solution of the present invention.

Claims (7)

1.一种基于时域融合变换器的锂离子电池荷电状态估计方法,包括以下步骤:1. A method for estimating the state of charge of a lithium-ion battery based on a time domain fusion converter, comprising the following steps: 步骤1:数据采集和预处理Step 1: Data acquisition and preprocessing 采集动力电池电压Vk、电流Ik和温度Tk的实时数据,并由数据采集模块进行数字化处理,在数据预处理阶段,进行噪声过滤、异常值处理,以保证数据的准确性和一致性;Collect the real-time data of the power battery voltage Vk , current Ik and temperature Tk , and digitally process them by the data acquisition module. In the data preprocessing stage, perform noise filtering and outlier processing to ensure the accuracy and consistency of the data; 步骤2:时域融合(又称时间尺度融合)Step 2: Time domain fusion (also known as time scale fusion) 首先利用滑动窗口技术获取一段时间内的电池数据,然后使用预测模型进行多步预测,同时利用分位数回归方法建立电池状态与电压、电流、温度之间的关联模型,接着,将预测结果与实际数据进行比较,并经过加权平均或统计学习融合处理,以获得综合的电池状态估计结果;First, the sliding window technology is used to obtain battery data within a period of time, and then the prediction model is used to perform multi-step predictions. At the same time, the quantile regression method is used to establish a correlation model between the battery state and voltage, current, and temperature. Then, the prediction results are compared with the actual data, and weighted average or statistical learning fusion processing is performed to obtain a comprehensive battery state estimation result; 步骤3:TFT模型构建Step 3: TFT Model Construction 基于Transformer模型的结构,构建Temporal Fusion Transformers(TFT),TFT由多个模块组成,每个模块用于学习不同时间尺度下的特征表示,模型的输入包括时域融合后的数据和其他相关信息;Based on the structure of the Transformer model, Temporal Fusion Transformers (TFT) are constructed. TFT consists of multiple modules, each of which is used to learn feature representations at different time scales. The input of the model includes the data after time domain fusion and other related information. 步骤4:特征提取和编码Step 4: Feature extraction and encoding TFT模型通过多层注意力机制和自注意力机制,对时域融合后的数据进行特征提取和编码,这些特征包括电流的平均值、电压的波动性、温度的变化率等,编码后的特征表示能够更好地捕捉电池系统的动态特性;The TFT model uses a multi-layer attention mechanism and a self-attention mechanism to extract and encode features of the time-domain fused data. These features include the average current, voltage volatility, temperature change rate, etc. The encoded feature representation can better capture the dynamic characteristics of the battery system. 步骤5:SOC估计Step 5: SOC estimation 利用TFT模型学习到的特征表示,通过全连接层和输出层,进行锂离子电池荷电状态的估计,估计的结果为荷电状态百分比、剩余电量;Using the feature representation learned by the TFT model, the state of charge of the lithium-ion battery is estimated through the fully connected layer and the output layer. The estimated results are the state of charge percentage and the remaining power. 步骤6:模型训练和性能评估Step 6: Model training and performance evaluation 使用历史数据对TFT模型进行训练和优化,将TFT估计的SOC值与实际测量的SOC进行比较,计算估计误差;使用均方根误差和平均绝对误差,来评估估计方法的准确性和鲁棒性。The TFT model is trained and optimized using historical data. The SOC value estimated by TFT is compared with the actual measured SOC, and the estimation error is calculated. The root mean square error and mean absolute error are used to evaluate the accuracy and robustness of the estimation method. 2.如权利要求1所述的一种基于时域融合变换器的锂离子电池荷电状态估计方法,其中:步骤1所述的数据采集,包括:2. A lithium-ion battery state of charge estimation method based on a time domain fusion converter as claimed in claim 1, wherein: the data collection described in step 1 includes: 获取锂离子电池的电流数据、电压数据和电池表面温度数据,对所述数据进行预处理,输入TFT的特征为归一化后的归一化后的电池电压V、电流I和温度T。The current data, voltage data and battery surface temperature data of the lithium-ion battery are obtained, and the data are preprocessed. The characteristics of the input TFT are the normalized battery voltage V, current I and temperature T. 3.如权利要求1所述的一种基于时域融合变换器的锂离子电池荷电状态估计方法,其中:步骤2所述的时域融合是在给定的时间序列数据集中存在唯一的SOC实际值,每一个实体i在每个时间步长t∈[0,Ti]都与一组静态协变量,即充电电流Iin,锂离子电池内阻Rin和放电深度χin相关联,依赖于时间的输入特征被细分为两类:一类是锂离子电池内阻Rin和放电深度χin,;一类是已知输入充电电流Iin,;3. A lithium-ion battery state of charge estimation method based on a time-domain fusion converter as claimed in claim 1, wherein: the time-domain fusion described in step 2 is that there is a unique SOC actual value in a given time series data set, and each entity i is associated with a set of static covariates, namely, charging current I in , lithium-ion battery internal resistance R in and discharge depth χ in at each time step t∈[0,T i ], and the time-dependent input features are subdivided into two categories: one is the lithium-ion battery internal resistance R in and discharge depth χ in ; the other is the known input charging current I in ; 采用分位数预测,对于多步预测问题的定义,可以简化成如下的公式:Using quantile forecasting, the definition of the multi-step forecasting problem can be simplified into the following formula: 式中,为在时间t下,预测未来第τ步下的分位数值q,fq(.)为预测模型,yi,t-k:t为历史目标变量,zi,t-k:t为过去可观测变量,xi,t-k:t+τ为先验已知未来的时变变量,si为静态协变量。In the formula, is the quantile value q predicted at the τth step in the future at time t, f q (.) is the prediction model, y i,tk:t is the historical target variable, z i,tk:t is the past observable variable, xi ,tk:t+τ is the a priori known time-varying variable in the future, and s i is the static covariate. 4.如权利要求1所述的一种基于时域融合变换器的锂离子电池荷电状态估计方法,其中:步骤3所述的TFT模型通过分位数损失函数来实现分位数的预测:4. A lithium-ion battery state of charge estimation method based on a time domain fusion converter as claimed in claim 1, wherein: the TFT model in step 3 realizes the prediction of quantiles through a quantile loss function: 式中,Ω为包含M个样本的训练数据域,W为TFT的权值,Q为输出分位数集合(Q={0.1,0.5,0.9}),L(Ω,W)是平均单条时序且平均预测点下的分位数损失,由于几乎会一正一负,所以公式可转换为:Where Ω is the training data domain containing M samples, W is the weight of TFT, Q is the output quantile set (Q = {0.1, 0.5, 0.9}), and L(Ω, W) is the quantile loss under the average single time series and average prediction point. and There will be almost one positive and one negative, so the formula can be converted to: 拟合分位数为0.9的目标值,带入上述公式得:The fitting quantile is a target value of 0.9, and the above formula is substituted to obtain: 则会出现两种情况:There are two situations: 即模型预测偏小,Loss增加会更多;like That is, if the model prediction is too small, the loss will increase more; 即模型预测偏大,Loss增加会更少;like That is, if the model prediction is too large, the increase in Loss will be less; 进行正则化处理,表示为:Regularization is performed, which is expressed as: TFT的主要组成部分是:The main components of TFT are: (1)门控残差网络(GRN),跳过架构中任何未使用的组件,提供自适应深度和网络复杂性,以适应广泛的数据集和场景;(1) Gated Residual Network (GRN), which skips any unused components in the architecture and provides adaptive depth and network complexity to accommodate a wide range of datasets and scenarios; (2)变量选择网络(VSN),在每个时间步中选择相关的输入变量;(2) variable selection network (VSN), which selects relevant input variables at each time step; (3)静态协变量编码器(SCE),将静态特征整合到网络中,通过编码上下文向量来调整时间动态;(3) Static Covariate Encoder (SCE), which integrates static features into the network and adjusts the temporal dynamics by encoding the context vector; (4)时间处理,从观察到的和已知的时变输入中学习长期和短期的时间关系,局部处理采用序列-序列层,而长期依赖关系则采用一种新的可解释的多头注意块来捕获;(4) Temporal processing, which learns long-term and short-term temporal relationships from observed and known time-varying inputs. Sequence-to-sequence layers are used for local processing, while long-term dependencies are captured using a novel interpretable multi-head attention block; (5)预测区间,通过分位数预测来确定在每个预测水平上可能的目标值的范围。(5) Prediction interval, which determines the range of possible target values at each prediction level through quantile prediction. 5.如权利要求1所述的一种基于时域融合变换器的锂离子电池荷电状态估计方法,其中:步骤4所述的特征提取和编码,首先是门控残差网络接受一个主要输入a和一个可选的上下文向量c,得到:5. A lithium-ion battery state of charge estimation method based on a time domain fusion converter as claimed in claim 1, wherein: the feature extraction and encoding described in step 4 is firstly that the gated residual network accepts a main input a and an optional context vector c to obtain: GRNω(a,c)=LayerNorm(a+GLUω1)) (6)GRN ω (a,c)=LayerNorm(a+GLU ω1 )) (6) η1=W1,ωη2+b1,ω (7)η 1 =W 1,ω η 2 +b 1,ω (7) η2=ELU(W2,ωa+W3,ωc+b2,ω) (8)η 2 =ELU(W 2,ω a+W 3,ω c+b 2,ω ) (8) 式中,ELU为指数线性单位激活函数,为中间层,LayerNorm为标准层归一化,ω为表示权重的指数,当W2,ωa+W3,ωc+b2,ω>>0时,ELU激活将作为一个identity函数;当W2,ωa+W3,ωc+b2,ω<<0,ELU激活将产生一个恒定的输出,导致线性层行为;使用基于门控线性单元(GLUs)的组件门控层,以提供抑制体系结构中任何给定数据集不需要的部分的灵活性;令为输入,则GLU可表示为:Where ELU is the exponential linear unit activation function, is the middle layer, LayerNorm is the standard layer normalization, ω is the exponent representing the weight, when W 2,ω a+W 3,ω c+b 2,ω >>0, ELU activation will act as an identity function; when W 2,ω a+W 3,ω c+b 2,ω <<0, ELU activation will produce a constant output, resulting in linear layer behavior; a component gating layer based on gated linear units (GLUs) is used to provide the flexibility to suppress the unwanted parts of the architecture for any given dataset; let As input, GLU can be expressed as: GLUω(γ)=σ(W4,ωγ+b4,ω)⊙(W5,ωγ+b5,ω) (9)GLU ω (γ)=σ(W 4,ω γ+b 4,ω )⊙(W 5,ω γ+b 5,ω ) (9) 式中,σ(.)是sigmoid激活函数,为权重,为偏差,⊙为元素的Hadamard乘积,dmodel是隐藏状态大小,GLU允许TFT控制GRN对原始输入的贡献程度在没有上下文向量的情况下,GRN简单地将上下文输入视为零,式(5)中的c=0;在训练过程中,在门控层和归一化层之前应用dropout,式(3)中的η1Where σ(.) is the sigmoid activation function, is the weight, is the bias, ⊙ is the element-wise Hadamard product, dmodel is the hidden state size, and GLU allows TFT to control the contribution of GRN to the original input. In the absence of a context vector, GRN simply treats the context input as zero, c = 0 in (5); during training, dropout is applied before the gating layer and the normalization layer, η 1 in (3); 对分类变量使用实体嵌入作为特征表示,将每个输入变量转换为(dmodel)维向量,该维向量与后续层次的维度相匹配,用于跳过连接;所有静态、过去和未来的输入都使用独立的变量选择网络;表示t时刻第j个变量的变换后的输入,是T时刻所有过去的输入的扁平向量,变量选择权是由通过GRN输入Ξt和外部上下文向量cs生成的,然后是Softmax层:Entity embeddings are used as feature representations for categorical variables. Each input variable is converted into a (dmodel)-dimensional vector that matches the dimension of subsequent layers for skip connections. Independent variable selection networks are used for all static, past, and future inputs. represents the transformed input of the j-th variable at time t, is a flattened vector of all past inputs at time T, and the variable selection weights are generated by passing the GRN input Ξt and the external context vector cs , followed by a Softmax layer: 式中,是变量选择权值的向量,cs从静态协变量编码器获得;In the formula, is the vector of variable selection weights, c s is obtained from the static covariate encoder; 在每一个时间步长,附加一层非线性处理,将输入到它自己的GRN中,表示为:At each time step, an additional layer of nonlinear processing is added Input into its own GRN, represented as: 式中,是变量j的处理后的特征向量,注意到每个变量都有自己的在所有时间步t上共享权值,然后,处理后的特征按其变量选择权值进行加权,并合并,表示为:In the formula, is the processed eigenvector of variable j. Note that each variable has its own The weights are shared across all time steps t, and then the processed features are weighted by their variable selection weights and merged, expressed as: 式中,是向量vχt的第j个元素;In the formula, is the jth element of the vector v χt ; 使用单独的GRN编码器生成四个不同的上下文向量cs,ce,cc和ch,这些联系向量被连接到时域融合解码器的各个位置,包括:A separate GRN encoder is used to generate four different context vectors cs , ce , cc , and ch . These context vectors are connected to various positions of the temporal fusion decoder, including: (1)时间变量选择(cs);(1) Time variable selection (c s ); (2)时间特征的局部处理(cc,ch);(2) Local processing of temporal features (c c , c h ); (3)用静态信息丰富时间特征(ce);(3) enriching temporal features (c e ) with static information; 注意力机制根据关键和查询之间的关系,将值标度如下:The attention mechanism is based on the key and query The relationship between The scale is as follows: Attention(Q,K,V)=A(Q,K)V (13)Attention(Q,K,V)=A(Q,K)V (13) 其中A(.)是一个标准化函数,一个常见的选择是缩放的点积注意力:Where A(.) is a normalization function, a common choice is the scaled dot-product attention: 为了提高标准注意机制的学习能力,提出了多头注意,对不同的表示子空间采用不同的头,表示为:In order to improve the learning ability of the standard attention mechanism, multi-head attention is proposed, using different heads for different representation subspaces, expressed as: 式中,是关键、查询和值与头相关的权重,而是线性组合从所有头Hh连接起来的输出;In the formula, are the weights of the key, query, and value associated with the header, and is the linear combination of the outputs from all heads H h connected; 修改多头注意力,使每个头共享值,并对所有头进行相加聚合,表示为:Modify the multi-head attention so that each head shares the value and all heads are summed, expressed as: 式中,是所有头共享的值权重,用于最终的线性映射。In the formula, is the value weight shared by all heads, Used for the final linear mapping. 6.如权利要求1所述的一种基于时域融合变换器的锂离子电池荷电状态估计方法,其中:步骤5所述的SOC估计,用可用的SOC值估算出电池充放电期间的容量值,表示为:6. A lithium-ion battery state of charge estimation method based on a time domain fusion converter as claimed in claim 1, wherein: the SOC estimation described in step 5 uses the available SOC value to estimate the capacity value of the battery during charging and discharging, expressed as: Edk=∫IkVkdt (20)E dk =∫I k V k dt (20) 式中,Ck是第k次循环的电池容量,Edk为同一循环的放电能量,SOCkmax,SOCkmin分别为该循环的SOC最大值和最小值;Where C k is the battery capacity of the kth cycle, Edk is the discharge energy of the same cycle, SOC kmax and SOC kmin are the maximum and minimum SOC values of the cycle respectively; 在已构建好的TFT模型将电池电压V、电流I和温度T作为未来输入,充电电流Iin为静态协变量输入,锂离子电池内阻Rin和放电深度χin,它们在每一步测量,作为未知输入,最终输入SOC。In the constructed TFT model, the battery voltage V, current I and temperature T are taken as future inputs, the charging current I in is the static covariate input, and the lithium-ion battery internal resistance R in and the discharge depth χ in , which are measured at each step, are taken as unknown inputs and finally input to SOC. 7.如权利要求1所述的一种基于时域融合变换器的锂离子电池荷电状态估计方法,其中:步骤6所述的均方根误差(RMSE)和平均绝对误差(MAE),表示为:7. A lithium-ion battery state of charge estimation method based on a time domain fusion converter as claimed in claim 1, wherein: the root mean square error (RMSE) and mean absolute error (MAE) described in step 6 are expressed as: 其中,N是训练样本总数,SOCk为模型在时间步长k时估计的SOC,为时间步长k时的SOC实际值。Where N is the total number of training samples, SOC k is the SOC estimated by the model at time step k, is the actual SOC value at time step k.
CN202311574912.5A 2023-11-23 2023-11-23 A lithium-ion battery state-of-charge estimation method based on time-domain fusion converter Pending CN117538783A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311574912.5A CN117538783A (en) 2023-11-23 2023-11-23 A lithium-ion battery state-of-charge estimation method based on time-domain fusion converter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311574912.5A CN117538783A (en) 2023-11-23 2023-11-23 A lithium-ion battery state-of-charge estimation method based on time-domain fusion converter

Publications (1)

Publication Number Publication Date
CN117538783A true CN117538783A (en) 2024-02-09

Family

ID=89785737

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311574912.5A Pending CN117538783A (en) 2023-11-23 2023-11-23 A lithium-ion battery state-of-charge estimation method based on time-domain fusion converter

Country Status (1)

Country Link
CN (1) CN117538783A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118483597A (en) * 2024-07-12 2024-08-13 江西科技师范大学 Sodium ion battery life detection method, system, electronic device and storage medium
CN118838484A (en) * 2024-07-15 2024-10-25 武汉攀升鼎承科技有限公司 Notebook battery endurance prediction method based on deep learning
CN119004118A (en) * 2024-10-24 2024-11-22 山东和光智慧能源科技有限公司 Thermal pipeline service life prediction method
CN119024216A (en) * 2024-10-31 2024-11-26 烟台开发区德联软件有限责任公司 A method and device for predicting the life of energy storage batteries based on improved TFT
CN119150025A (en) * 2024-11-11 2024-12-17 吉林大学 Lithium ion battery state of charge estimation method based on ensemble learning

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118483597A (en) * 2024-07-12 2024-08-13 江西科技师范大学 Sodium ion battery life detection method, system, electronic device and storage medium
CN118838484A (en) * 2024-07-15 2024-10-25 武汉攀升鼎承科技有限公司 Notebook battery endurance prediction method based on deep learning
CN119004118A (en) * 2024-10-24 2024-11-22 山东和光智慧能源科技有限公司 Thermal pipeline service life prediction method
CN119024216A (en) * 2024-10-31 2024-11-26 烟台开发区德联软件有限责任公司 A method and device for predicting the life of energy storage batteries based on improved TFT
CN119024216B (en) * 2024-10-31 2025-04-08 烟台开发区德联软件有限责任公司 Energy storage battery life prediction method and device based on improved TFT
CN119150025A (en) * 2024-11-11 2024-12-17 吉林大学 Lithium ion battery state of charge estimation method based on ensemble learning
CN119150025B (en) * 2024-11-11 2025-01-28 吉林大学 Lithium ion battery state of charge estimation method based on ensemble learning

Similar Documents

Publication Publication Date Title
CN110187290B (en) Lithium ion battery residual life prediction method based on fusion algorithm
CN117538783A (en) A lithium-ion battery state-of-charge estimation method based on time-domain fusion converter
CN113064093B (en) Method and system for jointly estimating state of charge and state of health of energy storage battery
CN108416695B (en) Power load probability density prediction method, system and medium based on deep learning
CN112051511A (en) Method and system for estimating state of health of power battery based on multi-channel technology
CN110888059A (en) An Algorithm Based on Improved Random Forest Combined Volumetric Kalman Power Battery State of Charge Estimation
CN110598854A (en) GRU model-based transformer area line loss rate prediction method
CN112380773A (en) Fuel cell degradation prediction method, device and equipment based on transfer learning
CN112557907A (en) SOC estimation method of electric vehicle lithium ion battery based on GRU-RNN
Huang et al. State of health estimation of lithium-ion batteries based on fine-tuning or rebuilding transfer learning strategies combined with new features mining
CN112130086B (en) Method and system for predicting remaining life of power battery
CN112883637A (en) Chaos time sequence nonlinear combination prediction method for lithium ion battery RUL
CN114487890A (en) An improved long short-term memory neural network for lithium battery state of health estimation method
CN112069741A (en) Fuel cell stack transient aging prediction method, device, equipment and storage medium
CN115409263A (en) A Lithium Battery Remaining Life Prediction Method Based on Gating and Attention Mechanism
CN113466710A (en) SOC and SOH collaborative estimation method for energy storage battery in receiving-end power grid containing new energy
CN116930609A (en) Electric energy metering error analysis method based on ResNet-LSTM model
Wang et al. Online state of health estimation for lithium-ion batteries based on a dual self-attention multivariate time series prediction network
CN116794547A (en) A method for predicting the remaining service life of lithium-ion batteries based on AFSA-GRU
CN116699434A (en) Fuel cell life prediction method based on impedance spectrum relaxation time distribution
CN116736133A (en) Early prediction method for capacity degradation track of lithium ion battery in full life cycle
Zhang et al. State of health estimation of lithium-ion batteries based on multiphysics features and CNN-EFC-BiLSTM
CN112014757A (en) Battery SOH estimation method integrating capacity increment analysis and genetic wavelet neural network
CN118731751A (en) Lithium battery SOH estimation method integrating attention mechanism and deep convolution
CN117826000A (en) A method for estimating the health status of lithium-ion batteries

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination