Method and device for acquiring residual electric energy of battery, and storage medium
By dividing and optimizing the time-series data of lithium-ion batteries into time windows, and training the target calculation model, the problem of insufficient prediction accuracy and generalization ability of the remaining dischargeable energy of lithium-ion batteries under complex dynamic conditions is solved, and high-precision prediction of the remaining battery energy is achieved, which meets the needs of practical applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-28
AI Technical Summary
Existing technologies struggle to accurately predict the remaining dischargeable energy of lithium-ion batteries under complex dynamic operating conditions, resulting in insufficient prediction accuracy and generalization ability, which limits their application in practical scenarios.
By acquiring sample time-series data of sample batteries under different operating conditions, using time window partitioning and optimization processing to obtain target sub-data, training the target calculation model, and combining data feature enhancement and time-series weakening, high-precision prediction of battery remaining energy can be achieved.
It improves the prediction accuracy and generalization ability of the remaining dischargeable energy of lithium-ion batteries, adapts to complex dynamic operating conditions, simplifies the model training process, lowers the implementation threshold, and ensures the safe and efficient operation of the battery system.
Smart Images

Figure CN121933936A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of battery data processing, specifically relating to methods and devices for obtaining remaining battery energy, and storage media. Background Technology
[0002] With the rapid development of the new energy industry, lithium-ion batteries, with their outstanding advantages such as high energy density, recyclability, and low self-discharge, have been widely used in many key fields such as energy storage systems, aerospace, and electric vehicles, becoming a core energy component supporting the high-quality development of related industries. Remaining dischargeable energy (RDE), as a core state parameter of lithium-ion batteries, is defined as the total energy that a battery can release before discharging to its cutoff voltage under highly random and fluctuating real-world operating conditions, based on its current state. Its accurate calculation is directly related to the efficient realization of peak shaving and valley filling and frequency regulation functions in energy storage systems, as well as the operational safety and range reliability of electric vehicles and aerospace equipment. It is a crucial fundamental indicator for rationally controlling the active power output of battery systems and ensuring stable equipment operation.
[0003] Meanwhile, to meet the usage requirements of different scenarios, batteries often face complex and variable operating environments. Factors such as charging and discharging power, temperature, and cycle count all have nonlinear effects on their remaining dischargeable energy, posing a significant challenge to accurate prediction. Currently, the mainstream RDE prediction methods in the industry mainly include three categories: power integration method, adaptive filter method, and traditional data-driven method. These methods are affected by factors such as battery aging and fluctuations in operating conditions, which easily generate significant cumulative errors and are difficult to adapt to complex dynamic operating conditions. Alternatively, they are highly dependent on the accuracy of the battery model, but the battery model parameters are affected by nonlinear interference from multiple factors such as battery model, ambient temperature, and cycle count. Real-time accurate acquisition requires full life cycle experiments, which limits the application scenarios. In other words, for battery systems with unknown initial states, existing methods often fail to achieve accurate prediction, further limiting their promotion and application in practical scenarios.
[0004] Therefore, how to overcome the existing technological bottlenecks, adapt to complex dynamic working conditions, and achieve high prediction accuracy and strong generalization ability when obtaining the remaining dischargeable energy of the battery is a key technical problem that urgently needs to be solved in the field of lithium-ion battery state estimation. Summary of the Invention
[0005] The purpose of this application is to overcome the bottlenecks of existing technology, adapt to complex dynamic working conditions, and achieve high prediction accuracy and strong generalization ability when obtaining the remaining dischargeable energy of the battery.
[0006] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.
[0007] According to one aspect of the embodiments of this application, a method for obtaining the remaining electrical energy of a battery is provided, the method comprising: Obtain sample time-series data of the sample battery under different operating conditions for charge-discharge cycles; The time series data of each sample is divided using a time window to obtain multiple initial sub-data; Each of the initial sub-data is optimized to obtain the target sub-data. The optimization process includes at least one of data feature enhancement and data temporal weakening. The initial computational model is trained using the target sub-data to obtain the target computational model; In response to the power calculation command, the historical time-series data of the applied battery in the current charge-discharge cycle is input into the target calculation model, so that the target calculation model can calculate the remaining power of the applied battery based on the historical time-series data.
[0008] According to one aspect of the embodiments of this application, each of the initial sub-data is optimized to obtain target sub-data, including: Obtain the correlation between each type of data in the sample time series data and the remaining battery power; Data types with a correlation greater than a set correlation threshold are considered strongly correlated data. The target sub-data is obtained by copying and retaining the strongly correlated data in the initial sub-data a set number of times.
[0009] According to one aspect of the embodiments of this application, optimizing each of the initial sub-data to obtain target sub-data further includes: For a portion of the time step data in the initial sub-data, position swapping is performed within a set time series range; Randomly select from the time step data during location swapping to obtain at least one winning result; The winning data is replaced with random data to obtain the target sub-data. The random data is obtained based on the initial sub-data in which the time step data is located.
[0010] According to one aspect of the embodiments of this application, training an initial computational model using the target sub-data to obtain a target computational model includes: The initial calculation model is used to extract features from each target sub-data to obtain data features; Based on the data characteristics, the predicted remaining electrical energy corresponding to each of the target sub-data is calculated; The absolute value of the difference between the predicted remaining energy and the standard remaining energy is used as the error value to train the initial calculation model, thereby obtaining the target calculation model.
[0011] According to one aspect of the embodiments of this application, training an initial computational model using the target sub-data to obtain a target computational model further includes: Select one time step data from the target sub-data as the target time step data; The first predicted remaining electrical energy is obtained by forward derivation from the target sub-data starting point to the target time step data; The second predicted remaining electrical energy is obtained by reverse derivation from the target sub-data endpoint to the target time step data; The predicted remaining energy is calculated based on the first and second predicted remaining energy. The absolute value of the difference between the predicted remaining energy and the standard remaining energy is used as the prediction error to train the initial calculation model and obtain the target calculation model.
[0012] According to one aspect of the embodiments of this application, the absolute value of the difference between the predicted remaining energy and the standard remaining energy is used as the prediction error to train the initial calculation model to obtain a target calculation model, including: Obtain the value range of various adjustment parameters of the initial calculation model; Take one value from the range of each of the aforementioned adjustment parameters to obtain the initial parameters; Obtain multiple different initial parameters and calculate the prediction error of the initial calculation model under each of the initial parameters; The target parameters are determined based on the prediction error, and the target calculation model is determined based on the target parameters.
[0013] According to one aspect of the embodiments of this application, determining target parameters based on the prediction error, and determining a target calculation model based on the target parameters, includes: The initial parameters corresponding to the initial calculation model with the smallest prediction error are taken as the initial target parameters; Based on the initial target parameters, the range of values for each adjustment parameter in the initial calculation model is narrowed, and the initial parameters are redefined. The initial target parameters are determined based on the latest acquired initial parameters in order to narrow the value range of each adjustment parameter in the initial calculation model. The initial calculation model with the smallest prediction error is selected as the target calculation model until the number of times the initial parameters are selected reaches a set number, or the number of times the prediction error increases reaches a preset value.
[0014] According to one aspect of the embodiments of this application, historical time-series data of the applied battery in the current charge-discharge cycle is input into the target calculation model, so that the target calculation model calculates the remaining electrical energy of the applied battery based on the historical time-series data, including: The target computation model is controlled to select a time step data as anchor data from historical time series data; the time of acquisition of the anchor data is later than the midpoint time of the historical time series data; From the starting point of the historical time series data to the anchor point data, a forward derivation is performed to obtain the third predicted remaining electrical energy; By reverse derivation from the end point of the historical time series data to the anchor point data, the fourth predicted remaining power is obtained; The remaining energy is calculated based on the third and fourth predicted remaining energy.
[0015] According to one aspect of the embodiments of this application, a device for obtaining the remaining energy of a battery is provided, including a memory, a processor, and a readable program stored in the memory, wherein the processor executes the readable program to implement the method described in any of the above.
[0016] According to one aspect of the embodiments of this application, a readable storage medium is provided, on which a readable program / instruction is stored, which, when executed by a processor, implements the method described in any one of the above-described embodiments.
[0017] In this application, sample time-series data of a sample battery under different operating conditions for charge-discharge cycles are obtained; each sample time-series data is divided using a time window to obtain multiple initial sub-data; each initial sub-data is optimized to obtain target sub-data, wherein the optimization includes at least one of data feature enhancement and data time-series weakening; the target sub-data is used to train an initial calculation model to obtain a target calculation model; in response to an energy calculation command, the historical time-series data of the applied battery in the current charge-discharge cycle is input into the target calculation model, so that the target calculation model calculates the remaining energy of the applied battery based on the historical time-series data.
[0018] In this embodiment, by collecting sample time-series data under different operating conditions, comprehensive training data coverage is ensured, providing the model with a rich learning foundation for adapting to various scenarios and improving its adaptability to complex operating conditions. Time window segmentation breaks down long time-series data into initial sub-data, facilitating the model's capture of local time-series patterns while reducing computational complexity. Feature enhancement highlights the value of data strongly correlated with remaining energy, while time-series de-emphasis avoids model overfitting. Both optimize data quality, helping the model accurately learn core patterns. The model is trained based on the optimized target sub-data, leveraging the advantages of data-driven approaches, eliminating the need for complex physical modeling, and significantly improving prediction accuracy and reliability. In actual calculations, simply inputting historical time-series data of the application battery allows for rapid output of results, simplifying operation, adapting to actual usage needs, and ensuring the safe and efficient operation of the battery system. This overcomes existing technological bottlenecks, enabling adaptation to complex dynamic operating conditions and providing high prediction accuracy and strong generalization ability when acquiring the remaining dischargeable energy of the battery.
[0019] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.
[0020] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0022] Figure 1 A schematic diagram of a method for obtaining remaining battery energy according to an embodiment of this application is shown.
[0023] Figure 2 A flowchart illustrating the optimization processing of each initial sub-data according to an embodiment of this application to obtain target sub-data is shown.
[0024] Figure 3 A flowchart illustrating the optimization processing of each initial sub-data according to another embodiment of this application to obtain target sub-data is shown.
[0025] Figure 4 A flowchart is shown illustrating a target computational model obtained by training an initial computational model using target sub-data according to an embodiment of this application.
[0026] Figure 5 A flowchart is shown showing the training of an initial computational model using target sub-data to obtain a target computational model according to another embodiment of this application.
[0027] Figure 6 The flowchart illustrates a method for training an initial calculation model to obtain a target calculation model by using the absolute value of the difference between the predicted remaining energy and the standard remaining energy as the prediction error, according to one embodiment of this application.
[0028] Figure 7 A flowchart is shown illustrating a process for determining target parameters based on prediction errors according to an embodiment of this application, in order to determine a target computational model based on the target parameters.
[0029] Figure 8A flowchart is shown, according to an embodiment of this application, in which historical time-series data of an applied battery in the current charge-discharge cycle is input into a target computing model, and the target computing model calculates the remaining electrical energy of the applied battery based on the historical time-series data.
[0030] Figure 9 A block diagram of a computer device for performing a method for obtaining remaining battery power according to an embodiment of this application is shown. Detailed Implementation
[0031] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.
[0032] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.
[0033] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0034] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily need to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0035] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0036] Please see Figure 1 , Figure 1 A schematic diagram of a method for obtaining remaining battery energy according to an embodiment of this application is shown. This application embodiment provides the execution steps of a method for obtaining remaining battery energy, including: Step S110: Obtain sample time-series data of the sample battery under different operating conditions for charge-discharge cycles; Step S120: Divide the time series data of each sample into multiple initial sub-data using time windows; Step S130: Optimize each initial sub-data to obtain the target sub-data. The optimization process includes at least one of data feature enhancement and data temporal weakening. Step S140: Train the initial computational model using the target sub-data to obtain the target computational model; Step S150: In response to the energy calculation command, the historical time series data of the applied battery in the current charge-discharge cycle is input into the target calculation model, so that the target calculation model can calculate the remaining energy of the applied battery based on the historical time series data.
[0037] The five steps described above are described in detail below.
[0038] First, it's important to clarify that battery remaining energy refers to the remaining dischargeable energy (RDE) of a battery. This means the total energy a battery can release before continuously discharging to a safe cutoff voltage, based on its current state (including aging level, current charge level, temperature, etc.) under random and fluctuating operating conditions (such as acceleration and deceleration of electric vehicles, sudden power supply from energy storage devices). The unit is usually watt-hours (Wh) or kilowatt-hours (kWh). Compared to State of Charge (SOC): SOC is a relative proportion (e.g., 50%), only indicating the percentage of remaining capacity relative to the total capacity; battery remaining energy is an absolute energy value (e.g., 20kWh), directly reflecting the actual amount of energy the battery can release, and is more aligned with engineering application requirements.
[0039] In step S110, the sample battery (which may be a lithium battery) is used to provide training data. The operating conditions cover various working conditions encountered in actual battery use, including static conditions with a fixed charge / discharge rate and dynamic conditions with fluctuating charge / discharge power (such as electric vehicle acceleration, sudden power supply from energy storage devices, etc.). A charge-discharge cycle is the complete process of discharging the battery from a fully charged state to the cutoff voltage and then recharging it to a fully charged state. The sample time-series data consists of continuously recorded battery operating parameters in chronological order, including voltage, current, state of charge (SOC), temperature, discharge energy gain coefficient, and charging energy efficiency.
[0040] For example, charge-discharge cycles are performed using different charge-discharge rates for various operating conditions. Alternatively, under various operating conditions, charge-discharge cycles are performed at different set temperatures and charge-discharge rates, and data is collected from the sample batteries to obtain multiple sample time-series data. In some embodiments, one sample time-series data is generated for each charging cycle, or discharging cycle, or charge-discharge cycle.
[0041] For the sample battery, various working conditions in actual use are simulated, allowing it to complete multiple charge-discharge cycles. At the same time, the above parameters are continuously recorded at fixed time intervals (e.g., 1 second / time) using professional testing equipment to form a complete sample time series dataset, ensuring that the data covers all possible working states of the battery.
[0042] In some embodiments, the sample battery is of the same type as the application battery to be tested.
[0043] In step S120, the time window is a preset fixed-length time segment (e.g., 10 minutes); the division is to cut a single continuous long time series data (e.g., 60 minutes of data in one charge-discharge cycle) into multiple overlapping or continuous short data blocks, i.e., initial sub-data, according to the time window length.
[0044] In some embodiments, each segment of sample time series data is overlapped and cut according to a preset time window length. For example, a 60-minute long data is divided into 10-minute windows to obtain 51 initial sub-data that are superimposed sequentially from minute 1 to minute 10, minute 2 to minute 11, and so on.
[0045] In step S130, the optimization process is a process of improving data quality and adapting it to model training. Data feature enhancement highlights the role of data strongly correlated with remaining electrical energy, while data temporal weakening reduces the model's dependence on fixed data temporal sequences to avoid overfitting; the target sub-data is high-quality data that meets the model training requirements after optimization.
[0046] In some embodiments, data feature enhancement can retain only parameters with strong correlations to the remaining battery energy based on the correlation between the various types of parameters in the initial sub-data and the battery's remaining energy.
[0047] Data feature enhancement can also be achieved through mathematical methods, calculating the correlation between various parameters in the initial sub-data and the remaining battery energy. Strongly correlated data (such as voltage and SOC) with correlations exceeding a set threshold are selected and replicated a set number of times to reinforce core information.
[0048] The correlation between the parameters of each type in the initial sub-data and the remaining battery energy can be calculated in the following way.
[0049]
[0050] in, x This indicates the remaining electrical energy of the battery. y This represents a parameter of type y in the initial sub-data. i x represents a parameter of type i in the i-th initial sub-data. i Indicates y i The corresponding remaining electrical energy. r This refers to the correlation between the two. This method allows for the calculation of the correlation between each type of parameter in the initial sub-data and the remaining electrical energy. 'n' refers to the number of parameter types in the initial sub-data.
[0051] In some embodiments, the sample time-series data exists in an ordered temporal sequence, with each time unit called a time step, and each time step corresponding to data, called time step data. Data temporal weakening refers to shuffling the order of the time step data in the initial sub-data.
[0052] In other words, time step data is the sample time-series data and the basic unit of initial sub-data. It refers to a complete set of data (including voltage, current, SOC, etc. at that moment) corresponding to a single time point when battery operating parameters are continuously recorded at fixed time intervals (such as 1 second, 10 seconds). For example, if the battery state is recorded once every 1 second, the voltage, current, and other data recorded at each moment, such as the 1st second, the 2nd second, etc., are each a time step data. Multiple consecutive time step data are strung together to form a complete initial sub-data. Multiple initial sub-data make up the sample time-series data, which is also the basic unit for subsequent time window division and data optimization processing.
[0053] In some embodiments, data temporal weakening can involve swapping the positions of some time-step data within a set temporal range of the initial sub-data, and then randomly selecting some winning data from the swapped data and replacing it with a random number within the numerical range of the corresponding type parameter in the initial sub-data, thereby ensuring data rationality while breaking fixed temporal dependencies.
[0054] In step S140, the initial computational model is a basic model with data processing and prediction capabilities (such as a TCN-Bi-GRU combined network). Training is the process of inputting the target sub-data into the model and adjusting the model parameters through error feedback. The target computational model is the final model that, after training, can accurately establish the mapping relationship between data features and remaining electrical energy.
[0055] The optimized target sub-data is input into the initial calculation model. The initial calculation model extracts features from the data, calculates the predicted remaining energy corresponding to each target sub-data, and then uses the error between the predicted value and the actual remaining energy (the standard value pre-calculated in the sample time series data) as feedback to continuously adjust the internal parameters of the model until the model prediction accuracy reaches the set requirements, thus forming a stable and usable target calculation model.
[0056] In some embodiments, cyclic data of charge-discharge cycles of sample batteries under different operating conditions are collected. The cyclic data is divided into sample time-series data and validation data according to a set ratio. The target calculation model is validated using the validation data. If the error is less than a set error threshold, the target calculation model is put into use. If the error threshold is greater than or equal to the set threshold, the target calculation model is redefined.
[0057] The set ratio is a pre-defined allocation ratio between the two types of data, determined based on the total amount of data and model requirements; the sample time series data is the core data used to train the initial computational model and must be of sufficient scale to support model learning; the validation data is a dataset independent of the sample time series data, used to test the model's generalization ability and avoid model overfitting.
[0058] For example, the total amount of collected cyclic data (e.g., 410 cycles) is separated into two groups using a random partitioning algorithm according to a set ratio (usually 7:3 or 8:2, and 9:1 when the data volume is small). During partitioning, the operating condition distribution and battery health status distribution of the two types of data are consistent to avoid data bias. For example, 1000 sets of cyclic data are partitioned in a 7:3 ratio to obtain 700 sets of sample time-series data (for early model training) and 300 sets of validation data (for subsequent model performance testing). After partitioning, they are stored separately to avoid cross-contamination.
[0059] Validation is the process of inputting validation data into the target calculation model and evaluating the model's performance by comparing the predicted results with the actual values. Error is the deviation between the predicted remaining energy output by the model and the standard remaining energy corresponding to the validation data (obtained through cyclical capacity verification measurements). It can be represented by absolute error, relative error, or root mean square error (RMSE). The error threshold is a qualified limit determined based on actual application requirements (e.g., prediction error of power batteries ≤ ±3%).
[0060] Input 300 sets of validation data into the target calculation model according to a preset format. The model outputs the predicted remaining energy corresponding to each set of data. Calculate the error between the predicted remaining energy and the standard remaining energy (such as the mean absolute percentage error). If the error is less than a set threshold (such as 2.33%), the model performance is deemed satisfactory and can be put into practical application. If the error is greater than or equal to the set threshold (such as exceeding 5%), return to the data optimization (such as reprocessing the cyclic data), model training (such as adjusting the network structure), or parameter optimization (such as iteratively optimizing and adjusting parameters) steps, and re-execute the training process to obtain a new target calculation model until the validation error meets the requirements.
[0061] This application embodiment collects charge-discharge cycle data of sample batteries under different operating conditions, covering complex scenarios commonly encountered in actual use such as temperature, discharge rate, and dynamic load. This ensures the comprehensiveness and representativeness of the data, providing high-fidelity basic data for the verification of the target calculation model and avoiding the problem of insufficient generalization ability of the target calculation model caused by single-condition data. The sample time-series data and verification data are randomly divided according to a set ratio. This ensures that the sample time-series data is large enough to support the initial calculation model's full learning, while the independent verification data objectively verifies the predictive performance of the target calculation model, effectively avoiding the risk of overfitting and ensuring the authenticity of the evaluation results. The target calculation model is judged based on a set error threshold. The determination of whether a target calculation model is put into use clarifies the qualification standard for the performance of the target calculation model. This threshold aligns with industry standards and practical application needs, ensuring that the target calculation model put into use has sufficient prediction accuracy and can accurately output the remaining energy of lithium-ion batteries. When the error does not meet the standard, the target calculation model is redefined, forming a closed-loop optimization mechanism of training, verification, and iteration. This further improves the reliability and adaptability of the target calculation model, eliminating the need for complex battery physics modeling, lowering the threshold for method implementation, and ensuring that the target calculation model can cope with diverse operating conditions in practical applications. This significantly enhances the engineering practicality and application value of the entire data-driven method for predicting the remaining dischargeable energy of lithium-ion batteries.
[0062] In step S150, the applied battery is the battery whose remaining energy needs to be calculated in actual use (it can be a lithium battery), and the energy calculation command is a signal that triggers the acquisition of the battery's remaining energy (such as a user-initiated query or a system-automatic detection command); the historical time-series data can be the time-series data of the applied battery from the start of the current charge-discharge cycle to the time the command is triggered. At this time, the length of the historical time-series data is equal to all historical data of the battery in the current charge-discharge cycle.
[0063] Historical time-series data can be battery data retrieved from the battery before the power measurement command trigger time, tracing back to a set duration. In this case, the length of the historical time-series data can be the same as the initial sub-data. Alternatively, historical time-series data can be battery data generated within a set duration after the battery has run for the specified time, starting from the power measurement command trigger time. In this case, the length of the historical time-series data can also be the same as the initial sub-data. In other words, in the latter two cases, the historical time-series data does not represent all historical data of the battery in the current charge-discharge cycle, but only a small portion of all historical data in the current charge-discharge cycle.
[0064] The target calculation model analyzes input data and outputs the remaining energy value through learned mapping relationships. Upon receiving an energy calculation command, it collects historical time-series data of the current charge-discharge cycle of the application battery, organizes it in a format consistent with the sample time-series data, and inputs it into the target calculation model. The model quickly analyzes the data characteristics and, based on the patterns learned during training, accurately outputs the remaining energy of the application battery.
[0065] In some embodiments, a target calculation model corresponding to the application battery is determined based on the type or model of the application battery. The remaining electrical energy of the application battery is then calculated using the target calculation model.
[0066] This application's embodiments comprehensively cover actual battery usage scenarios by collecting sample time-series data under different operating conditions, providing rich and realistic basic data for model training. This significantly improves the model's adaptability to complex dynamic operating conditions and avoids the prediction limitations caused by single-condition data. Time window division breaks down long time-series data into lightweight initial sub-data, reducing the model's computational burden and helping the model capture local time-series patterns, thus improving training and prediction efficiency. The data feature enhancement in the optimization process highlights the value of data strongly correlated with remaining energy, helping the model focus on core patterns. Data time-series weakening effectively avoids the model's over-reliance on data time-series, reduces overfitting, and significantly improves data quality and model generalization ability. Model training based on optimized target sub-data, relying on data-driven advantages, eliminates the need to build complex battery physical models, avoiding the technical difficulties of accurately obtaining battery internal parameters and lowering the implementation threshold of the method. In actual calculations, only historical time-series data of the applied battery needs to be input to quickly output results. The operation is simple, the response is rapid, and the prediction accuracy is high, providing a reliable basis for energy storage system scheduling and electric vehicle range judgment, effectively ensuring the safe and stable operation of the battery system.
[0067] Please see Figure 2 , Figure 2A flowchart illustrating the optimization processing of each initial sub-data according to an embodiment of this application to obtain target sub-data is shown. The embodiment of this application provides step S130 of optimizing each initial sub-data to obtain target sub-data, including: Step S131a: Obtain the correlation between each type of data and the remaining battery energy in the sample time series data; Step S132a: Data of each type with a correlation greater than the set correlation threshold are classified as strongly correlated data; Step S133a: Copy and retain the strongly correlated data in the initial sub-data a set number of times to obtain the target sub-data.
[0068] The above three steps are described in detail below.
[0069] In step S131a, the sample time series data refers to the set of battery operating parameters (such as voltage, current, state of charge (SOC), temperature, etc.) recorded in chronological order and obtained by dividing the data into time windows; the remaining battery energy is the remaining dischargeable energy (RDE), which refers to the total energy that the battery can release when discharged to the cutoff voltage in its current state; the correlation is a quantitative indicator that measures the degree of correlation between a certain type of data and the remaining energy, with a value ranging from -1 to 1, and the closer the absolute value is to 1, the stronger the correlation.
[0070] A correlation analysis algorithm is invoked to analyze each type of parameter (such as voltage and current data) in the sample time-series data, calculating the degree of correlation between it and the known standard value of remaining battery energy. This yields a correlation value for each type of data, providing a basis for subsequent screening of key data. A higher correlation value indicates a stronger correlation.
[0071] In step S132a, the relevant threshold is a predefined standard for judging whether the data is critical (e.g., 0.8, which can be adjusted according to actual training needs); strongly correlated data refers to a type of data that is closely related to the remaining battery power and has a significant impact on the prediction results.
[0072] The correlation values of various data obtained in step S131a are compared with the set correlation threshold. Data types with correlation values greater than the threshold are selected as strongly correlated data (for example, the correlation values of voltage and SOC data are 0.85 and 0.82 respectively, both of which are greater than the threshold of 0.8, and are therefore determined to be strongly correlated data). This clarifies the core data that the model training needs to focus on.
[0073] In step S133a, the initial sub-data is a short data block divided by a time window, which is the original object for optimization processing. The set number of replications refers to a predetermined number of replications (e.g., 2 or 3 times, set according to data characteristics and model requirements) used to strengthen the effect of strongly correlated data. Replication retention involves repeatedly adding strongly correlated data to the original initial sub-data without deleting existing data. The target sub-data is the final data that, after being strengthened by replicating strongly correlated data, highlights core information and is suitable for model training.
[0074] For each initial sub-data set, identify the strongly correlated data columns (such as voltage and SOC columns). Copy these data columns a predetermined number of times, and then merge the copied data with the original initial sub-data set (for example, if the original data contains three columns: voltage, current, and temperature, with voltage and SOC being strongly correlated, after two copies, the data columns become voltage, voltage, voltage, SOC, SOC, SOC, current, and temperature). This ultimately forms the target sub-data set with enhanced core information. Each initial sub-data set corresponds to one target sub-data set.
[0075] In some embodiments, only the strongly correlated data in the initial sub-data are retained to obtain the target sub-data corresponding to the initial sub-data.
[0076] In this embodiment, by acquiring the correlation between various types of data and the remaining battery energy, the core data that plays a crucial role in the prediction results can be accurately identified, avoiding irrelevant or weakly correlated data from interfering with the model's learning direction. This solves the problem of insufficient key information in the initial sub-data. Setting relevant thresholds and filtering strongly correlated data provides clear and quantifiable standards for data filtering, ensuring the consistency and rationality of the filtering results and avoiding bias caused by subjective judgment. Copying and retaining strongly correlated data a set number of times can significantly strengthen the weight of core information in the target sub-data, making it easier for the model to capture the core mapping pattern between data and remaining energy during training, thereby improving model learning efficiency and training accuracy. The final target sub-data has prominent core features and higher data quality, meeting the training requirements of data-driven models and providing solid data support for the high-precision prediction of the subsequent target calculation model.
[0077] Please see Figure 3 , Figure 3 A flowchart illustrating the optimization processing of each initial sub-data according to another embodiment of this application to obtain target sub-data is shown. This embodiment of the application provides step S130 of optimizing each initial sub-data to obtain target sub-data, including: Step S131b: For a portion of the time step data in the initial sub-data, perform position swapping within a set time series range; Step S132b: Randomly select from the time step data of the location exchange to obtain at least one winning data; Step S133b: Replace the winning data with random data to obtain target sub-data. The random data is obtained based on the initial sub-data in which the time step data is located.
[0078] The three steps described above are described in detail below.
[0079] In step S131b, the initial sub-data is a short data block (such as a 10-minute sequence of voltage, current, and other parameters) obtained after dividing the data into time windows, which is the original object for optimization processing. Time step data is the basic unit of time series data, referring to a complete set of battery parameters (voltage, current, SOC, etc.) corresponding to a single time point (such as the 3rd second). Setting the time series range is a pre-defined time interval for partial time step data that can be swapped (such as 20% before and after the time step data or no more than 15% of the data block length), to avoid excessive data disruption that could cause the time series features to fail. Position swapping is the operation of interchange the arrangement order of partial time step data within the set range.
[0080] For each initial sub-data set, a portion of time steps are randomly selected from the range (e.g., the 3rd, 5th, and 8th time steps). Then, a preset time series range is determined (e.g., a data block containing 100 time steps is set with a set number of time steps before and after it, such as 15). The positions of these time steps are then swapped (e.g., the 3rd and 9th time step data are swapped, and the 5th and 12th time step data are swapped). This breaks the fixed temporal arrangement of the data and reduces the model's dependence on a specific order.
[0081] In step S132b, the time step data for position swapping refers to all time step data for which position swapping was completed in step S131b. Random sampling is the process of randomly selecting from the swapped time step data according to a preset proportion or quantity. The selected data are the time step data that are chosen and subsequently require replacement.
[0082] The total amount of time step data that completed the position exchange in step S131b is counted (e.g., a total of 8 time step data were exchanged). The data is randomly selected according to preset rules (e.g., 2 are selected at a fixed rate or 30% is selected (rounded down or up, or if the rounded down result is zero, then the rounded up result is selected)). The selected time step data is the winning data (e.g., 2 are selected from 8), and the object of the subsequent replacement operation is determined.
[0083] In step S133b, the random data is virtual data used to replace the winning data, and the values of various parameters in it must meet the requirements of rationality. Specifically, the value range of the random data must be limited to the maximum and minimum values of the corresponding type of data in the initial sub-data to which the winning data belongs (e.g., if the voltage range of a certain initial sub-data is 3.0-3.6V, the random number of the voltage data in the replacement data must be within this range) to ensure the logical consistency of the data.
[0084] For each winning data, first extract the numerical range of the corresponding type of data in its initial sub-data (e.g., the current data range is 0.5-2.0A, and the SOC range is 30%-70%). Then, generate corresponding random numbers in the numerical range of each type of data using a random algorithm. Use these random numbers to completely replace the original parameters in the winning data, and finally form the target sub-data with weakened time-series dependency.
[0085] This optimization process involves swapping the positions of some time-step data within a defined time series range. This breaks the fixed temporal arrangement of the initial sub-data, preventing overfitting due to excessive reliance on the sequential features of the data during model training and effectively improving the model's generalization ability. Randomly selecting winning data from the swapped time-step data ensures the randomness and objectivity of the replacement operation, avoiding data bias caused by human intervention. Replacing the winning data with random data based on the numerical range of its initial sub-data ensures the rationality of the replaced data and further weakens the temporal correlation of the data. This allows the initial calculation model to focus more on learning the core mapping pattern between the data and the remaining battery energy, rather than memorizing specific time series combinations. The resulting target sub-data has low temporal dependence and strong anti-interference ability, meeting the training requirements of data-driven models and providing high-quality data support for the subsequent accurate prediction of the target calculation model under complex operating conditions.
[0086] In some embodiments, the initial sub-data may first undergo data feature enhancement, and then data temporal sequence weakening may be performed to obtain the target sub-data. Alternatively, the initial sub-data may first undergo data temporal sequence weakening, and then data feature enhancement may be performed to obtain the target sub-data.
[0087] For example, the correlation between various types of data and the remaining battery energy in the sample time series data is obtained; data types with a correlation greater than a set correlation threshold are identified as strongly correlated data; the strongly correlated data in each initial sub-data are copied and retained a set number of times to obtain the initial optimized data corresponding to each initial sub-data; then, the positions of some time step data in the initial optimized data are swapped within a set time series range; random sampling is performed on the time step data where the positions are swapped to obtain multiple winning data; the winning data are replaced with random data, and the random data is obtained according to the initial sub-data in which the time step data is located.
[0088] Alternatively, for a portion of the time-step data in the initial sub-data, position swaps are performed within a set time series; random sampling is then performed on the position-swapped time-step data to obtain multiple winning data; these winning data are replaced with random data to obtain the initial optimized data. Then, based on the correlation between each type of data in the initial optimized data and the remaining battery power, data types with a correlation greater than a set correlation threshold are designated as strongly correlated data; the strongly correlated data in each initial optimized data set are copied and retained a set number of times to obtain the target sub-data corresponding to the initial optimized data.
[0089] Please see Figure 4 , Figure 4 A flowchart illustrating the process of training an initial computational model using target sub-data to obtain a target computational model according to an embodiment of this application is shown. This embodiment provides step S140 of training an initial computational model using target sub-data to obtain a target computational model, including: Step S141: Extract features from each target sub-data using the initial calculation model to obtain data features; Step S142: Calculate the predicted remaining electrical energy corresponding to each target sub-data based on the data characteristics; Step S143: The absolute value of the difference between the predicted remaining energy and the standard remaining energy is used as the error value to train the initial calculation model and obtain the target calculation model.
[0090] The above three steps are described in detail below.
[0091] In step S141, the initial computational model is a model framework with basic data processing and learning capabilities (such as a TCN-Bi-GRU combined network (Temporal Convolutional Neural Network, TCN; (BidirectionalGated Recurrent Unit, Bi-GRU)) that has not been trained on the target sub-data and only possesses potential feature extraction and prediction capabilities. The target sub-data is high-quality data that has been optimized by enhancing data features or weakening time series, highlighting core information and exhibiting strong resistance to overfitting. Feature extraction is the process by which the model mines key information related to the remaining battery energy in the target sub-data through internal algorithms (such as the dilated causal convolution of TCN). Data features are high-dimensional information extracted that reflects the changing patterns of remaining energy (such as voltage drop rate features, current fluctuation features, and SOC correlation features).
[0092] All previously optimized target sub-data are input into the initial computation model according to a preset format. The model processes each target sub-data layer by layer through its internal hierarchical structure (such as convolutional layers of a TCN), filtering redundant information and strengthening core correlation information. Finally, it outputs high-dimensional data features corresponding to each target sub-data that can be used for subsequent prediction. It is important to note that each target sub-data corresponds to one data feature.
[0093] In step S142, the data features are the core correlation information extracted in step S141, and are the basis for establishing the mapping relationship between the target sub-data and the battery's remaining energy. The predicted remaining energy is the theoretical remaining dischargeable energy (RDE) of the battery calculated by the initial calculation model based on the data features. The initial calculation model uses internally preset mapping rules (such as the fully connected layer operation of a neural network) to transform high-dimensional data features into specific energy values.
[0094] After receiving the high-dimensional data features of each target sub-data, the initial calculation model integrates and quantizes the features through internal computational layers (such as fully connected layers), and establishes the correspondence between the features and the remaining electrical energy by combining the initial parameters of the model (such as weights and biases), and finally outputs the predicted remaining electrical energy value (unit such as Wh) corresponding to each target sub-data.
[0095] In some embodiments, the predicted remaining electrical energy predicted based on data features refers to the prediction result corresponding to the last time step of the target sub-data corresponding to the data features.
[0096] Based on the temporal nature of the target sub-data, the data features corresponding to each target sub-data also possess temporal characteristics. When determining the predicted remaining energy for any data feature corresponding to a target sub-data, if there are data features before and after that data feature, a forward derivation is performed from the first data feature in the target sub-data to that data feature to obtain a forward predicted value. A reverse derivation is performed from the last data feature in the target sub-data to that data feature to obtain a reverse predicted value. The predicted remaining energy is then calculated based on the forward and reverse predicted values.
[0097] If there are no data features preceding this data feature (the sample battery has just started using it), then the predicted remaining energy value corresponding to this data feature is 100%. If there are no data features following this data feature (the sample battery has stopped discharging), then the predicted remaining energy value corresponding to this data feature is 0.
[0098] In step S143, the standard remaining energy is the actual remaining dischargeable energy (true value) of the battery corresponding to the target sub-data, obtained through experimental measurement or precise detection; the error value is the absolute difference between the predicted remaining energy and the standard remaining energy, which can objectively reflect the degree of deviation of the prediction result; in some embodiments, the error value is backpropagated to adjust the internal parameters of the initial calculation model (such as convolution kernel weights and gating unit parameters) in an iterative process; the target calculation model is the final usable model after parameter optimization, in which the prediction error meets the set requirements.
[0099] First, obtain the standard remaining energy (true value) corresponding to each target sub-data. Calculate the difference between each predicted remaining energy and the standard value and take the absolute value to obtain the error value corresponding to each target sub-data. Then, use the error value as a feedback signal to adjust the internal parameters of the initial calculation model through the backpropagation algorithm (such as reducing the feature weight ratio corresponding to data with large errors). Iterate and repeat the process of feature extraction, prediction calculation, error feedback, and parameter adjustment until the overall error value of the initial calculation model stabilizes within the set range. The initial calculation model at this time is the target calculation model.
[0100] In some embodiments, data features are obtained by extracting features from the target sub-data using a TCN network module. Then, a Bi-GRU is used to calculate the predicted remaining energy corresponding to each target sub-data based on the data features.
[0101] TCN, an improvement on convolutional neural network models, was proposed to address temporal sequence problems. The TCN algorithm captures long-term dependencies in sequences hierarchically through the collaborative work of causal convolution, dilated convolution, and residual connections. TCN comprises several components: causal convolution (considering only current and past data, ignoring future data, adhering to the cause-effect relationship); dilated convolution (expanding the receptive field without increasing computation (e.g., a kernel size of 3 and a dilation factor of 2 allow viewing data from 6 time steps ago), capturing long-term patterns); residual connections (addressing the problem of deep networks failing to learn (avoiding gradient vanishing), combining simple shallow features with complex deep features); and the ReLU activation function (randomly disabling some neurons (the model's computational units) to prevent rote memorization and resist overfitting).
[0102] Please see Figure 5 , Figure 5A flowchart illustrating the process of training an initial computational model using target sub-data to obtain a target computational model according to another embodiment of this application is shown. Embodiments of this application provide steps for training an initial computational model using target sub-data to obtain a target computational model, including: Step S201: Select a time step data from the target sub-data as the target time step data; Step S202: Perform forward derivation from the target sub-data starting point to the target time step data to obtain the first predicted remaining electrical energy; Step S203: Perform reverse derivation from the target sub-data endpoint to the target time step data to obtain the second predicted remaining electrical energy; Step S204: Calculate the predicted remaining energy based on the first predicted remaining energy and the second predicted remaining energy; Step S205: The absolute value of the difference between the predicted remaining energy and the standard remaining energy is used as the prediction error to train the initial calculation model and obtain the target calculation model.
[0103] The above five steps are described in detail below.
[0104] In step S201, the target sub-data is a high-quality short data block (containing time-series parameters such as voltage, current, and SOC) optimized through data feature enhancement or time-series weakening, and it is the core data for model training. Time step data is the basic unit of time-series data, referring to a complete set of battery parameters corresponding to a single time point. Target time step data is specific time-point data selected from the target sub-data for focused prediction and is the core node of bidirectional derivation. Furthermore, the target time step data has other time step data before and after it within its respective target sub-data.
[0105] For each target sub-data (e.g., a 10-minute data block containing 100 time steps), select a data point from all time step data as the target time step data (e.g., the 30th time step data) randomly or according to a preset rule (e.g., uniform distribution) based on the model training requirements, thus clarifying the core object for subsequent derivation.
[0106] In step S202, the target sub-data starting point refers to the first time step data of the data block (such as the data corresponding to the first time step of the 10-minute data block); forward derivation refers to the process of gradually calculating from the data starting point of the target sub-data to the target time step data according to the time sequence. The core is to use historical time series characteristics to predict the remaining power; the first predicted remaining power is the theoretical remaining dischargeable energy (RDE) corresponding to the target time step data obtained by forward derivation.
[0107] Start the initial calculation model (such as Bi-GRU network), take the starting point of the target sub-data as the starting point, extract the data from the starting point to the target time step in time order, and derive it step by step through the internal calculation of the model, and finally output the first predicted remaining power corresponding to the target time step data.
[0108] In step S203, the target sub-data endpoint refers to the last time step data of the data block (such as the 100th time step of a 10-minute data block); reverse derivation refers to the process of reversing the time sequence from the data endpoint of the target sub-data to the target time step data. The core is to use subsequent time series characteristics to verify the remaining power; the second predicted remaining power is the theoretical remaining dischargeable energy corresponding to the target time step data obtained by reverse derivation, which complements the first predicted remaining power in both directions.
[0109] Using the inverse operation module of the initial calculation model, starting from the endpoint of the target sub-data, the features of the data from the endpoint to the target time step are extracted in reverse time order. Combined with the model's ability to capture subsequent trends, the second predicted remaining electrical energy corresponding to the target time step is finally output.
[0110] In step S204, the predicted remaining energy is the final theoretical remaining energy of the target time step data obtained by comprehensively deducing the bidirectional results. Its calculation core is to allocate weights based on the position of the target time step to achieve reasonable integration of the bidirectional results. The weights are coefficients determined according to the proportion of the distance from the target time step data to the starting point and the ending point (e.g., the ratio of the length from the target time step data to the starting point to the total length of the target sub-data is the first weight, and the ratio of the length to the ending point to the total length is the second weight).
[0111] For example, first calculate the weight allocation ratio. If the total length of the target sub-data is 100 time steps, and the target time step is the 30th time step, then the first weight = 30 / 100 = 0.3 (forward derivation of weight), and the second weight = 70 / 100 = 0.7 (reverse derivation of weight). Then, calculate the predicted remaining energy using the formula: "Predicted remaining energy = First predicted remaining energy × First weight + Second predicted remaining energy × Second weight," to obtain the predicted remaining energy fused with bidirectional information. This is the predicted remaining energy of the target sub-data at the target time step.
[0112] In step S205, the standard remaining energy corresponding to the target time step data is obtained, the difference between the predicted remaining energy and the standard value is calculated and the absolute value is taken as the prediction error of the target sub-data where the target time step data is located; the error values of all target sub-data are summarized and fed back to the initial calculation model through the backpropagation algorithm, the internal parameters of the model are adjusted to reduce the error, and the process of selecting points, bidirectional derivation, error calculation and parameter adjustment is repeated until the overall error of the model meets the set requirements, and the target calculation model is obtained.
[0113] In this embodiment, the initial computational model training step selects target time step data from the target sub-data and focuses on core prediction nodes, making the initial computational model training more targeted and avoiding inaccurate pattern capture caused by indiscriminate learning of the overall data. Forward derivation fully utilizes historical time series features, while reverse derivation effectively combines subsequent trend information. The bidirectional derivation mode can comprehensively explore the temporal correlation patterns of the data, making up for the omission of some features by single-direction derivation, and significantly improving the comprehensiveness and accuracy of predicting remaining energy. The fusion calculation method based on the weight allocation of the target time step position makes the combination of bidirectional derivation results more logical. The weights are dynamically adjusted with the position to adapt to the feature emphasis of different time nodes, further optimizing the prediction accuracy. The initial computational model training uses the absolute error between the predicted value and the standard value as feedback, which can objectively reflect the prediction deviation, avoid training distortion caused by the cancellation of positive and negative errors, and ensure the effectiveness of the initial computational model parameter optimization. The final target computational model has a stronger ability to capture temporal patterns and higher prediction accuracy, providing core support for the accurate measurement of battery remaining energy.
[0114] Please see Figure 6 , Figure 6 The flowchart illustrates a method, according to an embodiment of this application, for training an initial computational model using the absolute value of the difference between the predicted remaining energy and the standard remaining energy as a prediction error to obtain a target computational model. The embodiment of this application provides step S143 or step S205, which includes using the absolute value of the difference between the predicted remaining energy and the standard remaining energy as a prediction error to train an initial computational model to obtain a target computational model. Step S301: Obtain the value range of various adjustment parameters of the initial calculation model; Step S302: Take a value from the range of each adjustment parameter to obtain the initial parameter; Step S303: Obtain multiple different initial parameters and calculate the prediction error of the initial calculation model under each initial parameter; Step S304: Determine the target parameters based on the prediction error, and then determine the target calculation model based on the target parameters.
[0115] The above four steps are described in detail below.
[0116] In step S301, the initial computational model is a model framework with basic learning capabilities, but it has not undergone parameter optimization. The adjustment parameters are the adjustable core parameters within the initial computational model (such as the number of hidden layer nodes, learning rate, and convolutional kernel size), which directly affect the prediction performance of the initial computational model. The value range is a pre-defined range of legal values for each adjustment parameter (such as learning rate 0.001-0.01, number of hidden layer nodes 32-128) to avoid chaotic parameter values that could lead to model failure.
[0117] Based on the type of the initial calculation model and training requirements, combined with industry experience or pre-experiment results, determine the minimum and maximum values of each type of adjustment parameter, forming a clear list of value ranges to provide a basis for subsequent parameter selection.
[0118] In step S302, the initial parameters are a set of specific numerical combinations selected from the value range of each adjustment parameter, and are temporary operating parameters of the initial calculation model.
[0119] For each adjustment parameter, a value is selected from its range according to a random algorithm or uniform sampling rule. The selected values of all adjustment parameters are combined to form a complete set of initial parameters (such as learning rate 0.005, number of hidden layer nodes 64, and convolution kernel size 3).
[0120] In step S303, multiple different initial parameters are obtained by repeating step S302, which involves multiple sets of parameter combinations to ensure coverage of the key areas of the parameter value range. The prediction error is the absolute difference between the predicted residual energy and the standard residual energy output by the initial calculation model under a certain set of initial parameters, reflecting the adaptability of that set of parameters.
[0121] Repeat step S302 multiple times to generate multiple different sets of initial parameter combinations (e.g., 50 sets, 100 sets); substitute each set of initial parameters into the initial calculation model, train it using the target sub-data, calculate the model prediction error value corresponding to each set of parameters, and record the correspondence between the error value and the initial parameters.
[0122] In step S304, the target parameter is the set of initial parameters with the smallest prediction error among multiple sets of initial parameters, which is the optimal operating parameter of the model; the target calculation model is the final model with high-precision prediction capability after updating the adjustment parameters of the initial calculation model to the target parameter.
[0123] By comparing the prediction errors corresponding to all combinations of initial parameters, the initial parameter with the smallest error value is selected as the target parameter. The original adjustment parameters of the initial calculation model are replaced with the target parameter to complete the model parameter optimization and obtain the target calculation model with the best performance.
[0124] In this embodiment, by clearly defining the range of values for the initial computational model adjustment parameters, model training failure caused by chaotic parameter values is avoided, providing clear boundaries for parameter selection and ensuring the orderliness of the training process. Selecting multiple different initial parameters and calculating the corresponding prediction errors can fully cover the key areas of parameter values, avoiding the omission of optimal solutions caused by single parameter combinations and improving the comprehensiveness of parameter optimization. Determining the target parameters based on the prediction error ensures that the selected parameters can make the model prediction accuracy optimal, effectively reducing prediction bias and improving the stability and reliability of the target computational model. The final target computational model is based on the optimized parameters.
[0125] Please see Figure 7 , Figure 7 A flowchart illustrating the process of determining target parameters based on prediction error, according to an embodiment of this application, and then determining a target computational model based on the target parameters, is shown. This embodiment provides step S304, which involves determining target parameters based on prediction error and then determining a target computational model based on the target parameters, including: Step S401: Take the initial parameters corresponding to the initial calculation model with the smallest prediction error as the initial target parameters; Step S402: Based on the initial target parameters, narrow the range of values for each adjustment parameter of the initial calculation model, and redetermine the initial parameters; Step S403: Determine the initial target parameters based on the latest acquired initial parameters to narrow the value range of each adjustment parameter in the initial calculation model; Step S404: Continue until the number of times the initial parameters are selected reaches a set number, or the number of times the prediction error increases reaches a preset value, and then use the initial calculation model with the smallest prediction error as the target calculation model.
[0126] The above four steps are described in detail below.
[0127] In step S401, the initial target parameter is the set with the smallest prediction error among multiple sets of initial parameters, which is the initial optimal benchmark for parameter optimization.
[0128] By comparing the previously obtained sets of initial parameters and their corresponding prediction errors, the initial parameter combination with the smallest error value is selected and defined as the initial target parameter, thus clarifying the core basis for narrowing the subsequent parameter range.
[0129] In step S402, narrowing refers to reducing the numerical range of each adjustment parameter centered on the initial target parameter (e.g., if the original learning rate range is 0.001-0.01 and the initial target parameter is 0.005, narrowing it to 0.003-0.007), thereby reducing the search range for invalid parameters. The initial parameters are then redefined within this narrowed range, and new parameter combinations are selected according to the rules.
[0130] Based on the values of each parameter of the initial target parameter, a reasonable shrinkage ratio is set (such as ±30% around the initial target parameter) to narrow the value range of each adjustment parameter; within the new value range, multiple different initial parameters are reselected by random sampling or uniform sampling to prepare for the next round of error calculation.
[0131] In step S403, the newly acquired initial parameters are the new parameter combinations selected within the narrowed range in step S402; this step is the core of iterative optimization, which further focuses on the optimal parameter region by updating the initial target parameters, thereby achieving gradual refinement of the value range.
[0132] Substitute the initial parameters redefined in step S402 into the initial calculation model, calculate the prediction error corresponding to each group of parameters, select the parameter combination with the smallest current error, and update it as the new initial target parameter; based on the new initial target parameter, further narrow the value range of each adjustment parameter to make the search range closer to the optimal parameter region.
[0133] In step S404, the set number of iterations is a pre-defined upper limit for parameter iterations (e.g., 100 times) to avoid infinite iterations. The prediction error increasing a certain number of times reaches a preset value means that the error corresponding to the newly selected initial target parameter is higher than the minimum error of the previous round multiple times, indicating that the current initial target parameter has exceeded the optimal parameter region. The target parameter is the one with the smallest prediction error throughout the entire iteration process and is the final optimal parameter of the model.
[0134] Repeat steps S402-S403 to continuously iterate the selection of parameters, calculation of errors, updating of initial target parameters and narrowing of range; stop iterating when the number of iterations reaches the set number, or when the number of newly calculated prediction errors exceeds the minimum error of the previous round by a preset value; determine the set with the smallest prediction error among all parameter combinations during the iteration process as the target parameter, and the corresponding model is the target calculation model.
[0135] In this embodiment, by first selecting the initial target parameters corresponding to the minimum error, a precise benchmark is provided for subsequent optimization, avoiding the omission of optimal solutions caused by blind searching. Based on the initial target parameters, the range of parameter values is gradually narrowed, effectively reducing the search area for invalid parameters, significantly improving parameter optimization efficiency, and reducing computational costs. By repeatedly iterating and updating the initial target parameters and continuously narrowing the range, precise focus on parameters is achieved, ensuring that the finally determined target parameters are the optimal solution within the current search range, significantly improving the prediction accuracy of the target calculation model. Using the number of selections or error changes as termination conditions avoids wasting resources through infinite iteration and prevents missing the optimal parameter region, ensuring the rationality and efficiency of the optimization process. The final target calculation model relies on the optimal parameters.
[0136] In some embodiments, the range of values for the adjustment parameters is narrowed in the following manner: First, the sensitivity of each adjustment parameter to the prediction error is calculated. For parameters with high sensitivity, a small-scale fine-grained narrowing is applied, while for parameters with low sensitivity, a large-scale coarse-grained narrowing is applied, thereby improving the targeting of the narrowing.
[0137] For example, first, fix the initial target parameters, and then make a small perturbation (e.g., ±10%) to each adjustment parameter within its original range. Calculate the rate of change of the prediction error before and after the perturbation; the larger the rate of change, the higher the sensitivity. For example, if the error change rate after perturbing the first initial parameter is 30%, and the error change rate after perturbing the second initial parameter is 12%, then the sensitivity of the first initial parameter is higher than that of the second initial parameter.
[0138] The adjustment parameters corresponding to each initial parameter are sorted according to their sensitivity. The adjustment parameters with the highest sensitivity (top 30%) are assigned high weights (preset), such as a contraction ratio of 20%-30%. The adjustment parameters with the lowest sensitivity (bottom 30%) are assigned low weights (preset), such as a contraction ratio of 40%-60%. The adjustment parameters with intermediate sensitivity are assigned medium weights (preset), such as a contraction ratio of 30%-40%. The minimum value of the high-weighted parameter is greater than the maximum value of the medium-weighted parameter, and the minimum value of the medium-weighted parameter is greater than the maximum value of the low-weighted parameter.
[0139] Finally, based on the initial target parameters, the shrinkage range of each parameter is calculated according to the allocated shrinkage ratio.
[0140] Furthermore, multi-fold cross-validation can be performed on all the narrowed parameter combinations. If the mean validation error is more than 5% higher than the error corresponding to the initial target parameters, the narrowing ratio is reduced by 10%, and the range is recalculated. This completes the narrowing of the value range of each adjustment parameter in the initial calculation model based on the initial target parameters.
[0141] This method ensures that each adjustment range narrowing is quick and effective.
[0142] Please see Figure 8 , Figure 8 This document illustrates a flowchart illustrating how, according to an embodiment of this application, historical time-series data of an applied battery in its current charge-discharge cycle is input into a target computing model, enabling the target computing model to calculate the remaining energy of the applied battery based on the historical time-series data. The embodiment of this application provides step S150, which involves inputting historical time-series data of an applied battery in its current charge-discharge cycle into a target computing model, enabling the target computing model to calculate the remaining energy of the applied battery based on the historical time-series data. Step S151: Control the target calculation model to select a time step data as anchor data from the historical time series data; the time of acquisition of the anchor data is later than the midpoint time of the historical time series data; Step S152: From the starting point of the historical time series data to the anchor point data, a forward derivation is performed to obtain the third predicted remaining power. Step S153: From the end point of the historical time series data to the anchor point data, reverse derivation is performed to obtain the fourth predicted remaining power. Step S154: Calculate the remaining energy based on the third and fourth predicted remaining energy.
[0143] The above four steps are described in detail below.
[0144] In step S151, the target calculation model is the final model with accurate prediction capabilities after training and optimization; the historical time-series data is a portion of the core data from the current charge-discharge cycle of the battery, including three acquisition scenarios: first, tracing back a set duration of battery data from the energy calculation command trigger time as the endpoint; second, continuing to run the battery data generated for a set duration from the energy calculation command trigger time as the starting point; and third, the complete historical data of the current charge-discharge cycle. Furthermore, in the first two scenarios, the data length can be consistent with the initial sub-data during model training to ensure compatibility with the model input; anchor data is a single time step data selected from the historical time-series data as the core node for bidirectional derivation (complete parameters such as voltage, current, and SOC corresponding to a single time point); the midpoint time is the midpoint of the total duration of the historical time-series data (e.g., if the set duration is 10 minutes, the midpoint is the 5th minute); acquisition time later than the midpoint means that the anchor data is selected from time steps after the midpoint, ensuring that the data is close to the current battery state.
[0145] The target calculation model filters anchor data from historical time-series data according to preset rules (such as randomly selecting or fixing the time steps within the last 30% of the data). For example, if the historical time-series data is 10 minutes long (consistent with the initial sub-data length), if it is a case where the operation continues for 10 minutes after the instruction is triggered, then one data point is selected as the anchor data from the time steps of the 6th to 10th minute; if it is a case of looking back 10 minutes, then the data point is selected from the 6th to 10th minute (corresponding to the latter half of the looking-back period), ensuring that the anchor data can reflect the recent operating status of the battery.
[0146] In step S152, the starting point of the historical time series data is the first time step of the selected data segment (e.g., the first minute of a 10-minute data set). Forward derivation is a process of gradually calculating from the starting point to the anchor point data in chronological order. The core is to use the historical time series characteristics within the data segment (e.g., voltage drop trends, current fluctuation patterns) to predict the remaining electrical energy. The third predicted remaining electrical energy is the theoretical remaining dischargeable energy (RDE) corresponding to the anchor point data obtained through forward derivation.
[0147] The target calculation model calls the forward calculation module, starting from the historical time series data starting point, and sequentially extracts the continuous time series features from the starting point to the anchor point. Combining the data features already learned by the model and the remaining power mapping relationship, it gradually deduces and calculates, and finally outputs the third predicted remaining power.
[0148] In step S153, the historical time series data endpoint is the last time step data of the selected data segment (such as the 10th minute of 10-minute data); the reverse derivation is the process of deducing from the endpoint to the anchor point data in reverse time sequence. The core is to use the subsequent trend characteristics within the data segment to verify the remaining power; the fourth predicted remaining power is the theoretical remaining dischargeable energy corresponding to the anchor point data obtained by reverse derivation, which forms a two-way complement with the third predicted remaining power.
[0149] The target calculation model calls the reverse calculation module, starting from the end point of the historical time series data, and extracts the time series features from the end point to the anchor point in reverse time order. Combining the model's ability to capture data trends, it reverses the deduction and outputs the fourth predicted remaining power, making up for the feature omissions of the single forward deduction.
[0150] In step S154, calculation refers to the process of fusing the third and fourth predicted remaining energy according to preset weights to obtain the final remaining energy; the weight allocation rules are consistent with those in the model training stage (e.g., based on the position of the anchor point data in the sub-historical data, the length ratio from the anchor point to the starting point and the ending point is used as the weight), ensuring the logical coherence of the derivation.
[0151] Using the same weighted fusion rules as in step S204, for example, if the anchor point data is at the 5th minute of the sub-historical data (10 minutes) (corresponding to a 5-minute length from the start point of the sub-data to the anchor point and a 5-minute length from the anchor point to the end point), then equal weights (0.5 each) are assigned, and the remaining energy is calculated according to "remaining energy = third predicted remaining energy × 0.5 + fourth predicted remaining energy × 0.5". If the anchor point position is biased towards the latter half, the weights can be dynamically adjusted (e.g., if the length from the anchor point to the start point is 3 minutes and the length to the end point is 7 minutes, then the weights are 0.3 and 0.7 respectively), and finally the accurate remaining energy of the applied battery is output.
[0152] In this embodiment, by flexibly defining the acquisition method of historical time-series data, it supports both tracing past data and subsequent supplementary data, while maintaining the data length consistent with the initial sub-data. This ensures model adaptability while reducing the complexity of data collection in practical applications, adapting to the measurement needs of different scenarios. Anchor point data later than the midpoint of the historical time-series data is selected, making the derivation benchmark closer to the current or recent operating state of the applied battery, reducing the interference of early invalid data on the prediction results, and significantly improving the timeliness and accuracy of the measurement. Forward derivation fully explores historical time-series characteristics, while reverse derivation effectively utilizes subsequent trends. The information, bidirectional derivation mode comprehensively covers the core laws of data, avoiding the limitations of single-direction derivation and further optimizing prediction accuracy; it adopts the weighted fusion rules of the model training stage to ensure the coherence and consistency of the derivation logic, reduce error accumulation, and avoid the technical difficulties of accurately obtaining internal parameters without relying on complex battery physical modeling; the whole process takes into account both flexibility and accuracy, and can stably adapt to the complex dynamic operating conditions of applied batteries, providing a reliable basis for practical scenarios such as energy storage system scheduling and electric vehicle range judgment, significantly improving the engineering practicality and implementation value of the entire battery remaining power acquisition method.
[0153] Figure 9 A block diagram of a computer device for performing a method for obtaining remaining battery power according to an embodiment of this application is shown.
[0154] It should be noted that, Figure 9 The computer device 800 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0155] like Figure 9 As shown, the computer device 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 802 or programs loaded from storage section 808 into random access memory (RAM). The RAM 803 also stores various programs and data required for device operation. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output interface 805 (I / O interface) is also connected to the bus 804.
[0156] The following components are connected to the input / output interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a local area network card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the storage section 808 as needed.
[0157] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit 801, it performs the various functions defined in the device of this application.
[0158] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor device, apparatus, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution device, apparatus, or apparatus. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution device, apparatus, or apparatus. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0159] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based device that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0160] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0161] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this application.
[0162] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0163] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for obtaining the remaining electrical energy of a battery, characterized in that, The method includes: Obtain sample time-series data of the sample battery under different operating conditions for charge-discharge cycles; The time series data of each sample is divided using a time window to obtain multiple initial sub-data; Each of the initial sub-data is optimized to obtain the target sub-data. The optimization process includes at least one of data feature enhancement and data temporal weakening. The initial computational model is trained using the target sub-data to obtain the target computational model; In response to the power calculation command, the historical time-series data of the applied battery in the current charge-discharge cycle is input into the target calculation model, so that the target calculation model can calculate the remaining power of the applied battery based on the historical time-series data.
2. The method according to claim 1, characterized in that, Each of the initial sub-data is optimized to obtain the target sub-data, including: Obtain the correlation between each type of data in the sample time series data and the remaining battery power; Data types with a correlation greater than a set correlation threshold are considered strongly correlated data. The target sub-data is obtained by copying and retaining the strongly correlated data in the initial sub-data a set number of times.
3. The method according to claim 1, characterized in that, The initial sub-data is optimized to obtain the target sub-data, and the optimization process is further performed on each of the initial sub-data. For a portion of the time step data in the initial sub-data, position swapping is performed within a set time series range; Randomly select from the time step data during location swapping to obtain at least one winning result; The winning data is replaced with random data to obtain the target sub-data. The random data is obtained based on the initial sub-data in which the time step data is located.
4. The method according to claim 1, characterized in that, The initial computational model is trained using the target sub-data to obtain the target computational model, including: The initial calculation model is used to extract features from each target sub-data to obtain data features; Based on the data characteristics, the predicted remaining electrical energy corresponding to each of the target sub-data is calculated; The absolute value of the difference between the predicted remaining energy and the standard remaining energy is used as the error value to train the initial calculation model, thereby obtaining the target calculation model.
5. The method according to claim 1, characterized in that, The initial computational model is trained using the target sub-data to obtain the target computational model, which also includes: Select one time step data from the target sub-data as the target time step data; The first predicted remaining electrical energy is obtained by forward derivation from the target sub-data starting point to the target time step data; The second predicted remaining electrical energy is obtained by reverse derivation from the target sub-data endpoint to the target time step data; The predicted remaining energy is calculated based on the first and second predicted remaining energy. The absolute value of the difference between the predicted remaining energy and the standard remaining energy is used as the prediction error to train the initial calculation model and obtain the target calculation model.
6. The method according to claim 4 or 5, characterized in that, The absolute value of the difference between the predicted surplus energy and the standard surplus energy is used as the prediction error to train the initial calculation model, resulting in a target calculation model, including: Obtain the value range of various adjustment parameters of the initial calculation model; Take one value from the range of each of the aforementioned adjustment parameters to obtain the initial parameters; Obtain multiple different initial parameters and calculate the prediction error of the initial calculation model under each of the initial parameters; The target parameters are determined based on the prediction error, and the target calculation model is determined based on the target parameters.
7. The method according to claim 6, characterized in that, Determining target parameters based on the prediction error, and then determining the target computational model based on the target parameters, includes: The initial parameters corresponding to the initial calculation model with the smallest prediction error are taken as the initial target parameters; Based on the initial target parameters, the range of values for each adjustment parameter in the initial calculation model is narrowed, and the initial parameters are redefined. The initial target parameters are determined based on the latest acquired initial parameters in order to narrow the value range of each adjustment parameter in the initial calculation model. The initial calculation model with the smallest prediction error is selected as the target calculation model until the number of times the initial parameters are selected reaches a set number, or the number of times the prediction error increases reaches a preset value.
8. The method according to claim 1, characterized in that, The historical time-series data of the applied battery in the current charge-discharge cycle is input into the target calculation model, so that the target calculation model calculates the remaining electrical energy of the applied battery based on the historical time-series data, including: The target computation model is controlled to select a time step data as anchor data from historical time series data; the time of acquisition of the anchor data is later than the midpoint time of the historical time series data; From the starting point of the historical time series data to the anchor point data, a forward derivation is performed to obtain the third predicted remaining electrical energy; By reverse derivation from the end point of the historical time series data to the anchor point data, the fourth predicted remaining power is obtained; The remaining energy is calculated based on the third and fourth predicted remaining energy.
9. A device for obtaining remaining battery energy, comprising a memory, a processor, and a readable program stored in the memory, characterized in that, The processor executes the readable program to implement the control method according to any one of claims 1 to 8.
10. A readable storage medium, characterized in that, It stores a readable program / instruction, which, when executed by a processor, implements the control method according to any one of claims 1 to 8.