Lithium ion battery electric energy metering method and system based on data driving

By determining the influencing factors of lithium-ion battery electrical energy in the battery swap scenario, and using frequency domain channel feature extraction and training models, the accuracy and robustness of lithium-ion battery electrical energy prediction in the prior art are solved, and the accurate measurement of lithium-ion battery electrical energy and the improvement of battery swap operation capabilities are achieved.

CN120064980APending Publication Date: 2025-05-30CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +4
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411987305.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The prior art is difficult to accurately predict the electrical energy status of lithium-ion batteries in the electric swap scenario, and the traditional methods lack considerations for complex environmental factors and battery cycle life, resulting in insufficient general utility and robustness.

Method used

A data-driven lithium-ion battery electrical energy measurement method is proposed. By determining the influencing factors of battery electrical energy in the battery swap scenario, an initial electrical energy measurement model is established, and the frequency domain channel feature extraction and training model is extracted and trained to achieve accurate measurement of lithium-ion battery electrical energy.

Benefits of technology

This method can effectively and accurately predict the power state of lithium-ion batteries, improve the operational capabilities of the battery swap station, and is suitable for battery swap management in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120064980A_ABST
    Figure CN120064980A_ABST
Patent Text Reader

Abstract

The invention discloses a lithium ion battery electric energy metering method and system based on data driving, and belongs to the technical field of big mathematical analysis. The method comprises the following steps: determining influence factors of the electric energy of the lithium ion battery in a battery replacement scene; based on the influence factors and FCH-PatchTST, establishing an initial electric energy metering model of the lithium ion battery in a battery replacement scene; obtaining battery charging and discharging data of the lithium ion battery, and extracting frequency domain channel characteristics from the battery charging and discharging data to obtain the frequency domain channel characteristics; and based on the frequency domain channel characteristics, training the initial electric energy metering model to obtain an electric energy metering model, and based on the electric energy metering model, metering the electric energy of the lithium ion battery in the battery replacement scene. The method can effectively and accurately predict the electric energy of the battery, and can improve the operation capability of the battery swap station.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of big data analysis, and more specifically, to a data-driven method and system for measuring the electrical energy of lithium-ion batteries. Background Art

[0002] Nowadays, new energy vehicles are growing rapidly. In 2023, the number of new energy vehicles in China increased by 7.43 million, a year-on-year increase of 38.76%. Correspondingly, the supporting charging and swapping facilities rank first in the world. By the beginning of 2024, the number of newly added charging piles in China reached 3.386 million, and the number of swapping stations reached 1,594, a year-on-year increase of 30.6%. However, there are still great difficulties in the popularization of swapping stations. The reason is that during the prediction process of the State of Energy (SOE) of the battery, it is vulnerable to various external factors, and it is difficult to adapt to different types of batteries for swapping. It is difficult to achieve precise swapping management in actual complex environments.

[0003] The traditional method for predicting electrical energy is to convert a chaotic model into a numerically representable circuit model, and then estimate the electrical energy through various filtering algorithms. Fan established a second-order equivalent model of a lithium-ion battery and proposed an SOE estimation algorithm combining Kalman filtering and ion filtering to identify the battery offline, achieving accurate electrical energy estimation in a simulation environment. However, the offline parameter identification model can only analyze specific types of batteries and is difficult to popularize in actual swapping scenarios. Liu considered both the electrical energy state and power state of the battery, established a Thevenin equivalent model of the battery, and proposed using a recursive least squares combined extended Kalman filtering algorithm for battery state estimation. High-precision SOE can be obtained even with a large initial error. However, this method does not consider the modeling of environmental errors, such as temperature, vibration, and current disturbances, lacking generality and robustness.

[0004] When many scholars study the method for measuring the electrical energy of batteries, the commonly used methods include the power integration method and the model-based SOE measurement method. However, these methods can only analyze fixed types of batteries and do not consider the influence of complex environmental factors and battery cycle life, lacking generality and robustness, and are difficult to popularize in actual swapping scenarios.

[0005] Considering the variety of lithium-ion batteries, with inconsistent initial electrical energy states and health states, data-driven methods for establishing implicit relationship models between charge and discharge parameters and electrical energy can be divided into machine learning and deep learning. Compared with model-driven methods, machine learning models have better adaptability and flexibility, but it is difficult to learn local and global features of data from multiple dimensions, resulting in lower prediction effects.

[0006] The charging and discharging of lithium-ion batteries are usually affected by various discharge parameters, and the influencing factors are mutually coupled, which affects the estimation of charging electric energy and lifespan. Deep learning algorithms have strong data feature extraction capabilities, but existing models often have problems such as error accumulation and poor interpretability. From the above research status, it can be seen that the following problems of lithium-ion battery data are difficult to be solved simultaneously:

[0007] (1) The data dimension features are too high and the length of the time series features is inconsistent. The initial electric energy of each round of charging and discharging of the battery cannot be fixed, and the cut-off current and cut-off voltage will also decrease with the lifespan loss, and the charging and discharging duration will also show a decreasing trend. A round of charging and discharging sequence may last up to 4 hours and contain 1k to 10k samples, which will greatly increase the model response time;

[0008] (2) Under the battery swapping scenario, the charging and discharging of the battery are usually affected by various complex interferences. Since the power fluctuation cannot be completely eliminated on the AC side of the power grid, and the charging and discharging process of the battery is easily affected by factors such as temperature, vibration, and ripple current in the power grid, and the influencing factors are mutually coupled, errors will occur in battery characteristics such as the charging process, discharging process, electrothermal coupling, and lifespan. Summary of the Invention

[0009] In view of the above problems, the present invention proposes a data-driven method for measuring the electric energy of lithium-ion batteries, including:

[0010] Determine the influencing factors of the electric energy of lithium-ion batteries under the battery swapping scenario;

[0011] Based on the influencing factors and FCH-PatchTST, establish an initial electric energy measurement model for lithium-ion batteries under the battery swapping scenario;

[0012] Obtain the charging and discharging data of the lithium-ion battery, extract the frequency domain channel features from the charging and discharging data of the battery to obtain the frequency domain channel features;

[0013] Based on the frequency domain channel features, train the initial electric energy measurement model to obtain an electric energy measurement model, and based on the electric energy measurement model, measure the electric energy of the lithium-ion battery under the battery swapping scenario.

[0014] Optionally, determining the influencing factors of the electric energy of lithium-ion batteries under the battery swapping scenario includes:

[0015] Obtain the original data of various charging and discharging parameters of the lithium-ion battery under the battery swapping scenario, preprocess the original data to generate a battery influence data set, based on the battery influence data set, conduct the charging and discharging test of the lithium-ion battery, and based on the test results, determine the influencing factors of the electric energy of the lithium-ion battery under the battery swapping scenario.

[0016] Optionally, the battery charge and discharge data includes: time series data of multiple variables;

[0017] The multiple variables include: voltage, current, temperature, and time.

[0018] Optionally, extract the frequency domain channel features from the battery charge and discharge data to obtain the frequency domain channel features, including:

[0019] Establish a channel independent mechanism. Based on this channel independent mechanism, split the battery charge and discharge data to obtain charge sequence data and discharge sequence data. Independently calculate the attention between channels of each sequence data in the charge sequence data and the discharge sequence data. Based on this attention, extract the frequency domain channel features to obtain the frequency domain channel features.

[0020] Optionally, train the initial power metering model based on the EarlyStopping strategy and the Lr decay strategy to obtain the power metering model.

[0021] Optionally, the method further includes:

[0022] Evaluate the performance of the power metering model, including:

[0023] Determine the performance evaluation index, and evaluate the power metering model based on this performance evaluation index;

[0024] The performance evaluation index includes:

[0025] Mean square error, mean absolute error, and relative square error.

[0026] On the other hand, the present invention also proposes a data-driven lithium-ion battery power metering system, including:

[0027] An initial unit for determining the influencing factors of the lithium-ion battery power under the battery swapping scenario;

[0028] A model unit for establishing an initial power metering model of the lithium-ion battery under the battery swapping scenario based on the influencing factors and FCH-PatchTST;

[0029] A feature extraction unit for obtaining the battery charge and discharge data of the lithium-ion battery, and extracting the frequency domain channel features from the battery charge and discharge data to obtain the frequency domain channel features;

[0030] A metering unit for training the initial power metering model based on the frequency domain channel features to obtain the power metering model, and metering the power of the lithium-ion battery under the battery swapping scenario based on the power metering model.

[0031] Optionally, determine the influencing factors of the electric energy of lithium-ion batteries in the battery swapping scenario, including:

[0032] Obtain the original data of various charge and discharge parameters of lithium-ion batteries in the battery swapping scenario, preprocess the original data to generate a battery influence data set, and based on the battery influence data set, conduct charge and discharge tests on the lithium-ion batteries. Based on the test results, determine the influencing factors of the electric energy of lithium-ion batteries in the battery swapping scenario.

[0033] Optionally, the battery charge and discharge data includes: time series data with multiple variables;

[0034] The multiple variables include: voltage, current, temperature, and time.

[0035] Optionally, extract frequency domain channel features from the battery charge and discharge data to obtain frequency domain channel features, including:

[0036] Establish a channel independent mechanism. Based on the channel independent mechanism, split the battery charge and discharge data to obtain charge sequence data and discharge sequence data. Independently calculate the attention between channels of each sequence data in the charge sequence data and the discharge sequence data. Based on the attention, extract frequency domain channel features to obtain frequency domain channel features.

[0037] Optionally, train an initial electric energy measurement model based on the EarlyStopping strategy and the Lr decrease strategy to obtain an electric energy measurement model.

[0038] Optionally, the metering unit further includes:

[0039] Evaluate the performance of the electric energy measurement model, including:

[0040] Determine performance evaluation indicators, and evaluate the electric energy measurement model based on the performance evaluation indicators;

[0041] The performance evaluation indicators include:

[0042] Mean square error, mean absolute error, and relative square error.

[0043] On the other hand, the present invention also provides a computing device, including: one or more processors;

[0044] The processor is used to execute one or more programs;

[0045] When the one or more programs are executed by the one or more processors, the method as described above is implemented.

[0046] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed, the method described above is implemented.

[0047] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0048] The present invention provides a data-driven method for measuring the electric energy of a lithium-ion battery, including: determining the influencing factors of the electric energy of the lithium-ion battery in the battery swapping scenario; establishing an initial electric energy measurement model of the lithium-ion battery in the battery swapping scenario based on the influencing factors and FCH-PatchTST; obtaining the battery charge and discharge data of the lithium-ion battery, extracting the frequency domain channel features from the battery charge and discharge data to obtain the frequency domain channel features; training the initial electric energy measurement model based on the frequency domain channel features to obtain an electric energy measurement model, and measuring the electric energy of the lithium-ion battery in the battery swapping scenario based on the electric energy measurement model. The present invention can effectively and accurately predict the battery electric energy, and thus can improve the operation ability of the battery swapping station. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 is a flowchart of the method of the present invention;

[0050] Figure 2 is a PatchTST lithium-ion battery feature extraction model diagram of an embodiment of the method of the present invention;

[0051] Figure 3 is an FCH-PatchTST electric energy measurement prediction model diagram of an embodiment of the method of the present invention;

[0052] Figure 4 is an electric energy measurement diagram of different types of batteries in an embodiment of the method of the present invention;

[0053] Figure 5 is a maximum electric energy diagram of different types of batteries in an embodiment of the method of the present invention;

[0054] Figure 6 is a model response speed / parameter migration diagram of an embodiment of the method of the present invention;

[0055] Figure 7 is a structure diagram of the system of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0056] Reference is now made to the accompanying drawings to describe exemplary embodiments of the present invention. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to disclose the present invention in detail and completely, and to fully convey the scope of the present invention to those skilled in the art. The terms in the exemplary embodiments shown in the drawings are not intended to limit the present invention. In the drawings, the same units / components are denoted by the same reference numerals.

[0057] Unless otherwise specified, the terms used herein (including scientific and technical terms) have the ordinary meaning understood by those skilled in the art. In addition, it can be understood that the terms defined in the commonly used dictionary should be understood as having a meaning consistent with the context of their relevant fields, and should not be understood as idealized or overly formal meanings.

[0058] Embodiment 1:

[0059] The present invention proposes a data-driven method for measuring the electrical energy of lithium-ion batteries, as Figure 1 shown, including:

[0060] Step 1, determine the influencing factors of the electrical energy of lithium-ion batteries in the battery swapping scenario;

[0061] Step 2, based on the influencing factors and FCH-PatchTST, establish an initial electrical energy measurement model for lithium-ion batteries in the battery swapping scenario;

[0062] Step 3, obtain the charge and discharge data of the lithium-ion battery, extract the frequency domain channel features from the charge and discharge data of the battery, and obtain the frequency domain channel features;

[0063] Step 4, based on the frequency domain channel features, train the initial electrical energy measurement model to obtain an electrical energy measurement model, and based on the electrical energy measurement model, measure the electrical energy of the lithium-ion battery in the battery swapping scenario.

[0064] Among them, determining the influencing factors of the electrical energy of lithium-ion batteries in the battery swapping scenario includes:

[0065] Obtain the original data of various charge and discharge parameters of the lithium-ion battery in the battery swapping scenario, preprocess the original data to generate a battery influence data set, based on the battery influence data set, conduct the charge and discharge test of the lithium-ion battery, and based on the test results, determine the influencing factors of the electrical energy of the lithium-ion battery in the battery swapping scenario.

[0066] Among them, the charge and discharge data of the battery includes: multivariate time series data;

[0067] The multivariate includes: voltage, current, temperature and time.

[0068] Among them, for the battery charge and discharge data, frequency-domain channel features are extracted to obtain frequency-domain channel features, including:

[0069] A channel independence mechanism is established. Based on this channel independence mechanism, the battery charge and discharge data are split to obtain charge sequence data and discharge sequence data. The attention between channels of each sequence data in the charge sequence data and the discharge sequence data is calculated independently. Based on this attention, frequency-domain channel features are extracted to obtain frequency-domain channel features.

[0070] Among them, based on the EarlyStopping strategy and the Lr decay strategy, the initial power metering model is trained to obtain the power metering model.

[0071] Among them, the method further includes:

[0072] Performance evaluation of the power metering model includes:

[0073] Determine the performance evaluation index, and evaluate the power metering model based on this performance evaluation index;

[0074] The performance evaluation index includes:

[0075] Mean square error, mean absolute error and relative square error.

[0076] The present invention will be further described below in conjunction with specific implementation cases:

[0077] The specific case has the following process, including:

[0078] First, the PatchTST model introduces an independent channel input mechanism, splits the charge and discharge sequences, separately inputs the charge channel and the discharge channel, and independently calculates the attention between channels for each sequence to achieve feature extraction between data dimensions;

[0079] Secondly, a frequency-domain channel extraction strategy is proposed to map the original data features into the frequency-domain space for learning, introducing more frequency-domain components to enhance useful information, suppress unimportant information, and thus improve the extraction ability of various influencing factor features and charge and discharge features;

[0080] Finally, the power of the lithium-ion charge and discharge process is predicted by combining micro data and macro data.

[0081] The above steps are specifically as follows:

[0082] Step 1: Data processing and analysis of influencing factors;

[0083] Analyze various charge and discharge parameters of lithium-ion batteries in the battery swapping scenario to create a battery impact dataset. The experimental data includes 10 features: type, voltage, current, charge and discharge rate, temperature, vibration frequency, state of energy (SOE), and time, etc. The experiment involves 8 lithium-ion batteries, with a time span of 28 days, including 4 days of trickle charging experiments, 14 days of rate charge and discharge experiments, 3 days of temperature characteristic experiments, and 7 days of vibration experiments. A total of 3,261 charge and discharge cycles of lithium-ion batteries are completed, and the data dimension is 4,170,000×8. Battery life attenuation is also one of the important influencing factors for electricity metering in the battery swapping scenario. This invention uses the publicly available cycle discharge experimental data of LFP, NCA, and NMC batteries from Sandia National Laboratories to expand the dataset. This dataset studies the effects of temperature, depth of discharge, and discharge current on the long-term degradation performance of commercial batteries, and the data comes from the BatteryArchive website.

[0084] There are interferences such as missing values, outliers, and initialization rounds in the original dataset. This invention performs preprocessing work on the data source, including removing missing values, deleting outliers, and time resampling. Finally, an experimental dataset is formed, with a dimension of [5,704,287,:]. The input includes 10 dimensions such as battery type, voltage, current, temperature, frequency, and time, and the output is the electricity value. Among them, the time span of the cycle charge and discharge data is 2 years, including a total of 95,576 charge and discharge sequences. The time length of each round of sequence is about 6,000 seconds.

[0085] Through charge and discharge rate experiments, temperature characteristic experiments, and vibration characteristic experiments, this invention experimentally verifies that the maximum electric energy during the battery charge and discharge process is positively correlated with temperature and vibration frequency, and negatively correlated with the charge and discharge rate. Studying the maximum electric energy change rate under different influences, it is found that the temperature influence > the charge and discharge rate influence > the vibration frequency influence, with the lowest being 1.03%, and their influences cannot be ignored.

[0086] Step 2: Establish a lithium-ion battery electricity metering model for the battery swapping scenario based on FCH-PatchTST;

[0087] A high-precision and high-robustness battery power prediction model needs to simultaneously solve the problems of high-dimensional and long-time-series charge-discharge data of lithium-ion batteries, as well as the battery life attenuation caused by multiple charge-discharge cycles. To address the above problems, the present invention proposes a method for measuring the electrical energy of lithium-ion batteries based on a multi-level sliced time-series Transformer model with frequency domain fusion (Frequency Channel Hierarchical Patchtime series Transformer, FCH-PatchTST). To achieve the electrical energy prediction for the entire life cycle of the battery, the present invention adopts a PatchTST electrical energy measurement model, which uses an independent channel mechanism and a data slicing mechanism to enable the input of multi-dimensional and long-time-series data. To improve the accuracy of the PatchTST model for measuring battery electrical energy, the present invention first adopts a frequency domain feature extraction strategy. By mapping the multi-dimensional time-series data of the battery to the frequency domain, more frequency domain components are introduced to further enhance useful information and suppress unimportant information, thereby achieving the extraction of multi-dimensional features of lithium-ion battery data.

[0088] Lithium-ion batteries in battery swapping scenarios usually have multi-stage charge-discharge processes, and the charge-discharge processes are independent of each other. Therefore, the model needs to have the ability to process long sequences and extract features of multi-dimensional charge-discharge parameters.

[0089] The present invention proposes a method for measuring electrical energy using a sliced time-series Transformer (Patch time series Transformer, PatchTST), and the process includes five steps: channel independence, Patch, positional encoding, multi-head attention calculation, and output mapping, as Figure 2 shown.

[0090] Lithium-ion electrical energy prediction is to predict future charge-discharge parameters based on historical time-series data, and then obtain the future electrical energy through neural network mapping. The original multi-dimensional battery charge-discharge time series data is denoted as with dimension M = 10, including features such as voltage, current, temperature, and frequency. L represents the length of the sampling time series for one round of charge-discharge. x t is the variable corresponding to each sampling time point.

[0091] To achieve the extraction of dimensional features between data, an independent channel mechanism is adopted. First, the input battery sequence with length L is divided into a constant current charging channel a constant voltage charging channel a constant current discharging channel and a constant voltage discharging channel according to the charge-discharge process and the constant voltage and constant current processes. Then, the time-series data of each channel is split into one-dimensional data according to different charge-discharge parameters, denoted as where i ∈ [1, 10].

[0092] To increase the model's ability to predict the electrical energy of lithium-ion batteries for long time series, the reconstructed battery charge and discharge data is divided into small blocks (Patches) of the same length according to each individual channel. Taking the constant current charging channel dataset as an example, a sliding window is used for M channels, the input sequence is split into multiple blocks (Patches), and then the patch is used to copy the last value in the block to the end of the original sequence so that the sliding window can learn all the data within a single channel. The constant current charging channel u cc The sequence after patching The dimension is The number of blocks N is:

[0093]

[0094] Among them, The symbol represents rounding down, and P and S represent the length of the patch and the offset distance between two consecutive blocks respectively. Through the patch operation, the number of input blocks in the constant current charging channel u cc is reduced from L 1 to approximately The processing methods of the remaining charge and discharge cycle data are the same as this, which enables the model to process longer time series information under the same complexity and obtain better learning ability.

[0095] The sequence after patching and channel separation is input into the embedding layer and processed into high-dimensional data. The embedding layer uses linear projection to project the patch into a latent space with dimension D, and a learnable position encoding is superimposed according to the position information of the Patch to identify the time order of the charge and discharge sequence, that is:

[0096]

[0097] Among them, represents the result of superimposing the embedding layer and the position encoding after the original data is processed by the Patch, that is, the input of the backbone network Transformer.

[0098] To calculate the attention weights between each small block element and fuse the weight information of the elements within the small block, the multi-head attention mechanism is used to calculate. It is converted into multi-head attention Q, K, V, that is:

[0099]

[0100] Among them, W h is the attention matrix,

[0101] Subsequently, the scaled dot product between the chunks is calculated to obtain the attention result which is:

[0102]

[0103] As Figure 3 shown, calculate the residual connection, regularization, and feed-forward operations of the attention result to obtain the output of the backbone network is the high-dimensional representation of the charge-discharge sequence of the lithium-ion battery in the latent space. The dimensional features and temporal features of the sequence are independent of each other, and have good feature integration and extraction properties

[0104] Finally, through the mapping of the output layer, the electric energy measurement result is obtained

[0105] Step 3: Frequency-domain channel feature extraction

[0106] The charge-discharge data of the battery is a multivariate time-series data, including multiple charge-discharge parameters such as voltage, current, temperature, and time. In order to comprehensively learn the coupling characteristics between the charge-discharge parameters, this section first cuts in from the frequency domain and introduces the two-dimensional discrete cosine transform (2D-Discrete Cosine Transform, 2D-DCT) to transform the time-series data into the frequency domain. By calculating the attention weights between multiple channels, useful information is enhanced, unimportant information is suppressed, and the accuracy of the model is improved

[0107] The weight learning method of traditional channel attention is:

[0108] att = sigmoid(fc(compress(X))

[0109] where att represents the attention vector, sigmoid represents the Sigmoid function, fc represents the mapping function of the fully connected layer or one-dimensional convolution, and compress represents a certain channel compression method. The traditional method is global average pooling (Global AveragePooling, GAP). However, GAP cannot fully capture rich temporal input information. Different channels may obtain the same result after global average pooling, while the feature information they represent is different. Simply using GAP is equivalent to discarding many other information containing channel features. Therefore, the present invention introduces the two-dimensional discrete cosine transform (2D-Discrete Cosine Transform, 2D-DCT) on the basis of the PatchTST model to use more frequency components to enrich the information volume of channel attention. The principle of frequency-domain feature extraction of battery multi-dimensional charge parameters is as Figure 3 shown

[0110] Taking the constant charging current channel u cc as an example, after obtaining the attention vectors of its M channels through preprocessing, each channel is multiplied by the corresponding attention vector for scaling. The PatchTST network is transformed. First, before the charge and discharge data enters the sharding operation, the constant charging current channel u cc data is respectively input into the embedding layer according to different charge and discharge parameter dimensions, so that the one-dimensional time series data is mapped into high-dimensional time series data with a dimension of . At this time, the dimension of a single-round battery charge and discharge data is Project the charge and discharge sequence into the frequency domain space using 2D-DCT. 2D-DCT is expressed as:

[0111]

[0112] where is the DCT spectrum, is the input signal, L 1 and D are the length and width of the data within a single channel, and the weight function can be expressed as:

[0113]

[0114] where l ∈ {0, 1, …, L 1 - 1}, d ∈ {0, 1, …, D - 1}. Equispaced sampling of the weight function can obtain the transformation basis to improve the model calculation speed. When both l and d in (3 - 6) are 0, formula (3 - 5) can be further written as:

[0115]

[0116] where f 0,0 represents the lowest frequency component of the 2D-DCT and is proportional to GAP, proving that GAP is essentially a part of the 2D-DCT. Correspondingly, the inverse two-dimensional DCT is:

[0117]

[0118] Similarly, the above formula can be further rewritten as:

[0119]

[0120] where i ∈ {0, 1, …, L 1 - 1}, j ∈ {0, 1, …, D - 1}. It can be further seen that GAP is only a component in the DCT, and the traditional processing method discards the remaining components of the 2D-DCT.

[0121] Taking the constant charging current channel Slice it along the feature channel M into [X 0 ,…X i ,…,X m-1 , where i ∈ {0, 1, …, m - 1}, and assign a corresponding 2D-DCT component Freq to each channel data i . The calculation process can be expressed as:

[0122]

[0123] where [s i , t i is the two-dimensional index of the frequency component corresponding to X i . Multiple 2D-DCT components Freq i are concatenated together to form a complete representation of a sequence.

[0124] Freq = compress(X)

[0125] = Cat([Freq 0 , Freq 1 , …, Freq M-1 )

[0126] where Cat means concatenating Freq i into a matrix

[0127] At this time, the charge-discharge sequence information is compressed into the frequency domain, and then the frequency domain information is decoded and superimposed on the original data through the fully connected layer mapping and residual connection to obtain the reconstructed output after DCT transformation, and the result is

[0128]

[0129] Replace the original charge-discharge data in Section 3.1 with the data after feature enhancement as the input to upgrade the performance of the basic model, and perform Patch processing and then send it into the subsequent Transformer backbone model to achieve power prediction.

[0130] Step 4: Model training and result evaluation:

[0131] The present invention uses the early stopping EarlyStopping strategy and the learning rate Lr decrease strategy for training:

[0132] 1) Early Stopping Strategy: This is a learning strategy to avoid model overfitting. It controls the exit of the learning process by monitoring the performance metrics on the validation set. Stopping the training in advance before the model performance deteriorates can effectively avoid overlearning the noise in the training set.

[0133] 2) Lr Decrease Strategy: The learning rate Lr is a very important hyperparameter in the model training process, which controls the direction and magnitude of gradient descent. In this invention, the time decay Lr strategy is used to make different models have optimal and comparable learning rates. Its principle is to use a larger learning rate at the beginning of training and gradually decrease the learning rate as time goes on. The decay formula of Lr is:

[0134]

[0135] (3) Performance Evaluation Metrics:

[0136] The electric energy metering of lithium-ion batteries belongs to a supervised regression task. The mean squared error, mean absolute error, and relative squared error are used to measure the model output results and the deviation from the true value y i .

[0137] 1) Mean Squared Error:

[0138]

[0139] The mean squared error (MSE) calculates the mean of the squares between the predicted value and the true value. It is more sensitive to larger errors and reflects the learning degree of the macroscopic trend of the charge and discharge sequence.

[0140] 2) Mean Absolute Error:

[0141]

[0142] The mean absolute error (MAE) calculates the average of the absolute values between the predicted value and the true value. It is not sensitive to outliers and is used to measure the average absolute degree of prediction error.

[0143] 3) Relative Squared Error:

[0144]

[0145] The relative squared error (RSE) is the ratio of the model error to the benchmark model error. The benchmark model uses the average value of the target variable for prediction. The smaller the RSE value, the better the performance of the model relative to the benchmark model.

[0146] The invention effects are as follows:

[0147] 1. Hyperparameter experiments, including:

[0148] (1) Hyperparameter experiments on frequency-domain feature extraction strategies:

[0149] In the frequency-domain channel feature extraction strategy, the feature learning capabilities of different DCT transform bases and different DCT projection dimensions are different. The frequency-domain transformation is divided into high frequency, medium frequency, and low frequency. The transformation window lengths are set to 16 and 32, and the projection dimensions are set to 128, 256, and 512. h model experiments are conducted under different frequency-domain parameter settings, as shown in Table 1:

[0150] Table 1

[0151]

[0152] Comparing experiment numbers 3, 7, and 8, when the projection dimension is doubled, the MAE errors are reduced by 56.39% and 25.78% respectively. The larger the projection dimension, the more significantly the module error is reduced. Comparing sequences 1-6, when the transform base is upgraded from low frequency to high frequency, the MAE error increases by 1.78%. The higher the base frequency, the module error slightly decreases. When the window length is doubled, the average change in the MAE error is 0.28%. The projection dimension can significantly improve the feature extraction ability of the frequency-domain improvement module, followed by the base frequency, and the window length has the least improvement. Select the medium-frequency transform base, window length of 16, and projection dimension of 512 as the default parameters for the frequency-domain channel extraction module.

[0153] (2) FHC-PatchTST retrospective window experiment:

[0154] The retrospective window of FCH-PatchTST refers to the length of the supervised knowledge at the previous T moments when the model is performing power metering. The retrospective window controls the amount of prior knowledge of the model. An overly short retrospective window contains too little temporal information to cover an effective charge-discharge behavior, resulting in the model being unable to effectively learn sequence features. An overly long retrospective window may bring too much information redundancy, leading to dilution of key attention, and at the same time increasing the computational amount and slowing down the response speed. Experiments under different retrospective window lengths are shown in Table 2.

[0155] Table 2

[0156]

[0157] As the retrospective window length increases, the model error shows a trend of first decreasing and then increasing. When T = 96, the model error is the smallest. Compared with T = 32 and T = 160, the MAE errors are reduced by approximately 3 / 5 and 3 / 4 respectively. This shows that the retrospective window length has a greater impact on the model's feature extraction ability and determines the accuracy of power metering. When the window length is 96, the model is most suitable for lithium-ion battery charge-discharge metering.

[0158] 2. Ablation Experiment:

[0159] The dimensional features of lithium-ion battery data are too high and the length of time series features is inconsistent. Moreover, the data of various influencing factors are mutually coupled during the charging and discharging process. The battery power data contains information at multiple levels, such as short-term charging and discharging energy, medium-term charging and discharging inertia, and long-term life loss. The evolution between different cycles is highly correlated. In this section, the effectiveness of the strategy of superimposing the frequency domain channel module based on the PatchTST model is verified, and the results are shown in Table 3.

[0160] Table 3

[0161]

[0162] 1) The PatchTST model makes the charging and discharging features, dimensional features, and process features in the whole sequence independent through the independent channel mechanism and the Patch mechanism. Table 3 shows that the basic model reduces the relative error of power prediction to 0.2653, which can effectively realize the extraction of high-dimensional features of lithium-ion batteries and has good feature integration and extraction properties.

[0163] 2) The frequency domain channel extraction strategy maps the original data features to the frequency domain space for learning in terms of dimensions, and uses the channel independent and attention strategies to enhance the extraction ability of various influencing factor features and charging and discharging features in the frequency domain. The mean square error drops to 3181.1167, the mean absolute error is 22.6306, and the relative square error is 0.0233. Compared with the basic PatchTST model, the error drops by 88.52%, completing the upgrade of the basic model and having better prediction performance.

[0164] 3. Electric Energy Metering Experiment:

[0165] Next, the FCH-PatchTST electric energy metering experiment is carried out to demonstrate the electric energy metering effect of the model under complex interference and life attenuation.

[0166] (1) Battery Electric Energy Metering under Complex Interference:

[0167] First, 12 batteries of different models are selected, and the FCH-PatchTST is used to measure the electric energy during the charging process of the batteries. The results are as Figure 4 shown. The first row is the LFP battery, the second row is the NMC battery, and the third row is the NCA battery.

[0168] Among them, for the model measurement results of one round, one curve represents the true value of electric energy in this round, and the shaded part represents the measurement deviation of all rounds of this battery. For the convenience of display, the measurement deviation is magnified by 10 times for plotting. The average MAE errors of LFP, NMC, and NCA are calculated to be 4.28, 15.11, and 20.13 respectively. The percentage error of the model on all batteries is 0.12%, which can effectively achieve the electric energy measurement under the interference of coupling factors and meet the engineering accuracy requirements.

[0169] (2) Battery electric energy measurement under life attenuation:

[0170] Observing the model's electric energy measurement effect from the perspective of battery life attenuation, the maximum electric energy of all rounds is plotted as dots. The red ones are the model measurement results, and the blue ones are the true values of the maximum electric energy, as Figure 5 shown.

[0171] The continuous dots in the figure form a descending curve. As the number of battery cycles increases, the model can effectively learn the decrease in the maximum electric energy (i.e., battery life). Taking Battery-52 as an example, taking the maximum electric energy of the initial 50 times and the last 50 times, and calculating their means respectively, it drops from 9865.72 mWh to 6849.80 mWh, with a drop rate of 30.56%. The drop rate obtained by FCH-PatchTST is 29.54%, and the error between the two is 1.02%. Calculate the maximum electric energy attenuation results of all batteries, as shown in Table 4.

[0172] Table 4

[0173]

[0174] The maximum electric energy drop rates of 12 batteries are between 5% and 30%, with an average decrease of 14.05%. The drop rate errors of the model on LFP, NMC, and NCA are 0.30%, 0.64%, and 0.53% respectively, and the average value is 0.49%. The drop rate error of the model is relatively low, indicating that the model has learned the law of battery life decrease and can achieve the battery electric energy measurement under the influence of the decrease in battery life in the battery swapping scenario.

[0175] 4. Comparative experiments:

[0176] This section compares FCH-PatchTST with the mainstream time series models since 2021 to verify the superiority of the model in measuring the electrical energy of the lithium-ion battery charge and discharge sequence. The comparison models include Autoformer (2021), Informer (2021), PatchTST (2023), DLinear (2022), NLinear (2022), and traditional non-encoder-decoder models such as Linear and LSTM. The models used for comparison are tuned according to the lithium-ion battery charge and discharge sequence, and the experimental errors of the models on all batteries are calculated, as shown in Table 5.

[0177] The errors of traditional time series models are relatively large. Among the Transformer series models, the Transformer model has the lowest error, which is the backbone network of the present invention. The MAE errors of the Informer and Autoformer models increase by 26.53% and 5.39% respectively. Compared with the Transformer, the error of the PatchTST model is reduced by 74.43%; compared with PatchTST, the MAE error of the FCH-PatchTST of the present invention is 94.11% lower.

[0178] Table 5

[0179]

[0180] Analyze the experimental results: 1) The non-encoder-decoder model cannot fit the charge and discharge sequence, which may be due to the lack of encoding operation for the TS sequence in the model, and this type of model cannot understand the structure of the sequence normally; 2) The Transformer series models have certain learning abilities, but still cannot understand the timing knowledge of the charge and discharge sequence, which is because this type of model has not been specially customized; 3) PatchTST can follow the charge and discharge curve, but the dimension feature extraction ability is insufficient and the measurement error is relatively large; 4) FCH-PatchTST has a good effect, and the customized module can complete the electrical energy measurement well.

[0181] Compare the models from the perspectives of response time and the number of parameters. The response time is the response time of the model for one round of electrical energy measurement; the number of parameters is the sum of the trainable and non-trainable parameters of the linear and non-linear layers of the model, and the comparison is plotted as Figure 6 shown.

[0182] Figure 6The lower the MAE value, the better the model performance, the lower the number of parameters / response speed, and the faster the model speed. Therefore, the closer to the origin, the better the comprehensive performance of the model. Based on PatchTST, the results of the comparative experiments can be found as follows: 1) The accuracy of the FCH-PatchTST model is significantly reduced, the number of parameters is slightly increased, but the response time is the highest among all the comparative models; 2) The MAE of the Transformer-based models is at the middle level, but the number of parameters is much higher than that of other models, and their response times are uneven. Among them, Autoformer has a better response speed; 3) Traditional network models such as Linear and LSTM perform well in terms of model parameters and response time, but their accuracy is far from sufficient.

[0183] In summary, the FuCH-PatchTST model has both good accuracy and appropriate number of parameters, and is the most suitable for measuring the electric energy of lithium-ion batteries in the battery swapping scenario among the mainstream time series models.

[0184] So far, the present invention has verified the effectiveness of the strategy of superimposing the frequency domain channel module based on the PatchTST model through ablation experiments and comparative experiments.

[0185] Embodiment 2:

[0186] The present invention also proposes a data-driven lithium-ion battery electric energy metering system 200, as Figure 7 shown, including:

[0187] An initial unit 201 for determining the influencing factors of the electric energy of the lithium-ion battery in the battery swapping scenario;

[0188] A model unit 202 for establishing an initial electric energy metering model of the lithium-ion battery in the battery swapping scenario based on the influencing factors and FCH-PatchTST;

[0189] A feature extraction unit 203 for obtaining the charge and discharge data of the lithium-ion battery, and extracting the frequency domain channel features from the charge and discharge data of the battery to obtain frequency domain channel features;

[0190] A metering unit 204 for training the initial electric energy metering model based on the frequency domain channel features to obtain an electric energy metering model, and measuring the electric energy of the lithium-ion battery in the battery swapping scenario based on the electric energy metering model.

[0191] Among them, determining the influencing factors of the electric energy of the lithium-ion battery in the battery swapping scenario includes:

[0192] Obtain the original data of various charge and discharge parameters of lithium-ion batteries in the battery swapping scenario, preprocess the original data to generate a battery impact dataset, based on the battery impact dataset, conduct the charge and discharge tests of the lithium-ion battery, and based on the test results, determine the influencing factors of the electric energy of the lithium-ion battery in the battery swapping scenario.

[0193] Among them, the battery charge and discharge data includes: time series data of multiple variables;

[0194] The multiple variables include: voltage, current, temperature and time.

[0195] Among them, extract the frequency domain channel features from the battery charge and discharge data, and the obtained frequency domain channel features include:

[0196] Establish a channel independent mechanism, based on the channel independent mechanism, split the battery charge and discharge data to obtain charge sequence data and discharge sequence data, independently calculate the attention between channels of each sequence data in the charge sequence data and the discharge sequence data, and based on the attention, extract the frequency domain channel features to obtain the frequency domain channel features.

[0197] Among them, based on the EarlyStopping strategy and the Lr descent strategy, train the initial electric energy measurement model to obtain the electric energy measurement model.

[0198] Among them, the metering unit 204 further includes:

[0199] Evaluate the performance of the electric energy measurement model, including:

[0200] Determine the performance evaluation index, and evaluate the electric energy measurement model based on the performance evaluation index;

[0201] The performance evaluation index includes:

[0202] Mean square error, mean absolute error and relative square error.

[0203] The present invention can effectively and accurately predict the battery electric energy, and thus can improve the operation ability of the battery swapping station.

[0204] Example 3:

[0205] Based on the same inventive concept, the present invention further provides a computer device, which includes a processor and a memory. The memory is used to store a computer program, and the computer program includes program instructions. The processor is used to execute the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, and is suitable for implementing one or more instructions. Specifically, it is suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function, so as to implement the steps of the method in the above embodiments.

[0206] Embodiment 4:

[0207] Based on the same inventive concept, the present invention further provides a storage medium, specifically a computer-readable storage medium (Memory). The computer-readable storage medium is a memory device in a computer device and is used to store programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and, of course, the extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, and the operating system of the terminal is stored in this storage space. And, one or more instructions suitable for being loaded and executed by the processor are also stored in this storage space. These instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The one or more instructions stored in the computer-readable storage medium can be loaded and executed by the processor to implement the steps of the method in the above embodiments.

[0208] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The solutions in the embodiments of the present invention can be implemented in various computer languages. For example, object-oriented programming languages such as Java and interpreted scripting languages such as JavaScript, etc.

[0209] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the specified functions in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0210] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the specified functions in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0211] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the specified functions in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0212] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the present invention.

[0213] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these changes and modifications within.

Claims

1. A lithium-ion battery energy metering method based on data drive, characterized in that: include: Determine the factors affecting the power of lithium-ion batteries in battery swapping scenarios; Based on the influencing factors and FCH-PatchTST, an initial electric energy metering model for lithium-ion batteries in battery replacement scenarios is established; Acquiring battery charge and discharge data of the lithium-ion battery, and extracting frequency domain channel features from the battery charge and discharge data to obtain frequency domain channel features; Based on the frequency domain channel characteristics, the initial electric energy metering model is trained to obtain an electric energy metering model, and based on the electric energy metering model, the electric energy of the lithium-ion battery in the battery replacement scenario is measured.

2. The method according to claim 1, characterized in that The factors affecting the determination of the lithium-ion battery power in the battery replacement scenario include: Obtain original data of various charging and discharging parameters of the lithium-ion battery in the battery swap scenario, preprocess the original data to generate a battery impact data set, perform charging and discharging tests on the lithium-ion battery based on the battery impact data set, and determine the influencing factors of the lithium-ion battery electric energy in the battery swap scenario based on the test results.

3. The method according to claim 1, characterized in that The battery charging and discharging data includes: multivariate time series data; The multiple variables include: voltage, current, temperature and time.

4. The method according to claim 1, characterized in that The extracting of frequency domain channel features from the battery charge and discharge data to obtain frequency domain channel features includes: A channel independence mechanism is established. Based on the channel independence mechanism, the battery charging and discharging data are split to obtain charging sequence data and discharging sequence data. The attention between channels of each sequence data in the charging sequence data and the discharging sequence data is independently calculated. Based on the attention, the frequency domain channel features are extracted to obtain the frequency domain channel features.

5. The method according to claim 1, characterized in that Based on the EarlyStopping strategy and the Lr reduction strategy, the initial electric energy metering model is trained to obtain the electric energy metering model.

6. The method according to claim 1, characterized in that The method further comprises: Evaluate the performance of the energy metering model, including: Determining a performance evaluation index, and evaluating the electric energy metering model based on the performance evaluation index; The performance evaluation indicators include: Mean square error, mean absolute error and relative square error.

7. A data-driven lithium-ion battery energy metering system, characterized in that: include: Initial unit, used to determine the factors affecting the power of lithium-ion batteries in battery replacement scenarios; A model unit, used to establish an initial electric energy metering model of the lithium-ion battery in a battery replacement scenario based on the influencing factors and FCH-PatchTST; A feature extraction unit, used to obtain battery charge and discharge data of the lithium-ion battery, and extract frequency domain channel features from the battery charge and discharge data to obtain frequency domain channel features; A metering unit is used to train the initial electric energy metering model based on the frequency domain channel characteristics to obtain an electric energy metering model, and to measure the electric energy of the lithium-ion battery in the battery replacement scenario based on the electric energy metering model.

8. The system according to claim 7, characterized in that The factors affecting the determination of the lithium-ion battery power in the battery replacement scenario include: Obtain original data of various charging and discharging parameters of the lithium-ion battery in the battery swap scenario, preprocess the original data to generate a battery impact data set, perform charging and discharging tests on the lithium-ion battery based on the battery impact data set, and determine the influencing factors of the lithium-ion battery electric energy in the battery swap scenario based on the test results.

9. The system according to claim 7, characterized in that The battery charging and discharging data includes: multivariate time series data; The multiple variables include: voltage, current, temperature and time.

10. The system according to claim 7, characterized in that The extracting of frequency domain channel features from the battery charge and discharge data to obtain frequency domain channel features includes: A channel independence mechanism is established. Based on the channel independence mechanism, the battery charging and discharging data are split to obtain charging sequence data and discharging sequence data. The attention between channels of each sequence data in the charging sequence data and the discharging sequence data is independently calculated. Based on the attention, the frequency domain channel features are extracted to obtain the frequency domain channel features.

11. The system according to claim 7, characterized in that Based on the EarlyStopping strategy and the Lr reduction strategy, the initial electric energy metering model is trained to obtain the electric energy metering model.

12. The system according to claim 7, characterized in that The metering unit further comprises: Evaluate the performance of the energy metering model, including: Determining a performance evaluation index, and evaluating the electric energy metering model based on the performance evaluation index; The performance evaluation indicators include: Mean square error, mean absolute error and relative square error.

13. A computer device, characterized in that: include: one or more processors; a processor for executing one or more programs; When the one or more programs are executed by the one or more processors, the method according to any one of claims 1 to 6 is implemented.

14. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Lithium ion battery electric quantity real-time estimation method based on canonical correlation analysis

    CN116106761A

  • Battery SOH estimation method based on Ada-MLP and PatchTST model

    CN118465551A

  • Lithium battery SOC and SOH joint estimation method and system based on error correction

    CN118501745A

  • Lithium ion battery state-of-charge estimation method based on ensemble learning

    CN119150025A