A battery SOC online simulation method and device, electronic equipment and storage medium

By collecting and processing battery data in real time and generating SOC simulation values ​​using multi-head self-attention and cross-attention mechanisms, the problem of parameter drift and error accumulation in traditional battery SOC estimation methods is solved, achieving high-precision and real-time SOC simulation and improving the management reliability of energy storage systems and electric vehicles.

CN121679365BActive Publication Date: 2026-05-15RESEARCH INSTITUTE OF TSINGHUA UNIVERSITY IN SHENZHEN
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
RESEARCH INSTITUTE OF TSINGHUA UNIVERSITY IN SHENZHEN
Filing Date
2026-02-11
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Traditional battery SOC estimation methods rely on experimental calibration, which makes parameters prone to drift, leads to severe error accumulation, has poor adaptability to complex operating conditions, ignores cross-feature dependencies, and lacks real-time performance and scalability.

Method used

By collecting battery operating parameters in real time, performing noise reduction and standardization processing, constructing a sliding window sequence, extracting features using a multi-head self-attention structure and a lightweight feedforward network, and generating SOC simulation values ​​using a cross-attention mechanism, high-precision online simulation of battery SOC is achieved.

Benefits of technology

It improves the accuracy of battery SOC estimation and its adaptability under complex operating conditions, and significantly improves the reliability of SOC estimation for energy storage systems and electric vehicles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121679365B_ABST
    Figure CN121679365B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a battery SOC online simulation method and device, electronic equipment and storage medium, relating to the technical field of battery management and digital control of energy storage system, wherein the method comprises: constructing a sliding window sequence to generate a historical time sequence matrix after real-time acquisition of operating parameters such as voltage and current, and denoising, filtering and standardization preprocessing. A multi-head self-attention structure is used to construct a time sequence encoder to extract long-term dependence features such as voltage curve changes to generate a historical feature vector; at the same time, a lightweight feedforward network is used to extract key influence features from the current covariates, the key influence features are used as query vectors, the historical feature vector is used as a key-value vector, and a cross-attention mechanism is used to dynamically adjust the weight to generate a fusion feature sequence and automatically adjust the attention weight. The decoder network is used for multi-layer nonlinear mapping of the fusion features to generate an SOC simulation value. The present application effectively solves the problems of parameter drift, error accumulation and poor adaptability in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital control technology for battery management and energy storage systems, and in particular to a method, apparatus, electronic device, and storage medium for online simulation of battery SOC. Background Technology

[0002] With the rapid development of battery management and digital control of energy storage systems, accurate estimation of battery SOC (State of Charge) has become a key factor in improving energy storage scheduling efficiency, ensuring safe control, and extending battery life.

[0003] However, traditional SOC estimation methods face many challenges: methods based on equivalent circuit models (ECM) are highly dependent on experimental calibration, and parameters are easily affected by temperature and aging conditions, resulting in insufficient generalization performance; coulomb measurement methods rely on current integration, and sensor errors and noise can easily cause cumulative drift, significantly increasing long-term prediction bias; under complex operating conditions such as frequent charging and discharging, pulsed loads, and high-rate conditions, single voltage or current characteristics are difficult to accurately model SOC changes.

[0004] Furthermore, the nonlinear coupling relationships between parameters such as voltage, current, and temperature are often overlooked, and traditional methods cannot fully capture cross-feature dependencies. At the same time, as the scale of energy storage power stations expands, SOC inference needs to balance efficiency, speed, and stability, while existing methods generally lack real-time performance and scalability.

[0005] Therefore, there is an urgent need for an online simulation method for battery SOC that integrates multi-parameter information, has strong expressive power, is suitable for online simulation, and can improve the estimation accuracy and system adaptability under complex working conditions. Summary of the Invention

[0006] The present invention provides an online battery SOC simulation method to address the problems of existing technologies, such as reliance on experimental calibration, easy parameter drift, severe error accumulation, poor adaptability to complex operating conditions, neglect of cross-feature dependencies, and lack of real-time performance and scalability. The technical solution is as follows:

[0007] According to one aspect of the present invention, a method for online simulation of battery SOC (State of Charge), the method comprising: real-time acquisition of battery operating parameters and preprocessing to obtain raw data; the operating parameters including voltage, current, temperature, charge / discharge state, power, cycle count, SOH (State of Health), and cell balancing state; the preprocessing including denoising, outlier filtering, and standardization; constructing a sliding window sequence for the raw data and extracting auxiliary covariates of the battery at the current moment to obtain a historical time series matrix and a current covariate; the auxiliary covariates including charge / discharge state, rate of change, cycle count, balancing index, and historical SOC value; constructing a time series encoder using a multi-head self-attention structure, and extracting long-term dependency features from the historical time series matrix through the time series encoder to generate a historical feature representation vector; extracting key influencing features from the current covariate using a lightweight feedforward network; constructing a fused feature sequence using the key influencing features as a query vector, and using the historical feature representation vector as a key vector and a value vector; processing the fused feature sequence through a decoder network to generate a SOC simulation value; and obtaining a predicted SOC value of the battery based on the SOC simulation value.

[0008] In one embodiment, the real-time acquisition of battery operating parameters and the preprocessing to obtain raw data are achieved through the following steps: the battery operating parameters are acquired in real time through the analog front-end (AFE) integrated in the battery management system (BMS), the operating parameters are denoised, invalid values ​​are removed, outliers are filtered through interval rules, and the raw data is obtained through standardization.

[0009] In one embodiment, a sliding window sequence is constructed for the original data, and the auxiliary covariates of the battery at the current moment are extracted to obtain the historical time series matrix and the current covariates. This is achieved through the following steps: a sliding window sequence of a set length is constructed based on the preprocessed original data; the continuous signal stream in the original data is divided into historical time series data through the sliding window sequence to obtain the historical time series matrix; the auxiliary covariates of the battery at the current moment are extracted from the original data; the historical time series matrix is ​​used to reflect the accumulation of polarization voltage and historical state inertia inside the battery; the auxiliary covariates are used to characterize the instantaneous physical pressure currently experienced by the battery.

[0010] In one embodiment, a time-series encoder is constructed using a multi-head self-attention structure, and the time-series encoder extracts long-term dependency features from the historical time-series matrix to generate a historical feature representation vector. This is achieved through the following steps: a time-series encoder is constructed using a multi-head self-attention structure; the time-series encoder is used to capture the correlation between different time steps in the historical time series through a multi-head mechanism, and to extract the voltage curve change trend, current waveform features, and temperature hysteresis characteristics; features are extracted from the historical time-series matrix based on the time-series encoder to obtain a historical feature representation vector; the historical feature representation vector is used to characterize the electrochemical inertia and voltage rebound characteristics of the battery over a past period.

[0011] In one embodiment, the extraction of key influencing features from the current covariate using a lightweight feedforward network is achieved through the following steps: embedding the current covariate, mapping it to a high-dimensional support space, constructing a query vector representing the current operating condition features, and using a lightweight feedforward network to extract the key influencing features of the current covariate; the lightweight feedforward network is used to reduce computational complexity and retain features that have a significant impact on SOC prediction.

[0012] In one embodiment, the construction of a fused feature sequence using the key impact feature as the query vector and the historical feature representation vector as the key vector and value vector is achieved through the following steps: using the key impact feature as the query vector and the historical feature representation vector as the key vector and value vector, the weights of the key vector and value vector are dynamically adjusted through a cross-attention mechanism, and the fused feature sequence is generated by combining the query vector; when the load changes suddenly or the battery ages, the attention weights of the corresponding time regions are automatically adjusted; the adjustment of the attention weights is used to improve the sensitivity to charge and discharge nonlinearity and compensate for deviations caused by aging, rate, and voltage hysteresis.

[0013] In one embodiment, the SOC simulation value is generated by processing the fused feature sequence through a decoder network, and the SOC prediction value of the battery is obtained based on the SOC simulation value through the following steps: performing multi-layer nonlinear mapping on the fused feature sequence through the decoder network to generate the SOC simulation value, and obtaining the SOC prediction value of the battery based on the SOC simulation value; the decoder network supports single-point simulation and multi-step simulation.

[0014] According to one aspect of the present invention, a battery SOC online simulation device is provided, the device comprising: a data acquisition and preprocessing module for real-time acquisition of battery operating parameters and preprocessing to obtain raw data; the operating parameters include voltage, current, temperature, charge / discharge state, power, cycle count, SOH, and cell balancing state; the preprocessing includes noise reduction, outlier filtering, and standardization; and a time series matrix and covariate extraction module for constructing a sliding window sequence for the raw data and extracting auxiliary covariates of the battery at the current moment to obtain a historical time series matrix and current covariates; the auxiliary covariates include charge / discharge state, rate of charge, and cycle count. The system comprises: a balance index and historical SOC values; a feature encoding and extraction module, used to construct a time-series encoder using a multi-head self-attention structure, and extract long-term dependency features from the historical time-series matrix through the time-series encoder to generate a historical feature representation vector, and use a lightweight feedforward network to extract key influencing features from the current covariates; and a feature fusion and SOC prediction module, used to construct a fused feature sequence using the key influencing features as a query vector, and the historical feature representation vector as a key vector and value vector, and use a decoder network to process the fused feature sequence to generate a simulated SOC value, and obtain the predicted SOC value of the battery based on the simulated SOC value.

[0015] According to one aspect of the present invention, an electronic device includes at least one processor and at least one memory, wherein computer-readable instructions are stored on the memory; the computer-readable instructions are executed by one or more of the processors to cause the electronic device to implement the battery SOC online simulation method as described above.

[0016] According to one aspect of the present invention, a storage medium has computer-readable instructions stored thereon, which are executed by one or more processors to implement the battery SOC online simulation method as described above.

[0017] The beneficial effects of the technical solution provided by this invention are:

[0018] In the above technical solution, this invention first uses an AFE integrated in the BMS to collect operating parameters such as voltage and current in real time. After denoising, outlier filtering, and standardization preprocessing, a sliding window sequence is constructed to generate a historical time series matrix, and auxiliary covariates such as charge and discharge states are extracted to characterize the current operating conditions. Secondly, a multi-head self-attention structure is used to construct a time series encoder to capture the correlation between different time steps in the historical time series, extracting long-term dependent features such as voltage curve changes to generate historical feature vectors. Simultaneously, a lightweight feedforward network is used to extract key influencing features from the current covariates, reducing computational complexity. Then, using the key influencing features as query vectors and the historical feature vectors as key-value vectors, a cross-attention mechanism is used to dynamically adjust the weights to generate a fused feature sequence. The attention weights are automatically adjusted when there are sudden load changes or battery aging, improving sensitivity to charge and discharge nonlinearities. Finally, a decoder network performs multi-layer nonlinear mapping on the fused feature sequence to generate SOC simulation values, supporting single-point or multi-step simulation prediction. This method achieves high-precision online simulation of SOC under complex operating conditions, effectively solving the problems of parameter drift, error accumulation, and poor adaptability of traditional methods, and significantly improving the reliability of SOC estimation for energy storage systems and electric vehicles. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating an online battery SOC simulation method according to an exemplary embodiment;

[0021] Figure 2 This is a schematic diagram of the network structure using the online simulation method for battery SOC in an exemplary embodiment;

[0022] Figure 3 This is a schematic diagram of the SOC simulation results of an online battery SOC simulation method in an application scenario;

[0023] Figure 4 This is a block diagram of a battery SOC online simulation device according to an exemplary embodiment;

[0024] Figure 5 This is a hardware structure diagram of an electronic device according to an exemplary embodiment;

[0025] Figure 6 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0026] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0027] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this disclosure means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.

[0028] This invention provides an online battery SOC simulation method. By integrating multi-source data preprocessing, cross-attention feature fusion, and lightweight network modeling, it achieves high-precision online simulation and real-time prediction of battery SOC. This effectively solves the problems of parameter drift, error accumulation, and poor adaptability to complex operating conditions inherent in traditional methods, improving the reliability of SOC estimation for energy storage systems and electric vehicles. This online battery SOC simulation method is applicable to online battery SOC simulation devices, which can be electronic devices. The online battery SOC simulation method in this invention can be applied to various scenarios, such as online battery SOC simulation.

[0029] Please see Figure 1 This invention provides an online battery SOC simulation method, which is applicable to electronic devices.

[0030] In the following method embodiments, for ease of description, the execution subject of each step of the method is an electronic device, but this does not constitute a specific limitation.

[0031] like Figure 1 As shown, the method may include the following steps:

[0032] Step 110: Collect the battery's operating parameters in real time and preprocess them to obtain the raw data.

[0033] In one possible implementation, the battery's operating parameters are collected in real time through an analog front-end (AFE) integrated into the battery management system (BMS). The operating parameters are then denoised, invalid values ​​are removed, outliers are filtered out using interval rules, and the raw data is obtained through standardization.

[0034] The operating parameters include voltage, current, temperature, charge / discharge status, power, number of cycles, state of equilibrium (SOH), cell balancing status, etc., and the preprocessing includes noise reduction, outlier filtering, standardization, etc., none of which are specified here.

[0035] Specifically, the analog front-end (AFE) integrated into the battery management system (BMS) collects battery operating parameters in real time, including voltage, current, temperature, state of charge / discharge, power, cycle count, state of health (SOH), and cell balancing status. These parameters comprehensively reflect the battery's current operating state. The collected raw data undergoes noise reduction to remove invalid values ​​such as transient pulse interference from sensors; outliers are filtered using interval rules to ensure the data remains within a reasonable range; finally, standardization is performed to make data of different dimensions comparable, facilitating subsequent analysis.

[0036] Methods such as moving average or median filtering are employed to eliminate random noise during sensor measurements and improve data quality. Based on the physical characteristics of the battery, a reasonable numerical range is set, and data points outside this range are filtered out to prevent erroneous data from interfering with model training. Data is scaled to the [0,1] or [-1,1] interval to eliminate the influence of dimensions and improve the model's convergence speed and stability.

[0037] In the above process, the embodiments of the present invention ensure the accuracy and reliability of the input data through comprehensive data collection and meticulous data preprocessing, providing a high-quality data foundation for subsequent feature extraction and model training, and effectively improving the accuracy of SOC simulation.

[0038] Step 120: Construct a sliding window sequence for the original data and extract the auxiliary covariates of the battery at the current time to obtain the historical time series matrix and the current covariates.

[0039] In one possible implementation, a sliding window sequence of a set length is constructed based on the preprocessed raw data. The continuous signal stream in the raw data is divided into historical time series data by the sliding window sequence to obtain the historical time series matrix. The auxiliary covariate of the battery at the current moment is extracted from the raw data.

[0040] The historical time series matrix reflects the accumulated polarization voltage and historical state inertia within the battery; auxiliary covariates characterize the instantaneous physical stress currently experienced by the battery. These auxiliary covariates include state of charge / discharge, rate capability, cycle count, balancing index, historical SOC value, etc., but are not specified here.

[0041] Specifically, based on the preprocessed raw data, a sliding window sequence of a set length is constructed to divide the continuous signal stream into historical time-series data, forming a historical time-series matrix. This matrix reflects the voltage and current variation trajectory of the battery over a past period. Auxiliary covariates of the battery at the current moment are extracted from the raw data, including state of charge / discharge, rate of change, number of cycles, balancing index, and historical state of charge (SOC). These variables characterize the instantaneous physical stress currently experienced by the battery.

[0042] Furthermore, the choice of window length needs to comprehensively consider computational complexity and feature capture capability; too short a window may lead to information loss, while too long a window increases the computational burden. Charge / discharge status indicates whether the battery is currently charging or discharging; the rate of change reflects the charge / discharge rate; the cycle count records the battery's usage history; the balance index reflects the balance state between cells; and historical SOC values ​​provide information on state continuity.

[0043] In the above process, the embodiments of the present invention construct a feature matrix reflecting the historical state and current operating condition of the battery by extracting sliding window sequences and auxiliary covariates, which provides a rich source of information for subsequent feature fusion and SOC simulation, and enhances the model's adaptability to complex operating conditions.

[0044] Step 130: A multi-head self-attention structure is used to construct a temporal encoder, and the temporal encoder is used to extract long-term dependency features from the historical time series matrix to generate a historical feature representation vector. A lightweight feedforward network is used to extract key influence features from the current covariates.

[0045] In one possible implementation, a multi-head self-attention structure is used to construct a temporal encoder; features are extracted from the historical temporal matrix based on the temporal encoder to obtain a historical feature representation vector.

[0046] Among them, the timing encoder is used to capture the correlation between different time steps in the historical time series through a multi-head mechanism, and extract the voltage curve change trend, current waveform characteristics and temperature hysteresis characteristics; the historical feature representation vector is used to characterize the electrochemical inertia and voltage rebound characteristics of the battery over a period of time.

[0047] In one possible implementation, the current covariate is embedded and mapped to a high-dimensional support space to construct a query vector representing the characteristics of the current operating condition. A lightweight feedforward network is then used to extract the key impact features of the current covariate.

[0048] The lightweight feedforward network is used to reduce computational complexity and retain features that have a significant impact on SOC prediction.

[0049] Specifically, a multi-head self-attention structure is used to construct a time-series encoder to capture the correlation between different time steps in the historical time series, extract voltage curve change trends, current waveform features, and temperature hysteresis characteristics, and generate a historical feature representation vector. The current covariates are embedded and mapped to a high-dimensional support space to construct a query vector representing the current operating condition characteristics. A lightweight feedforward network is used to extract key influencing features. Using the key influencing features as the query vector and the historical feature representation vector as the key and value vectors, a cross-attention mechanism is used to dynamically adjust the weights of the key and value vectors to generate a fused feature sequence.

[0050] Among these features, the multi-head self-attention mechanism allows the model to capture multiple dependencies in time series across different subspaces, enhancing feature extraction capabilities. A lightweight feedforward network reduces computational complexity while retaining features that significantly impact SOC prediction, improving model efficiency. Dynamically adjusting the attention weights of historical features based on current operating conditions enhances sensitivity to charge-discharge nonlinearities and compensates for biases caused by aging, rate capability, and voltage hysteresis.

[0051] In the above process, the embodiments of the present invention achieve dynamic fusion of historical features and current working condition features by constructing a time-series encoder and a covariate encoder, and introducing a cross-attention mechanism, which significantly improves the model's ability to fit complex working conditions and the accuracy of SOC prediction.

[0052] Step 140: Using key impact features as query vectors and historical feature representation vectors as key and value vectors, a fused feature sequence is constructed. The fused feature sequence is then processed by a decoder network to generate SOC simulation values. Based on the SOC simulation values, the predicted SOC value of the battery is obtained.

[0053] In one possible implementation, key impact features are used as query vectors, and historical feature representation vectors are used as key and value vectors. The weights of the key and value vectors are dynamically adjusted through a cross-attention mechanism, and a fused feature sequence is generated by combining the query vectors. When the load changes suddenly or the battery ages, the attention weights of the corresponding time regions are automatically adjusted.

[0054] Among them, the adjustment of attention weight is used to improve the sensitivity to charge and discharge nonlinearity and compensate for deviations caused by aging, rate and voltage hysteresis.

[0055] In one possible implementation, a decoder network performs multi-layer nonlinear mapping on the fused feature sequence to generate SOC simulation values, and the SOC prediction value of the battery is obtained based on the SOC simulation values.

[0056] The decoder network supports both single-point and multi-step simulation.

[0057] Specifically, a decoder network is constructed to perform multi-layer nonlinear mapping on the fused feature sequence to generate SOC simulation values. Based on the SOC simulation values ​​output by the decoder network, the predicted SOC value of the battery is obtained. The decoder network supports single-point simulation and multi-step simulation to meet the needs of different application scenarios.

[0058] This method employs structures such as Multilayer Perceptron (MLP) or Long Short-Term Memory (LSTM) networks to perform nonlinear transformations on the fused features, generating accurate SOC simulation values. Single-point simulations provide an SOC estimate for the current moment, while multi-step simulations predict future SOC trends, providing a basis for battery management and energy scheduling.

[0059] In the above process, the embodiments of the present invention achieve accurate prediction of battery SOC by constructing a decoder network and generating SOC simulation values. The multi-layer nonlinear mapping capability of the decoder network enhances the expressive power of the model, supports single-point and multi-step simulations to meet the needs of different scenarios, and significantly improves the intelligence level of battery management.

[0060] Through the above process, this embodiment of the invention achieves high-precision online simulation of battery SOC by comprehensively acquiring and preprocessing data, extracting features and constructing matrices, fusing cross-attention with feature generation, and generating and predicting SOC simulation values. This method fully utilizes the battery's historical time-series information and current operating condition characteristics, dynamically fusing multi-source information through a cross-attention mechanism, significantly improving the model's adaptability to complex operating conditions and the accuracy of SOC prediction. Simultaneously, the decoder network's multi-layer nonlinear mapping capability and support for single-point and multi-step simulation meet the needs of different application scenarios, providing reliable technical support for battery management and energy scheduling.

[0061] In one exemplary embodiment, the battery SOC online simulation system provided by the battery SOC online simulation method of the present invention is used to perform SOC online simulation.

[0062] Specifically, the system deeply integrates Figure 2 The deep learning network structure shown in the image and its mapping relationship with the physical properties of batteries include the following modules:

[0063] Data acquisition module: As the physical interface of the system, it is usually integrated into the analog front end (AFE) of the battery management system (BMS) and is responsible for capturing the physical signals of cell-level terminal voltage, loop current and module temperature in real time.

[0064] The data preprocessing module is responsible for denoising, outlier filtering (such as removing instantaneous pulse interference from sensors), and normalization of the raw physical signals. It also constructs a sliding time window to divide the continuous signal stream into historical time-series data.

[0065] SOC online simulation model: As the core computing unit, it uses a cross-attention mechanism to integrate historical memory and real-time excitation to calculate the internal state of the battery.

[0066] SOC simulation results output: Outputs the final state of charge (SOC) percentage, which is used for vehicle instrument display or energy dispatch strategy of energy storage system.

[0067] Specifically, using this system for online SOC simulation may include the following steps:

[0068] Step S1: Simulation variable selection.

[0069] Specifically, during the operation of the battery management system (BMS) of an electric vehicle, various types of battery data are collected and preprocessed in real time through data acquisition and data preprocessing modules. Specifically, data such as current, voltage, temperature, and charge / discharge status are acquired through sensors in the BMS.

[0070] Furthermore, utilizing Figure 2 In the lower left section (a), the Index_Filter within the Simu Variates Filter accurately extracts the current load, ambient temperature, and charge / discharge status bits from the BMS data stream as the model's real-time stimulus signal. These variables collectively characterize the instantaneous physical stress currently experienced by the battery, providing the model with necessary input information. Simultaneously, historical time-series data (such as voltage and current trajectories from the past 60 seconds) is used to reflect the accumulation of polarization voltage and historical state inertia within the battery, providing historical context for the model. Simulation-time state variables (such as the current real-time current load, ambient temperature, and BMS charge / discharge flags) serve as the model's real-time stimulus signal.

[0071] The Simu Variates Filter represents the process of filtering and indexing real-time simulation variables. Specifically, it is used to extract the current load, ambient temperature, and charge / discharge status bits from the BMS data stream as the real-time excitation signal (Stimulus) of the model, representing the instantaneous physical stress currently experienced by the battery.

[0072] In the above process, the embodiments of the present invention effectively screen out key variables characterizing the instantaneous physical pressure currently experienced by the battery through the Simu Variates Filter, and obtain historical time series data input and simulation time state quantity input, providing accurate excitation for subsequent model processing.

[0073] Step S2: Variable feature embedding.

[0074] Specifically, the historical time series data and simulation time state variables selected in step S1 are input into... Figure 2 The top left section (b) contains the Variate Tokens Embedding module. This module maps the values ​​in the physical space to a high-dimensional support space, constructing a query vector representing the characteristics of the current operating condition. This query vector will be used to retrieve similar operating condition patterns from historical memory.

[0075] Among them, Variate Tokens Embedding demonstrates the process of embedding multidimensional real-time variables into a high-dimensional support space. This step maps the current and temperature values ​​in the physical space into high-dimensional feature vectors, constructing a query vector representing the current operating condition characteristics, which is used to retrieve similar operating condition patterns in historical memory later.

[0076] In the above process, the embodiments of the present invention transform physical quantities into feature vectors suitable for model processing through variable feature embedding, laying the foundation for subsequent attention calculation.

[0077] Step S3: Sequence decomposition.

[0078] Specifically, historical physical parameters, including voltage, current, temperature, SOC, and state of charge / discharge, are input into the Decomp (sequence decomposition module). This module physically separates these historical inputs into Seasonal Init and Trend Init. Physically, the trend term corresponds to the gradual decay of the battery open-circuit voltage (OCV) or SOC baseline value, while the seasonal term corresponds to the ohmic voltage drop and transient polarization voltage caused by current fluctuations. This separation ensures that the model can independently handle high-frequency operating condition fluctuations and low-frequency charge changes. This embodiment of the invention, through sequence decomposition, enables the model to more accurately capture the different changing characteristics of the battery state.

[0079] Figure 2The central main body of the model showcases the Encoder-Decoder architecture, with the Decomp module at the bottom physically separating historical inputs into Seasonal Init and Trend Init branches. Physically, the trend branch corresponds to the gradual decay of the battery open-circuit voltage (OCV) or SOC baseline, while the seasonal branch corresponds to the ohmic voltage drop and transient polarization voltage caused by current fluctuations. This separation ensures that the model can independently handle high-frequency operating condition fluctuations and low-frequency charge changes.

[0080] Step S4: Self-attention calculation.

[0081] In the historical branch, the self-attention module is used to process the historical sequence. Specifically, this module calculates the self-correlation between historical time steps, generating key and value vectors. Physically, these vectors represent the battery's electrochemical inertia and voltage rebound effect over a past period. Through self-attention calculation, the model can extract dynamic response patterns from the historical sequence.

[0082] Figure 2 On the right (c) Self-Attention demonstrates the details of time-step self-correlation calculation within the historical branch. This module is used to extract dynamic response patterns in the historical sequence and generate key and value vectors, which physically characterize the electrochemical inertia and voltage rebound characteristics (Relaxation Effect) of the battery over a period of time.

[0083] Figure 2 The right side (d) illustrates the core logic of this invention through the Cross-Attention mechanism: A Query generated from a real-time covariate (current operating pressure) is used to retrieve Keys and Values ​​generated by matching historical features, and historical memory is dynamically weighted according to the current load intensity. For example, when a high-rate discharge (Query sudden change) is detected, similar voltage drop segments in the history are automatically monitored, and the fused nonlinear features are output. Finally, these features are combined with the trend branch (OCV benchmark) to output simu_outputs (i.e., SOC simulation values), thereby achieving real-time correction of ampere-hour integral drift under dynamic operating conditions.

[0084] In the above process, the embodiments of the present invention use a self-attention mechanism to deeply explore the inherent relationships in historical data, providing support for subsequent cross-attention calculations.

[0085] Step S5: Cross-attention calculation and SOC simulation value generation.

[0086] Specifically, the query vector generated in step S2 is used to retrieve the key vector and value vector corresponding to the historical features generated in step S4, and dynamic weighting is performed through Cross-Attention. When a high-rate discharge (Query mutation) is detected, similar voltage drop segments in the history are automatically monitored.

[0087] Furthermore, the fused nonlinear features output by the cross-attention mechanism are combined with the trend branch (OCV baseline) in step S3, and processed by a decoder network to finally output simu_outputs (i.e., SOC simulation values). This embodiment of the invention uses a cross-attention mechanism to dynamically adjust the focus on historical memory according to the current operating conditions, achieving real-time correction of ampere-hour integral drift under dynamic operating conditions, thereby obtaining accurate SOC simulation values.

[0088] Figure 3 The simulation results of SOC obtained from the above process are shown. The horizontal axis indicates the sampling time series (SampleIndex), and the vertical axis indicates the normalized SOC value. The red solid line (True) represents the true SOC value calibrated using high-precision laboratory equipment, serving as a reference standard; the blue solid line (Predicted) represents the real-time inference output of this invention based on the cross-attention model. It is evident that both exhibit high convergence under non-steady-state conditions, confirming that the model effectively captures the transient nonlinear characteristics of the battery using a covariate dynamic retrieval mechanism, and verifying its robustness in eliminating traditional integral accumulation drift.

[0089] Through the above process, this embodiment of the invention starts with the selection of simulation variables, accurately extracting key variables as excitation signals; transforming them into feature vectors suitable for model processing through variable feature embedding; independently handling different changes in battery state using sequence decomposition; mining the intrinsic relationships in historical data using a self-attention mechanism; and finally, dynamically adjusting the attention to historical memory according to the current operating conditions through a cross-attention mechanism to achieve accurate simulation of SOC. By comparing with the true SOC value calibrated by high-precision laboratory equipment, the robustness of this model in eliminating traditional integral accumulation drift is verified, demonstrating its ability to effectively capture the transient nonlinear characteristics of the battery and providing reliable technical support for battery management.

[0090] In one application scenario, the battery SOC online simulation method proposed in this embodiment of the invention is used to perform online SOC simulation of the battery in the BMS of an electric vehicle. The specific steps are as follows:

[0091] Step S1: System deployment and data collection.

[0092] Specifically, the SOC simulation system of this invention is first integrated into the BMS of an electric vehicle. This system includes a data acquisition module, a preprocessing module, a temporal encoder, a covariate encoder, a cross-attention module, and a decoder module. Simultaneously, a cloud server is used for model training, parameter updates, and large-scale data analysis.

[0093] Furthermore, parameters such as battery terminal voltage, loop current, module temperature, charge / discharge status, and operating mode are collected in real time through the BMS's analog front-end (AFE). The acquisition cycle is set to 1 second to ensure the real-time nature and continuity of the data.

[0094] Step S2: Data preprocessing.

[0095] Specifically, invalid values ​​(such as -99, 0, and abnormal voltage jumps) and transient pulse interference from sensors are removed from the collected data. Temperature, voltage, and current are filtered within reasonable ranges using interval rules, and these parameters are standardized to eliminate the influence of dimensions.

[0096] Furthermore, a sliding time window of 60 seconds is constructed to divide the continuous signal stream into historical time-series data for subsequent processing. Auxiliary covariates such as charge / discharge state, current rate, number of cycles, equalization index, and past SOC value are constructed based on the original signal to enhance the model's ability to express complex operating conditions.

[0097] Step S3: Temporal feature extraction.

[0098] Specifically, the preprocessed historical time-series data (L×D matrix, where D is the number of features, including voltage, current, temperature, etc.) is input into the time-series encoder. A multi-layer self-attention structure is used to extract long-term dependent features from the battery's historical time series. Through a multi-head self-attention mechanism, the voltage curve change trend is captured, current waveform features are identified, and temperature hysteresis characteristics are modeled to generate a fixed-dimensional historical feature representation vector H.

[0099] Step S4: Covariate feature extraction.

[0100] Specifically, real-time parameters such as voltage, current, and battery operating mode at the current moment are embedded, and a lightweight feedforward network is used to extract key influencing features C of the covariates. The extracted covariate features C are then used to construct a query vector for subsequent retrieval of similar operating conditions from historical memory.

[0101] Step S5: Cross-attention fusion and SOC simulation.

[0102] Specifically, using covariate feature C as the query and historical encoded feature H as the key and value, dynamic weighting is performed through a cross-attention module. When high-rate discharge or sudden temperature change is detected, the attention weight for the relevant time region is automatically adjusted to quickly focus on similar voltage drop or temperature change segments in the history.

[0103] Furthermore, a fused feature sequence F is generated through a cross-attention mechanism. This sequence combines historical time-series features with the real-time influence of current covariates, effectively improving the model's ability to fit complex working conditions. The fused feature sequence F is input into the decoder network, and after multiple layers of mapping, SOC simulation values ​​are generated. The decoder supports single-point simulation or multi-step simulation to meet the needs of different application scenarios. The model is trained using the MSE loss function, with Adam as the optimizer, ensuring the stability and convergence of the training process.

[0104] Step S6: Verify the implementation effect.

[0105] Specifically, in multi-scenario tests of energy storage systems and vehicle batteries, the method of this invention can control the average SOC error within 1-2% under dynamic operating conditions, which is a significant improvement compared to the drift problem of traditional integral methods and EKF under complex operating conditions. By comparing the true SOC value calibrated based on high-precision laboratory equipment (red solid line) with the real-time inference output of the model of this invention (blue solid line), both exhibit high convergence under non-steady-state conditions. This confirms that the model effectively captures the transient nonlinear characteristics of the battery using a covariate dynamic retrieval mechanism, and verifies its robustness in eliminating the drift accumulated by traditional integral methods.

[0106] Through the above process, this embodiment of the invention, starting from system deployment and data acquisition, and proceeding through steps such as data preprocessing, temporal feature extraction, covariate feature extraction, cross-attention fusion, and SOC simulation, ultimately achieves high-precision online battery SOC estimation. Multi-scenario testing verifies the effectiveness and robustness of this invention, providing reliable technical support for battery management in electric vehicles.

[0107] The following are embodiments of the apparatus of the present invention, which can be used to execute the online battery SOC simulation method involved in the present invention. For details not disclosed in the embodiments of the apparatus of the present invention, please refer to the method embodiments of the online battery SOC simulation method involved in the present invention.

[0108] Please see Figure 4 This invention provides a battery SOC online simulation device 800.

[0109] The battery SOC online simulation device 800 includes, but is not limited to: a data acquisition and preprocessing module 810, a time series matrix and covariate extraction module 830, a feature encoding and extraction module 850, and a feature fusion and SOC prediction module 870.

[0110] The data acquisition and preprocessing module 810 is used to acquire the battery's operating parameters in real time and perform preprocessing to obtain raw data. The operating parameters include voltage, current, temperature, charge / discharge status, power, cycle count, SOH, and cell balancing status. The preprocessing includes noise reduction, outlier filtering, and standardization.

[0111] The time series matrix and covariate extraction module 830 is used to construct a sliding window sequence for the original data and extract the auxiliary covariates of the battery at the current time to obtain the historical time series matrix and the current covariates; the auxiliary covariates include charge and discharge state, rate, number of cycles, balancing index, and historical SOC value.

[0112] The feature encoding and extraction module 850 is used to construct a temporal encoder using a multi-head self-attention structure, extract long-term dependency features from the historical time series matrix through the temporal encoder, generate historical feature representation vectors, and extract key influence features from the current covariates using a lightweight feedforward network.

[0113] The feature fusion and SOC prediction module 870 is used to construct a fused feature sequence using key impact features as query vectors and historical feature representation vectors as key and value vectors. The fused feature sequence is processed by a decoder network to generate SOC simulation values, and the SOC prediction value of the battery is obtained based on the SOC simulation values.

[0114] It should be noted that the battery SOC online simulation provided in the above embodiments is only an example of the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed. That is, the internal structure of the battery SOC online simulation device will be divided into different functional modules to complete all or part of the functions described above.

[0115] Furthermore, the battery SOC online simulation device and the battery SOC online simulation method provided in the above embodiments belong to the same concept, and the specific way in which each module performs its operation has been described in detail in the method embodiments, and will not be repeated here.

[0116] Figure 5 A schematic diagram of the structure of an electronic device according to an exemplary embodiment is shown.

[0117] It should be noted that this electronic device is merely an example adapted to the present invention and should not be construed as providing any limitation on the scope of use of the present invention. Furthermore, this electronic device should not be interpreted as requiring or depending on having... Figure 5 One or more components of the exemplary electronic device 2000 shown.

[0118] The hardware structure of electronic devices 2000 can vary significantly due to differences in configuration or performance, such as... Figure 5 As shown, the electronic device 2000 includes: a power supply 210, an interface 230, at least one memory 250, and at least one central processing unit (CPU) 270.

[0119] Specifically, power supply 210 is used to provide operating voltage for various hardware devices on electronic device 2000.

[0120] Interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. Of course, in other examples adapted to this invention, interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input / output interface 235, and at least one USB interface 237, etc. Figure 5 As shown, this does not constitute a specific limitation.

[0121] The memory 250 serves as a carrier for resource storage and can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored on it include the operating system 251, application programs 253, and data 255, etc., and the storage method can be temporary storage or permanent storage.

[0122] The operating system 251 is used to manage and control the various hardware devices and application programs 253 on the electronic device 2000, so as to enable the central processing unit 270 to perform calculations and processing on the massive data 255 in the memory 250. It can be Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0123] Application 253 is a computer-readable instruction based on operating system 251 that performs at least one specific task, and may include at least one module ( Figure 5 (Not shown), each module can contain computer-readable instructions for the electronic device 2000. For example, the battery SOC online simulation device can be considered as application program 253 deployed on the electronic device 2000.

[0124] Data 255 may be signal information, etc., and is stored in memory 250.

[0125] The central processing unit 270 may include one or more processors and is configured to communicate with the memory 250 via at least one communication bus to read computer-readable instructions stored in the memory 250, thereby performing operations and processing on massive amounts of data 255 stored in the memory 250. For example, a battery SOC online simulation method can be implemented by the central processing unit 270 reading a series of computer-readable instructions stored in the memory 250.

[0126] Furthermore, the present invention can also be implemented through hardware circuits or a combination of hardware circuits and software. Therefore, the implementation of the present invention is not limited to any specific hardware circuit, software, or combination thereof.

[0127] Please see Figure 6 This invention provides an electronic device 4000, which may include: a desktop computer, a laptop computer, a server, etc., with sensor recognition capabilities.

[0128] exist Figure 6 In this context, the electronic device 4000 includes at least one processor 4001 and at least one memory 4003.

[0129] The data interaction between the processor 4001 and the memory 4003 can be achieved through at least one communication bus 4002. This communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0130] Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.

[0131] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this invention. Processor 4001 may also be a combination that implements computing functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0132] The memory 4003 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program instructions or code in the form of instructions or data structures and accessible by the electronic device 4000, but not limited thereto.

[0133] The memory 4003 stores computer-readable instructions, and the processor 4001 can read the computer-readable instructions stored in the memory 4003 through the communication bus 4002.

[0134] The computer-readable instructions are executed by one or more processors 4001 to implement the battery SOC online simulation method in the above embodiments.

[0135] Furthermore, this embodiment of the invention provides a storage medium storing computer-readable instructions, which are executed by one or more processors to implement the battery SOC online simulation method as described above.

[0136] This invention provides a computer program product, which includes computer-readable instructions stored in a storage medium. One or more processors of an electronic device read the computer-readable instructions from the storage medium, load and execute the computer-readable instructions, thereby enabling the electronic device to implement the battery SOC online simulation method as described above.

[0137] Compared with related technologies, the beneficial effects of the present invention are:

[0138] 1. This invention can significantly improve the accuracy of SOC simulation; by introducing a cross-attention mechanism, it enhances the sensitivity to covariates (such as current, voltage, temperature, etc.) and effectively captures the nonlinear coupling relationship between these quantities, thereby achieving higher accuracy SOC simulation under complex operating conditions (such as frequent charging and discharging, pulse load, high-rate operating conditions).

[0139] 2. This invention has real-time update and online inference capabilities; by designing a lightweight model structure and combining it with an efficient attention mechanism, the model can generate SOC simulation values ​​in milliseconds, meeting the stringent real-time requirements of energy storage systems and electric vehicle BMS, and ensuring the immediacy and accuracy of system operation.

[0140] 3. This invention can effectively reduce error accumulation; unlike the traditional coulomb measurement method that relies on current integration, this scheme does not rely on the integration process, but significantly reduces the cumulative drift caused by sensor error and noise through multi-source feature fusion and dynamic attention adjustment, thereby improving the stability of long-term prediction.

[0141] 4. This invention has strong generalization ability; through intelligent data sampling strategies (including time-layered sampling, variable load sampling, and difficult case priority sampling) and cross-attention mechanism to dynamically adapt to complex working conditions, the model can better handle SOC behavior under varying conditions such as battery aging, different driving conditions, and different charging rates, demonstrating excellent generalization performance.

[0142] 5. This invention has strong scalability and supports parallel inference for multiple battery cells. Through the combined design of feature compression and hierarchical attention, the model reduces computational complexity while maintaining high accuracy, enabling the system to be easily scaled up to parallel operation of thousands of battery cells. It is very suitable for the centralized or distributed SOC estimation needs of large-scale energy storage power stations.

[0143] 6. This invention enhances the model's adaptability to complex operating conditions; by uniformly encoding and multi-source fusion of historical SOC information and physical quantities (such as voltage, current, temperature, etc.) collected by the BMS, the model can more comprehensively describe the battery state, including its historical behavior and current operating conditions, thereby maintaining stable performance under various complex operating conditions.

[0144] 7. This invention improves model training efficiency and generalization ability; it adopts a multi-strategy data sampling method to balance the training data coverage of different stages such as charging, discharging, and resting, while identifying and prioritizing difficult sample samples (such as extreme working conditions such as high rate and low temperature), effectively improving the model's training efficiency and generalization ability under complex working conditions.

[0145] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0146] The above description is only a partial embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A battery SOC online simulation method, characterized in that, The method includes: The battery's operating parameters are collected in real time and preprocessed to obtain raw data. The operating parameters include voltage, current, temperature, charge / discharge state, power, cycle count, state of equilibrium (SOH), and cell balancing status. The preprocessing includes noise reduction, outlier filtering, and standardization. A sliding window sequence is constructed for the original data, and the auxiliary covariates of the battery at the current moment are extracted to obtain the historical time series matrix and the current covariates; the auxiliary covariates include charge / discharge state, rate of charge, number of cycles, balancing index and historical SOC value; A multi-head self-attention structure is used to construct a time encoder, and the time encoder extracts long-term dependency features from the historical time matrix to generate a historical feature representation vector. A lightweight feedforward network is used to extract key influence features from the current covariate. Using the key influencing features as the query vector and the historical feature representation vector as the key vector and value vector, a fused feature sequence is constructed. The fused feature sequence is then processed by a decoder network to generate a SOC simulation value. Based on the SOC simulation value, the SOC prediction value of the battery is obtained.

2. The battery SOC online simulation method as described in claim 1, characterized in that, The real-time acquisition of battery operating parameters, followed by preprocessing to obtain raw data, includes: The battery's operating parameters are collected in real time through the analog front-end (AFE) integrated into the battery management system (BMS). The operating parameters are then denoised, invalid values ​​are removed, and outliers are filtered out using interval rules. Finally, the data is standardized to obtain the original data.

3. The battery SOC online simulation method as described in claim 1, characterized in that, The process involves constructing a sliding window sequence for the original data and extracting the auxiliary covariates of the battery at the current time step to obtain the historical time series matrix and the current covariates, including: Based on the preprocessed original data, a sliding window sequence of a set length is constructed. The continuous signal stream in the original data is divided into historical time series data through the sliding window sequence to obtain a historical time series matrix. The auxiliary covariates of the battery at the current moment are extracted from the original data; the historical time series matrix is ​​used to reflect the accumulation of polarization voltage and historical state inertia inside the battery; the auxiliary covariates are used to characterize the instantaneous physical pressure currently experienced by the battery.

4. The battery SOC online simulation method as described in claim 1, characterized in that, The process employs a multi-head self-attention structure to construct a temporal encoder, and uses this temporal encoder to extract long-term dependency features from the historical time-series matrix. Generate historical feature representation vectors, including: A timing encoder is constructed using a multi-head self-attention structure; the timing encoder is used to capture the correlation between different time steps in the historical timing sequence through a multi-head mechanism, and to extract the voltage curve change trend, current waveform characteristics and temperature hysteresis characteristics. The historical time series matrix is ​​extracted using the time encoder to obtain a historical feature representation vector; the historical feature representation vector is used to characterize the electrochemical inertia and voltage rebound characteristics of the battery over a period of time.

5. The battery SOC online simulation method as described in claim 1, characterized in that, The extraction of key influencing features from the current covariates using a lightweight feedforward network includes: The current covariate is embedded and mapped to a high-dimensional support space to construct a query vector representing the characteristics of the current working condition. A lightweight feedforward network is used to extract the key influencing features of the current covariate. The lightweight feedforward network is used to reduce computational complexity and retain features that have a significant impact on SOC prediction.

6. The battery SOC online simulation method as described in claim 1, characterized in that, The construction of a fused feature sequence using the key impact features as the query vector and the historical feature representation vector as the key vector and value vector includes: Using the key impact features as the query vector and the historical feature representation vector as the key vector and value vector, the weights of the key vector and value vector are dynamically adjusted through a cross-attention mechanism, and a fused feature sequence is generated by combining the query vector. When the load changes suddenly or the battery ages, the attention weight of the corresponding time region is automatically adjusted. The adjustment of the attention weight is used to improve the sensitivity to charge and discharge nonlinearity and to compensate for the deviation caused by aging, rate and voltage hysteresis.

7. The battery SOC online simulation method as described in claim 1, characterized in that, The process of generating a simulated SOC value by processing the fused feature sequence through a decoder network, and obtaining a predicted SOC value for the battery based on the simulated SOC value, includes: The fused feature sequence is subjected to multi-layer nonlinear mapping through a decoder network to generate SOC simulation values, and the SOC prediction value of the battery is obtained based on the SOC simulation values; the decoder network supports single-point simulation and multi-step simulation.

8. A battery SOC online simulation device, characterized in that, The device includes: The data acquisition and preprocessing module is used to acquire the battery's operating parameters in real time and perform preprocessing to obtain raw data. The operating parameters include voltage, current, temperature, charge / discharge state, power, cycle count, state of equilibrium (SOH), and cell balancing status. The preprocessing includes noise reduction, outlier filtering, and standardization. The time series matrix and covariate extraction module is used to construct a sliding window sequence for the original data and extract the auxiliary covariates of the battery at the current time to obtain the historical time series matrix and the current covariates; the auxiliary covariates include charge / discharge state, rate of charge, number of cycles, balancing index and historical SOC value; The feature encoding and extraction module is used to construct a temporal encoder using a multi-head self-attention structure, extract long-term dependency features from the historical time series matrix through the temporal encoder, generate a historical feature representation vector, and extract key influencing features from the current covariate using a lightweight feedforward network. The feature fusion and SOC prediction module is used to construct a fused feature sequence using the key influencing features as query vectors and the historical feature representation vectors as key and value vectors, process the fused feature sequence through a decoder network to generate SOC simulation values, and obtain the SOC prediction value of the battery based on the SOC simulation values.

9. An electronic device, characterized in that, include: At least one processor and at least one memory, wherein, The memory stores computer-readable instructions; The computer-readable instructions are executed by one or more of the processors, causing the electronic device to implement the battery SOC online simulation method as described in any one of claims 1 to 7.

10. A storage medium having computer-readable instructions stored thereon, characterized in that, The computer-readable instructions are executed by one or more processors to implement the battery SOC online simulation method as described in any one of claims 1 to 7.