Method, system, device and medium for dynamically adjusting active power of wind farm based on fruit fly algorithm

By optimizing the PID controller parameters using the fruit fly algorithm and combining it with least squares modeling, the active power distribution of the wind farm is dynamically adjusted, solving the problems of robustness and accuracy in active power control of the wind farm and achieving stable and controllable operation of the wind farm.

CN122246904APending Publication Date: 2026-06-19CRRC WIND POWER(SHANDONG) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CRRC WIND POWER(SHANDONG) CO LTD
Filing Date
2026-02-05
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing active power control for wind farms suffers from the intermittency, randomness, and volatility of wind energy resources, leading to drastic fluctuations in output. Traditional control strategies are ill-suited to the complex and ever-changing operating conditions of wind farms, lack robustness, and are unable to achieve precise regulation.

Method used

The fruit fly algorithm is used to optimize the proportional, integral, and derivative parameters of the PID controller. Combined with least squares modeling and z-transform domain modeling, the active power distribution of the wind farm is dynamically adjusted. By optimizing the PID parameters through the fruit fly algorithm, a wind farm active power distribution model is constructed to achieve dynamic and precise control.

🎯Benefits of technology

It improves the stability and accuracy of active power distribution in wind farms, meets the grid's requirements for controllable and adjustable wind farms, ensures the safe grid connection and operation of large-scale wind power, and enhances the robustness and response efficiency of control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122246904A_ABST
    Figure CN122246904A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of active power regulation technology for wind turbine generators, specifically relating to a method, system, equipment, and medium for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm. This invention establishes a transfer function model for active power allocation, combines historical data with the total allocated active power, and uses the least squares method to determine the values ​​of the model coefficients to be identified. Based on the model coefficients, a differential format formula for the wind farm active power allocation model is derived. Then, the fruit fly algorithm is used to dynamically adjust the proportional, integral, and derivative parameters in the PID algorithm, and combined with the wind farm active power allocation model formula, the total allocated active power is dynamically adjusted. Based on the total allocated active power and the theoretical power of a single wind turbine and the overall theoretical power of the wind farm, the active power allocated to each wind turbine is calculated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of active power regulation technology for wind turbine generator sets, and particularly relates to a method, system, equipment and medium for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm. Background Technology

[0002] Currently, the global energy transition is accelerating. Wind power, as a clean, low-carbon, and renewable energy source, has entered a new stage of large-scale centralized development and grid-connected operation. Its installed capacity and power generation share in the power grid continue to rise, becoming one of the core supporting forces for optimizing the energy structure. However, the inherent intermittency, randomness, and volatility of wind energy resources cause the active power output of large-scale grid-connected wind farms to exhibit significant dynamic changes. Instantaneous fluctuations in wind speed, turbulence effects, and environmental factors such as wind shear and tower shadows can directly cause drastic fluctuations in the output power of wind turbines in a short period of time, thereby triggering problems such as grid frequency fluctuations, voltage deviations, and power flow imbalances.

[0003] This uncertainty in power output poses a severe challenge to the active power balance regulation of the power grid. Traditional power grids rely on controllable power sources such as thermal and hydropower, whose active power output can be precisely controlled through dispatch commands to maintain grid frequency stability within permissible ranges. However, the large-scale integration of wind power disrupts the traditional power balance mechanism: when wind speeds surge, the sudden increase in active power from wind farms may cause grid frequency to exceed limits, triggering the disconnection of frequency regulation units; when wind speeds drop sharply, the power gap must be quickly filled by other power sources, and if this filling is not timely, it may disrupt grid stability or even lead to widespread blackouts. Furthermore, wind farms are typically located in remote areas, far from load centers, and their output fluctuations can exacerbate power flow impacts on transmission channels, increase the risk of line overload, and further threaten the safe and reliable operation of the power grid.

[0004] To address these issues, both domestic and international power grid operation standards explicitly require that large-scale grid-connected wind farms be equipped with Automatic Active Power Control (AGC) systems. These systems must possess the capability to adjust active power output in real time according to grid dispatch instructions, including control functions such as maximum output limits, schedule tracking, and frequency response. Through the AGC system, wind farms must stabilize their active power output within the target range given by the dispatcher, actively participating in grid frequency regulation and peak shaving, thus becoming controllable, adjustable, and predictable power generation units.

[0005] However, in actual operation scenarios, achieving precise control of active power in wind farms faces multiple technical bottlenecks. On the one hand, wind turbines are complex systems with strong nonlinearity and multivariable coupling. Their aerodynamic characteristics, dynamic response of the transmission chain, and converter control logic all exhibit nonlinear relationships. Furthermore, changes in equipment conditions such as blade wear and gearbox aging can cause parameter drift, increasing control difficulty. On the other hand, wind speed distribution within a wind farm exhibits significant spatial and temporal variability. The wake effect leads to a decrease and increased fluctuation in wind speed at downstream turbines, further amplifying the power output fluctuations of the entire wind farm. Simultaneously, external disturbances such as grid voltage fluctuations and sudden load changes can also superimpose with wind power output fluctuations, affecting control accuracy. Existing traditional control strategies (such as PID control) are mostly based on linear model designs, making it difficult to adapt to the complex and variable operating conditions of wind farms. In scenarios with strong disturbances and time-varying parameters, they are prone to problems such as large overshoot, response lag, and insufficient robustness, failing to meet the high-precision requirements of the power grid for active power control of wind farms.

[0006] Therefore, it can be seen that the existing active power control of wind farms suffers from the intermittency, randomness, and volatility of wind energy resources, making the active power output of wind farms prone to drastic fluctuations and making it difficult to form a stable control object. Wind turbines are complex systems with strong nonlinearity and multivariable coupling, and traditional control strategies based on linearized models are difficult to adapt to, and existing control strategies lack sufficient adaptive capabilities. Traditional control methods are not robust enough and are prone to large overshoot and response lag in scenarios with strong disturbances and time-varying parameters, making it difficult to achieve precise regulation of active power. Summary of the Invention

[0007] To address the aforementioned problems, this invention provides a method, system, device, and medium for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm. This invention establishes an active power allocation model, combines historical data with the total allocated active power, and uses the least squares method to determine the values ​​of the model coefficients to be identified. Based on these coefficients, a differential format formula for the wind farm active power allocation model is derived. Then, the fruit fly algorithm is used to dynamically adjust the PID algorithm. proportional parameters Integral parameters Differential parameters are used, and combined with the active power allocation model formula of the wind farm, the total active power is dynamically adjusted and allocated. The active power allocated to each wind turbine is calculated based on the total active power allocation and the theoretical power of a single wind turbine and the overall theoretical power of the wind farm.

[0008] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm, comprising the following steps: Step S1, the step of finding the vector of coefficients to be identified, determines the transfer function model of active power allocation. The model formula is as follows: ; Where G(z) is the transfer function, P(z) is the z-transform of the actual electric field power, and P in (z) represents the z-transform of the total active power of the distributed electric field, b i With a i The model coefficients to be identified are used; the coefficient vector to be identified is obtained by combining the least squares algorithm. Based on the coefficient vector to be identified Determine the active power distribution model for wind farms Step S2, PID controller optimization step: The PID controller is optimized using the fruit fly algorithm, and individual performance indicators for fruit flies are defined. , The calculation formula is as follows:

[0009] The optimal fruit fly individual is selected based on performance indicators. A new fruit fly population is formed based on the data of the optimal fruit fly individual. After T rounds of iteration of the fruit fly algorithm, the final optimal fruit fly individual is converted into the proportional parameter of the PID controller. Integral parameters Differential parameters ; Step S3, calculate the total active power of the wind turbine, based on the proportional parameters obtained in step S2. Integral parameters Differential parameters The total active power distribution is calculated. Step S4: Calculate the active power of each wind turbine. Calculate the total active power allocated in step S3 to obtain the active power of each wind turbine, and then distribute it to each wind turbine.

[0010] In a second aspect, the present invention provides a system for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm, comprising a model building module, a PID control vector parameter optimization module, a total active power allocation calculation module, an active power calculation module for each wind turbine, and a distribution module; The model building module determines the transfer function model for active power allocation, with the following expression:

[0011] Where G(z) is the transfer function, P(z) is the z-transform of the actual power of the electric field, and P in (z) represents the z-transform of the total active power of the distributed electric field, b i With a iThe model coefficients to be identified are given; their inverse transformation yields the time-domain difference equation; and the time-domain difference equation is then transformed into a vector to obtain the vector of coefficients to be identified. ,

[0012] A data vector is formed by combining the historical actual power of the electric field with the total active power of the distributed electric field. The expression is as follows: ; in, Let be the actual power of the electric field at time t. The total active power allocated to the electric field at time t; the vector of coefficients to be identified. With data vector Based on the obtained model's prediction expression, the expression is as follows:

[0013] The optimal vector of coefficients to be identified is obtained by combining the least squares method. ,Will Substituting into the difference equation in the time domain, we obtain the active power distribution model of the wind farm: ; The PID control vector parameter optimization module obtains the optimal fruit fly individual using the fruit fly algorithm, and decodes the fruit fly individual to obtain the PID control algorithm. proportional parameters Integral parameters Differential parameters; The total active power calculation module allocates the parameters obtained from the PID control vector parameter optimization module. proportional parameters Integral parameters Substituting the differential parameters into the formula for calculating the total active power, we obtain the total active power. The formula is as follows: ; The active power calculation module for each wind turbine will combine the allocated total active power obtained from the total active power calculation module with the theoretical power of the individual wind turbine and the overall theoretical power of the wind farm to calculate the allocated active power P for each wind turbine. w (t), the calculation formula is as follows: ; The distribution module distributes the active power of each wind turbine to each wind turbine through a defined protocol, enabling real-time adjustment of the wind turbine's active power.

[0014] A third aspect of the present invention provides an electronic device, including a memory 102, a processor 101, a display module 103, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps described in any of the preceding methods for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm.

[0015] A fourth aspect of the present invention provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the preceding methods for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm.

[0016] The beneficial effects of this invention are as follows: By combining least squares modeling with the fruit fly algorithm to optimize PID control, dynamic and precise control of active power in wind farms is achieved. This not only adapts to the nonlinear and variable operating conditions of wind farms but also improves the stability and accuracy of active power allocation, meeting the core requirements of the power grid for controllable and adjustable wind farms and ensuring the safe grid connection and operation of large-scale wind power. Through a complete process of z-transform domain modeling, time-domain difference equation transformation, and least squares parameter identification, a wind farm active power allocation model is accurately constructed, effectively solving the problem of the disconnect between traditional models and actual operating conditions. This provides a reliable mathematical foundation for subsequent precise active power control and improves the model's adaptability to wind speed fluctuations and equipment parameter drift. Through a complete process of fruit fly population initialization, random search, performance index evaluation, and iterative optimization, the optimal PID parameters are efficiently found. This not only utilizes random perturbations to ensure population diversity and avoid the algorithm getting trapped in local optima but also achieves rapid convergence by approaching the optimal individual, improving the efficiency and reliability of PID parameter optimization and providing core technical support for precise active power control. Attached Figure Description

[0017] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating the method of this invention; Figure 2 This is a schematic diagram of the system structure of the present invention; Figure 3 This is a schematic diagram of the device structure of the present invention.

[0019] Among them, 101 is the processor, 102 is the memory, and 103 is the display module. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this application and in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.

[0022] Example 1, such as Figure 1 The method for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm, as shown, includes the following steps: Step S1, the step of finding the vector of coefficients to be identified, determines the transfer function model of active power allocation. The model formula is as follows: ; Where G(z) is the transfer function, P(z) is the z-transform of the actual electric field power, and P in (z) represents the z-transform of the total active power of the distributed electric field, b i With a i The model coefficients to be identified are used; the coefficient vector to be identified is obtained by combining the least squares algorithm. Based on the coefficient vector to be identified Determine the active power distribution model for the wind farm; the specific steps are as follows: Step S12: Cross-multiply the z-transform domain model of active power allocation and perform inverse z-transform domain transformation to obtain the time-domain difference equation:

[0023] in, Let be the actual power of the electric field at time t. Let b be the total active power distributed in the electric field at time t. i With a i Model coefficients to be identified Step S13: Transform the time-domain difference equation into a vector, converting the model coefficients to be identified into a vector of coefficients to be identified, as shown in the following expression:

[0024] The data vector at time t is formed by combining the historical actual power of the electric field with the total active power of the distributed electric field, and the expression is as follows: ; in, Let be the actual power of the electric field at time t. The total active power allocated to the electric field at time t; the prediction expression of the model is generated based on the vector of coefficients to be identified and the data vector:

[0025] Step S14: Define the objective function of the sum of squared errors of the least squares method based on the core of the least squares method and in conjunction with the prediction expression. min

[0026] Where, min J( Let N be the least squares sum, and N be the number of data samples. Let be the prediction error at time t; Step S15, find min J( Extreme values; based on the extreme value theorem... Find the partial derivatives and set them equal to 0. The derivation process is as follows:

[0027] The partial derivatives are expanded and calculated using the following formula: =0 The revised formula is as follows:

[0028] The optimal result is finally derived. The formula is as follows:

[0029] in, Let be the actual power of the electric field at time t. The total active power distributed by the electric field at time t; Step S16, the obtained Substituting the time-domain difference equation obtained in step S12, we obtain the active power distribution model of the wind farm:

[0030] in, Let be the actual power of the electric field at time t. The total active power distributed by the electric field at time t; Step S2, PID controller optimization step: The PID controller is optimized using the fruit fly algorithm, and individual performance indicators for fruit flies are defined. , The calculation formula is as follows:

[0031] Where e(t) is the control deviation and t is time; the optimal fruit fly individual is selected based on performance indicators, and a new fruit fly population is formed based on the data of the optimal fruit fly individual. After T rounds of iteration of the fruit fly algorithm, the final optimal fruit fly individual is selected and converted into the proportional parameter of the PID controller. Integral parameters Differential parameters The specific steps are as follows: Step S21, based on the actual active power (t) and active power target value The control deviation e(t) can be calculated using the following formula:

[0032] The formula for calculating the total active power distribution is derived by using the PID control algorithm on the control deviation e(t). The formula is as follows:

[0033] in, For proportional parameters, For integration parameters, The differential parameter, from which the control effect of PID can be known, is related to... , , The three parameters are related; Step S22: Use the fruit fly algorithm to obtain the performance indicators of individual fruit flies, filter the performance indicators to obtain the optimal fruit fly individuals, use the optimal fruit fly individuals to form a new fruit fly population, and after T rounds of iteration, select the final optimal fruit fly individuals, and transform them to obtain the optimal parameters for the PID controller. , and The specific steps are as follows: Step S221, initialize the fruit fly population size and set the initial coordinates of the fruit fly population ( ) and the maximum number of iterations T; Step S222: Use the initial coordinates of the fruit fly population plus a random value to obtain the random direction and random distance of each fruit fly, as shown in the following expression:

[0034] Where rand() is a random function, Let be the value on the x-axis of the i-th fruit fly. Let be the value on the y-axis of the i-th fruit fly. Let be the value on the z-axis of the i-th fruit fly; Step S223: Based on the electric field active power distribution model in step S16 and the total active power distribution calculation formula in step S21, the performance index of each fruit fly is obtained. The performance index calculation formula is as follows:

[0035] Among them, e(t) is the control deviation; Step S224: Select the fruit fly individuals with the optimal taste concentration according to the performance index of each fruit fly, record the optimal taste concentration and its coordinates, perform the condition judgment of the number of iterations, confirm whether to stop the fruit fly algorithm, stop the iteration to obtain the final optimal fruit fly individual, and convert the fruit fly individual into the optimal parameters of the PID controller 、 and ; The specific steps are as follows: Step S2241: If the current number of iterations d < T, then according to the recorded optimal taste concentration and its coordinates, make the fruit fly population fly towards this position using vision to form a new fruit fly population. The assignment expression is as follows:

[0036] Among them, is the optimal taste concentration The x-axis coordinate corresponding to the fruit fly individual, is the optimal taste concentration The y-axis coordinate corresponding to the fruit fly individual, is the optimal taste concentration The z-axis coordinate corresponding to the fruit fly individual; The number of iterations d = d + 1, and execute steps S221 - S224; Step S2242: If the current number of iterations d ≥ T, then stop the iteration, and use the coordinates corresponding to the recorded optimal taste concentration as the optimal k p 、 k i 、 k d ; The expression is as follows:

[0037] is the optimal taste concentration The x-axis coordinate corresponding to the fruit fly individual, is the optimal taste concentration The y-axis coordinate corresponding to the fruit fly individual, is the optimal taste concentration The z-axis coordinate corresponding to the fruit fly individual.

[0038] Step S3: Calculate the total active power of the fan. According to the proportional parameter obtained in step S2, the integral parameter 、the differential parameter The total active power distribution is calculated; the specific operation is as follows: the optimal parameters are obtained using step S22. , and The distributed total active power output is obtained by using the formula for calculating the total active power distributed by PID control. (t), the formula is as follows:

[0039] in, Let be the actual power of the electric field at time t. The total active power distributed by the electric field at time t.

[0040] Step S4: Calculate the active power of each wind turbine. Based on the total active power allocated in Step S3, calculate the active power of each wind turbine and distribute it to each turbine. Specifically, combine the calculated total active power, the theoretical power of a single wind turbine obtained using the nacelle wind speed method, and the overall theoretical power of the wind farm to calculate the active power P allocated to each wind turbine. w (t), the calculation formula is as follows:

[0041] in, This represents the theoretical power of a single wind turbine. This represents the theoretical power of the wind farm. To determine the total power allocated to the wind turbines, the active power P allocated to each wind turbine is calculated. w (t) is distributed to each wind turbine.

[0042] Example 2, as Figure 2 As shown, a system for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm includes a model building module, a PID control vector parameter optimization module, a total active power allocation calculation module, an active power calculation module for each wind turbine, and a distribution module. The model building module determines the transfer function model for active power allocation, with the following expression:

[0043] Where G(z) is the transfer function, P(z) is the z-transform of the actual power of the electric field, and P in (z) represents the z-transform of the total active power of the distributed electric field, b i With a i The model coefficients to be identified are given; their inverse transformation yields the time-domain difference equation; and the time-domain difference equation is then transformed into a vector to obtain the vector of coefficients to be identified. ,

[0044] A data vector is formed by combining the historical actual power of the electric field with the total active power of the distributed electric field. The expression is as follows: ; in, Let be the actual power of the electric field at time t. The total active power allocated to the electric field at time t; the vector of coefficients to be identified. With data vector Based on the obtained model's prediction expression, the expression is as follows:

[0045] The optimal vector of coefficients to be identified is obtained by combining the least squares method. ,Will Substituting into the difference equation in the time domain, we obtain the active power distribution model of the wind farm:

[0046] in, Let be the actual power of the electric field at time t. The total active power distributed by the electric field at time t; The PID control vector parameter optimization module obtains the optimal fruit fly individual using the fruit fly algorithm, and decodes the fruit fly individual to obtain the PID control algorithm. proportional parameters Integral parameters Differential parameters; The total active power calculation module allocates the parameters obtained from the PID control vector parameter optimization module. proportional parameters Integral parameters Substituting the differential parameters into the formula for calculating the total active power, we obtain the total active power. The formula is as follows: ; The active power calculation module for each wind turbine will combine the allocated total active power obtained from the total active power calculation module with the theoretical power of the individual wind turbine and the overall theoretical power of the wind farm to calculate the allocated active power P for each wind turbine. w (t), the calculation formula is as follows: ; The distribution module distributes the active power of each wind turbine to each wind turbine through a defined protocol, enabling real-time adjustment of the wind turbine's active power.

[0047] Example 3, as Figure 3As shown, a computer device includes a processor 101, a memory 102, a display module 103, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the method for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm described in Embodiment 1.

[0048] Example 4: A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the method for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm described in Example 1.

[0049] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, the present invention 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 and optical storage) containing computer-usable program code.

[0050] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. 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 illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0051] 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.

[0052] 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 1The steps of the function specified in one or more boxes.

[0053] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0054] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm, characterized in that: Includes the following steps: Step S1, the step of finding the vector of coefficients to be identified, determines the transfer function model of active power allocation. The model formula is as follows: ; Where G(z) is the transfer function, P(z) is the z-transform of the actual power of the electric field, and P in (z) represents the z-transform of the total active power of the distributed electric field, b i With a i These are the model coefficients to be identified; Step S2, PID controller optimization step: The PID controller is optimized using the fruit fly algorithm, and individual performance indicators for fruit flies are defined. , The calculation formula is as follows: Where e(t) is the control deviation and t is time; the optimal fruit fly individual is selected based on performance indicators, and a new fruit fly population is formed based on the data of the optimal fruit fly individual. After T rounds of iteration of the fruit fly algorithm, the final optimal fruit fly individual is selected and converted into the proportional parameter of the PID controller. Integral parameters Differential parameters ; Step S3, calculating the total active power of the wind turbine, based on the proportional parameters obtained in step S2. Integral parameters Differential parameters The total active power distribution is calculated. Step S4: Calculate the active power of each wind turbine. Calculate the total active power allocated in step S3 to obtain the active power of each wind turbine, and then distribute it to each wind turbine.

2. The method for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm according to claim 1, characterized in that: Step S1 specifically includes the following steps: Step S11: Determine the transfer function model for active power distribution. The model formula is as follows: ; Where G(z) is the transfer function, P(z) is the z-transform of the actual power of the electric field, and P in (z) represents the total active power of the distributed electric field, b i With a i The model coefficients to be identified are used; the coefficient vector to be identified is obtained by combining the least squares algorithm. Based on the coefficient vector to be identified Determine the active power distribution model for wind farms; Step S12: Cross-multiply the z-transform domain model of active power allocation and perform inverse z-transform domain transformation to obtain the time-domain difference equation: in, Let be the actual power of the electric field at time t. Let b be the total active power distributed in the electric field at time t. i With a i These are the model coefficients to be identified; Step S13: Transform the time-domain difference equation into a vector, converting the model coefficients to be identified into a vector of coefficients to be identified, as shown in the following expression: The data vector at time t is formed by combining the historical actual power of the electric field with the total active power of the distributed electric field, and the expression is as follows: ; in, Let be the actual power of the electric field at time t. The total active power allocated to the electric field at time t; the prediction expression of the model is generated based on the vector of coefficients to be identified and the data vector: Step S14: Define the objective function of the sum of squared errors of the least squares method based on the core of the least squares method and in conjunction with the prediction expression. min Among them, min J( Let N be the least squares sum, and N be the number of data samples. Let be the prediction error at time t; Step S15, find min J( Extreme values; based on the extreme value theorem... Find the partial derivatives and set them equal to 0. The derivation process is as follows: The partial derivatives are expanded and calculated using the following formula: =0 The revised formula is as follows: The optimal result is finally derived. The formula is as follows: During the aforementioned pushing process. Let be the actual power of the electric field at time t. The total active power distributed by the electric field at time t; Step S16, substitute the obtained into the time-domain difference equation obtained in step S12 to obtain the active power distribution model of the wind farm: in, Let be the actual power of the electric field at time t. The total active power distributed by the electric field at time t.

3. The method for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm according to claim 2, characterized in that: Step S2 specifically includes the following steps: Step S21, based on the actual active power (t) and active power target value The control deviation e(t) can be calculated using the following formula: Where t is time; the PID control algorithm is used to derive the calculation formula for the total active power allocation based on the control deviation e(t), and the calculation formula is as follows: in, For proportional parameters, For integration parameters, The differential parameter, from which the control effect of PID can be known, is related to... , , The three parameters are related; Step S22: Use the fruit fly algorithm to obtain the performance indicators of individual fruit flies, filter the performance indicators to obtain the optimal fruit fly individuals, use the optimal fruit fly individuals to form a new fruit fly population, and after T rounds of iteration, select the final optimal fruit fly individuals, and transform them to obtain the optimal parameters for the PID controller. , and .

4. The method for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm according to claim 3, characterized in that: The specific steps in S3 are as follows: Obtain the optimal parameters using step S22. , and The distributed total active power output is obtained by using the formula for calculating the total active power distributed by PID control. (t), the formula is as follows: 。 5. The method for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm according to claim 4, characterized in that: The specific steps for S4 are as follows: Combining the calculated total active power, the theoretical power of a single wind turbine obtained by the nacelle wind speed method, and the overall theoretical power of the wind farm, calculate the active power P allocated to each wind turbine. w (t), the calculation formula is as follows: in, This represents the theoretical power of a single wind turbine. This represents the theoretical power of the wind farm. To determine the total power allocated to the wind turbines, the active power P allocated to each wind turbine is calculated. w (t) is distributed to each wind turbine.

6. The method for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm according to claim 5, characterized in that: Step S22 specifically includes the following steps: Step S221, initialize the fruit fly population size and set the initial coordinates of the fruit fly population ( ) and the maximum number of iterations T; Step S222: Use the initial coordinates of the fruit fly population plus a random value to obtain the random direction and random distance of each fruit fly, as shown in the following expression: Where rand() is a random function, Let be the value on the x-axis of the i-th fruit fly. Let be the value on the y-axis of the i-th fruit fly. Let be the value on the z-axis of the i-th fruit fly; Step S223: Based on the electric field active power distribution model in step S16 and the total active power distribution calculation formula in step S21, the performance index of each fruit fly is obtained. The performance index calculation formula is as follows: Where e(t) is the control deviation and t is time; Step S224: Select the fruit fly with the optimal taste concentration based on the performance indicators of each fruit fly, and record the optimal taste concentration. Based on its coordinates, a conditional judgment is made regarding the number of iterations to determine whether to stop the fruit fly algorithm. If the iteration stops, the final optimal fruit fly individual is obtained, and the fruit fly individual is converted into the optimal parameters for the PID controller. , and .

7. The method for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm according to claim 6, characterized in that: Step S224 specifically includes the following steps: Step S2241, if the current iteration number d < T, then according to the recorded optimal flavor concentration and its coordinates, make the fruit fly population fly towards this position using vision to form the latest fruit fly population, and the assignment expression is as follows: in, For optimal flavor concentration The x-axis coordinates of an individual fruit fly. For optimal flavor concentration The y-coordinate of an individual fruit fly. For optimal flavor concentration The z-axis coordinate of the individual fruit fly; the iteration number d = d + 1, and the steps S221-S224 are executed. Step S2242: If the current iteration number d ≥ T, then stop the iteration and record the optimal flavor concentration. The corresponding coordinates are considered optimal. k p , k i , k d The expression is as follows: For optimal flavor concentration The x-axis coordinates of an individual fruit fly. For optimal flavor concentration The y-coordinate of an individual fruit fly. For optimal flavor concentration The z-axis coordinates of an individual fruit fly.

8. A system for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm, characterized in that: It includes a model building module, a PID control vector parameter optimization module, a total active power allocation calculation module, an active power calculation module for each wind turbine, and a distribution module; The model building module determines the transfer function model for active power allocation, with the following expression: Where G(z) is the transfer function, P(z) is the z-transform of the actual power of the electric field, and P in (z) represents the z-transform of the total active power of the distributed electric field, b i With a i The model coefficients to be identified are given; their inverse transformation yields the time-domain difference equation; this time-domain difference equation is then transformed into a vector to obtain the vector of coefficients to be identified. , ; A data vector is formed by combining the historical actual power of the electric field with the total active power of the distributed electric field. The expression is as follows: ; in, Let be the actual power of the electric field at time t. The total active power allocated to the electric field at time t; the vector of coefficients to be identified. With data vector Based on the obtained model's prediction expression, the expression is as follows: The optimal vector of coefficients to be identified is obtained by combining the least squares method. ,Will Substituting into the difference equation in the time domain, we obtain the active power distribution model of the wind farm: in, Let be the actual power of the electric field at time t. The total active power distributed by the electric field at time t; The PID control vector parameter optimization module obtains the optimal fruit fly individual using the fruit fly algorithm, and then transforms the fruit fly individual to obtain the PID controller. proportional parameters Integral parameters Differential parameters; The total active power calculation module allocates the parameters obtained from the PID control vector parameter optimization module. proportional parameters Integral parameters Substituting the differential parameters into the formula for calculating the total active power, we obtain the total active power. The formula is as follows: ; The active power calculation module for each wind turbine will combine the allocated total active power obtained from the total active power calculation module with the theoretical power of the individual wind turbine and the overall theoretical power of the wind farm to calculate the allocated active power P for each wind turbine. w (t), the calculation formula is as follows: in, This represents the theoretical power of a single wind turbine. This represents the theoretical power of the wind farm. To determine the total power allocated to the wind turbines, the active power P allocated to each wind turbine is calculated. w (t) is distributed to each wind turbine; The distribution module distributes the active power of each wind turbine to each wind turbine through a defined protocol, enabling real-time adjustment of the wind turbine's active power.

9. An electronic device comprising a memory (102), a processor (101), a display module (103), and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm as described in any one of claims 1 to 7.

10. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for dynamically adjusting the active power of a wind farm based on the fruit fly algorithm as described in any one of claims 1 to 7.