Battery charging strategy generation method in battery swap station
By using a hybrid prediction model and genetic algorithm optimization, an event-based discrete time-series simulation model is constructed to generate the optimal charging strategy. This solves the problems of inaccurate demand forecasting and high computational complexity in battery charging strategies for battery swapping stations, and achieves a dynamic balance between cost and success rate.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI JIENENG SMART ELECTRIC NEW ENERGY TECH CO LTD
- Filing Date
- 2026-02-10
- Publication Date
- 2026-06-05
AI Technical Summary
Existing battery charging strategies for battery swapping stations cannot accurately predict future demand, leading to increased costs during peak electricity price periods or untimely charging causing battery turnover failure. Furthermore, traditional optimization models have high computational complexity in large-scale battery swapping station networks, making real-time optimization impossible.
A hybrid prediction model is used to predict future battery swapping orders. An event-based discrete time-series simulation model is constructed, and a genetic algorithm is used to optimize the charging strategy. The optimal charging strategy is generated through dual threshold rules and intelligent optimization.
It enables accurate prediction and fine-grained control of future battery swapping demand, reduces operating costs, improves order success rate and the scientific and effective nature of strategies, and adapts to personalized demand fluctuations at different sites and on different dates.
Smart Images

Figure CN122155186A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of battery swapping station operation and management technology, specifically a method for generating battery charging strategies within a battery swapping station. Background Technology
[0002] As a highly efficient centralized energy replenishment mode for electric vehicles, the operating costs and service quality of battery swapping stations are highly dependent on the charging scheduling strategy of the batteries within the station. Due to the significant peak-valley electricity price difference in the power grid, batteries need to be charged in advance during the off-peak hours at night to meet daytime demand. However, the number of batteries within the station is limited. If the charging reserves during the off-peak hours are insufficient, charging must be carried out during the peak and normal hours when electricity prices are higher, leading to a surge in costs. On the other hand, if charging is too conservative, battery turnover may fail due to untimely charging, reducing the customer order fulfillment rate.
[0003] Currently, the common methods for formulating charging strategies in the industry mainly include:
[0004] 1. Manual experience-based setup: This method relies on operators' subjective judgment of battery charging demand at each station. It cannot be scaled up, suffers from poor strategy consistency, lacks quantifiable evaluation, and struggles to cope with dynamically changing demand and electricity prices.
[0005] 2. Fixed time period strategy: For example, setting simple rules such as "fully fill the time period during off-peak hours and not fill the time period during peak hours". Although this method is easy to implement, it has extremely poor flexibility and cannot adapt to the personalized demand fluctuations of different sites and different dates, nor can it achieve a dynamic balance between cost and success rate.
[0006] Strategies based on traditional optimization models, such as the scheme disclosed in public document CN115742801A, solve for the charging rate by establishing an optimization model with the objective of minimizing overall cost. However, this method has significant limitations:
[0007] First, it did not fully consider the accurate prediction of future battery swapping demand, while prediction is the premise for formulating forward-looking charging strategies.
[0008] Secondly, if the charging rate is used as a finely controlled variable, when facing a large-scale battery swapping station network (hundreds or thousands of stations) and a single station with multiple bays, the solution space will explode exponentially (for example, reaching the order of 1.e+42), making the calculation completely infeasible and unable to achieve real-time or near-real-time strategy optimization. Summary of the Invention
[0009] The purpose of this invention is to provide a method for generating battery charging strategies within a battery swapping station, in order to solve the problems mentioned in the background art.
[0010] To achieve the above objectives, the present invention provides the following technical solution:
[0011] A method for generating a battery charging strategy within a battery swapping station includes the following steps:
[0012] S1. Generation of future battery swapping order sequence: Based on historical operation data and related characteristics, a hybrid prediction model is used to predict the number of battery swapping orders for each site and each battery type in the future target period, and generate a time series of future battery swapping orders containing accurate timestamps;
[0013] S2. Charging strategy parameterization and combination construction: The charging strategy is defined as a parameterized rule triggered by the battery inventory status; and several sets of candidate parameter pairs consisting of the battery demand quantity and the battery urgently needed quantity are configured for each time period within the target period to form a strategy combination search space.
[0014] S3. Charging time series simulation and evaluation: Construct an event-based discrete time series simulation model to simulate the operation of a battery swapping station under a given charging strategy and battery swapping order time series, and output the corresponding order success rate and charging cost.
[0015] S4. Intelligent Strategy Optimization: The genetic algorithm is used to search the strategy combination search space to find the optimal charging strategy.
[0016] S5, Optimal Strategy Output: Decode the optimal charging strategy into specific time-segmented charging control parameters and output them.
[0017] As a further aspect of the present invention: in step S1, the specific steps for generating the future battery swapping order sequence are as follows:
[0018] S11. Obtain historical operating data of the target battery swapping station and multi-dimensional features related to battery swapping demand;
[0019] S12. Input historical operating data and multi-dimensional features into the trained hybrid prediction model to predict the number of battery swapping orders for each battery type at the target battery swapping station in the corresponding time period within the future target period.
[0020] S13. Based on the predicted number of battery swapping orders for each time period, generate battery swapping order events with precise timestamps within the corresponding time period, and arrange them in chronological order to form a future battery swapping order time series.
[0021] As a further aspect of the present invention: in step S12, the method for training the hybrid prediction model is as follows:
[0022] S121. Use a time-series prediction model to fit the time series of historical battery swapping orders to obtain the basic predicted values and the decomposed time-series components;
[0023] S122. Using time-series components and multi-dimensional features as input features, a machine learning model is trained with the number of historical battery swapping orders as the training target to obtain a hybrid prediction model for correcting the basic prediction value.
[0024] As a further aspect of the present invention: in step S2, the specific steps for parameterizing and combining the charging strategy are as follows:
[0025] S21. Define a dual-threshold parameter charging triggering rule based on the number of fully charged available batteries in the station, where the first threshold parameter is the number of batteries required and the second threshold parameter is the number of batteries urgently needed.
[0026] S22. Determine the range of values for the required number of batteries and the urgently needed number of batteries, and select multiple sets of discrete candidate parameter values within the range to form a set of candidate parameter pairs;
[0027] S23. For different time periods within the future target operating cycle, assign one or more candidate parameter pairs to each time period to form a candidate charging strategy for that time period.
[0028] S24. Based on the candidate charging strategies allocated for all time periods, generate a search space for combinations of charging strategies for global optimization.
[0029] As a further aspect of the present invention: in step S21, the dual-threshold charging triggering rule is as follows:
[0030] When the number of fully charged and usable batteries in the charging station is lower than the first threshold parameter, the charging is triggered to start charging at the first power level.
[0031] When the number of fully charged and available batteries in the charging station is lower than the second threshold parameter, it is triggered to start charging at the second power level, which is higher than the first power level.
[0032] As a further aspect of the present invention: in step S3, the specific method for charging timing simulation and evaluation is as follows:
[0033] S31. Load the input data, including the charging strategy to be evaluated, the time series of future battery swapping orders, site configuration parameters and cost parameters, and initialize the site status object and each battery compartment object.
[0034] S32. Based on the time series of future battery swapping orders, initialize a key event queue containing the arrival times of future orders;
[0035] S33. Take the earliest event from the critical event queue and advance the simulation clock to that event time; at the event time point, process the battery swap completion event, charging completion event, battery swap start event and charging start event in a preset order; and dynamically update the status of the site status object and related battery compartment objects, and then add the newly triggered future event time to the critical event queue.
[0036] S34. Based on the state at the end of the simulation, calculate and output evaluation indicators including order success rate and charging cost.
[0037] As a further aspect of the present invention: in step S33, the method for processing the charging start event is as follows:
[0038] Based on the current simulation time period, obtain the charging parameters for the corresponding strategy. Then query the site status object to get the current number of fully charged and available batteries. ;
[0039] like If the charging resource constraints are met, the decision is to start charging at the second power level.
[0040] Otherwise, if If the charging resource constraints are met, the decision is to start charging at the first power level.
[0041] As a further aspect of the present invention: in step S4, the specific steps of intelligent strategy optimization are as follows:
[0042] S41. Encode the strategies in the strategy combination search space into chromosomes to generate an initial population;
[0043] S42. For each individual in the population, decode its chromosome into a specific charging strategy, obtain the order success rate and charging cost under the strategy through a time-series simulation model, and calculate its fitness value using a preset fitness function.
[0044] S43. Based on fitness values, iteratively perform selection, crossover, and directed mutation operations to generate a new generation of population;
[0045] S44. When the termination condition is met, the individual with the highest fitness in the population throughout the generations is decoded and output as the optimal charging strategy.
[0046] As a further aspect of the present invention: in step S42, the specific steps of the directional mutation operation are as follows:
[0047] S431. During the genetic iteration process, the average fitness contribution or success rate of individuals associated with each candidate gene value at each mutable gene position is calculated.
[0048] S432. Based on the statistical results, the candidate gene values at each gene position are sorted by performance, and according to the preset directional mutation ratio parameter, the candidate gene values at the bottom of the ranking are selected to form a mutation gene pool.
[0049] S433. When a gene is mutated, if the current value of the gene belongs to the mutated gene pool, it is mutated to another candidate gene value in the mutated gene pool with a probability higher than random probability.
[0050] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0051] This invention achieves accurate and fine-grained prediction of future battery swapping demand by introducing multi-dimensional features into a hybrid prediction model; it provides reliable data input for the formulation of charging strategies, enabling strategies to shift from passive response to proactive planning, and fundamentally improving the scientific nature and effectiveness of the strategies.
[0052] By constructing an event-based discrete time-series simulation model, it is possible to accurately simulate the dynamic process of charging and swapping under any given strategy, and calculate its order success rate and charging cost; by refreshing the state only at key event points such as battery swapping and charging, the amount of computation is greatly reduced, providing an efficient evaluation engine for subsequent optimization.
[0053] By parameterizing the charging strategy into time-segmented dual-threshold rules and employing an improved genetic algorithm for global optimization, it can not only handle a huge search space, but also guide the search direction according to operational needs, efficiently and intelligently finding the globally optimal or near-optimal balance between cost and success rate. Attached Figure Description
[0054] Figure 1 A flowchart illustrating a method for generating a battery charging strategy within a battery swapping station;
[0055] Figure 2 This is a schematic diagram of the framework for simulating the charging timing in a battery charging strategy generation method within a battery swapping station. Detailed Implementation
[0056] Please see Figures 1-2 In this embodiment of the invention, a method for generating a battery charging strategy within a battery swapping station includes the following steps:
[0057] S1. Generation of Future Battery Swapping Order Sequence: Based on historical operational data and relevant characteristics, a hybrid prediction model is used to predict the number of battery swapping orders for each site and each battery type within the future target period, and to generate a time series of future battery swapping orders containing precise timestamps; the specific steps are as follows:
[0058] S11. Obtain historical operational data of the target battery swapping station and multi-dimensional features related to battery swapping demand; among which, the multi-dimensional features include the following:
[0059] Time cycle characteristics, such as seasons, date types, and time of day;
[0060] Historical demand characteristics, such as the average order volume for the same period in recent times and historical order volume trends;
[0061] Vehicle status characteristics, such as the number of vehicles within a preset range around the battery swapping station and the average state of charge (SOC) of the vehicles.
[0062] On-site operational characteristics, such as the average state of charge (SOC) of users' batteries before battery swapping in the same period of history.
[0063] Environmental characteristics: weather conditions, temperature;
[0064] Suppose we need to generate an order sequence for tomorrow (a typical workday) of standard-range batteries (Type B) from a battery swapping station in a certain area of a first-tier city; where...
[0065] Time cycle characteristics: Tomorrow is October 26, 2025, Thursday, the fourth quarter, a working day;
[0066] Historical demand characteristics: The average number of orders at this station between 08:00 and 09:00 over the past 7 Thursdays is 4.3; the average SOC before battery swapping during this period over the past 15 days is 32%.
[0067] Vehicle status characteristics: Based on dynamic data, it is predicted that there will be approximately 120 electric vehicles within a 5-kilometer radius of this station at 08:00 tomorrow.
[0068] ... (46 other features in total);
[0069] S12. Input historical operational data and multi-dimensional features into the trained hybrid prediction model to predict the number of battery swapping orders for each battery type at the target battery swapping station within the corresponding time period in the future target period; the training method of the hybrid prediction model is as follows:
[0070] S121. Use a time-series prediction model to fit the time series of historical battery swapping orders to obtain the basic predicted values and the decomposed time-series components;
[0071] S122. Using time-series components and multi-dimensional features as input features, a machine learning model is trained, with the number of historical battery swapping orders as the training target, to obtain a hybrid prediction model for correcting the basic prediction value; wherein, the time-series prediction model is the Prophet time-series model, and the machine learning model is the random forest model or the XGBoost model.
[0072] Assuming that the Prophet time series model, based on the site's historical order data, predicts a baseline order volume of 4 orders for tomorrow's 08:00-09:00 period;
[0073] Then, the prediction results (4 singles) and their seasonal factors and trend terms, together with the above 46 features, are input into the trained XGBoost model;
[0074] Based on characteristics such as "a large number of nearby vehicles (120 vehicles)" and "a low SOC in the same period of history (32%, which means urgent need for refueling)," the XGBoost model judges that the demand will be slightly higher than the baseline and outputs a correction value: +1.2 units.
[0075] Ultimately, the mixed forecast result for this period is: 4 + 1.2 = 5.2 orders. After processing according to business rules (such as rounding), the predicted number of orders is determined to be 5 orders.
[0076] S13. Based on the predicted number of battery swapping orders for each time period, generate battery swapping order events with precise timestamps within the corresponding time period, and arrange them in chronological order to form a future battery swapping order time series.
[0077] Assume the time period is from 08:00:00 to 09:00:00, lasting 60 minutes.
[0078] Forecast order count: 5 orders;
[0079] Equal-interval segmentation: Divide the 60 minutes into 5 equal segments, with each segment spaced 12 minutes apart;
[0080] The generated precise order timestamps are: (1) 08:00:00; (2) 08:12:00; (3) 08:24:00; (4) 08:36:00; (5) 08:48:00;
[0081] Repeat the above process to predict and generate sequences for all battery types at the station and for each time period of the next 24 hours (e.g., divided into 24 time periods by hour). Finally, sort all the generated orders in ascending order by timestamp to obtain a complete time series of future battery swapping orders to drive subsequent simulations.
[0082] S2. Charging Strategy Parameterization and Combination Construction: Define the charging strategy as a parameterized rule triggered by battery inventory status; and configure several sets of parameters based on battery demand for each time period within the target cycle. And batteries are in urgent need of quantity Candidate parameter pairs This forms a strategy combination search space; the specific steps are as follows:
[0083] S21. Define a dual-threshold parameter charging triggering rule based on the number of fully charged available batteries in the station, where the first threshold parameter is the number of batteries required. The second threshold parameter is the number of batteries urgently needed. And the number of batteries required The dual-threshold charging triggering rules are as follows:
[0084] When the number of fully charged and usable batteries in the charging station is lower than the first threshold parameter, the charging is triggered to start at the first power level (such as normal power, slow charging).
[0085] When the number of fully charged and usable batteries in the charging station is lower than the second threshold parameter, it is triggered to start charging at a second power level higher than the first power level (such as high power, fast charging).
[0086] S22. Determine the required battery quantity. And batteries are in urgent need of quantity The range of values for the parameter is determined, and multiple discrete candidate parameter values are selected within this range to form candidate parameter pairs. The set; where the number of batteries required And batteries are in urgent need of quantity The range of values is determined based on the following: the total number of batteries in the target battery swapping station, the battery demand level in historical operational data, and business experience rules; for example, for a station with 40 batteries, The range of values is ; The range of values is ;
[0087] S23. For different time periods within the future target operating cycle, assign one or more candidate parameter pairs to each time period. This forms the candidate charging strategy for that time period; the division of different time periods is determined according to the following method:
[0088] According to the power grid's time-of-use pricing policy, the electricity period is divided into off-peak, normal, and peak periods.
[0089] Based on the predicted battery swapping demand intensity, the periods are divided into high demand periods, medium demand periods, and low demand periods.
[0090] Divide evenly at fixed time intervals;
[0091] Candidate parameter pairs assigned at different time periods The difference lies in the parameters allocated to periods with higher electricity prices or stronger predicted demand. The values are generally no lower than the parameter pairs allocated to periods with lower electricity prices or weaker predicted demand. The value;
[0092] For example, during off-peak hours at night (when electricity prices are low), a more flexible configuration can be provided. and radical ,like ;in, This means that as long as there are more than 10 batteries, charging will not be required, and the batteries will be fully charged overnight; fast charging will only be initiated when there are fewer than 2 batteries, with the goal of maximizing battery reserves at the lowest cost.
[0093] For peak daytime hours (high electricity prices, high demand), a conservative configuration is recommended. and ,like ;in, This means maintaining a high inventory level; regular charging begins when there are fewer than 16 batteries, and fast charging begins immediately when there are fewer than 8 batteries. The goal is to prioritize order success rate, regardless of higher electricity costs.
[0094] S24. Based on the candidate charging strategies assigned across all time periods, generate a search space for combinations of charging strategies for global optimization, where each strategy in the search space represents a specific parameter pair selected for each time period. The complete charging strategy sequence;
[0095] The total size of the search space for charging strategy combinations is ,in The average number of candidate strategies across different time periods. The total number of time periods divided within the target operating cycle;
[0096] Suppose that there are 100 people a day Time period (e.g.) ); Assume each time period has Candidates Strategies (such as) Then the total number of all possible all-day strategy combinations is: This is an extremely large discrete search space, which is the object that subsequent optimization methods such as genetic algorithms need to deal with.
[0097] S3. Charging Time Series Simulation and Evaluation: Construct an event-based discrete time series simulation model to simulate the operation of a battery swapping station under a given charging strategy and battery swapping order time series, and output the corresponding order success rate and charging cost; the specific method is as follows:
[0098] S31. Load the input data, including the charging strategy to be evaluated, the time series of future battery swapping orders, site configuration parameters and cost parameters, and initialize the site status object and each battery compartment object.
[0099] S32. Based on the time series of future battery swapping orders, initialize a key event queue containing the arrival times of future orders;
[0100] S33. Take the earliest event from the critical event queue and advance the simulation clock to the event time; at the event time point, process the battery swap completion event, charging completion event, battery swap start event and charging start event in a preset order;
[0101] The procedure for handling battery swap completion events is as follows:
[0102] Iterate through the battery compartment objects to check if the following condition exists: battery swap start time + battery swap duration = current time. Positions;
[0103] If present, the battery swap in that compartment is complete; the vehicle is released, the battery in that compartment is removed and replaced with a depleted battery, and the status changes to "battery unavailable"; the battery is marked as "awaiting charging" (if its SOC is not full).
[0104] The charging complete event is handled as follows:
[0105] Iterate through the battery compartment objects to check if the estimated charging end time equals the current time. Positions;
[0106] If present, the charging of that compartment is complete; the battery SOC becomes 100%, and the status changes to "fully charged and available"; billing stops (the electricity cost for this charging is calculated based on the charging period and power, and the time-of-use electricity price, and added to the total cost);
[0107] The procedure for handling battery swapping start events is as follows:
[0108] Check: Current Time Is it in the order sequence?
[0109] If an order arrives, check the current number of fully charged and available batteries in the site status object. ;
[0110] If the current fully charged battery number is [number] If the value is ≥1, then start battery swapping: Select one battery from the available batteries (e.g., based on the highest SOC or the first fully charged battery to be used), occupy a battery swapping station, record the battery swapping start time = t at the battery slot, and decrement the number of available batteries at the station by 1; the order is successful.
[0111] If the current fully charged battery number is [number] If the value is 0, the order fails because no battery is available; the number of failed orders is incremented by 1.
[0112] The charging start event is handled as follows:
[0113] Based on the current simulation time period, obtain the charging parameters for the corresponding strategy. Then query the site status object to get the current number of fully charged and available batteries. ;
[0114] like If the charging resource constraints are met (i.e., there are available chargers and the power distribution capacity is not exceeded), then the decision is to start charging at the second power level (such as fast charging).
[0115] Otherwise, if If the charging resource constraints are met, the decision is to start charging at the first power level (such as slow charging).
[0116] During the handling of relevant events, the status of the site status object and the related battery compartment object are dynamically updated, and the newly triggered future event times are added to the critical event queue.
[0117] The site status object is used to record the overall operating status of the battery swapping station. Its data items include: simulation time, number of currently fully charged and available batteries, number of batteries currently charging, cumulative number of successful orders and failed orders, and cumulative charging cost.
[0118] The battery compartment object is used to record the detailed status of a single battery compartment. Its data items include: compartment identifier, battery availability status, battery state of charge (SOC), charging status, charging start time, estimated charging end time, charging power, battery swapping status, and battery swapping start time.
[0119] The newly triggered future event times include:
[0120] Estimated charging end time due to charging initiation;
[0121] The battery swap end time, which is based on a fixed battery swap duration and is generated when the battery swap operation begins;
[0122] The new charging start time that may occur after a charging decision event is triggered due to the consumption of one available battery while processing an order arrival event;
[0123] The new battery swap start time is generated when the next battery swap order arrives in the order time series.
[0124] S34. Based on the state at the end of the simulation, calculate and output the evaluation indicators, including order success rate and charging cost;
[0125] Order success rate = (Number of successful orders / Total number of orders) × 100%;
[0126] The charging cost is calculated as follows:
[0127] Each time a charging completion event is processed, the electricity cost for that charging is calculated based on the start time, end time, charging power, and the corresponding time-of-use electricity price table, and then added to the total charging cost of the site status object.
[0128] Assume a battery swapping station has a total of 5 batteries, with 3 initially fully charged; 1 battery swapping station (swapping takes 3 minutes); and 2 chargers (regular charging takes 1 hour per battery, fast charging takes 0.5 hours per battery).
[0129] Current period Simulation initial event list (orders): Current time t = 10:00;
[0130] At t=10:00: Process order arrivals;
[0131] Available batteries = 3; Order fulfilled; Select battery compartment 1 to start battery swapping, swapping start time = 10:00; Available batteries reduced to 2;
[0132] Added event: Battery swap completion time = 10:00 + 3 minutes = 10:03, added to the event list; the list now reads: [10:03, 10:05, 10:15];
[0133] At t=10:03, the battery swap was completed;
[0134] Battery swapping completed in Warehouse 1; battery removed, status changed to "Battery unavailable (SOC=20%, awaiting charging)". Battery swapping station now available.
[0135] Check charging strategy: Current number of fully charged batteries available A = 2. Strategy (C=3, K=1);
[0136] Judgment: A=2, which is less than C=3 but greater than K=1; trigger normal charging; there is an available charger, select the battery with the lowest SOC (i.e., the battery in compartment 1 that was just replaced) to start normal charging;
[0137] Record: Charging start time for compartment 1 = 10:03, power = normal, estimated end time = 11:03;
[0138] Added event: Charging completion time = 11:03, added to list; list becomes: [10:05, 10:15, 11:03].
[0139] S4. Intelligent Strategy Optimization: A genetic algorithm is used to search the strategy combination search space to find the optimal charging strategy; the specific steps are as follows:
[0140] S41. Encode the strategies in the strategy combination search space into chromosomes to generate an initial population; wherein, the encoding adopts an index encoding method, where a chromosome is a sequence, each gene value in the sequence represents a time period, and the value corresponding to the gene value represents the index of the specific strategy selected from the predefined candidate charging strategy set in that time period;
[0141] S42. For each individual in the population, decode its chromosome into a specific charging strategy, obtain the order success rate and charging cost under this strategy through a time-series simulation model, and calculate its fitness value using a preset fitness function; wherein, the fitness function... ;in, and Configurable weights , The normalized cost (cost is 1 to 0); the higher the fitness value, the better the individual.
[0142] S43. Based on the fitness value, iteratively perform selection, crossover, and directed mutation operations to generate a new generation of population, wherein...
[0143] The specific steps of the selection operation are as follows: Based on the fitness value, roulette wheel selection or tournament selection methods are used to select superior individuals from the current population to enter the mating pool for the generation of the next generation; individuals with higher fitness have a higher probability of being selected, simulating the survival of the fittest;
[0144] The specific steps for crossover operations are as follows:
[0145] A pair of parental chromosomes is randomly selected from the mating pool, and their genes are exchanged with a certain probability (crossover probability, such as 0.8) to generate two new offspring individuals. Single-point crossover or uniform crossover is commonly used; for example, single-point crossover involves cutting the chromosome at a random location and exchanging the latter half.
[0146] The specific steps for targeted mutation are as follows:
[0147] S431. During the genetic iteration process, the average fitness contribution or success rate of individuals associated with each candidate gene value at each mutable gene position is calculated.
[0148] S432. Based on the statistical results, the candidate gene values at each gene position are sorted by performance, and according to the preset directional mutation ratio parameter, the candidate gene values at the bottom of the ranking are selected to form a mutation gene pool. The directional mutation ratio parameter can be configured according to different priorities for charging cost control or order success rate. Increasing this parameter will make the algorithm more actively explore gene regions with poor performance and tend to find low-cost solutions; decreasing this parameter will make the algorithm more inclined to fine-tune in gene regions with better performance and tend to find high-success-rate solutions.
[0149] S433. When a gene is mutated, if the current value of the gene belongs to the mutated gene pool, it is mutated into another candidate gene value in the mutated gene pool with a probability higher than random probability.
[0150] S44. When the termination condition is met, the individual with the highest fitness in the population throughout the generations is decoded and output as the optimal charging strategy.
[0151] Suppose that 5 chromosomes are randomly generated using index encoding: Individual 1: [2,1,0]; Individual 2: [0,0,1]; Individual 3: [1,2,2]; Individual 4: [2,0,1]; Individual 5: [1,1,1]; where the index is 2 for off-peak electricity (lowest electricity price); 1 for average electricity (medium electricity price); and 0 for peak electricity (highest electricity price).
[0152] Simulation results show that the fitness of individual 1 is 0.85; the fitness of individual 2 is 0.62; the fitness of individual 3 is 0.78; the fitness of individual 4 is 0.81; and the fitness of individual 5 is 0.73.
[0153] Selection operation: Random pairings, winners enter the mating pool; Assuming the result: Mating pool = [Individual 1, Individual 4, Individual 1, Individual 3, Individual 5];
[0154] Crossover operation: random pairing; individual 1 [2,1,0] and individual 4 [2,0,1] crossover after position 2, resulting in: offspring A: [2,1,1]; offspring B: [2,0,0];
[0155] Targeted mutation operation:
[0156] Historical statistics: Assuming that based on the current population, the historical average performance of each index over different time periods is ranked as follows:
[0157] Valley period: Index 2 (excellent) > Index 1 (medium) > Index 0 (poor);
[0158] Normally: Index 1 (Excellent) > Index 2 (Average) > Index 0 (Poor);
[0159] Peak time period: Index 0 (Excellent) > Index 1 (Medium) > Index 2 (Poor);
[0160] Differential gene identification: Assuming a directional mutation rate of 30%, the last digit in each time period (3 × 30% = 1) is marked as a "differential gene"; that is: trough period index 0, normal period index 0, peak period index 2;
[0161] Perform mutation: For offspring A[2,1,1]: check each gene;
[0162] Gene 1 (valley time index 2): exhibits superior performance and is unchanging;
[0163] Gene 2 (normal segment index 1): exhibits superior phenotype, without variation;
[0164] Gene 3 (peak period index 1): Characterized in the middle, not belonging to the bottom 30%, and undergoes random mutation with a low probability. Assume no mutation.
[0165] For offspring B[2,0,0]:
[0166] Gene 1 (valley time index 2): exhibits superior performance and is unchanging;
[0167] Gene 2 (normal segment index 0): shows a poor expression; belongs to the directed mutation pool; therefore, it will be mutated into other values that are also "poor". However, in the normal segment, only index 0 is poor, so it may be randomly changed to index 0 (i.e., unchanged) or the range may be broadened; let's assume it is mutated to index 2 (medium).
[0168] Gene 3 (peak time index 0): exhibits superior performance, without variation;
[0169] After mutation: offspring B becomes [2,2,0];
[0170] New generation formation: Elite 1 is retained, and offspring A, B, and other new individuals are added to form a new generation population:
[0171] New Individual 1 (Elite): [2,1,0] (Fitness 0.85);
[0172] New individual 2: [2,1,1];
[0173] New individual 3: [2,2,0];
[0174] New individual 4: [1,2,2] (from previous individual 3);
[0175] New individual 5: [1,1,1] (from previous individual 5);
[0176] Repeat the above process; with each iteration, the algorithm will gradually phase out the strategy of using index 2 (poor) during peak hours and tend to use index 1 (good) during off-peak hours.
[0177] Ultimately, it converges to a high-fitness individual like [2,1,0], which represents an excellent solution that uses a high inventory threshold during trough periods and a high protection strategy during peak periods.
[0178] S5. Optimal Strategy Output: Decode the optimal charging strategy into specific time-segmented charging control parameters and output them;
[0179] Assume that the electricity price is divided into three levels throughout the day: off-peak electricity (00:00-07:00), normal electricity (08:00-16:00), and peak electricity (17:00-23:00).
[0180] Valley period candidate set A: {index 0: (C=10, K=2), index 1: (C=12, K=3), index 2: (C=14, K=4)};
[0181] Candidate set B for the normal segment: {index 0: (C=8, K=2), index 1: (C=10, K=4), index 2: (C=12, K=6)};
[0182] Peak period candidate set C: {index 0: (C=14, K=6), index 1: (C=16, K=8), index 2: (C=18, K=10)};
[0183] Suppose that after multiple iterations, the algorithm converges to a highly fit optimal individual, which is encoded as: [2, 1, 0]; which means: valley period gene = 2, normal period gene = 1, peak period gene = 0;
[0184] Decoding yields:
[0185] Valley period (gene value = 2): Strategy of searching for index 2 in candidate set A → (C = 14, K = 4);
[0186] Normal segment (gene value = 1): Strategy for finding index 1 in candidate set B → (C = 10, K = 4);
[0187] Peak period (gene value = 0): Strategy for searching candidate set C with index 0 → (C=14, K=6);
[0188] Output:
[0189] Predicted order success rate: 96.5%
[0190] The estimated average cost per battery swap is 3.8 yuan.
[0191] Strategy generation time: 2025-10-26 22:00:00;
[0192] Starting at midnight on October 27, 2025, this strategy will be implemented automatically:
[0193] Between 00:00 and 07:00, the system will continuously monitor the number of fully charged batteries; once it falls below 14, it will automatically start regular charging for low SOC batteries; if the inventory continues to be depleted to below 4, it will trigger a fast charging command.
[0194] At 08:00, the system automatically switched the threshold to (C=10, K=4);
[0195] At 17:00, the system automatically switched back to a more conservative threshold (C=14, K=6) to cope with the evening rush hour.
[0196] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for generating a battery charging strategy in a battery swap station, characterized in that, Includes the following steps: S1. Generation of future battery swapping order sequence: Based on historical operation data and related characteristics, a hybrid prediction model is used to predict the number of battery swapping orders for each site and each battery type in the future target period, and generate a time series of future battery swapping orders containing accurate timestamps; S2. Charging strategy parameterization and combination construction: The charging strategy is defined as a parameterized rule triggered by the battery inventory status; and several sets of candidate parameter pairs consisting of the battery demand quantity and the battery urgently needed quantity are configured for each time period within the target period to form a strategy combination search space. S3. Charging time series simulation and evaluation: Construct an event-based discrete time series simulation model to simulate the operation of a battery swapping station under a given charging strategy and battery swapping order time series, and output the corresponding order success rate and charging cost. S4. Intelligent Strategy Optimization: The genetic algorithm is used to search the strategy combination search space to find the optimal charging strategy. S5, Optimal Strategy Output: Decode the optimal charging strategy into specific time-segmented charging control parameters and output them.
2. The method of claim 1, wherein the method further comprises: In step S1, the specific steps for generating the future battery swapping order sequence are as follows: S11. Obtain historical operating data of the target battery swapping station and multi-dimensional features related to battery swapping demand; S12. Input historical operating data and multi-dimensional features into the trained hybrid prediction model to predict the number of battery swapping orders for each battery type at the target battery swapping station in the corresponding time period within the future target period. S13. Based on the predicted number of battery swapping orders for each time period, generate battery swapping order events with precise timestamps within the corresponding time period, and arrange them in chronological order to form a future battery swapping order time series.
3. The method for generating a battery charging strategy within a battery swapping station according to claim 2, characterized in that, In step S12, the method for training the hybrid prediction model is as follows: S121. Use a time-series prediction model to fit the time series of historical battery swapping orders to obtain the basic predicted values and the decomposed time-series components; S122. Using time-series components and multi-dimensional features as input features, a machine learning model is trained with the number of historical battery swapping orders as the training target to obtain a hybrid prediction model for correcting the basic prediction value.
4. The method for generating a battery charging strategy within a battery swapping station according to claim 1, characterized in that, In step S2, the specific steps for parameterizing and combining the charging strategy are as follows: S21. Define a dual-threshold parameter charging triggering rule based on the number of fully charged available batteries in the station, where the first threshold parameter is the number of batteries required and the second threshold parameter is the number of batteries urgently needed. S22. Determine the range of values for the required number of batteries and the urgently needed number of batteries, and select multiple sets of discrete candidate parameter values within the range to form a set of candidate parameter pairs; S23. For different time periods within the future target operating cycle, assign one or more candidate parameter pairs to each time period to form a candidate charging strategy for that time period. S24. Based on the candidate charging strategies allocated for all time periods, generate a search space for combinations of charging strategies for global optimization.
5. The method for generating a battery charging strategy within a battery swapping station according to claim 4, characterized in that, In step S21, the dual-threshold charging triggering rule is as follows: When the number of fully charged and usable batteries in the charging station is lower than the first threshold parameter, the charging is triggered to start charging at the first power level. When the number of fully charged and available batteries in the charging station is lower than the second threshold parameter, it is triggered to start charging at the second power level, which is higher than the first power level.
6. The method for generating a battery charging strategy within a battery swapping station according to claim 1, characterized in that, In step S3, the specific method for charging timing simulation and evaluation is as follows: S31. Load the input data, including the charging strategy to be evaluated, the time series of future battery swapping orders, site configuration parameters and cost parameters, and initialize the site status object and each battery compartment object. S32. Based on the time series of future battery swapping orders, initialize a key event queue containing the arrival times of future orders; S33. Take the earliest event from the critical event queue and advance the simulation clock to the event time; at the event time point, process the battery swap completion event, charging completion event, battery swap start event and charging start event in a preset order; It also dynamically updates the status of the site status object and related battery compartment objects, and adds the newly triggered future event time to the critical event queue; S34. Based on the state at the end of the simulation, calculate and output evaluation indicators including order success rate and charging cost.
7. The method for generating a battery charging strategy within a battery swapping station according to claim 6, characterized in that, In step S33, the charging start event is handled as follows: Based on the current simulation time period, obtain the charging parameters for the corresponding strategy. ; Then query the site status object to get the current number of fully charged and available batteries. ; like If the charging resource constraints are met, the decision is to start charging at the second power level. Otherwise, if If the charging resource constraints are met, the decision is to start charging at the first power level.
8. The method for generating a battery charging strategy within a battery swapping station according to claim 1, characterized in that, In step S4, the specific steps for intelligent strategy optimization are as follows: S41. Encode the strategies in the strategy combination search space into chromosomes to generate an initial population; S42. For each individual in the population, decode its chromosome into a specific charging strategy, obtain the order success rate and charging cost under the strategy through a time-series simulation model, and calculate its fitness value using a preset fitness function. S43. Based on fitness values, iteratively perform selection, crossover, and directed mutation operations to generate a new generation of population; S44. When the termination condition is met, the individual with the highest fitness in the population throughout the generations is decoded and output as the optimal charging strategy.
9. A method for generating a battery charging strategy within a battery swapping station according to claim 8, characterized in that, In step S42, the specific steps of the directional mutation operation are as follows: S431. During the genetic iteration process, the average fitness contribution or success rate of individuals associated with each candidate gene value at each mutable gene position is calculated. S432. Based on the statistical results, the candidate gene values at each gene position are sorted by performance, and according to the preset directional mutation ratio parameter, the candidate gene values at the bottom of the ranking are selected to form a mutation gene pool. S433. When a gene is mutated, if the current value of the gene belongs to the mutated gene pool, it is mutated to another candidate gene value in the mutated gene pool with a probability higher than random probability.