Energy management method of photovoltaic energy storage system

The energy management method for photovoltaic systems uses IoT and edge computing with machine learning and reinforcement learning to address slow response and inflexible scheduling, enhancing efficiency and stability by dynamically adjusting energy strategies.

CN119231653AActive Publication Date: 2024-12-31SUZHOU YIMI NEW ENERGY TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411730223.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2024-12-31
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

Existing photovoltaic energy storage systems face challenges with slow response speed, weak prediction ability, and inflexible scheduling, especially in complex supply and demand environments, which affect grid stability and energy efficiency.

Method used

An energy management method that includes real-time data collection and processing using IoT sensors and edge computing, combined with lightweight machine learning and deep reinforcement learning, to dynamically adjust charging and discharging strategies of power electronic converters, and flexibly schedule distributed energy resources through adaptive supply and demand balance algorithms.

Benefits of technology

This approach enhances energy management efficiency and economic benefits by providing accurate data processing, intelligent adjustment of power electronic converters, and flexible scheduling, improving system responsiveness and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119231653A_ABST
    Figure CN119231653A_ABST
Patent Text Reader

Abstract

The invention discloses an energy management method for a photovoltaic energy storage system, and relates to the technical field of energy management, and the method comprises the steps: collecting the operation state and environment demand data of a photovoltaic module in real time, and transmitting the data to an edge computing device for primary processing; the edge computing device analyzes the operation state and the environment demand data in real time by using a lightweight machine learning model to generate prediction data; based on prediction data of the edge computing device, a deep reinforcement learning algorithm is adopted to train an intelligent agent, an optimal energy management strategy is learned, and a charging and discharging strategy of the power electronic converter is dynamically adjusted; and carrying out real-time monitoring on the system state snapshot data, and if a significant change which does not conform to prediction is monitored, re-evaluating the supply-demand balance state, and adjusting the working mode of the power electronic converter. The system integrates the Internet of Things and the AI technology, intelligently regulates and controls photovoltaic energy storage, optimizes energy management, improves efficiency and benefits, solves technical bottlenecks, and enhances system performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of energy management, and in particular to an energy management method for a photovoltaic energy storage system. Background Art

[0002] As an important part of the renewable energy sector, photovoltaic energy storage systems have developed rapidly in recent years with the surge in global demand for clean energy. Early photovoltaic energy storage systems mainly relied on simple charging and discharging control strategies, that is, when photovoltaic power generation exceeds the immediate load, the excess electricity is stored, and when power generation is insufficient, the stored energy is released to make up for the demand gap. However, this primary energy storage management method cannot effectively cope with the complex and changing energy supply and demand relationship, especially in the scenario of large-scale access to the power grid, which puts higher requirements on grid stability and energy efficiency.

[0003] In recent years, with the maturity of advanced technologies such as the Internet of Things, edge computing, machine learning, and deep reinforcement learning, the energy management of photovoltaic energy storage systems has ushered in a revolutionary change. The widespread use of IoT sensors makes it possible to collect the operating status and environmental parameters of photovoltaic components in real time, thereby providing basic data support for refined management. The introduction of edge computing not only improves the speed and efficiency of data processing, but also enhances the system's responsiveness and intelligent decision-making level. Combined with machine learning, especially deep reinforcement learning technology, photovoltaic energy storage systems can learn and optimize complex energy scheduling strategies, and realize dynamic adjustment of the charging and discharging strategies of power electronic converters, thereby greatly improving energy utilization and economic benefits. Summary of the invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides an energy management method for a photovoltaic energy storage system to solve the problems of slow response speed, weak prediction ability and inflexible scheduling in the prior art under complex supply and demand environments.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: In a first aspect, an embodiment of the present invention provides an energy management method for a photovoltaic energy storage system, which includes collecting the operating status and environmental demand data of photovoltaic components in real time, and transmitting the data to an edge computing device for preliminary processing; the edge computing device uses a lightweight machine learning model to analyze the operating status and environmental demand data in real time to generate prediction data; based on the prediction data of the edge computing device, a deep reinforcement learning algorithm is used to train an intelligent agent to learn the optimal energy management strategy and dynamically adjust the charging and discharging strategy of the power electronic converter; through an adaptive supply and demand balance algorithm, a microservice architecture is used to flexibly schedule distributed energy resources in a microgrid to generate an optimized scheduling strategy; in combination with the charging and discharging strategy and the optimized scheduling strategy of the power electronic converter, system status snapshot data is continuously collected; the system status snapshot data is monitored in real time, and if a significant change that does not match the prediction is detected, the supply and demand balance state is re-evaluated and the working mode of the power electronic converter is adjusted.

[0007] As a preferred solution of the energy management method of the photovoltaic energy storage system of the present invention, the real-time collection of the operating status and environmental demand data of the photovoltaic components and the transmission of the data to the edge computing device for preliminary processing are as follows: Deploy a comprehensive network of environmental and performance monitoring sensors, as well as equipment with integrated weather station functions, to form a network covering the PV panel area; Use the performance monitoring sensor network to capture the operating status and environmental parameters of the PV panels in real time, convert them into JSON format, and create data packets; Apply a moving average method to the measurements in the data packet on the edge computing device to identify abnormal data points that deviate from the normal range and mark them in the data packet; Verify the marked data packets and complete the preliminary processing of the data.

[0008] As a preferred solution of the energy management method of the photovoltaic energy storage system of the present invention, wherein: the moving average method is applied to the measured values ​​in the data packet on the edge computing device to identify abnormal data points that deviate from the normal range and mark them in the data packet, the specific steps are: The edge computing device receives data packets from the sensor network and unpacks the received JSON format data packets to extract metadata and payload data; Parse the measurement value of each metadata and payload data point, set the moving average window size N, and calculate the moving average of each measurement value. The expression is: ; in, represents the moving average at time point t, represents the i-th measurement value, where i is the index variable; The standard deviation SD expression based on the moving average at time point t is: ; Combining the moving average value at time point t and the corresponding standard deviation SD, the standard deviation multiple threshold Td expression is defined as: ; Where k is the selected standard deviation multiple; Compare each measured value with the threshold Td. If the measured value exceeds the threshold Td, it is marked as an outlier. In the original data packet, the identified outliers are marked.

[0009] As a preferred solution of the energy management method of the photovoltaic energy storage system of the present invention, wherein: Generate forecast data. The specific steps are: Receive the data packets of photovoltaic module operation status and environmental requirements collected and preliminarily processed by IoT sensors, and perform data cleaning; For the cleaned data packets, multi-scale wavelet transform is applied to extract features and output the operation status and environmental demand data; Based on the operating status and environmental demand data extracted from the features, the real-time prediction expression is constructed through polynomial regression and exponential smoothing: ; Among them, P t represents the predicted value at time point t, β0 is the intercept term, β i and γ i are the coefficient and polynomial order of the i-th feature, respectively. is the i-th eigenvalue, E t-1 is the error term of the previous moment, α is the smoothing factor, To control the decay rate of exponential smoothing, n is the number of polynomial features and e is the base of the natural logarithm.

[0010] As a preferred solution of the energy management method of the photovoltaic energy storage system of the present invention, the specific steps of dynamically adjusting the charging and discharging strategy of the power electronic converter are as follows: Add the predicted value P to the original state representation S t , the expression of the extended state S′ is generated as: ; Based on the extended state S′, the agent learning framework is defined and the comprehensive evaluation function F is established as follows: ; in, represents the energy efficiency at time point t, C(S′, A) is the economic cost C of taking any action A under the extended state S′, T is the starting time, Δt is the time interval of integration, dt is the time differential element, and w is the adjusted prediction value P t The weight coefficient of relative importance in the comprehensive evaluation function F; Combine the comprehensive evaluation function F with the immediate reward R to generate the adjusted immediate reward R adj The expression is: ; Based on the immediate reward R adj , combined with the deep Q network to train the agent, in each learning iteration, the agent updates the Q value, and the update expression is: ; in, It represents the update amount of Q value after executing action a in the current state s, a′ represents the possible action to be taken in the next state s′, α is the learning rate, γ is the discount factor, and θ represents the parameters of the main network. are the parameters of the target network.

[0011] As a preferred solution of the energy management method of the photovoltaic energy storage system of the present invention, the specific steps of generating the optimization scheduling strategy are as follows: Define standardized interfaces for distributed energy resources and build them into microservices with independent business logic; Use Docker containers to encapsulate microservices, and manage and schedule containerized microservices through Kubernetes clusters; The charging and discharging strategy of the converter is integrated with the dynamic balance algorithm of the market mechanism, and the distributed energy resources are encouraged to actively participate in the supply and demand regulation through the real-time electricity price strategy, and the supply and demand balance optimization expression is generated as follows: ; Among them, P sy,i is the total power supplied at the i-th time point, P dd,i is the total power demand at time i, P DER is the power output vector of distributed energy resources, C DER,i is the operating cost of distributed energy resources at the i-th time point, λ is the cost weight factor; Distributed energy resource microservices exchange data through RESTful APIs and use message queues to transmit supply and demand signals; In the distributed energy resource microservice, the Raft consensus algorithm is integrated for event monitoring; The output of the supply-demand balance optimization expression is used as input, and a scheduling strategy is generated using mathematical programming. The scheduling strategy is then sent to the distributed energy resource microservice to guide it to adjust its operation mode. Collect the actual response of distributed energy resources, compare it with the expected response, and adjust the strategy until the optimal balance is achieved.

[0012] As a preferred solution of the energy management method of the photovoltaic energy storage system of the present invention, wherein: the charging and discharging strategy and the optimization scheduling strategy of the power electronic converter are combined to continuously collect system status data, and the specific steps are: Define deep reinforcement learning policies as decision rules; The supply-demand balancing algorithm is defined as the adjustment rule for electricity demand and supply; Integrate the real-time evaluation results of decision rules and adjustment rules to build a decision framework; Assign weights to decisions and adjustment rules through a decision framework based on the current system state and target priorities; Combine the weighted rule outputs to generate specific control instructions; Send control instructions to corresponding power electronic equipment for execution, and output the real-time response status of the power electronic equipment; Leverage existing sensor networks to deploy additional sensors to monitor the status of power electronic converters and collect key power data; Combine newly collected critical power data with status data, environmental data, and forecast data to form a comprehensive system status snapshot.

[0013] As a preferred solution of the energy management method of the photovoltaic energy storage system of the present invention, wherein: Monitor the system status snapshot data in real time. If significant changes that are inconsistent with the forecast are detected, re-evaluate the supply and demand balance and adjust the power electronic converter working mode. The specific steps are as follows: The real-time data stream processing framework is used to aggregate the system status snapshot data collected by the sensor network in real time to form a unified data stream; Perform denoising, anomaly detection and standardization on the aggregated data; Apply statistical process control charts to monitor statistical characteristics in data streams and identify points outside control limits; Feedback detected points beyond control limits to edge computing devices to trigger a reassessment process; Update the decision rules of the deep reinforcement learning agent and retrain the agent based on the new supply and demand balance state and system snapshot data; Generate new control instructions based on the updated decision rules to adjust the charging and discharging strategy of the power electronic converter; Execute control instructions and monitor the response status of power electronic converters; Implement a closed-loop control mechanism to continuously monitor the performance of the power electronic converter and the system status.

[0014] In a second aspect, an embodiment of the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the energy management method of the photovoltaic energy storage system as described in the first aspect of the present invention is implemented.

[0015] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, any step of the energy management method for a photovoltaic energy storage system as described in the first aspect of the present invention is implemented.

[0016] The beneficial effects of the present invention are as follows: the present invention realizes more accurate data processing, more efficient energy prediction, more intelligent adjustment of the working mode of power electronic converters, and more flexible distributed energy resource scheduling through the comprehensive application of IoT sensors, edge computing, lightweight machine learning, deep reinforcement learning, and adaptive supply and demand balance algorithms. Specifically, the present invention collects the operating status and environmental demand data of photovoltaic components in real time, uses edge computing devices to identify and process abnormal data points, combines lightweight machine learning models for high-precision prediction, uses deep reinforcement learning algorithms to train intelligent agents to dynamically adjust the charging and discharging strategies of power electronic converters, and flexibly schedules distributed energy resources in microgrids through adaptive supply and demand balance algorithms, thereby significantly improving the energy management efficiency and economy of photovoltaic energy storage systems and solving problems existing in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0018] Figure 1 This is a flow chart of the energy management method of the photovoltaic energy storage system in Example 1.

[0019] Figure 2 This is a flowchart of the preliminary processing of the edge computing device in Example 1. DETAILED DESCRIPTION

[0020] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0021] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0022] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0023] Example 1, reference Figure 1 and Figure 2 , which is the first embodiment of the present invention, provides an energy management method for a photovoltaic energy storage system, comprising the following steps: S1. Collect the operating status and environmental demand data of photovoltaic modules in real time, and transmit the data to the edge computing device for preliminary processing.

[0024] Furthermore, a comprehensive environmental and performance monitoring sensor network is deployed, including sensors for temperature, humidity, light intensity, current, voltage, and devices with integrated weather station functions, with at least one node deployed every 100 square meters to form a network covering the PV panel area; It should be noted that the equipment with integrated weather station functions mainly includes but is not limited to the following sensors and components: Temperature sensor: used to measure the temperature of air, soil or water.

[0025] Humidity Sensor: Monitors the relative humidity in the air.

[0026] Wind speed sensor: measures wind speed and is usually used in conjunction with a wind direction sensor.

[0027] Wind direction sensor: Determines wind direction.

[0028] Air pressure sensor: Observes atmospheric pressure to help predict weather changes.

[0029] Precipitation Sensor: Includes a rain gauge to detect the amount of rain or snowfall.

[0030] Light sensor: measures light intensity, which is particularly important for photovoltaic power generation.

[0031] UV sensors: monitor UV intensity, which has an impact on skin health and material aging.

[0032] Radiation sensors: measure solar and other types of radiation.

[0033] Soil temperature and humidity sensor: used to monitor soil temperature and humidity, valuable for agricultural and ecological research.

[0034] PM2.5 / PM10 sensor: monitors the concentration of particulate matter in the air and assesses air quality.

[0035] Carbon dioxide (CO2) sensor: measures the concentration of carbon dioxide in the air, which affects the greenhouse effect and plant growth.

[0036] In addition to sensors, devices with integrated weather station functions include: Data collector: responsible for collecting raw data from each sensor and performing preliminary data processing.

[0037] Communication module: used to transmit data to a central database or cloud platform. Common communication methods include wireless networks (such as LoRaWAN, GPRS, Wi-Fi), satellite communications, or wired networks.

[0038] Power management unit: such as solar panels and batteries, to power the weather station and ensure continuous operation.

[0039] Protective devices: such as protective covers and lightning rods, protect equipment from severe weather and external damage.

[0040] Data storage and processing software: On-premises or cloud-based software for storing, analyzing, and visualizing meteorological data.

[0041] Furthermore, a performance monitoring sensor network is used to capture the operating status and environmental parameters of the PV panels in real time and convert them into JSON format to create data packets. Each data packet contains a timestamp, precise location coordinates, specific measurement values, and a checksum to verify data integrity. It should be noted that the specific implementation steps of "using the performance monitoring sensor network to capture the operating status and environmental parameters of the photovoltaic components in real time, converting them into JSON format, and creating data packets" are as follows: First, the sensor starts working and continuously collects the operating status (such as current, voltage, temperature) and environmental parameters (such as light, temperature, humidity, wind speed) of the photovoltaic modules; Secondly, the sensor converts physical signals (such as light, heat, electricity) into electrical signals, which are then converted into digital signals by analog-to-digital converters (ADCs) for subsequent processing; Finally, a preliminary check is performed on the integrity and rationality of the data, invalid or abnormal values ​​are eliminated, and data quality is ensured. The processed digital signal is encoded according to a predetermined data format. Common data formats include CSV, XML, JSON, etc., among which JSON is selected because of its lightweight and easy-to-parse characteristics; the encoded data is packaged into data packets according to a certain time interval or event trigger mechanism. Each data packet may contain data from multiple sensors and a collection timestamp.

[0042] Apply a moving average method to the measurements in the data packet on the edge computing device to identify abnormal data points that deviate from the normal range and mark them in the data packet; Furthermore, the edge computing device receives data packets from the sensor network and unpacks the received JSON format data packets to extract metadata and payload data. Among them, metadata usually includes information that describes the context of the data packet, such as timestamps and location information. This information helps to understand the time and space background of the data and is very important for data analysis and subsequent processing; Payload Data refers to the actual measured or collected data, such as temperature, humidity, pressure and other measurement values. These data are the main outputs of the sensor network and are used to monitor environmental conditions or equipment operation.

[0043] Parse the measured values ​​of each metadata and payload data point, such as current, voltage, temperature, etc., and set the moving average window size N, which depends on the volatility of the data and is generally 5 to 20 data points; The moving average is calculated for each measured value, and the expression is: ; in, represents the moving average at time point t, represents the i-th measurement value, i is the index variable; During the parsing process, as new data points are added, the moving average is updated, the oldest data points are removed, and the latest data points are added; The standard deviation SD is calculated based on the moving average at time point t to measure the degree of deviation of the data point from the average value. Its expression is: ; Combine the moving average value and the corresponding standard deviation SD at time point t to define the standard deviation multiple threshold Td (for example, 2 or 3 times) to identify outliers. The expression is: ; Where k is the selected standard deviation multiple; Compare each measured value with the threshold Td. If the measured value exceeds the threshold Td, it is marked as an outlier. In the original data packet, the identified anomaly values ​​are marked. For example, a Boolean field isAnomaly or an anomaly type label can be added.

[0044] Preferably, the "moving average method" is used as a tool for outlier detection, mainly based on its several significant advantages in processing time series data, which make the moving average method an ideal choice for real-time monitoring and data analysis, especially in the monitoring of the operating status and environmental parameters of photovoltaic modules. The moving average method can smooth short-term fluctuations and highlight long-term trends by calculating the average value of N consecutive data points in the data sequence, which is particularly effective in filtering out outliers caused by random noise. In photovoltaic systems, environmental factors such as light intensity and temperature may be affected by short-term disturbances, which do not reflect the true state, but are the result of measurement errors or temporary interference. By applying the moving average method, we can eliminate such short-term disturbances and make the data more stable, making it easier to identify real abnormal patterns, such as equipment failures or extreme weather events. In addition, the moving average method has high computational efficiency, is suitable for real-time data stream processing, and can be quickly executed on edge computing devices without waiting for a large amount of data to accumulate, which is crucial for real-time monitoring and rapid response. Therefore, the moving average method can not only help us extract useful information from complex data streams, but also realize efficient data preprocessing on resource-constrained edge computing devices, ensuring that subsequent in-depth analysis and decision-making are based on accurate and clean data.

[0045] The marked data packets are checked to ensure that the marked data packet structure is complete and all necessary information is correctly encoded, preparing the data stream for transmission to the next processing stage.

[0046] It should be noted that "ensuring that the structure of the marked data packet is complete and all necessary information is correctly encoded" mainly refers to: Packet integrity check: Checks whether the packet contains all required fields, such as timestamp, location information, measurement values, and exception markers; confirms that the data type and format of all fields are as expected to avoid decoding failures due to data format errors.

[0047] Data packet structure verification: Verify that the structure of the data packet is consistent with the format expected by the recipient, including the correctness of the JSON key-value pairs; if the data packet contains a nested structure, ensure that the data at all levels is correct.

[0048] Anomaly labeling confirmation: Confirm that the abnormal data points have been correctly labeled without omissions or incorrect labeling; ensure that each abnormal data point is accompanied by sufficient information, such as the type of anomaly, the severity of the anomaly, etc.

[0049] Finally, if any problems are found during the integrity check, reorganize the data packet to ensure that all information is accurate, and check the encoding again to ensure that all data is encoded correctly, especially special characters and numeric data.

[0050] S2. Edge computing devices use lightweight machine learning models to analyze operating status and environmental demand data in real time and generate predictive data.

[0051] Furthermore, receiving the data packets of PV module operating status and environmental requirements collected and preliminarily processed by IoT sensors and performing data cleaning, including removing noise and processing missing values, is a key step to ensure data quality; For the cleaned data packets, multi-scale wavelet transform is applied to extract features and output the operation status and environmental demand data; Preferably, the application of multi-scale wavelet transform for feature extraction is an important component of the lightweight model. The purpose of feature extraction is to extract the most helpful key information for prediction from the original data, reduce the computational burden, and maintain the prediction performance.

[0052] It should be noted that the application of multi-scale wavelet transform for feature extraction shows unique beneficial effects compared with other traditional methods, such as Fourier transform or windowed time-frequency analysis methods. Multi-scale wavelet transform can capture the local characteristics of data in both time and frequency domains at the same time, and is particularly good at processing non-stationary signals, which is crucial for analyzing the operating status and environmental demand data of photovoltaic components, because these data often contain transient and trend components. By decomposing the signal into different time scales, the wavelet transform can separate high-frequency noise or mutations and low-frequency long-term trends, thereby more finely extracting features that are valuable for prediction. In addition, the multi-scale characteristics allow us to observe data at different resolutions, which is extremely beneficial for identifying patterns at different time scales in photovoltaic systems (such as daytime light changes and seasonal fluctuations). Therefore, compared with other methods, multi-scale wavelet transform can provide richer and more specific feature information, enhance the accuracy and robustness of the prediction model, and thus improve the energy management efficiency of the entire photovoltaic energy storage system.

[0053] Furthermore, based on the operating status and environmental demand data extracted from the features, a real-time prediction expression is constructed through polynomial regression and exponential smoothing: ; Among them, P t represents the predicted value at time point t, β0 is the intercept term, βi and γ i are the coefficient and polynomial order of the i-th feature, respectively. is the i-th eigenvalue, E t-1 is the error term of the previous moment, α is the smoothing factor, To control the decay rate of exponential smoothing, n is the number of polynomial features and e is the base of the natural logarithm.

[0054] Preferably, the intercept term β0 is estimated by minimizing the residual sum of squares (RSS), that is, by finding a set of parameters β (including β0) that minimizes the gap between the predicted value and the actual observed value. In practice, we use numerical optimization algorithms, such as gradient descent or quasi-Newton method, to solve the model parameters, including the intercept term. Finally, the model parameters we obtain provide the optimal energy prediction ability, where β0 represents the expected energy level when all independent variables are zero.

[0055] It should be noted that determining the order of the polynomial in the polynomial regression model is a key step, which directly affects the model's fitting ability and generalization ability. Generally, choosing an appropriate polynomial order requires balancing the complexity of the model and the fitting effect of the data to avoid overfitting or underfitting. The following are several common methods to determine the polynomial order: First, perform a visual check: Use a scatter plot to observe the data distribution and try to identify whether the data has an obvious curve trend. If the data shows a nonlinear relationship, you can consider using polynomial regression. By drawing scatter plots of polynomial fitting curves of different orders and the original data, you can intuitively determine which order of model can best reflect the true trend of the data.

[0056] Next, perform residual analysis: Check the residual plot, which is the difference between the predicted value and the actual value as the predicted value changes. Ideally, the residuals should be randomly distributed with a mean close to 0. If the residuals show a certain pattern (such as a curve), it may indicate that the model is too simple and the order of the polynomial needs to be increased; if the variance of the residuals increases as the predicted value increases, you may need to consider a different type of model or transform the data. Analyze the residual sum of squares (RSS) under different orders and choose the polynomial order that minimizes the RSS.

[0057] Next, perform cross-validation: Use cross-validation (such as k-fold cross-validation) to evaluate the performance of models of different orders on unseen data. Usually the polynomial order with the lowest average cross-validation error is selected. Cross-validation can help evaluate the generalization ability of the model and avoid choosing a model that performs well on the training data but performs poorly on new data.

[0058] Next, perform information criteria: Use the Akaike Information Criterion (AIC) or the Bayesian Information Criterion (BIC) to evaluate the model. These criteria take into account the complexity and fit of the model, and tend to choose a model that fits the data well without being overly complex. Both AIC and BIC penalize the complexity of the model, with BIC having a greater penalty and being more suitable for model selection in large sample situations.

[0059] Finally, we use stepwise regression to increase the order of the polynomial. It should also be noted that stepwise regression is a statistical method that automatically adds or removes variables to find the optimal model. In the context of polynomial regression, we can gradually increase the order of the polynomial until the improvement in the model is no longer significant.

[0060] Preferably, the combination of polynomial regression and exponential smoothing technology is applied to the energy management of photovoltaic energy storage systems, which can give full play to the advantages of both. Polynomial regression can capture nonlinear trends in data and accurately model complex time series patterns, while exponential smoothing is good at handling short-term fluctuations and providing more stable prediction results. This combination not only improves the prediction accuracy, but also enhances the model's ability to adapt to real-time data changes, enabling the energy management system to more intelligently predict electricity demand and supply and optimize scheduling strategies, thereby significantly improving the overall performance and economic benefits of the system.

[0061] It should be noted that this process describes the application process of lightweight machine learning models in the prediction of photovoltaic module operating status and environmental demand, including data preprocessing, feature extraction, and the construction and application of prediction models. The entire process aims to achieve lightweight, efficient, and real-time prediction goals, which is in line with the design concept of lightweight machine learning models.

[0062] It should also be noted that edge computing devices use lightweight machine learning models to analyze the operating status and environmental demand data of photovoltaic systems in real time, which can quickly generate accurate prediction data, effectively improve energy management efficiency, achieve instant response and optimized scheduling, and significantly improve the intelligence level and economic benefits of photovoltaic energy storage systems.

[0063] S3. Based on the prediction data of edge computing devices, a deep reinforcement learning algorithm is used to train the intelligent agent, learn the optimal energy management strategy, and dynamically adjust the charging and discharging strategy of the power electronic converter.

[0064] Furthermore, we add the predicted value P to the original state representation S t , the expression of the extended state S′ is generated as: ; Preferably, "obtaining the extended state representation S′" means that the intelligent agent not only considers the current operating state and environmental parameters when making decisions, but also considers future predicted values, thereby enhancing the predictability of the intelligent agent.

[0065] Based on the extended state S′, the agent learning framework is defined and the comprehensive evaluation function F is established as follows: ; in, represents the energy efficiency at time point t, C(S′, A) is the economic cost C of taking any action A under the extended state S′, T is the starting time, Δt is the time interval of integration, dt is the time differential element, and w is the adjusted prediction value P t The weight coefficient of relative importance in the comprehensive evaluation function F; It should be noted that "economic cost C" specifically includes the following specific cost types: Operating costs: This may include the cost of operating the power electronic converters and other equipment, as well as any maintenance and depreciation costs.

[0066] Opportunity cost: If the system does not store or release energy at a certain moment, market opportunities may be missed, such as selling electricity during a period of high electricity prices or charging during a period of low electricity prices.

[0067] Loss cost: Energy storage equipment will lose energy during the charging and discharging process, and the energy cost of this loss also needs to be taken into account.

[0068] Equipment lifecycle costs: Frequent charge and discharge cycles may shorten the battery life, so a frequent charge and discharge strategy may result in higher equipment replacement costs.

[0069] Market transaction costs: If the system participates in electricity market transactions, then the transaction costs of buying and selling electricity should also be taken into account, which may include transaction fees, imbalance fees, etc.

[0070] Environmental costs: Some regions may impose taxes on carbon or pollutant emissions. If the energy storage system leads to an indirect or direct increase in the carbon footprint, this cost should also be included.

[0071] Spare capacity cost: The system needs to maintain a certain amount of spare capacity to cope with emergencies. This unused capacity is also a cost.

[0072] It should be noted that in the context of deep reinforcement learning, an "agent" refers to an entity that can perceive the environment and make decisions based on the perceived information. The goal of an agent is usually to perform a series of actions through interaction with the environment to achieve a long-term goal or maximize a reward signal. In specific application scenarios, agents can be software programs, robots, virtual characters, etc. They can observe the state of the environment, make decisions based on these states, and perform corresponding actions; It should be noted that, through the above steps, the predicted value Pt Integrating it into the decision-making process of the intelligent agent not only adjusts the learning framework and evaluation function of the intelligent agent, but also enables the intelligent agent to dynamically adjust the charging and discharging strategy of the power electronic converter based on future prediction data, thereby achieving more efficient and forward-looking energy management. This strategy not only improves the flexibility and efficiency of energy management, but also enhances the overall stability of the system.

[0073] Combine the comprehensive evaluation function F with the immediate reward R to generate the adjusted immediate reward R adj The expression is: ; Preferably, in this way, the following ΔQ(s, a) update formula directly reflects the influence of F(S′, A). When learning, the agent not only considers the immediate reward R, but also the long-term benefits represented by F(S′, A), so that the decision is more inclined to those actions that can bring higher comprehensive benefits.

[0074] Based on the immediate reward R adj , combined with the deep Q network to train the agent, in each learning iteration, the agent updates the Q value, and the update expression is: ; in, It represents the amount of Q value update after executing action a in the current state s, which is used to adjust the predicted value of the Q network to be closer to the actual value. a′ represents the possible action to be taken in the next state s′. α is the learning rate, which determines the magnitude of the change in weight at each update. γ is the discount factor, which is used to balance the impact of immediate rewards and future rewards. θ represents the parameters of the main network. It is the parameter of the target network, which is used to calculate the target Q value and help stabilize the training process; Preferably, DQN is a reinforcement learning algorithm based on deep learning, which can learn complex strategies from high-dimensional inputs. At the same time, in order to improve learning efficiency and stability, a dual network structure and a priority experience replay mechanism will be adopted.

[0075] It should also be noted that in the learning process of the deep Q network (DQN), the role of the agent is to perceive the environment: the agent can receive information about the current state S of the environment, which may include visual images, sensor readings, system status, etc.; Decision making: Based on the current state S, the agent will select an action a from the available action set A to perform. This decision is based on the agent's internal strategy, which is usually guided by a policy function or a value function (such as a Q function); Execution of actions: the agent performs the selected action a, which will cause the environment to change and enter a new state S', and may generate an immediate reward R; Learning and adaptation: the agent updates its internal strategy or value function based on the immediate reward R and the new state S'. In DQN, this usually means updating the Q value so that the agent's decision can gradually approach the optimal strategy, that is, the action taken in a given state can maximize the expected cumulative reward.

[0076] It should be noted that the specific meanings of "main network and target network" are as follows: the main network is a network used to predict the Q value of taking a certain action in the current state. During the learning process, the intelligent agent selects actions and predicts Q values ​​based on the network of θ parameters. Whenever the intelligent agent interacts with the environment and receives new experience samples, the θ parameters will be updated according to these samples to make the network's predictions more accurate; the role of the target network is to provide a stable target Q value, which is used to update the parameters θ of the main network. The parameters θ of the target network will not be updated frequently, but will be periodically copied from the parameters θ of the main network. This is done to increase the stability of the learning process and avoid instability caused by rapid changes in parameters during training.

[0077] It should also be noted that after training, the intelligent agent will be able to dynamically adjust the charging and discharging strategies of the power electronic converter based on the real-time prediction data of the edge computing device. In this step, the intelligent agent will evaluate the current status in real time and predict future energy demand and market conditions to optimize the timing of energy storage and release. The intelligent agent's decision will be directly converted into the control signal of the power electronic converter to realize automated and intelligent energy management.

[0078] After the deep Q network (DQN) training is completed, the agent will be able to dynamically adjust the charging and discharging strategies of the power electronic converter based on its learned strategies.

[0079] It should be noted that the following are the specific steps for how the agent uses the knowledge learned to optimize energy management after training is completed: The agent first observes the current environmental state S, which includes but is not limited to the output power of photovoltaic panels, the power state of energy storage systems, market electricity prices, weather forecasts, etc. This information will be converted into feature vectors that the agent can understand and process as a representation of the current state S.

[0080] Based on the current state S, the agent will use its trained Q network (represented by parameters θ) to evaluate all possible actions A. For each action a∈A, the agent calculates the corresponding Q value Q(s, a; θ), which reflects the cumulative reward expected from taking that action in the current state.

[0081] The agent chooses the action a* with the highest Q value as: ; Once the agent selects the optimal action a*, it will be directly or indirectly converted into control instructions for the power electronic converter. For example, if a* indicates charging, the agent will send a signal to the power electronic converter, commanding it to absorb power from the grid or photovoltaic panels and store it in the battery. On the contrary, if a* indicates discharging, the agent will command the power electronic converter to release the stored power to meet the load demand.

[0082] After executing action a*, the agent will observe feedback from the environment, including the new state S′ and the immediate reward R. The new state S′ will become the basis for the next decision, while the immediate reward R can be used to evaluate the effect of the action. Even after training is completed, the agent can continue to collect data for future fine-tuning and optimization of strategies.

[0083] The above process will be repeated in a cycle, with the agent continuously observing, evaluating, selecting actions, executing and receiving feedback to dynamically adjust the charging and discharging strategies of the power electronic converter to achieve optimal energy management and resource allocation.

[0084] Finally, in this way, the intelligent agent can flexibly adjust the charging and discharging strategy according to real-time environmental conditions and forecast information to maximize energy utilization efficiency and economic benefits while ensuring the stable operation of the system.

[0085] S4. Through the adaptive supply and demand balancing algorithm, the distributed energy resources in the microgrid are flexibly dispatched using the microservice architecture to generate an optimized dispatching strategy.

[0086] Going a step further, define standardized interfaces for distributed energy resources (DERs); It should be noted that this standardized interface should cover functions such as energy resource authentication, status reporting, control command acceptance and execution, so as to facilitate seamless integration across systems and platforms.

[0087] Each distributed energy resource is defined as a microservice with independent business logic, such as energy generation, storage, consumption or transaction; Use Docker containers to encapsulate microservices to ensure environmental consistency, and manage and schedule containerized microservices through Kubernetes clusters to ensure high availability and elastic scalability; The charging and discharging strategies of converters (such as power electronic converters in battery energy storage systems) are integrated with the dynamic balance algorithm of the market mechanism. The distributed energy resources (DERs) are encouraged to actively participate in supply and demand regulation through real-time electricity price strategies, thereby optimizing the supply and demand balance problem. Its goal is to minimize the supply and demand differences in the power system while considering economic costs. The supply and demand balance optimization expression is generated as follows: ; Among them, P sy,i is the total power supplied at the i-th time point, P dd,i is the total power demand at time i, P DER is the power output vector of distributed energy resources, C DER,i is the operating cost of the distributed energy resource at the i-th time point, and λ is the cost weight factor that balances the power mismatch and operating cost.

[0088] The real-time pricing (RTP) strategy is not a new concept. It has been studied and applied in the power industry for some time, especially in the field of smart grid and demand side management (DSM). The core of the real-time pricing strategy is to dynamically adjust the electricity price according to the real-time changes in electricity supply and demand, so as to reflect the real cost and value of electricity. This strategy aims to encourage electricity consumers to reduce electricity consumption during peak hours and increase electricity consumption during off-peak hours, so as to balance electricity supply and demand and improve the efficiency and reliability of the power grid.

[0089] It should be noted that the "supply and demand balance optimization expression" is closely related to the previous step "based on the prediction data of edge computing devices, using deep reinforcement learning algorithms to train intelligent agents, learn optimal energy management strategies, and dynamically adjust the charging and discharging strategies of power electronic converters". The correlation between the two concepts is reflected in the following points: The goal of the “supply-demand balance optimization expression” is to minimize the supply-demand imbalance and operating costs by adjusting the output of distributed energy resources (DERs), which is consistent with the goal of the deep reinforcement learning agent - learning the optimal strategy to optimize energy management; the deep reinforcement learning agent learns through trial and error, and continuously adjusts the strategy to optimize its actions in a specific state (i.e., the charging and discharging strategy of the power electronic converter), which directly affects P in the above expression. DER, thus affecting the supply and demand balance and operating costs; the learning process of deep reinforcement learning agents relies on real-time and predicted data, which may include weather forecasts, power demand forecasts, market prices, etc., which are collected and pre-processed by edge computing devices. The quality and accuracy of these data directly affect the optimization effect of the agent strategy; deep reinforcement learning agents can dynamically adjust their strategies according to environmental changes (such as real-time power demand and supply conditions), which is consistent with the expression of adjusting P DER It is consistent to respond to real-time changes in supply and demand.

[0090] In summary, the learning and decision-making process of the deep reinforcement learning agent directly serves the objective function in the optimization expression, that is, minimizing the supply-demand imbalance and operating cost. Through the dynamic strategy adjustment of the agent, the optimal scheduling of DERs can be effectively achieved, thereby realizing the optimization of smart grid energy management in practical applications.

[0091] Furthermore, distributed energy resources DERs microservices interact with each other through RESTful APIs to ensure compatibility between heterogeneous systems, and use message queues (such as RabbitMQ or Kafka) to transmit supply and demand signals to ensure reliable transmission and sequential processing of messages; It should be noted that this step ensures the coordination and consistency within the DERs system, and its output is a stable data flow between microservices and a real-time transmission mechanism for supply and demand signals.

[0092] In the distributed energy DERs resource microservice, the Raft consensus algorithm is integrated to monitor events, such as price changes, supply and demand imbalances, etc., and automatically trigger the response mechanism to ensure the consistency of all nodes' response to events; The preferred "Raft consensus algorithm" in this type of distributed energy management system is mainly due to its significant advantages in easy to understand, efficient election process and fault tolerance, which is particularly suitable for the event monitoring and response mechanism under the DERs (distributed energy resources) microservice architecture. Unlike other complex and theoretically abstract consensus algorithms, such as Paxos, Raft simplifies the core process and decomposes the state machine replication problem into three parts: leader election, log replication and security, making the algorithm not only easy to understand and implement, but also performs well in a dynamically changing network environment. Especially in the DERs scenario, the state of energy resources changes frequently, and the price signals under the market mechanism need to respond quickly. The Raft algorithm can quickly select a leader to ensure timely and consistent responses to events such as price changes or supply and demand imbalances in the distributed system, while ensuring that the system can maintain consistency and high availability even in the event of network partitions or node failures. This is an extremely critical feature for power systems with high real-time requirements and high reliability. Therefore, the Raft consensus algorithm, with its intuitive design, efficient election mechanism and strong fault tolerance, has become an ideal choice for maintaining decision consistency and system stability among DERs microservices.

[0093] Furthermore, the output of the supply-demand balance optimization expression is used as input, and a scheduling strategy is generated using mathematical programming. The performance of the strategy in different scenarios is evaluated to ensure the robustness and effectiveness of the strategy. The scheduling strategy is then sent to the distributed energy resource DERs microservice to guide it to adjust its operation mode. The output of this step is a real-time updated scheduling strategy and continuously improved system performance, ultimately achieving efficient and economical operation of the distributed energy resource DERs system. Collect the actual response of distributed energy resources DERs, compare it with the expected response, and adjust the strategy until the optimal balance is achieved; It should be noted that "collecting the actual response of distributed energy resources DERs, comparing it with the expected response, and adjusting the strategy until the optimal balance is achieved" is a key part of the optimization scheduling strategy, which is used to ensure that the behavior of DERs (distributed energy resources) meets the established goals, such as supply and demand balance, cost minimization, etc. The following is a set of specific steps to achieve this process: S4.1. First, the operating status and performance indicators of DERs need to be monitored in real time. This includes but is not limited to the charging status, discharging status, actual power output, environmental conditions (such as light intensity, temperature), and any external factors that may affect the behavior of DERs. These data should be automatically collected through sensors and smart metering devices and sent to the central management system through the network.

[0094] S4.2. Clean, preprocess and analyze the collected raw data to convert it into effective information that can be used for comparison and decision-making. For example, compare the actual power output of DERs with the expected output in the scheduling strategy to evaluate whether DERs are performing as planned.

[0095] S4.3 This may include differences in power output, delays in response speed, or failure to achieve expected cost efficiencies.

[0096] S4.4. Further analyze the causes of the deviation. Possible causes include limitations of DERs themselves, changes in the external environment, inaccurate prediction models, or deficiencies in scheduling strategies. This step helps to adjust strategies in a targeted manner rather than blindly correcting deviations.

[0097] S4.5. Adjust the dispatch strategy based on the results of deviation analysis and cause diagnosis. This may involve modifying the working mode of DERs, updating the prediction model, adjusting the cost weight factor λ, or optimizing the coordination mechanism between DERs.

[0098] S4.6, re-issue the adjusted strategy to DERs and monitor their new responses. This stage also requires collecting data to verify whether the adjusted strategy is effective, that is, whether it is closer to or achieves the expected goal.

[0099] Optimization is an ongoing process that requires continuous monitoring, analysis, adjustment, and verification. Therefore, steps S4.1 to S4.6 form a closed loop, and each cycle aims to gradually improve the scheduling strategy until the optimal balance is reached.

[0100] S5. Combine the charging and discharging strategy and optimization scheduling strategy of the power electronic converter to continuously collect system status snapshot data.

[0101] Furthermore, the deep reinforcement learning strategy is defined as a decision rule to prescribe the charging and discharging behavior of the power electronic converter under different system states; The supply-demand balancing algorithm is defined as the adjustment rule for electricity demand and supply; Integrate the real-time evaluation results of decision rules and adjustment rules to build a decision framework to ensure that the framework has the ability to handle immediate needs and long-term goals; Preferably, the decision-making framework needs to be able to comprehensively consider long-term interests (deep reinforcement learning strategies) and immediate needs (supply and demand balancing algorithms).

[0102] According to the current system status and target priority, the decision framework assigns weights to decisions and adjustment rules; for example, during peak hours, the focus is on supply and demand balance, while during non-peak hours, the focus is on deep learning strategies; It should be noted that this weight distribution can be dynamically adjusted according to pre-set rules or determined by another optimization algorithm (such as fuzzy logic or genetic algorithm); Combined with the weighted rule output, specific control instructions are generated, such as adjusting the PWM frequency of the power electronic converter, controlling the battery charge and discharge current, etc. It should be noted that the control instructions should take into account the physical limitations and safety margins of the power electronic equipment; Send control instructions to corresponding power electronic equipment for execution, and output the real-time response status of the power electronic equipment; Leverage existing sensor networks to deploy additional sensors to monitor the status of power electronic converters and collect key power data; Preferably, key power data: including key parameters such as voltage, current, power conversion efficiency, etc.; Combine newly collected critical power data with status data, environmental data, and forecast data to form a comprehensive system status snapshot.

[0103] It should be noted that combining the charging and discharging strategies of power electronic converters with the optimization scheduling strategy and continuously collecting snapshot data of system status can significantly improve the efficiency and stability of distributed energy resources (DERs) systems. Its beneficial effects are reflected in the following aspects: First, by real-time monitoring and analysis of the operating status of DERs, the system can quickly identify potential imbalances or inefficiencies, and then adjust the charging and discharging strategies of power electronic converters in a timely manner to ensure the accuracy of DERs in responding to market signals and system requirements. Secondly, the dynamic adjustment of the optimization scheduling strategy, based on the collected snapshot data, can more accurately predict and respond to changes in supply and demand, promote supply and demand balance, reduce operating costs, and improve the flexibility and resilience of the entire power system. Finally, continuous data collection provides rich empirical evidence for strategy optimization. Through advanced technologies such as machine learning, the system can self-learn and evolve, continuously improve the intelligence level of decision-making, and ultimately achieve efficient configuration and sustainable operation of DERs resources. This closed-loop feedback mechanism is the key to realizing the vision of smart grids, and it will help the power industry move towards a greener, smarter and more efficient future.

[0104] S6. Monitor the system status snapshot data in real time. If significant changes that are inconsistent with the prediction are detected, re-evaluate the supply and demand balance and adjust the working mode of the power electronic converter.

[0105] Furthermore, real-time data stream processing frameworks (such as Apache Kafka Streams or Apache Flink) are used to aggregate the system status snapshot data collected by the sensor network in real time to form a unified data stream; Preferably, the real-time data stream processing framework can quickly process a large amount of continuously arriving data to ensure the system's responsiveness to the latest data, which is crucial for real-time monitoring.

[0106] De-noising, anomaly detection and standardization of aggregated data can eliminate invalid or erroneous data and ensure data quality; Apply statistical process control (SPC) charts, such as X-bar and R charts, to monitor statistical characteristics in the data stream and identify points that are outside the control limits; this usually indicates a significant change in system status; It should be noted that the application of statistical process control (SPC) charts, especially mean-range charts (X-bar and Rchart), is a commonly used quality control and process monitoring method for monitoring statistical characteristics in data streams to identify points that exceed control limits. The following are specific implementation steps: Sample groups are drawn regularly from the data stream. Each sample group usually contains the same number of observations (for example, 5 or 10 data points). These observations should be collected under the same conditions to reflect the instantaneous state of the process. All observations for each sample group are recorded at the same time. Average the observations in each sample group, find the maximum and minimum values ​​in each sample group, and then calculate the difference between them; Average the means and ranges of all sample groups; Calculate the upper control limit (UCL) and lower control limit (LCL). For the X-bar chart, the control limit expression is: UCL=overall mean+A2*average range; LCL = overall mean - A2 * average range; Where A2 is a constant that depends on the size of the sample group and can be found in the SPC chart constant table; For the R chart, the control limit calculation expression is: UCL_R=D4*average range; LCL_R=D3*average range; Among them, D4 and D3 are also constants found in the SPC chart constant table; Mark the sample group numbers on the horizontal axis, plot the mean of each sample group on the vertical axis, draw the center line (overall mean) and the upper and lower control limits; On another graph, plot the range for each sample group, and also draw the center line (average range) and upper control limit; Check whether the points on the X-bar chart and R chart fall within the control limits. If the points fall outside the control limits or show non-random patterns (such as trends, periodicity, systematic shifts, etc.), it indicates that the process may be out of control or there is special cause variation; Conduct in-depth analysis of points that exceed control limits or exhibit non-random patterns, determine the causes, and take corrective actions; Based on the analysis results, make necessary adjustments to the process to eliminate special cause variation and restore process stability; Even after the process is adjusted to a state of control, the SPC chart should be continuously monitored to ensure process stability and continuous improvement.

[0107] Preferably, through the SPC chart, abnormal changes in system status can be discovered early, which helps to take measures in advance to avoid potential failures. At the same time, SPC helps to maintain the stability of the process and ensure that the production or operation process is under control.

[0108] Furthermore, the detected points that exceed the control limits are fed back to the edge computing device to trigger the re-evaluation process; It should be noted that in the energy management of photovoltaic energy storage systems, the triggering of the reassessment process is usually closely related to the dynamic characteristics of the system and changes in the external environment. When the system detects a point beyond the control limit, it usually means that the system state has changed significantly from the expected or predicted state, which may affect the stability and efficiency of the system. The following are several specific situations that may trigger the reassessment process: Changes in environmental conditions: Sudden changes in weather, such as dramatic changes in light intensity and temperature, can affect the power generation efficiency of photovoltaic modules and the working status of energy storage systems, necessitating a reassessment of energy management and scheduling strategies.

[0109] Load demand fluctuations: If there are unexpected large fluctuations in load demand on the grid, such as a sudden increase or decrease in industrial activity, or a sudden change in electricity consumption habits in residential areas, this may require the system to immediately adjust the charging and discharging strategies and scheduling plans.

[0110] Market price fluctuations: Changes in real-time electricity prices, especially when there are large fluctuations in market prices, require the system to respond quickly to optimize costs and benefits.

[0111] Equipment failure or performance degradation: If the performance of power electronic converters or other critical equipment is monitored to be below normal levels, or if a failure occurs, the system needs to be re-evaluated to avoid further losses or safety risks.

[0112] Energy storage state changes: If the battery's SOC (State of Charge) reaches the warning limit, whether it is too high or too low, the charge and discharge strategy needs to be re-evaluated to protect the battery and optimize its use.

[0113] Market Trading Opportunities: When new trading opportunities emerge in the market, such as changes in the price of renewable energy certificates (RECs) or carbon credits, the system may need to re-evaluate its strategy for participating in the market.

[0114] System safety considerations: If the system detects any anomalies that may affect safety, such as overheating, overvoltage, or short circuit risks, it must be immediately reassessed and necessary preventive measures must be taken.

[0115] When any of the above situations are detected, the system will automatically trigger a reassessment process, which may include the following steps: Data collection and analysis: Collect the latest system status data, including environmental data, equipment status, market prices, etc., and analyze this data to determine the current system status.

[0116] Model updating: Based on the latest data, the forecast model is updated, such as adjusting the parameters of the machine learning model to more accurately predict future demand and supply.

[0117] Strategy optimization: Based on the updated model, recalculate the optimal charging and discharging strategy and scheduling plan to adapt to the current system conditions and market environment.

[0118] Control instruction generation and execution: Generate new control instructions, adjust the operating mode of power electronic converters, update the scheduling strategy of distributed energy resources, and monitor the impact of these changes on system performance.

[0119] Performance evaluation and feedback: Evaluate the effectiveness of the new strategy, compare it with the expected goals, and if necessary, further adjust the strategy until the system returns to optimal operation.

[0120] Preferably, edge computing devices are located close to data sources and can process and respond to data quickly, reducing latency. Once an anomaly is detected, a reassessment process is immediately initiated to ensure that the system can adjust its strategy in a timely manner.

[0121] Update the decision rules of the deep reinforcement learning agent, retrain the agent to adapt to the current system conditions through the new supply and demand balance state and system snapshot data; Generate new control instructions based on the updated decision rules to adjust the charging and discharging strategy of the power electronic converter; Execute control instructions and monitor the response status of the power electronic converter to ensure that the instructions are executed and the system status is stable; Implement a closed-loop control mechanism to continuously monitor the performance of the power electronic converter and the system status; ensuring that any subsequent significant changes can be captured and processed in a timely manner; It should be noted that real-time monitoring of system status snapshot data, combined with real-time data stream processing frameworks such as Apache Kafka Streams or Apache Flink, enables instant insight and agile response to the operating status of power electronic converters. This mechanism improves data quality and ensures the reliability of decision-making through efficient aggregation, denoising and standardization. The application of SPC chart monitoring statistical characteristics can detect system status anomalies at an early stage and trigger the rapid re-evaluation process of edge computing devices, thereby accelerating strategy adjustment. By updating the deep reinforcement learning model, the system can flexibly change the working mode of the power electronic converter according to the latest supply and demand balance status, enhancing the adaptability and robustness of the system. The implementation of the closed-loop control mechanism ensures continuous monitoring and timely correction, maintains the stable operation of the system in complex environments, and significantly improves the intelligence level and economic benefits of power management.

[0122] This embodiment also provides a computer device, which is suitable for the energy management method of a photovoltaic energy storage system, including: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to implement the energy management method of the photovoltaic energy storage system proposed in the above embodiment.

[0123] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0124] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the energy management method for a photovoltaic energy storage system proposed in the above embodiment is implemented; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, SRAM for short), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM for short), erasable programmable read-only memory (Erasable Programmable Read Only Memory, EPROM for short), programmable read-only memory (Programmable Red-Only Memory, PROM for short), read-only memory (Read-Only Memory, ROM for short), magnetic storage, flash memory, magnetic disk or optical disk.

[0125] In summary, the present invention activates IoT sensors to acquire and pre-process the operating status and environmental data of photovoltaic components in real time, ensuring data quality and laying a solid foundation for subsequent analysis; using lightweight machine learning and deep reinforcement learning technology, it can accurately predict the behavior of photovoltaic systems and dynamically adjust the working mode of power electronic converters, greatly improving energy utilization efficiency and system response speed; using the combination of adaptive supply and demand balance algorithms and microservice architectures, it realizes the flexible scheduling of distributed energy resources and enhances the economy and stability of the system. In summary, the present invention effectively solves the problems of slow response speed, weak prediction ability and inflexible scheduling of existing technologies in complex supply and demand environments, and provides a more advanced and intelligent management solution for photovoltaic energy storage systems.

[0126] Example 2, referring to Table 1, is the second example of the present invention. To further verify the advancement of the present invention, experimental simulation data of the energy management method of the photovoltaic energy storage system is provided.

[0127] The energy management method of the present invention was implemented in a large-scale photovoltaic energy storage power station located in North China. The power station has about 50MW of photovoltaic panels, equipped with an advanced battery energy storage system and a series of IoT sensors. The test was carried out in the summer for 25 days to fully test the performance of the system under high light and high load conditions.

[0128] First, a high-performance sensor network including temperature sensors, humidity sensors, radiometers, anemometers, and equipment with integrated weather station functions were deployed to form a network covering the PV module area. A performance monitoring sensor network was used to capture the operating status and environmental parameters of the PV modules in real time, and converted them into JSON format to create data packets. The moving average method was applied to the measured values ​​in the data packets on the edge computing devices to identify abnormal data points that deviated from the normal range and marked them in the data packets. The marked data packets were verified to complete the preliminary processing of the data.

[0129] Secondly, edge computing devices use lightweight machine learning models to analyze operating status and environmental demand data in real time to generate prediction data; multi-scale wavelet transform is applied for feature extraction, combined with polynomial regression and exponential smoothing to build a real-time prediction model.

[0130] Next, based on the prediction data of the edge computing device, a deep reinforcement learning algorithm is used to train the intelligent agent, learn the optimal energy management strategy, and dynamically adjust the charging and discharging strategy of the power electronic converter. Through continuous learning, the intelligent agent adjusts the charging and discharging strategy in real time according to the system status and prediction results to achieve efficient energy utilization and cost savings.

[0131] Furthermore, the microservice architecture is used to flexibly dispatch distributed energy resources within the microgrid and generate optimized dispatching strategies; distributed energy resource microservices exchange data through RESTful APIs, and use message queues to transmit supply and demand signals to ensure rapid response and efficient collaboration.

[0132] Finally, the charging and discharging strategy and optimization scheduling strategy of the power electronic converter are combined to continuously collect system status snapshot data. By utilizing the existing sensor network, additional sensors for monitoring the status of the power electronic converter are deployed to collect key power data and form comprehensive system status snapshot data. The system status snapshot data is monitored in real time. If significant changes that are inconsistent with the prediction are detected, the supply and demand balance is re-evaluated and the power electronic converter working mode is adjusted. A closed-loop control mechanism is implemented to continuously monitor the performance of the power electronic converter and the system status.

[0133] The details are shown in Table 1 below: Table 1 Experimental record table date Light intensity (W / m²) Ambient temperature (°C) Predicted power consumption (kWh) Actual power consumption (kWh) Power deviation(%) System efficiency (%) Cost savings ($) 2024 / 8 / 5 1000 30 4500 4480 0.44 82.5 320 2024 / 8 / 10 1100 32 5000 4975 0.5 83 350 2024 / 8 / 15 950 29 4200 4180 0.48 82 310 2024 / 8 / 20 1050 31 4700 4675 0.53 82.8 330 2024 / 8 / 25 980 30 4300 4270 0.65 82.3 325 During the 25-day experiment, the energy management method of the photovoltaic energy storage system showed significant advantages, especially in terms of power prediction accuracy, system efficiency and cost savings. During the experiment, the system efficiency reached an average of 82.5%, at least 3 percentage points higher than the traditional method. This is mainly due to the intelligent agent learning optimal energy management strategy of deep reinforcement learning technology and the precise scheduling of the adaptive supply and demand balance algorithm; by optimizing the scheduling strategy, the monthly cost savings reached 325-325-350, compared with the average monthly savings of 200-200-250 of the traditional method, the cost saving ability of the present invention has increased by at least 30%.

[0134] In summary, these data clearly demonstrate the innovativeness and practicality of the energy management method of photovoltaic energy storage systems. It not only improves prediction accuracy and system efficiency, but also significantly reduces operating costs, which plays an important role in promoting the sustainable development of the photovoltaic energy storage industry.

[0135] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. An energy management method for a photovoltaic energy storage system, characterized in that: include, Collect the operating status and environmental demand data of photovoltaic modules in real time, and transmit the data to edge computing devices for preliminary processing; Edge computing devices use lightweight machine learning models to analyze operating status and environmental demand data in real time and generate predictive data; Based on the prediction data of edge computing devices, the deep reinforcement learning algorithm is used to train the intelligent agent, learn the optimal energy management strategy, and dynamically adjust the charging and discharging strategy of the power electronic converter; Through the adaptive supply and demand balancing algorithm, the distributed energy resources in the microgrid are flexibly dispatched using the microservice architecture to generate an optimized dispatching strategy; Combine the charging and discharging strategy of the power electronic converter with the optimization scheduling strategy to continuously collect snapshot data of the system status; Monitor the system status snapshot data in real time. If changes that are inconsistent with the forecast are detected, re-evaluate the supply and demand balance and adjust the power electronic converter working mode. The specific steps of generating prediction data are as follows: Receive the data packets of photovoltaic module operation status and environmental requirements collected and preliminarily processed by IoT sensors, and perform data cleaning; For the cleaned data packets, multi-scale wavelet transform is applied to extract features and output the operation status and environmental demand data; Based on the operating status and environmental demand data extracted from the features, the real-time prediction expression is constructed through polynomial regression and exponential smoothing: ; Among them, P t represents the predicted value at time point t, β0 is the intercept term, β i and γ i are the coefficient and polynomial order of the i-th feature, respectively. is the i-th eigenvalue, E t-1 is the error term of the previous moment, α is the smoothing factor, To control the decay rate of exponential smoothing, n is the number of polynomial features and e is the base of the natural logarithm.

2. The energy management method of the photovoltaic energy storage system according to claim 1, characterized in that: The real-time collection of the operating status and environmental demand data of the photovoltaic components and the transmission of the data to the edge computing device for preliminary processing are as follows: Deploy a comprehensive network of environmental and performance monitoring sensors, as well as equipment with integrated weather station functions, to form a network covering the PV panel area; Use the performance monitoring sensor network to capture the operating status and environmental parameters of the PV panels in real time, convert them into JSON format, and create data packets; Apply a moving average method to the measurements in the data packet on the edge computing device to identify abnormal data points that deviate from the normal range and mark them in the data packet; Verify the marked data packets and complete the preliminary processing of the data.

3. The energy management method of the photovoltaic energy storage system according to claim 2, characterized in that: The moving average method is applied to the measured values ​​in the data packet on the edge computing device to identify abnormal data points that deviate from the normal range and mark them in the data packet. The specific steps are as follows: The edge computing device receives data packets from the sensor network and unpacks the received JSON format data packets to extract metadata and payload data; Parse the measurement value of each metadata and payload data point, set the moving average window size N, and calculate the moving average of each measurement value. The expression is: ; in, represents the moving average at time point t, represents the i-th measurement value, i is the index variable; The standard deviation SD expression based on the moving average at time point t is: ; Combining the moving average value at time point t and the corresponding standard deviation SD, the standard deviation multiple threshold Td expression is defined as: ; Where k is the selected standard deviation multiple; Compare each measured value with the threshold Td. If the measured value exceeds the threshold Td, it is marked as an outlier. In the original data packet, the identified outliers are marked.

4. The energy management method of the photovoltaic energy storage system according to claim 3, characterized in that: The specific steps of dynamically adjusting the charging and discharging strategy of the power electronic converter are as follows: Add the predicted value P to the original state representation S t , the expression of the extended state S′ is generated as: ; Based on the extended state S′, the agent learning framework is defined and the comprehensive evaluation function F is established as follows: ; in, represents the energy efficiency at time point t, C(S′, A) is the economic cost C of taking any action A under the extended state S′, T is the starting time, Δt is the time interval of integration, dt is the time differential element, and w is the adjusted prediction value P t The weight coefficient of relative importance in the comprehensive evaluation function F; Combine the comprehensive evaluation function F with the immediate reward R to generate the adjusted immediate reward R adj The expression is: ; Based on the immediate reward R adj , combined with the deep Q network to train the agent, in each learning iteration, the agent updates the Q value, and the update expression is: ; in, It represents the update amount of Q value after executing action a in the current state s, a′ represents the possible action to be taken in the next state s′, α is the learning rate, γ is the discount factor, and θ represents the parameters of the main network. are the parameters of the target network.

5. The energy management method of the photovoltaic energy storage system according to claim 4, characterized in that: The specific steps of generating the optimized scheduling strategy are as follows: Define standardized interfaces for distributed energy resources and build them into microservices with independent business logic; Use Docker containers to encapsulate microservices, and manage and schedule containerized microservices through Kubernetes clusters; The charging and discharging strategy of the converter is integrated with the dynamic balance algorithm of the market mechanism, and the distributed energy resources are encouraged to actively participate in the supply and demand regulation through the real-time electricity price strategy, and the supply and demand balance optimization expression is generated as follows: ; Among them, P sy,i is the total power supplied at the i-th time point, P dd,i is the total power demand at time i, P DER is the power output vector of distributed energy resources, C DER,i is the operating cost of distributed energy resources at the i-th time point, λ is the cost weight factor; Distributed energy resource microservices exchange data through RESTful APIs and use message queues to transmit supply and demand signals; In the distributed energy resource microservice, the Raft consensus algorithm is integrated for event monitoring; The output of the supply-demand balance optimization expression is used as input, and a scheduling strategy is generated using mathematical programming. The scheduling strategy is then sent to the distributed energy resource microservice to guide it to adjust its operation mode. Collect the actual response of distributed energy resources, compare it with the expected response, and adjust the strategy until the optimal balance is achieved.

6. The energy management method of the photovoltaic energy storage system according to claim 5, characterized in that: The charging and discharging strategy and the optimization scheduling strategy of the power electronic converter are combined to continuously collect system status data. The specific steps are as follows: Define deep reinforcement learning policies as decision rules; The supply-demand balancing algorithm is defined as the adjustment rule for electricity demand and supply; Integrate the real-time evaluation results of decision rules and adjustment rules to build a decision framework; Assign weights to decisions and adjustment rules through a decision framework based on the current system state and target priorities; Combine the weighted rule outputs to generate specific control instructions; Send control instructions to corresponding power electronic equipment for execution, and output the real-time response status of the power electronic equipment; Leverage existing sensor networks to deploy additional sensors to monitor the status of power electronic converters and collect key power data; Combine newly collected critical power data with status data, environmental data, and forecast data to form a comprehensive system status snapshot.

7. The energy management method of the photovoltaic energy storage system according to claim 6, characterized in that: The system status snapshot data is monitored in real time. If a significant change that is inconsistent with the prediction is detected, the supply and demand balance state is re-evaluated and the working mode of the power electronic converter is adjusted. The specific steps are: The real-time data stream processing framework is used to aggregate the system status snapshot data collected by the sensor network in real time to form a unified data stream; Perform denoising, anomaly detection and standardization on the aggregated data; Apply statistical process control charts to monitor statistical characteristics in data streams and identify points outside control limits; Feedback detected points beyond control limits to edge computing devices to trigger a reassessment process; Update the decision rules of the deep reinforcement learning agent and retrain the agent based on the new supply and demand balance state and system snapshot data; Generate new control instructions based on the updated decision rules to adjust the charging and discharging strategy of the power electronic converter; Execute control instructions and monitor the response status of power electronic converters; Implement a closed-loop control mechanism to continuously monitor the performance of the power electronic converter and the system status.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the energy management method for the photovoltaic energy storage system described in any one of claims 1 to 7 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the energy management method for a photovoltaic energy storage system according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • One-pile multi-connection electric vehicle ordered charging method based on deep reinforcement learning

    CN116001624A

  • Wind turbine generator vibration monitoring and fault diagnosis method

    CN118327909A

  • Flexible light-storage integrated intelligent energy management method and system

    CN118432124A

  • Microgrid energy storage optimization scheduling system and method based on artificial intelligence

    CN118432125A

  • Control method of photovoltaic energy storage system

    CN118899954A

Cited By

  • Photovoltaic module intelligent control method based on TinyML

    CN119945312A

  • Community microgrid scheduling method considering photovoltaic energy storage

    CN119994897A

  • Energy efficiency prediction analysis platform based on artificial intelligence

    CN120046791A

  • Cooperative control method, system and equipment based on optical storage fusion system, and medium

    CN120073823A

  • Hybrid energy storage system optimization scheduling method based on AI intelligent regulation and control

    CN120150194A