Emergency power equipment flexible grid-connected parameter dynamic optimization method based on reinforcement learning

By constructing an intelligent agent based on a deep Q-network using reinforcement learning, the grid connection parameters of emergency power generation equipment are dynamically optimized, solving the problem of fixed parameters in traditional controllers, realizing flexible grid connection of emergency power generation equipment, and improving grid stability and equipment lifespan.

CN122437142APending Publication Date: 2026-07-21STATE GRID FUJIAN ELECTRIC POWER RES INST +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
STATE GRID FUJIAN ELECTRIC POWER RES INST
Filing Date
2026-04-09
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Traditional emergency power generation equipment grid-connected controllers have fixed control parameters, making it difficult to adapt to grid load switching and frequency fluctuations. This results in large grid-connected inrush currents, affecting grid stability and equipment lifespan. Existing adaptive droop control lacks an online learning mechanism, and adjustments rely on manual experience, leading to slow response times.

Method used

A reinforcement learning-based approach is adopted to construct an agent through a deep Q-network, collect parameters such as voltage and phase angle deviation at the grid connection point, generate a standardized state vector, combine it with a preset set of adjustment actions, use a reward function to select the optimal adjustment action, dynamically optimize the droop coefficient, and realize the real-time update of the flexible grid-connected controller.

Benefits of technology

It effectively reduces grid connection inrush current, improves the grid connection stability and response speed of emergency power generation equipment, extends equipment life, reduces traditional trial and error costs, and improves grid connection reliability and learning efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122437142A_ABST
    Figure CN122437142A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of based on reinforcement learning's emergency power generation equipment flexible grid connection parameter dynamic optimization method, comprising the following steps: step S101: the operating parameter of emergency power generation equipment grid connection point is collected, and standardization state vector is generated;Step S102: according to standardization state vector, using the preset droop control parameter adjustment action set, obtain selected adjustment action;Step S103: according to selected adjustment action generation droop coefficient optimization instruction;Step S104: through flexible grid connection controller receives droop coefficient optimization instruction, updates the parameter setting of droop control equation, and according to the output voltage and frequency of updated droop control equation reacquires emergency power generation equipment.It can realize the dynamic self-adapting adjustment of droop coefficient, reduce grid connection impact, improve the grid connection reliability of emergency power generation equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power electronic control technology, specifically relating to a dynamic optimization method for flexible grid connection parameters of emergency power generation equipment based on reinforcement learning. Background Technology

[0002] Flexible grid connection is a key technology for the safe and rapid connection of emergency power generation equipment (such as diesel generator sets, gas generator sets, and energy storage emergency power supplies) to the power grid. Traditional grid connection controllers typically use fixed control parameters (such as voltage reference values ​​and frequency reference values), which are difficult to adapt to various operating conditions such as grid load switching and frequency fluctuations. This can easily lead to large inrush currents at the moment of grid connection, affecting grid stability and equipment lifespan.

[0003] Droop control is a commonly used grid-connected control strategy. It simulates the external characteristics of a synchronous generator by using an active power-frequency droop coefficient (m) and a reactive power-voltage droop coefficient (n) to achieve power distribution. However, the m and n coefficients in existing droop control systems are usually preset based on experience. When load switching or grid fluctuations occur, fixed parameters may lead to problems such as excessive phase angle deviation and severe voltage drops. Although some adaptive droop control schemes exist, they lack online learning mechanisms and cannot dynamically optimize the droop coefficients based on real-time operating conditions. Parameter adjustments still rely on manual experience or offline tuning, reducing grid-connected reliability and response speed.

[0004] Therefore, how to provide a method that can optimize droop control parameters in real time and online to reduce grid connection impact and improve grid connection stability is a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a dynamic optimization method for flexible grid connection parameters of emergency power generation equipment based on reinforcement learning, so as to realize dynamic adaptive adjustment of the droop coefficient, reduce grid connection impact, and improve the grid connection reliability of emergency power generation equipment.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: a dynamic optimization method for flexible grid connection parameters of emergency power generation equipment based on reinforcement learning, comprising the following steps:

[0007] Step S101: Collect the operating parameters of the emergency power generation equipment grid connection point and generate a standardized state vector;

[0008] Step S102: Based on the standardized state vector, adjust the set of actions using preset droop control parameters to obtain the selected adjustment action;

[0009] Step S103: Generate a sag coefficient optimization instruction based on the selected adjustment action;

[0010] Step S104: Receive the droop coefficient optimization command through the flexible grid-connected controller, update the parameter settings of the droop control equation, and re-obtain the output voltage and frequency of the emergency power generation equipment according to the updated droop control equation.

[0011] Furthermore, in step S101, the operating parameters include voltage deviation value, phase angle deviation value, load current value, and grid frequency fluctuation value.

[0012] Furthermore, the voltage deviation and phase angle deviation values ​​in the operating parameters are collected by a voltage sensor and a phase detector at a sampling frequency of no less than 20 times per second.

[0013] Further, in step S101, the process of collecting the operating parameters of the emergency power generation equipment grid connection point and generating a standardized state vector specifically involves:

[0014] After denoising the operating parameters using a sliding window filtering algorithm, the minimum-maximum normalization method is used to map them to the [0,1] interval to generate a standardized state vector.

[0015] Furthermore, in step S102, the preset set of droop control parameter adjustment actions includes multiple droop control parameter adjustment actions; the droop control parameter adjustment actions include the adjustment amount of the active power-frequency droop coefficient m and the adjustment amount of the reactive power-voltage droop coefficient n.

[0016] Further, in step S102, the step of adjusting the set of actions according to the standardized state vector using preset droop control parameters and obtaining the selected adjustment action specifically includes:

[0017] S1021: A reinforcement learning agent is constructed using a deep Q-network algorithm. The reinforcement learning agent takes a standardized state vector as input and adjusts its actions using droop control parameters as output.

[0018] S1022: After the reinforcement learning agent adjusts the action set according to the preset droop control parameters and outputs a droop control parameter adjustment action, obtain the standardized state vector after the action is executed.

[0019] S1023: Based on the standardized state vector after the action is executed, the reward value of the droop control parameter adjustment action is obtained using a reward function;

[0020] S1024: Repeat steps S1022-S1023 until all droop control parameter adjustment actions in the preset droop control parameter adjustment action set are traversed, and the droop control parameter adjustment action with the highest reward value is selected as the adjustment action.

[0021] Furthermore, in step S1021, the deep Q-network adopts a dual-branch input structure, including a first branch and a second branch;

[0022] The first branch is used to process high-frequency fluctuation parameters, including voltage deviation and phase angle deviation, and extracts transient impact features at the moment of grid connection through a 16-dimensional convolution kernel.

[0023] The second branch is used to process slowly varying steady-state parameters, including load current values ​​and grid frequency fluctuation values, and to mine load change trend characteristics through a 32-dimensional fully connected layer;

[0024] After the first and second branches are normalized by two BatchNorm layers, they are input into a three-layer shared hidden layer for fusion and output.

[0025] Furthermore, the activation function of the shared hidden layer is Leaky ReLU; high-risk samples with grid-connected inrush current greater than 1.1 times the rated current and voltage deviation or phase angle deviation greater than 50% of the maximum allowable value are assigned a sampling weight of 1.5 times.

[0026] Furthermore, step S1022 also includes an emergency scenario adaptive ε-exploration mechanism, specifically:

[0027] Let the overall deviation coefficient η = 0.6 × (ΔU / U) max )+0.4×(δ / δ max );

[0028] When η > 0.3, the exploration probability ε = 0.8 - 0.5η;

[0029] When η≤0.3, the exploration probability ε=0.1+0.2η;

[0030] Furthermore, the state vector is the average of three consecutive sampling periods within 0.5 seconds.

[0031] Further, in step S1023, the step of obtaining the reward value of the droop control parameter adjustment action based on the standardized state vector after the action is executed using a reward function specifically includes:

[0032] In the standardized state vector after the action is executed, let the voltage deviation value be ΔU and the phase angle deviation value be δ;

[0033] Let U max For the maximum allowable voltage deviation, δ max This is the maximum permissible phase angle deviation;

[0034] Obtain the grid-connected inrush current value I 冲击 ;

[0035] Obtain the rated current I of the emergency power generation equipment 额定 ;

[0036] Let the reward value for the droop control parameter adjustment action be R, then:

[0037] R = α×(1-ΔU / U max )-β×δ / δ max -γ×I 冲击 / I 额定 ;

[0038] Wherein, α, β, and γ are preset weighting coefficients.

[0039] Compared with the prior art, the present invention has the following beneficial effects:

[0040] 1. This invention is based on reinforcement learning technology. It constructs a reinforcement learning agent through a deep Q-network, collects operating parameters such as voltage deviation and phase angle deviation at the grid connection point of emergency power generation equipment, generates a standardized state vector through denoising and normalization, and combines it with a set of preset droop control parameters to adjust actions. The optimal adjustment action is selected through a reward function, realizing the dynamic optimization of the active power-frequency droop coefficient m and the reactive power-voltage droop coefficient n in the droop coefficient and the real-time updating of the parameters of the flexible grid-connected controller, thereby achieving seamless off-grid operation of emergency power generation equipment.

[0041] 2. This invention effectively alleviates the technical problems of fixed grid connection parameters, delayed adjustment, and reliance on manual experience in the prior art for emergency power generation equipment, which easily leads to grid connection shocks when load switching or grid fluctuations occur. At the same time, it improves grid connection stability and response speed, reduces the damage of inrush current to equipment to extend equipment life, and reduces the traditional trial and error cost through reinforcement learning online learning, thereby improving grid connection reliability.

[0042] 3. This invention uses a dual-branch deep Q-network structure to extract high-frequency transient impact features and slow-changing steady-state trend features respectively, and combines high-risk sample priority sampling to improve the learning efficiency and decision-making accuracy of the agent under critical conditions.

[0043] 4. This invention designs an adaptive ε-exploration mechanism for emergency scenarios, which dynamically adjusts the exploration probability based on the comprehensive deviation coefficient. When the working conditions are significant, it increases the exploration diversity to quickly find the optimal solution, and reduces exploration interference to maintain parameter stability when the working conditions are stable. At the same time, it adopts a multi-period mean state vector to effectively avoid random errors caused by electromagnetic interference. Attached Figure Description

[0044] Figure 1 This is a flowchart of a dynamic optimization method for flexible grid connection parameters of emergency power generation equipment based on reinforcement learning, provided in an embodiment of the present invention. Detailed Implementation

[0045] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0046] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0047] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0048] like Figure 1 As shown in the figure, this embodiment provides a method for dynamic optimization of flexible grid connection parameters of emergency power generation equipment based on reinforcement learning, and its implementation steps are as follows.

[0049] Step S101: Collect the operating parameters of the emergency power generation equipment grid connection point and generate a standardized state vector.

[0050] The operating parameters include voltage deviation, phase angle deviation, load current, and grid frequency fluctuation.

[0051] The process of collecting the operating parameters of the emergency power generation equipment grid connection point and generating a standardized state vector involves: denoising the operating parameters using a sliding window filtering algorithm, then mapping them to the [0,1] interval using a minimum-maximum normalization method to generate a standardized state vector.

[0052] The min-max normalization method is an existing data preprocessing technique that aims to linearly map the original data to a specific interval, typically [0, 1] or [-1, 1], to eliminate differences in the dimensions and magnitudes of different features, so that all features are on the same numerical scale.

[0053] The voltage deviation and phase angle deviation values ​​in the operating parameters are collected by a voltage sensor and a phase detector at a sampling frequency of no less than 20 times per second.

[0054] Step S102: Based on the standardized state vector, adjust the set of actions using preset droop control parameters and obtain the selected adjustment action.

[0055] The preset set of droop control parameter adjustment actions includes multiple droop control parameter adjustment actions; the droop control parameter adjustment actions include the adjustment amount of the active power-frequency droop coefficient m and the adjustment amount of the reactive power-voltage droop coefficient n.

[0056] The step of adjusting the set of actions based on the standardized state vector and using preset droop control parameters to obtain the selected adjustment action specifically includes the following steps.

[0057] S1021: A reinforcement learning agent is constructed using a deep Q-network algorithm. The reinforcement learning agent takes a standardized state vector as input and adjusts the action of the droop control parameter as output.

[0058] Specifically, to address the characteristics of scenarios with frequent transient impacts during emergency grid connection and rapid switching of operating conditions, the deep Q-network adopts a dual-branch input structure, including a first branch and a second branch.

[0059] The first branch is used to process high-frequency fluctuation parameters, including voltage deviation and phase angle deviation, and extracts transient impact features at the moment of grid connection through a 16-dimensional convolution kernel.

[0060] The second branch is used to process slowly varying steady-state parameters, including load current values ​​and grid frequency fluctuation values, and to mine load change trend characteristics through a 32-dimensional fully connected layer.

[0061] After the first and second branches are normalized by two BatchNorm layers, they are input into a three-layer shared hidden layer for fusion and output.

[0062] The activation function of the shared hidden layer is Leaky ReLU, which is used to avoid gradient vanishing.

[0063] High-risk samples with grid-connected inrush current greater than 1.1 times the rated current and voltage deviation or phase angle deviation greater than 50% of the maximum allowable value are assigned a sampling weight of 1.5 times to ensure that the agent learns the parameter adjustment strategy under critical operating conditions first, which is different from the uniform sampling mechanism of conventional DQN.

[0064] S1022: After the reinforcement learning agent adjusts the action set according to the preset droop control parameters and outputs a droop control parameter adjustment action, obtain the standardized state vector after the action is executed.

[0065] Step S1022 also includes an emergency scenario adaptive ε exploration mechanism, specifically:

[0066] Let the overall deviation coefficient η = 0.6 × (ΔU / U) max )+0.4×(δ / δ max );

[0067] When η > 0.3, the exploration probability ε = 0.8 - 0.5η;

[0068] When η≤0.3, the exploration probability ε=0.1+0.2η;

[0069] Furthermore, the state vector uses the average of three consecutive sampling periods within 0.5 seconds to avoid random errors in data at a single moment caused by electromagnetic interference, thus adapting to the complex electromagnetic environment of emergency scenarios.

[0070] S1023: Based on the standardized state vector after the action is executed, the reward value of the droop control parameter adjustment action is obtained using a reward function.

[0071] Specifically, obtaining the reward value for adjusting the droop control parameters based on the standardized state vector after the action is executed, using a reward function, includes:

[0072] In the standardized state vector after the action is executed, let the voltage deviation value be ΔU and the phase angle deviation value be δ;

[0073] Let U max For the maximum allowable voltage deviation, δ max For the maximum permissible phase angle deviation; in an optional embodiment, δ max It is 15 degrees;

[0074] Obtain the grid-connected inrush current value I 冲击 ;

[0075] Obtain the rated current I of the emergency power generation equipment 额定 ;

[0076] Let the reward value for the droop control parameter adjustment action be R, then:

[0077] R = α×(1-ΔU / U max )-β×δ / δ max -γ×I 冲击 / I 额定 ;

[0078] Wherein, α, β, and γ are preset weighting coefficients.

[0079] In an optional embodiment, the values ​​of α, β, and γ can be determined by empirical tuning, automated optimization, or constraint methods.

[0080] Experience-based optimization: Based on domain knowledge or historical data, manually adjust the values ​​of α, β, and γ, and verify the effect through simulation or field testing. For example, the initial values ​​can be set to α=0.5, β=0.3, and γ=0.2, and then fine-tuned according to the grid-connected inrush current and voltage fluctuations.

[0081] Automated optimization method: Uses grid search, random search, or Bayesian optimization algorithms to search for the optimal weight combination within a preset range. For example, define the search space α∈[0,1], β∈[0,1], γ∈[0,1], with the objective function being to minimize the grid-connected inrush current or maximize the reward value.

[0082] Constraint method: Set constraints based on system technical specifications, and then adjust α, β, and γ to maximize the reward function under these constraints. For example, if the inrush current must be less than 1.2 times the rated value, γ can be set higher to strengthen this constraint.

[0083] S1024: Repeat steps S1022-S1023 until all droop control parameter adjustment actions in the preset droop control parameter adjustment action set are traversed, and the droop control parameter adjustment action with the highest reward value is selected as the adjustment action.

[0084] Steps S1021-S1024 construct a reinforcement learning agent using a deep Q-network algorithm. The agent takes a standardized state vector as input and droop control parameter adjustment actions as output. It then obtains a new standardized state vector by executing the adjustment actions, calculates the reward value of the corresponding action using a reward function, and finally iterates through all preset droop control parameter adjustment actions, selecting the action with the highest reward value as the chosen adjustment action. This not only achieves intelligent and online autonomous decision-making for droop control parameter adjustment, eliminating reliance on human experience, but also ensures that the selected adjustment action is the optimal solution for the current grid connection point conditions through full action traversal and filtering, avoiding the blindness of traditional trial-and-error adjustments. Furthermore, by combining the reward value calculation with the state vector generated from real-time operating conditions, the parameter adjustment can quickly respond to changes in operating conditions such as load switching or grid fluctuations. This effectively alleviates the technical problems of existing adaptive droop control, such as lack of online learning mechanisms, adjustment lag, and inability to accurately match multi-state operating conditions, further improving the stability and reliability of emergency power generation equipment grid connection.

[0085] Step S103: Generate a droop coefficient optimization instruction based on the selected adjustment action.

[0086] The droop coefficient optimization command includes the adjustment amount of the active power-frequency droop coefficient m and the adjustment amount of the reactive power-voltage droop coefficient n.

[0087] Step S104: Receive the droop coefficient optimization command through the flexible grid-connected controller, update the parameter settings of the droop control equation, and re-obtain the output voltage and frequency of the emergency power generation equipment according to the updated droop control equation.

[0088] This invention provides a dynamic optimization method for flexible grid connection parameters of emergency power generation equipment based on reinforcement learning. Utilizing reinforcement learning technology, a reinforcement learning agent is constructed through a deep Q-network to collect operating parameters such as voltage deviation and phase angle deviation at the grid connection point of the emergency power generation equipment. After denoising and normalization, a standardized state vector is generated. Combined with a preset set of droop control parameter adjustment actions, the optimal adjustment action is selected through a reward function. This achieves dynamic optimization of the active power-frequency droop coefficient *m* and the reactive power-voltage droop coefficient *n* within the droop coefficient, and real-time updates of the flexible grid connection controller parameters. This enables seamless off-grid operation of the emergency power generation equipment. It effectively alleviates the technical problems of fixed grid connection parameters, delayed adjustments, and reliance on manual experience in existing technologies, which easily lead to grid connection shocks during load switching or grid fluctuations. Simultaneously, it improves grid connection stability and response speed, reduces equipment losses due to inrush current to extend equipment life, and reduces traditional trial-and-error costs through online reinforcement learning, thereby improving grid connection reliability.

[0089] This embodiment also provides a computer device, including at least one processor, at least one memory, and computer program instructions stored in the memory, which implement the above-described method when executed by the processor.

[0090] This embodiment also provides a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the above-described method.

[0091] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0092] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0093] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0094] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0095] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A dynamic optimization method for flexible grid connection parameters of emergency power generation equipment based on reinforcement learning, characterized in that, Includes the following steps: Step S101: Collect the operating parameters of the emergency power generation equipment grid connection point and generate a standardized state vector; Step S102: Based on the standardized state vector, adjust the set of actions using preset droop control parameters to obtain the selected adjustment action; Step S103: Generate a sag coefficient optimization instruction based on the selected adjustment action; Step S104: Receive the droop coefficient optimization command through the flexible grid-connected controller, update the parameter settings of the droop control equation, and re-obtain the output voltage and frequency of the emergency power generation equipment according to the updated droop control equation.

2. The method for dynamic optimization of flexible grid connection parameters of emergency power generation equipment based on reinforcement learning according to claim 1, characterized in that, In step S101, the operating parameters include voltage deviation, phase angle deviation, load current, and grid frequency fluctuation.

3. The method for dynamic optimization of flexible grid connection parameters of emergency power generation equipment based on reinforcement learning according to claim 2, characterized in that, The voltage deviation and phase angle deviation values ​​in the operating parameters are collected by a voltage sensor and a phase detector at a sampling frequency of no less than 20 times per second.

4. The method for dynamic optimization of flexible grid connection parameters of emergency power generation equipment based on reinforcement learning according to claim 1, characterized in that, In step S101, the process of collecting the operating parameters of the emergency power generation equipment grid connection point and generating a standardized state vector specifically involves: After denoising the operating parameters using a sliding window filtering algorithm, the minimum-maximum normalization method is used to map them to the [0,1] interval to generate a standardized state vector.

5. The method for dynamic optimization of flexible grid connection parameters of emergency power generation equipment based on reinforcement learning according to claim 1, characterized in that, In step S102, the preset set of droop control parameter adjustment actions includes multiple droop control parameter adjustment actions; the droop control parameter adjustment actions include the adjustment amount of the active power-frequency droop coefficient m and the adjustment amount of the reactive power-voltage droop coefficient n.

6. The method for dynamic optimization of flexible grid connection parameters of emergency power generation equipment based on reinforcement learning according to claim 1, characterized in that, In step S102, the step of adjusting the set of actions according to the standardized state vector using preset droop control parameters and obtaining the selected adjustment action specifically includes: S1021: A reinforcement learning agent is constructed using a deep Q-network algorithm. The reinforcement learning agent takes a standardized state vector as input and adjusts its actions using droop control parameters as output. S1022: After the reinforcement learning agent adjusts the action set according to the preset droop control parameters and outputs a droop control parameter adjustment action, obtain the standardized state vector after the action is executed. S1023: Based on the standardized state vector after the action is executed, the reward value of the droop control parameter adjustment action is obtained using a reward function; S1024: Repeat steps S1022-S1023 until all droop control parameter adjustment actions in the preset droop control parameter adjustment action set are traversed, and the droop control parameter adjustment action with the highest reward value is selected as the adjustment action.

7. The method for dynamic optimization of flexible grid connection parameters of emergency power generation equipment based on reinforcement learning according to claim 6, characterized in that, In step S1021, the deep Q-network adopts a dual-branch input structure, including a first branch and a second branch; The first branch is used to process high-frequency fluctuation parameters, including voltage deviation and phase angle deviation, and extracts transient impact features at the moment of grid connection through a 16-dimensional convolution kernel. The second branch is used to process slowly varying steady-state parameters, including load current values ​​and grid frequency fluctuation values, and to mine load change trend characteristics through a 32-dimensional fully connected layer; After the first and second branches are normalized by two BatchNorm layers, they are input into a three-layer shared hidden layer for fusion and output.

8. The method for dynamic optimization of flexible grid connection parameters of emergency power generation equipment based on reinforcement learning according to claim 7, characterized in that, The activation function of the shared hidden layer is Leaky ReLU; high-risk samples with grid-connected inrush current greater than 1.1 times the rated current and voltage deviation or phase angle deviation greater than 50% of the maximum allowable value are assigned a sampling weight of 1.5 times.

9. The method for dynamic optimization of flexible grid connection parameters of emergency power generation equipment based on reinforcement learning according to claim 6, characterized in that, Step S1022 also includes an emergency scenario adaptive ε-exploration mechanism, specifically: Let the overall deviation coefficient η = 0.6 × (ΔU / U) max )+0.4×(δ / δ max ); When η > 0.3, the exploration probability ε = 0.8 - 0.5η; When η≤0.3, the exploration probability ε=0.1+0.2η; Furthermore, the state vector is the average of three consecutive sampling periods within 0.5 seconds.

10. The method for dynamic optimization of flexible grid connection parameters of emergency power generation equipment based on reinforcement learning according to claim 6, characterized in that, In step S1023, the step of obtaining the reward value for the droop control parameter adjustment action based on the standardized state vector after the action is executed using a reward function specifically includes: In the standardized state vector after the action is executed, let the voltage deviation value be ΔU and the phase angle deviation value be δ; Let U max For the maximum allowable voltage deviation, δ max This is the maximum permissible phase angle deviation; Obtain the grid-connected inrush current value I 冲击 ; Obtain the rated current I of the emergency power generation equipment 额定 ; Let the reward value for the droop control parameter adjustment action be R, then: R = α×(1-ΔU / U max )-β×δ / δ max -γ×I 冲击 / I 额定 ; Wherein, α, β, and γ are preset weighting coefficients.