A battery swap station charging and discharging strategy optimization method

By optimizing the charging and discharging strategy through an online adaptive prediction model and a rolling time-domain control framework, the problem of inventory mismatch caused by the volatility of demand at battery swapping stations was solved, achieving a balance between economic efficiency and service reliability, and improving the robustness and adaptability of the system.

CN121809999BActive Publication Date: 2026-06-02JILIN ELECTRIC POWER RES INST LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JILIN ELECTRIC POWER RES INST LTD
Filing Date
2026-03-10
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Battery swapping stations face a contradiction between demand volatility and economic efficiency. Existing methods cannot effectively cope with changes in peak demand, leading to inventory mismatch and service failure.

Method used

An online adaptive prediction model is constructed, and the charging and discharging strategy is optimized through a rolling time-domain control framework. Combined with dynamic inventory safety boundaries and time-of-use pricing, a balance between economic efficiency and service reliability is achieved.

Benefits of technology

This achieves simultaneous optimization of the economic efficiency and service reliability of battery swapping stations under fluctuating demand conditions, thereby improving the robustness and adaptability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121809999B_ABST
    Figure CN121809999B_ABST
Patent Text Reader

Abstract

The application discloses a battery swap station charging and discharging strategy optimization method, steps comprising: S1, collecting the historical battery swap demand, battery inventory state and time-of-use electricity price data of the battery swap station; S2, constructing a battery swap demand prediction model with online parameter updating capability, and rolling outputting a battery swap demand sequence of multiple time steps in a prediction time domain; S3, calculating the minimum safety inventory required to meet future services in the prediction time domain, and then determining the dynamic safety operation interval of the battery inventory state; S4, constructing a charging and discharging strategy optimization problem with operation economy as the target, and generating an optimal power decision in combination with the battery inventory dynamics and power limit; S5, solving the charging and discharging strategy optimization model to obtain a charging and discharging power decision sequence in the prediction time domain, and repeating steps S2 to S5 in the next time step. The application realizes the minimization of operation cost on the premise of guaranteeing the zero interruption of battery swap service by converting the future demand into an inventory hard constraint reflecting the service capacity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of energy management and scheduling control technology for electric vehicle battery swapping stations, and particularly relates to an optimization method for charging and discharging strategies of battery swapping stations. Background Technology

[0002] As a rapid energy replenishment infrastructure for electric vehicles, battery swapping stations differ significantly from traditional charging stations in that they need to manage two key resources simultaneously: "electrical energy" and "available battery inventory." The essence of battery swapping services lies in using available battery inventory as the service carrier; therefore, inventory levels directly determine service capacity, and inventory replenishment depends on the energy exchange process with the power grid. During operation, battery swapping stations typically face two conflicting objectives. On the one hand, time-of-use pricing requires stations to charge during low-price periods and reduce or even discharge electricity during high-price periods to lower costs. On the other hand, battery swapping demand is volatile and unpredictable; stations must prepare sufficient inventory before future demand arrives, otherwise problems such as battery swapping queues and service failures will occur.

[0003] In existing technologies, one type of method mainly relies on rule control or static threshold control. However, battery swapping demand has obvious temporal structure and uncertainty. Demand peaks may occur in concentrated periods during weekday morning and evening rush hours, concentrated vehicle dispatch times in specific areas, rainy or snowy weather, or holiday travel changes. This method often cannot prepare for these demand fluctuations in advance, leading to inventory mismatch and failing to simultaneously consider service capacity and economic efficiency. Another type of method uses a combination of prediction and optimization. However, it often uses predicted values ​​directly as deterministic inputs for power planning. Moreover, the prediction models are mostly offline trained models, lacking online update capabilities. When the demand distribution drifts, the prediction error accumulates, causing the optimization plan to gradually deviate from reality during operation, affecting its feasibility.

[0004] Therefore, there is an urgent need for a strategy that can utilize historical battery swapping data to generate online-updable demand forecasting information, and further transform this forecasting information into boundary constraints that reflect the continuous service capacity requirements of battery swapping stations. This strategy can then be used to perform rolling optimization solutions under conditions of limited grid-connected power and limited inventory capacity, thereby improving the economic efficiency and service reliability of battery swapping stations. Summary of the Invention

[0005] To address the aforementioned issues, this invention provides a method for optimizing the charging and discharging strategy of battery swapping stations. This method captures demand changes by constructing an online adaptive prediction model and builds a dynamic inventory safety boundary based on the prediction results. It utilizes a rolling time-domain control framework to achieve long-term, dynamic economic optimization and zero service interruption.

[0006] The present invention adopts the following technical solution:

[0007] A method for optimizing the charging and discharging strategy of a battery swapping station includes the following steps:

[0008] Step S1: Collect operational data from the battery swapping station;

[0009] Collect operational data from battery swapping stations, including historical battery swapping demand data, battery inventory status data, and time-of-use electricity price data;

[0010] Step S2: Construct a battery swapping demand prediction model;

[0011] Based on the historical battery swapping demand data collected in step S1, a data-driven battery swapping demand prediction model with online update capability is constructed. This model is used to continuously output the battery swapping demand prediction sequence for multiple future time steps in the prediction time domain.

[0012] Step S3: Determine the dynamic safe operating range;

[0013] Based on the battery swapping demand forecast sequence, the minimum safety stock of battery swapping stations that needs to be maintained within the forecast time domain to meet future battery swapping demand is dynamically calculated. Combined with the upper limit of physical inventory of swapping stations, the dynamic safe operating range of battery inventory status within the entire forecast time domain is determined.

[0014] Step S4: Construct a charging and discharging strategy optimization model;

[0015] Under the constraints of dynamic safe operating range, a charging and discharging strategy optimization problem with operating economy as the optimization objective is constructed, and the charging and discharging power decision is made in the time domain of battery inventory dynamics, grid-connected power limit and time-of-use electricity price generation prediction.

[0016] Step S5: Rolling optimization and closed-loop execution;

[0017] Solve the charging and discharging strategy optimization model to obtain the charging and discharging power decision sequence in the predicted time domain, and execute the charging and discharging power decision corresponding to the current time step; after completing one cycle, update the battery inventory status and historical battery swapping demand data according to the actual execution results, and enter the next time step to repeat steps S2 to S5 for the next round of rolling optimization.

[0018] Furthermore, in step S1, outliers need to be removed from the collected historical battery swapping demand data, and gaps need to be filled using linear interpolation to form a historical observation vector for input; the time is obtained through the battery management system. The number of available batteries that meet the battery swapping standards is used as the battery inventory status; then, a price vector is constructed by obtaining time-of-use electricity price data in the future forecast time domain.

[0019] Furthermore, in step S2, the battery swapping demand prediction model is a parameterized data-driven model, which is used at each decision time. The model is based on the feature mapping function. Feature vectors composed of historical data With current model parameters Combined, in the prediction time domain Internal prediction of the future time step battery swapping demand ,satisfy:

[0020] ;

[0021] in, For the first Feature mapping function for each prediction step Relative to time The future prediction time step number;

[0022] Furthermore, the model parameters Based on the observed value of new battery swapping demand Perform online updates to meet the following requirements:

[0023] ;

[0024] in, Learning rate; prediction error , Indicates at time The predicted time step The need for battery swapping; This is the updated model parameter vector.

[0025] Furthermore, the feature vector It incorporates intercept features, autoregressive features, and diurnal triangular features to capture the inertia and periodicity of battery swapping demand, and employs stochastic gradient descent or recursive least squares algorithms to implement model parameters. Online updates.

[0026] Furthermore, in step S3, the lower bound of the dynamic safe operation range is determined by the future accumulated battery swapping demand to ensure the continuity of the battery swapping service, so that the time step within the predicted time domain is within a certain range. Battery inventory status satisfy:

[0027] ;

[0028] in, , indicating at time step To maintain the minimum inventory capacity required to meet future battery swapping needs, Indicates time The future number calculated based on the prediction model Forecast of battery swapping demand at each time step To account for the safety redundancy constant of prediction uncertainty, This indicates the maximum inventory that a battery swapping station is allowed to store. The summation index variable represents the value from the current prediction step. To the prediction time domain Each discrete time step between the endpoints is used to calculate the cumulative total demand during that time period.

[0029] Furthermore, in step S4, the battery inventory state is used as the state variable of the optimization model, and a discrete-time battery inventory state equation is established in the prediction time domain as a function of charge and discharge power:

[0030] ;

[0031] in, Indicates the first Available battery inventory at the end of each time step Indicates time step The charging and discharging power decisions between the battery swapping station and the power grid are determined, with positive values ​​representing charging and negative values ​​representing discharging; this satisfies the grid connection capacity constraints of the battery swapping station. , This indicates the maximum allowable charging and discharging power of the battery swapping station, determined jointly by the station's grid-connected capacity, the rated power of the power conversion equipment, and operational safety requirements. This refers to the rated energy capacity of a single battery cell. The overall charging and discharging efficiency coefficient. To control the cycle duration, This indicates the model's prediction of the future... The battery swapping demand occurring at each time step.

[0032] Furthermore, under the conditions of satisfying the dynamic inventory status and grid-connected power constraints, in step S4, the charging and discharging power is... As decision variables, an objective function for optimizing the charging and discharging strategy in the prediction time domain is constructed to minimize the overall operating cost of the battery swapping station. The objective function is expressed as:

[0033] ;

[0034] in, The objective function value, Indicates time step Time-of-use electricity pricing This represents the penalty weighting coefficient for inventory deviating from the target inventory level. The target inventory level is a reference value for the number of available batteries that a battery swapping station is expected to maintain.

[0035] Furthermore, in step S5, the charging and discharging strategy optimization model in the predicted time domain is solved to obtain the optimal charging and discharging power decision sequence, and the optimal charging and discharging power corresponding to the current time step is executed:

[0036] ;

[0037] in, Indicates at time step The optimal power decision sequence obtained by solving the problem. Indicates time The corresponding optimal charge / discharge power decision value.

[0038] Through the above design scheme, the present invention can bring the following beneficial effects:

[0039] The requirements for future battery swapping service capabilities are precisely modeled mathematically based on the predicted dynamic safe operating range in the time domain, and this model is used as a hard constraint in the optimization problem. This mechanism fundamentally prevents short-sighted behavior that sacrifices service reliability for economic benefits, achieving an intrinsic unity between economic goals and service constraints.

[0040] The adopted battery swapping demand forecasting model has online parameter update capabilities and can continuously self-correct based on the latest actual operation data. This enables the system to automatically track and adapt to seasonal changes, trend growth, or sudden fluctuations in battery swapping demand patterns, ensuring the long-term effectiveness and robustness of the strategy.

[0041] By adopting a rolling optimization framework, optimization is performed multiple time periods ahead at each decision step, and only the first step instruction is executed. The closed-loop mechanism is then re-optimized based on feedback. This approach is better able to cope with uncertainty and makes more accurate decisions than open-loop or static strategies.

[0042] The optimization methodology has a clear framework, and the required data is readily available. The core optimization problem can typically be constructed as a standard convex optimization problem, resulting in high solution efficiency. Furthermore, the prediction model and objective function are highly modular, allowing for easy replacement or upgrading to more complex models based on specific needs. Attached Figure Description

[0043] The present invention will be further described below with reference to the accompanying drawings and specific embodiments:

[0044] Figure 1 This is a flowchart of a method for optimizing the charging and discharging strategy of a battery swapping station according to the present invention.

[0045] Figure 2 This is a deployment block diagram of the "cloud-edge-device" collaborative architecture system of the present invention. Detailed Implementation

[0046] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0047] It should be noted that, unless otherwise stated, the technical or scientific terms used in this invention should have the ordinary meaning as understood by one of ordinary skill in the art.

[0048] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.

[0049] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0050] This invention provides a method for optimizing the charging and discharging strategy of a battery swapping station, the steps of which are as follows: Figure 1 As shown, specifically:

[0051] Step S1: Collect operational data from the battery swapping station;

[0052] Collect operational data from battery swapping stations, including historical battery swapping demand data, battery inventory status data, and time-of-use electricity price data;

[0053] The system collects historical battery swapping order records from the local database of the station control host as historical battery swapping demand data; it also reads the state of charge (SOC) and available quantity of batteries in the rack in real time through the battery management system and charger controller in the station; and it obtains time-of-use electricity prices through the power trading center platform.

[0054] Step S2: Construct a battery swapping demand prediction model;

[0055] Based on the historical battery swapping demand data collected in step S1, a data-driven battery swapping demand prediction model with online update capability is constructed. This model is used to continuously output the battery swapping demand prediction sequence for multiple future time steps in the prediction time domain.

[0056] The length of the prediction time domain is typically selected to cover 4 to 24 hours. The design of this time domain length must meet two conditions: first, it must be greater than the physical time required for the battery to fully charge from a depleted state to a fully charged state, ensuring that the system has sufficient lead time for inventory preparation; second, it must cover the main time-of-use electricity price fluctuation cycles and the morning and evening peak battery swapping periods, so that the optimization algorithm can formulate a globally economically optimal strategy.

[0057] Step S3: Determine the dynamic safe operating range;

[0058] Based on the battery swapping demand forecast sequence, the minimum safety stock of battery swapping stations that needs to be maintained within the forecast time domain to meet future battery swapping demand is dynamically calculated. Combined with the upper limit of physical inventory of swapping stations, the dynamic safe operating range of battery inventory status within the entire forecast time domain is determined.

[0059] Step S4: Construct a charging and discharging strategy optimization model;

[0060] Under the constraints of dynamic safe operating range, a charging and discharging strategy optimization problem with operating economy as the optimization objective is constructed, and the charging and discharging power decision is made in the time domain of battery inventory dynamics, grid-connected power limit and time-of-use electricity price generation prediction.

[0061] Step S5: Rolling optimization and closed-loop execution;

[0062] Solve the charging and discharging strategy optimization model to obtain the charging and discharging power decision sequence in the predicted time domain, and execute the charging and discharging power decision corresponding to the current time step; after completing one cycle, update the battery inventory status and historical battery swapping demand data according to the actual execution results, and enter the next time step to repeat steps S2 to S5 for the next round of rolling optimization to complete the closed loop.

[0063] In this invention, a method for optimizing the charging and discharging strategy of a battery swapping station is described. Based on the forecast information of future battery swapping demand, a constraint boundary is constructed to reflect the continuous service capacity requirements of the battery swapping station. The constraint boundary is used to limit the feasible solution space for the charging and discharging power decision, so that the generated charging and discharging strategy can simultaneously meet the future battery swapping service capacity requirements and the operational economy requirements throughout the entire forecast time domain.

[0064] The present invention will be further described in detail below with reference to the accompanying drawings and specific implementation process.

[0065] like Figure 1As shown, this invention provides a method for optimizing the charging and discharging strategy of battery swapping stations. This method is based on a model predictive control (MPC) architecture, which predicts future battery swapping demand through online learning and constructs a dynamic inventory safety boundary accordingly, thereby achieving closed-loop optimization of battery swapping station energy management. The method described in this embodiment operates in a cloud-edge-device collaborative battery swapping station energy management system architecture. The cloud is responsible for long-term load forecasting model training and macro-level strategy distribution; the edge side is deployed on the station control host and is responsible for executing the real-time rolling optimization strategy described in this embodiment; the device side includes a battery management system, charger controller, battery pack, and smart meters, which are responsible for data acquisition and command response.

[0066] Model Predictive Control (MPC) is a closed-loop optimal control algorithm based on a model, rolling optimization, and feedback correction. Its core is to perform finite-time optimization using the current state and the predictive model at each sampling time, execute only the first control variable of the optimal control sequence, and then update the loop in a rolling manner. It is good at handling multivariable and constrained control scenarios.

[0067] The specific implementation steps are as follows:

[0068] S1. Collect multi-dimensional operational data from the battery swapping station.

[0069] In this embodiment, the system control cycle is set to... At every decision-making moment The system performs the following data acquisition and preprocessing:

[0070] (1) Historical battery swapping demand sequence: The system extracts past demand sequences from the database. To eliminate data noise caused by sensor false alarms or communication packet loss, the system performs outlier cleaning on the original sequence for each time step, based on the actual number of battery swaps at each time step: The mean of the sequence is calculated. with standard deviation Remove those with a deviation exceeding The singularities are identified, and the gaps are filled using linear interpolation to form the historical observation vector for input. .

[0071] in, Indicates the cutoff time. Historical battery swapping demand observation vector, Indicates the past The actual number of battery swaps per time step. The value is typically set to cover the past 3 to 7 complete operating days (e.g., when the control cycle...). For 1 hour, take = 72 hours to 168 hours), to ensure that the sample size is sufficient to support the detection of outliers with statistical significance and to capture the weekly variation patterns of historical battery swapping demand.

[0072] (2) Battery inventory status: Statistics are collected at the current time through the on-site battery management system. Meets battery swapping standards (e.g.) The number of available batteries, denoted as a scalar. .

[0073] (3) Time-of-use electricity price series: Obtaining the future forecast time domain Use time-of-use electricity price data to construct a price vector. The unit is "yuan / kWh".

[0074] It typically covers 4 to 24 hours, of which, Indicates the current time Electricity prices.

[0075] S2. Construct a data-driven battery swapping demand prediction model with online update capabilities.

[0076] To adapt to the non-stationary nature of battery swapping demand, this step employs an online adaptive linear prediction model.

[0077] (1) Feature vector construction:

[0078] At any moment Build feature vectors based on historical data To simultaneously capture both the autocorrelation and periodicity of demand, the feature vector is designed as follows:

[0079]

[0080] Among them, constant term 1 is the intercept feature, used to absorb the DC bias of the model; the intermediate term is the autoregressive feature, selected from the most recent historical sequence. Data The first two terms are used to capture the inertia of demand; the last two terms utilize trigonometric functions to represent the current time. Encode (hours) and construct This is used to fit the daily cycle characteristics of morning and evening peak hours.

[0081] for A real vector space of dimensionless numbers, where is the dimension of the feature vector.

[0082] (2) Rolling forecast calculation:

[0083] Using the parameter vector at the current time Calculate the future number Step (time step) Demand forecasts :

[0084]

[0085] in, It is for predicting step size The feature mapping function is the first... The feature recursion construction operator for each prediction step is used to generate the feature vector for the corresponding prediction step, and is defined as follows:

[0086]

[0087] in, By using the previous step's predicted value The prediction is constructed by replacing the preceding historical requirement terms in the original feature vector and updating the periodic feature components simultaneously, and then generating multi-step predictions step by step through a recursive approach.

[0088] The weight coefficient vector has the same dimension as the feature vector. The same, the model parameters Based on the observed value of new battery swapping demand Perform online updates.

[0089] (3) Online parameter correction:

[0090] When the system reaches the next moment And obtain real needs Then, calculate the one-step prediction error. Parameters are updated using stochastic gradient descent (SGD) or recursive least squares (RLS). :

[0091]

[0092] in, The learning rate is used to adjust the magnitude of model parameter updates to satisfy... In practical applications, The value of the learning rate is determined based on the magnitude of the eigenvector and the fluctuation range of demand, typically selected in the range of 0.001-0.1 to achieve a balance between convergence speed and stability. A larger learning rate can be chosen when the eigenvector is normalized; a smaller learning rate should be chosen to avoid oscillations when the eigenvector magnitude is large or demand fluctuations are severe. This mechanism ensures that the model can track the drift of demand distribution in real time.

[0093] S3. Calculate the dynamic safe operating range of battery inventory.

[0094] This step transforms the predicted information into hard constraints on state variables, which is the core of ensuring service reliability.

[0095] (1) Calculation of minimum safety stock boundary:

[0096] For any future time step within the prediction time domain Define minimum safety stock Let $\mathbf{v}$ be the minimum number of batteries that must be retained at the current time to meet the cumulative demand from this moment until the end of the predicted time domain. Its mathematical expression is the inverse cumulative sum:

[0097]

[0098] in, To account for the uncertainty of prediction, a safety redundancy constant is used to cover the uncertainty of the prediction residuals. Its value is adaptively determined based on the prediction error statistic and satisfies:

[0099]

[0100] in, As of the current moment Historical one-step prediction error sequence standard deviation is the confidence coefficient, used to adjust the safety margin level. The symbol... This indicates rounding up to the nearest integer to ensure that the inventory consists of whole blocks.

[0101] (2) Definition of feasible region:

[0102] Combined with the upper limit of the physical capacity of the battery compartment Determine the time Inventory status The dynamic range constraints that must be satisfied are:

[0103]

[0104] During the process of generating a dynamic safety interval, if the system detects the minimum safety stock calculated at a certain moment... Exceeding the physical inventory limit of the battery swapping station ,Right now This indicates that even if the current inventory is fully stocked, it cannot meet future forecasted demand. At this point, the system will automatically trigger the stockout warning mode and forcibly set the lower limit of inventory at that moment as the upper limit of physical inventory. This allows the system to be powered at maximum capacity in subsequent optimization calculations.

[0105] S4. Constructing a charging / discharging strategy optimization problem

[0106] Under the aforementioned safety constraints, an optimal control problem is established with the goal of operational economy.

[0107] (1) System state equations:

[0108] To ensure the rigor of the physical meaning, the following discrete-time state equations are established:

[0109]

[0110] in, Battery inventory status (unit: unit); Charge and discharge power (unit: kW, positive value is charging, negative value is discharging); Forecasted battery swapping demand (unit: blocks); Control cycle duration (unit: h); Rated energy capacity of a single battery cell (unit: kWh); The overall charge-discharge efficiency coefficient characterizes the energy loss in converting grid-side electrical energy into effective battery-side electrical energy. It can be expressed as an equivalent result of the charging link efficiency and the discharging link efficiency. In practical applications, Calibration can be performed using the factory parameters of the station equipment (converter efficiency, charger efficiency, battery charging efficiency), or it can be identified based on historical operating data according to the energy conservation relationship.

[0111] Control cycle duration (unit: h). To predict the number of time-domain steps (unit: steps), the predicted physical duration is: , and The selection must meet the following criteria: predicted coverage duration The timescale should be no less than the critical physical timescale for battery swapping stations to complete energy replenishment and inventory recovery, while also covering the main fluctuation cycles of time-of-use electricity prices and peak periods of battery swapping demand, to ensure the feasibility and economic viability of the optimization results. In practical applications, Typically, 5-60 minutes are taken. When taking the smaller value, The amount of computation can be appropriately reduced to control the computational load; when When taking a larger value, It needs to be enlarged to ensure The coverage duration meets the above requirements.

[0112] (2) Optimize the objective function:

[0113] Minimize prediction time domain Generalized cost function within :

[0114]

[0115] Among them, the first item ( ) represents the cost of electricity transactions. For time-of-use pricing, this system guides arbitrage by allowing low-storage and high-release transactions; the second item ( This is a penalty for inventory stability. This is the penalty weighting coefficient for inventory deviation from the target inventory level, used to achieve dimensional consistency and trade-off between the electricity cost item and the inventory deviation item. The price can be set based on the equivalent electricity cost of a single battery recharge, which meets the requirements. ,in To predict a representative value of electricity prices within the time domain, either the mean or the median can be selected. This represents the equivalent grid-side energy required to fully charge (or replenish) a battery to its usable threshold. As a weighting factor, The larger the scale, the more emphasis is placed on inventory stability and service reliability. The smaller the size, the more emphasis is placed on economy. The target inventory level is a reference value for the number of available batteries that the battery swapping station expects to maintain. This value is used to suppress overcharging or over-discharging of the inventory and enhance system robustness.

[0116] (3) Set of constraints:

[0117] State constraints: ;

[0118] Input constraints: ;

[0119] Terminal constraints: This ensures sustainability at the end of the time domain.

[0120] To predict the minimum inventory required at the end of the time domain, ensuring that the battery swapping station still has the ability to continue service into the next cycle after the current optimization cycle ends.

[0121] S5, Rolling Solving and Closed-Loop Execution

[0122] The above optimization is performed using a rolling time-domain control strategy:

[0123] (1) Problem Solving: At time t The objective function and linear constraints are transformed into a standard quadratic programming model, and a numerical solver is used to obtain the future optimal power sequence. .

[0124] (2) Instruction execution: According to the MPC principle, only the first element in the sequence is extracted. The system translates these into specific control commands and distributes them to each charger using a power allocation algorithm. This power allocation algorithm can be implemented using minimum deviation quadratic programming to ensure that the power of each charger is as close as possible to the evenly distributed reference value, while satisfying power conservation and single-machine constraints. Let the number of chargers participating in the control be... At every moment, the station Perform a quick allocation:

[0125]

[0126] in, For the first The charging and discharging power command of the charger. To share the reference power equally, and constraint, For the first The maximum allowable charging and discharging power of the charger is obtained by solving the above quadratic programming problem. And then send it to the corresponding charger for execution.

[0127] (3) Closed-loop feedback: after After a certain time, the system will enter. At this moment, the latest inventory status is re-collected. Based on actual needs, steps S2 to S5 are repeated. This closed-loop mechanism can effectively eliminate the cumulative effects of model mismatch and external disturbances, ensuring that the control strategy is always in the optimal state.

[0128] Through the above steps, the battery swapping station charging and discharging strategy optimization method provided in this embodiment constructs a dynamic safety stock lower limit constraint by inversely accumulating and calculating the total demand in the predicted time domain. This enables the system to reserve the minimum stock level to meet subsequent demand, thereby reducing the risk of service interruption due to insufficient stock. Simultaneously, a discrete state equation including power-stock conversion coefficients is established, and a rolling optimization model with the goal of minimizing operating costs is constructed within the safety constraint range. This model can automatically adjust the charging and discharging strategy according to time-of-use electricity price fluctuations, effectively reducing the electricity cost of the battery swapping station. Furthermore, the prediction model introduces an online parameter update mechanism based on prediction errors. When the statistical characteristics of battery swapping demand change, the parameters can be automatically corrected, reducing the impact of prediction deviations on the control strategy and improving the control accuracy and stability of the system in non-stationary demand environments.

[0129] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of the claims of the present invention.

Claims

1. A method for optimizing the charging and discharging strategy of a battery swapping station, characterized in that, Includes the following steps: Step S1: Collect operational data from the battery swapping station; Collect operational data from battery swapping stations, including historical battery swapping demand data, battery inventory status data, and time-of-use electricity price data; Step S2: Construct a battery swapping demand prediction model; Based on the historical battery swapping demand data collected in step S1, a data-driven battery swapping demand prediction model with online update capability is constructed. This model is used to continuously output the battery swapping demand prediction sequence for multiple future time steps in the prediction time domain. Step S3: Determine the dynamic safe operating range; Based on the battery swapping demand forecast sequence, the minimum safety stock of battery swapping stations that needs to be maintained within the forecast time domain to meet future battery swapping demand is dynamically calculated. Combined with the upper limit of physical inventory of swapping stations, the dynamic safe operating range of battery inventory status within the entire forecast time domain is determined. Step S4: Construct a charging / discharging strategy optimization model; Under the constraints of dynamic safe operating range, a charging and discharging strategy optimization problem with operating economy as the optimization objective is constructed, and the charging and discharging power decision is made in the time domain of battery inventory dynamics, grid-connected power limit and time-of-use electricity price generation prediction. Step S5: Rolling optimization and closed-loop execution; Solve the charging and discharging strategy optimization model to obtain the charging and discharging power decision sequence in the predicted time domain, and execute the charging and discharging power decision corresponding to the current time step; after completing one cycle, update the battery inventory status and historical battery swapping demand data according to the actual execution results, and enter the next time step to repeat steps S2 to S5 for the next round of rolling optimization.

2. The method for optimizing the charging and discharging strategy of a battery swapping station according to claim 1, characterized in that: In step S1, outliers are removed from the collected historical battery swapping demand data, and gaps are filled using linear interpolation to form a historical observation vector for input; the time is obtained through the battery management system. The number of available batteries that meet the battery swapping standards is used as the battery inventory status; then, a price vector is constructed by obtaining time-of-use electricity price data in the future forecast time domain.

3. The method for optimizing the charging and discharging strategy of a battery swapping station according to claim 1, characterized in that: In step S2, the battery swapping demand prediction model is a parameterized data-driven model, and at each decision time... The model is based on the feature mapping function. Feature vectors composed of historical data With current model parameters Combined, in the prediction time domain Internal prediction of the future time step battery swapping demand ,satisfy: ; in, For the first Feature mapping function for each prediction step Relative to time The future prediction time step number; Furthermore, the model parameters Based on the observed value of new battery swapping demand Perform online updates to meet the following requirements: ; in, Learning rate; prediction error , Indicates at time The predicted time step The need for battery swapping; This is the updated model parameter vector.

4. The method for optimizing the charging and discharging strategy of a battery swapping station according to claim 3, characterized in that: The feature vector It incorporates intercept features, autoregressive features, and diurnal triangular features to capture the inertia and periodicity of battery swapping demand, and employs stochastic gradient descent or recursive least squares algorithms to implement model parameters. Online updates.

5. The method for optimizing the charging and discharging strategy of a battery swapping station according to claim 1, characterized in that: In step S3, the lower bound of the dynamic safe operating range is determined by the future cumulative battery swapping demand to ensure the continuity of the battery swapping service, so that the time step within the predicted time domain is within the specified range. Battery inventory status satisfy: ; in, , indicating at time step To maintain the minimum inventory capacity required to meet future battery swapping needs, Indicates time The future number calculated based on the prediction model Forecast of battery swapping demand at each time step To account for the safety redundancy constant of prediction uncertainty, This indicates the maximum inventory that a battery swapping station is allowed to store. The summation index variable represents the summation from the current prediction step. To the prediction time domain Each discrete time step between the endpoints is used to calculate the cumulative total demand during that time period.

6. The method for optimizing the charging and discharging strategy of a battery swapping station according to claim 1, characterized in that: In step S4, the battery inventory state is used as the state variable of the optimization model, and a discrete-time battery inventory state equation is established in the prediction time domain as a function of charge and discharge power: ; in, Indicates the first Available battery inventory at the end of each time step Indicates time step The charging and discharging power decisions between the battery swapping station and the power grid are determined, with positive values ​​representing charging and negative values ​​representing discharging; this satisfies the grid connection capacity constraints of the battery swapping station. , This indicates the maximum allowable charging and discharging power of the battery swapping station, determined jointly by the station's grid-connected capacity, the rated power of the power conversion equipment, and operational safety requirements. The rated energy capacity of a single battery cell. The overall charging and discharging efficiency coefficient. To control the cycle duration, This indicates the model's prediction of the future... The battery swapping demand occurring at each time step.

7. The method for optimizing the charging and discharging strategy of a battery swapping station according to claim 6, characterized in that: Under the conditions of satisfying the dynamic inventory status and grid-connected power constraints, in step S4, the charging and discharging power is... As decision variables, an objective function for optimizing the charging and discharging strategy in the prediction time domain is constructed to minimize the overall operating cost of the battery swapping station. The objective function is expressed as: ; in, The objective function value, Indicates time step Time-of-use electricity pricing This represents the penalty weighting coefficient for inventory deviating from the target inventory level. The target inventory level is a reference value for the number of available batteries that a battery swapping station is expected to maintain.

8. The method for optimizing the charging and discharging strategy of a battery swapping station according to claim 1, characterized in that: In step S5, the charging and discharging strategy optimization model in the predicted time domain is solved to obtain the optimal charging and discharging power decision sequence, and the optimal charging and discharging power corresponding to the current time step is executed: ; in, Indicates at time step The optimal power decision sequence obtained by solving the problem. Indicates time The corresponding optimal charge / discharge power decision value.