Battery Life Prediction Method Based on Pre-trained Model-Guided Genetic Programming
By using a genetic programming method guided by a pre-trained Transformer model, combined with semantic backpropagation and mutation operations, the problems of insufficient accuracy and interpretability in battery life prediction are solved, achieving efficient and low-cost battery life prediction and feature recognition.
Patent Information
- Application Number
- CN202511971259.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2045-12-25
AI Technical Summary
Existing battery life prediction methods suffer from insufficient accuracy and poor interpretability, especially in scenarios with few samples. Furthermore, data-driven methods rely on large amounts of data and are costly, while symbolic regression methods are inefficient and depend on expert rules.
A genetic programming approach guided by a pre-trained Transformer model is adopted. By generating a guide population and combining it with a random population, selection, crossover and mutation operations are performed. Semantic backpropagation and semantic guidance from the pre-trained model are used to optimize the mathematical expression to improve prediction accuracy and efficiency.
It achieves high-precision battery life prediction under limited sample conditions, reduces data acquisition costs, and outputs mathematical expressions with clear physical meaning, enhancing the interpretability of the model and identifying key features affecting battery life.
Smart Images

Figure CN121389835B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of battery life prediction technology, and more particularly to a battery life prediction method based on pre-trained model-guided genetic programming. Background Technology
[0002] As a mainstream energy storage device, the accurate prediction of lithium-ion battery lifespan is crucial for guiding safe use and secondary utilization. Currently, battery lifespan prediction methods mainly fall into two categories: traditional methods based on physical models and data-driven methods utilizing machine learning models such as Support Vector Regression (SVR) and Extreme Gradient Boosting (XGBoost). However, these existing methods all have significant limitations. Physical model methods are prone to long-term prediction accuracy decline due to error accumulation; data-driven methods are generally limited by high data costs and lack generalization ability in scenarios with few samples.
[0003] More importantly, mainstream data-driven methods, such as SVR and XGBoost, are essentially "black box" models. While they can achieve high accuracy on specific datasets, their prediction process is opaque and cannot provide a concise mathematical expression with clear physical meaning. This inherent interpretability deficiency makes it difficult for researchers and engineers to glean insights into the key physical characteristics and underlying mechanisms affecting battery degradation from the models, severely hindering scientific decision-making in battery material optimization, manufacturing process improvement, and operation and maintenance strategies.
[0004] To overcome the limitations of "black box" models, symbolic regression technology has emerged, aiming to directly discover the underlying mathematical formulas from data. For example, Chinese patent application CN119066985A discloses such a method, which uses reinforcement learning to progressively select nodes from a symbol library under pre-defined logical constraints to construct a mathematical expression for predicting the fatigue life of turbine blades.
[0005] However, existing symbolic regression methods also have inherent bottlenecks. First, they heavily rely on reinforcement learning's random exploration from scratch, which is inefficient and slow to converge in the vast expression search space. Second, their performance is highly dependent on manually defined expert rules, but for complex battery systems, these rules are not only difficult to formulate completely, but may also limit the model's ability to discover better patterns. Therefore, developing a new model that can guarantee high prediction accuracy and interpretability while overcoming the core shortcomings of existing symbolic regression methods, such as low exploration efficiency and reliance on expert rules, has become a pressing technical bottleneck to be addressed in this field. Summary of the Invention
[0006] The purpose of this invention is to overcome the defects and shortcomings of the prior art and provide a battery life prediction method based on pre-trained model-guided genetic programming. The aim is to improve the accuracy and efficiency of battery life prediction in low-sample scenarios by guiding the genetic programming process through a pre-trained Transformer model, while reducing data acquisition costs and enhancing the interpretability of prediction results.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] A battery lifetime prediction method based on pre-trained model-guided genetic programming includes the following steps:
[0009] Define battery life prediction targets and battery cycle characteristics;
[0010] By using mathematical expressions containing battery cycle features, a set of data point pairs is generated, a training dataset is constructed, a Transformer model is pre-trained, and the mapping from battery cycle features to mathematical expressions is learned.
[0011] Collect battery cycle charge and discharge data, construct a battery dataset containing battery cycle characteristics, and preprocess the battery dataset containing battery cycle characteristics.
[0012] The battery dataset is input into a pre-trained Transformer model, which generates a pilot subpopulation and combines it with a randomly generated subpopulation to construct a hybrid initial population based on genetic programming.
[0013] The initial mixed population is iteratively evolved, with selection, crossover, and mutation operations performed. The mutation operation is executed based on semantic backpropagation and semantic guidance of the pre-trained Transformer model.
[0014] Determine whether the evolution has reached the termination condition. If the evolution terminates, output a mathematical expression. Input the battery cycle characteristics of the battery under test into the mathematical expression, and after calculation, obtain the battery life prediction result.
[0015] Furthermore, the battery life prediction target and battery cycle characteristics are defined as follows:
[0016] The battery life prediction target is the logarithm of the number of cycles when the battery capacity decays to a preset threshold. The battery cycle characteristics are numerical features extracted based on the current, voltage, and temperature data collected in the battery sample cyclic charge and discharge test.
[0017] Battery cycle characteristics include: the mean of the difference between the battery cycle discharge voltage curves, the variance of the difference between the battery cycle discharge voltage curves, the minimum of the difference between the battery cycle discharge voltage curves, the slope of the battery cycle capacity decay curve, the battery charging rate, the battery discharging rate, the average charging time of the battery cycle, the integral value of the battery cycle temperature, and the internal resistance value of the battery cycle.
[0018] Furthermore, using mathematical expressions containing battery cycling features, a set of data point pairs is generated to construct a training dataset. A Transformer model is pre-trained to learn the mapping from battery cycling features to mathematical expressions, specifically:
[0019] Build a containing m Training dataset for group data The i-th set of data is generated by a randomly generated mathematical expression that includes battery cycle characteristics. and based on The generated set of data point pairs Composition; among which This is the set of input points for battery cycle characteristics. for The corresponding calculation result for this mathematical expression;
[0020] Data point set As the input sequence, corresponding to the mathematical expression skeleton As the target output, a Transformer model with an encoder-decoder architecture is trained through an autoregressive generation task;
[0021] The Transformer model generates well-structured mathematical expressions from battery cycling feature data by minimizing the cross-entropy loss between the predicted skeleton and the true skeleton and by optimizing autoregressive modeling capabilities through batch gradient updates.
[0022] The final output expression skeleton is an abstract representation of the original mathematical expression, in which all numerical constants are replaced with a uniform placeholder symbol.
[0023] Furthermore, battery cycle charge-discharge data are collected to construct a battery dataset containing battery cycle characteristics, specifically:
[0024] Multiple battery samples were subjected to cyclic charge-discharge tests, and various signal data were recorded during the test. Taking the data acquisition of a single battery as an example, the process is as follows: In one complete charge-discharge cycle, the current I at each moment is recorded in time sequence. j (t), voltage V j (t) and temperature T j(t); and these signals are stored in cyclic order to form a dataset:
[0025] ;
[0026] Where j is the loop number and a is the total number of loops;
[0027] When the battery capacity decays to the number of cycles corresponding to a preset threshold, based on the dataset S Based on the definition of battery cycle characteristics, a battery dataset containing battery cycle characteristics is extracted through corresponding calculations.
[0028] Furthermore, the battery dataset containing battery cycling features is preprocessed, specifically as follows:
[0029] The battery dataset containing battery cycle characteristics is standardized to eliminate the dimensional differences between the features and transform it into a normal distribution with a mean of 0 and a standard deviation of 1.
[0030] Standard value of the cycle characteristic of the q-th battery in the p-th battery sample The calculation formula is:
[0031] ;
[0032] in, This represents the original data value of the cycle feature of the qth battery in the p-th battery sample. Let q be the mean of the q-th battery cycle feature across all battery samples. Let be the standard deviation of the q-th battery cycle characteristic across all battery samples.
[0033] Furthermore, the battery dataset is input into a pre-trained Transformer model, which generates a bootstrap subpopulation. This bootstrap subpopulation is then combined with the generated random subpopulation to construct a hybrid initial population based on genetic programming. Specifically:
[0034] The standardized battery dataset containing battery cycle features is input into a pre-trained Transformer model. The Transformer model generates a well-structured expression skeleton and converts it into a symbolic regression program tree, where constants are represented by placeholders.
[0035] Copy the program tree SP One, of which SP Total population size NP The preset percentage is used to slightly randomize the constant placeholders in each copy, forming a bootstrap subpopulation;
[0036] To ensure the diversity of the initial population, the classic population initialization method, the ramped half-and-half method, is adopted, generating a population of [number missing]. NP-SP A randomized program tree is generated to initialize random individuals, specifically including:
[0037] Using any feature or constant in the battery cycle characteristics, generate a quantity of The program tree is constructed by continuously adding operators from the root node until a preset maximum depth is reached, where the leaf nodes are selected from any feature or constant in the battery cycle features.
[0038] Generate another Each program tree, during its construction, has the opportunity at each node to terminate the growth of a branch with any feature or constant in the battery cycle characteristics, thus forming a tree with greater depth and more flexible structure.
[0039] The two sets of program trees are merged to form a random subpopulation;
[0040] The pilot subpopulation and the random subpopulation are merged to form a complete mixed initial population.
[0041] Furthermore, the root mean square error (RMSE) is used as a fitness index to evaluate the fitness of each individual in the initial mixed population. The formula for calculating the root mean square error (RMSE) is as follows:
[0042] ;
[0043] Where n is the number of battery samples; For the first o The true value of a battery sample, that is, the logarithm of the number of cycles when the battery capacity decays to a preset threshold; For the first o The predicted values for each battery sample are based on the battery cycling characteristics.
[0044] Furthermore, the selection operation employs a tournament selection strategy to screen for high-quality individuals, while the crossover operation achieves parental gene exchange through a single-point crossover strategy, specifically as follows:
[0045] A specified number of individuals are randomly selected from the current population to form a candidate set. The individual with the best fitness is selected from this candidate set and added to the new generation population. This process is repeated until the new generation population reaches a certain size. NP ;
[0046] After selecting individuals in the population, they are randomly paired. For each pair of parent procedural trees, a non-root node is randomly selected as the intersection point. The corresponding subtrees of the two parents at the intersection point are swapped to generate new offspring. The height of the offspring procedural tree is controlled to not exceed a preset threshold, while ensuring that the subtree still contains effective combinations of battery cycle characteristics.
[0047] Furthermore, the mutation operation is executed based on semantic backpropagation and semantic guidance from a pre-trained Transformer model, specifically as follows:
[0048] Mutation is a hybrid mutation operation that is executed based on a preset semantic mutation probability. In each mutation operation, the program generates a random number.
[0049] When the random number is less than the preset semantic mutation probability, a semantically guided mutation operation is triggered, specifically including:
[0050] Randomly select a node N from the program tree of the individual to be mutated, and calculate the target semantics of node N through semantic backpropagation technology. The calculation starts from the target output of the root node, and is deduced from top to bottom. Semantic propagation is carried out in combination with the actual value of the battery cycle characteristics. The target output is the logarithm of the number of cycles when the battery capacity decays to a preset threshold.
[0051] The calculated target semantic vector, i.e. the set of target semantics, and the corresponding input data of battery cycle features are input together into the pre-trained Transformer model. The Transformer model generates a symbol sequence that matches the target semantics. This symbol sequence is then parsed into a new subtree, called the Transformer semantic mutation subtree.
[0052] The original subtree at node N to be mutated is replaced by the new subtree, thus completing a semantically guided mutation operation.
[0053] When the random number is greater than or equal to the preset semantic mutation probability, the traditional random mutation operation is performed: a new subtree with a preset height constraint is randomly generated, where the leaf nodes are battery cycle features or constants, and the random subtree in the individual to be mutated is replaced by it.
[0054] Furthermore, it is determined whether the evolution has reached the termination condition. If the evolution terminates, a mathematical expression is output. The battery cycle characteristics of the battery under test are input into the mathematical expression, and after calculation, the battery life prediction result is obtained, specifically:
[0055] Determine whether the preset evolutionary generation or running time threshold termination condition has been reached; if so, select the individual with the best fitness from all evolutionary generations of the population, and the mathematical expression corresponding to this individual is used for battery life prediction.
[0056] The battery cycle characteristics of the battery to be predicted are input into the mathematical expression, which outputs the logarithm of the number of cycles required for the battery capacity to decay to a preset threshold. After exponential transformation, the final battery life prediction result, i.e., the number of battery cycles, is obtained.
[0057] Compared to existing technologies, this invention reduces reliance on large amounts of labeled data through pre-training, achieving high-precision predictions with only a small amount of battery testing data, significantly reducing the time and economic costs of battery testing. The mutation process, combining semantic-oriented optimization and random exploration, can quickly converge to the optimal solution, significantly improving prediction accuracy compared to traditional methods. Random mutation operations ensure the population's exploratory capabilities, helping it escape local optima and are crucial for maintaining the population's long-term evolutionary vitality.
[0058] The pre-trained Transformer model of this invention plays a key role in semantically guided mutation operations: when it is necessary to generate a new subtree that satisfies a specific target semantic for a node in the program tree, the target semantic and the corresponding battery cycle feature data are input into the pre-trained model; the model uses its ability to map from the set of data point pairs to the expression skeleton learned in the pre-training stage to generate an expression skeleton that matches the target semantic. After constant optimization, the skeleton is parsed into a new subtree, thereby achieving semantically driven precise mutation and improving evolutionary efficiency.
[0059] The prediction model output by this invention is a mathematical expression with clear physical meaning, which not only enhances the interpretability of the model, but also identifies key features that affect battery life, thereby providing interpretable decision-making basis for battery research and development, manufacturing and operation and maintenance, and overcoming the limitations of black box models such as neural networks in terms of interpretability. Attached Figure Description
[0060] Figure 1 This is a flowchart of a battery lifetime prediction method based on pre-trained model-guided genetic programming.
[0061] Figure 2 This is a schematic diagram of a battery lifetime prediction method based on pre-trained model-guided genetic programming.
[0062] Figure 3 A schematic diagram of a genetic programming method guided by a pre-trained model.
[0063] Figure 4 This is a flowchart of semantic mutation based on the Transformer model. Detailed Implementation
[0064] The battery life prediction method based on pre-trained model-guided genetic programming of the present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0065] Please see Figure 1 and Figure 2 This invention discloses a battery lifetime prediction method based on pre-trained model-guided genetic programming, comprising the following steps:
[0066] S1: Define battery life prediction targets and battery cycle characteristics;
[0067] S2: Using mathematical expressions containing battery cycle features, generate a set of data point pairs, build a training dataset, pre-train the Transformer model, and learn the mapping from battery cycle features to mathematical expressions;
[0068] S3: Collect battery cycle charge and discharge data, construct a battery dataset containing battery cycle characteristics, and preprocess the battery dataset containing battery cycle characteristics.
[0069] S4: Input the battery dataset into the pre-trained Transformer model, use the Transformer model to generate a pilot subpopulation, and combine it with the generated random subpopulation to construct a hybrid initial population based on genetic programming.
[0070] S5: Iteratively evolve the mixed initial population, performing selection, crossover, and mutation operations. The mutation operation is executed based on semantic backpropagation and semantic guidance of the pre-trained Transformer model.
[0071] S6: Determine whether the evolution has reached the termination condition. If the evolution terminates, output a mathematical expression. Input the battery cycle characteristics of the battery under test into the mathematical expression, and after calculation, obtain the battery life prediction result.
[0072] Step S1: Define the battery life prediction target and battery cycle characteristics.
[0073] Specifically, the battery life prediction target is the logarithm of the number of cycles required to reduce battery capacity to 80%. The battery cycle characteristic C is a set of numerical characteristics calculated based on current, voltage, and temperature data collected during battery cycle charge-discharge tests. Specifically, it includes:
[0074] C1: The average difference between the discharge voltage curves of the battery at the 100th cycle and the 10th cycle;
[0075] C2: Variance of the difference between the discharge voltage curves of the battery at the 100th cycle and the 10th cycle;
[0076] C3: The minimum difference between the discharge voltage curves of the battery at the 100th cycle and the 10th cycle;
[0077] C4: The slope of the battery's capacity decay curve from the 2nd to the 100th cycle;
[0078] C5: The slope of the battery's capacity decay curve from the 90th to the 100th cycle;
[0079] C6: Battery charging rate;
[0080] C7: Battery discharge rate;
[0081] C8: Average charging time for the first 5 battery cycles;
[0082] C9: The integral value of the battery temperature from the 2nd to the 100th cycle;
[0083] C10: The internal resistance of the battery during the second cycle.
[0084] Step S2: Using mathematical expressions containing battery cycle features, generate a set of data point pairs, construct a training dataset, pre-train the Transformer model, and learn the mapping from battery cycle features to mathematical expressions.
[0085] Specifically, construct a containing m Training dataset for group data The i-th set of data is generated by a randomly generated mathematical expression containing the battery cycle characteristics C. and based on The generated set of data point pairs Composition, in which This is the set of input points for battery cycle characteristics. for The corresponding calculation result on this mathematical expression is output.
[0086] Data point set As the input sequence, corresponding to the mathematical expression skeleton As the target output (the "skeleton" refers to the form after replacing specific constants in the expression with placeholders), a Transformer model with an encoder-decoder architecture is trained through an autoregressive generation task. The encoder outputs the corresponding data for each mathematical expression. Mapping to a latent space yields a latent representation z of a fixed size, which is the encoded latent vector z.
[0087] use Represents skeleton The k-th symbol or element in Represents skeleton The first k symbols or elements. Given previously generated symbols. Given the encoded latent vector z, the Transformer model outputs the conditional probability distribution function of the next symbol. The training objective of the Transformer model is to maximize the true next symbol. The probability value in this conditional probability distribution function. Specifically, the Transformer model minimizes the predicted skeleton. With real skeleton The cross-entropy loss L between (i.e., the skeleton of the original mathematical expression) is used, and the autoregressive modeling capability is optimized by batch gradient updates, so that the Transformer model can generate well-structured mathematical expressions from the data of battery cycling features C.
[0088] The formula for calculating the cross-entropy loss L is:
[0089] ;
[0090] The final output expression skeleton It is the original mathematical expression e An abstract representation in which all numerical constants are replaced with a uniform placeholder symbol "*".
[0091] Considering the set of data point pairs used as the input sequence in this invention Essentially, it is a set of data point pairs with variable size and no order. The positional encoding is removed from the standard Transformer architecture, thus ensuring the permutation invariance of the Transformer model to the order of input data points, making it more suitable for symbolic regression tasks.
[0092] This invention reduces the reliance on large amounts of labeled data by using a pre-trained Transformer model, and can achieve high-precision prediction with only a small amount of battery test data, which significantly reduces the time and economic cost of battery testing.
[0093] Step S3: Collect battery cycle charge and discharge data, construct a battery dataset containing battery cycle characteristics, and preprocess the battery dataset containing battery cycle characteristics.
[0094] Specifically, taking the data acquisition of a single battery sample as an example, the process is as follows: In one complete charge-discharge cycle (from fully discharged to fully charged, and then discharged to the cutoff voltage), the current I at each moment is recorded in time sequence. j (t), voltage V j (t) and temperature T j (t); Store these signals in cyclic order to form a dataset:
[0095] ;
[0096] Where j is the cycle number and a is the total number of cycles, that is, the number of cycles that the battery capacity has experienced when it drops to a preset threshold (such as 80%). This value a will be used as the life label of the battery.
[0097] When the battery capacity decays to 80%, based on the above dataset SBased on the definition of battery cycle feature C, a battery dataset containing battery cycle feature C is extracted through corresponding calculations.
[0098] The battery dataset containing the battery cycle feature C is standardized to eliminate the dimensional differences between the features and make it follow a standard normal distribution with a mean of 0 and a standard deviation of 1.
[0099] The standardized value of the q-th cycle feature in the p-th battery sample The calculation formula is:
[0100] ;
[0101] in, The original data values of the cycle characteristics of the qth battery in the pth battery sample (q=1,2,...,10); Let q be the mean of the q-th battery cycle feature across all battery samples; Let be the standard deviation of the q-th battery cycle characteristic across all battery samples.
[0102] Please see Figure 3 In step S4, the battery dataset is input into the pre-trained Transformer model, the Transformer model is used to generate a guide subpopulation, and it is combined with the generated random subpopulation to construct a hybrid initial population based on genetic programming.
[0103] Specifically, the standardized battery dataset containing battery cycle features C is input into a pre-trained Transformer model, which generates a well-structured expression skeleton and converts it into a symbolic regression program tree, with constants in the tree represented by placeholders.
[0104] Copy the program tree SP One, of which SP Set as the total population size NP (here) NP= 10% of (200), i.e., 20 individuals. Small-scale random initialization is performed on the constant placeholders in each replica program tree, thus forming the bootstrap subpopulation.
[0105] To ensure the diversity of the initial population, the classic population initialization method, the Ramped Half-and-Half method (mixed method), is used to generate a population of [number missing]. NP-SP(i.e., 180) randomized program trees. The method specifically includes: First, using any feature or constant from C1 to C10 as nodes, 90 program trees are generated. The construction process starts from the root node and continuously adds operators until a preset maximum depth (between 2 and 6) is reached. Leaf nodes can use any feature or constant from C1 to C10. Second, another 90 program trees are generated. During the construction process, each node has the opportunity to directly terminate the growth of the current branch using any feature or constant from C1 to C10 as a leaf node, thus forming a tree with more flexible depth and structure. The two sets of program trees are then merged to form a random subpopulation.
[0106] The guide subpopulation and the random subpopulation are merged to form a complete hybrid initial population. Combining the high-quality guide subpopulation generated by the Transformer model with the random subpopulation effectively mitigates the inherent blindness of completely randomizing mathematical expressions containing battery cycle characteristics. This strategy for generating the hybrid initial population can be repeatedly executed for a range of different target depths to ensure that the final generated random subpopulation exhibits broad diversity in tree height and topology.
[0107] The root mean square error (RMSE) was used as a fitness metric to evaluate the fitness of each individual in the initial mixed population. The formula for calculating the RMSE is as follows:
[0108] ;
[0109] Where n is the number of battery samples; For the first o The true value of a battery sample, that is, the logarithm of the number of cycles when the battery capacity decays to a preset threshold; For the first o The predicted value of each battery sample is calculated based on the C1-C10 features through the current individual (program tree).
[0110] Please see Figure 3 Step S5 involves iteratively evolving the initial mixed population, performing selection, crossover, and mutation operations. The mutation operation is executed based on semantic backpropagation and semantic guidance from the pre-trained Transformer model.
[0111] Specifically, five individuals are randomly selected from the current population to form a candidate set. The individual with the best fitness among these individuals is then selected to enter the new generation population. This process is repeated until the size of the new generation population reaches a certain level. NP The tournament selection strategy formula is:
[0112] ;
[0113] in, Let M be the candidate set of the winning individuals in a single tournament. The set of all individuals T that minimize the RMSE.
[0114] After selecting individuals in the population, randomly pair them up. For each pair of parent program trees, randomly select a non-root node as the intersection point and swap the corresponding subtrees of the two parents at the intersection point to generate new offspring. At the same time, control the height of the offspring program tree to not exceed a preset threshold and ensure that the subtree still contains an effective combination of battery cycle features C1-C10.
[0115] The formula for the single-point crossover strategy is expressed as:
[0116] ;
[0117] ;
[0118] in, , For the two child trees generated by the crossover, , These are two paired father trees from the parent population. , These are the intersection points of non-root nodes on parent tree 1 and parent tree 2, respectively. This represents the subtree rooted at node c. This indicates that the subtree in individual T is... A Replace with subtree B .
[0119] Mutation is a hybrid mutation operation, executed based on a preset semantic mutation probability d. In each mutation operation, the program generates a random number r.
[0120] When the random number r is less than 0.025, a semantically guided mutation operation is triggered, which specifically includes:
[0121] A node N is randomly selected from the program tree of the individual to be mutated, and the target semantics of node N are calculated using semantic backpropagation. This calculation starts with the target output of the root node (i.e., the logarithm of the number of cycles when the battery capacity decays to a preset threshold) and proceeds backward from top to bottom, combining the actual values of features C1-C10 for semantic propagation.
[0122] like Figure 4 As shown, the root node (i.e., node 0) represents the battery life prediction target, and there is still a discrepancy between its original semantics and the target semantics. The semantics propagate backward from top to bottom along the computation path, with the arrow indicating the direction of propagation. Taking the calculation of the target semantics of node 3 as an example: First, the inverse function operation of parent node 2 and its sibling nodes are combined. pointThe output of node 4 is used to derive the target semantics of node 2; then, based on the target semantics of node 2 and the output of the sibling node of node 3, the target value that node 3 needs to satisfy is calculated.
[0123] The specific formula for calculating the target semantics is as follows:
[0124] ;
[0125] in, For the parent node function, Its inverse function is Output a set for sibling nodes. Represents the parent node The target semantics.
[0126] The calculated target semantic vector (i.e., the set of target semantics) and the corresponding battery cycle feature C are input together into a pre-trained Transformer model. The model generates a symbol sequence that matches the target semantics, which is then parsed into a new subtree, namely the Transformer semantic mutation subtree.
[0127] The original subtree at node N to be mutated is replaced by the new subtree, thus completing a semantically guided mutation operation.
[0128] When the random number r is greater than or equal to 0.025, the traditional random mutation operation is performed: a new subtree with a height of 0 to 2 is randomly generated, where the leaf nodes can be C1-C10 features or constants, and the random subtree in the individual to be mutated is replaced with it, so as to maintain the population's exploration ability and avoid getting trapped in local optima.
[0129] Step S6: Determine whether the evolution has reached the termination condition. If the evolution terminates, output a mathematical expression. Input the battery cycle characteristics of the battery under test into the mathematical expression, and after calculation, obtain the battery life prediction result.
[0130] Specifically, it determines whether a preset evolutionary generation (e.g., 300) or a running time threshold or other termination condition has been reached; if so, the individual with the best fitness is selected from the population of all generations, and its corresponding mathematical expression will be used for battery life prediction.
[0131] Input the battery cycle characteristics C of the battery to be predicted for the first 100 cycles into the mathematical expression, and output the logarithmic value of the number of cycles required for the battery capacity to decay to 80%. After exponential transformation (i.e., inverse logarithmic transformation), the final battery life prediction result (number of battery cycles) is obtained.
[0132] The above description is a detailed description of the preferred embodiments of the present invention. However, the embodiments are not intended to limit the scope of the patent application of the present invention. All equivalent changes or modifications made under the technical spirit disclosed in the present invention should fall within the patent scope covered by the present invention.
Claims
1.A battery life prediction method based on pre-training model guided genetic programming, characterized in that, The method comprises the following steps: defining a battery life prediction target and a battery cycle characteristic; using a mathematical expression containing the battery cycle characteristic to generate a data point pair set, build a training data set, pre-train a Transformer model, and learn the mapping of the battery cycle characteristic to the mathematical expression; collecting battery cycle charge and discharge data, building a battery data set containing the battery cycle characteristic, and preprocessing the battery data set containing the battery cycle characteristic; inputting the battery data set into the pre-trained Transformer model, using the Transformer model to generate a guided sub-population, combining it with a generated random sub-population to build a hybrid initial population for genetic programming; iterative evolution of the hybrid initial population, selection, crossover and mutation operations, mutation operation based on semantic backpropagation and semantic guidance of the pre-trained Transformer model; determining whether the evolution has reached the termination condition, and if the evolution has terminated, outputting the mathematical expression, inputting the battery cycle characteristic of the battery to be tested into the mathematical expression, and after calculation, obtaining the battery life prediction result; collecting battery cycle charge and discharge data, building a battery data set containing the battery cycle characteristic, specifically: A plurality of battery samples are subjected to cyclic charge-discharge tests, and a plurality of signal data are recorded during the tests. Taking data acquisition of a single battery as an example, the procedure is as follows: in a complete charge-discharge cycle, the current I j (t) at each moment is recorded in time sequence j (t) and the temperature T j (t) are recorded; and these signals are stored in the order of cycles to form a data set: ; where j is the cycle number, and a is the total number of cycles; when the battery capacity decays to the cycle number corresponding to the preset threshold, based on the data set S, according to the definition of the battery cycle characteristic, the battery data set containing the battery cycle characteristic is extracted through corresponding calculation; the mutation operation is based on semantic backpropagation and semantic guidance of the pre-trained Transformer model, specifically: The mutation operation is a hybrid mutation operation based on a preset semantic mutation probability. In each mutation operation, a random number is generated; when the random number is less than the preset semantic mutation probability, the semantic guided mutation operation is triggered, which specifically includes: randomly selecting a node N from the individual program tree to be mutated, calculating the target semantics of the node N through semantic backpropagation technology; the calculation starts from the target output of the root node and reverses from top to bottom, and combines the actual value of the battery cycle characteristic for semantic propagation; the target output is the logarithmic value of the cycle number when the battery capacity decays to the preset threshold; the calculated target semantic vector, i.e. the set of target semantics, and the corresponding input data of the battery cycle characteristic are jointly input into the pre-trained Transformer model, and the Transformer model generates a symbol sequence matching the target semantics; the symbol sequence is then parsed into a new sub-tree, called Transformer semantic mutation sub-tree; using the new sub-tree to replace the original sub-tree at the to-be-mutated node N, i.e. completing a semantic guided mutation operation; when the random number is greater than or equal to the preset semantic mutation probability, a new sub-tree of a preset height constraint is randomly generated, where the leaf nodes are battery cycle characteristics or constants, and the new sub-tree is used to replace the random sub-tree in the individual to be mutated. 2.The battery life prediction method based on pre-trained model guided genetic programming of claim 1, wherein, defining a battery life prediction target and a battery cycle characteristic, specifically: The battery life prediction target is the logarithmic value of the cycle number when the battery capacity decays to a preset threshold, and the battery cycle characteristics are numerical features extracted based on current, voltage and temperature data collected in the battery sample cycle charge and discharge test; The battery cycle characteristics include: the mean value of the battery cycle discharge voltage curve difference, the variance of the battery cycle discharge voltage curve difference, the minimum value of the battery cycle discharge voltage curve difference, the slope of the battery cycle capacity decay curve, the charge rate of the battery, the discharge rate of the battery, the average charging time of the battery cycle, the integral value of the battery cycle temperature, and the internal resistance value of the battery cycle. 3.The battery life prediction method based on pre-trained model guided genetic programming of claim 1, wherein, A set of data points is generated using a mathematical expression containing battery cycle characteristics, a training data set is constructed, a Transformer model is pre-trained, and the mapping of battery cycle characteristics to mathematical expressions is learned, specifically: constructing a training dataset comprising m sets of data wherein the ith set of data is comprised of a mathematically expression randomly generated to include a battery cycle characteristic and a set of data points pairs generated based on ; wherein is a set of input points of the battery cycle characteristic, is a set of corresponding calculated output results on the mathematically expression; A set of data points pairs As input sequences, with corresponding mathematical expressions Skeletons As target outputs, a Transformer model of an encoder-decoder architecture is trained through an autoregressive generation task; The Transformer model generates a mathematical expression with good structure from the battery cycle characteristics data by minimizing the cross-entropy loss between the predicted skeleton and the real skeleton, and optimizing the autoregressive modeling capability using batch gradient update, so that the Transformer model generates a mathematical expression with good structure from the battery cycle characteristics data; The final output expression skeleton is an abstract representation of the original mathematical expression, in which all numerical constants are replaced by a unified placeholder symbol. 4.The battery life prediction method based on pre-trained model guided genetic programming of claim 1, wherein, The battery data set containing battery cycle characteristics is preprocessed, specifically: The battery data set containing battery cycle characteristics is standardized to eliminate the dimensional differences between the features and transform them into a normal distribution with a mean of 0 and a standard deviation of 1; a standard value of a qth battery cycle characteristic in a pth battery sample The calculation formula is: ; wherein, is the original data value of the qth battery cycle feature in the pth battery sample, is the mean of the qth battery cycle feature across all battery samples, is the standard deviation of the qth battery cycle feature across all battery samples. 5.The battery life prediction method based on pre-trained model guided genetic programming of claim 1, wherein, The battery data set is input into the pre-trained Transformer model, and the Transformer model generates a guided sub-population, which is combined with a random sub-population to form a hybrid initial population for genetic programming, specifically: The standardized battery data set containing battery cycle characteristics is input into the pre-trained Transformer model, which generates an expression skeleton with good structure and converts it into a symbolic regression program tree, with constants in the tree represented by placeholders; Copy the program tree SP times, where SP is a preset percentage of the total population size NP, and randomly assign small values to the constant placeholders in each copy to form a guided sub-population; To ensure the diversity of the initial population, the classic population initialization method, the Hybrid method, is used to generate NP-SP random program trees, which complete the initialization of random individuals, specifically including: Using any of the battery cycle characteristics or constants, a program tree of size is generated, which is built by continuously adding operators from the root node until a preset maximum depth is reached, where leaf nodes are selected from any of the battery cycle characteristics or constants. generate another program tree, whose construction process has the opportunity to terminate the growth of branches at each node with any of the battery cycle characteristics or constants, thereby forming a more flexible tree in depth and structure; Merge the two groups of program trees to form a random sub-population; Merge the guided sub-population and the random sub-population to form a complete hybrid initial population. 6.The battery life prediction method based on pre-trained model guided genetic programming of claim 5, wherein, The root mean square error RMSE is used as the fitness index to evaluate the fitness of each individual in the hybrid initial population, and the calculation formula of the root mean square error RMSE is as follows: ; Wherein, n is the number of battery samples; is the true value of the oth battery sample, that is, the logarithmic value of the cycle number when the battery capacity decays to a preset threshold value; is the predicted value of the oth battery sample based on the battery cycle characteristics. 7.The battery life prediction method based on pre-trained model guided genetic programming of claim 6, wherein, The selection operation uses the tournament selection strategy to select high-quality individuals, and the crossover operation realizes the exchange of parent genes through the single-point crossover strategy, specifically: Randomly select a specified number of individuals from the current population to form a candidate set, select the individual with the best fitness in the candidate set to enter the new population, and repeat the process until the size of the new population reaches NP; Randomly pair the selected population individuals, for each pair of parent program trees, randomly select a non-root node as the crossover point, exchange the corresponding sub-trees of the two parents at the crossover point to generate new offspring, and control the height of the offspring program tree not to exceed the preset threshold, while ensuring that the sub-tree still contains an effective combination of battery cycle characteristics. 8.The battery life prediction method based on pre-trained model guided genetic programming of claim 1, wherein, Determine whether the evolution has reached the termination condition, if the evolution is terminated, input the battery cycle characteristics of the battery to be tested into the mathematical expression, and after calculation, the battery life prediction result is obtained, which is: Determine whether the preset evolution generation or running time threshold termination condition is reached; if so, select the individual with the best fitness from all the populations of all evolution generations, and the mathematical expression corresponding to the individual is used for battery life prediction; Input the battery cycle characteristics of the battery to be predicted into the mathematical expression, which outputs the logarithmic value of the number of cycles required for the battery capacity to decay to the preset threshold, and after exponential transformation, the final battery life prediction result, i.e. the number of battery cycles, is obtained.
Citation Information
Patent Citations
Turbine blade fatigue life prediction method based on logic constraint enhanced sign regression
CN119066985A
Energy storage battery health state prediction method, device, equipment and medium
CN119644177A
Transform-based lithium battery health state estimation method
CN119846485A