Grid-connected and off-grid switching control method of micro-grid
Through multi-scale decomposition and reinforcement learning model dynamically adjusting the charging and discharging strategy of the energy storage system, the problem that the microgrid and off-grid switching control method in the existing technology cannot dynamically adapt to the changes in load and power generation, and achieve higher stability and reliability.
Patent Information
- Application Number
- CN202510043559.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-05-13
AI Technical Summary
The existing microgrid and off-grid switching control methods cannot dynamically adapt to changes in load and power generation, and are prone to over-adjustment or under-adjustment, resulting in intensified transient fluctuations and affecting system stability.
By retrieving the microgrid operation timing data of the historical time period based on the to be executed and off-grid instructions, multi-scale decomposition is performed to extract the oscillation signal, determining the microgrid stability index, and defining the input state of the energy storage system assisted switching model through the reinforcement learning model, dynamically adjusting the charge and discharge strategy of the energy storage system.
It effectively reduces the transient fluctuations of the system, improves the stability and reliability of microgrid switching, and can automatically adjust the charging and discharging strategies of the energy storage system in the case of high fluctuations or grid failures to suppress transient fluctuations of the power grid.
Smart Images

Figure CN119994948A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of microgrid intelligent control systems, and in particular to a microgrid on-grid and off-grid switching control method and system. Background Art
[0002] As a small, local and independent power system, microgrids are usually composed of distributed power generation resources (such as solar energy, wind energy, small hydropower, etc.) and loads. Microgrids can operate independently of traditional power grids, achieve self-sufficiency when the power grid fails or is subject to external interference, and ensure the stability of local power supply. In addition, microgrids also have the function of connecting to the large power grid, and improve the reliability and flexibility of the power system through flexible grid connection and off-grid switching. Especially in the context of the widespread application of renewable energy, microgrids can better balance the volatility and uncertainty of energy.
[0003] However, when the microgrid switches between grid-connected and off-grid, the voltage and frequency of the grid often fluctuate greatly due to load fluctuations, changes in power generation, and differences in the responses of system components. Transient fluctuations can reduce system stability, causing equipment to frequently experience high loads and unbalanced states, which can accelerate equipment aging or failure. In addition, frequent fluctuations can also affect the quality of continuous power supply to the load, which may result in power outages, equipment damage, or a decline in user experience.
[0004] Existing microgrid on-grid and off-grid switching control methods often rely on fixed thresholds or PID control methods, which can effectively perform basic adjustments to the system, but cannot dynamically adapt to changes in microgrid load and power generation, and are prone to over- or under-regulation. Especially when the system load fluctuates violently or the grid fails, the switching control strategy cannot be adjusted in time, resulting in increased transient fluctuations, further affecting the stability of the system.
[0005] In response to the above problems, the industry has not yet proposed a better technical solution. Summary of the invention
[0006] The embodiments of the present application provide a microgrid on-grid and off-grid switching control method and system, which are used to at least solve the over-regulation or under-regulation problem that is prone to occur in the fixed threshold control method in the prior art when the load and power generation change drastically, effectively reduce the transient fluctuations of the system, and improve the stability and reliability of the microgrid during switching.
[0007] In a first aspect, an embodiment of the present application provides a microgrid on-grid and off-grid switching control method, comprising: based on the on-grid and off-grid instructions to be executed, retrieving the microgrid operation timing data corresponding to the preset historical time period, and performing multi-scale decomposition on the microgrid operation timing data to extract oscillation signals from different time scales; the on-grid and off-grid instructions are on-grid instructions or off-grid instructions, and the microgrid operation timing data include microgrid frequency timing information and / or microgrid voltage timing information; according to the extracted multi-scale oscillation signal, determining the corresponding microgrid stability index; obtaining the real-time operating parameters of the energy storage system and the real-time operating parameters of the main grid, and defining the input state of the energy storage system auxiliary switching model based on the on-grid and off-grid instructions, the microgrid stability index, the real-time operating parameters of the energy storage system and the real-time operating parameters of the main grid, so as to determine the target charging and discharging strategy of the energy storage system through reinforcement learning; the energy storage system auxiliary switching model adopts a reinforcement learning model; when it is detected that the microgrid executes the on-grid and off-grid instructions, controlling the energy storage system to execute the target charging and discharging strategy.
[0008] In a second aspect, an embodiment of the present application provides a microgrid on-grid and off-grid switching control system, comprising: a microgrid data retrieval unit, for retrieving microgrid operation timing data corresponding to a preset historical time period based on an on-grid and off-grid instruction to be executed, and performing multi-scale decomposition on the microgrid operation timing data to extract oscillation signals from different time scales; the on-grid and off-grid instruction is an on-grid instruction or an off-grid instruction, and the microgrid operation timing data includes microgrid frequency timing information and / or microgrid voltage timing information; a stability index extraction unit, for determining a corresponding microgrid stability index according to the extracted multi-scale oscillation signal; a charging and discharging strategy determination unit, for obtaining real-time operating parameters of an energy storage system and real-time operating parameters of a main grid, and defining an input state of an auxiliary switching model of an energy storage system based on the on-grid and off-grid instruction, the microgrid stability index, the real-time operating parameters of the energy storage system and the real-time operating parameters of the main grid, so as to determine a target charging and discharging strategy of the energy storage system through reinforcement learning; the auxiliary switching model of the energy storage system adopts a reinforcement learning model; a charging and discharging strategy execution unit, for controlling the energy storage system to execute the target charging and discharging strategy when it is detected that the microgrid executes the on-grid and off-grid instruction.
[0009] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the above method.
[0010] In a fourth aspect, an embodiment of the present application provides a storage medium, which stores one or more programs including execution instructions, and the execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute the steps of the above-mentioned method of the present application.
[0011] In a fifth aspect, an embodiment of the present application further provides a computer program product, wherein the computer program product comprises a computer program stored on a storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer executes the steps of the above method.
[0012] Compared with the prior art, the above technical solution has at least the following beneficial effects:
[0013] (1) By retrieving the microgrid operation timing data of the historical time period based on the grid-connected and off-grid instructions to be executed and performing multi-scale decomposition on these data, it is possible to extract system oscillation signals from different time scales and more accurately analyze the dynamic oscillation trend of the microgrid, such as the change pattern of the microgrid at different time scales of frequency and voltage fluctuations.
[0014] (2) Through the analysis of multi-scale oscillation signals, the stability index of the microgrid can be generated in real time to reflect the operating status of the microgrid and its ability to cope with load fluctuations and power generation changes. This stability index, together with the operating parameters of the energy storage system and the main grid, is used as the input of the energy storage system auxiliary switching model to dynamically adjust the charging and discharging strategy of the energy storage system, thereby achieving effective response to load and power generation fluctuations during the microgrid on-grid and off-grid switching process.
[0015] (3) During the on-grid and off-grid switching process of the microgrid, the energy storage system is used to balance the power fluctuations caused by load fluctuations and changes in power generation. The energy storage system assisted switching model adopts a reinforcement learning model, which can autonomously optimize the control strategy of the energy storage system in the constant environmental changes, gradually improve the adaptability of the microgrid system, and ensure the stability of the switching process. Especially in the case of high fluctuations or grid failures, the charging and discharging strategy of the energy storage system is automatically adjusted to accurately adjust or compensate for the frequency and / or voltage of the microgrid and suppress transient fluctuations of the grid.
[0016] Through this technical solution, multi-scale oscillation signal analysis and reinforcement learning models are introduced. When facing grid fluctuations caused by emergencies, the charging and discharging strategies of the energy storage system in the microgrid are adaptively adjusted to ensure that the microgrid can smoothly and reliably complete the on-grid and off-grid switching, thereby improving the reliability and flexibility of the microgrid and the main grid on-grid and off-grid switching. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 A flowchart showing an example of a method for controlling on-grid and off-grid switching of a microgrid according to an embodiment of the present application is shown;
[0019] Figure 2 A schematic diagram showing an example of a state transition action in a reinforcement learning model;
[0020] Figure 3 An operation flow chart of an example of extracting a multi-scale oscillation signal from microgrid operation timing data according to an embodiment of the present application is shown;
[0021] Figure 4 An operation flow chart of an example of determining a microgrid stability index according to a multi-scale oscillation signal according to an embodiment of the present application is shown;
[0022] Figure 5 Shown according to Figure 1 An exemplary operation flow chart of step S130 in FIG.
[0023] Figure 6 A structural block diagram of an example of an on-grid and off-grid switching control system of a microgrid according to an embodiment of the present application is shown;
[0024] Figure 7 It is a schematic structural diagram of an embodiment of an electronic device of the present application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme of the embodiments of the present application will be clearly and completely described below in conjunction with the drawings of the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the described embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0026] Unless otherwise defined, the technical terms or scientific terms used in this application should be understood by people with ordinary skills in the field to which this application belongs. "First", "second" and similar words used in this application do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, similar words such as "one", "one" or "the" do not indicate quantitative restrictions, but indicate the existence of at least one. "Include" or "comprises" and other similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and other similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0027] It should be noted that the terms "up", "down", "left", "right", "front", "back", etc. used in this application are only used to indicate relative position relationships. When the absolute position of the object being described changes, the relative position relationship may also change accordingly.
[0028] Figure 1 A flowchart of an example of a method for controlling on-grid and off-grid switching of a microgrid according to an embodiment of the present application is shown.
[0029] Regarding the executor of the method of the embodiment of the present application, it can be any controller or processor with computing or processing capabilities. By combining multi-scale decomposition, stability indicator feedback and reinforcement learning to optimize the charging and discharging strategy of the energy storage system, a more intelligent and adaptive microgrid on-grid and off-grid switching control method is proposed. Based on the adjustment of the intelligent energy storage discharge strategy, the response speed and control accuracy of the system are optimized, thereby significantly improving the operating reliability and energy utilization efficiency of the microgrid, reducing the risk of equipment aging and failure, and ensuring that the microgrid can operate efficiently and stably in a complex environment.
[0030] In some examples, it may be integrated and configured in the e-government system server through software, hardware, or a combination of software and hardware, and the type of the e-government system server may be diverse, such as a mobile phone, tablet computer, or desktop computer, etc.
[0031] like Figure 1 As shown, in step S110, based on the grid-connection and off-grid instruction to be executed, the microgrid operation timing data corresponding to the preset historical time period is retrieved, and the microgrid operation timing data is decomposed at multiple scales to extract oscillation signals from different time scales.
[0032] Here, the grid-connection and off-grid instruction is a grid-connection instruction or an off-grid instruction, and the microgrid operation timing data includes microgrid frequency timing information and / or microgrid voltage timing information.
[0033] In some embodiments, a grid-connection or off-grid instruction is received from an external control module through a system interface. The instruction may be issued according to the current operating state of the microgrid (such as grid failure, load change, etc.), or it may be triggered by an active operation of a user, which should not be limited here. In addition, under the request trigger of the grid-connection or off-grid instruction, the microgrid system searches and retrieves the microgrid operation timing data within a preset time period (for example, 1 week or 1 month, etc.) in the past, and may pay special attention to the historical operation timing data related to the current grid-connection or off-grid operation as a reference for voltage or frequency fluctuations.
[0034] Here, the multi-scale analysis method can be diverse, such as wavelet transform, empirical mode decomposition (EMD) and other signal processing technologies to perform multi-scale decomposition on the microgrid operation sequence data, so as to extract oscillation signals of different frequency components, such as low-frequency components and high-frequency components. The oscillation signal of the low-frequency component reflects the relatively slow system oscillation changes, and the oscillation signal of the high-frequency component captures the instantaneous voltage or frequency fluctuations.
[0035] Therefore, by retrieving the microgrid operation timing data of the historical time period based on the grid-connected and off-grid instructions to be executed and performing multi-scale decomposition on these data, it is possible to extract system oscillation signals from different time scales and more accurately analyze the dynamic oscillation trend of the microgrid, such as the change pattern of the microgrid at different time scales of frequency and voltage fluctuations.
[0036] In step S120, a corresponding microgrid stability index is determined according to the extracted multi-scale oscillation signal.
[0037] Here, the microgrid stability index can be constructed based on the multi-scale oscillation signal, such as the quantitative parameters related to the frequency fluctuation amplitude, voltage fluctuation amplitude and its change rate reflected by the multi-scale oscillation signal. Exemplarily, the microgrid stability index can include indicators of the frequency fluctuation amplitude, voltage fluctuation amplitude, system recovery response time and other types of indicators, and the frequency fluctuation amplitude and voltage fluctuation amplitude can be used to reflect the fluctuation range of the system frequency and voltage, and the system recovery response time can be used to reflect the time it takes for the system to recover from an abnormal state to a stable state.
[0038] Therefore, by analyzing the multi-scale oscillation signal, the stability index of the microgrid can be generated in real time to reflect the operating status of the microgrid and its ability to cope with load fluctuations and power generation changes. In addition, by real-time monitoring of the stability index, unstable factors in the microgrid system (such as excessive frequency or voltage fluctuations) can be discovered in time to avoid excessive fluctuations or failures during the switching process between on-grid and off-grid.
[0039] In step S130, the real-time operating parameters of the energy storage system and the real-time operating parameters of the main grid are obtained, and the input state of the energy storage system auxiliary switching model is defined based on the grid connection and off-grid instructions, the microgrid stability index, the real-time operating parameters of the energy storage system and the real-time operating parameters of the main grid, so as to determine the target charging and discharging strategy of the energy storage system through reinforcement learning.
[0040] It should be noted that during the on-grid and off-grid switching process of the microgrid, the energy storage system is used to balance the power fluctuations caused by load fluctuations and changes in power generation. In some embodiments, the microgrid system can also monitor the operating parameters of the energy storage system and the main grid in real time, such as the charging and discharging status, power, power demand, etc. of the energy storage system, as well as the frequency and voltage of the main grid, etc., and combine with the real-time data of the microgrid to enable the microgrid system to have a more comprehensive understanding of the current operating environment.
[0041] Figure 2 A schematic diagram showing an example of state transition actions in a reinforcement learning model.
[0042] like Figure 2 As shown, it involves actions corresponding to state transitions in the state space of multiple states S1 to Sn, for example, a1 represents the action of state transition from S1 to S2, a2 represents the action from S2 to S1, a3 represents the state transition from S1 to S3, and so on. Here, the corresponding state transition can occur based on the strategy, and each state transition strategy can be used to occur different transitions. For example, based on the transition strategy for state S1, action a2 or a3 can occur.
[0043] It should be noted that the range of another state (also called transferable state) that a state can transfer to may be restricted or conditional. For example, none of S1 to S3 will transfer to S4 to Sn, and the states that state S1 can transfer to are S2 and S3, and so on.
[0044] In some embodiments, each action has a corresponding action reward, and each action reward can be determined based on a preset reward function. Generally, if the transfer reward is larger, it can be considered that the transferred action is more valuable, and the system will give priority to executing this action. For example, if the reward corresponding to action a1 is greater than the reward corresponding to a3, it means that the transferred action a1 is more valuable.
[0045] Here, the energy storage system auxiliary switching model adopts a reinforcement learning model. Based on reinforcement learning, the charging and discharging strategy of the energy storage system is optimized through historical data and current environmental status. The reinforcement learning model uses state-action pairs (S, A) to represent the current system state and the charging and discharging decision of the energy storage system. Through multiple rounds of training and feedback, the reinforcement learning model can automatically adjust and generate a charging and discharging strategy for the energy storage system that meets the current environment, so as to achieve the stability, load fluctuation, and economy of the microgrid system.
[0046] It should be understood that the content of the charging and discharging strategy can be diverse, such as charging and discharging power, charging and discharging timing, load fluctuation response, optimal electricity price cost, etc., which are not limited here.
[0047] In some examples of the embodiments of the present application, the action space of the auxiliary switching model of the energy storage system is defined by the adjustment range of the charge and discharge power of the energy storage system, and the corresponding target charge and discharge strategy includes the target charge and discharge power adjustment amount for the energy storage system. The charge and discharge power adjustment range of the energy storage system is set according to its maximum charging power, maximum discharge power and current battery state (such as SOC state). Specifically, the action space of the system can be defined as the power range that the energy storage system can adjust within a certain time window. For charging, the action space includes the interval from the minimum charging power to the maximum charging power; for discharging, the action space is defined as the interval from the minimum discharge power to the maximum discharge power.
[0048] Reinforcement learning models (such as Q-learning, DQN (Deep Q-Network), PPO (Proximal Policy Optimization), etc.) will update the strategy after each operation. Specifically, after each charge and discharge power adjustment, the energy storage system will calculate the adjusted system state and adjust the next strategy based on the result of the state. For example, if the stability of the system is improved after this adjustment, the reinforcement learning model will increase the weight of similar operations; if the stability deteriorates, the strategy will be adjusted accordingly to reduce the execution of similar adjustments.
[0049] Therefore, the target charging and discharging power adjustment amount for the energy storage system output by the reinforcement learning model enables the system to decide whether to adjust the charging and discharging power state of the energy storage system by a corresponding amount according to the current state and demand.
[0050] In step S140, when it is detected that the microgrid executes a grid connection or off-grid instruction, the energy storage system is controlled to execute a target charging and discharging strategy.
[0051] In some embodiments, the microgrid system continuously monitors the response execution status of the on-grid and off-grid instructions. Once the system detects that the microgrid is executing the on-grid and off-grid instructions, the energy storage system control module is immediately started, and the corresponding charging and discharging operations of the energy storage system are implemented by controlling the charging and discharging equipment (such as inverters, battery management systems, etc.) of the energy storage system according to the target charging and discharging strategy generated by reinforcement learning.
[0052] It should be noted that when the microgrid is connected to the main grid, since the power supply of the main grid is usually stable and sufficient, the energy storage system can mainly perform charging operations to absorb the excess power generated by the microgrid. For example, when the power generation of solar or wind power exceeds the load demand, the charging process absorbs the excess power for subsequent use, which also helps to balance the grid load and reduce grid fluctuations. On the other hand, when the microgrid is disconnected from the main grid (i.e., off-grid), the main grid is no longer available, and the energy storage system can perform discharging operations to support the microgrid to provide a stable power supply to the local load through the energy storage system, and help maintain the stability of voltage and frequency. Therefore, through real-time monitoring and the guidance of the reinforcement learning model, it is ensured that the energy storage system is charged and discharged according to the optimal strategy, thereby effectively suppressing voltage and frequency fluctuations and ensuring the stability of the microgrid during the switching process.
[0053] Figure 3 An operational flowchart of an example of extracting a multi-scale oscillation signal from microgrid operating timing data according to an embodiment of the present application is shown.
[0054] In step S310, the microgrid operation timing data is decomposed into multiple scales by wavelet transform to obtain local features of the microgrid operation signal at different scales.
[0055]
[0056] Where x(t) represents the microgrid operation timing data, t represents the time step, ψ(t) represents the mother wavelet function used for signal decomposition; W(a,b) is the wavelet transform coefficient, which represents the local characteristics of the signal x(t) at scale a and position b; a is the scale factor, which is used to control the expansion and contraction of the mother wavelet, where small scale corresponds to high-frequency components and large scale corresponds to low-frequency components; b is the translation factor, which is used to control the position of the mother wavelet to reflect the temporal local characteristics of the signal.
[0057] It should be noted that the wavelet transform can transform the signal from the time domain to the time-frequency domain, and decompose the non-stationary signal through wavelet basis functions of different scales, so as to capture the high-frequency components of short-term changes and the low-frequency components of long-term changes. By selecting a suitable mother wavelet function (such as Morlet wavelet, Daubechies wavelet, etc.), the multi-scale oscillation information in the frequency and voltage of the microgrid can be efficiently extracted. Preferably, the Morlet wavelet is selected as the mother wavelet function, which has the localization characteristics of both the frequency domain and the time domain, which is conducive to efficiently capturing the transient changes in the frequency signal of the microgrid.
[0058] Specifically, by selecting a smaller scale a, the instantaneous fluctuations of voltage and current are captured, reflecting the short-term instability that may occur when the microgrid is connected to or off the grid. By selecting a larger scale a, the long-term stability trend of the system is extracted, such as power fluctuations caused by changes in the microgrid load.
[0059] In step S320, the intrinsic mode function components of the microgrid operation timing data in different frequency ranges are extracted by empirical mode decomposition, and the instantaneous frequency of each intrinsic mode function component is calculated by Hilbert transform.
[0060] c i (t) = A i (t)·cos(2π·ν i (t)·t+φ i (t)), Formula (2)
[0061] In the formula, c i (t) is the i-th intrinsic mode function component, which represents the local oscillation component of the signal in the i-th frequency band; A i (t) is the instantaneous amplitude of the i-th intrinsic mode function component, which indicates the signal energy in the i-th frequency band; ν i (t) is the instantaneous frequency of the i-th eigenmode function component, which represents the local oscillation frequency of the signal in the i-th frequency band; φ i (t) is the phase of the i-th intrinsic mode function component, indicating the initial angle of the signal in the i-th frequency band.
[0062] It should be noted that HHT (Hilbert-Huang Transform) is an adaptive signal analysis method that can perform multi-scale analysis on complex, nonlinear and non-stationary signals. By decomposing the signal into intrinsic mode functions (IMF) and performing instantaneous frequency analysis, HHT can capture the dynamic changes of microgrid oscillations at multiple scales, especially the transient response of the power grid system during rapid switching.
[0063] Here, the processing of HHT includes EMD (Empirical Mode Decomposition) and Hilbert spectrum analysis. Specifically, through the EMD method, the microgrid signal is decomposed into multiple IMF components, which represent the oscillation components of different frequency bands in the signal. EMD does not require a predefined basis function, but gradually decomposes the signal through local information, so that it can automatically adapt to the dynamic changes of the microgrid. In the Hilbert spectrum analysis, each IMF component is Hilbert transformed to obtain the instantaneous frequency and amplitude, which can clearly identify whether the microgrid has high-frequency oscillation or low-frequency oscillation.
[0064] In step S330, the scale of the wavelet transform is mapped to the instantaneous frequency of the intrinsic mode function component based on a preset time window, so as to align the wavelet transform coefficients and the intrinsic mode function component in the frequency domain.
[0065]
[0066] In the formula, Δt represents the sampling period of the signal, f c represents the center frequency of the mother wavelet, represents the window time average of the instantaneous frequency, T w Indicates the length of the time window.
[0067] Here, in order to achieve alignment on the time scale, each IMF component c i (t) and the wavelet transform coefficients W(a,b) are mapped to the same time scale, and the temporal local alignment between the two is achieved through the time window matching technique. Specifically, the average instantaneous frequency in the time window The wavelet scale a is mapped to avoid the scale inconsistency problem caused by instantaneous frequency fluctuations. Thus, the time-frequency domain alignment of the wavelet transform and HHT results is achieved, ensuring the comparability and physical consistency of the feature extraction results of the two.
[0068] In step S340, each intrinsic mode function component and each wavelet transform coefficient are fused to determine a multi-scale oscillation signal.
[0069]
[0070]
[0071] In the formula, represents the fused multi-scale oscillation signal, α i represents the fusion weight of the i-th intrinsic mode function component, β a,b represents the fusion weight of W(a,b), E i and Ej denote the energy of the i-th intrinsic mode function component and the energy of the j-th intrinsic mode function component, respectively, and E a,b and E a′,b′ denote the energies of W(a,b) and W(a',b') respectively.
[0072] It should be noted that the multi-scale local features of the signal extracted by wavelet transform mainly reflect high-frequency and low-frequency oscillations. In the Hilbert-Huang transform, the instantaneous frequency and amplitude of the signal are extracted by the IMF component to reflect the dynamic time-frequency characteristics of the signal. Finally, by weighted averaging, the multi-scale local features of the wavelet transform and the instantaneous time-frequency features of the HHT are combined to generate a more comprehensive integrated oscillation signal, forming an oscillation signal with multi-scale and time-frequency features, providing a more representative time-frequency oscillation representation of the microgrid system state.
[0073] Here, α i and β a,b is a weight coefficient adaptively determined based on the local energy contribution. Specifically, high-energy IMF components correspond to the main oscillation components of the system and have a higher corresponding weight, while low-energy IMF components correspond to noise or secondary components and have a lower corresponding weight. In addition, the energy of the wavelet coefficients at all scales a and time positions b is normalized to obtain the weight β a,b , high-frequency wavelet coefficients correspond to the fast dynamic response of the system, and the weight is higher when the energy is larger; low-frequency wavelet coefficients correspond to the slow dynamic characteristics of the system, and the weight is determined according to its energy contribution. Therefore, the weight α i and β a,b It is calculated based on the local energy contribution of the signal component and can be adaptively adjusted according to the energy distribution of the actual oscillation signal without the need to manually set fixed weights, allowing the system to dynamically adjust the influence of each feature.
[0074] It should be noted that although both wavelet transform and Hilbert-Huang transform (HHT) are time-frequency analysis methods, they differ in time-frequency resolution. Specifically, in wavelet transform, high-frequency resolution is high and low-frequency resolution is poor, while HHT has better time-frequency resolution. When the wavelet transform results and HHT results are directly fused, time-frequency inconsistency may occur, affecting the accuracy of the final result.
[0075] In view of this, in some examples of the embodiments of the present application, in order to solve the time-frequency coupling problem of wavelet transform and HHT, time-frequency consistency verification is introduced to verify the consistency of the two in the time-frequency domain by calculating the mutual correlation coefficient between the two in the time window.
[0076] More specifically, in some implementations of step S330 , the correlation coefficients between the IMF components and the wavelet transform coefficients within a preset time window are calculated.
[0077]
[0078] In the formula, R i,a (t) represents the intrinsic mode function component c i (t) and the wavelet transform coefficients W(a,b) in the time window [t,t+T w ] within the correlation.
[0079] Specifically, R i,a (t) ranges from [-1,1], if R i,a (t)≈1, it means that the wavelet and HHT have high time-frequency consistency within the time window and can be fused.
[0080] The mutual correlation coefficient is compared with the preset correlation threshold γ. If R i,a (t)<γ, the intrinsic mode function components and wavelet transform coefficients of the corresponding time window are eliminated.
[0081] If R i,a (t)≥γ, it is confirmed that the intrinsic mode function component and the wavelet transform coefficient have good time-frequency consistency in the corresponding time window, and the scale of the wavelet transform is mapped to the instantaneous frequency of the intrinsic mode function component based on the preset time window, so as to align the wavelet transform coefficient and the intrinsic mode function component in the frequency domain.
[0082] Through the embodiment of the present application, a time-frequency consistency verification link is introduced to calculate the mutual correlation coefficient of the wavelet transform coefficient and the IMF component within the time window to measure the time-frequency matching degree of the two. Thus, by eliminating the redundant noise components of time-frequency mismatch, the difference in time-frequency resolution between the wavelet transform and the HHT is solved, ensuring that the fusion of signal features is more consistent and accurate, and effectively improving the reliability and stability of oscillation feature extraction.
[0083] Figure 4 An operational flowchart of an example of determining a microgrid stability index based on a multi-scale oscillation signal according to an embodiment of the present application is shown.
[0084] like Figure 4 As shown, in step S410, the amplitude variation of the multi-scale oscillation signal is extracted, and the root mean square of the oscillation amplitude is calculated.
[0085]
[0086] In the formula, represents the instantaneous amplitude of the multi-scale oscillation signal, S amp The oscillation amplitude index of a multi-scale oscillation signal is used to measure the strength of the signal oscillation.
[0087] Here, the size of the oscillation amplitude index reflects the dynamic response amplitude of the microgrid system. An excessively large amplitude indicates that there are significant voltage or frequency fluctuations in the system.
[0088] In step S420, the instantaneous frequency of the multi-scale oscillation signal is calculated based on the Hilbert transform, and the standard deviation of the instantaneous frequency is calculated to determine the frequency fluctuation index of the oscillation signal.
[0089]
[0090] In the formula, S freq The frequency fluctuation index representing the multi-scale oscillation signal is used to measure the dynamic stability of the system; represents the instantaneous frequency of the multi-scale oscillating signal, Represents the time average of the instantaneous frequency.
[0091] Here, the standard deviation of the instantaneous frequency is calculated to measure the degree of fluctuation of the instantaneous frequency, which reflects the dynamic stability of the system. The greater the frequency fluctuation, the more unstable the microgrid system is.
[0092] In step S430, the total energy of the multi-scale oscillation signal is calculated, and the high-frequency energy is separated by a bandpass filter, and then the energy proportion of the high-frequency part is counted.
[0093]
[0094] In the formula, E w Represents the total energy of the multi-scale oscillation signal in the time window, E hf Represents the high-frequency energy obtained by bandpass filtering, S hf Indicates the high-frequency energy ratio.
[0095] Here, the comprehensive oscillation signal is calculated The total energy of the system is obtained by bandpass filtering, and the proportion of energy in the high-frequency and low-frequency regions is obtained. The higher the proportion of high-frequency energy, the stronger the high-frequency instability component in the system.
[0096] In step S440, the microgrid stability index is calculated according to the amplitude index, the frequency fluctuation index and the high-frequency energy proportion index of the multi-scale oscillation signal.
[0097] S stb =w1·S amp +w2·S freq +w3·S hf , Formula (17)
[0098] In the formula, S stb represents the comprehensive stability index, w1, w2 and w3 represent the weighting coefficients of the oscillation amplitude index, frequency fluctuation index and high-frequency energy proportion index respectively.
[0099] Here, the oscillation amplitude characteristics, frequency fluctuation characteristics and high-frequency energy proportion of the comprehensive oscillation signal are combined to construct a comprehensive stability index of the microgrid through weighted linear combination. In addition, the stability index S stable The numerical range of the microgrid system is divided into different levels, such as S stable <θ1 indicates that the system is in a stable state, S stable ≥θ2 indicates that the system has severe transient oscillation.
[0100] Through the embodiments of the present application, by extracting the amplitude index, frequency fluctuation index and high-frequency energy proportion index of the fused oscillation signal, the dynamic characteristics of the microgrid can be comprehensively quantified, the dynamic response characteristics of the microgrid can be accurately captured, and it will also help to conduct real-time and quantitative evaluation of the dynamic stability of the system during the on-grid and off-grid switching process.
[0101] Figure 5 Shown according to Figure 1 An example operation flow chart of step S130 in FIG.
[0102] like Figure 5 As shown, in step S510, it is detected whether the grid connection and off-grid instruction is a grid connection instruction or an off-grid instruction.
[0103] In step S521, when the on-grid and off-grid instruction is an off-grid instruction, the microgrid stability index and the real-time operation parameters of the energy storage system are defined as the input state of the auxiliary switching model of the energy storage system to determine the target charging and discharging strategy of the energy storage system through reinforcement learning.
[0104] In step S523, when the grid-connection and off-grid instruction is a grid-connection instruction, the microgrid stability index, the real-time operating parameters of the energy storage system and the real-time operating parameters of the main grid are defined as the input state of the energy storage system auxiliary switching model to determine the target charging and discharging strategy of the energy storage system through reinforcement learning.
[0105] In the embodiment of the present application, the reinforcement learning model uses different operating modes according to different grid-connected and off-grid instructions, so that the system can make corresponding charging and discharging strategy adjustments according to different operating requirements (grid-connected or off-grid), effectively supporting the smooth switching of the microgrid.
[0106] Specifically, when off-grid, the charging and discharging strategy of the energy storage system is mainly to deal with local load fluctuations and unstable power generation. At this time, only the stability index of the microgrid and the operating status of the energy storage system itself can be considered. The discharge strategy is optimized through reinforcement learning, emphasizing the self-sufficiency within the microgrid to ensure that it can remain stable independently of the external power grid. When connected to the grid, the energy storage system not only needs to balance the local load, but also needs to work with the main grid to perform operations such as load regulation, frequency control and voltage stabilization. Therefore, in addition to considering the stability index of the microgrid and the real-time status of the energy storage system, the real-time operating parameters of the main grid will also be added to ensure that the energy storage system can effectively support the load of the microgrid when connected to the grid, and can maintain good coordination with the main grid to avoid excessive charging and discharging or imbalance.
[0107] Through the embodiments of the present application, different types of input states of different reinforcement learning models are defined under grid-connected and off-grid instructions, and the efficiency and stability of microgrid grid-connected and off-grid switching can be significantly improved by combining reinforcement learning to regulate the charging and discharging strategy of the energy storage system. Whether in grid-connected or off-grid mode, the system can make intelligent adjustments in real time according to the input state, optimize the use of energy storage resources, reduce over-regulation and under-regulation, improve emergency response capabilities, and ultimately achieve efficient, stable, and reliable operation of the microgrid.
[0108] As described above, the role and optimization objectives of the energy storage system are different in the microgrid grid-connected stage and the off-grid stage, and the state definitions in the corresponding energy storage system auxiliary switching model are also different. At this time, the reward functions of the reinforcement learning model in different operating modes can be distinguished accordingly to achieve optimization in different modes.
[0109] In some examples of the embodiments of the present application, when the on-grid and off-grid instruction is an off-grid instruction, the definition of states and actions in the auxiliary switching model of the energy storage system can refer to the description of the relevant parts in the above text, that is, the action space is defined by the adjustment range of the charging and discharging power of the energy storage system, and the corresponding target charging and discharging strategy includes a first target charging and discharging power adjustment amount for the energy storage system, which can effectively support the power supply target of the energy storage system to the microgrid in the off-grid mode.
[0110] On the other hand, when the grid-connection and off-grid instruction is a grid-connection instruction, the action space of the energy storage system auxiliary switching model is defined by the adjustment range of the charging and discharging power, voltage amplitude, phase and frequency of the energy storage system, and the target charging and discharging strategy includes the second target charging and discharging power adjustment amount, target voltage amplitude adjustment amount, target phase adjustment amount and target frequency adjustment amount for the energy storage system. In the grid-connection mode of the microgrid, special attention should be paid to the synchronization matching between the microgrid and the main grid, that is, the same frequency, same phase and same amplitude of the grid to ensure smooth grid connection. In addition, the microgrid auxiliary grid-connection operation based on the above energy storage system can occur in the pre-synchronization operation stage, that is, before the microgrid is connected to the main grid, the energy storage system is guided by the above reinforcement learning to correct the amplitude, frequency, phase and other parameters of the microgrid, and gradually adjust it to a state close to the main grid. Through the above pre-synchronization process, the smooth transition of the microgrid in the subsequent grid-connection with the main grid can be guaranteed, and the current shock and power shock at the moment of grid connection can be reduced, which also helps to improve the stability and power quality of the microgrid operation.
[0111] In some examples of the embodiments of the present application, in off-grid mode, the design goal of the reward function of the energy storage system auxiliary switching model is: to improve the stability of the microgrid itself and ensure stable power supply in island mode; at the same time, limit the power output of the energy storage system to prevent excessive discharge or charging of the equipment. In grid-connected mode, the design goal of the reward function of the energy storage system auxiliary switching model is: to ensure the synchronization of voltage, frequency and phase between the microgrid and the main grid to achieve stable grid connection; at the same time, smooth the power exchange between the microgrid and the main grid, reduce power shocks, and improve system operation stability.
[0112] More specifically, when the grid-connection and off-grid instruction is an off-grid instruction, the reward function of the energy storage system auxiliary switching model is:
[0113]
[0114] ΔS stb =S stb (m+1)-S stb (m), formula (19)
[0115] P bat (m) = P bat (m-1)+ΔP bat , Formula (20)
[0116] In the formula, R m_gd represents the reward value of the model for the off-grid command at sampling time m, which is used to measure the overall impact of the action taken by the energy storage system for the input state at time m on the off-grid switching of the microgrid; S stb (m) represents the comprehensive stability index of the microgrid at sampling time m; S stb(m+1) is the comprehensive stability index of the microgrid at sampling time m+1, which indicates the comprehensive stability performance of the microgrid after the energy storage system executes the charging and discharging strategy corresponding to the action; ΔS stb represents the improvement of microgrid stability after the action is executed at sampling time m, S stb_max is the maximum reference value of the comprehensive stability index, which is used for normalization; P bat (m) represents the actual charging and discharging power of the energy storage system at time m, P bat (m)>0 means the energy storage system is in charging state, P bat (m)<0 means the energy storage system is in the discharging state; P bat (m-1) represents the charging and discharging power of the energy storage system at time m-1; ΔP bat represents the power adjustment amount, which is determined by the charging and discharging strategy corresponding to the action output by the reinforcement learning model; P max Indicates the maximum charge and discharge power of the energy storage system; ∈ indicates a preset positive value to prevent the denominator from being zero; λ gd_1 The weight of the microgrid stability improvement, λ gd_2 represents the weight of the energy storage system power constraint, and λ gd_3 Indicates the weight of the performance reward item under the off-grid action.
[0117] Here, the amplitude term is improved by stability The improvement of the stability index of the microgrid is measured, so that the microgrid needs to achieve dynamic balance through the energy storage system when it is off-grid. The improvement of the stability index is the core goal. Control the charging and discharging power of the energy storage system to prevent overuse of the energy storage system, so that the energy storage system can assume the main power regulation function in the off-grid scenario. Constraining power output helps to extend the life of the equipment. Weigh the effectiveness of stability improvement and energy storage system power output, and guide efficient power regulation by maximizing this ratio. Thus, on the basis of stability improvement, the power utilization efficiency of the energy storage system is optimized and the overall regulation performance is improved.
[0118] Therefore, by maximizing the improvement of microgrid stability indicators, the voltage and frequency can be quickly stabilized in the isolated operation state, and the self-healing ability and operational reliability of the microgrid can be enhanced. The energy storage system can smooth out voltage and frequency fluctuations caused by load fluctuations or uneven distributed generation by adjusting power output in real time. In addition, through constraints, the energy storage system can be prevented from overcharging and discharging, ensuring the healthy operation of the equipment and extending the service life of the energy storage system.
[0119] On the other hand, when the grid-connection and off-grid instruction is a grid-connection instruction, the reward function of the energy storage system auxiliary switching model is:
[0120]
[0121] V dev (m) = V micro (m)-V grid (m), formula (22)
[0122] f dev (m) = f micro (m)-f grid (m), Formula (23)
[0123] P exchange (m)=|P micro (m)-P grid (m)| , Formula (24)
[0124] In the formula, R m_gc V represents the reward value of the model for the grid-connected instruction at sampling time m, which is used to measure the overall impact of the action taken by the energy storage system for the input state at time m on the grid-connected switching of the microgrid; micro (m) represents the voltage value of the microgrid at sampling time m, V grid (m) represents the voltage value of the main grid at sampling time m, V nom Indicates the rated voltage of the main power grid, V dev (m) represents the voltage deviation between the microgrid and the main grid at sampling time m; f micro (m) represents the frequency value of the microgrid at sampling time m, f grid (m) represents the frequency value of the main power grid at sampling time m, f nom Indicates the rated frequency of the main power grid, f dev (m) represents the frequency deviation between the microgrid and the main grid at sampling time m; P micro (m) represents the power demand of the microgrid at sampling time m, P grid (m) represents the supply power of the main grid at sampling time m, P micro _ max Represents the maximum power capacity of the microgrid, P exchange (m) represents the power exchange smoothing term at sampling time m; λ gc_1 represents the weight of the voltage deviation term, λ gc_2 represents the weight of the frequency deviation term, λ gc_3 represents the weight of the power exchange fluctuation term, λ gc_4 Represents the weight of the performance bonus item under the grid-connected action.
[0125] Here, the voltage deviation term The voltage difference between the microgrid and the main grid is measured to ensure voltage synchronization by minimizing the voltage deviation. Since the voltage difference during grid connection is a key factor affecting system stability, reducing the voltage deviation helps smooth the grid connection process. Measure the frequency difference between the microgrid and the main grid, and ensure frequency synchronization by minimizing the frequency deviation; since frequency synchronization is an important constraint in the grid connection process, reducing frequency fluctuations can prevent system oscillations. Power exchange fluctuation term Measures the power exchange fluctuation between the microgrid and the main grid, and ensures smooth power flow and protects grid stability by minimizing the fluctuation and reducing power overshoot or reverse flow. Measure the efficiency of microgrid stability improvement and energy storage system power output; achieve maximum stability improvement under limited power output conditions and improve the power regulation efficiency of the energy storage system.
[0126] Therefore, the voltage deviation term between the microgrid and the main grid is minimized to effectively smooth out voltage fluctuations, ensure that the microgrid voltage is quickly synchronized to the main grid voltage, and reduce voltage shocks. By minimizing the frequency deviation term, the frequency of the microgrid and the main grid can be accurately synchronized to prevent frequency oscillation and system instability. By controlling the power exchange fluctuation term, the power flow between the microgrid and the main grid is smoothed to avoid power overshoot and reverse flow, thereby ensuring the dynamic stability of the grid connection process. In addition, based on the action efficiency term, the energy storage system is guided to maximize stability under limited power output, thereby improving the dynamic robustness of the system.
[0127] Through the embodiments of the present application, the reward function is designed separately for the grid-connected command and the off-grid command, and the regulation requirements in different scenarios are fully considered. In the grid-connected scenario, the voltage, frequency synchronization and power exchange smoothness are optimized to ensure smooth grid connection with the main grid. In the off-grid scenario, the dynamic stability of the microgrid itself and the power safety of the energy storage system are optimized to ensure stable operation in the island mode, thereby achieving the directional optimization goal of the microgrid for different operation modes.
[0128] In some examples of the embodiments of the present application, the energy storage system auxiliary switching model is optimized based on the PPO algorithm and through iterative training using a training sample set.
[0129] Specifically, the training sample set includes input states, actions and reward feedback in the microgrid operation scenario, specifically including input states, grid-connected command states and off-grid command states. The input state includes the key features of the current operating state of the microgrid, the grid-connected command state includes the microgrid voltage deviation, frequency deviation, power exchange fluctuation, microgrid stability index, energy storage system operating parameters and main grid operating parameters, etc. The off-grid command state includes the microgrid stability index and energy storage system operating parameters (such as charging and discharging power). The action includes the charging and discharging power adjustment of the energy storage system. The reward is calculated by the reward function, and the specific form can be referred to the records of the relevant embodiments above.
[0130] In terms of the collection and simulation platform of training data, the grid-connected and off-grid instruction states of the microgrid are simulated through the simulation platform or actual operating environment of the microgrid system to obtain dynamic change data such as voltage, frequency, and power. For example, a microgrid simulation platform is built with the help of dynamic simulation software (such as MATLAB / Simulink, PSCAD, etc.), and various simulation components are designed in the platform, including microgrid models, main grid models, grid-connected and off-grid controllers, load change modules, etc. Furthermore, the dynamic simulation platform of the microgrid is used to generate training data, which should cover a variety of working conditions, such as different load fluctuation scenarios, different distributed energy generation fluctuation scenarios, and dynamic switching scenarios in grid-connected and off-grid modes. Finally, the sample data can be stored by indexing in units of time steps. On the other hand, the actual microgrid operation log data can also be collected to further expand the training data, so that a high-quality training sample set can be generated through the simulation platform and actual data collection to support the strategy optimization training of the PPO algorithm in the microgrid scenario.
[0131] In the training optimization of the reinforcement learning model based on the PPO algorithm, the policy network and the value network are mainly included. θ (a t |s t ) can use a neural network structure (such as a multi-layer perceptron MLP) and input the current state s t , output action probability distribution a t (Charge and discharge power adjustment of energy storage system). Value Network V φ (s t ) is used to estimate the current state s t The state value of the action strategy provides a reference for optimizing the action strategy.
[0132] The training process of the PPO algorithm adopts a combination of strategy iteration and value estimation. The specific steps are as follows:
[0133] 1) Sampling data
[0134] Use the current policy network π θ (at |s t ) interacts with the microgrid simulation environment and collects training samples {s t ,a t ,R t ,s t+1}.
[0135] 2) Calculate the advantage function
[0136] Using the State Value Network V φ (s t ) Estimate the state value.
[0137] 3) Update the policy network
[0138] Use the clipping objective function to limit the policy update amplitude and avoid policy collapse during training.
[0139] 4) Update the value network
[0140] The state-value network is updated using the mean squared error loss function.
[0141] 5) Strategy iteration and convergence judgment
[0142] The sampling and updating process is repeated until the strategy converges, that is, the mean of the reward function reaches a stable state.
[0143] It should be noted that in the PPO algorithm, the policy update range is limited by designing a clipping objective function to avoid large fluctuations in the policy network during training, which can prevent the "policy collapse" phenomenon. This design ensures that the policy update range is within a reasonable range, effectively balances exploration and utilization, and improves the stability of model training.
[0144] The following will also be compared with other types of reinforcement learning optimization algorithms. DQN (Deep Q-Network) is only applicable to discrete action spaces and it is difficult to accurately output continuous power control strategies; TRPO (Trust Region Policy Optimization) has strict restrictions on strategy updates, but the computational cost is high and the training efficiency is low. In contrast, the PPO algorithm has a low computational complexity while ensuring the stability of strategy updates, which is suitable for the high real-time requirements of microgrids.
[0145] Through the embodiment of the present application, PPO adopts a combination of policy iteration and advantage function estimation to achieve efficient optimization of the policy network under the condition of limited training samples. Specifically, PPO iterates the same batch of samples multiple times with a smaller update step size, thereby improving the utilization efficiency of samples; in addition, by estimating the advantage function, it guides the gradient update of the policy network and optimizes the overall benefit of the strategy.
[0146] The on-grid and off-grid switching control system of the microgrid provided in the present application is described below. The on-grid and off-grid switching control system of the microgrid described below and the on-grid and off-grid switching control method of the microgrid described above can be referenced to each other.
[0147] Figure 6 A structural block diagram of an example of an on-grid or off-grid switching control system of a microgrid according to an embodiment of the present application is shown.
[0148] like Figure 6 As shown, the microgrid on-grid and off-grid switching control system 600 includes a microgrid data retrieval unit 610, a stability index extraction unit 620, a charging and discharging strategy determination unit 630 and a charging and discharging strategy execution unit 640.
[0149] The microgrid data retrieval unit 610 is used to retrieve the microgrid operation timing data corresponding to a preset historical time period based on the grid-connected and off-grid instructions to be executed, and perform multi-scale decomposition on the microgrid operation timing data to extract oscillation signals from different time scales; the grid-connected and off-grid instructions are grid-connected instructions or off-grid instructions, and the microgrid operation timing data includes microgrid frequency timing information and / or microgrid voltage timing information.
[0150] The stability index extraction unit 620 is used to determine the corresponding microgrid stability index according to the extracted multi-scale oscillation signal.
[0151] The charging and discharging strategy determination unit 630 is used to obtain the real-time operating parameters of the energy storage system and the real-time operating parameters of the main power grid, and define the input state of the energy storage system auxiliary switching model based on the grid-connection and off-grid instructions, the microgrid stability index, the real-time operating parameters of the energy storage system and the real-time operating parameters of the main power grid, so as to determine the target charging and discharging strategy of the energy storage system through reinforcement learning; the energy storage system auxiliary switching model adopts a reinforcement learning model.
[0152] The charging and discharging strategy execution unit 640 is used to control the energy storage system to execute the target charging and discharging strategy when it is detected that the microgrid executes the grid connection and disconnection instruction.
[0153] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of actions combined, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application. In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0154] In some embodiments, an embodiment of the present application provides a non-volatile computer-readable storage medium, in which one or more programs including execution instructions are stored, and the execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute the above-mentioned microgrid on-grid and off-grid switching control method of the present application.
[0155] In some embodiments, the embodiments of the present application also provide a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the above-mentioned microgrid on-grid and off-grid switching control method.
[0156] In some embodiments, an embodiment of the present application also provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a microgrid on-grid and off-grid switching control method.
[0157] Figure 7 is a hardware structure diagram of an electronic device for executing a microgrid on-grid and off-grid switching control method provided by another embodiment of the present application, such as Figure 7 As shown, the device includes:
[0158] One or more processors 710 and memory 720, Figure 7 A processor 710 is taken as an example.
[0159] The device for executing the on-grid and off-grid switching control method of the microgrid may further include: an input device 730 and an output device 740 .
[0160] The processor 710, the memory 720, the input device 730 and the output device 740 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0161] The memory 720, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the on-grid and off-grid switching control method of the microgrid in the embodiment of the present application. The processor 710 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 720, that is, the on-grid and off-grid switching control method of the microgrid in the above method embodiment is realized.
[0162] The memory 720 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 720 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 720 may optionally include a memory remotely arranged relative to the processor 710, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0163] The input device 730 may receive input digital or character information and generate signals related to user settings and function control of the electronic device. The output device 740 may include a display device such as a display screen.
[0164] The one or more modules are stored in the memory 720, and when executed by the one or more processors 710, the microgrid on-grid and off-grid switching control method in any of the above method embodiments is executed.
[0165] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.
[0166] The electronic devices of the embodiments of the present application exist in various forms, including but not limited to:
[0167] (1) Mobile communication equipment: This type of equipment is characterized by having mobile communication functions and its main purpose is to provide voice and data communications. This type of terminal includes: smart phones, multimedia phones, functional phones, and low-end phones.
[0168] (2) Ultra-mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, etc.
[0169] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players, handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0170] (4) Other onboard electronic devices with data interaction functions, such as on-board devices installed in vehicles.
[0171] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0172] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0173] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A microgrid on-grid and off-grid switching control method, comprising: Based on the on-grid and off-grid instruction to be executed, the microgrid operation timing data corresponding to the preset historical time period is retrieved, and the microgrid operation timing data is decomposed at multiple scales to extract oscillation signals from different time scales; the on-grid and off-grid instruction is a on-grid instruction or an off-grid instruction, and the microgrid operation timing data includes microgrid frequency timing information and / or microgrid voltage timing information; According to the extracted multi-scale oscillation signals, the corresponding microgrid stability index is determined; Acquire the real-time operating parameters of the energy storage system and the real-time operating parameters of the main grid, and define the input state of the auxiliary switching model of the energy storage system based on the grid-connection and off-grid instructions, the microgrid stability index, the real-time operating parameters of the energy storage system and the real-time operating parameters of the main grid, so as to determine the target charging and discharging strategy of the energy storage system through reinforcement learning; The energy storage system auxiliary switching model adopts a reinforcement learning model; When it is detected that the microgrid executes the grid connection and disconnection instruction, the energy storage system is controlled to execute the target charging and discharging strategy.
2. The method according to claim 1, wherein: The multi-scale decomposition of the microgrid operation time series data to extract oscillation signals from different time scales includes: The microgrid operation timing data is decomposed into multiple scales through wavelet transform to obtain the local characteristics of the microgrid operation signal at different scales: Where x(t) represents the microgrid operation time series data, t represents the time step, ψ(t) represents the mother wavelet function used for signal decomposition; W(a,b) is the wavelet transform coefficient, which represents the local characteristics of the signal x(t) at scale a and position b; a is the scale factor, which is used to control the expansion and contraction of the mother wavelet, where the small scale corresponds to the high-frequency component and the large scale corresponds to the low-frequency component; b is the translation factor, which is used to control the position of the mother wavelet to reflect the temporal local characteristics of the signal; The empirical mode decomposition method is used to extract the intrinsic mode function components of the microgrid operation timing data in different frequency ranges, and the Hilbert transform is used to calculate the instantaneous frequency of each intrinsic mode function component: c i (t)=A i (t)·cos(2π·ν i (t)·t+φ i (t)), In the formula, c i (t) is the i-th intrinsic mode function component, which represents the local oscillation component of the signal in the i-th frequency band; A i (t) is the instantaneous amplitude of the i-th intrinsic mode function component, which indicates the signal energy in the i-th frequency band; ν i (t) is the instantaneous frequency of the i-th eigenmode function component, which represents the local oscillation frequency of the signal in the i-th frequency band; φ i (t) is the phase of the i-th intrinsic mode function component, indicating the initial angle of the signal in the i-th frequency band; Based on the preset time window, the scale of the wavelet transform is mapped to the instantaneous frequency of the intrinsic mode function component, and the wavelet transform coefficients and the intrinsic mode function components are aligned in the frequency domain: In the formula, Δt represents the sampling period of the signal, f c represents the center frequency of the mother wavelet, represents the window time average of the instantaneous frequency, T w Indicates the length of the time window; Each intrinsic mode function component and each wavelet transform coefficient are fused to determine the multi-scale oscillation signal: In the formula, represents the fused multi-scale oscillation signal, α i represents the fusion weight of the i-th intrinsic mode function component, β a,b represents the fusion weight of W(a,b), E i and E j denote the energy of the i-th intrinsic mode function component and the energy of the j-th intrinsic mode function component, respectively, and E a,b and E a′,b′ denote the energies of W(a,b) and W(a',b') respectively.
3. The method according to claim 2, wherein: The method of mapping the scale of the wavelet transform to the instantaneous frequency of the intrinsic mode function component based on the preset time window, and aligning the wavelet transform coefficients and the intrinsic mode function component in the frequency domain, includes: Calculate the cross-correlation coefficients between the IMF components and the wavelet transform coefficients within a preset time window: In the formula, R i,a (t) represents the intrinsic mode function component c i (t) and the wavelet transform coefficients W(a,b) in the time window [t,t+T w ]; The mutual correlation coefficient is compared with the preset correlation threshold γ. If R i,a (t)<γ, then the intrinsic mode function components and wavelet transform coefficients of the corresponding time window are eliminated; If R i,a (t)≥γ, it is confirmed that the intrinsic mode function component and the wavelet transform coefficient have good time-frequency consistency within the corresponding time window, and the scale of the wavelet transform is mapped to the instantaneous frequency of the intrinsic mode function component based on the preset time window, so as to align the wavelet transform coefficient and the intrinsic mode function component in the frequency domain.
4. The method according to claim 2, wherein: Determining the corresponding microgrid stability index according to the extracted multi-scale oscillation signal includes: Extract the amplitude changes of multi-scale oscillation signals and calculate the root mean square of the oscillation amplitude: In the formula, represents the instantaneous amplitude of the multi-scale oscillation signal, S amp The oscillation amplitude index of the multi-scale oscillation signal is used to measure the intensity of the signal oscillation; The instantaneous frequency of the multi-scale oscillation signal is calculated based on the Hilbert transform, and the standard deviation of the instantaneous frequency is statistically analyzed to determine the frequency fluctuation index of the oscillation signal: In the formula, S freq The frequency fluctuation index representing the multi-scale oscillation signal is used to measure the dynamic stability of the system; represents the instantaneous frequency of the multi-scale oscillating signal, represents the time average of the instantaneous frequency; Calculate the total energy of the multi-scale oscillation signal, separate the high-frequency energy through a bandpass filter, and then count the energy proportion of the high-frequency part: In the formula, E w represents the total energy of the multi-scale oscillation signal in the time window, E hf Represents the high-frequency energy obtained by bandpass filtering, S hf Indicates the high-frequency energy ratio index; According to the amplitude index, frequency fluctuation index and high-frequency energy proportion index of the multi-scale oscillation signal, the microgrid stability index is calculated: S stb =w1·S amp +w2·S freq +w3·S hf , In the formula, S stb represents the comprehensive stability index, w1, w2 and w3 represent the weighting coefficients of the oscillation amplitude index, frequency fluctuation index and high-frequency energy proportion index respectively.
5. The method according to claim 1, wherein: The input state of the auxiliary switching model of the energy storage system is defined based on the grid connection and off-grid instruction, the microgrid stability index, the real-time operating parameters of the energy storage system and the real-time operating parameters of the main grid to determine the target charging and discharging strategy of the energy storage system through reinforcement learning, including: When the on-grid and off-grid instruction is an off-grid instruction, the microgrid stability index and the real-time operation parameter of the energy storage system are defined as input states of an auxiliary switching model of the energy storage system, so as to determine a target charging and discharging strategy of the energy storage system through reinforcement learning; and When the grid-connection and off-grid instruction is a grid-connection instruction, the microgrid stability index, the energy storage system real-time operating parameters and the main grid real-time operating parameters are defined as input states of the energy storage system auxiliary switching model to determine the target charging and discharging strategy of the energy storage system through reinforcement learning.
6. The method according to claim 5, wherein: When the on-grid and off-grid instruction is an off-grid instruction, the action space of the auxiliary switching model of the energy storage system is defined by an adjustment range of the charge and discharge power of the energy storage system, and the target charge and discharge strategy includes a first target charge and discharge power adjustment amount for the energy storage system; When the grid-connected and off-grid instruction is a grid-connected instruction, the action space of the auxiliary switching model of the energy storage system is defined by the adjustment range of the charging and discharging power, voltage amplitude, phase and frequency of the energy storage system, and the target charging and discharging strategy includes a second target charging and discharging power adjustment amount, a target voltage amplitude adjustment amount, a target phase adjustment amount and a target frequency adjustment amount for the energy storage system.
7. The method according to claim 6, wherein: When the grid-connection and off-grid instruction is an off-grid instruction, the reward function of the energy storage system auxiliary switching model is: ΔS stb =S stb (m+1)-S stb (m), P bat (m)=P bat (m-1)+ΔP bat , In the formula, R m_gd represents the reward value of the model for the off-grid command at sampling time m, which is used to measure the overall impact of the action taken by the energy storage system for the input state at time m on the off-grid switching of the microgrid; S stb (m) represents the comprehensive stability index of the microgrid at sampling time m; S stb (m+1) is the comprehensive stability index of the microgrid at sampling time m+1, which indicates the comprehensive stability performance of the microgrid after the energy storage system executes the charging and discharging strategy corresponding to the action; ΔS stb represents the improvement of microgrid stability after the action is executed at sampling time m, S stb_max is the maximum reference value of the comprehensive stability index; P bat (m) represents the actual charging and discharging power of the energy storage system at time m, P bat (m)>0 means the energy storage system is in charging state, P bat (m)<0 means the energy storage system is in the discharge state; P bat (m-1) represents the charging and discharging power of the energy storage system at time m-1; ΔP bat represents the power adjustment amount, which is determined by the charging and discharging strategy corresponding to the action output by the reinforcement learning model; P max Indicates the maximum charge and discharge power of the energy storage system; ∈ indicates a preset positive value to prevent the denominator from being zero; λ gd_1 The weight of the microgrid stability improvement, λ gd_2 represents the weight of the energy storage system power constraint, and λ gd_3 Indicates the weight of the performance reward item under the off-grid action; When the grid-connection and off-grid instruction is a grid-connection instruction, the reward function of the energy storage system auxiliary switching model is: In dev (m)=V micro (m)-V grid (m), f dev (m)=f micro (m)-f grid (m), P exchange (m)=|P micro (m)-P grid (m)|, In the formula, R m_gc V represents the reward value of the model for the grid-connected instruction at sampling time m, which is used to measure the overall impact of the action taken by the energy storage system for the input state at time m on the grid-connected switching of the microgrid; micro (m) represents the voltage value of the microgrid at sampling time m, V grid (m) represents the voltage value of the main grid at sampling time m, V nom Indicates the rated voltage of the main power grid, V dev (m) represents the voltage deviation between the microgrid and the main grid at sampling time m; f micro (m) represents the frequency value of the microgrid at sampling time m, f grid (m) represents the frequency value of the main power grid at sampling time m, f nom Indicates the rated frequency of the main power grid, f dev (m) represents the frequency deviation between the microgrid and the main grid at sampling time m; P micro (m) represents the power demand of the microgrid at sampling time m, P grid (m) represents the supply power of the main grid at sampling time m, P micro _ max Represents the maximum power capacity of the microgrid, P exchange (m) represents the power exchange smoothing term at sampling time m; λ gc_1 represents the weight of the voltage deviation term, λ gc_2 represents the weight of the frequency deviation term, λ gc_3 represents the weight of the power exchange fluctuation term, λ gc_4 Represents the weight of the performance bonus item under the grid-connected action.
8. The method according to claim 7, wherein: The energy storage system auxiliary switching model is optimized based on the PPO algorithm and through iterative training using a training sample set.
Citation Information
Cited By
Uninterruptible power supply method and system based on emergency energy storage power supply vehicle
CN120810902A
An uninterrupted power supply method and system based on an emergency energy storage power supply vehicle
CN120810902B