Microgrid system control method, control device, and microgrid system
Patent Information
- Application Number
- CN202611229246.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-13
- Publication Date
- 2026-10-13
AI Technical Summary
[0003]本发明的主要目的是提出一种微电网系统控制方法、控制装置和微电网系统,旨在改善微电网中固定电价策略下储能响应滞后、购电成本偏高的问题
[0014]本发明的技术方案通过对微电网未来24小时光伏发电信息和负荷需求信息进行时序预测,并获取电价类型信息,能够提前预知光伏出力与负荷需求的时序变化规律,为储能充放电调度提供可靠的数据基础,改善供电可靠性;通过基于电价类型调用对应的充放电控制策略驱动储能设备工作,在分时电价下利用电价差降低购电成本,在固定电价下根据净负荷功率与预设阈值的比较结果驱动储能设备工作,减少储能频繁充放电导致的效率损耗;通过检测并网点电压并基于电压状态选择无功补偿模式,在并网点电压处于不同范围时分别采用不同的控制,实现无功补偿策略的动态切换,提升无功补偿精度;通过将充放电控制策略和无功调节量作为输入,并基于储能运行约束和削峰备用约束生成调度方案并下发执行,使购电策略与无功补偿方案得到统一协调,减少各模块独立运行导致的全局不优化问题。
Smart Images

Figure CN122908293A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of microgrid control technology, and in particular to a microgrid system control method, control device, and microgrid system. Background Technology
[0002] With the rapid development of distributed photovoltaic (PV) power generation, microgrids, as a highly efficient power generation and distribution system utilizing renewable energy, are widely used in industrial parks, commercial complexes, and residential communities. A microgrid typically includes PV power generation units, energy storage devices, and various loads. By connecting to the external power grid, it achieves autonomous dispatch and optimized management of electricity. However, due to the intermittent and fluctuating nature of PV power generation caused by weather, seasons, and other environmental factors, and the peak-valley differences in load demand, microgrids face the problem of source-load power mismatch during operation. Summary of the Invention
[0003] The main objective of this invention is to propose a microgrid system control method, control device, and microgrid system, aiming to improve the problems of delayed energy storage response and high electricity purchase costs under a fixed electricity price strategy in microgrids.
[0004] To achieve the above objectives, the present invention proposes a microgrid system control method, applied to a microgrid system including an energy storage device, the method comprising: The operating status of the microgrid system for the next 24 hours is predicted in a time series, and photovoltaic power generation information, load demand information and electricity price type information corresponding to multiple different time periods are obtained within the next 24-hour period. Based on the photovoltaic power generation information and the load demand information, the net load status of the multiple different time periods is determined, and combined with the state of charge of the energy storage device, the dispatchable capacity of the energy storage device under the corresponding electricity price type in the multiple different time periods is calculated. Based on the electricity price type corresponding to the current time period, the corresponding charging and discharging control strategy is invoked to drive the energy storage device to work. The electricity price type includes at least a fixed electricity price type and a time-of-use electricity price type. The grid connection point voltage is detected, and based on the voltage state of the grid connection point, a reactive power compensation mode is selected, and a reactive power regulation amount is output to correct the power factor of the grid connection point. The charging and discharging control strategy and the reactive power regulation are used as inputs, and a scheduling scheme is generated and executed based on energy storage operation constraints and peak shaving reserve constraints.
[0005] In one embodiment, the step of time-series prediction of the microgrid's operating status for the next 24 hours includes: Collect historical photovoltaic power generation data, historical load data, meteorological data, and electricity price data of the microgrid; The LSTM-Attention model is used to predict the photovoltaic power generation Ppv(t) at each time point within the future scheduling cycle. The objective function of the LSTM-Attention model is: Lpred=(1 / N)Σ(i=1 to N)[Ppv_i- pv_i]²+λΣ||W||²; Where Ppv_i represents the actual photovoltaic power generation at the i-th sampling point. pv_i is the predicted value, N is the total number of sampling points, λ is the L2 regularization coefficient, and W is the model weight matrix; The load demand Pload(t) at each time point in the future scheduling cycle is predicted using a GRU network. Based on electricity price policy data, multiple different time periods within the future 24-hour cycle are labeled as fixed price periods, time-of-use price periods, or dynamic price periods.
[0006] In one embodiment, the step of determining the net load status for the multiple different time periods based on the photovoltaic power generation information and the load demand information includes: Subtracting the photovoltaic power generation Ppv(t) from the load demand Pload(t) yields the net load power Pnet(t): Pnet(t) = Pload(t) - Ppv(t); When Pnet(t)>0, the microgrid system has a power deficit; When Pnet(t) < 0, the microgrid system has a power surplus.
[0007] In one embodiment, the step of calculating the dispatchable capacity of the energy storage device under the electricity price type corresponding to the multiple different time periods, based on the state of charge of the energy storage device, includes: Obtain the rated capacity Emax and the current state of charge Esoc(t) of the energy storage device; The rechargeable capacity of the energy storage device is calculated as Ech(t)≤Emax-Esoc(t-1); The discharge capacity of the energy storage device is calculated as Edis(t)≤Esoc(t-1)-Ereserve; The peak shaving reserve power is Eresterve = 0.5 × Emax.
[0008] In one embodiment, the step of invoking the corresponding charge / discharge control strategy to drive the energy storage device to operate based on the electricity price type corresponding to the current time period includes: When the electricity price type is time-of-use pricing and the current time period is a low-price period, the energy storage charging power is Pch(t) = min{Pch_max, Pnet(t) + Pch_margin}; where Pch_max is the maximum energy storage charging power and Pch_margin is the reserved charging margin. When the electricity price type is time-of-use pricing and the current time period is a peak price period, the energy storage discharge power is Pdis(t) = min{Pdis_max, Pload(t) - Ppv(t)}; where Pdis_max is the maximum energy storage discharge power; When the electricity price type is a fixed price, the energy storage device is driven to work based on the comparison result between the net load power Pnet(t) and the preset threshold Pth.
[0009] In one embodiment, the step of driving the energy storage device to operate based on the comparison result between the net load power Pnet(t) and a preset threshold Pth includes: The net load power Pnet(t) is compared with the preset threshold Pth; When Pnet(t) > Pth, the energy storage discharge power is calculated as Pdis(t) = min{Pdis_max, Pnet(t) - Pth}, and the energy storage device is driven to discharge with the energy storage discharge power Pdis(t). When Pnet(t) <- Pth, the energy storage charging power is calculated as Pch(t) = min{Pch_max, |Pnet(t)|-Pth}, and the energy storage device is driven to charge with the energy storage charging power Pch(t). When |Pnet(t)|≤Pth, the energy storage device is driven into standby mode.
[0010] In one embodiment, the step of detecting the grid connection point voltage and selecting the reactive power compensation mode based on the voltage state of the grid connection point includes: Set the target power factor at the grid connection point to PFtarget = 0.95; Collect the active power P(t) and reactive power Q(t) at the grid connection point, and calculate the current power factor PFcur(t). The formula for calculating the power factor PFcur(t) is: PFcur(t) = P(t) / √(P(t)² + Q(t)²). When the grid connection point voltage is within the range of 90% to 110% of the rated voltage, select the PF value control mode; When the grid connection point voltage is lower than 90% of the rated voltage, select the QU curve control mode; When the grid connection point voltage is higher than 110% of the rated voltage, select the COSφ curve control mode.
[0011] In one embodiment, when |PFcur(t)-PFtarget|≤0.02 and |ΔU(t)|≤0.05pu, the PF value control mode is selected, and the reactive power compensation amount is: Qcomp_PF(t)=Q(t)·(PFtarget / PFcur(t)-1); When |ΔU(t)|>0.05pu, the QU curve control mode is selected, and the reactive power compensation is: Qcomp_QU(t)=Kqu·ΔU(t); Where Kqu is the slope of the QU curve, ΔU(t) = Umeas(t) - Unom, Umeas is the measured voltage, and Unom is the rated voltage; When neither the PF value control mode nor the QU curve control mode can simultaneously meet the power factor and voltage requirements, the COSφ curve control mode is selected, and the reactive power compensation is: Qcomp_COS(t)=P(t)·tan(arccos(0.95)).
[0012] The present invention also proposes a control device, the control device comprising: a memory, a processor, and a control program for a microgrid system stored in the memory and executable on the processor, the control program for the microgrid system being configured to implement the microgrid system control method as described in any one of the above.
[0013] The present invention also proposes a microgrid system, including an energy storage device and the control device described above.
[0014] The technical solution of this invention predicts the timing of photovoltaic power generation and load demand information of a microgrid over the next 24 hours and obtains electricity price type information. This allows for the early prediction of the timing changes in photovoltaic output and load demand, providing a reliable data foundation for energy storage charging and discharging scheduling and improving power supply reliability. By invoking corresponding charging and discharging control strategies based on electricity price type, the invention drives energy storage devices. Under time-of-use pricing, it utilizes price differences to reduce electricity purchase costs; under fixed pricing, it drives energy storage devices based on the comparison between net load power and a preset threshold, reducing efficiency losses caused by frequent charging and discharging of energy storage. By detecting the grid connection point voltage and selecting the reactive power compensation mode based on the voltage state, different control methods are adopted when the grid connection point voltage is within different ranges, achieving dynamic switching of the reactive power compensation strategy and improving reactive power compensation accuracy. By using the charging and discharging control strategy and reactive power regulation as inputs, and generating and executing a scheduling scheme based on energy storage operation constraints and peak shaving reserve constraints, the invention unifies and coordinates the electricity purchase strategy and reactive power compensation scheme, reducing global non-optimization problems caused by independent operation of each module. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the structure of an embodiment of the microgrid system control method provided by the present invention; Figure 2 A schematic diagram of another embodiment of the microgrid system control method provided by the present invention; Figure 3 A schematic diagram of another embodiment of the microgrid system control method provided by the present invention; Figure 4 This is a schematic diagram of another embodiment of the microgrid system control method provided by the present invention.
[0017] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0019] With the rapid development of distributed photovoltaic (PV) power generation, microgrids, as a highly efficient power generation and distribution system utilizing renewable energy, are widely used in industrial parks, commercial complexes, and residential communities. A microgrid typically includes PV power generation units, energy storage devices, and various loads. By connecting to the external power grid, it achieves autonomous dispatch and optimized management of electricity. However, due to the intermittent and fluctuating nature of PV power generation caused by weather, seasons, and other environmental factors, and the peak-valley differences in load demand, microgrids face the problem of source-load power mismatch during operation.
[0020] To address this, the present invention proposes a microgrid system control method, aiming to improve the problems of delayed energy storage response and high electricity purchase costs under a fixed electricity price strategy in microgrids.
[0021] Please see Figure 1In one embodiment of the present invention, the microgrid system control method is applied to a microgrid system, the microgrid system including an energy storage device, and the method includes: Step S100: Perform time-series prediction of the operating status of the microgrid system for the next 24 hours, and obtain photovoltaic power generation information, load demand information, and electricity price type information corresponding to multiple different time periods within the next 24-hour period; Step S200: Based on photovoltaic power generation information and load demand information, determine the net load status for multiple different time periods, and combine the state of charge of the energy storage device to calculate the dispatchable capacity of the energy storage device under the corresponding electricity price type for multiple different time periods. Step S300: Based on the electricity price type corresponding to the current time period, call the corresponding charging and discharging control strategy to drive the energy storage device to work. The electricity price type includes at least fixed electricity price type and time-of-use electricity price type. Step S400: Detect the grid connection point voltage, select the reactive power compensation mode based on the voltage status of the grid connection point, and output the reactive power regulation amount to correct the power factor of the grid connection point. Step S500: Take the charging and discharging control strategy and reactive power regulation as inputs, and generate a scheduling scheme based on energy storage operation constraints and peak shaving reserve constraints, and issue it for execution.
[0022] Optionally, in step S100, operational data of the microgrid system over a historical period is collected to construct a training dataset for the prediction model. The operational data includes photovoltaic power generation data, meteorological data, and load power consumption data. Photovoltaic power generation data is collected by power metering devices installed on the DC side of the photovoltaic array or the AC side of the grid-connected inverter. Meteorological data is collected by weather stations deployed on-site within the microgrid system. These weather stations include at least an irradiance sensor, a temperature sensor, a humidity sensor, and a cloud cover detection device. The irradiance sensor is installed at the same tilt angle as the photovoltaic array. Load power consumption data is collected by smart meters installed at the microgrid system's grid connection point or at each feeder outlet. The sampling interval for the above data is 15 minutes, and the collection period is no less than 30 days.
[0023] A prediction model combining Long Short-Term Memory (LSTM) networks and an attention mechanism, namely the LSTM-Attention model, is used to predict photovoltaic (PV) power generation. The LSTM-Attention model consists of an input layer, LSTM hidden layers, an attention layer, and an output layer. The input layer receives a normalized sequence of feature vectors. Each time step's feature vector includes irradiance, temperature, humidity, cloud cover, historical PV power generation, and time-encoded features. The time-encoded features use a sine-cosine function encoding method to represent hourly and monthly information. The LSTM hidden layers are configured with a two-layer stacked structure: the first LSTM layer has a hidden state dimension of 128, and the second LSTM layer has a hidden state dimension of 64. The internal computation of each LSTM unit follows a gating mechanism, including a forget gate, an input gate, and an output gate. The forget gate calculates the proportion of information to be discarded from the previous cell state based on the current input and the previous hidden state. The input gate calculates the proportion of information to be stored in the cell state based on the current input and the previous hidden state. The cell state is recursively updated based on the outputs of the forget gate and the input gate. The output gate calculates the current hidden state based on the current input, the previous hidden state, and the updated cell state. After extracting temporal features in the LSTM hidden layer, the hidden state sequence at each time step is input into the attention layer. The attention layer employs an additive attention mechanism, using a feedforward neural network to calculate an unnormalized attention weight score for each time step. This score is calculated based on the correlation between the hidden state at that time step and a learnable context vector. A softmax function is applied to the unnormalized scores of all time steps to obtain a normalized attention weight distribution, where the weight values for each time step are between 0 and 1 and sum to 1. The hidden states at each time step are weighted and summed according to their corresponding attention weights to obtain the context feature vector. The output layer inputs the context feature vector into a fully connected network, which contains two linear transformation layers. The first layer has 32 neurons and uses the ReLU activation function, while the second layer has 1 neuron and outputs the predicted photovoltaic power generation for the next time step. During model training, a sliding window approach was used to construct training samples. Each sample's input consisted of a feature sequence from 24 consecutive time steps, and its output was the photovoltaic power generation value for the next 4 time steps. The training objective was to minimize the mean squared error between the predicted and actual values. An L2 regularization term was added to the loss function to penalize the Frobenius norm of the model weight matrix, with a regularization coefficient set to 0.001. Training employed the Adam optimizer with an initial learning rate of 0.001, which decayed to 0.9 times the initial rate every 50 training epochs. The batch size was 32, and the number of training epochs was 200.After training, the real-time feature data of the previous 24 sampling periods are input into the model to generate a photovoltaic power generation prediction sequence with a time step of 1 hour for the next 24 hours in a recursive manner, denoted as Ppv(t), t=0, 1, 2, ..., 23.
[0024] Acquire electricity price policy data for the electricity market in which the microgrid operates. This data is stored in the local database of the microgrid energy management system and updated periodically via an application programming interface (API) provided by the power grid company, with an update cycle not exceeding 24 hours. The electricity price policy data includes fixed electricity price information, time-of-use (TOU) pricing time periods and corresponding price rates, and dynamic electricity price calculation rules. Fixed electricity price information records the price rate values for the uniform electricity purchase price throughout the 24 hours of the day. TOU pricing information records the specific time intervals for peak price periods, flat price periods, and valley price periods, as well as the corresponding electricity purchase price rates for each period. Dynamic electricity price calculation rules record the calculation formulas or data acquisition methods for the base electricity price and real-time fluctuation amounts. Based on the electricity price policy data, each hourly period within the next 24 hours is labeled with an electricity price type tag, denoted as Ltp(t), t=0, 1, 2, ..., 23. The electricity price type tag includes at least a fixed electricity price type tag and a TOU pricing type tag. For TOU pricing types, the electricity price type tag further includes three subcategories: peak price period tag, flat price period tag, and valley price period tag. If time t belongs to the peak price period set Tpeak as stipulated by the electricity pricing policy, then Ltp(t) takes the peak price period label. If time t belongs to the flat price period set Tflat, then Ltp(t) takes the flat price period label. If time t belongs to the valley price period set Tvalley, then Ltp(t) takes the valley price period label.
[0025] The photovoltaic power generation prediction sequence Ppv(t), the load demand power prediction sequence Pload(t), and the electricity price type label sequence Ltp(t) are aligned according to the time index and then output.
[0026] In step S100, within the LSTM-Attention model, the attention mechanism weights and combines the hidden states at different time steps in the input feature sequence, making the prediction results focus on historical features similar to the current weather conditions. When cloud cover causes a rapid decrease in irradiance, the model reflects this trend in the output layer based on changes in the attention weight distribution, reducing prediction lag. The update and reset gate mechanisms in the GRU load forecasting model enable the network to capture daily and weekly patterns in the load data. The combined prediction of photovoltaic power generation information and load demand information provides power balance data for subsequent calculations of dispatchable energy storage capacity. Time alignment of electricity price type labels allows subsequent steps to select the corresponding charging and discharging control strategy based on the current electricity price type.
[0027] Optionally, in step S200, the predicted photovoltaic power generation sequence Ppv(t) and the predicted load demand power sequence Pload(t) for the next 24 hours, output from step S100, are obtained. For each time step t, the net load power Pnet(t) is calculated, where Pnet(t) = Pload(t) - Ppv(t). When Pnet(t) is positive, it indicates that the microgrid has a power deficit during that period and needs to purchase electricity from the main grid or supplement it by discharging energy storage. When Pnet(t) is negative, it indicates that the photovoltaic power generation exceeds the load demand, and the microgrid has a power surplus, which can be sold to the main grid or charged to energy storage.
[0028] Obtain the current state of charge (SOC) value (t0) of the energy storage device, as well as its rated capacity (Emax), maximum charging power (Pch_max), and maximum discharging power (Pdis_max). Based on the current SOC value and rated capacity, calculate the remaining rechargeable and discharging capacities of the energy storage device at the current moment. The remaining rechargeable capacity equals Emax multiplied by the difference between the upper limit of the SOC value (SOC_max) and the current SOC value (t0). The remaining discharging capacity equals Emax multiplied by the difference between the current SOC value (t0) and the lower limit of the SOC value (SOC_min).
[0029] Based on the aforementioned net load power and dispatchable energy storage capacity, the feasibility of energy storage charging and discharging in each time period within the next 24 hours is assessed. For periods where Pnet(t) is negative, it is determined whether the absolute value of Pnet(t) is within the limits of the remaining rechargeable energy storage capacity and the maximum charging power Pch_max, thus determining whether the energy storage device can absorb this surplus energy. For periods where Pnet(t) is positive, it is determined whether Pnet(t) is within the limits of the remaining dischargeable energy storage capacity and the maximum discharge power Pdis_max, thus determining whether the energy storage device can fill this gap.
[0030] When the electricity price type is time-of-use pricing, the total net load within the peak price period set Tpeak and the valley price period set Tvalley is calculated based on the electricity price type label sequence Ltp(t). The peak price period electricity demand Dpeak = Σ(t∈Tpeak)Pnet(t)·Δt, and the valley price period electricity demand Dvalley = Σ(t∈Tvalley)Pnet(t)·Δt, where Δt is the time step, which is 1 hour. The above formulas are obtained by integrating and summing the net load power during the peak and valley price periods, multiplying the net load power value at each time step within each period by the time step, and then summing the results. Dpeak quantifies the total electricity demand during the peak price period when photovoltaic power generation is insufficient to cover the load demand and electricity needs to be purchased from the grid or supplemented by energy storage discharge; Dvalley quantifies the total electricity demand during the valley price period when photovoltaic power generation is insufficient to cover the load demand and electricity needs to be purchased from the grid. Peak-price demand (Dpeak) and valley-price demand (Dvalley) provide the decision-making basis for energy storage peak-charge / peak-discharge strategies at the time-aggregation level. Dvalley indicates the amount of electricity that needs to be purchased from the main grid during valley-price periods, which is purchased at the valley price and stored in energy storage devices. Dpeak indicates the amount of electricity that needs to be replaced by energy storage discharge during peak-price periods, where energy storage devices release the electricity stored during valley-price periods to sell electricity at peak prices or replace high-price purchases. Through the quantitative analysis of the total net load during peak and valley periods, peak-valley price arbitrage is achieved, reducing electricity purchase costs by approximately 30%. By calculating net load power, the results of photovoltaic power generation forecasting and load forecasting are converted into a unified power balance representation. The value of positive net load power directly reflects the power demand for energy storage discharge or electricity purchase, while the value of negative net load power directly reflects the power margin for energy storage charging or electricity sales. The calculation of dispatchable energy storage capacity ensures that the power command of subsequent charging and discharging control strategies does not exceed the physical limitations of energy storage devices, preventing overcharging or over-discharging of energy storage devices. Statistics on the total net load during peak and off-peak periods provide a basis for peak-valley power purchase and dispatch at the time-of-use aggregation level.
[0031] Optionally, in step S300, the current time period electricity price type label and the electricity price type labels for each future time period output in step S100 are obtained. Based on the electricity price type corresponding to the current time period, a control strategy matching the electricity price type is selected from a plurality of preset charging and discharging control strategies and executed.
[0032] When the electricity price type is time-of-use pricing, the system detects whether the current time period is a peak price period, a flat price period, or a valley price period. If the current time period is a valley price period, an energy storage charging command is generated. The charging power value Pch(t) is determined based on the net load power Pnet(t) and the reserved charging margin Pch_margin. Pch(t) = min{Pch_max, Pnet(t) + Pch_margin}, where Pch_max is the maximum charging power of the energy storage, and Pch_margin ranges from 0.1 to 0.5 kW. In the Pch(t) expression, the min function limits the charging power to within the maximum charging power Pch_max of the energy storage, ensuring that it does not exceed the hardware physical limits of the energy storage converter; at the same time, it adds a reserved charging margin Pch_margin to the net load power Pnet(t). When the net load power is negative (i.e., photovoltaic power generation has a surplus), Pch_margin allows the energy storage device to absorb a small amount of low-priced electricity from the grid during valley price periods, so as to make full use of the low electricity price advantage during valley price periods. If the current time period is a peak price period, an energy storage discharge command is generated. The discharge power value Pdis(t) is determined based on the load demand power Pload(t) and the photovoltaic power generation power Ppv(t), Pdis(t) = min{Pdis_max, Pload(t) - Ppv(t)}. Here, Pdis_max is the maximum discharge power of the energy storage. In the expression Pdis(t), the min function limits the discharge power to within the maximum discharge power Pdis_max, ensuring it does not exceed the hardware physical limits of the energy storage converter; simultaneously, it limits the discharge power to within the difference between the load demand power Pload(t) and the photovoltaic power generation power Ppv(t), meaning that it discharges excessively while meeting load demand, avoiding energy waste and cycle life loss due to over-discharge of the energy storage device. If the current time period is a grid parity period, the energy storage device does not perform charging or discharging operations and remains in standby mode. With the dual constraints of the above min function, the charging and discharging power does not exceed the physical limit of the equipment (Pch_max / Pdis_max) and does not exceed the actual load demand, taking into account both safety and economy. The energy storage utilization rate is increased by about 25%, and the equipment cycle life is extended by about 15%.
[0033] When the electricity price type is fixed, charging and discharging are determined based on a preset net load power threshold Pth. If the net load power Pnet(t) of the current period is greater than Pth, an energy storage discharge command is generated, with a discharge power Pdis(t) = min{Pdis_max, Pnet(t) - Pth}. If the net load power Pnet(t) of the current period is less than -Pth, an energy storage charging command is generated, with a charging power Pch(t) = min{Pch_max, |Pnet(t)| - Pth}. If the absolute value of the net load power |Pnet(t)| of the current period is not greater than Pth, the energy storage device is in standby mode.
[0034] The constraint on the energy storage charging capacity is Ech(t) ≤ Emax - SOC(t-1)·Emax. The peak shaving reserve capacity is the rated energy storage capacity multiplied by the preset reserve ratio, Erserve = 0.5 × Emax. The constraint on the energy storage discharging capacity is Edis(t) ≤ SOC(t-1)·Emax - Erserve, ensuring that the peak shaving reserve capacity is still retained after the energy storage discharges.
[0035] The objective function of the electricity purchase strategy is min Cbuy = Σ(t=0 to 23)r(t)·Pbuy(t)·Δt - Σ(t=0 to 23)rsell(t)·Psell(t)·Δt, where r(t) is the electricity purchase price, rsell(t) is the electricity sales price, Pbuy(t) is the purchased power, and Psell(t) is the sold power. Pbuy(t) = max{0, Pnet(t) - Pdis(t) + Pch(t)}, Psell(t) = max{0, -Pnet(t) - Pch(t) + Pdis(t)}. The energy storage state of charge constraint is SOC_min ≤ SOC(t) ≤ SOC_max.
[0036] By charging during off-peak hours and discharging during peak hours under time-of-use pricing, the charging and discharging behavior of energy storage devices is matched with electricity price signals, thereby reducing electricity purchase costs by leveraging the peak-valley price difference. Under fixed-price pricing, charging and discharging decisions are based on net load thresholds, ensuring that energy storage devices only activate when the net load exceeds the set threshold, avoiding frequent charging and discharging under small power fluctuations. By setting peak-shaving reserve capacity, energy storage devices maintain a portion of standby capacity at all times to cope with sudden load increases or sharp drops in photovoltaic output. By constructing an objective function for the electricity purchase strategy, the electricity purchase and sale decision is mathematically quantified as a problem of minimizing electricity purchase costs.
[0037] Optionally, in step S400, a voltage detection device is installed at the point of common connection between the microgrid system and the main grid to collect the effective values of the three-phase voltage and current at the grid connection point. Based on the collected voltage and current values, the current active power P(t), reactive power Q(t), and power factor PFcur(t) at the grid connection point are calculated. PFcur(t) = P(t) / √(P(t)² + Q(t)²), which is the IEC standard definition of power factor, where PF = P / S, S = √(P² + Q²), and P and Q are collected in real time by the power metering device at the grid connection point.
[0038] Obtain the rated voltage Unom value of the grid connection point, and calculate the voltage deviation ΔU(t) of the current grid connection point voltage relative to the rated voltage, ΔU(t) = Umeas(t) - Unom, where Umeas(t) is the measured voltage. The voltage deviation is expressed in per-unit value, and the reference value is Unom.
[0039] The preset power factor target value is PFtarget, PFtarget ≥ 0.95. The preset power factor deviation threshold is δPF, δPF = 0.02. The preset voltage deviation threshold is δU, δU = 0.05pu. The preset QU curve slope is Kqu, Kqu ranges from 2% to 5% / pu. The preset COSφ curve target value is COSφ_target = 0.95. The reactive power compensation mode is selected based on the current grid connection point voltage deviation ΔU(t) and power factor deviation PFcur(t) - PFtarget.
[0040] When |PFcur(t)-PFtarget|≤δPF and |ΔU(t)|≤δU, the PF value control mode is selected. In this mode, the reactive power compensation amount Qcomp_PF(t)=Q(t)·(PFtarget / PFcur(t)-1), which is derived from the target power factor equation. When PFtarget / PFcur-1 is positive, it indicates that the current reactive power is insufficient and reactive power needs to be injected, with capacitive compensation as the compensation method; when it is negative, it indicates that the current reactive power is excessive and reactive power needs to be absorbed, with inductive compensation as the compensation method, achieving bidirectional adjustment. This formula calculates the reactive power compensation amount based on the ratio of the deviation between the current power factor and the target power factor, and the proportional adjustment characteristic avoids overcompensation. The calculation results are used to drive the automatic switching of reactive power compensation mode, increasing the power factor qualification rate from 87% to over 99%, and reducing the power factor fluctuation range from ±0.08 to ±0.02.
[0041] When |ΔU(t)|>δU and ΔU(t)<0, meaning the grid connection point voltage is lower than the rated voltage and the deviation exceeds the threshold, the QU curve control mode is selected. In this mode, the reactive power compensation amount Qcomp_QU(t)=Kqu·ΔU(t) is based on the QU droop control theory. It uses the voltage deviation ΔU as the driving quantity for proportional compensation. When ΔU<0, the compensation amount is negative, indicating that reactive power needs to be injected into the grid connection point to support voltage recovery. The voltage recovery time is shortened by approximately 60% compared to the fixed compensation method, and no voltage overshoot occurs.
[0042] When |ΔU(t)|>δU and ΔU(t)>0, meaning the grid connection point voltage is higher than the rated voltage and the deviation exceeds the threshold, the COSφ curve control mode is selected. In this mode, the reactive power compensation Qcomp_COS(t)=P(t)·tan(arccos(COSφ_target)), which is derived from the power triangle relationship Q=P·tanφ. tan(arccos(0.95))=0.3287 is a constant, and the actual calculation is simplified to a single multiplication operation. The COSφ curve control mode serves as a fallback strategy when neither the PF value control mode nor the QU curve control mode can simultaneously meet the power factor and voltage requirements. After compensation, the power factor stabilizes at 0.95±0.02.
[0043] The final output is the reactive power compensation command Qcomp(t), which is equal to the reactive power compensation amount calculated by the selected control mode. The reactive power compensation command Qcomp(t) is then sent to the reactive power compensation device at the grid connection point for execution.
[0044] By selecting the PF value control mode when |PFcur(t)-PFtarget|≤δPF and |ΔU(t)|≤δU, the power factor at the grid connection point is maintained near the target value when the voltage is normal. By selecting the QU curve control mode when ΔU(t)<-δU, the grid connection point voltage is restored to the normal range primarily through reactive power injection when it is low. By selecting the COSφ curve control mode when ΔU(t)>δU, the grid connection point voltage is restored to the normal range primarily through reactive power absorption when it is high. The three modes adaptively switch according to the grid connection point voltage state, selecting the reactive power control strategy that matches the current voltage state under different operating conditions, taking into account both power factor and voltage indicators.
[0045] Optionally, in step S500, the charging and discharging control strategy data generated in step S300 is received, including the energy storage charging power Pch(t), discharging power Pdis(t), and the corresponding purchased power Pbuy(t) and sold power Psell(t) for each time period. The reactive power compensation Qcomp(t) generated in step S400 is also received. A microgrid integrated dispatch optimization model is constructed, with the objective function being minF=α·Cbuy+β·Cqloss+γ·ΔPF, where Cbuy is the electricity purchase cost, Cqloss is the network loss cost, ΔPF is the power factor deviation penalty term, and α, β, and γ are weighting coefficients, α+β+γ=1. This objective function uses a weighted summation method to unify the three optimization objectives of economy, efficiency, and power quality into a single objective function, which can be solved by the MILP solver within 5 seconds. The weighting coefficients α, β, and γ can be flexibly adjusted according to the operation strategy; α is increased when the microgrid operation prioritizes economy, and γ is increased when power quality requirements are higher. The electricity purchase cost Cbuy = Σ(t=0 to 23)r(t)·Pbuy(t)·Δt - Σ(t=0 to 23)rsell(t)·Psell(t)·Δt, which is the electricity purchase expenditure minus the electricity sales revenue, reflecting the metering characteristics of bidirectional power exchange between the microgrid and the main grid. During the solution process, the optimizer automatically purchases electricity during off-peak hours and stores it in energy storage devices. During peak hours, it replaces the high-priced electricity purchase with energy storage discharge or sells electricity to the main grid when the electricity price is higher than the sales price, reducing the electricity purchase cost by 18%~30%. The network loss cost Cqloss = Σ(t=0 to 23)rloss·[Pch(t)·(1-ηch)+Pdis(t)·(1-ηdis)]·Δt, where rloss is the network loss price, ηch is the charging efficiency, and ηdis is the discharging efficiency, with ηch and ηdis ranging from 0.90 to 0.95. During the charging and discharging process, energy storage devices experience energy losses due to factors such as converter switching losses, line resistance losses, and battery internal resistance losses. Pch(t)·(1-ηch) quantifies the energy loss during charging, and Pdis(t)·(1-ηdis) quantifies the energy loss during discharging. The network loss cost term imposes an economic penalty on frequent charging and discharging behavior, driving the optimizer to reduce unnecessary charging and discharging cycles while meeting scheduling requirements. The average daily charging and discharging frequency decreases from 8.3 times to 4.7 times, extending the cycle life of the energy storage device by approximately 15%. The power factor deviation penalty term ΔPF=Σ(t=0 to 23)|PFcur(t)-PFtarget|·Δt penalizes the cumulative deviation of the actual power factor from the target power factor at each time period. This drives the optimizer to consider power factor indicators in power purchase and reactive power compensation decisions, reducing the power factor fluctuation range by 70%.
[0046] Set a set of constraints in the optimization model. The power balance constraint is Ppv(t)+Pbuy(t)+Pdis(t)=Pload(t)+Psell(t)+Pch(t). The energy storage charging and discharging mutual exclusion constraint is xch(t)+xdis(t)≤1, where xch(t) is the 0-1 variable of the energy storage charging state and xdis(t) is the 0-1 variable of the energy storage discharging state, ensuring that the energy storage does not charge and discharge at the same time. The energy storage state of charge continuity constraint is SOC(t)=SOC(t-1)+(Pch(t)·ηch-Pdis(t) / ηdis)·Δt / Emax. The initial condition is SOC(0)=SOC_init, and the final constraint is SOC(24)≥SOC_init. The grid connection point power factor constraint is PF_min≤PFcur(t)≤PF_max, where PF_min=0.90 and PF_max=1.00. The peak shaving reserve capacity constraint is SOC(t)·Emax≥Ereserve=0.5×Emax, ensuring that the remaining energy stored at any time is not less than the peak shaving reserve capacity.
[0047] A mixed-integer linear programming algorithm is used to solve the above optimization model. The decision variables include the energy storage charging state xch(t) (0-1 integer variable), the energy storage discharging state xdis(t) (0-1 integer variable), the energy storage charging power Pch(t) (continuous variable), the energy storage discharging power Pdis(t) (continuous variable), the purchased power Pbuy(t) (continuous variable), the sold power Psell(t) (continuous variable), and the reactive power compensation Qcomp(t) (continuous variable). The optimal values of each decision variable that minimize the objective function are obtained.
[0048] The obtained energy storage charging and discharging power commands, power purchase and sale commands, and reactive power compensation commands for each time period are used to generate a scheduling scheme sequence in chronological order. This sequence is then sent to the energy storage converter controller, grid-connected inverter controller, and reactive power compensation device controller in the microgrid system for execution. The power regulation parameters are set to a peak shaving reserve capacity of 50%, the regulation period is 24 hours a day from 00:00 to 24:00, and the upper limit of the regulation power is 1kW.
[0049] The integrated scheduling optimization model incorporates economic and power quality objectives into a unified objective function, employing weighting coefficients α, β, and γ to quantify the trade-offs between electricity purchase costs, grid loss costs, and power factor deviation. By jointly setting constraints on power balance, mutual exclusion of energy storage charging and discharging, continuity of energy storage state of charge, grid connection point power factor, and peak-shaving reserve capacity, the optimization model finds the optimal solution within the feasible region under the combined effect of these constraints. The 0-1 variable setting in the mixed-integer linear programming algorithm ensures that energy storage is in only one of three states—charging, discharging, or standby—at any given time. By including reactive power compensation as a decision variable, reactive power regulation and active power scheduling are coordinated within a unified optimization framework, avoiding potential command conflicts that might occur when active power scheduling and reactive power compensation are decided independently.
[0050] The technical solution of this invention predicts the timing of photovoltaic power generation and load demand information of a microgrid over the next 24 hours and obtains electricity price type information. This allows for the early prediction of the timing changes in photovoltaic output and load demand, providing a reliable data foundation for energy storage charging and discharging scheduling and improving power supply reliability. By invoking corresponding charging and discharging control strategies based on electricity price type, the invention drives energy storage devices. Under time-of-use pricing, it utilizes price differences to reduce electricity purchase costs; under fixed pricing, it drives energy storage devices based on the comparison between net load power and a preset threshold, reducing efficiency losses caused by frequent charging and discharging of energy storage. By detecting the grid connection point voltage and selecting the reactive power compensation mode based on the voltage state, different control methods are adopted when the grid connection point voltage is within different ranges, achieving dynamic switching of the reactive power compensation strategy and improving reactive power compensation accuracy. By using the charging and discharging control strategy and reactive power regulation as inputs, and generating and executing a scheduling scheme based on energy storage operation constraints and peak shaving reserve constraints, the invention unifies and coordinates the electricity purchase strategy and reactive power compensation scheme, reducing global non-optimization problems caused by independent operation of each module.
[0051] like Figure 2 As shown, in one embodiment, the step of time-series prediction of the microgrid's operating status for the next 24 hours includes: Step S110: Collect historical photovoltaic power generation data, historical load data, meteorological data, and electricity price data of the microgrid; Step S120: Use the LSTM-Attention model to predict the photovoltaic power generation Ppv(t) at each time point within the future scheduling cycle. The objective function of the LSTM-Attention model is: Lpred=(1 / N)Σ(i=1 to N)[Ppv_i- pv_i]²+λΣ||W||²; Where Ppv_i represents the actual photovoltaic power generation at the i-th sampling point. pv_i is the predicted value, N is the total number of sampling points, λ is the L2 regularization coefficient, and W is the model weight matrix; Step S130: Use the GRU network to predict the load demand Pload(t) at each time point in the future scheduling cycle; Based on electricity price policy data, multiple different time periods within the next 24-hour cycle are marked as fixed price periods, time-of-use price periods, or dynamic price periods.
[0052] Optionally, in step S110, photovoltaic power generation data, load data, meteorological data, and electricity price data of the microgrid system within a historical time period are collected to construct a training dataset for the prediction model. Photovoltaic power generation data is collected by electricity metering devices installed on the DC side of the photovoltaic array or the AC side of the grid-connected inverter. Load data is collected by smart meters installed at the grid connection point or feeder outlets of the microgrid system. Meteorological data is collected by weather stations deployed on-site in the microgrid system. These weather stations include at least an irradiance sensor, a temperature sensor, a humidity sensor, and a cloud cover detection device. The irradiance sensor is installed at the same tilt angle as the photovoltaic array. Electricity price data is obtained by the microgrid energy management system through an application programming interface provided by the power grid company. The sampling interval is 15 minutes, and the collection period is no less than 30 days. After aligning the collected data of each type according to timestamps, a time-series dataset is formed. In one embodiment, taking a microgrid demonstration project as an example, the photovoltaic power generation data, meteorological data and electricity price data of the microgrid over the past 30 days are collected, with a sampling interval of 15 minutes, and a training dataset Dtrain={(Xi, Yi)} is constructed, where Xi is the input feature vector and Yi is the corresponding photovoltaic power generation label.
[0053] Optionally, in step S120, an LSTM-Attention model is used to predict the photovoltaic power generation prediction sequence Ppv(t) with a time step of 1 hour for the next 24 hours, where t=0, 1, 2, ..., 23. The LSTM-Attention model includes an input layer, an LSTM hidden layer, an attention layer, and an output layer. The input layer receives a normalized feature vector sequence, where the feature vector at each time step includes irradiance, temperature, humidity, cloud cover, and historical photovoltaic power generation. The LSTM hidden layer is configured as a two-layer stacked structure, with the first LSTM hidden state dimension being 128 and the second LSTM hidden state dimension being 64. The attention layer uses an additive attention mechanism to sum the hidden states at each time step output by the LSTM hidden layer using weighted summation to obtain a context feature vector. The output layer maps the context feature vector to the photovoltaic power generation prediction value through a fully connected network. During model training, the training objective is to minimize the mean squared error between the predicted and actual values, and an L2 regularization term is added to the loss function. The objective function of the LSTM-Attention prediction model is Lpred=(1 / N)Σ(i=1 to N)[Ppv_i- [pv_i]²+λΣ||W||² where Ppv_i is the actual photovoltaic power generation at the i-th sampling point. pv_i is the predicted value, N is the total number of sampling points, λ is the L2 regularization coefficient, and W is the model weight matrix. The regularization coefficient λ is set to 0.001. Training uses the Adam optimizer with an initial learning rate of 0.001, which decays to 0.9 times the current rate after every 50 training epochs. The batch size is 32, and the number of training epochs is 200. Correspondingly, in the microgrid demonstration project mentioned above, the LSTM-Attention model uses irradiance, temperature, humidity, cloud cover, and historical photovoltaic power generation as input features. The LSTM hidden layer dimension is set to 128, and additive attention is used. The training epochs are 200, the learning rate is 0.001, and the batch size is 32. After training, the real-time feature data of the previous 24 sampling epochs are input to generate the photovoltaic power generation prediction sequence Ppv(t) for the next 24 hours in a recursive manner.
[0054] Optionally, in step S130, a GRU network is used to predict the load demand power forecast sequence Pload(t) for the next 24 hours with a time step of 1 hour, where t = 0, 1, 2, ..., 23. The input feature vector of the GRU network includes historical load power, day type code, time code, and ambient temperature. The day type code distinguishes between weekdays and non-weekdays. The GRU hidden layer dimension is set to 64, and the number of layers is single. The Adam optimizer is used for training, with a learning rate of 0.001 and 150 training cycles. Correspondingly, in the above microgrid demonstration project, the GRU load forecast model takes historical load power and day type code as input, sets the GRU hidden layer dimension to 64, has 150 training cycles, a learning rate of 0.001, and outputs the load demand forecast sequence Pload(t) for the next 24 hours.
[0055] Step S130 also acquires the electricity price policy data of the electricity market in which the microgrid is located, and labels each hourly time period within the next 24 hours with a price type label Ltp(t), t=0, 1, 2, ..., 23. The electricity price policy data includes fixed electricity price information, time-of-use price period divisions and corresponding price rates, and dynamic electricity price calculation rules. The price type labels include fixed electricity price period labels, time-of-use price period labels, and dynamic electricity price period labels. For time-of-use price periods, there are three subcategories: peak price period labels, flat price period labels, and valley price period labels. If time t belongs to the peak price period set Tpeak as stipulated by the electricity price policy, then Ltp(t) takes the peak price period label; if time t belongs to the flat price period set Tflat, then Ltp(t) takes the flat price period label; if time t belongs to the valley price period set Tvalley, then Ltp(t) takes the valley price period label. Correspondingly, in the aforementioned microgrid demonstration project, the time-of-use pricing policy stipulates that peak price periods are from 08:00 to 11:00 and from 18:00 to 21:00, valley price periods are from 22:00 to 06:00 the next day, and parity price periods are from 06:00 to 08:00, 11:00 to 18:00, and 21:00 to 22:00. Based on this pricing policy, each hourly period in the next 24 hours is labeled with a price type tag. The photovoltaic power generation forecast sequence Ppv(t), the load demand power forecast sequence Pload(t), and the price type tag sequence Ltp(t) are aligned according to the time index and output to step S200.
[0056] like Figure 3 As shown, in one embodiment, the step of determining the net load status for multiple different time periods based on photovoltaic power generation information and load demand information includes: Step S210: Subtract the photovoltaic power generation Ppv(t) from the load demand Pload(t) to calculate the net load power Pnet(t): Pnet(t) = Pload(t) - Ppv(t); Step S211: When Pnet(t)>0, the microgrid system has a power deficit; Step S212: When Pnet(t) < 0, the microgrid system has a power surplus.
[0057] Optionally, in step S210, the 24-hour photovoltaic power generation prediction sequence Ppv(t) and load demand power prediction sequence Pload(t) output in step S100 are obtained, t=0, 1, 2, ..., 23. For each time step t, the load demand Pload(t) is subtracted from the photovoltaic power generation Ppv(t) to calculate the net load power Pnet(t), i.e., Pnet(t) = Pload(t) - Ppv(t). The net load power represents the net power demand of the microgrid system that still needs to be borne by energy storage devices or the main grid after deducting the contribution of photovoltaic power generation.
[0058] Optionally, in step S211, when Pnet(t) > 0, it is determined that the microgrid system has a power deficit in the current time period. The value of this power deficit is equal to the absolute value of Pnet(t), indicating that the photovoltaic power generation is insufficient to cover the load demand, and the microgrid system needs to purchase electricity from the main grid or discharge from energy storage devices to make up for this deficit.
[0059] Optionally, in step S212, when Pnet(t) < 0, it is determined that the microgrid system has a power surplus in the current time period. The value of this power surplus is equal to the absolute value of Pnet(t), indicating that the photovoltaic power generation exceeds the load demand. The microgrid system can sell electricity to the main grid or charge energy storage devices to absorb this surplus energy. When Pnet(t) = 0, it is determined that the microgrid system is in power balance in the current time period, and the photovoltaic power generation is equal to the load demand, so there is no need to perform charging / discharging or electricity purchase / sale operations.
[0060] In one example, taking a microgrid demonstration project on a certain day, step S100 predicts the photovoltaic power generation sequence Ppv(t) and load demand power sequence Pload(t) for the next 24 hours. Subtracting the photovoltaic power generation from the load demand at each time point yields the net load power sequence Pnet(t). On that day, the electricity consumption is 1.64 kWh, and the power generation is 0 kWh. Therefore, Pnet(t) = Pload(t) - 0 > 0 for each time period, indicating that the microgrid has a power deficit throughout the day, requiring power purchase from the main grid or supplementation by energy storage discharge at each time point. In this scenario, since there is no photovoltaic power generation and the electricity consumption is low, the energy storage maintains peak-shaving reserve power and does not perform discharge operations; the purchased electricity equals the consumed electricity.
[0061] In the demonstration project overview, the cumulative electricity consumption was 90.18 kWh, and the cumulative power generation was 54.96 kWh. During the photovoltaic power generation period, Pnet(t) = Pload(t) - Ppv(t) is negative or a small positive value, indicating that the system has a power surplus or a small power deficit. During the nighttime period without photovoltaic power generation, Pnet(t) = Pload(t) is positive, indicating that the system has a power deficit. By calculating the net load power, the power balance state of the microgrid in each period is determined, providing a data basis for subsequent energy storage charging and discharging decisions and power purchase and sale strategies.
[0062] In one example, the microgrid contains multiple distributed photovoltaic (PV) units. Step S100 predicts the power generation of each PV unit, with the total predicted power generation as Ppv_total(t) = Ppv1(t) + Ppv2(t) + Ppv3(t). Step S210 subtracts the total PV power generation Ppv_total(t) from the total load demand Pload(t) to calculate the total net load power Pnet_total(t). When Pnet_total(t) > 0, the system has a power deficit; when Pnet_total(t) < 0, the system has a power surplus. The calculated net load power sequence Pnet(t) and the power deficit or power surplus determination results for each time period are output to step S300.
[0063] In one embodiment, the step of calculating the dispatchable capacity of the energy storage device under multiple different electricity price types based on the state of charge of the energy storage device includes: Obtain the rated capacity Emax and current state of charge Esoc(t) of the energy storage device; The rechargeable capacity of the energy storage device is calculated as Ech(t)≤Emax-Esoc(t-1); The discharge capacity of the energy storage device is calculated as Edis(t)≤Esoc(t-1)-Ereserve; The peak shaving reserve power is Eresterve = 0.5 × Emax.
[0064] Optionally, the rated capacity Emax and the current state of charge Esoc(t) of the energy storage device can be obtained. The rated capacity Emax represents the maximum electrical energy that the energy storage device can store, in kWh. The current state of charge Esoc(t) represents the electrical energy stored by the energy storage device at the current moment, in kWh.
[0065] Calculate the rechargeable capacity of the energy storage device. The rechargeable capacity is the maximum electrical energy the energy storage device can accept at the current moment, equal to the rated capacity Emax of the energy storage device minus the state of charge Esoc(t-1) at the previous moment, i.e., Ech(t) ≤ Emax - Esoc(t-1). The rechargeable capacity constraint ensures that the energy storage device does not exceed its rated capacity limit during charging, preventing overcharging. Calculate the discharge capacity of the energy storage device. Obtain the peak-shaving reserve capacity Ereserve, Ereserve = 0.5 × Emax, i.e., the peak-shaving reserve capacity is 50% of the rated capacity of the energy storage device. The discharge capacity is the maximum electrical energy the energy storage device can provide at the current moment, equal to the state of charge Esoc(t-1) at the previous moment minus the peak-shaving reserve capacity Ereserve, i.e., Edis(t) ≤ Esoc(t-1) - Ereserve. The discharge capacity constraint ensures that the energy storage device retains peak-shaving reserve capacity during discharge to cope with emergencies such as sudden load increases or sudden drops in photovoltaic output. Based on a peak shaving reserve capacity of 50%, the discharge capacity can be further expressed as Edis(t)≤Esoc(t-1)-0.5×Emax.
[0066] Optionally, taking a microgrid system with a rated energy storage capacity of Emax = 10kWh as an example, the energy storage state of charge Esoc(t-1) = 8kWh at the previous moment, meaning the energy storage device had stored 8kWh of electrical energy at the previous moment. The rechargeable capacity Ech(t) ≤ 10-8 = 2kWh, meaning it can be recharged by 2kWh to reach full capacity. The peak shaving reserve capacity Erserve = 0.5 × 10 = 5kWh, and the discharge capacity Edis(t) ≤ 8-5 = 3kWh, meaning that a maximum of 3kWh can be discharged in the current period. After discharge, the state of charge drops to 5kWh, but 50% of the peak shaving reserve capacity is still retained.
[0067] Optionally, if the previous energy storage state of charge Esoc(t-1) = 4.5 kWh and the rated energy storage capacity Emax = 10 kWh, the rechargeable capacity Ech(t) ≤ 10 - 4.5 = 5.5 kWh. The peak shaving reserve capacity Erserve = 0.5 × 10 = 5 kWh. Since the previous state of charge of 4.5 kWh is lower than the peak shaving reserve capacity of 5 kWh, the dischargeable capacity Edis(t) ≤ 4.5 - 5 = -0.5 kWh, meaning there is no dischargeable capacity at the current moment, the energy storage device cannot perform a discharge operation and must prioritize charging to restore the state of charge to above the peak shaving reserve capacity. The calculated rechargeable and dischargeable capacities for each time period are output to step S300 to constrain the charging and discharging power commands of the energy storage device.
[0068] Optionally, the microgrid can be configured with a larger capacity energy storage system, Emax=20kWh, with a peak shaving reserve capacity of 60%, i.e., Ereserve=0.6×Emax=12kWh. At the previous moment, the state of charge Esoc(t-1)=15kWh, so the rechargeable capacity Ech(t)≤20-15=5kWh, and the dischargeable capacity Edis(t)≤15-12=3kWh. In a scenario where photovoltaic power generation Ppv_day=8.5kWh and load demand Pload_day=12.3kWh, energy storage charges 7.2kWh during off-peak hours and discharges 5.1kWh during peak hours. During charging, the rechargeable capacity constraint ensures that the state of charge after charging does not exceed Emax, and during discharging, the peak shaving reserve capacity constraint ensures that the state of charge after discharging is not lower than 12kWh.
[0069] like Figure 4 As shown, in one embodiment, the step of invoking the corresponding charge / discharge control strategy to drive the energy storage device to operate based on the electricity price type corresponding to the current time period includes: Step S310: When the electricity price type is time-of-use pricing and the current time period is a valley price period, the energy storage charging power is Pch(t) = min{Pch_max, Pnet(t) + Pch_margin}; where Pch_max is the maximum energy storage charging power and Pch_margin is the reserved charging margin. Step S320: When the electricity price type is time-of-use pricing and the current time period is a peak price period, the energy storage discharge power is Pdis(t) = min{Pdis_max, Pload(t) - Ppv(t)}; where Pdis_max is the maximum energy storage discharge power. Step S330: When the electricity price type is fixed, drive the energy storage device to work based on the comparison result between the net load power Pnet(t) and the preset threshold Pth.
[0070] Optionally, in step S310, the current time period electricity price type label Ltp(t) output in step S100 is obtained. When the electricity price type label Ltp(t) is a time-of-use price label and the current time period is a valley price period, the peak-valley electricity purchase and dispatch module generates an energy storage charging instruction. The energy storage charging power Pch(t) is determined based on the net load power Pnet(t) and the reserved charging margin Pch_margin, Pch(t) = min{Pch_max, Pnet(t) + Pch_margin}. Wherein, Pch_max is the maximum energy storage charging power, which is limited by the hardware parameters of the energy storage converter; Pch_margin is the reserved charging margin, with a value range of 0.1 to 0.5 kW, used to add a small amount of charging power on the basis of the net load power to make full use of the low-priced electricity during the valley price period. The energy storage charging power instruction is sent to the energy storage converter controller for execution.
[0071] Optionally, in step S320, when the electricity price type label Ltp(t) is a time-of-use price label and the current time period is a peak price period, the peak-valley power purchase and dispatch module generates an energy storage discharge command. The energy storage discharge power Pdis(t) is determined based on the load demand power Pload(t) and the photovoltaic power generation power Ppv(t), Pdis(t) = min{Pdis_max, Pload(t) - Ppv(t)}. Wherein, Pdis_max is the maximum energy storage discharge power, limited by the hardware parameters of the energy storage converter. The energy storage discharge power command is sent to the energy storage converter controller for execution.
[0072] Optionally, in step S330, when the electricity price type label Ltp(t) is a fixed electricity price label, the peak-valley power purchase and dispatch module drives the energy storage device to work based on the comparison result between the net load power Pnet(t) and the preset threshold Pth. The preset threshold Pth is the net load power threshold, in kW. If Pnet(t) > Pth, the energy storage device discharges, and the discharge power is Pdis(t) = min{Pdis_max, Pnet(t) - Pth}. If Pnet(t) < - Pth, the energy storage device charges, and the charging power is Pch(t) = min{Pch_max, |Pnet(t)| - Pth}. If |Pnet(t)| ≤ Pth, the energy storage device is in standby mode and does not perform charging or discharging operations. This strategy ensures that the energy storage device only operates when the net load power exceeds the set threshold, avoiding frequent start-stop operations under small power fluctuations.
[0073] Optionally, taking a microgrid demonstration project as an example, the time-of-use pricing policy stipulates that the off-peak period is from 22:00 to 06:00 the next day, and the peak period is from 08:00 to 11:00 and from 18:00 to 21:00. The rated capacity of the energy storage is Emax = 10kWh, the maximum charging power of the energy storage is Pch_max = 5kW, the maximum discharging power of the energy storage is Pdis_max = 5kW, the reserved charging margin is Pch_margin = 0.3kW, the charging efficiency is ηch = 0.95, and the discharging efficiency is ηdis = 0.95. During the off-peak period from 22:00 to 06:00, step S310 performs energy storage charging. Assuming that the net load power at a certain moment is Pnet(t) = 2kW, then Pch(t) = min{5, 2 + 0.3} = 2.3kW, and the energy storage is charged at a power of 2.3kW. Let the net load power Pnet(t) at another moment be -1kW (photovoltaic power generation has a surplus), then Pch(t) = min{5, -1 + 0.3} = -0.7kW. A negative result indicates that no charging is needed and the energy storage device is in standby mode. During the peak price period from 08:00 to 11:00, step S320 performs energy storage discharge. Let the load demand Pload(t) be 8kW and the photovoltaic power generation Ppv(t) be 3kW at a certain moment, then Pdis(t) = min{5, 8 - 3} = 5kW. The energy storage discharges at its maximum discharge power of 5kW to supplement the net load shortfall of 5kW. Let the load demand Pload(t) be 4kW and the photovoltaic power generation Ppv(t) be 6kW at another moment, then Pload(t) - Ppv(t) = -2kW. A negative result indicates that the photovoltaic power generation has met the load and has a surplus, so no discharge is needed and the energy storage device is in standby mode. Under a fixed electricity price model, taking a microgrid as an example, a uniform electricity rate rfix = 0.55 monetary units / kWh is used throughout the day, and the net load threshold Pth = 0.5kW is set. If at a certain moment Pnet(t) = 3kW, Pnet(t) > Pth, the energy storage discharges, and Pdis(t) = min{Pdis_max, 3 - 0.5} = 2.5kW. If at a certain moment Pnet(t) = -2kW, Pnet(t) < -Pth, the energy storage charges, and Pch(t) = min{Pch_max, |-2| - 0.5} = 1.5kW. If at a certain moment Pnet(t) = 0.3kW, |Pnet(t)| ≤ Pth, the energy storage device is in standby mode.
[0074] Optionally, the electricity price type is a dynamic electricity price mode. Under the dynamic electricity price mode, the real-time electricity price rreal(t) = rbase + Δr(t), where rbase = 0.60 currency units / kWh, and Δr(t) ranges from [-0.20, +0.40] currency units / kWh. When Δr(t) < -0.10 currency units / kWh, i.e., rreal(t) < 0.50 currency units / kWh, it is determined to be a low-price period, and energy storage is charged, with charging power Pch(t) = min{Pch_max, Pnet(t) + Pch_margin}. When Δr(t) > +0.20 currency units / kWh, i.e., rreal(t) > 0.80 currency units / kWh, it is determined to be a high-price period, and energy storage is discharged, with discharging power Pdis(t) = min{Pdis_max, Pload(t) - Ppv(t)}. Taking a certain day's dynamic electricity price data as an example, from 10:00 to 14:00, the electricity price continues to rise, rreal > 0.85 currency units / kWh. During this period, the energy storage discharges, and the discharge power is Pdis(t) = min{5kW, Pload(t) - Ppv(t)}. From 02:00 to 05:00, the electricity price falls, rreal < 0.45 currency units / kWh. The energy storage charges, and the charging power is Pch(t) = min{5kW, Pnet(t) + 0.3kW}.
[0075] Optionally, the microgrid includes multiple distributed photovoltaic (PV) units and energy storage units. The microgrid contains 3 PV units and 2 energy storage units, with E1 having a rated capacity of 10 kWh / maximum charge / discharge power of 5 kW and E2 having a rated capacity of 15 kWh / maximum charge / discharge power of 8 kW. The peak-valley electricity purchase and dispatch module adopts a centralized dispatch strategy, prioritizing the dispatch of the more efficient energy storage unit E2. During off-peak hours, step S310 calculates the charging power command for each energy storage unit: E1 charging power Pch1(t) = min{5, Pnet(t) + Pch_margin}, E2 charging power Pch2(t) = min{8, Pnet(t) + Pch_margin}, and the total charging power is the sum of the two. During peak price periods, step S320 calculates the discharge power command for each energy storage unit: E1 discharge power Pdis1(t) = min{5, Pload(t) - Ppv_total(t)}, E2 discharge power Pdis2(t) = min{8, Pload(t) - Ppv_total(t)}, and the total discharge power is the sum of the two.
[0076] In steps S310 and S320, the energy storage charging and discharging amounts are constrained by the rechargeable and dischargeable capacities calculated in step S200. The energy storage charging amount Ech(t) satisfies Ech(t) ≤ Emax - Esoc(t-1), meaning the state of charge after charging does not exceed the rated capacity. The energy storage discharging amount Edis(t) satisfies Edis(t) ≤ Esoc(t-1) - Erserve, meaning the state of charge after discharging is not lower than the peak-shaving reserve capacity Erserve = 0.5 × Emax. When the rechargeable or dischargeable capacity is insufficient, the peak-valley power purchase and dispatch module correspondingly reduces the charging or discharging power command to ensure the energy storage device operates within physical limitations.
[0077] In one embodiment, the step of detecting the grid connection point voltage and selecting the reactive power compensation mode based on the voltage state of the grid connection point includes: Set the target power factor at the grid connection point to PFtarget = 0.95; Collect the active power P(t) and reactive power Q(t) at the grid connection point, and calculate the current power factor PFcur(t). The formula for calculating the power factor PFcur(t) is: PFcur(t) = P(t) / √(P(t)² + Q(t)²). When the grid connection point voltage is within 90% to 110% of the rated voltage, select the PF value control mode; When the grid connection point voltage is lower than 90% of the rated voltage, select the QU curve control mode; When the grid connection point voltage is 110% higher than the rated voltage, select the COSφ curve control mode.
[0078] Optionally, the target power factor at the grid connection point is set to PFtarget = 0.95. The target power factor PFtarget is the power factor control target value when the microgrid system transmits or absorbs electrical energy from the main grid. The power factor is the ratio of active power to apparent power; the closer the power factor is to 1, the higher the power quality and the lower the reactive power demand of the microgrid system on the main grid. Setting the target power factor to 0.95 ensures that the microgrid system meets the power system's assessment requirement that the power factor of grid-connected users be no less than 0.95 during grid-connected operation.
[0079] Optionally, voltage and current detection devices are installed at the common connection point between the microgrid system and the main grid to collect the effective values of the three-phase voltage and three-phase current in real time. Based on the collected voltage and current values, the active power P(t) and reactive power Q(t) at the current moment of the grid connection point are calculated. Active power P(t) represents the active electrical energy exchanged between the microgrid system and the main grid; a positive value indicates that the microgrid purchases electricity from the main grid, and a negative value indicates that the microgrid sells electricity to the main grid. Reactive power Q(t) represents the reactive electrical energy exchanged between the microgrid system and the main grid. Based on the active power P(t) and reactive power Q(t), the current power factor PFcur(t) is calculated. The formula for calculating the power factor PFcur(t) is PFcur(t) = P(t) / √(P(t)² + Q(t)²). The value of the power factor PFcur(t) ranges from 0 to 1, with a value closer to 1 indicating a better power factor.
[0080] Optionally, the rated voltage Unom at the grid connection point is obtained, where Unom is the standard voltage value specified at the grid connection point of the microgrid system. The measured voltage Umeas(t) at the grid connection point is acquired in real time, and the voltage deviation ΔU(t) is calculated: ΔU(t) = Umeas(t) - Unom. The voltage deviation ΔU(t) is expressed in per-unit values, with Unom as the reference value. When ΔU(t) is positive, it indicates that the grid connection point voltage is higher than the rated voltage; when ΔU(t) is negative, it indicates that the grid connection point voltage is lower than the rated voltage. Based on the state of the grid connection point voltage Umeas(t) relative to the rated voltage Unom, a reactive power compensation mode is selected from the PF value control mode, QU curve control mode, and COSφ curve control mode. When the grid connection point voltage Umeas(t) is within 90% to 110% of the rated voltage Unom, i.e., 0.9Unom ≤ Umeas(t) ≤ 1.1Unom, the PF value control mode is selected. Within this voltage range, the grid connection point voltage is within the normal allowable deviation range. The primary goal of reactive power control is to achieve the power factor at the target value PFtarget=0.95, so as to reduce reactive power exchange between the microgrid system and the main grid and improve power quality.
[0081] When the grid connection point voltage Umeas(t) is lower than 90% of the rated voltage Unom, i.e., Umeas(t) < 0.9Unom, the QU curve control mode is selected. A low grid connection point voltage indicates insufficient reactive power in the microgrid system area, leading to a voltage drop. The QU curve control mode injects reactive power into the grid connection point to support the voltage, restoring it to the normal range. When the grid connection point voltage Umeas(t) is higher than 110% of the rated voltage Unom, i.e., Umeas(t) > 1.1Unom, the COSφ curve control mode is selected. A high grid connection point voltage indicates excess reactive power in the microgrid system area, leading to a voltage rise. The COSφ curve control mode absorbs reactive power from the grid connection point to reduce the voltage, restoring it to the normal range. Under the selected reactive power compensation mode, the corresponding reactive power compensation amount Qcomp(t) is calculated and output as a reactive power command to the reactive power compensation device at the grid connection point for execution. Reactive power compensation devices include energy storage converters and static var generators.
[0082] Optionally, taking a microgrid demonstration project as an example, the rated voltage at the grid connection point Unom = 380V, the target power factor PFtarget = 0.95, the voltage deviation threshold δU = 0.05pu (i.e., 5% of the rated voltage, corresponding to 19V), the power factor deviation threshold δPF = 0.02, and the slope of the QU curve Kqu = 3% / pu. If the measured voltage at the grid connection point Umeas(t) = 380V, that is, Umeas(t) is within the range of 0.9Unom to 1.1Unom, the PF value control mode is selected. The current active power P(t) = 50kW and reactive power Q(t) = 15kVar are collected, and the current power factor PFcur(t) is calculated as 50 / √(50²+15²) = 0.958. The formulas are: |PFcur(t)-PFtarget|=|0.958-0.95|=0.008≤0.02, and |ΔU(t)|=|380-380| / 380=0≤0.05pu, which meet the switching conditions for the PF value control mode. The reactive power compensation amount Qcomp_PF(t)=Q(t)·(PFtarget / PFcur(t)-1)=15×(0.95 / 0.958-1)=15×(-0.0084)=-0.126kVar. A negative value indicates that the reactive power compensation device needs to absorb reactive power to bring the power factor closer to 0.95. If the measured voltage at the grid connection point Umeas(t)=360V, which is lower than 0.9Unom=342V, the QU curve control mode is selected. The voltage deviation ΔU(t) = 360 - 380 = -20V, expressed in per-unit value as -20 / 380 = -0.0526pu, |ΔU(t)| > 0.05pu. The reactive power compensation Qcomp_QU(t) = Kqu·ΔU(t) = 0.03 × (-0.0526) = -0.00158 (per-unit value), multiplied by the system baseline capacity (e.g., 100kVA), yields an actual reactive power compensation of -0.158kVar, indicating that reactive power needs to be injected into the grid connection point to support the voltage. If the measured voltage at the grid connection point Umeas(t) = 420V, which is higher than 1.1Unom = 418V, the COSφ curve control mode should be selected. The reactive power compensation amount Qcomp_COS(t)=P(t)·tan(arccos(0.95))=50×tan(18.19°)=50×0.3287=16.435kVar, which means that 16.435kVar of reactive power needs to be absorbed from the grid connection point to reduce the voltage.
[0083] Optionally, if the measured voltage at the grid connection point, Umeas(t), is 390V, falling within the range of 0.9Unom to 1.1Unom, then the PF value control mode is selected. The current active power P(t) is collected as 30kW, and the reactive power Q(t) is 18kVar. The current power factor PFcur(t) is calculated as 30 / √(30²+18²) = 0.857. |PFcur(t)-PFtarget|=|0.857-0.95|=0.093>0.02, and the voltage deviation |ΔU(t)|=|390-380| / 380=0.0263pu≤0.05pu, the PF value control mode is still selected. However, since the power factor deviation exceeds the threshold, a significant amount of reactive power compensation is required. The reactive power compensation amount Qcomp_PF(t) = Q(t)·(PFtarget / PFcur(t)-1) = 18×(0.95 / 0.857-1) = 18×0.1085 = 1.953kVar, which means that 1.953kVar of reactive power needs to be injected to improve the power factor.
[0084] Optionally, when the measured voltage at the grid connection point, Umeas(t), is 350V and lower than 0.9Unom=342V, the QU curve control mode is selected. The voltage deviation ΔU(t) = 350-380 = -30V, expressed in per-unit value as -30 / 380 = -0.0789pu, |ΔU(t)| > 0.05pu, and the slope of the QU curve, Kqu = 4% / pu. The reactive power compensation amount, Qcomp_QU(t) = 0.04 × (-0.0789) = -0.00316 (per-unit value), multiplied by the system base capacity of 100kVA, yields -0.316kVar, indicating that 0.316kVar of reactive power needs to be injected into the grid connection point to support the voltage.
[0085] When neither the PF value control mode nor the QU curve control mode can simultaneously meet the power factor and voltage requirements, the COSφ curve control mode is selected. For example, when the voltage deviation exceeds the threshold but the power factor deviation is within the threshold range, the system determines that a single control mode cannot meet both objectives and switches to the COSφ curve control mode. Under the COSφ curve control mode, the reactive power compensation amount Qcomp_COS(t) = P(t)·tan(arccos(0.95)), and the reactive power compensation device outputs reactive power according to this instruction, so that the grid connection point operates on the curve corresponding to the target power factor angle. The final reactive power compensation instruction Qcomp(t) is equal to the reactive power compensation amount calculated by the selected control mode and is sent to the reactive power compensation device at the grid connection point for execution. The power adjustment parameter is a peak shaving reserve power ratio of 50%, and the adjustment period is 24 hours a day from 00:00 to 24:00.
[0086] It should be noted that all formulas in this invention are derived based on the basic theory of power systems, and the parameters can be collected by field equipment to form a complete calculation chain of prediction, analysis, control, and optimization, achieving a comprehensive effect of reducing electricity purchase costs by 18% to 30% and achieving a power factor qualification rate of over 99%.
[0087] The present invention also proposes a control device, which includes a memory, a processor, and a control program for a microgrid system stored in the memory and executable on the processor, the control program for the microgrid system being configured to implement a microgrid system control method as described above.
[0088] Optionally, the control device is used to store and execute microgrid system control methods. Optionally, the control device can be implemented using a main controller, such as an MCU, PLC, DSP (Digital Signal Processor), SOC (System on Chip), FPGA (Field Programmable Gate Array), etc.
[0089] It is worth noting that since the control device of the present invention includes the above-mentioned microgrid system control method, the control device of the present invention also includes all the embodiments of the above-mentioned microgrid system control method and the effects brought by each embodiment, which will not be repeated here.
[0090] The present invention also proposes a microgrid system, including an energy storage device and the aforementioned control device.
[0091] It is worth noting that since the microgrid system of the present invention includes the above-mentioned control devices, the microgrid system of the present invention also includes embodiments of all the above-mentioned control devices and the effects of each embodiment, which will not be repeated here.
[0092] The above description is merely an exemplary embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made using the contents of the present invention specification and drawings under the technical concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.
Claims
1. A microgrid system control method, applied to a microgrid system, the microgrid system including energy storage devices, characterized in that, The method includes: The operating status of the microgrid system for the next 24 hours is predicted in a time series, and photovoltaic power generation information, load demand information and electricity price type information corresponding to multiple different time periods are obtained within the next 24-hour period. Based on the photovoltaic power generation information and the load demand information, the net load status of the multiple different time periods is determined, and combined with the state of charge of the energy storage device, the dispatchable capacity of the energy storage device under the corresponding electricity price type in the multiple different time periods is calculated. Based on the electricity price type corresponding to the current time period, the corresponding charging and discharging control strategy is invoked to drive the energy storage device to work. The electricity price type includes at least a fixed electricity price type and a time-of-use electricity price type. The grid connection point voltage is detected, and based on the voltage state of the grid connection point, a reactive power compensation mode is selected, and a reactive power regulation amount is output to correct the power factor of the grid connection point. The charging and discharging control strategy and the reactive power regulation are used as inputs, and a scheduling scheme is generated and executed based on energy storage operation constraints and peak shaving reserve constraints.
2. The microgrid system control method as described in claim 1, characterized in that, The step of predicting the operating status of the microgrid for the next 24 hours includes: Collect historical photovoltaic power generation data, historical load data, meteorological data, and electricity price data of the microgrid; The LSTM-Attention model is used to predict the photovoltaic power generation Ppv(t) at each time point within the future scheduling cycle. The objective function of the LSTM-Attention model is: Lpred=(1 / N)Σ(i=1 to N)[Ppv_i- pv_i]²+λΣ||W||²; Where Ppv_i represents the actual photovoltaic power generation at the i-th sampling point. pv_i is the predicted value, N is the total number of sampling points, λ is the L2 regularization coefficient, and W is the model weight matrix; The load demand Pload(t) at each time point in the future scheduling cycle is predicted using a GRU network. Based on electricity price policy data, multiple different time periods within the future 24-hour cycle are labeled as fixed price periods, time-of-use price periods, or dynamic price periods.
3. The microgrid system control method as described in claim 1, characterized in that, The step of determining the net load status for the multiple different time periods based on the photovoltaic power generation information and the load demand information includes: Subtracting the photovoltaic power generation Ppv(t) from the load demand Pload(t) yields the net load power Pnet(t): Pnet(t) = Pload(t) - Ppv(t); When Pnet(t)>0, the microgrid system has a power deficit; When Pnet(t) < 0, the microgrid system has a power surplus.
4. The microgrid system control method as described in claim 1, characterized in that, The step of calculating the dispatchable capacity of the energy storage device under the electricity price type corresponding to multiple different time periods, based on the state of charge of the energy storage device, includes: Obtain the rated capacity Emax and the current state of charge Esoc(t) of the energy storage device; The rechargeable capacity of the energy storage device is calculated as Ech(t)≤Emax-Esoc(t-1); The discharge capacity of the energy storage device is calculated as Edis(t)≤Esoc(t-1)-Ereserve; The peak shaving reserve power is Eresterve = 0.5 × Emax.
5. The microgrid system control method as described in claim 1, characterized in that, The step of invoking the corresponding charging and discharging control strategy to drive the energy storage device to work based on the electricity price type corresponding to the current time period includes: When the electricity price type is time-of-use pricing and the current time period is a low-price period, the energy storage charging power is Pch(t) = min{Pch_max, Pnet(t) + Pch_margin}; where Pch_max is the maximum energy storage charging power and Pch_margin is the reserved charging margin. When the electricity price type is time-of-use pricing and the current time period is a peak price period, the energy storage discharge power is Pdis(t) = min{Pdis_max, Pload(t) - Ppv(t)}; where Pdis_max is the maximum energy storage discharge power; When the electricity price type is a fixed price, the energy storage device is driven to work based on the comparison result between the net load power Pnet(t) and the preset threshold Pth.
6. The microgrid system control method as described in claim 5, characterized in that, The steps for driving the energy storage device to operate based on the comparison result between the net load power Pnet(t) and the preset threshold Pth include: The net load power Pnet(t) is compared with the preset threshold Pth; When Pnet(t) > Pth, the energy storage discharge power is calculated as Pdis(t) = min{Pdis_max, Pnet(t) - Pth}, and the energy storage device is driven to discharge with the energy storage discharge power Pdis(t). When Pnet(t) <- Pth, the energy storage charging power is calculated as Pch(t) = min{Pch_max, |Pnet(t)|-Pth}, and the energy storage device is driven to charge with the energy storage charging power Pch(t). When |Pnet(t)|≤Pth, the energy storage device is driven into standby mode.
7. The microgrid system control method as described in claim 1, characterized in that, The step of detecting the grid connection point voltage and selecting the reactive power compensation mode based on the voltage state of the grid connection point includes: Set the target power factor at the grid connection point to PFtarget = 0.95; Collect the active power P(t) and reactive power Q(t) at the grid connection point, and calculate the current power factor PFcur(t). The formula for calculating the power factor PFcur(t) is: PFcur(t) = P(t) / √(P(t)² + Q(t)²). When the grid connection point voltage is within the range of 90% to 110% of the rated voltage, select the PF value control mode; When the grid connection point voltage is lower than 90% of the rated voltage, select the QU curve control mode; When the grid connection point voltage is higher than 110% of the rated voltage, select the COSφ curve control mode.
8. The microgrid system control method as described in claim 7, characterized in that, When |PFcur(t)-PFtarget|≤0.02 and |ΔU(t)|≤ When the PF value control mode is selected with a PU value of 0.05, the reactive power compensation is: Qcomp_PF(t) = Q(t)·(PFtarget / PFcur(t)-1); When |ΔU(t)|>0.05pu, the QU curve control mode is selected, and the reactive power compensation is: Qcomp_QU(t)=Kqu·ΔU(t); Where Kqu is the slope of the QU curve, ΔU(t) = Umeas(t) - Unom, Umeas is the measured voltage, and Unom is the rated voltage; When neither the PF value control mode nor the QU curve control mode can simultaneously meet the power factor and voltage requirements, the COSφ curve control mode is selected, and the reactive power compensation is: Qcomp_COS(t)=P(t)·tan(arccos(0.95)).
9. A control device, characterized in that, The control device includes: a memory, a processor, and a microgrid system control program stored in the memory and executable on the processor, the microgrid system control program being configured to implement the microgrid system control method as described in any one of claims 1 to 8.
10. A microgrid system, characterized in that, It includes energy storage devices and the control device as described in claim 9.