A method, device, equipment and medium for preventing reverse flow of a photovoltaic energy storage system
Patent Information
- Application Number
- CN202611109907.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]本发明提供了一种光伏储能系统的防逆流控制方法、装置、设备及介质,以解决现有方案无法兼顾日内长期趋势预测和秒级短期突变捕捉的问题
以边缘超短期预测权重和云端长期预测权重之和上限约束为约束条件,由归一化确定电表实测负荷权重;
Smart Images

Figure CN122932097A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of distributed photovoltaic energy storage technology, specifically to a method, device, equipment, and medium for preventing backflow control in a photovoltaic energy storage system. Background Technology
[0002] Anti-reverse current control is an indispensable core control function of photovoltaic energy storage systems. By monitoring changes in current, instantaneous flow, and power on the grid side, it automatically activates the adjustment mechanism when photovoltaic power generation exceeds electricity demand.
[0003] In existing technologies, a pure feedback control strategy is commonly used for backflow prevention. This involves real-time power acquisition at the point of common coupling (PCC) using electricity meters. When active power is detected being fed back to the grid, a PI / PID controller adjusts the inverter's output power to suppress backflow. Traditional solutions typically employ cloud-based or edge-based forecasting, which cannot simultaneously address both long-term intraday trend prediction and short-term, second-level abrupt changes. Summary of the Invention
[0004] This invention provides a method, device, equipment, and medium for preventing backflow control in a photovoltaic energy storage system, in order to solve the problem that existing solutions cannot simultaneously address both intraday long-term trend prediction and second-level short-term mutation capture.
[0005] In a first aspect, the present invention provides an anti-backflow control method for a photovoltaic energy storage system, applied to an anti-backflow control system for a photovoltaic energy storage system. The anti-backflow control system includes a cloud server and an edge gateway device. The method includes: Using historical operating data and meteorological data of photovoltaic energy storage sites aggregated on cloud servers as input, a prediction model is used to make long-term predictions, generating load prediction curves and photovoltaic output prediction curves as the results of long-term cloud predictions. Using the feature sequence within a preset time period as input, a deep separable temporal convolutional network deployed on an edge gateway device is used for ultra-short-term prediction, and the output load prediction value is used as the edge ultra-short-term prediction result. Obtain the actual load measured by the electricity meter; The long-term forecast results from the cloud, the ultra-short-term forecast results from the edge, and the actual load measured by the electricity meter are weighted and fused to obtain the fused load estimate. Anti-reverse flow scheduling is performed based on the fused load estimate, and power regulation commands are generated. The power adjustment command is sent to the inverter to adjust the power.
[0006] This invention provides load and photovoltaic trend predictions through long-term cloud forecasting, captures short-term load fluctuations through ultra-short-term edge forecasting, and provides backup protection through meter measurements. By integrating long-term cloud forecasting, ultra-short-term edge forecasting, and meter measurements, it can predict and adjust power before reverse current occurs, transforming reverse current prevention control from traditional post-event feedback to pre-event feedforward, thereby reducing the amplitude and duration of reverse current peaks.
[0007] In one optional implementation, the long-term cloud forecast results, the ultra-short-term edge forecast results, and the measured load from the electricity meter are weighted and fused to obtain a fused load estimate, including: The edge ultra-short-term prediction weights are modulated sequentially using confidence modulation, error modulation, and confidence gating. Error modulation and freshness decay are applied sequentially to modulate the weights of long-term cloud-based predictions; The weight of the measured load of the electricity meter is determined by normalization, with the upper limit of the sum of the ultra-short-term forecast weight at the edge and the long-term forecast weight in the cloud as the constraint condition. The sum of the products of the long-term cloud forecast results and the edge ultra-short-term forecast weights, the products of the edge ultra-short-term forecast results and the cloud long-term forecast weights, and the products of the measured load of the electricity meter and the measured load weights of the electricity meter is determined as the fused load estimate.
[0008] This invention integrates confidence modulation, error modulation, and confidence-gated modulation of edge ultra-short-term prediction weights to ensure that weights are only assigned when the model is truly reliable. It also integrates error modulation and freshness decay modulation of cloud-based long-term prediction weights to avoid fusion of outdated or inaccurate information. The invention sets an upper limit constraint on the sum of edge ultra-short-term prediction weights and cloud-based long-term prediction weights, and determines the measured load weights of electricity meters through normalization to ensure that electricity meter data always retains a safety net in any scenario. Finally, it weights and fuses the cloud-based long-term prediction results, edge ultra-short-term prediction results, and measured load of electricity meters to improve the accuracy of fused load estimation.
[0009] In one alternative implementation, anti-reverse scheduling is performed based on the fused load estimate to generate power regulation commands, including: The maximum value among the long-term forecast results from the cloud, the ultra-short-term forecast results from the edge, and the actual load measured by the electricity meter is used as the photovoltaic output input for the anti-reverse current calculation. The sum of the estimated load and the anti-reverse current target power is determined as the maximum allowable power generation, and the difference between the current total power generation and the maximum allowable power generation is determined as the power surplus. Based on the power surplus, power is allocated according to the principle of priority tiered power allocation for energy storage, and power adjustment commands are generated.
[0010] This invention employs a conservative estimation strategy to perform anti-reverse current calculations on the maximum values from long-term cloud forecasts, ultra-short-term edge forecasts, and actual meter measurements. It proactively prevents reverse current during the rising phase of photovoltaic output, calculates power surplus, allocates power, and maximizes self-consumption rate.
[0011] In one optional implementation, power is allocated according to the power surplus and the principle of priority tiered power allocation for energy storage, and a power adjustment command is generated, including: When the power surplus is positive, the first priority power adjustment instruction is to increase the charging power of the energy storage battery, and the second priority power adjustment instruction is to reduce the output power of the photovoltaic inverter. When the power surplus is negative, the power regulation command is to increase the energy storage discharge power or increase the photovoltaic output.
[0012] This invention maximizes self-consumption by prioritizing energy storage charging to absorb excess photovoltaic power when the power surplus is positive, rather than directly restricting photovoltaic power generation. When the power surplus is negative, it increases energy storage discharge to fill the load gap or increases photovoltaic output to meet electricity demand.
[0013] In one alternative implementation, the prediction model for edge gateway device deployment is trained as follows: The data source is the operational data reported by the site, which includes load power, photovoltaic output, grid connection point power, and battery state of charge. A prediction model is obtained by using a deep learning framework for quantitative perception training.
[0014] This invention uses operational data reported by the site as the data source to ensure the matching of predicted output and actual physical values. It employs a deep learning framework to train the model for quantization perception, which allows the model to simulate the accuracy loss caused by quantization during the training phase, thus ensuring that the trained model maintains its predictive performance.
[0015] In one alternative implementation, the method further includes: The model files are compiled using a compiler toolchain; Perform MD5 signing and edge detection on the compiled model file.
[0016] This invention compiles the trained model using a compilation tool, enabling the model to fully utilize the hardware acceleration capabilities of the edge gateway. The compiled model file is then MD5-signed to prevent the model from being tampered with, damaged, or replaced, thus ensuring model consistency.
[0017] In one optional implementation, before weightedly fusing the long-term cloud forecast results, the ultra-short-term edge forecast results, and the measured load from the electricity meter to obtain the fused load estimate, the method further includes: A rollback mechanism is used to check whether there are unavailable data sources in the long-term forecast results in the cloud, the ultra-short-term forecast results at the edge, and the actual load measured by the electricity meter. The weights corresponding to unavailable data sources will be continuously decayed to zero.
[0018] This invention employs a fallback mechanism to degrade to a traditional feedback mode when the data source is unavailable, continuously decaying the weights to zero, thereby ensuring that the control output has no abrupt changes and thus guaranteeing system stability.
[0019] Secondly, the present invention provides an anti-reverse current control device for a photovoltaic energy storage system, applied to an anti-reverse current control system for a photovoltaic energy storage system. The anti-reverse current control system includes a cloud server and an edge gateway device. The device includes: The long-term forecasting module is used to take historical operating data and meteorological data of photovoltaic energy storage sites aggregated on the cloud server as input, use a forecasting model to make long-term forecasts, and generate load forecasting curves and photovoltaic output forecasting curves as the long-term forecast results in the cloud. The ultra-short-term prediction module is used to perform ultra-short-term prediction using a feature sequence within a preset time period as input and a deep separable temporal convolutional network deployed on the edge gateway device, and outputs the load prediction value as the edge ultra-short-term prediction result. The actual measurement module is used to obtain the actual load measured by the electricity meter; The weighted fusion module is used to weight and fuse the long-term forecast results from the cloud, the ultra-short-term forecast results from the edge, and the actual load measured by the electricity meter to obtain the fused load estimate. The anti-reverse flow scheduling module is used to perform anti-reverse flow scheduling based on the converged load estimate and generate power adjustment commands; The sending module is used to send power adjustment commands to the inverter for power adjustment.
[0020] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the anti-reverse current control method of the photovoltaic energy storage system described in the first aspect or any corresponding embodiment.
[0021] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the anti-reverse current control method of the photovoltaic energy storage system described in the first aspect or any corresponding embodiment thereof. Attached Figure Description
[0022] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0023] Figure 1 This is a schematic diagram of the anti-backflow control system of a photovoltaic energy storage system according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a cloud-edge collaborative dual-layer predictive fusion anti-backflow control loop according to an embodiment of the present invention; Figure 3 This is a flowchart illustrating the anti-backflow control method for a photovoltaic energy storage system according to an embodiment of the present invention. Figure 4 This is a schematic diagram of the model training and deployment process according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the edge-side lightweight prediction model network structure according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the multi-level fallback mechanism mode switching according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the three-source adaptive weighted fusion process according to an embodiment of the present invention; Figure 8 This is a schematic diagram of the three-source fusion weighted adaptive modulation process according to an embodiment of the present invention; Figure 9 This is a schematic diagram of energy storage priority hierarchical power allocation according to an embodiment of the present invention; Figure 10 This is a schematic diagram of the anti-backflow control process according to an embodiment of the present invention; Figure 11 This is a structural block diagram of the anti-reverse current control device of a photovoltaic energy storage system according to an embodiment of the present invention; Figure 12 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.
[0026] Currently, the pure feedback control strategy commonly used in photovoltaic energy storage systems for backflow prevention and control has the following workflow: The meter samples the PCC power every hundreds of milliseconds to 1 second → The power data is sent to the EMS gateway via Modbus TCP → The backflow prevention controller in the EMS gateway calculates the adjustment amount → The power command is sent to the inverter via Modbus TCP → The inverter performs power adjustment.
[0027] It has the following defects: (1) Response lag: From the occurrence of reverse current to the effective power adjustment, there is a system delay consisting of the meter sampling period (500ms), Modbus communication delay (200ms), and inverter power response time (300ms), with a typical total delay of 1 to 2 seconds. In scenarios with rapid load changes (such as when a user suddenly turns off a high-power appliance), this delay results in a brief but significant reverse current spike (ranging from hundreds to thousands of watts), the duration of which is comparable to the system delay. The accuracy requirement for some reverse current power detection is within 50W, and pure feedback control is unlikely to eliminate the spike at this level of accuracy. The fundamental reason for the response lag is that feedback control is essentially "first occurs, then adjusts." From the occurrence of reverse current to its detection and then to the effective adjustment, a complete sampling-communication-execution link delay is required, and these delays are limited by physical hardware and communication protocols, making further compression difficult. (2) Power oscillation: When the load fluctuates frequently (such as the start and stop of the air conditioner compressor, the operation of the elevator, and other periodic loads), the hysteresis characteristic of the PID controller is prone to cause power oscillation. The inverter output power oscillates repeatedly near the anti-reverse current limit, forming an oscillation cycle of "over-adjustment → under-adjustment → over-adjustment again". Oscillation not only reduces the stability of the system, but also accelerates the thermal cycle fatigue of the inverter power devices, affecting the equipment life. The reason for power oscillation is that the PID controller adjusts based on the current error. When the frequency of load change is higher than the response bandwidth of the control loop, the adjustment action always lags behind the load change, causing the controller to continuously "chase" the load change and fail to converge. (3) Lack of foresight: Pure feedback control can only adjust based on the current PCC power and cannot perceive the trend of load changes. For example, it cannot distinguish between "temporary load reduction (microwave oven operation ends)" and "continuous load reduction (user goes out)," leading to overly conservative control strategies (leaving a large safety margin and reducing self-consumption rate) or over-adjustment (frequent power curtailment leading to photovoltaic curtailment). The reason for the lack of foresight is that feedback control only uses single-point measurement data at the current moment and does not contain any historical pattern information or future trend inference ability, so it cannot support forward-looking control decisions from the perspective of information content.
[0028] To address the above shortcomings, the existing solution employs the following prediction method: (1) Cloud-based forecasting scheme: Cloud-based models can use massive historical data and meteorological information to forecast intraday load trends (such as load curves for the next 24 hours), but the forecasting step size is usually more than 15 minutes, the time resolution is too coarse, and it cannot capture second-level load changes (such as electrical switches); and it relies on network communication, and completely loses its forecasting ability when communication is interrupted. (2) Edge prediction scheme: Edge embedded devices have limited computing power (such as MCU / MPU), and can only run lightweight models. Their prediction accuracy and generalization ability are not as good as large cloud models. They also lack a global perspective (no meteorological data, no multi-site aggregated data), making it difficult to predict the daily load trend (such as regular load changes during commuting hours).
[0029] In order to solve the following technical problems: (1) The existing pure feedback anti-backflow control has a system delay of 1 to 2 seconds, which causes backflow spikes when the load changes rapidly, and cannot meet the high-precision anti-backflow requirements; (2) Each single prediction source (only cloud or only edge) has its own inherent defects and cannot simultaneously take into account the intraday long-term trend prediction and the second-level short-term mutation capture; (3) When cloud communication is interrupted, the prediction-based anti-backflow control fails and the system lacks fault tolerance.
[0030] According to an embodiment of the present invention, an embodiment of an anti-reverse current control method for a photovoltaic energy storage system is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0031] This embodiment provides an anti-reverse current control method for a photovoltaic energy storage system, which is applied to the anti-reverse current control system of the photovoltaic energy storage system, such as... Figure 1 and Figure 2As shown, this anti-backflow control system adopts a cloud-edge collaborative architecture, comprising a cloud server and an edge gateway device. The cloud server is deployed in a data center with GPU computing power, while the edge gateway hardware platform uses a heterogeneous processor with an NPU, including a dual-core application processor and an NPU accelerator. The dual-core application processor runs a Linux operating system and is responsible for EMS scheduling logic, feature preprocessing, and fusion computing. The NPU accelerator (with a computing power of TOPS-level INT8) is dedicated to AI model inference and works in parallel with the CPU. The edge gateway connects to devices such as electricity meters, energy storage hybrid inverters, and grid-connected inverters via Modbus TCP and communicates with the cloud server via the MQTT protocol.
[0032] Figure 3 This is a flowchart of an anti-reverse current control method for a photovoltaic energy storage system according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps: Step S301: Using historical operating data and meteorological data of photovoltaic energy storage sites aggregated by the cloud server as input, a prediction model is used to make long-term predictions, generating load prediction curves and photovoltaic output prediction curves as the long-term prediction results in the cloud.
[0033] In embodiments of the present invention, such as Figure 4 As shown, the cloud server aggregates historical operating data and external meteorological data from multiple photovoltaic energy storage sites. The historical operating data of the photovoltaic energy storage sites includes load, PV output, PCC power, SOC, etc., with a sampling rate of 1 second. The external meteorological data includes irradiance, temperature, and cloud cover.
[0034] Using historical operational data and meteorological data from photovoltaic energy storage sites aggregated on cloud servers as input, large-scale forecasting models such as Transformer or LightGBM are run to perform long-term forecasts, generating load forecast curves and photovoltaic output forecast curves for each site for the next 24 hours, which serve as the long-term forecast results in the cloud. The forecast step size is 15 minutes (96 forecast points in total), which serves to provide a baseline for the intraday load trend. The load forecast curves and photovoltaic output forecast curves are sent to the edge gateway devices of each site in JSON format via the MQTT protocol.
[0035] After receiving the data, the edge gateway device stores it in the cloud prediction cache. Linear interpolation refines the 15-minute granularity predictions to the second level for querying by the fusion module. The cache is maintained and updated with timestamps; values not updated for more than 30 minutes are marked as invalid.
[0036] Step S302: Using the feature sequence within a preset time period as input, a deep separable temporal convolutional network deployed on the edge gateway device is used to perform ultra-short-term prediction, and the output load prediction value is used as the edge ultra-short-term prediction result.
[0037] In embodiments of the present invention, such as Figure 5 As shown, the edge gateway device uses a specially designed lightweight DS-TCN (Depthwise Separable Temporal Convolutional Network) model, which runs on the NPU.
[0038] Using a 5-dimensional feature sequence of the most recent 60 seconds as input, including load power, PV output, PCC power, battery state of charge (SOC), and intraday time encoding, a multi-layer depthwise separable temporal convolutional block is employed for ultra-short-term load prediction. Dilated convolution is used to expand the receptive field. Each layer contains depthwise convolution → activation → pointwise convolution → residual connection, outputting the load prediction value for the next 10 seconds as the edge ultra-short-term prediction result. Its prediction stride is 1 second, and its purpose is to capture second-level load abrupt changes. Notably, the intraday time in the input features uses sinusoidal encoding to avoid discontinuous jumps in linear time at the day's transition.
[0039] The reasons for choosing DS-TCN instead of LSTM / Transformer include: (1) The LSTM / GPU model has about 50K parameters, does not support NPU acceleration, and can only be transferred from fallback to CPU during model runtime, with a delay of about 100 milliseconds, so it is not suitable; (2) The Transformer model has about 200K parameters, triggers MatMul dynamic input fallback, with a delay of about 200 milliseconds, so it is not suitable; (3) The standard TCN model has about 30K parameters, is accelerated by Conv2D hardware, with a delay of about 15 milliseconds, although it is usable, there is still room for lightweighting; (4) The DS-TCN model uses full INT8 quantization deployment, has about 2.6K parameters, about 2.5KB weights, and all operators can be hardware accelerated on the NPU without occupying CPU resources, with a delay of less than 5 milliseconds.
[0040] The DS-TCN model decomposes standard convolution into depthwise convolution (channel-wise spatial convolution) and pointwise convolution (1x1 cross-channel mixing), reducing the number of parameters by 4 to 8 times, and both operators can be hardware accelerated on the NPU.
[0041] Step S303: Obtain the actual load measured by the electricity meter.
[0042] In this embodiment of the invention, the edge gateway CPU reads the electricity meter data in real time and calculates the measured load based on the law of conservation of energy.
[0043] Step S304: The long-term forecast results from the cloud, the ultra-short-term forecast results from the edge, and the measured load from the electricity meter are weighted and fused to obtain the fused load estimate.
[0044] In this embodiment of the invention, at the load estimation layer on the edge gateway side, the long-term forecast results from the cloud, the ultra-short-term forecast results from the edge, and the measured load from the electricity meter are weighted and fused together.
[0045] Compared to the traditional approach of generating control commands separately from each prediction source in the control layer and then superimposing them, this embodiment first fuses the optimal load estimate and then uses the fusion result to drive a single anti-reverse flow control logic, thereby improving the perception accuracy from the source.
[0046] Step S305: Perform anti-reverse flow scheduling based on the fused load estimate and generate power regulation commands.
[0047] In this embodiment of the invention, based on the weighted fusion obtained by fusion, anti-reverse scheduling is carried out. First, the photovoltaic output is conservatively estimated, then the power surplus is calculated, and finally the power is allocated in layers. This maximizes the photovoltaic self-consumption rate while preventing reverse flow.
[0048] Step S306: Send the power adjustment command to the inverter for power adjustment.
[0049] In this embodiment of the invention, the power adjustment command is sent to the inverter via Modbus TCP, and the inverter performs power adjustment.
[0050] The anti-reverse current control method for photovoltaic energy storage systems provided in this embodiment uses long-term cloud forecasting to provide load and photovoltaic trend predictions, ultra-short-term edge forecasting to capture short-term load fluctuations, and actual meter measurements to provide a safety net. By integrating the long-term cloud forecasting results, ultra-short-term edge forecasting results, and actual meter load measurements, the system can predict and adjust power before reverse current occurs, transforming anti-reverse current control from traditional post-event feedback to pre-event feedforward, thereby reducing the amplitude and duration of reverse current peaks.
[0051] This embodiment provides a method for preventing backflow in a photovoltaic energy storage system, the process of which includes the following steps: Step S401: Using historical operating data and meteorological data of photovoltaic energy storage sites aggregated by the cloud server as input, a prediction model is used to make long-term predictions, generating load prediction curves and photovoltaic output prediction curves as the long-term prediction results in the cloud.
[0052] Please see details Figure 3 Step S301 of the illustrated embodiment will not be described again here.
[0053] Step S402: Using the feature sequence within a preset time period as input, a deep separable temporal convolutional network deployed on the edge gateway device is used to perform ultra-short-term prediction, and the output load prediction value is used as the edge ultra-short-term prediction result.
[0054] Specifically, the DS-TCN lightweight model deployed on the edge gateway device is trained according to the following steps: Step S402a: Use the operational data reported by the site as the data source; Step S402b: Quantization perception training is performed using a deep learning framework to obtain a prediction model.
[0055] In this embodiment of the invention, data collection is performed first. Each site reports its operating data to the cloud via MQTT. The operating data includes load power, photovoltaic output, grid connection point power, battery state of charge, etc., with a sampling rate of 1 second.
[0056] Then, Quantization-Aware Training (QAT) is performed using a deep learning framework on a cloud GPU server. The loss function is Huber Loss, which balances the mean square error optimization of normal samples and robustness to outliers. The model weights are quantized according to the per-channel symmetric INT8 scheme, and the activation values are quantized according to the per-tensor asymmetric INT8 scheme, so that the model simulates the accuracy loss of INT8 quantization during the training phase.
[0057] By using the operational data reported by the site as the data source, the predicted output is matched with the actual physical values. A deep learning framework is used to train the model for quantization perception, so that the model can simulate the accuracy loss caused by quantization during the training phase, and the trained model can maintain its predictive performance.
[0058] In some alternative implementations, the method further includes: Step S402c: Compile the model file using the compilation toolchain; Step S402d: Perform MD5 signing and edge verification on the compiled model file.
[0059] In this embodiment of the invention, after the model training is completed, an OTA update mechanism is introduced to export the model in ONNX QDQ format and compile it into an NPU executable binary file using an NPU-specific compilation toolchain for deployment and use by the edge gateway.
[0060] The compiled model file is MD5 signed and distributed to each edge gateway via the MQTT protocol. The edge gateway performs edge verification and signature comparison. If the verification is consistent, the model file is hot-loaded to the NPU terminal. The entire process does not require restarting the device or interrupting the anti-reverse flow control service.
[0061] Through the aforementioned OTA update mechanism, with the continuous accumulation of operational data from each site and iterative optimization of the model, the prediction accuracy at the edge continuously improves, adapting to the long-term evolution of user load patterns.
[0062] The trained model is compiled using compilation tools, allowing it to fully utilize the hardware acceleration capabilities of the edge gateway. The compiled model file is then MD5-signed to prevent tampering, damage, or replacement, ensuring model consistency.
[0063] Please see details Figure 3 Step S302 of the illustrated embodiment will not be described again here.
[0064] Step S403: Obtain the actual load measured by the electricity meter.
[0065] Please see details Figure 3 Step S303 of the illustrated embodiment will not be described again here.
[0066] In some alternative implementations, the method further includes: Step Sa involves using a rollback mechanism to check whether the long-term forecast results in the cloud, the ultra-short-term forecast results at the edge, and the actual load measured by the electricity meter are available. Step Sb involves continuously decaying the weights corresponding to unavailable data sources to zero.
[0067] In this embodiment of the invention, after obtaining the long-term prediction results in the cloud, the ultra-short-term prediction results at the edge, and the measured load of the electricity meter, a rollback mechanism is used to check whether each data source is available. If all are available, step S404 is executed. If there are unavailable data sources, the weights corresponding to the unavailable data sources are continuously decayed to zero.
[0068] Specifically, such as Figure 6 As shown, the multi-level fallback mechanism automatically and smoothly switches between the following four modes based on data source availability: Mode 1: The highest accuracy is achieved by fusing long-term cloud forecasting, ultra-short-term edge forecasting, and actual meter measurements. Mode 2: Cloud-based offline, edge ultra-short-term forecasting and meter readings are fused together. Although it loses the predictability of intraday trends, the second-level response is normal. Mode 3: Edge AI is unavailable, but the dual-source fusion of long-term cloud forecasts and actual meter measurements still retains trend predictability; Mode 4: Neither the cloud nor the edge is available; it relies solely on actual meter readings, equivalent to traditional pure feedback backflow prevention.
[0069] The key design of the multi-level backoff mechanism is that backoff is not "stopping the anti-reverse flow", but rather continuously decaying the weight of the corresponding prediction source to zero, rather than stepping to zero, controlling the output to avoid sudden changes, so as to ensure smooth switching.
[0070] Taking edge rollback AI as an example, the rollback process is triggered when the AI function is not enabled, the model is not loaded, the feature data has less than 60 sampling points, or the prediction fails more than 10 times in a row.
[0071] By employing a fallback mechanism, the system degenerates into a traditional feedback mode when the data source becomes unavailable, continuously decaying the weights to zero. This ensures that the control output does not experience abrupt changes, thereby guaranteeing system stability.
[0072] Step S404: The long-term forecast results from the cloud, the ultra-short-term forecast results from the edge, and the measured load from the electricity meter are weighted and fused to obtain the fused load estimate.
[0073] Specifically, step S404 includes: Step S4041: Confidence modulation, error modulation, and confidence gating are sequentially used to modulate the edge ultra-short-term prediction weights. Step S4042: Error modulation and freshness decay are applied sequentially to modulate the long-term prediction weights in the cloud. Step S4043: Using the upper limit constraint of the sum of edge ultra-short-term prediction weight and cloud long-term prediction weight as a constraint condition, the measured load weight of the electricity meter is determined by normalization. Step S4044: The sum of the product of the long-term forecast result in the cloud and the weight of the ultra-short-term forecast at the edge, the product of the ultra-short-term forecast result at the edge and the weight of the long-term forecast in the cloud, and the product of the measured load of the electricity meter and the weight of the measured load of the electricity meter is determined as the fused load estimate.
[0074] In embodiments of the present invention, such as Figure 7 and Figure 8 At the load estimation layer on the edge side, the long-term forecast results from the cloud, the ultra-short-term forecast results from the edge, and the actual load measured by the electricity meter are weighted and fused.
[0075] The weighted fusion expression is as follows: P_fusion=α×P_edge+β×P_cloud+γ×P_meter in, P_fusion For load estimation, P_edge For ultra-short-term edge forecasting, α For edge ultra-short-term prediction weights, P_cloud For long-term cloud-based prediction, β For long-term prediction weights in the cloud, P_meter This is the actual load measured by the electricity meter. γ This represents the actual load weight measured by the electricity meter.
[0076] Among them, the marginal ultra-short-term prediction weight α The modulation process is as follows: Step 1: Confidence Modulation α = α_base × confidence_edge ,in, α_base As the basic weights for edge prediction, confidence_edge The confidence level is calculated as follows: confidence=1.0-clamp(σ²_recent / σ ²_history,0,1) ,in, σ²_recent The variance of the most recent 5 predicted values. σ²_history The historical power variance is calculated by dividing the variance of the most recent 5 predicted values by the historical power variance. The ratio of the two is clamped between 0 and 1. Subtracting this ratio from 1 gives the confidence level. Its physical meaning is that if a model can still output stable predictions during "difficult periods" with drastic load fluctuations, it is more reliable. Step 2: Error Modulation α=α×max(0,1-E_ema / P_meter_smooth) ,in, E_ema This is the exponential moving average of the edge prediction error. P_meter_smooth This is a smoothed value of the measured load of the electricity meter. Its physical meaning is that when the model is continuously inaccurate, the weighting is automatically reduced.
[0077] Step 3: Confidence Gating: If the confidence level is less than the confidence threshold (default 0.3), its physical meaning is: when the confidence level is too low, the model is completely distrusted.
[0078] Among them, cloud-based long-term prediction weight β The modulation process is as follows: Step 1: Error Modulation β=β_base×max(0,1-E_cloud_ema / P_meter_smooth) ,in, β_ base For long-term cloud-based prediction of basic weights, E_cloud_ema This is the exponential moving average of the cloud prediction error. P_meter_ smooth This is a smoothed value of the actual load measured by the electricity meter. Its physical meaning is: if the cloud prediction has a large deviation, the weighting will be reduced. Step Two: Freshness Decline β=β×max(0,1-T_age / T_expire) , where is the time interval since the last update, and is the expiration threshold (usually 30 minutes). Its physical meaning is that the older the prediction, the less reliable it is, and it decays linearly to zero.
[0079] Using marginal ultra-short-term prediction weights α and cloud-based long-term prediction weights β The upper limit of the sum is set at 0.95 as a constraint, and the marginal ultra-short-term prediction weights are adjusted accordingly. α Long-term prediction weights in the cloud β Actual load weight measured by electricity meter γ Normalization γ=1-α-β , γ≥ 0.05 (At least 5% weighting should be reserved for actual electricity meter measurements).
[0080] The weights are automatically adapted for each scenario as follows: For normal three-source usable scenarios α It is 0.5. β It is 0.3. γ The optimal precision is 0.2. For scenarios where cloud communication is interrupted. α It is 0.6. β =0, γ The value is 0.4, with independent edge operation control. For scenarios where edge AI is unavailable α =0, β It is 0.3. γ The value is 0.2, achieved through a dual-source fusion control system combining cloud and actual measurement data. For all unavailable scenarios α =0, β =0, γ It is 1.0, which degenerates into pure feedback control.
[0081] By fusing confidence modulation, error modulation, and confidence-gated modulation of edge ultra-short-term prediction weights, weights are only assigned when the model is truly reliable. By fusing error modulation and freshness decay modulation of cloud long-term prediction weights, outdated or inaccurate information fusion is avoided. An upper limit constraint is set on the sum of edge ultra-short-term prediction weights and cloud long-term prediction weights. The weight of the measured load of the electricity meter is determined by normalization to ensure that the meter data always retains a backup guarantee in any scenario. The weighted fusion of cloud long-term prediction results, edge ultra-short-term prediction results, and measured load of the electricity meter improves the accuracy of the fused load estimation.
[0082] Step S405: Perform anti-reverse flow scheduling based on the fused load estimate and generate power regulation commands.
[0083] Specifically, step S405 includes: Step S4051: Use the maximum value among the long-term forecast results from the cloud, the ultra-short-term forecast results from the edge, and the actual load measured by the electricity meter as the photovoltaic output input for the anti-reverse current calculation; Step S4052: The sum of the integrated load estimate and the anti-reverse current target power is determined as the maximum allowable power generation, and the difference between the current total power generation and the maximum allowable power generation is determined as the power surplus. Step S4053: Based on the power surplus, power is allocated according to the principle of priority hierarchical power allocation for energy storage, and a power adjustment command is generated.
[0084] In embodiments of the present invention, such as Figure 9 and Figure 10 As shown, a conservative estimate of photovoltaic (PV) output is first performed, taking the maximum value from the long-term cloud forecast, the ultra-short-term edge forecast, and the actual measured load from the meter as the PV output input for anti-backflow calculation. This is because, in anti-backflow scenarios, overestimating PV output is safer than underestimating it; overestimation allows the system to reserve more capacity for absorption, thus more actively suppressing backflow.
[0085] Then calculate the power surplus and the maximum allowable power generation. maxAllowedGeneration For fusion load estimation P_ fusion and anti-reverse current target PCC power P_target The sum of maxAllowedGeneration=P_fusion+P_ target Power surplus adjustment The current total power generation and the maximum allowable power generation. maxAllowedGeneration The difference, that is adjustment =Current total power generation - maxAllowedGeneration .
[0086] Based on the power surplus, power is allocated according to the principle of priority tiered power allocation for energy storage. If the power surplus is greater than zero, the feeder grid needs to be reduced; if the power surplus is less than zero, there is a capacity to absorb the excess power.
[0087] By employing a conservative estimation strategy, reverse current prevention calculations are performed on the maximum values among the long-term forecast results from the cloud, the ultra-short-term forecast results from the edge, and the actual measured load from the electricity meter. This allows for early prevention of reverse current during the rising phase of photovoltaic output, calculation of power surplus, and power allocation to maximize self-consumption rate.
[0088] Specifically, step S4053 includes: Step S40531: When the power surplus is positive, the first priority power adjustment instruction is to increase the charging power of the energy storage battery, and the second priority power adjustment instruction is to reduce the output power of the photovoltaic inverter. In step S40532, when the power surplus is negative, the power adjustment command is to increase the energy storage discharge power or increase the photovoltaic output.
[0089] In embodiments of the present invention, such as Figure 9 As shown, when the power surplus is positive, the grid feed needs to be reduced. The first priority power regulation instruction is to increase the charging power of the energy storage battery to absorb the excess photovoltaic output. The second priority power regulation instruction is to reduce the output power of the photovoltaic inverter if the energy storage charging has reached its limit.
[0090] When the power surplus is negative, there is a margin, and the power adjustment command is to increase the energy storage discharge power or increase the photovoltaic output.
[0091] The strategy of prioritizing energy storage and tiering up the energy storage layer maximizes the self-consumption rate of photovoltaics, and only restricts photovoltaics when energy storage is unavailable.
[0092] By prioritizing energy storage charging to absorb excess photovoltaic power when the power surplus is positive, rather than directly restricting photovoltaic power generation, the self-consumption rate is maximized. When the power surplus is negative, energy storage discharge is increased to fill the load gap, or photovoltaic output is increased to meet electricity demand.
[0093] Step S406: Send the power adjustment command to the inverter for power adjustment.
[0094] Please see details Figure 3 Step S306 of the illustrated embodiment will not be described again here.
[0095] It should be noted that the constraints and actual values of each indicator are compared as follows: For the NPU inference latency metric, the constraint is <10ms, and the actual value is 3~5ms; For the end-to-end latency metric, the constraint is <30ms, and the actual value is 8~12ms; The actual value for the number of model parameters is 2594. For the model weight (INT8) metric, the constraint is <200KB, and the actual value is 2.5KB; For the total runtime memory metric, the constraint is <16MB, and the actual value is <210KB; The scheduling cycle indicator is constrained to 1 second, but it is not actually affected. For the feature buffer metric, the actual value is 3600 entries × 48 bytes ≈ 170KB.
[0096] Compared with existing pure feedback anti-reverse current control technology, the anti-reverse current control method for photovoltaic energy storage systems provided in this embodiment has the following advantages: (1) Feedforward control to eliminate response lag: Through cloud-edge collaborative dual-layer prediction, power surplus is predicted and power is actively adjusted before backflow occurs, transforming anti-backflow control from "post-event feedback" to "pre-event feedforward", significantly reducing the amplitude and duration of backflow peaks.
[0097] (2) Three sources are integrated to take into account multiple time scales: the cloud shows the intraday trend (15-minute level), the edge captures the second-level change, and the electricity meter provides a backup correction. The three are integrated at the load estimation layer (rather than superimposed at the control layer) to improve the load perception accuracy from the source.
[0098] (3) Triple adaptive weighting to avoid manual parameter tuning: The fusion weights are dynamically adjusted through a triple mechanism of confidence modulation, prediction error modulation and data freshness decay, and are automatically optimized under different operating conditions. The actual meter readings retain a minimum 5% weight as a correction fallback.
[0099] (4) Multi-level rollback and communication interruption fault tolerance: When the cloud is offline, the edge runs independently. When the edge AI is unavailable, it degenerates into the traditional feedback mode. During the rollback process, the weights continuously decay, and the control output has no abrupt changes, ensuring system safety.
[0100] (5) PV conservative estimation strategy: The maximum value of the predicted and measured photovoltaic output is used to calculate the anti-backflow, and the backflow is prevented in advance during the rising photovoltaic output stage.
[0101] (6) Prioritize power allocation for energy storage: When there is a power surplus, prioritize increasing energy storage charging to absorb excess photovoltaic power, rather than directly restricting photovoltaic power generation, to maximize self-consumption rate.
[0102] (7) High hardware efficiency and extremely low resource consumption: The DS-TCN model has only 2594 parameters, INT8 weights of 2.5KB, full operator NPU hardware acceleration, inference latency <5ms, total memory <210KB, and does not affect the existing 1-second scheduling cycle.
[0103] (8) Online model update: The edge model is continuously updated via OTA, and the prediction accuracy continues to improve over time.
[0104] To verify the effectiveness of the anti-reverse current control method for the photovoltaic energy storage system provided in this embodiment, a simulation test platform was built to compare and test the following four schemes: Option A: Traditional pure feedback PID anti-backflow control (existing technology baseline), with an end-to-end system delay of approximately 1.5 seconds (including 500ms for meter sampling, 200ms for Modbus communication, 300ms for inverter power response, and margin). Option B: Cloud-based predictive assistance + PID feedback control, with a cloud-based predictive step size of 15 minutes, and linear interpolation assisting the PID controller; Option C: Edge ultra-short-term predictive aid + PID feedback control, using a DS-TCN-Lite model second-level predictive aid PID controller; Scheme D (this embodiment): Three-source fusion feedforward anti-backflow control, end-to-end delay of about 10ms (NPU inference 5ms + fusion calculation and instruction issuance 5ms).
[0105] The simulation platform is based on the parameter configuration of a typical residential photovoltaic energy storage system: photovoltaic installed capacity of 5kW, energy storage battery capacity of 5kWh, maximum energy storage charge and discharge power of 5kW, and anti-reverse current target PCC power of 50W.
[0106] The following four typical scenarios and four sets of ablation comparison experiments were used for simulation comparison.
[0107] Scenario 1: Sudden load change (high-power appliances suddenly shut down) Test conditions: The photovoltaic system had a stable output of 5kW, an initial load of 4.5kW (including a 3kW air conditioner), and the system was operating in a steady state. At test time t=0, the 3kW air conditioner suddenly shut off, causing the load to drop sharply to 1.5kW, resulting in an instantaneous power surplus of approximately 3.5kW. The results of the anti-reverse current performance comparison for Scenario 1 are shown in Table 1.
[0108] Table 1
[0109] Solution A suffers from a system delay of approximately 1.5 seconds, resulting in an inability to adjust power output promptly after a sudden load drop, leading to a reverse current spike of 2800W lasting approximately 1.8 seconds. Solution B, while incorporating cloud-based forecasting assistance, has a 15-minute forecasting step size, failing to capture second-level load fluctuations and thus offering limited improvement. Solution C utilizes the second-level forecasting capabilities of the edge DS-TCN-Lite model, predicting trends seconds before load changes and reducing the reverse current spike to 780W, demonstrating significant improvement. Solution D, building upon Solution C, further integrates long-term cloud trends and meter readings, employing feedforward power scheduling. This reduces the reverse current spike to only 180W, shortens its duration to 80ms, and achieves a stabilization time of just 0.5 seconds, resulting in the best overall performance.
[0110] Scenario 2: Periodic load fluctuations (air conditioner compressor start-stop) Test conditions: Photovoltaic output stable at 4kW, base load 2kW, air conditioning compressor periodically starts and stops; load increases by 2kW during startup and decreases by 2kW during shutdown, with a start-stop cycle of approximately 30 seconds. The test lasted 10 minutes, and steady-state oscillation characteristics were statistically analyzed. Table 2 shows the comparison results of anti-backflow performance in scenario 2 (periodic load fluctuation).
[0111] Table 2
[0112] Scheme A, affected by the lag characteristic of the PID controller, exhibits significant power oscillations in a 30-second load start-stop cycle scenario, with peak-to-peak values reaching 1500W and average reverse current power as high as 350W. Scheme B, due to the cloud prediction granularity being much coarser than the compressor start-stop cycle, contributes limitedly to suppressing short-cycle oscillations. Scheme C's edge prediction model can learn the periodic patterns of compressor start-stop and predict the direction of load changes in advance, reducing the peak-to-peak oscillation value to 480W. Scheme D, through three-source fusion feedforward control, proactively increases the energy storage charging power to absorb excess photovoltaic output before the compressor stops, resulting in a peak-to-peak power oscillation value of only 120W and an average reverse current power reduction to 12W, effectively eliminating the power oscillation problem caused by periodic loads.
[0113] Scenario 3: Cloud communication interruption Test conditions: The system operated in normal three-source fusion mode. Cloud communication was interrupted at test time t=0 and resumed after 30 minutes. Photovoltaic output and load fluctuated normally during the test. Table 3 shows the comparison results of anti-reverse current performance changes during the cloud communication interruption scenario.
[0114] Table 3
[0115] Option A does not rely on cloud communication, and its performance remains unchanged before and after the interruption, but its baseline performance is inherently poor. Option B relies entirely on cloud prediction; after a communication interruption, it immediately degenerates into pure PID control, and its anti-backflow performance drops to the same level as Option A. Furthermore, the sudden intervention of prediction commands when communication is restored can easily cause control disturbances. Option C relies only on edge prediction and is unaffected by cloud communication. After a cloud communication interruption, Option D uses a freshness decay mechanism to smoothly decay the long-term cloud prediction weight β to zero within 30 minutes. The system automatically transitions to a dual-source fusion mode of edge prediction plus meter readings. The backflow peak slightly increases from 180W to 350W, and the performance decreases by about 15%, but it is still far superior to Option A and Option B after the interruption. When communication is restored, the long-term cloud prediction weight of Option D is smoothly restored, and the control output has no abrupt changes, demonstrating the fault-tolerant advantage of the multi-level continuous decay backoff mechanism.
[0116] Scenario 4: Comprehensive Statistics of Daily Operations Test conditions: Typical sunny day conditions, a residential 5kW photovoltaic system with a 5kWh energy storage system, generating approximately 20kWh per day, including peak electricity consumption periods in the morning, noon, and evening, as well as low-load periods during the day, covering real-world electricity usage scenarios such as appliance switching, air conditioner start / stop, and cooking. The comprehensive statistical comparison results of backflow prevention performance throughout the day are shown in Table 4.
[0117] Table 4
[0118] Option A, lacking foresight and requiring a large safety margin, achieves a photovoltaic self-consumption rate of only 82.5%. A significant portion of photovoltaic power generation is conservatively restricted or fed back into the grid, resulting in a daily cumulative reverse flow of up to 850Wh. Furthermore, frequent PID regulation leads to up to 1200 power adjustments per day, accelerating thermal cycling fatigue of the inverter's power devices. Option B, leveraging cloud-based intraday trend prediction to rationally arrange charging and discharging strategies, increases the self-consumption rate to 85.8%, but remains ineffective against second-level load surges. Option C, utilizing edge-level second-level prediction, significantly reduces reverse flow spikes and regulation frequency, achieving a self-consumption rate of 92.4%. Solution D comprehensively leverages the advantages of the three-source integration: cloud-based prediction provides a baseline for daily charge and discharge planning, edge prediction captures second-level load mutations, and meter measurements continuously correct deviations. The photovoltaic self-consumption rate reaches 96.8%, the daily cumulative reverse current is only 35Wh, the maximum reverse current peak is controlled within 200W, and the number of power regulation times is reduced to 160. It achieves optimal levels in terms of anti-reverse current accuracy, photovoltaic utilization rate, and equipment friendliness.
[0119] Experiment 5: Ablation Comparison of Data Source Quantity To verify the necessity of three-source fusion, the anti-backflow performance of different data source combinations was tested under the same test conditions as in Scenario 4. The comparison results of the anti-backflow performance of different data source combinations are shown in Table 5.
[0120] Table 5
[0121] The dual-source solution of edge-mounted power meters performs well in terms of second-level response, reducing the maximum reverse current peak to 800W. However, due to the lack of intraday load trend information, the energy storage charging and discharging planning is not optimized, and the daily cumulative reverse current still reaches 180Wh. The dual-source solution of cloud-mounted power meters has trend prediction capabilities and can optimize charging and discharging strategies. However, because the prediction step size is 15 minutes, it cannot capture second-level load mutations, and the maximum reverse current peak is still as high as 2500W. The three-source fusion solution of this invention combines the advantages of both, with a load prediction MAE of only 52W and a reverse current failure rate reduced to 0.4%, verifying the necessity and effectiveness of three-source fusion.
[0122] Experiment 6: Comparison of Adaptive Weights and Fixed Weights To verify the advantages of the triple adaptive weight modulation mechanism, the adaptive weight scheme of this invention and the fixed weight scheme (α=0.5, β=0.3, γ=0.2) were compared under four typical operating conditions for one day each. The performance comparison results of adaptive weight and fixed weight are shown in Table 6.
[0123] Table 6
[0124] Under stable load conditions in clear weather, the difference between fixed and adaptive weights is relatively small due to the high accuracy of all prediction sources, with a MAE difference of approximately 16W. However, under challenging conditions such as cloudy weather and frequent load fluctuations, the advantages of adaptive weights become significantly greater: MAE decreases from 155W to 78W in cloudy weather, a reduction of approximately 50%; and MAE decreases from 195W to 88W in scenarios with frequent load fluctuations, a reduction of approximately 55%. This is because the adaptive weight mechanism can dynamically adjust the confidence level of each prediction source based on its real-time performance. It automatically reduces the weight of cloud-based predictions when accuracy decreases due to weather changes, and optimizes the response through confidence modulation when edge predictions face load fluctuations. The adaptive mechanism eliminates the need for manual parameter tuning for different operating conditions, achieving automatic adaptation across all operating conditions.
[0125] Experiment 7: Comparison of architectures with load estimation layer fusion and control layer overlay To verify the architectural advantages of fusion at the load estimation layer compared to overlay at the control layer, the all-day operating performance of the two fusion architectures was compared. Architecture A is the control layer overlay scheme, where each forecast source independently calculates power regulation commands, and then the commands from each source are weighted and synthesized before being issued. Architecture B is the load estimation layer fusion scheme of this invention, where the optimal load estimate is first fused, and then a single anti-reverse flow control logic is driven. The comparison results of the anti-reverse flow performance of the two fusion architectures are shown in Table 7.
[0126] Table 7
[0127] In the control layer overlay architecture, control commands calculated independently by each prediction source based on its own prediction results may have opposite directions. For example, the cloud prediction might indicate an increase in load and instruct to increase photovoltaic output, while the edge prediction might detect an impending decrease in load and instruct to decrease photovoltaic output. The superposition of these two commands results in control conflicts, occurring an average of 45 times per day. These control conflicts cause power oscillation peak-to-peak values to reach 380W, and extend the adjustment stabilization time to 2.8 seconds. The load estimation layer fusion architecture of this invention provides unified perception from the information source and outputs a unique fused load estimate. With only one set of control logic, it fundamentally eliminates the possibility of multi-source command conflicts, achieving zero daily control conflicts, reducing power oscillation peak-to-peak values to 120W, and decreasing daily cumulative reverse current power from 125Wh to 35Wh.
[0128] Experiment 8: Stability Comparison of Continuous Decay Backoff and Step Switching To verify the stability advantage of the multi-stage continuous decay back-off mechanism compared to the traditional step switching, the system was running in steady-state mode with three sources (4kW photovoltaic output and 3.5kW load). A sudden interruption of cloud communication at t=0 was simulated, and the transition characteristics of the two switching methods were compared. The stability comparison results of the two switching methods when cloud communication was interrupted are shown in Table 8.
[0129] Table 8
[0130] When using the step switching scheme, the long-term cloud prediction weight β immediately returns to zero upon the moment cloud communication is interrupted. The edge ultra-short-term prediction weight α and the meter measured weight γ are instantly redistributed proportionally, causing a jump in the merged load estimate. This triggers a sudden change in the power regulation command, resulting in a 420W step jump in PCC power. The peak-to-peak power oscillation during the transition period reaches 650W, requiring 8.5 seconds to stabilize, with a maximum reverse current spike of 580W during this period. In the continuous attenuation scheme of this invention, the long-term cloud prediction weight β linearly decays to zero within a preset expiration time according to the freshness attenuation mechanism. The merged load estimate transitions smoothly, with the PCC power change at the moment of interruption being only 15W, almost imperceptible, and no significant oscillations during the transition period. The continuous attenuation mechanism not only avoids the thermal shock risk to the inverter power devices caused by power step jumps but also eliminates the reverse current spike during the transition period, significantly improving the system's safety and stability under abnormal operating conditions.
[0131] Based on the simulation results of the four typical scenarios and four sets of ablation comparison experiments, the anti-backflow control method proposed in this invention shows significant advantages in all test scenarios: compared with the traditional pure feedback PID scheme (Scheme A), the backflow peak amplitude is reduced by 93.6%, the adjustment stabilization time is shortened by 88.9%, the photovoltaic self-consumption rate is increased from 82.5% to 96.8%, and the daily cumulative backflow power is reduced from 850Wh to 35Wh; compared with the single prediction source scheme (Scheme B and Scheme C), this invention takes into account both long-term trend prediction and second-level mutation capture capabilities through three-source adaptive weighted fusion, and can still maintain excellent anti-backflow performance under abnormal conditions such as cloud communication interruption, verifying the effectiveness and robustness of the multi-level continuous decay backoff mechanism. Ablation comparison experiments further demonstrate that: the three-source fusion has significant gains in load forecasting accuracy and anti-reverse flow failure rate compared to the dual-source or single-source schemes (Experiment 5); the adaptive weighted modulation mechanism reduces the MAE by about 50%-55% compared to the fixed weight scheme under difficult operating conditions such as cloudy weather and load abrupt changes (Experiment 6); the load estimation layer fusion architecture fundamentally eliminates the multi-path command conflict problem in the control layer superposition scheme (Experiment 7); the multi-level continuous attenuation backoff mechanism achieves a smooth transition with almost imperceptible communication interruption, avoiding power abrupt changes and equipment thermal shock caused by step switching (Experiment 8).
[0132] This embodiment also provides an anti-reverse current control device for a photovoltaic energy storage system. This device is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0133] This embodiment provides an anti-backflow control device for a photovoltaic energy storage system, applied to the anti-backflow control system of the photovoltaic energy storage system. This anti-backflow control system includes a cloud server and an edge gateway device, such as... Figure 11 As shown, it includes: The long-term forecasting module 1101 is used to take historical operating data and meteorological data of photovoltaic energy storage sites gathered by the cloud server as input, use a forecasting model to make long-term forecasts, and generate load forecasting curves and photovoltaic output forecasting curves as the long-term forecasting results in the cloud. The ultra-short-term prediction module 1102 is used to take the feature sequence within a preset time period as input, use a deep separable temporal convolutional network deployed on the edge gateway device to perform ultra-short-term prediction, and output the load prediction value as the edge ultra-short-term prediction result. The actual measurement module 1103 is used to obtain the actual load measured by the electricity meter; The weighted fusion module 1104 is used to weight and fuse the long-term forecast results from the cloud, the ultra-short-term forecast results from the edge, and the measured load from the electricity meter to obtain a fused load estimate. The anti-reverse flow scheduling module 1105 is used to perform anti-reverse flow scheduling based on the converged load estimate and generate power adjustment commands. The sending module 1106 is used to send power adjustment commands to the inverter for power adjustment.
[0134] In some alternative implementations, the weighted fusion module 1104 includes: The first modulation unit is used to modulate the edge ultra-short-term prediction weights sequentially using confidence modulation, error modulation, and confidence gating; The second modulation unit is used to modulate the long-term prediction weights in the cloud sequentially using error modulation and freshness decay. The first determining unit is used to determine the measured load weight of the electricity meter by normalization, with the upper limit constraint of the sum of the edge ultra-short-term prediction weight and the cloud long-term prediction weight as the constraint condition. The second determining unit is used to determine the fused load estimate by adding the product of the long-term forecast result in the cloud and the weight of the ultra-short-term forecast at the edge, the product of the ultra-short-term forecast result in the edge and the weight of the long-term forecast result in the cloud, and the product of the measured load of the electricity meter and the weight of the measured load of the electricity meter.
[0135] In some optional implementations, the anti-backflow scheduling module 1105 includes: The third determining unit is used to take the maximum value among the long-term forecast results from the cloud, the ultra-short-term forecast results from the edge, and the actual load measured by the electricity meter as the photovoltaic output input for anti-reverse current calculation; The fourth determining unit is used to determine the sum of the integrated load estimate and the anti-reverse current target power as the maximum allowable power generation, and to determine the difference between the current total power generation and the maximum allowable power generation as the power surplus. The power regulation unit is used to allocate power according to the power surplus and the principle of priority hierarchical power allocation for energy storage, and to generate power regulation commands.
[0136] In some alternative implementations, the power regulation unit includes: The first adjustment subunit is used to increase the charging power of the energy storage battery and reduce the output power of the photovoltaic inverter when the power surplus is positive. The second regulation subunit is used to issue a power regulation command to either increase the energy storage discharge power or increase the photovoltaic output when the power surplus is negative.
[0137] In some optional implementations, the prediction model for edge gateway device deployment is trained as follows: The data source is the operational data reported by the site, which includes load power, photovoltaic output, grid connection point power, and battery state of charge. A prediction model is obtained by using a deep learning framework for quantitative perception training.
[0138] In some alternative embodiments, the device further includes: The compilation module is used to compile model files using a compilation toolchain; The signature module is used to perform MD5 signing on the compiled model files and to perform edge detection.
[0139] In some alternative embodiments, the device further includes: The inspection module is used to check whether there are unavailable data sources in the long-term forecast results in the cloud, the ultra-short-term forecast results at the edge, and the actual load measured by the electricity meter, using a rollback mechanism. The decay module is used to continuously decay the weights corresponding to unavailable data sources to zero.
[0140] The anti-reverse current control device for photovoltaic energy storage systems provided in this embodiment of the invention can execute the anti-reverse current control method for photovoltaic energy storage systems provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0141] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0142] The following is a detailed reference. Figure 12 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 1201, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1202 or a program loaded from memory 1208 into random access memory (RAM) 1203. The RAM 1203 also stores various programs and data required for the operation of the electronic device. The processor 1201, ROM 1202, and RAM 1203 are interconnected via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0143] Typically, the following devices can be connected to I / O interface 1205: input devices 1206 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 1207 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 1208 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1209. Communication device 1209 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 12 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0144] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 1209, or installed from a memory 1208, or installed from a ROM 1202. When the computer program is executed by the processor 1201, it performs the functions defined in the anti-reverse current control method of the photovoltaic energy storage system of the embodiments of the present invention.
[0145] Figure 12 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.
[0146] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the anti-reverse current control method of the photovoltaic energy storage system shown in the above embodiments is implemented.
[0147] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0148] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and all such modifications and variations fall within the scope defined by the appended invention.
Claims
1. A method for preventing backflow control in a photovoltaic energy storage system, characterized in that, A backflow prevention control system for photovoltaic energy storage systems, the backflow prevention control system comprising a cloud server and an edge gateway device, the method comprising: Using historical operating data and meteorological data of photovoltaic energy storage sites aggregated on cloud servers as input, a prediction model is used to make long-term predictions, generating load prediction curves and photovoltaic output prediction curves as the results of long-term cloud predictions. Using the feature sequence within a preset time period as input, a deep separable temporal convolutional network deployed on an edge gateway device is used for ultra-short-term prediction, and the output load prediction value is used as the edge ultra-short-term prediction result. Obtain the actual load measured by the electricity meter; The long-term cloud forecast results, the ultra-short-term edge forecast results, and the measured load from the electricity meter are weighted and fused to obtain a fused load estimate. Based on the fused load estimate, anti-reverse flow scheduling is performed to generate power regulation commands; The power adjustment command is sent to the inverter for power adjustment.
2. The method according to claim 1, characterized in that, The step of weightedly fusing the long-term cloud forecast results, the ultra-short-term edge forecast results, and the measured load from the electricity meter to obtain the fused load estimate includes: The edge ultra-short-term prediction weights are modulated sequentially using confidence modulation, error modulation, and confidence gating. Error modulation and freshness decay are applied sequentially to modulate the weights of long-term cloud-based predictions; The weight of the measured load of the electricity meter is determined by normalization, with the upper limit of the sum of the ultra-short-term forecast weight at the edge and the long-term forecast weight in the cloud as the constraint condition. The sum of the products of the long-term cloud forecast results and the long-term cloud forecast weights, the products of the edge ultra-short-term forecast results and the edge ultra-short-term forecast weights, and the products of the measured load of the electricity meter and the measured load weights of the electricity meter is used to determine the fused load estimate.
3. The method according to claim 1, characterized in that, The step of performing anti-reverse flow scheduling based on the fused load estimate and generating power adjustment commands includes: The maximum value among the long-term cloud forecast result, the ultra-short-term edge forecast result, and the actual measured load of the electricity meter is used as the photovoltaic output input for anti-reverse current calculation; The sum of the estimated load and the anti-reverse current target power is determined as the maximum allowable power generation, and the difference between the current total power generation and the maximum allowable power generation is determined as the power surplus. Based on the power surplus, power is allocated according to the principle of priority tiered power allocation for energy storage, and power adjustment commands are generated.
4. The method according to claim 3, characterized in that, The process of allocating power based on the power surplus and following the principle of priority tiered power allocation for energy storage, and generating power adjustment commands, includes: When the power surplus is positive, the first priority power adjustment instruction is to increase the charging power of the energy storage battery, and the second priority power adjustment instruction is to reduce the output power of the photovoltaic inverter. When the power surplus is negative, the power regulation command is to increase the energy storage discharge power or increase the photovoltaic output.
5. The method according to claim 1, characterized in that, The prediction model for edge gateway device deployment is trained as follows: The data source is the operational data reported by the site, which includes load power, photovoltaic output, grid connection point power, and battery state of charge. A prediction model is obtained by using a deep learning framework for quantitative perception training.
6. The method according to claim 5, characterized in that, The method further includes: The model files are compiled using a compiler toolchain; Perform MD5 signing and edge detection on the compiled model file.
7. The method according to claim 1, characterized in that, Before weightedly fusing the long-term cloud forecast results, the ultra-short-term edge forecast results, and the measured load from the electricity meter to obtain the fused load estimate, the method further includes: A rollback mechanism is used to check whether there are unavailable data sources in the long-term forecast results in the cloud, the ultra-short-term forecast results at the edge, and the actual load measured by the electricity meter. The weights corresponding to unavailable data sources will be continuously decayed to zero.
8. A reverse current control device for a photovoltaic energy storage system, characterized in that, A backflow prevention control system for photovoltaic energy storage systems, comprising a cloud server and an edge gateway device, the device comprising: The long-term forecasting module is used to take historical operating data and meteorological data of photovoltaic energy storage sites aggregated on the cloud server as input, use a forecasting model to make long-term forecasts, and generate load forecasting curves and photovoltaic output forecasting curves as the long-term forecast results in the cloud. The ultra-short-term prediction module is used to perform ultra-short-term prediction using a feature sequence within a preset time period as input and a deep separable temporal convolutional network deployed on the edge gateway device, and outputs the load prediction value as the edge ultra-short-term prediction result. The actual measurement module is used to obtain the actual load measured by the electricity meter; The weighted fusion module is used to weight and fuse the long-term forecast results from the cloud, the ultra-short-term forecast results from the edge, and the measured load from the electricity meter to obtain a fused load estimate. The anti-reverse flow scheduling module is used to perform anti-reverse flow scheduling based on the fused load estimate and generate power adjustment commands. The sending module is used to send the power adjustment command to the inverter for power adjustment.
9. An electronic device, characterized in that, include: The system includes a memory and a processor, which are interconnected. The memory stores computer instructions, and the processor executes the computer instructions to perform the anti-reverse current control method of the photovoltaic energy storage system according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the anti-reverse flow control method of the photovoltaic energy storage system according to any one of claims 1 to 7.