Lithium ion battery electric energy prediction method and system
By obtaining the statistical characteristics of the time sequence data of lithium-ion batteries and the prediction task demand to generate prediction instructions, and using pre-trained large language models to predict electricity, the problem of inaccurate electricity prediction in the battery swap scenario is solved, and the power prediction with high accuracy and generalization ability is achieved.
Patent Information
- Application Number
- CN202510463872.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-14
AI Technical Summary
In the battery swap scenario, due to the diversity of battery types, uncertainty in the initial charging state, inconsistency in the battery health status and the limitation of BMS historical data, the electrical energy prediction results of existing lithium-ion batteries are inaccurate.
By obtaining battery power timing data, determining statistical characteristics and prediction task requirements, generating prediction instructions in text format, and embedding them with battery power timing data and inputting them into the pre-trained large language model for power prediction, and using the powerful generalization ability and long-term dependency processing capabilities of pre-trained large language models for accurate prediction.
It improves the accuracy and generalization ability of the electrical energy prediction results, adapts to different prediction tasks, meets the demand for a small amount of battery energy timing sample data in battery swap scenarios, and adapts to long-term timing prediction.
Smart Images

Figure CN120370161A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery performance prediction, and particularly relates to a method and system for predicting the electric energy of a lithium-ion battery. Background Art
[0002] In recent years, with the popularization of new energy electric vehicles, rapid and efficient battery energy replenishment has become a key factor in enhancing the user experience and accelerating the development of the electric vehicle industry. As a solution for quickly replacing battery packs, the battery swapping technology can replenish energy for electric vehicles in a short time, while alleviating users' concerns about charging safety and long charging waiting times. When implementing the battery swapping technology, accurately predicting the electric energy of lithium-ion batteries is crucial for improving the operation efficiency of battery swapping stations, optimizing resource allocation, reducing operation costs, and ensuring the battery service life.
[0003] The method for predicting the electric energy of lithium-ion batteries based on an electrochemical model has high prediction accuracy, but the model identification workload is large, requiring a large amount of parameter identification work, with poor adaptability and high complexity. To solve this technical problem, a deep learning method driven by big data has been proposed in the prior art for electric energy prediction. Although progress has been made in electric energy prediction by deep learning, there are still some limitations. Specifically: insufficient capture of long-term dependence information, inadequate consideration of battery aging and cyclic use, and the need for a large amount of high-quality training data, etc. Especially in the battery swapping scenario, due to the diversity of battery types, the uncertainty of the initial charging state, the inconsistency of battery health states, and the finiteness of BMS historical data, the processing and feature extraction of battery time series data become complex and challenging, resulting in poor accuracy and precision of the obtained electric energy prediction results.
[0004] Therefore, there is an urgent need to provide a method and system for predicting the electric energy of lithium-ion batteries to improve the accuracy of the electric energy prediction results. Summary of the Invention
[0005] In view of this, it is necessary to provide a method and system for predicting the electric energy of lithium-ion batteries to solve the technical problem in the prior art that in the battery swapping scenario, due to the diversity of battery types, the uncertainty of the initial charging state, the inconsistency of battery health states, and the finiteness of BMS historical data, the electric energy prediction results are inaccurate.
[0006] On the one hand, to solve the above technical problem, the present invention provides a method for predicting the electric energy of a lithium-ion battery, including: Obtaining battery electric energy time series data, as well as prediction task requirements and battery swapping application background information; Determining the statistical features in the battery electric energy time series data, and generating a prediction instruction in text format based on the statistical features, the prediction task requirements, and the battery swapping application background information; Embed the prediction instruction and the battery power time series data respectively to obtain text embedding features and data embedding features; Align the text embedding features and the data embedding features to obtain alignment features; Input the alignment features into a pre-trained large language model to obtain the power prediction result.
[0007] In a possible implementation, embedding the battery power time series data includes: Divide the battery power time series data into multiple independent single-variable time series data based on variable types; Copy the last data in the independent single-variable time series data a preset number of times to obtain multiple copied data, and splice the multiple copied data to the end of the independent single-variable time series data to obtain extended time series data; Split the extended time series data into multiple time series data blocks based on a preset length and the preset number of times; Enhance the features of the time series data to obtain enhanced time series data; Input the enhanced time series data into a feature mapping model to obtain the data embedding features.
[0008] In a possible implementation, the number of the multiple time series data blocks is:
[0009] where N is the number of multiple time series data blocks; is the floor symbol; L is the length of the independent single-variable time series data; P is the preset length; S is the preset number of times.
[0010] In a possible implementation, enhancing the features of the time series data to obtain enhanced time series data includes: Obtain a time series sample data set; the time series sample data set includes multiple time series sample data blocks; Use the time series sample data block as an anchor sample, use the time series sample data block with an overlapping area with the anchor sample as a positive sample, and use the time series sample data block without an overlapping area with the anchor sample as a negative sample; Extract features of the anchor sample, negative sample, and positive sample based on an encoder to obtain anchor sample features, negative sample features, and positive sample features; Restore the features of the anchor sample features, negative sample features, and positive sample features based on a decoder to obtain a restored anchor sample, a restored negative sample, and a restored positive sample; Determine the embedding contrast loss value based on the anchor samples, negative samples, positive samples, restored anchor samples, restored negative samples, and restored positive samples, and train the encoder and the decoder based on the embedding contrast loss value to obtain a trained target encoder; Input the time series data into the target encoder to obtain the enhanced time series data.
[0011] In a possible implementation manner, after obtaining the time series sample dataset, it further includes: Add random perturbations to each of the time series sample data blocks to obtain weakly enhanced time series sample data blocks; Randomly divide each of the time series sample data blocks to obtain a plurality of divided data units, and perform random position transformation on the plurality of divided data units to obtain strongly enhanced time series sample data blocks.
[0012] In a possible implementation manner, the feature mapping model includes a multi-head attention layer, a scaled dot-product attention layer, a concatenation layer, and a linear layer; then the step of inputting the enhanced time series data into the feature mapping model to obtain the data embedding feature includes: Perform multi-head attention learning on the enhanced time series data based on the multi-head attention layer to obtain multi-head attention; Aggregate the multi-head attention based on the scaled dot-product attention layer to obtain aggregated attention; Perform concatenation processing on the aggregated attention based on the concatenation layer to obtain concatenated features; Perform linear processing on the concatenated features based on the linear layer to obtain the data embedding feature.
[0013] In a possible implementation manner, the step of performing embedding processing on the prediction instruction to obtain the text embedding feature includes: Perform embedding processing on the prediction instruction based on the token embedding module in the pre-trained large language model to obtain the text embedding feature.
[0014] In a possible implementation manner, before performing embedding processing on the battery power time series data, it further includes: Perform reversible instance normalization processing on the battery power time series data.
[0015] In a possible implementation manner, the step of inputting the alignment feature into the pre-trained large language model to obtain the power prediction result includes: Input the alignment feature into the pre-trained large language model to obtain a power prediction sequence; Perform inverse instance normalization processing on the power prediction sequence to obtain the power prediction result.
[0016] On the other hand, the present invention also provides a lithium-ion battery electric energy prediction system, including: A data acquisition unit, configured to acquire battery electric energy time-series data, prediction task requirements, and battery swapping application background information; A prediction instruction generation unit, configured to determine statistical features in the battery electric energy time-series data, and generate a prediction instruction in text format based on the statistical features, the prediction task requirements, and the battery swapping application background information; A feature embedding unit, configured to perform embedding processing on the prediction instruction and the battery electric energy time-series data respectively to obtain a text embedding feature and a data embedding feature; A feature alignment unit, configured to align the text embedding feature and the data embedding feature to obtain an alignment feature; An electric energy prediction unit, configured to input the alignment feature into a pre-trained large language model to obtain an electric energy prediction result.
[0017] The beneficial effects of the present invention are as follows: The lithium-ion battery electric energy prediction method provided by the present invention determines statistical features in the acquired battery electric energy time-series data, generates a prediction instruction based on the statistical features, prediction task requirements, and battery swapping application background information, and jointly predicts the lithium-ion battery electric energy based on the prediction instruction and the battery electric energy time-series data. During the prediction process, the statistical features can effectively help the pre-trained large language model understand the rising, falling, fluctuating, and other marker information of the lithium-ion electronic time-series data, improving the accuracy of the obtained electric energy prediction result. At the same time, the prediction task requirements and the battery swapping application background can further provide semantic support for the large language model, enabling the large language model to know the prediction purpose and prediction background, improving the reasoning ability of the pre-trained large language model, and further improving the accuracy of the electric energy prediction result.
[0018] Furthermore, the present invention can construct different prediction instructions by changing the prediction task requirements, thereby realizing predictions for different prediction tasks and improving the generalization ability of the pre-trained large language model.
[0019] Even further, the pre-trained large language model has the ability to effectively learn on a small amount of data, meeting the requirement of a small amount of battery electric energy time-series sample data in the battery swapping scenario, and being more suitable for battery electric energy prediction in the battery swapping scenario. Moreover, the pre-trained large language model is good at processing data with long-term dependence relationships, which is very useful for long-term time-series prediction of battery states, and can further improve the accuracy of the obtained electric energy prediction result. Description of the Drawings
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0021] Figure 1 Schematic flowchart of an embodiment of the method for predicting the electric energy of a lithium-ion battery provided by the present invention; Figure 2 Schematic diagram of an embodiment of the prediction instruction provided by the present invention; Figure 3 Schematic flowchart of an embodiment of the embedding process for the battery electric energy time series data in step S103 of the present invention; Figure 4 Schematic diagram of an embodiment of obtaining the time series data block provided by the present invention; Figure 5 For the present invention Figure 3 Schematic flowchart of an embodiment of S304 in the present invention; Figure 6 Schematic structural diagram of an embodiment of the feature mapping model provided by the present invention; Figure 7 Schematic diagram of an embodiment of the charging prediction result provided by the present invention; Figure 8 Schematic diagram of an embodiment of the maximum electric energy - cycle prediction result of different types of batteries provided by the present invention; Figure 9 Schematic diagram of an embodiment of the instruction output result provided by the present invention; Figure 10 Schematic structural diagram of an embodiment of the lithium-ion battery electric energy prediction system provided by the present invention. Detailed implementation manners
[0022] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.
[0023] It should be understood that the schematic drawings are not drawn to scale. The flowcharts used in the present invention illustrate operations implemented according to some embodiments of the present invention. It should be understood that the operations of the flowchart may not be implemented in sequence, and steps without logical context may be reversed or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart or remove one or more operations from the flowchart under the guidance of the content of the present invention. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor systems and / or microcontroller systems.
[0024] References to "embodiments" herein mean that the specific features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of the present invention. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0025] The present invention provides a method and system for predicting the electric energy of a lithium-ion battery, which will be described separately below.
[0026] Figure 1 It is a schematic flowchart of an embodiment of the method for actively reducing vibration and noise of an electric motor provided by the present invention, as Figure 1 shown, the method for actively reducing vibration and noise of an electric motor includes: S101. Obtain the battery electric energy time series data, as well as the prediction task requirements and the background information of the battery swapping application; S102. Determine the statistical features in the battery electric energy time series data, and generate a prediction instruction in text format based on the statistical features, prediction task requirements, and background information of the battery swapping application; S103. Perform embedding processing on the prediction instruction and the battery electric energy time series data respectively to obtain text embedding features and data embedding features; S104. Align the text embedding features and the data embedding features to obtain alignment features; S105. Input the alignment features into a pre-trained large language model to obtain the electric energy prediction result.
[0027] It should be noted that: the relationship between the battery electric energy time series data and the electric energy prediction result in the embodiments of the present invention is: the electric energy prediction result is the data of the future moment of the battery electric energy time series data, that is, based on the time window for predicting the variable in the future moments.
[0028] Among them, the statistical data of the battery power time-series data include, but are not limited to, the minimum value, the maximum value, the average value, the number of upward trends (upward rate), the number of downward trends (downward rate), and the spectral maximum value.
[0029] The prediction task requirement refers to predicting the power prediction data for how long in the future based on the battery power time-series data with how many time steps.
[0030] The battery swapping background application information refers to the professional background knowledge of different prediction tasks, such as: maximum power prediction and charging sequence prediction, etc. Specifically, the battery swapping background application information for maximum power prediction is: predicting the maximum power and duration during a single battery swap, and the maximum value appears at the end of the charging sequence. The battery swapping background application information for charging sequence prediction is: predicting the power increase during a single battery swap, where the power value slowly increases from 0 to the maximum value and then slowly discharges to 0.
[0031] The battery swapping background application information can provide constraint conditions for power prediction, such as the aforementioned maximum power appears at the end of the charging sequence, and the power trend during charging sequence prediction is first increasing and then decreasing, etc.
[0032] In a specific embodiment of the present invention, as Figure 2 shown, when the prediction instruction is a charging sequence prediction instruction, the data text corresponding to the statistical feature is: "The minimum value of the battery power time-series data is <min>, the maximum value is <max>, with an average value of <mean>, the number of upward trends is <UP_COUNT>, the number of downward trends is <DOWN_COUNT>, and the maximum value of the spectrum is <lag>". The task requirement text corresponding to the prediction task requirement is: "Predict data for the next <pred_len> time steps based on <seq_len> time steps". The domain knowledge text corresponding to the battery swapping application background is: "We predict the increase in electrical energy during a single battery swap. One cycle length is 40 - 100, and the electrical energy value slowly increases from 0 to the maximum value and then slowly discharges to 0."
[0033] When the prediction instruction is the maximum electrical energy prediction instruction, the data text corresponding to the statistical feature is: "The minimum value of the battery electrical energy time series data is <min>, the maximum value is <max>, with an average value of <mean>, the number of upward trends is <UP_COUNT>, the number of downward trends is <DOWN_COUNT>, and the maximum value of the spectrum is <lag>”. The task requirement text corresponding to the prediction task requirement is: "Predict the data at the position after <pred_len> steps based on <seq_len> steps". The domain knowledge text corresponding to the battery swapping application background is: "We predict the maximum electric energy and duration during a single battery swap. The length of one round is 40 - 100, and the maximum value appears at the end of the charging sequence."
[0034] It should also be noted that: The specific alignment method for aligning the text embedding feature and the data embedding feature in step S104 is time suffix alignment, that is: splicing the data embedding feature after the text embedding feature. Time suffix alignment can distinguish numbers from text, and only perform backpropagation on the prediction results of the time series, ensuring the model's ability to understand time series while also enabling instruction expansion according to task requirements.
[0035] Compared with the prior art, the lithium-ion battery electric energy prediction method provided by the embodiments of the present invention determines the statistical features in the obtained battery electric energy time series data, generates prediction instructions based on the statistical features, prediction task requirements, and battery swapping application background information, and jointly predicts the lithium-ion battery electric energy based on the prediction instructions and the battery electric energy time series data. During the prediction process, the statistical features can effectively help the pre-trained large language model understand the rising, falling, fluctuating and other marker information of the lithium-ion electronic time series data, improving the accuracy of the obtained electric energy prediction results. At the same time, the prediction task requirements and the battery swapping application background can further provide semantic support for the large language model, enabling the large language model to know the prediction purpose and background, improving the reasoning ability of the pre-trained large language model, and further improving the accuracy of the electric energy prediction results.
[0036] Furthermore, the embodiments of the present invention can construct different prediction instructions by changing the prediction task requirements, thereby realizing the prediction of different prediction tasks and improving the generalization ability of the pre-trained large language model.
[0037] Even further, the pre-trained large language model has the ability to effectively learn on a small amount of data, meeting the requirement of less sample data volume of the battery electric energy time series in the battery swapping scenario and being more suitable for the battery electric energy prediction in the battery swapping scenario. Moreover, the pre-trained large language model is good at processing data with long-term dependence relationships, which is very useful for the long-term time series prediction of battery states, and can further improve the accuracy of the obtained electric energy prediction results.
[0038] In some embodiments of the present invention, as Figure 3 shown, the embedding process of the battery electric energy time series data in step S103 includes: S301. Divide the battery electric energy time series data into multiple independent single-variable time series data based on variable types; S302. Copy the last data in the independent univariate time series data a preset number of times to obtain multiple copied data, and splice the multiple copied data to the end of the independent univariate time series data to obtain an extended time series data; S303. Split the extended time series data into multiple time series data blocks based on a preset length and a preset number of times; S304. Perform feature enhancement on the time series data to obtain enhanced time series data; S305. Input the enhanced time series data into a feature mapping model to obtain data embedding features.
[0039] In the embodiments of the present invention, the battery power time series data is divided into multiple independent univariate time series data, and each independent univariate time series data is split into multiple time series data blocks, reducing the length of the battery power time series data, decomposing the multivariate time series into multiple univariate series, and improving the processing efficiency and prediction accuracy of the model for the battery power time series data.
[0040] Furthermore, in the embodiments of the present invention, by performing feature enhancement on the time series data, the amount of data available for the feature mapping model to learn is increased, and at the same time, it helps to improve the generalization of the feature mapping model, enabling the feature mapping model to more accurately learn the data embedding features.
[0041] It should be noted that: before using the feature mapping model, it needs to be trained according to different types of lithium-ion batteries or other factors. During the training process, the model parameters of the pre-trained large language model are frozen and not updated to reduce the computational complexity of the model, so as to achieve accurate power prediction even in the case of missing samples or low sampling resolution.
[0042] In the specific embodiments of the present invention, the number of multiple time series data blocks is:
[0043] where N is the number of multiple time series data blocks; is the floor function symbol; L is the length of the independent univariate time series data; P is the preset length; S is the preset number of times.
[0044] It should be understood that: the variable types include but are not limited to voltage, current, temperature, and frequency.
[0045] In the specific embodiments of the present invention, as Figure 4 shown, the battery power time series data is represented as , which is a multivariate series with a length of and a dimension of , and each channel is denoted as After that, a sliding window is used for each channel to split the sequence into multiple chunks, and each chunk corresponds to a time series data chunk (Token). To ensure that the number of data in each chunk is the same, the last value in each channel is copied times to the end of the original sequence.
[0046] Through the above splitting process, the embodiments of the present invention can obtain time series data chunks that can accurately reflect the entire input space without contingency. Through the patching operation, the number of input chunks in one channel is reduced from L to N, and the model can process longer time series information with the same complexity and obtain better learning ability.
[0047] In some embodiments of the present invention, as Figure 5 shown, step S304 includes: S501. Obtain a time series sample data set; the time series sample data set includes multiple time series sample data chunks; S502. Use the time series sample data chunk as the anchor sample, use the time series sample data chunk with an overlapping area with the anchor sample as the positive sample, and use the time series sample data chunk without an overlapping area with the anchor sample as the negative sample; S503. Based on the encoder, perform feature extraction on the anchor sample, negative sample, and positive sample to obtain the anchor sample feature, negative sample feature, and positive sample feature; S504. Based on the decoder, perform feature reduction on the anchor sample feature, negative sample feature, and positive sample feature to obtain the reduced anchor sample, reduced negative sample, and reduced positive sample; S505. Determine the embedding contrast loss value based on the anchor sample, negative sample, positive sample, reduced anchor sample, reduced negative sample, and reduced positive sample, and train the encoder and decoder based on the embedding contrast loss value to obtain a trained target encoder; S506. Input the time series data into the target encoder to obtain enhanced time series data.
[0048] Through the embodiments of the present invention, by determining the positive sample and negative sample corresponding to the anchor sample and based on the idea of contrast learning, the time series data can be mapped to the target space, making the dimension of the embedding space smaller while ensuring that the mapped result can fully represent the time series data information, and further improving the power prediction efficiency.
[0049] Among them, the encoder consists of a multi-layer perceptron (MLP), and its feature extraction process can be described as mapping the sample to an embedding space e with a dimension of D, and this process can be described as:
[0050] Among them, can be interpreted as the independent representation of the sample in the high-dimensional space.
[0051] Among them, the loss function during the training of the encoder and decoder is the embedding contrast loss , specifically:
[0052]
[0053] In the formula, is the cosine similarity between the anchor sample feature e and the positive sample feature e + , is the cosine similarity between the anchor sample feature e and the negative sample feature e - , and B is the number of negative sample features; f d (e) is to restore the anchor sample, f d (e - ) is to restore the negative sample, f d (e + ) is to restore the positive sample; is a hyperparameter.
[0054] To further make the electric energy prediction method of the lithium-ion battery adapt to the few-shot scenario, in some embodiments of the present invention, after step S501, it further includes: Adding random perturbations to each time-series sample data block to obtain weakly augmented time-series sample data blocks; Randomly splitting each time-series sample data block to obtain multiple split data units, and performing random position transformation on the multiple split data units to obtain strongly augmented time-series sample data blocks.
[0055] In the embodiments of the present invention, the time-series sample data blocks are augmented by adding random perturbations and random position transformation, which can generate multiple samples in the few-shot scenario, improve their adaptability to the few-shot scenario, and improve the electric energy prediction accuracy in the few-shot scenario.
[0056] In a specific embodiment of the present invention, as Figure 6 shown, the feature mapping model includes a multi-head attention layer (Multi-Head Attention), a scaled dot-product attention layer (Scaled Dot-Product Attention), a concatenation layer (Concat), and a linear layer (Linear); then step S205 includes: Performing multi-head attention learning on the augmented time-series data based on the multi-head attention layer to obtain multi-head attention; Aggregate the multi - head attention based on the scaled dot - product attention layer to obtain the aggregated attention; Perform splicing processing on the aggregated attention based on the splicing layer to obtain the spliced features; Perform linear processing on the spliced features based on the linear layer to obtain the data embedding features.
[0057] Specifically, the multi - head attention layer includes multi - head attention Q, K, V, that is:
[0058] In the formula, W h Q is the Q attention matrix; W h K is the K attention matrix; W h V is the V attention matrix; Q h (i) is the Q attention; K h (i) is the K attention; V h (i) is the V attention.
[0059] Among them, the aggregated attention is:
[0060] In the formula, d k is the scaling factor.
[0061] In the embodiment of the present invention, the enhanced temporal features are mapped to a new representation space through the feature mapping model, and the dimensional features and temporal features of the sequence are independent of each other, having good feature integration and extraction properties.
[0062] Since the pre - trained large - language model has a built - in text embedding function, in order to further reduce the training amount, in the specific embodiment of the present invention, the embedding process of the prediction instruction in step S103 to obtain the text embedding features includes: Perform embedding processing on the prediction instruction based on the token embedding module in the pre - trained large - language model to obtain the text embedding features.
[0063] In the specific embodiment of the present invention, the token embedding module includes a tokenization layer and an embedder layer.
[0064] To avoid the influence of some excessively large data in the battery power time series data on the training and prediction results, in some embodiments of the present invention, before step S104, the following steps are further included: Perform reversible instance normalization processing on the battery power time series data.
[0065] After the reversible instance normalization processing, the battery power time series data is transformed into a standard normal distribution with a mean of 0 and a variance of 1, removing the non-stationary characteristics of the input battery power time series data, facilitating the learning of the battery power time series data by the pre-trained large language model, and being conducive to the gradient update during model training.
[0066] To make the power prediction result more accurate, in some embodiments of the present invention, step S105 is specifically: Input the aligned features into the pre-trained large language model to obtain a power prediction sequence; Perform inverse instance normalization processing on the power prediction sequence to obtain a power prediction result.
[0067] In the embodiments of the present invention, before outputting the power prediction result, inverse instance normalization is performed on the power prediction sequence, and the non-stationary information of the original data is re-incorporated into the output, improving the accuracy of the power prediction result.
[0068] It should be noted that: the pre-trained large language model in the embodiments of the present invention is GPT-2, and its specific structure is prior art and will not be elaborated here.
[0069] To verify the effectiveness of the lithium-ion battery power prediction method proposed in the embodiments of the present invention, corresponding experimental verifications are also designed in the embodiments of the present invention, including power prediction experiments, model comparison experiments, and instruction input experiments. Lithium-ion battery power prediction belongs to a supervised regression task, and the mean square error (MSE), mean absolute error (MAE), relative square error (RSE), mean percentage error (MAPE), and symmetric mean percentage error (sMAPE) are usually used to measure the deviation between the model output result and the true value . The calculation formulas are shown as follows:
[0070]
[0071]
[0072]
[0073] In the formula, n is the total amount of data.
[0074] 1. Power prediction experiment 1.1. Prediction of the single-round charging sequence process of different batteries To meet the prediction requirements for various battery types in the battery replacement scenario, the embodiments of the present invention introduce a charging energy prediction experiment focusing on the widely used LFP and NCM batteries. A total of four batteries were selected from each type. The experiment first inputs a charging sequence consisting of 15 time steps, each time step representing 60 seconds in the display time. This sequence is derived from the start of the battery charging data to predict the subsequent charging energy of the battery. The prediction results of these experiments are as Figure 7 shown, Figure 7 The abscissa is time, and the ordinate is the battery power (mWh). The solid blue line is the actual input time series data, the solid red line is the predicted result, and the dashed blue line is the time series data corresponding to the predicted result collected in reality.
[0075] It can be Figure 7 seen that: the method proposed in the embodiments of the present invention effectively captures the overall trend of the charging sequences of various types of batteries, and the prediction curve fits well with the actual value. The maximum error usually appears in the non-linear part of the time-energy curve, close to the middle to the end of the cycle. Regarding the error index, the predicted MAPE values of the eight batteries always remain below 2%. Specifically, the MAPE value of the LFP battery is 1.10%, and that of the NMC battery is 1.50%. Generally speaking, the prediction process shows a high degree of accuracy, highlighting the robustness of the embodiments of the present invention in predicting various battery types.
[0076] 1.2. Battery degradation analysis experiment The degradation trend of the battery can be reflected in the attenuation of the maximum energy at the end of various charging cycle sequences. Therefore, the main purpose of this experiment is to extract and compare the actual sequence end data from the predicted charging sequences of the same battery in different cycles. Figure 8 shows the comparison results between the actual values of the maximum energy curve of the battery throughout its life cycle and the prediction by the method proposed in the embodiments of the present invention. Figure 8 The abscissa is the number of cycles, and the ordinate is the battery energy. The solid blue line is the actual value, and the red scatter points are the predicted values.
[0077] As Figure 8 shown, the solid blue line represents the actual value, while the red scatter points represent the predicted maximum energy for each cycle. The predicted MAPE values of the four batteries remain below 1%. Compared with the NCM battery, the LFP battery shows better performance. This difference is mainly due to the stable chemical properties of the LFP battery, and the energy drops slowly during multiple charge and discharge cycles. The results show that the embodiments of the present invention accurately predict the maximum energy capacity of different batteries.
[0078] In addition, it is observed that the prediction accuracy of the maximum energy in the embodiments of the present invention remains consistent in consecutive charging cycles, demonstrating its stability and accuracy in tracking energy changes over multiple cycles. Therefore, monitoring the prediction of the maximum energy in the embodiments of the present invention can effectively evaluate the current degradation state of the battery and guide decisions regarding battery recycling or replacement. This ensures that the battery remains in a healthy working state, thereby reducing the economic losses and safety risks associated with unexpected failures.
[0079] 2. Model Comparison Experiment To demonstrate the relative superiority of the pre-trained large language model (BatteryGPT) used in the embodiments of the present invention, mainstream large models GPT4TS, Time-LLM from 2023, the current SOTA time series model PatchTST, and traditional time series models Informer and LSTM were selected for comparison. The comparison results are shown in Table 1: Table 1 Performance Comparison of Different Models
[0080] As can be seen from Table 1, BatteryGPT in the embodiments of the present invention has the best prediction effect on the battery swapping sequence, and its MSE, MAE, RMSE, MAPE, and sMAPE are all better than those of the other prediction models. In the comparison with other large models, the average improvement of the model in this paper is 81.38%, and the improvement compared with the SOTA time series model is 88.16%.
[0081] Generally speaking, the BatteryGPT model proposed in the embodiments of the present invention is more suitable for the battery power sequence prediction task in the battery swapping scenario.
[0082] 3. Instruction Input Experiment The embodiments of the present invention conducted an instruction input experiment in the usage scenario: the user inputs prediction requirements, including background information and domain knowledge of the battery swapping scenario; then provides input data; finally, the model outputs the power prediction results under different tasks, including battery charging sequence prediction and battery maximum power prediction.
[0083] LFP batteries and NMC batteries were selected for demonstration respectively. In this experiment, it was set to 30, that is, the power prediction data with a future length of 30 was output. Figure 9 As can be seen, by constructing a suitable instruction set, the model can complete the prediction of the lithium-ion battery charging sequence and the maximum power according to the input prediction requirements, and the output results meet the task requirements.
[0084] In summary, the lithium-ion battery power prediction method proposed in the embodiments of the present invention has the following beneficial effects: 1. Electric energy prediction is carried out based on prediction instructions and battery electric energy time series data. By changing the prediction instructions, it is possible to predict the electric energy under different scenarios, eliminating the need to train a separate model for the source-load data of each scenario and improving the generalization ability of the model.
[0085] 2. The powerful generalization ability and rich world knowledge of the pre-trained large language model are fully utilized, eliminating the need for a large number of samples during training and the need to train the model from scratch, meeting the requirements of small sample conditions in the scenario of lithium-ion battery performance prediction.
[0086] 3. Instance normalization is performed before inputting into the model to remove the non-stationary characteristics of the battery electric energy time series data, facilitating the model's learning of time series information and benefiting the gradient update during model training. While inverse instance normalization is performed at the output to re-incorporate the non-stationary information of the original data into the output, enhancing the accuracy of the prediction results.
[0087] 4. Processing such as chunking and channel separation is applied to the battery electric energy time series data to reduce the length of the input sequence, decomposing the multi-variable time series into multiple single-variable sequences, improving the processing efficiency and prediction accuracy of the model for the battery electric energy time series data.
[0088] To better implement the lithium-ion battery electric energy prediction method in the embodiments of the present invention, correspondingly, based on the lithium-ion battery electric energy prediction method, the embodiments of the present invention further provide a lithium-ion battery electric energy prediction system, as Figure 10 shown. The lithium-ion battery electric energy prediction system 1000 includes: A data acquisition unit 1001, configured to acquire battery electric energy time series data, prediction task requirements, and information on the background of battery swapping applications; A prediction instruction generation unit 1002, configured to determine the statistical features in the battery electric energy time series data and generate prediction instructions in text format based on the statistical features, prediction task requirements, and information on the background of battery swapping applications; A feature embedding unit 1003, configured to perform embedding processing on the prediction instructions and the battery electric energy time series data respectively to obtain text embedding features and data embedding features; A feature alignment unit 1004, configured to align the text embedding features and the data embedding features to obtain alignment features; An electric energy prediction unit 1005, configured to input the alignment features into a pre-trained large language model to obtain an electric energy prediction result.
[0089] The lithium-ion battery electric energy prediction system 1000 provided in the above embodiments can implement the technical solutions described in the embodiments of the above lithium-ion battery electric energy prediction method. The specific implementation principles of the above modules or units can be referred to the corresponding content in the embodiments of the above lithium-ion battery electric energy prediction method, which will not be elaborated here.
[0090] Those skilled in the art can understand that all or part of the processes for implementing the methods of the above embodiments can be completed by instructing relevant hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium. Among them, the computer-readable storage medium is a disk, an optical disk, a read-only memory, or a random access memory, etc.
[0091] The above has introduced in detail a method and system for predicting the electric energy of a lithium-ion battery provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. The content of this specification should not be construed as a limitation to the present invention.< / lag> < / mean> < / max> < / min> < / lag> < / mean> < / max> < / min>
Claims
1. A method for predicting the electrical energy of a lithium-ion battery, characterized in that, Including: Obtaining battery power time-series data, prediction task requirements, and battery swapping application background information; Determining statistical features in the battery power time-series data, and generating a prediction instruction in text format based on the statistical features, the prediction task requirements, and the battery swapping application background information; Performing embedding processing on the prediction instruction and the battery power time-series data respectively to obtain a text embedding feature and a data embedding feature; Aligning the text embedding feature and the data embedding feature to obtain an alignment feature; Inputting the alignment feature into a pre-trained large language model to obtain a power prediction result.
2. The method for predicting the electric energy of a lithium-ion battery according to claim 1, wherein Performing embedding processing on the battery power time-series data, including: Dividing the battery power time-series data into multiple independent univariate time-series data based on variable types; Copying the last data in the independent univariate time-series data a preset number of times to obtain multiple copied data, and concatenating the multiple copied data to the tail of the independent univariate time-series data to obtain an extended time-series data; Splitting the extended time-series data into multiple time-series data blocks based on a preset length and the preset number of times; Performing feature enhancement on the time-series data to obtain enhanced time-series data; Inputting the enhanced time-series data into a feature mapping model to obtain the data embedding feature.
3. The method for predicting the electric energy of a lithium-ion battery according to claim 2, wherein, The number of the multiple time-series data blocks is: Wherein, N is the number of multiple time-series data blocks; is the floor symbol; L is the length of the independent single-variable time-series data; P is the preset length; S is the preset number of times.
4. The method for predicting the electric energy of a lithium-ion battery according to claim 2, wherein The performing feature enhancement on the time-series data to obtain enhanced time-series data includes: Obtaining a time-series sample data set; the time-series sample data set includes multiple time-series sample data blocks; Regarding the time-series sample data block as an anchor sample, regarding the time-series sample data block with an overlapping area with the anchor sample as a positive sample, and regarding the time-series sample data block without an overlapping area with the anchor sample as a negative sample; Performing feature extraction on the anchor sample, the negative sample, and the positive sample based on an encoder to obtain an anchor sample feature, a negative sample feature, and a positive sample feature; Performing feature reduction on the anchor sample feature, the negative sample feature, and the positive sample feature based on a decoder to obtain a reduced anchor sample, a reduced negative sample, and a reduced positive sample; Determining an embedding contrast loss value based on the anchor sample, the negative sample, the positive sample, the reduced anchor sample, the reduced negative sample, and the reduced positive sample, and training the encoder and the decoder based on the embedding contrast loss value to obtain a trained target encoder; Inputting the time-series data into the target encoder to obtain the enhanced time-series data.
5. The method for predicting the electric energy of a lithium-ion battery according to claim 4, wherein After obtaining the time-series sample data set, it further includes: Adding random perturbations to each of the time-series sample data blocks to obtain weakly enhanced time-series sample data blocks; Randomly splitting each of the time-series sample data blocks to obtain multiple split data units, and performing random position transformation on the multiple split data units to obtain strongly enhanced time-series sample data blocks.
6. The method for predicting the electric energy of a lithium-ion battery according to claim 2, wherein The feature mapping model includes a multi-head attention layer, a scaled dot-product attention layer, a concatenation layer, and a linear layer; then the inputting the enhanced time-series data into the feature mapping model to obtain the data embedding feature includes: Performing multi-head attention learning on the enhanced time-series data based on the multi-head attention layer to obtain multi-head attention; Aggregate the multi-head attention based on the scaled dot-product attention layer to obtain aggregated attention; Perform splicing processing on the aggregated attention based on the splicing layer to obtain spliced features; Perform linear processing on the spliced features based on the linear layer to obtain the data embedding features.
7. The method for predicting the electric energy of a lithium-ion battery according to claim 1, wherein Embed the prediction instruction to obtain text embedding features, including: Embed the prediction instruction based on the token embedding module in the pre-trained large language model to obtain the text embedding features.
8. The method for predicting the electric energy of a lithium-ion battery according to claim 1, wherein, Before embedding the battery power time series data, it further includes: Perform reversible instance normalization processing on the battery power time series data.
9. The method for predicting the electric energy of a lithium-ion battery according to claim 1, wherein, Inputting the aligned features into the pre-trained large language model to obtain the power prediction result, including: Input the aligned features into the pre-trained large language model to obtain a power prediction sequence; Perform inverse instance normalization processing on the power prediction sequence to obtain the power prediction result.
10. A lithium-ion battery electric energy prediction system, characterized in that, It includes: A data acquisition unit for acquiring battery power time series data, prediction task requirements, and swap application background information; A prediction instruction generation unit for determining the statistical features in the battery power time series data and generating a prediction instruction in text format based on the statistical features, the prediction task requirements, and the swap application background information; A feature embedding unit for respectively embedding the prediction instruction and the battery power time series data to obtain text embedding features and data embedding features; A feature alignment unit for aligning the text embedding features and the data embedding features to obtain aligned features; A power prediction unit for inputting the aligned features into the pre-trained large language model to obtain the power prediction result.
Citation Information
Patent Citations
Method and system for predicting battery replacement demand of electric vehicle based on time sequence
CN114943386A
Battery replacement demand prediction method and system and computer equipment
CN118446376A
Electric vehicle charging station load orderly regulation and control method and system based on large language model
CN119047784A
Power system time sequence prediction model training method, system and device based on large language model weight fine tuning and storage medium
CN119670893A
Large model construction method for intelligent collaboration and decision-making of power time series
CN119692415A
Cited By
Thermal runaway prediction method and device of power battery, storage medium and electronic equipment
CN121276357A