Household energy storage pre-charging control method and system based on scenario synthesis and spike prediction

CN122993174APending Publication Date: 2026-10-27NANTONG ALPHA ESS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611049944.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-15
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

1.户用储能数据稀缺,极端场景覆盖不足:

Benefits of technology

本发明通过带物理约束的LLM本地化极端场景合成,生成符合电力市场规律的极端电价样本,扩充训练数据边界;从根本上替代SMOTE/GAN等盲目增强方法,避免物理失真,让预测模型基于真实可信的数据分布训练,大幅提升极端场景预测泛化能力。解决了户储小样本数据困境,保证数据物理一致性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122993174A_ABST
    Figure CN122993174A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of energy storage system control, and provides a household energy storage pre-charging control method and system based on scene synthesis and peak prediction. First, LLM is used to generate localized extreme electricity price scenes under physical constraints to expand the training data set. Then, based on Bayesian LSTM combined with Monte Carlo Dropout reasoning, the future electricity price probability distribution and confidence interval are obtained. A pre-charging cost-benefit-risk trade-off optimization model is constructed to solve the target SOC trajectory and pre-charging power instruction. Real-time monitoring of electricity price deviation triggers rolling re-optimization. LLM explains the decision to the user and receives feedback to correct the personalized control parameters online. The application can effectively solve the problems of small sample prediction distortion, peak arbitrage loss and low user trust of household storage, realize the transition from passive low-price charging to active risk pre-charging, realize active pre-charging arbitrage and battery life protection, and greatly improve the economy and practicality of household energy storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of energy storage system control technology, specifically relating to a pre-charging control method and system for residential energy storage based on scenario synthesis and peak prediction. Background Technology

[0002] Currently, residential energy storage, as a core unit of distributed energy, mainly participates in electricity market arbitrage through a model of charging during off-peak hours and discharging during peak hours. It is a key device for improving household energy economy and power supply reliability. However, current residential energy storage charging and discharging control heavily relies on electricity price forecasting and optimization decisions. Existing technologies suffer from core deficiencies in four key areas: data, forecasting, decision-making, and interaction, severely limiting system arbitrage profits and user acceptance. 1. Residential energy storage data is scarce, and coverage of extreme scenarios is insufficient: Residential energy storage installation cycles are short (typically 1-3 years), and the accumulation of historical operational data on the user side is limited, especially lacking in: Localized extreme electricity price samples: Historical electricity price data for the distribution network nodes where users are located is difficult to obtain, and extreme peak events (such as line failures caused by typhoons or a surge in air conditioning load in summer) may only occur once every few years; User-side load-electricity price linkage data: The impact of household EV charging and the starting of high-power appliances on local node electricity prices was not recorded; Cross-domain correlation characteristics: the correlation patterns between external factors such as meteorological disaster early warning, power grid maintenance plans, and fluctuations in renewable energy output and electricity prices.

[0003] Existing data-driven prediction methods rely on training with large-scale historical data, which has poor generalization ability in scenarios with small sample sizes, and is especially unable to predict extreme events that have not been experienced.

[0004] 2. Deterministic point prediction has a risk blind spot and poor decision robustness. Existing charging and discharging strategies are all based on LSTM single-point prediction and deterministic optimization. The prediction error accumulates and amplifies during rolling optimization, making it impossible to quantify the prediction uncertainty. In actual operation, there are two problems: missing the peak (conservative prediction without pre-charging, missing arbitrage opportunities) and over-pre-charging (aggressive prediction with high-price charging, resulting in losses when the peak does not appear). Moreover, the system lacks risk exposure assessment and cannot adapt to users' personalized risk preferences.

[0005] 3. The pre-charging strategy is rigid and lacks active arbitrage logic. Traditional strategies only follow the passive logic of "charging only when the electricity price is below a threshold" and do not introduce an active pre-charging mechanism. They cannot deploy battery SOC in advance at the current market price or even higher price when predicting future extreme peaks, thus missing the core arbitrage opportunity of "buying at a high price and selling at an even higher price". The strategy is seriously lacking in flexibility and profitability.

[0006] 4. Decision-making is opaque, leading to low user trust. Existing intelligent control systems suffer from the problems of "no explanation, no disclosure, no response, and no learning": they do not explain the reasons for pre-charging decisions, do not disclose the risk of prediction errors, cannot adapt to users' temporary power needs, and do not record user feedback to optimize strategies; this leads to users having extremely low trust in automated decision-making, making it difficult for them to accept the system's proactive control, and further exacerbating the problem of strategy failure.

[0007] Furthermore, existing energy storage optimization solutions based on large language models are primarily geared towards large-scale centralized energy storage. These solutions rely on massive historical grid-level data (such as AEMO's market clearing data over many years) and employ LLM for data augmentation, Bayesian prediction, and multi-scenario stochastic optimization. However, these solutions differ fundamentally from distributed residential energy storage: large-scale energy storage utilizes a unified grid-level market clearing price, resulting in abundant data and a macroscopic spatial scale; residential energy storage, on the other hand, uses localized prices at the distribution network node level, is significantly affected by local load fluctuations, has extremely scarce historical data (typically less than 1000 records), and must consider the micro-behavior of individual users, limited system information, and the trust and interaction needs of residential users. Therefore, existing large-scale energy storage solutions cannot be directly transferred to residential energy storage scenarios, necessitating specialized technical solutions tailored to the small sample size, node-level electricity prices, and user interaction characteristics of residential energy storage. Summary of the Invention

[0008] The purpose of this invention is to overcome the shortcomings of existing methods and provide a residential energy storage pre-charging control method and system based on scenario synthesis and peak prediction. It proposes a five-layer closed-loop architecture of "synthesis-prediction-decision-execution-interaction." The data layer collects local historical electricity prices, user load, weather, and grid events; the synthesis layer uses LLM to generate localized extreme scenarios under physical constraints; the prediction layer obtains the electricity price probability distribution through Bayesian LSTM combined with Monte Carlo Dropout; the decision layer constructs a pre-charging cost-benefit-risk trade-off optimization model to solve for the objective SOC; and the interaction layer explains the decision to the user and receives feedback through LLM. The closed-loop collaboration of each layer achieves a shift from passive low-cost charging to proactive risk-based pre-charging.

[0009] To solve the above-mentioned technical problems, the present invention provides the following technical solution: The first objective of this invention is to provide a pre-charging control method for residential energy storage based on scene synthesis and peak prediction, comprising the following steps: (1) Obtain user power grid area identifier, local historical electricity price data, and external knowledge sources, use large language model to generate localized extreme electricity price scenarios under physical constraints, and expand local historical electricity price data to obtain an enhanced dataset; (2) Based on the augmented dataset, the distribution of electricity price predictions for future periods and the corresponding confidence intervals are obtained by using Bayesian LSTM combined with Monte Carlo Dropout inference; (3) Calculate the probability of peak occurrence in each period based on the electricity price prediction distribution, and make a pre-charging trigger determination in combination with the confidence level threshold set by the user. Construct a pre-charging cost-benefit-risk trade-off optimization model, and solve the pre-charging target SOC trajectory and the pre-charging power command for the current period by quantifying the expected net benefit and risk value. (4) Send the pre-charge power command to the inverter for execution and monitor the grid electricity price in real time. When the deviation between the real-time electricity price and the prediction exceeds the set threshold, trigger rolling re-optimization and re-execute steps (2) to (3) with the latest data. (5) Use a large language model to convert the pre-charging decision into natural language and display it to the user, receive user feedback and correct personalized control parameters online.

[0010] Furthermore, the generation of localized extreme electricity price scenarios under physical constraints using a large language model includes: Construct a structured Prompt that includes domain context, historical extreme cases, and physical constraints; Synthetic samples are generated using a large language model, and their physical consistency is verified. Counterintuitive samples that violate the physical laws of the electricity market are then removed.

[0011] Furthermore, the method of using Bayesian LSTM combined with Monte Carlo Dropout inference to obtain the electricity price prediction distribution and corresponding confidence intervals for future periods specifically includes: Keep Dropout enabled during the Bayesian LSTM inference phase and execute... Sub-random forward propagation:

[0012]

[0013] in, For the first Dropout mask during the next forward propagation This represents the Dropout probability. It follows the Bernoulli distribution. For the first Electricity price forecasts from the next forward propagation; Obtain the prediction set Calculate the approximate forecast mean and approximate forecast variance, and use the Gaussian forecast distribution model and confidence interval calculation model to obtain the electricity price forecast distribution and corresponding confidence interval for future periods.

[0014] Furthermore, the formula for calculating the probability of peak occurrence in each time period is expressed as follows:

[0015] in, for Probability of time spike occurrence The standard normal cumulative distribution function is... Peak electricity price thresholds set for users, for Predicted mean at any time for Standard deviation of time-time prediction.

[0016] Furthermore, the pre-charging cost-benefit-risk trade-off optimization model is expressed as follows: Optimize the objective function:

[0017] in, Let SOC trajectory function be the target function to be optimized. for Always expecting returns This is the risk aversion coefficient. This is a risk metric. Expected returns:

[0018] in, This represents the probability of a spike occurring. This represents the average electricity price predicted during peak hours. Based on the current pre-charge electricity price, This represents the average predicted electricity price during off-peak hours. This is the planned discharge amount; Risk items:

[0019] in, Confidence level Value at risk (VaR) For the loss random variable, For the indeterminate boundary, Risk confidence level; Constraints:

[0020]

[0021]

[0022]

[0023] in, Minimum permissible SOC of the battery The maximum permissible SOC of the battery. For the battery's rated capacity, For maximum charge and discharge power, The duration is the length of the time period. To ensure State of Charge (SOC) for home backup power, To predict the number of iterations within the prediction window, This represents the maximum number of cycles allowed per day.

[0024] Furthermore, the receiving of user feedback and online correction of personalized control parameters specifically includes: When a user questions the pre-charging decision or sends an overwrite instruction, the system maintains the user's personalized confidence threshold based on the comparison of the number of correct user judgments with the number of correct system judgments. Adjust the risk aversion coefficient and peak threshold based on user feedback so that the system strategy can gradually adapt to the user's personalized risk preferences; The scenarios where users raise questions are recorded as potential false positive samples, which are then used to amplify negative samples during retraining, forming a reinforcement learning-style continuous evolution mechanism.

[0025] Another objective of this invention is to provide a residential energy storage pre-charging control system based on scene synthesis and peak prediction, comprising: The LLM localized extreme scenario synthesis module is used to acquire user power grid area identifiers, local historical electricity price data, and external knowledge sources. It uses a large language model to generate localized extreme electricity price scenarios under physical constraints and expands the local historical electricity price data to obtain an enhanced dataset. The Bayesian probabilistic electricity price prediction module is used to obtain the electricity price prediction distribution and corresponding confidence interval for future periods based on the augmented dataset using Bayesian LSTM combined with Monte Carlo Dropout inference. The peak probability assessment and pre-charging decision module is used to calculate the probability of peak occurrence in each time period based on the electricity price prediction distribution, combine the confidence level threshold set by the user to determine the pre-charging trigger, construct the pre-charging cost-benefit-risk trade-off optimization model, and solve the pre-charging target SOC trajectory and the pre-charging power command for the current time period by quantifying the expected net benefit and risk value. The pre-charge execution and real-time correction module is used to send the pre-charge power command to the inverter for execution and monitor the grid electricity price in real time. When the deviation between the real-time electricity price and the prediction exceeds a set threshold, rolling re-optimization is triggered. The LLM-driven interpretation and online correction module is used to convert pre-charging decisions into natural language for display to users using a large language model, receive user feedback, and correct personalized control parameters online.

[0026] Furthermore, the LLM localized extreme scene synthesis module includes: The feature extraction unit extracts extreme sample thresholds from local historical electricity price data and extracts contextual feature vectors for detected extreme samples. The Prompt building block constructs a structured Prompt containing domain context, historical extreme cases, and physical constraints. The physical consistency verification unit generates synthetic samples through a large language model, performs physical consistency verification on the synthetic samples, and removes counterintuitive samples that violate the physical laws of the electricity market.

[0027] Another object of the present invention is to provide an electronic device, including a processor and a memory storing a computer program, wherein the processor executes the computer program to implement the residential energy storage pre-charging control method based on scene synthesis and peak prediction provided by the first object of the present invention.

[0028] Another object of the present invention is to provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the residential energy storage pre-charging control method based on scene synthesis and peak prediction provided by the first object of the present invention.

[0029] In combination with the above technical solutions, the beneficial effects of the present invention compared with the prior art are as follows: This invention generates extreme electricity price samples that conform to the laws of the electricity market through locally-based extreme scenario synthesis using physically constrained LLM, thus expanding the training data boundary. It fundamentally replaces blind augmentation methods such as SMOTE / GAN, avoiding physical distortion and allowing the prediction model to be trained based on real and reliable data distributions, significantly improving the generalization ability of extreme scenario predictions. It solves the problem of small sample data for household storage and ensures physical consistency of data.

[0030] This invention employs Bayesian LSTM combined with Monte Carlo Dropout to output the probability distribution and confidence interval of electricity prices, transforming the "whether a peak occurs" from a single-point guess into a calculable probability metric. By introducing Value at Risk (VaR) and user-defined risk preferences, the optimization objective is upgraded from "maximizing returns" to "expected returns - risk trade-off," completely avoiding the double losses of missing peaks and overcharging, eliminating blind spots in prediction risk, and achieving quantitative robust decision-making.

[0031] This invention employs a pre-charging cost-benefit-risk trade-off model, allowing the system to proactively pre-charge and deploy the SOC at market price / high price when the expected net benefit is positive. By calculating the benefits under two scenarios of peak occurrence / absence, it accurately balances arbitrage benefits and prediction error losses, realizing a proactive arbitrage mode of "high-price pre-charging and even higher-price discharging," breaking through the traditional charging logic and achieving proactive arbitrage pre-charging.

[0032] This invention establishes a rolling re-optimization mechanism triggered by real-time electricity price deviation. When the actual electricity price exceeds the prediction confidence interval, the prediction and pre-charging plan are updated immediately. This forms a closed loop of "prediction-execution-detection-correction", which controls the prediction deviation loss within a single cycle, greatly improves the robustness of the strategy under dynamic electricity price environment, and dynamically rolls the correction to improve the strategy's adaptive capability.

[0033] This invention embeds a hard constraint on the number of battery cycles into the optimization model, limiting the number of daily pre-charge cycles; it avoids overcharging and discharging for short-term arbitrage that could damage the battery, balances "peak returns" with "battery lifespan," safeguards the long-term investment value of residential energy storage, protects battery lifespan, and improves the overall economic efficiency throughout the entire lifecycle. This invention uses LLM to transform decision-making into natural language explanations, transparently disclosing peak probabilities, pre-charge costs, expected benefits, and risks; it receives user feedback and corrects parameters such as confidence thresholds and risk coefficients online, forming a continuous evolution mechanism of "explanation-feedback-correction," solving the black box problem of decision-making, creating a closed loop of human-machine collaboration, significantly improving user acceptance, enhancing user trust, and personalizing the application.

[0034] The essential difference between this invention and the prior art lies in: Differences in data scarcity: In existing large-scale energy storage solutions, LLM is only used as a data enhancement auxiliary material, relying on massive historical data; This invention is aimed at scenarios where household storage data is extremely scarce (sample size is usually <<1000), and uses LLM synthesis as the data foundation rather than an enhancement method. Physical constraints are injected through structured Prompt to ensure that the synthesized samples conform to the laws of the electricity market.

[0035] Innovation in the transformation from prediction to decision-making: Existing technologies use prediction for multi-scenario stochastic optimization (power allocation); this invention transforms probabilistic prediction into pre-charge target SOC planning (state pre-deployment), introducing an active arbitrage decision logic of "high-price pre-charging, higher-price discharging", breaking through the passive boundary of the traditional "charging only during low-price periods".

[0036] User interaction closed loop: Existing technologies lack user interaction; This invention achieves decision transparency by interpreting the agent through LLM, and receives user natural language feedback (questioning, override), and corrects personalized confidence thresholds, risk aversion coefficients and peak thresholds online, forming a human-machine co-evolution mechanism. Attached Figure Description

[0037] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of the residential energy storage pre-charging control method based on scene synthesis and peak prediction provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of the residential energy storage pre-charging control system based on scene synthesis and peak prediction provided in an embodiment of the present invention. Detailed Implementation

[0038] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0039] Example 1:

[0040] like Figure 1 The image shows an embodiment of the residential energy storage pre-charging control method based on scene synthesis and peak prediction provided by the present invention, which specifically includes the following steps: S1: Obtain the user's power grid area identifier, local historical electricity price data, and external knowledge sources. Use a large language model to generate localized extreme electricity price scenarios under physical constraints, and expand the local historical electricity price data to obtain an enhanced dataset. S2: Based on the augmented dataset, use Bayesian LSTM combined with Monte Carlo Dropout inference to obtain the electricity price prediction distribution and corresponding confidence interval for future periods; S3: Calculate the probability of peak occurrence in each time period based on the electricity price prediction distribution, combine the confidence level threshold set by the user to determine the pre-charging trigger, construct the pre-charging cost-benefit-risk trade-off optimization model, and solve the pre-charging target SOC trajectory and the pre-charging power command for the current time period by quantifying the expected net benefit and risk value. S4: Send the pre-charge power command to the inverter for execution and monitor the grid electricity price in real time. When the deviation between the real-time electricity price and the prediction exceeds the set threshold, trigger rolling re-optimization and re-execute steps S2 to S3 with the latest data. S5: Utilizes a large language model to translate pre-charging decisions into natural language and present them to the user, receiving user feedback and correcting personalized control parameters online.

[0041] Specifically, this invention transforms LLM from a "general text generator" into a "domain scenario synthesizer under physical constraints" through a structured Prompt. Specifically, the Prompt explicitly injects three layers: domain context (regional power grid structure, electricity pricing mechanism), historical extreme cases (few sample examples), and physical constraints (ensuring consistency between variable covariance and historical statistical patterns through partial derivative constraints). After generation, physical consistency verification is performed, actively removing samples that violate common sense in the electricity market. LLM synthesis is no longer a "data augmentation supplement" for large-scale energy storage, but rather a "data foundation" for small-sample scenarios in household energy storage. The synthesized samples both expand the training set distribution boundary and maintain the consistency of physical correlations such as "high load + extreme high temperature → high price," enabling subsequent prediction models to be trained based on physically reliable data distributions, fundamentally solving the dual dilemma of "few data and distortion after augmentation" in household energy storage scenarios.

[0042] This invention establishes an explicit mapping link from Bayesian prediction distribution to pre-charge control commands. First, the prediction distribution is transformed into the probability of peak occurrence at each time period; then, a user-defined confidence level is introduced. Only when Pre-charging is triggered only when the time is right, forming a set of target pre-charging time periods. Finally, the pre-charge target SOC trajectory is solved using dynamic programming. By transforming the unquantifiable, single-point guess of whether a peak will occur in the future into a computable, thresholdable, and personalized probabilistic metric, and further mapping it to specific battery state pre-deployment instructions, residential energy storage systems have, for the first time, acquired proactive control capabilities based on uncertainty quantification, rather than passively relying on point predictions for "gambling"-style decision-making.

[0043] This invention constructs a specialized pre-charging economics model, with the optimization objective explicitly including the expected returns of two scenarios: earning the price difference by discharging at a high price during peak periods (probability-dependent). If the peak does not occur, the pre-charging cost loss will be borne (probability). Simultaneously, Value at Risk (VaR) is introduced as a risk metric to establish... This framework balances various factors. The constraints allow pre-charging to be triggered as long as the expected net return is positive, breaking the traditional boundary of "only low-price charging." By upgrading user storage control from passive "low-price charging" to proactive "risk-adventure-based charging" based on probability prediction, the system can proactively pre-charge and deploy SOCs at market price or even higher than the average price, under the premise of quantitatively assessing "prediction error losses." This avoids arbitrage opportunity losses caused by "missed peaks" and prevents blind costs from excessive pre-charging through VaR constraints, achieving Pareto optimality between return and risk.

[0044] This invention deploys an LLM (Limited Least Metric) as a bidirectional interactive node consisting of an "Explanation Agent" and a "Feedback Receiver." The Explanation Agent translates pre-charging decisions into structured natural language (including peak probability, pre-charging cost, expected benefit, and Value at Risk (VaR)) so that users understand "why charge now at ¥0.6 / kWh"; it also receives user confirmations, questions, or override instructions (e.g., "Guests are coming tonight, need to be fully charged for backup"). More importantly, the system performs online personalized adjustments based on user feedback: dynamically adjusting personalized confidence thresholds and synchronously updating the risk aversion coefficient. With peak threshold By transforming "black-box automated decision-making" into "transparent human-machine collaborative evolution," the system not only explains "what was done" to the user but also continuously optimizes "how it was done" based on user feedback, gradually calibrating to a personalized model that aligns with the user's specific risk preferences and lifestyle. This directly addresses the core pain point of low user trust and acceptance of automated strategies, forming a continuously enhanced human-machine collaborative closed loop.

[0045] This invention establishes an event-triggered mechanism based on statistical anomaly detection. By monitoring actual electricity prices in real time, the deviation between the actual electricity price and the predicted distribution is quantified as a trigger signal. Once an abnormal deviation is detected, the probability prediction and pre-charging decision steps are immediately re-executed, and the pre-charging plan is updated on a rolling basis. This achieves closed-loop control of "prediction-execution-detection-correction". The system no longer blindly follows the initial pre-charging plan, but automatically triggers strategy recalculation when prediction fails, controlling the loss caused by prediction deviation within a single control cycle, and significantly improving the robustness and adaptability of the strategy in a dynamic electricity price environment.

[0046] This invention explicitly introduces battery cycle life constraints into the pre-charge optimization model, embedding the maximum permissible number of cycles per day as a hard constraint into the target SOC trajectory optimization. This constraint is solved simultaneously with the pre-charge benefit optimization, rather than as a posterior correction. By incorporating the long-term aging cost of the battery into the constraint space of the short-term pre-charge decision, the system achieves an engineering-feasible balance between "capturing peak benefits" and "protecting battery life." This avoids long-term economic degradation caused by excessively depleting battery cycle life in pursuit of short-term arbitrage, thus safeguarding the full lifecycle investment value of residential energy storage systems.

[0047] The specific implementation details of each step in this embodiment will be further explained below.

[0048] Step 1: Localized Extreme Scene Compositing using LLM 1. Objective: To generate physically consistent local extreme electricity price scenarios under the condition of scarce user historical data, and to expand the distribution boundary of training data.

[0049] 2. Input: User power grid area identifier: ; Local historical electricity price data: ,in The input feature vector contains historical electricity prices, load, weather, etc. For electricity price, For the sample size (usually small, ); External knowledge sources: meteorological disaster database (obtained through meteorological API), power grid maintenance notices (obtained through public interfaces of power grid companies or by web crawlers), regional load characteristic reports; LLM domain knowledge: It imparts general power market knowledge through pre-training, injects specific regional rules through Prompt engineering, and adapts to localized expressions through fine-tuning.

[0050] 3. Processing procedure: (1) Extreme event detection and feature extraction: Extracting extreme sample thresholds from historical data:

[0051] in: For historical electricity prices quantiles; This indicates that the top 5% of extremely high-priced samples will be extracted. This is the historical electricity price vector.

[0052] For the detected extreme samples, extract their contextual feature vectors:

[0053] in: : Regional load corresponding to the time period; Ambient temperature; Wind speed; Event markers (such as typhoon warnings, power grid maintenance); Hour marker; : Weekday identifier.

[0054] (2) Structured Prompt Design: LLM build tips, including: Domain context: Describes the power grid structure, electricity pricing mechanism, and typical load patterns of the user's region; Historical extreme cases: Several real extreme events serve as examples from a small sample size; Physical constraints: Ensure that the synthesized sample meets the physical laws of the electricity market and avoid situations that violate physical laws or common sense in the market, such as combinations that defy common sense, like load reduction but electricity price soaring, or wind power output increasing significantly but electricity price remaining high.

[0055] Hint structure:

[0056] in: For the historical context encoding function, encode the most recent The feature sequence of each time step is emphasized, highlighting its temporal nature; For the first One physical constraint term; To constrain the weighting coefficients, the LLM is forced to follow the physical laws of the electricity market during generation.

[0057] Constraints ensure that the covariance among variables is consistent:

[0058] in: Let be the variable correlation function, representing the th The variable for the first Dependencies of variables; The partial derivative of the objective function is estimated from historical data. Tolerance; For the first One relevant variable; For variable increment; This constraint ensures that the physical relationship between electricity price and variables such as load and temperature in the synthetic sample is reasonable, and avoids distortion of the relationship between features.

[0059] (3) LLM generation and verification: LLM generates synthetic samples:

[0060] in: The input feature vector for synthesis; The price of electricity is the synthesized price; This indicates that the large language model is providing prompts. The generation process under certain conditions; Repeated generation Each time, the scene description is fine-tuned to capture diverse extreme situations.

[0061] Verify the physical consistency of the synthesized samples: check the positive correlation between electricity price and load, check the probability of extreme high temperature and high price occurring simultaneously, and eliminate samples that violate the basic laws of the electricity market.

[0062] 4. Output: Synthetic dataset ; Augmented training set .

[0063] The synthetic samples generated in step one expand the training set in quantity (forming D_augmented=D_local∪D_synthetic) and maintain the consistency of physical correlations such as "high load + high temperature → high price" in quality, enabling subsequent prediction models to be trained based on physically reliable data distributions. This fundamentally solves the dual dilemma of "limited data and physical distortion after augmentation" in small-sample scenarios involving household storage, replacing blind augmentation methods like SMOTE / GAN that lack domain knowledge constraints, and ensuring that the patterns learned by the model conform to the actual operating laws of the power system.

[0064] Step 2: Bayesian Probabilistic Electricity Price Prediction 1. Objective: Based on augmented datasets, output the probability distribution of future electricity prices with confidence intervals to quantify prediction uncertainty.

[0065] 2. Input: Augmented dataset ; Current input features (Historical electricity prices, load forecasts, weather forecasts, event markers).

[0066] 3. Processing procedure: Bayesian LSTM network training: Using LSTM (Long Short-Term Memory) network as the basic architecture, its advantage lies in its ability to capture long-term dependencies in electricity price time-series data.

[0067] Model outputs electricity price prediction:

[0068] in: For LSTM neural network mapping functions; for Input feature vector at any time; The network weights are treated as random variables, and their posterior distribution is learned. ; To predict noise; For noise variance; To predict the step size; Note: Strict Bayesian inference is computationally complex. In practice, approximate methods such as variational inference (VI) or Monte Carlo Dropout are used to estimate the posterior to avoid computational overhead.

[0069] Monte Carlo Dropout reasoning: During training, Dropout regularization is enabled; during inference, Dropout remains enabled (this is the core innovation of McAfee Dropout). Sub-random forward propagation:

[0070]

[0071] in: For the first Dropout mask during the next forward propagation; The probability of Dropout (e.g., 0.2); It follows a Bernoulli distribution with probability. Randomly zeroed neurons; For the first Electricity price forecasts from the next forward propagation; Obtain the prediction set .

[0072] Predicted distribution estimation: Approximate predicted mean:

[0073] in: Given input Electricity price forecasts for the time period; Monte Carlo sampling number (usually) ).

[0074] Approximate prediction variance:

[0075] Construct the Gaussian prediction distribution:

[0076] Confidence interval:

[0077] in: significance level (e.g.) (corresponding to a 95% confidence level) The quantiles of the standard normal distribution (corresponding to the 95% confidence level) ).

[0078] 4. Output: future Electricity price forecast distribution for different time periods: in: For forecasting the horizon (e.g., 24 hours); The predicted mean value for time t+h; The variance is predicted for time t+h.

[0079] Step 3: Peak Probability Assessment and Pre-charging Decision 1. Objective: To transform probabilistic predictions into an executable pre-charge control strategy to achieve an arbitrage model of "high-price pre-charge, higher-price discharge".

[0080] 2. Input: future Electricity price forecast distribution for different time periods ; User-defined peak threshold (e.g., ¥1.0 / kWh); User confidence level (e.g., 80%), reflecting the user's customized risk preference; Current battery status ,capacity Maximum charging and discharging power .

[0081] 3. Processing procedure: Peak occurrence probability calculation: Calculate the probability of electricity prices exceeding the threshold for each time period:

[0082] in: for Probability of time spike occurring; It is the standard normal cumulative distribution function; Peak electricity price thresholds set for users; for Predicted mean at any given time; for Standard deviation of time-time prediction.

[0083] Precharge trigger determination: Define the precharge trigger set:

[0084] in: For the set of target pre-charging time periods; The confidence level threshold set for the user; For forecasting the horizon; That is, when the peak probability in a certain period exceeds the user-set confidence level, that period is included in the pre-charging target.

[0085] Pre-charge target SOC dynamic programming: Define the pre-charge target SOC trajectory Optimization issues:

[0086] in: The target SOC trajectory function to be optimized; for Always expecting returns; Risk aversion coefficient; This is a risk metric.

[0087] Expected returns:

[0088] in: The probability of peak occurrence; Forecast average electricity price during peak hours The current pre-charge electricity price; This represents the average predicted electricity price during off-peak hours. This is the planned discharge amount.

[0089] meaning: If a spike occurs (probability) ): Peak average price Discharge, minus pre-charge cost ; If the spike does not occur (probability) ): using non-peak average price Discharging may result in losses.

[0090] Risk item (Value at Risk VaR):

[0091] in: Confidence level Value at risk, i.e., the maximum possible loss at a given confidence level; For loss random variables; The infimum; For risk confidence level (e.g.) ).

[0092] Constraints:

[0093]

[0094]

[0095]

[0096] in: Minimum permissible SOC for the battery; This is the maximum permissible SOC of the battery (typically 100%). The rated capacity of the battery is (kWh). Maximum charging and discharging power (kW); The duration is in hours. To ensure the State of Charge (SOC) of the household backup power supply (e.g., 20%). To estimate the number of iterations within the prediction window; The maximum number of cycles allowed per day (e.g., 2 times) is set to protect the battery's long lifespan by limiting the number of cycles.

[0097] Pre-charging timing and power determination: In the current period ,like Trigger pre-charge:

[0098] in: for Pre-charge power at all times; For the current SOC; The target SOC for the next time period; This represents the maximum allowable power exchange in the power grid.

[0099] Acceptable range of pre-charge electricity price:

[0100] In other words, as long as the expected net income is positive, pre-charging at a price higher than that of conventional off-peak electricity is permitted.

[0101] 4. Output: Pre-charge target SOC trajectory ; Current period pre-charge power ; Expected return on precharge and Value at Risk (VaR).

[0102] This embodiment introduces the concept of proactive pre-charging: the system upgrades from a passive strategy of "charging only during low-price periods" to an active strategy of "deploying SOC in advance based on probability prediction," enabling an arbitrage model of "buying at high prices and selling at even higher prices." Through a cost-benefit-risk trade-off model, a balance is struck between expected returns and VaR risk, avoiding the dual losses of "missing peaks" (no pre-charging) and "over-pre-charging" (peaks not appearing after pre-charging). Battery cycle constraints ensure the long-term economic viability of the pre-charging strategy. This breaks the rigid logic of existing strategies that "charge only during low-price periods," enabling residential energy storage systems to proactively pre-charge at market prices or even higher prices based on probabilistic peak prediction, deploying SOC in advance to capture extreme peak electricity price arbitrage opportunities, while controlling potential losses from pre-charging through risk quantification and lifetime constraints.

[0103] Step 4: Pre-charge execution and real-time correction 1. Purpose: To translate pre-charging decisions into physical execution and to make rolling adjustments based on real-time electricity prices.

[0104] 2. Input: Precharge power command ; Real-time electricity price ; Real-time battery status .

[0105] 3. Processing procedure: Inverter power distribution:

[0106] The negative sign indicates the charging direction.

[0107] Event triggering fix: When the deviation between real-time electricity price and forecast exceeds a threshold, re-optimization is triggered.

[0108] in: This is an indicator function that takes the value 1 if the condition is met, and 0 otherwise. for Real-time electricity prices; for Predicted mean at any given time; for Time-based forecast standard deviation; The deviation coefficient, It corresponds to a confidence interval of approximately 95%; anything outside of this interval is considered abnormal.

[0109] Once triggered, steps two and three are re-executed with the latest data to continuously update the pre-charging plan.

[0110] Peak performance verification: If a spike actually occurs after pre-charging: execute discharge arbitrage and record "prediction successful"; If no spike appears after pre-charging: record "prediction error" for subsequent model correction.

[0111] 4. Output: Actual charge / discharge power curve; Prediction accuracy records (for online learning).

[0112] Step 5: Interpretation and Online Correction of LLM Drivers 1. Objective: To make pre-charging decisions transparent to users and to optimize personalized models by incorporating user feedback.

[0113] 2. Input: Pre-charge decision log: ; User natural language query or feedback .

[0114] 3. Processing procedure: Explanation of decision-making transparency: LLM generates structured interpretations: "The system predicts an 82% probability of a price spike of ¥1.5 / kWh between 20:00 and 22:00 tonight (currently ¥0.6). It is recommended to pre-charge to 85% SOC now, with a pre-charging cost of approximately ¥3.6. If the spike occurs, the expected return is ¥12.8; if it does not occur, the loss is approximately ¥2.4. Your risk tolerance is set to 'Medium,' and the system has automatically balanced returns and risks." User feedback received: Confirmation: Pre-charge performed; Question: "I don't think the price will go up tonight" → Record user judgment; Override: "Guests are coming to the house tonight, so a full charge is needed for backup" → Pause pre-charging, prioritizing user commands, reflecting the system's human-centered design and user-driven nature.

[0115] Online personalized calibration: Maintain user-specific confidence thresholds :

[0116] in: Personalized confidence thresholds for users; The learning rate (e.g., 0.01); The number of times the user is judged as correct (1 indicates correct, 0 indicates incorrect); The system determines the number of correct answers (1 indicates correct, 0 indicates incorrect).

[0117] If the user makes multiple correct predictions while the system errs, the risk decreases. (Users are more aggressive); conversely, (the system becomes more conservative).

[0118] At the same time, the risk aversion coefficient was adjusted based on user feedback. and peak threshold :

[0119]

[0120] in To adjust the coefficients and achieve more comprehensive personalized adaptation.

[0121] The scenarios where users raise questions are recorded as "potential false positive samples" and used to amplify negative samples during retraining, forming a reinforcement learning-style continuous evolution mechanism.

[0122] 4. Output: Natural language interpretation of text; Updated user personalization parameters ; Feedback record dataset.

[0123] Example 2:

[0124] like Figure 2 As shown, this embodiment provides a residential energy storage pre-charging control system based on scene synthesis and peak prediction, including: The LLM localized extreme scenario synthesis module is used to obtain user power grid area identifiers, local historical electricity price data, and external knowledge sources. It uses a large language model to generate localized extreme electricity price scenarios under physical constraints and expands the local historical electricity price data to obtain an enhanced dataset. The Bayesian probabilistic electricity price prediction module is used to obtain the electricity price prediction distribution and corresponding confidence interval for future periods based on the augmented dataset using Bayesian LSTM combined with Monte Carlo Dropout inference. The peak probability assessment and pre-charging decision module is used to calculate the probability of peak occurrence in each time period based on the electricity price prediction distribution, combine the confidence level threshold set by the user to determine the pre-charging trigger, construct the pre-charging cost-benefit-risk trade-off optimization model, and solve the pre-charging target SOC trajectory and the pre-charging power command for the current time period by quantifying the expected net benefit and risk value. The pre-charge execution and real-time correction module is used to send the pre-charge power command to the inverter for execution and monitor the grid electricity price in real time. When the deviation between the real-time electricity price and the prediction exceeds a set threshold, rolling re-optimization is triggered. The LLM-driven interpretation and online correction module is used to convert pre-charging decisions into natural language for display to users using a large language model, receive user feedback, and correct personalized control parameters online.

[0125] As a preferred embodiment, the LLM localized extreme scene compositing module in this implementation includes: The feature extraction unit extracts extreme sample thresholds from local historical electricity price data and extracts contextual feature vectors for detected extreme samples. The Prompt building block constructs a structured Prompt containing domain context, historical extreme cases, and physical constraints. The physical consistency verification unit generates synthetic samples through a large language model, performs physical consistency verification on the synthetic samples, and removes counterintuitive samples that violate the physical laws of the electricity market.

[0126] Example 3:

[0127] This embodiment provides an electronic device, including a processor and a memory storing a computer program. When the processor executes the computer program, it implements the residential energy storage pre-charging control method based on scene synthesis and peak prediction provided by the first objective of this invention.

[0128] Example 4:

[0129] This embodiment provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the residential energy storage pre-charging control method based on scene synthesis and peak prediction provided by the first objective of this invention.

[0130] It should be understood that although the steps in the flowcharts of the various embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in the present invention, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some steps in the various embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.

[0131] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0132] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A pre-charging control method for residential energy storage based on scene synthesis and peak prediction, characterized in that, The method includes the following steps: (1) Obtain user power grid area identifier, local historical electricity price data, and external knowledge sources, use large language model to generate localized extreme electricity price scenarios under physical constraints, and expand local historical electricity price data to obtain an enhanced dataset; (2) Based on the augmented dataset, use Bayesian LSTM combined with Monte Carlo Dropout inference to obtain the electricity price prediction distribution and corresponding confidence interval for future periods; (3) Calculate the probability of peak occurrence in each period based on the electricity price prediction distribution, and make a pre-charging trigger determination in combination with the confidence level threshold set by the user. Construct a pre-charging cost-benefit-risk trade-off optimization model, and solve the pre-charging target SOC trajectory and the pre-charging power command for the current period by quantifying the expected net benefit and risk value. (4) Send the pre-charge power command to the inverter for execution and monitor the grid electricity price in real time. When the deviation between the real-time electricity price and the prediction exceeds the set threshold, trigger rolling re-optimization and re-execute steps (2) to (3) with the latest data. (5) Use a large language model to convert the pre-charging decision into natural language and display it to the user, receive user feedback and correct personalized control parameters online.

2. The residential energy storage pre-charging control method based on scene synthesis and peak prediction according to claim 1, characterized in that, The method of generating localized extreme electricity price scenarios under physical constraints using a large language model includes: Construct a structured Prompt that includes domain context, historical extreme cases, and physical constraints; Synthetic samples are generated using a large language model, and their physical consistency is verified. Counterintuitive samples that violate the physical laws of the electricity market are then removed.

3. The residential energy storage pre-charging control method based on scene synthesis and peak prediction according to claim 1, characterized in that, The method of using Bayesian LSTM combined with Monte Carlo Dropout inference to obtain the distribution of electricity price predictions for future periods and the corresponding confidence intervals specifically includes: Keep Dropout enabled during the Bayesian LSTM inference phase and execute... Sub-random forward propagation: in, For the first Dropout mask during the next forward propagation This represents the Dropout probability. It follows the Bernoulli distribution. For the first Electricity price forecasts from the next forward propagation; Obtain the prediction set Calculate the approximate forecast mean and approximate forecast variance, and use the Gaussian forecast distribution model and confidence interval calculation model to obtain the electricity price forecast distribution and corresponding confidence interval for future periods.

4. The residential energy storage pre-charging control method based on scene synthesis and peak prediction according to claim 1, characterized in that, The formula for calculating the probability of peak occurrence in each time period is expressed as follows: in, for Probability of time spike occurrence The standard normal cumulative distribution function is... Peak electricity price thresholds set for users, for Predicted mean at any time for Standard deviation of time-time prediction.

5. The residential energy storage pre-charging control method based on scene synthesis and peak prediction according to claim 1, characterized in that, The pre-charging cost-benefit-risk trade-off optimization model is expressed as follows: Optimize the objective function: in, Let SOC trajectory function be the target function to be optimized. for Always expecting returns This is the risk aversion coefficient. This is a risk metric. Expected returns: in, This represents the probability of a spike occurring. This represents the average electricity price predicted during peak hours. Based on the current pre-charge electricity price, This represents the average predicted electricity price during off-peak hours. This is the planned discharge amount; Risk items: in, Confidence level Value at risk (VaR) For loss random variables, For the indeterminate boundary, Risk confidence level; Constraints: in, Minimum permissible SOC of the battery The maximum permissible SOC of the battery. For the battery's rated capacity, For maximum charge and discharge power, The duration is the length of the time period. To ensure State of Charge (SOC) for home backup power, To predict the number of iterations within the prediction window, This represents the maximum number of cycles allowed per day.

6. The residential energy storage pre-charging control method based on scene synthesis and peak prediction according to claim 1, characterized in that, The process of receiving user feedback and correcting personalized control parameters online specifically includes: When a user questions the pre-charging decision or sends an overwrite instruction, the system maintains the user's personalized confidence threshold based on the comparison of the number of correct user judgments with the number of correct system judgments. Adjust the risk aversion coefficient and peak threshold based on user feedback so that the system strategy can gradually adapt to the user's personalized risk preferences; The scenarios where users raise questions are recorded as potential false positive samples, which are then used to amplify negative samples during retraining, forming a reinforcement learning-style continuous evolution mechanism.

7. A residential energy storage pre-charging control system based on scene synthesis and peak prediction, characterized in that, The system includes: The LLM localized extreme scenario synthesis module is used to obtain user power grid area identifiers, local historical electricity price data, and external knowledge sources. It uses a large language model to generate localized extreme electricity price scenarios under physical constraints and expands the local historical electricity price data to obtain an enhanced dataset. The Bayesian probabilistic electricity price prediction module is used to obtain the electricity price prediction distribution and corresponding confidence interval for future periods based on the augmented dataset using Bayesian LSTM combined with Monte Carlo Dropout inference. The peak probability assessment and pre-charging decision module is used to calculate the probability of peak occurrence in each time period based on the electricity price prediction distribution, combine the confidence level threshold set by the user to determine the pre-charging trigger, construct the pre-charging cost-benefit-risk trade-off optimization model, and solve the pre-charging target SOC trajectory and the pre-charging power command for the current time period by quantifying the expected net benefit and risk value. The pre-charge execution and real-time correction module is used to send the pre-charge power command to the inverter for execution and monitor the grid electricity price in real time. When the deviation between the real-time electricity price and the prediction exceeds a set threshold, rolling re-optimization is triggered. The LLM-driven interpretation and online correction module is used to convert pre-charging decisions into natural language for display to users using a large language model, receive user feedback, and correct personalized control parameters online.

8. The residential energy storage pre-charging control system based on scene synthesis and peak prediction according to claim 7, characterized in that, The LLM localized extreme scene synthesis module includes: The feature extraction unit extracts extreme sample thresholds from local historical electricity price data and extracts contextual feature vectors for detected extreme samples. The Prompt building block constructs a structured Prompt containing domain context, historical extreme cases, and physical constraints. The physical consistency verification unit generates synthetic samples through a large language model, performs physical consistency verification on the synthetic samples, and removes counterintuitive samples that violate the physical laws of the electricity market.

9. An electronic device comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the residential energy storage pre-charging control method based on scene synthesis and peak prediction as described in any one of claims 1 to 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the residential energy storage pre-charging control method based on scene synthesis and peak prediction as described in any one of claims 1 to 6.