Method and device for determining hyper-parameters of convolutional neural network by using Pedal algorithm and method and device for optimizing optical storage network type inverter by using convolutional neural network
Through the gazelle algorithm, the hyperparameters of the convolutional neural network are optimized, and the parameter control model of optical storage network-type inverter is constructed, which solves the problem of inverter control in the existing technology, and realizes stable control of adaptive power grid changes and improves the ability to absorb new energy.
Patent Information
- Application Number
- CN202411860659.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-11
AI Technical Summary
The existing technology is difficult to adapt to changes in the power grid operation, resulting in unstable control of optical storage grid-type inverters and unable to effectively improve the ability to absorb new energy.
The gazelle algorithm is used to optimize the hyperparameters of the convolutional neural network, and the parameter control model of the optical storage network type inverter is constructed, and the inverter control parameters are adaptively updated through the real-time measured grid impedance.
It improves the stability and new energy consumption capacity of optical storage grid-type inverters, can dynamically respond to changes in power grid status and maintain stable system output.
Smart Images

Figure CN119808900A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of control technology, and in particular to a method and device for determining convolutional neural network hyperparameters using a gazelle algorithm and optimizing a photovoltaic storage grid-type inverter using the convolutional neural network. Background Art
[0002] Convolutional neural networks have played an important role in applications in various industries, and have also been applied in the field of renewable energy power generation technology. However, when applying convolutional neural networks, they are generally used directly without in-depth consideration of how to optimize the convolutional neural network and then use it. In the field of renewable energy power generation technology, such as photovoltaic storage grid inverters, a well-optimized convolutional neural network can achieve better optimization of the inverter, but this is not covered in the current existing technologies.
[0003] With the advancement of the "dual carbon" goal, the construction of a new power system dominated by new energy has become a future trend. Among them, clean energy represented by photovoltaics and energy storage is an important part of new energy power generation. New energy grid-connected inverters are divided into two types: grid-following type and grid-building type. The grid-following inverter measures the grid-connected point phase as a voltage phase reference benchmark to follow the grid, which can be equivalent to a current source. However, the grid-following control is affected by the large power grid and is prone to instability when disturbances occur. The grid-building inverter keeps synchronization with the grid and can be equivalent to a voltage source. It can adapt to voltage and frequency disturbances, which is conducive to improving the new energy absorption capacity. However, as the operating characteristics of the power grid change, the current grid-building inverter control is prone to voltage instability.
[0004] At present, some inverter parameter control methods have been studied to solve the oscillation problem caused by renewable energy generation. Existing studies in the literature have realized the analysis of the influence of inverter control parameters and steady-state operation points on stability by building state space and impedance models; analyzed the coupling relationship between renewable energy control parameters and grid-forming control parameters and the sensitivity under different states. However, this parameter control method cannot guarantee the stability of the system when facing the requirements of dynamic changes and fault crossing of the power grid; for the grid-forming inverter connected in parallel to the power grid, the power conversion coefficient is used to improve the anti-interference ability of the power grid. However, the above inverter parameter control method cannot adapt to the state of the power grid. In the face of renewable energy power systems with changing grid impedance, it cannot dynamically update parameters to maintain system stability.
[0005] With the rapid development of artificial intelligence technology in recent years, it has a good dynamic response capability in parameter adaptive adjustment based on data-driven analysis. Some studies have proposed multi-inverter parameter optimization technology based on artificial neural networks, which maps the relationship between closed-loop poles and control parameters to achieve adaptive update of inverter control parameters. However, artificial neural networks are machine learning algorithms that can only learn shallow features and cannot fit the relationship between complex high-dimensional data. With the rapid development of deep learning, convolutional neural networks have attracted the attention of more and more scholars due to their advantages in nonlinear fitting ability and strong self-learning ability.
[0006] Therefore, it is urgent to propose a new parameter control method for grid-connected inverters that can adapt to changes in grid operation and thus improve system stability. Summary of the invention
[0007] In order to solve the above problems, the present invention provides a method and device for determining the hyperparameters of a convolutional neural network using a gazelle algorithm and optimizing a photovoltaic storage grid inverter using the convolutional neural network. The present invention provides the following technical solutions:
[0008] In a first aspect of the present invention, a method for determining hyperparameters of a convolutional neural network using a gazelle algorithm is provided, the method comprising:
[0009] Using a hyperparameter in a convolutional neural network as a gazelle position, wherein the hyperparameter is one or more of the number of neurons in all intermediate layers of the convolutional neural network, a learning rate, and a batch size;
[0010] Initialize gazelle position;
[0011] The difference between the actual control parameters and the ideal parameters is used as the algorithm fitness function; wherein the actual control parameters are the hyperparameter combination directly obtained from the convolutional neural network, and the ideal parameters are the hyperparameter combination in the convolutional neural network that reaches a predetermined state;
[0012] Determining a fitness corresponding to the gazelle position;
[0013] It is determined whether the fitness corresponding to the gazelle position satisfies a predetermined condition. If the predetermined condition is satisfied, the gazelle position corresponding to the predetermined condition is used as a target hyperparameter in the convolutional neural network.
[0014] Furthermore, the determining whether the fitness corresponding to the gazelle position satisfies a predetermined condition includes:
[0015] It is determined whether the number of iterations is reached or the fitness is less than or equal to a predetermined value. If the number of iterations is reached or the fitness is less than or equal to the predetermined value, it is considered that the predetermined condition is met.
[0016] Furthermore, the determining whether the fitness corresponding to the gazelle position satisfies a predetermined condition includes:
[0017] Determine whether the number of iterations is reached or the fitness is less than or equal to a predetermined value; if the number of iterations is not reached or is greater than the predetermined value, update the gazelle position using Levy flight and Brownian motion, and continue to execute the step of determining the fitness corresponding to the gazelle position.
[0018] Furthermore, the gazelle position is initialized in the following way,
[0019]
[0020] Among them, x ij To indicate the position of the gazelle; They represent the lower and upper limits of the dth hyperparameter respectively; rand(0,1) represents a random value between 0 and 1.
[0021] Further, the gazelle position is updated by using Lévy flight and Brownian motion, and the step of determining the fitness corresponding to the gazelle position is continued, including:
[0022] x i (t+1)=x i (t)+v i (t);
[0023] Among them, x i (t) is the t-th generation position of the i-th gazelle; x i (t+1) is the t+1th generation position of the i-th gazelle; v i (t) is the speed of the ith gazelle in the tth generation;
[0024] v i The update formula of (t) is:
[0025] v i (t+1)=v i (t)+c1·r1·(p i (t)-x i (t))+c2·r2·(g(t)-x i (t))
[0026] Where: v i (t+1) is the speed of the ith gazelle in the t+1 generation, c1 and c2 are learning factors, r1 and r2 are random numbers between [0, 1]; p i (t) is the current optimal position of the i-th gazelle, and g(t) is the global optimal position.
[0027] In a second aspect of the present invention, a method for optimizing a photovoltaic storage grid inverter using a convolutional neural network is provided, wherein the hyperparameters of the convolutional neural network are optimized using the method described above, and the method comprises:
[0028] Based on the convolutional neural network, a parameter control model of a photovoltaic energy storage grid inverter is constructed;
[0029] Inputting the measured grid impedance value into the photovoltaic energy storage grid inverter parameter control model;
[0030] The photovoltaic storage grid inverter parameter control model determines the photovoltaic storage grid inverter control parameters according to the grid impedance value, wherein the photovoltaic storage grid inverter control parameters include the current regulation proportional coefficient k ip , current regulation integral coefficient k ii , voltage regulation proportional coefficient k vp , voltage regulation integral coefficient k iv and droop gain factor m pf ;
[0031] The photovoltaic-storage-grid inverter control model determines the output stability of the photovoltaic-storage-grid inverter according to the photovoltaic-storage-grid inverter control parameters.
[0032] Furthermore, based on the convolutional neural network, a parameter control model of a photovoltaic energy storage grid inverter is constructed, including:
[0033] The parameter control data of the photovoltaic storage grid inverter is input as input data into the convolutional neural network for iterative training to obtain the output inverter control parameters; wherein the parameter control data of the photovoltaic storage grid inverter includes the grid impedance value, and the grid impedance value includes the grid equivalent resistance r g , equivalent inductance L g ,
[0034] The input formula is:
[0035] The output is:
[0036]
[0037] In the formula, A in represents the training set input; y out Represents the model output; r g (n) represents the equivalent impedance of the power grid in the nth training set; L g (n) represents the equivalent inductance of the power grid in the nth training set; K ip (n) represents the current adjustment ratio coefficient of the nth training set; k ii (n) represents the current regulation integral coefficient of the nth training set; kvp (n) represents the voltage regulation coefficient of the nth training set; k iv (n) represents the voltage regulation integral coefficient of the nth training set; m pf (n) represents the droop gain coefficient of the nth training set;
[0038] The trained convolutional neural network is the parameter control model of the photovoltaic energy storage network inverter.
[0039] Furthermore, the process of inputting the parameter control data of the photovoltaic energy storage grid inverter into the convolutional neural network for iterative training includes:
[0040] The input data is divided into a training set and a test set; the training set is used to train the parameter control model of the photovoltaic storage grid inverter, and after convolution, activation, pooling, and full connection operations, the loss function is forward calculated, and the parameters of the photovoltaic storage grid inverter parameter control model are reversely updated;
[0041] If the maximum number of iterations is not reached, retrain according to the updated parameters;
[0042] If the maximum number of iterations is reached, the trained photovoltaic storage grid-type inverter parameter control model parameters are retained, the test set data is input into the trained photovoltaic storage grid-type inverter parameter control model, and the optimal photovoltaic storage grid-type inverter control parameter output is updated in real time. The optimal photovoltaic storage grid-type inverter control parameters are the grid-type inverter control parameters.
[0043] Furthermore, based on the current control, voltage control and droop control of the control part of the photovoltaic storage grid-type inverter, as well as the equivalent resistance and equivalent inductance of the LC filter of the grid-connected circuit part, and the equivalent equivalent resistance and equivalent inductance of the large power grid, a control model of the photovoltaic storage grid-type inverter is constructed using the Thevenin equivalent circuit.
[0044] Furthermore, the control model of the photovoltaic-storage grid-connected inverter is:
[0045]
[0046]
[0047] In the formula, v o (s) is the inverter output voltage; v s (s) is the equivalent voltage source output voltage; A and B are inverter constant parameters; Z g (s) is the impedance of the large power grid; v g (s) is the voltage of the large power grid; R i is the equivalent resistance of the i-th node; s is the variable in the transfer function; λ i is the ith pole; n is the number of poles; Mi is a constant term; Z i-PI is the equivalent impedance of the PI regulator in the current inner loop control; k ip , k ii are the current regulation proportional coefficient and integral coefficient respectively; Z v-PI is the equivalent impedance of the PI regulator in the voltage outer loop control; k vp , k iv They are the voltage regulation proportional coefficient and integral coefficient respectively; G v is the voltage outer loop control gain coefficient; Z vc-l is the virtual equivalent impedance of the voltage outer loop control and filter capacitor; Z i-l Virtual equivalent impedance for current inner loop control; They are virtual positive impedance and negative impedance for equivalent droop control respectively; are the steady-state voltage and current positive frequencies respectively; V0 - , I0 - They are the negative frequencies of steady-state voltage and current respectively; j represents the imaginary part and has no practical meaning; G pf is the droop control coefficient; m pf is the droop gain coefficient; ω f is the cut-off angular frequency of the low-pass filter.
[0048] Furthermore, the photovoltaic-storage-grid inverter control model determines the stability of the photovoltaic-storage-grid inverter according to the photovoltaic-storage-grid inverter control parameters, including:
[0049] The output stability of the inverter is determined by the poles. When the real parts of all poles are negative, the output is stable; when there is a pole with a positive real part, oscillation occurs at the corresponding pole frequency and the output is unstable.
[0050] In a third aspect of the present invention, there is provided a device for determining hyperparameters of a convolutional neural network using a gazelle algorithm, the device comprising:
[0051] Initialize a gazelle position unit, which is used to use a hyperparameter in the convolutional neural network as a gazelle position, wherein the hyperparameter is one or more of the number of neurons in all intermediate layers of the convolutional neural network, a learning rate, and a batch size;
[0052] Initialize gazelle position;
[0053] Determine a fitness unit, which is used to use the difference between the actual control parameter and the ideal parameter as the algorithm fitness function; wherein the actual control parameter is a hyperparameter combination directly obtained from the convolutional neural network, and the ideal parameter is a hyperparameter combination that reaches the optimal state in the convolutional neural network;
[0054] Determining a fitness corresponding to the gazelle position;
[0055] A judging unit is used to judge whether the fitness corresponding to the gazelle position satisfies a predetermined condition. If the predetermined condition is satisfied, the gazelle position corresponding to the predetermined condition is used as a target hyperparameter in the convolutional neural network.
[0056] In a fourth aspect of the present invention, an optimization device for optimizing a photovoltaic storage grid inverter using a convolutional neural network is provided, wherein the hyperparameters of the convolutional neural network are obtained by optimizing using the device described above or the hyperparameters of the convolutional neural network are obtained by optimizing using the method described above, and the optimization device comprises:
[0057] A construction unit, used to construct a parameter control model of a photovoltaic energy storage grid inverter based on a convolutional neural network after hyperparameter optimization;
[0058] An input unit, used to input the measured grid impedance value into the photovoltaic energy storage grid inverter parameter control model;
[0059] A determination unit, used for the photovoltaic storage grid inverter parameter control model to determine the photovoltaic storage grid inverter control parameters according to the grid impedance value, wherein the photovoltaic storage grid inverter control parameters include the current regulation proportional coefficient k ip , current regulation integral coefficient k ii , voltage regulation proportional coefficient k vp , voltage regulation integral coefficient k iv , droop gain coefficient m pf ;
[0060] A stability judgment unit is used for the photovoltaic-storage-grid inverter control model to judge the stability of the photovoltaic-storage-grid inverter according to the photovoltaic-storage-grid inverter control parameters.
[0061] In a fifth aspect of the present invention, an electronic device is provided, the electronic device comprising at least one processor and at least one memory, the memory being data-connected to the processor, wherein:
[0062] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor so that the at least one processor can perform the above method.
[0063] In a sixth aspect of the present invention, a computer storable medium is provided, on which computer instructions are stored. When the computer instructions are executed by a processor, the steps in the above method are specifically performed.
[0064] In a seventh aspect of the present invention, a computer program product is provided, comprising computer instructions, which, when executed by a processor, specifically execute the steps in the above-described method.
[0065] Technical effects and advantages of the present invention:
[0066] The present invention adopts the gazelle optimization algorithm to optimize the convolutional neural network. The convolutional neural network contains many hyperparameters such as the number of neurons in all intermediate layers, learning rate, batch size, etc. It is difficult to select these parameters manually. Using an intelligent optimization algorithm to find the best network hyperparameters can greatly improve network performance and enhance the network's feature learning ability.
[0067] Build a grid-type inverter control model and analyze the output voltage stability. Establish an inverter parameter control model based on a convolutional neural network, optimize the convolutional neural network hyperparameters through the gazelle algorithm, improve the model feature learning ability, and obtain the inverter control parameters. Use the real-time measured grid impedance as the input of the convolutional neural network model, and the inverter control parameters as the output. The feature mapping input-output relationship is used to adaptively update the inverter control parameters according to the change of grid impedance, so that the system can always maintain a stable output.
[0068] Other features and advantages of the present invention will be described in the following description, and partly become obvious from the description, or be understood by implementing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1a It is a flow chart of a method for determining hyperparameters of a convolutional neural network using a gazelle algorithm provided in an embodiment of the present application;
[0070] Figure 1b It is an implementation diagram of a method for determining hyperparameters of a convolutional neural network using a gazelle algorithm provided in an embodiment of the present application;
[0071] Figure 2 It is a flow chart of a method for optimizing a photovoltaic storage grid inverter using the convolutional neural network provided in an embodiment of the present application;
[0072] Figure 3 It is a specific implementation flow chart of the optimization control method of the photovoltaic storage grid inverter based on the gazelle algorithm to optimize the convolutional neural network according to the embodiment of the present application;
[0073] Figure 4 A structural block diagram of an electronic device provided in an embodiment of the present application;
[0074] Figure 5 A schematic diagram of the structure of a photovoltaic storage grid-connected inverter provided in an embodiment of the present application connected to a large power grid;
[0075] Figure 6 A schematic diagram of the optimization results of the gazelle algorithm provided in the embodiment of the present application;
[0076] Figure 7 The equivalent resistance and inductance change curves of the power grid provided in the embodiment of the present application;
[0077] Figure 8 The convolutional neural network loss function changes provided in the embodiments of the present application;
[0078] Fig. 9 The current regulation proportional coefficient variation curve provided in the embodiment of the present application;
[0079] Fig.10 The current regulation integral coefficient variation curve provided in the embodiment of the present application;
[0080] Fig.11 The voltage regulation proportional coefficient variation curve provided in the embodiment of the present application;
[0081] Fig.12 The voltage regulation integral coefficient variation curve provided in the embodiment of the present application;
[0082] Fig.13 The droop gain coefficient variation curve provided in the embodiment of the present application;
[0083] Fig.14 The inverter output voltage variation curve provided in the embodiment of the present application. DETAILED DESCRIPTION
[0084] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0085] To address the deficiencies of the prior art, the present invention discloses a method for determining hyperparameters of a convolutional neural network using a gazelle algorithm, such as Figure 1a and 1b As shown, the method includes,
[0086] Step 1: Use the hyperparameters in the convolutional neural network as gazelle positions, where the hyperparameters are one or more of the number of neurons in all intermediate layers of the convolutional neural network, the learning rate, and the batch size; initialize the gazelle positions:
[0087] Convolutional neural networks contain many hyperparameters, such as the number of neurons in all intermediate layers, learning rate, batch size, etc. It is difficult to select these parameters manually. Using intelligent optimization algorithms to find the best network hyperparameters can greatly improve network performance.
[0088] The gazelle algorithm is an intelligent swarm optimization algorithm proposed in recent years that simulates the gazelle hunting process. It has the advantages of strong optimization ability and fast convergence speed.
[0089] The formula for random initialization of gazelle population is:
[0090] x ij = rand·(max j -min j )+min j
[0091] In the formula, x ij is the value of the i-th gazelle in the population in the j-th dimension; max j 、min j are the maximum and minimum values of the j-th dimension vector respectively; rand is a random number.
[0092] Step 2: Take the difference between the actual control parameters and the ideal parameters as the algorithm fitness function, define the fitness function f(x), and calculate the fitness corresponding to the position of each gazelle, F i =f(x i ); wherein the actual control parameter is a hyperparameter combination directly obtained from the convolutional neural network, and the ideal parameter is a hyperparameter combination that reaches the optimal state in the convolutional neural network;
[0093] Determining a fitness corresponding to the gazelle position;
[0094] Step 3: Determine whether the fitness corresponding to the gazelle position meets a predetermined condition. If the predetermined condition is met, the gazelle position corresponding to the predetermined condition is used as the target hyperparameter in the convolutional neural network.
[0095] In a specific embodiment of the present invention, step 1 is as follows:
[0096] Step 101: Initialize the gazelle population, set the population size to N, and the gazelle position (hyperparameter combination) to X = {x1, x2, ..., x N}, each Gazelle hyperparameter combination is x i =[x i1 ,x i2 ,…,x id ], where d is the hyperparameter dimension, x i represents the location of the i-th gazelle population;
[0097] Step 102: Initialize the gazelle position, x ij To indicate the position of the gazelle; Respectively represent the lower and upper limits of the dth hyperparameter;
[0098] In a specific embodiment of the present invention, in step 3:
[0099] Brownian motion is a random molecular thermal motion. The displacement process follows a normal distribution and the calculation formula is:
[0100]
[0101] In the formula, f b : represents the Brownian motion position update formula; L represents the random molecular position; μ and δ are the mean and standard deviation of the Gaussian distribution, respectively, and μ=0, δ=1.
[0102] Levy flight randomly searches for the best solution by alternating high and low distance flights, which can effectively coordinate the global search and local search of the algorithm. The calculation formula is:
[0103]
[0104] Where, L(β) represents the optimization formula of Levy flight; x is the lateral position of Levy flight, y is the longitudinal position of Levy flight; β is the Levy flight coefficient, which is 1.5; y = Normal (0,1 2 );
[0105] where σ x The calculation formula is:
[0106]
[0107] Where Γ(·) is the gamma function, σ x represents the Lévy flight distance function.
[0108] The development phase is used for scenarios without predators, where the free gazelle updates its position through Brownian motion, calculated as:
[0109] G i+1 =G i +s v ·r·r b ·(E i -r b G i )
[0110] In the formula, G i is the solution at the i-th iteration; s v is the moving speed; r is a random number between 0 and 1; r bis the Brownian motion random vector; E i is the matrix of the optimal gazelle at the i-th iteration.
[0111] When gazelles spot a predator, they use Lévy flight and Brownian motion to escape.
[0112] (1) Phase 1
[0113] The calculation formula for the gazelle's initial Levy flight to find prey is:
[0114] G i+1 =G i +s max ·λ σ ·r·r L ·(E i -r L G i )
[0115] In the formula, s max is the maximum flight speed; σ The value is -1 or 1, indicating two flight directions; r L is the Levy flight random vector, r is a random number between 0 and 1;
[0116] (2) Second stage
[0117] G i+1 =G i +s max ·λ σ ·A b ·r b ·(E i -r L G i )
[0118] In the formula, A b is the cumulative effect coefficient.
[0119] In a specific embodiment of the present invention, the gazelle position is updated by using Lévy flight and Brownian motion, and the step of determining the fitness corresponding to the gazelle position is continued, including:
[0120] Define the fitness corresponding to the position of each gazelle as F i =f(x i ),in,
[0121] x i (t+1)=x i (t)+v i (t)
[0122] Where: v i (t) is the speed of the i-th gazelle in the t-th generation, and its update formula is:
[0123] v i (t+1)=v i (t)+c1·r1·(p i (t)-x i (t))+c2·r2·(g(t)-x i (t))
[0124] Where: v i (t+1) is the speed of the ith gazelle in the t+1th generation, c1 and c2 are learning factors, r1 and r2 are random numbers between [0, 1], and p i (t) is the current optimal position of the i-th gazelle, and g(t) is the global optimal position.
[0125] In a specific embodiment of the present invention, for step 3: determining whether the fitness corresponding to the gazelle position meets a predetermined condition includes:
[0126] It is determined whether the number of iterations is reached or the fitness is less than or equal to a predetermined value. If the number of iterations is reached or the fitness is less than or equal to the predetermined value, it is considered that the predetermined condition is met.
[0127] If the predetermined condition is not met, the gazelle position is updated by using Levy flight and Brownian motion, and the step of determining the fitness corresponding to the gazelle position is continued, until the condition is met and the optimal hyperparameter combination is output, completing the hyperparameter optimization of the convolutional neural network.
[0128] In a second aspect of the present invention, the present invention also provides a method for optimizing a photovoltaic storage grid inverter using a convolutional neural network, wherein the hyperparameters of the convolutional neural network are optimized using the method described above, such as Figure 2 As shown, the method includes,
[0129] Step S1: constructing a parameter control model of a photovoltaic energy storage grid inverter based on a convolutional neural network after hyperparameter optimization;
[0130] Step S2: inputting the measured grid impedance value into the photovoltaic-storage grid-connected inverter parameter control model;
[0131] Step S3: The photovoltaic storage grid inverter parameter control model determines the photovoltaic storage grid inverter control parameters according to the grid impedance value, wherein the photovoltaic storage grid inverter control parameters include the current regulation proportional coefficient k ip , current regulation integral coefficient k ii , voltage regulation proportional coefficient k vp , voltage regulation integral coefficient k iv , droop gain coefficient m pf ;
[0132] Step S4: the photovoltaic-storage-grid inverter control model determines the stability of the photovoltaic-storage-grid inverter according to the photovoltaic-storage-grid inverter control parameters.
[0133] In a specific embodiment of the present invention, a grid-type inverter parameter control model is established based on a convolutional neural network. The real-time measured grid impedance is used as the input of the convolutional neural network model, and the inverter control parameters are used as the output. The input-output relationship is feature mapped, and the inverter control parameters are adaptively updated according to the change of grid impedance, so that the system can always maintain a stable output.
[0134] Convolutional neural network is a typical deep learning method with strong nonlinear fitting and feature extraction capabilities. It can fit the relationship between grid impedance and inverter control parameters. It consists of convolution, activation, pooling, and full connection.
[0135] In step S1: based on the hyperparameter optimized convolutional neural network, a parameter control model of the photovoltaic storage grid inverter is constructed, wherein the photovoltaic storage grid inverter control model includes a current inner loop control equation, a voltage outer loop control equation, and an equation of the inverter output impedance considering droop control; the specific steps are as follows:
[0136] S21, the convolution layer is the core part of the network. The convolution kernel traverses all input points by sharing weights, and can extract features in a shorter time. The calculation formula is:
[0137]
[0138] In the formula, A λ is the input of the λth layer; is the operator for convolution operation; W λ is the convolution kernel weight of the τth layer input; b λ is the bias of the τth layer input.
[0139] S22, the purpose of the activation layer is to change the result of the convolution nonlinearly, improve the generalization ability of the network, and perform this operation by adding an activation function. The expression is:
[0140]
[0141] Where: f(*) is the activation function; y τ is the output of the activation layer after the τth layer input.
[0142] S23. When the feature dimension of the activation layer output is too high, overfitting will occur. This phenomenon can be avoided through pooling operation. The common pooling operation is the maximum value operation, which selects the maximum value in the pooling area as the representative to achieve the dimensionality reduction effect. The calculation formula is:
[0143] max-pooling(f[τ-1],f[τ],f[τ+1])=
[0144] max(f[τ-1],f[τ],f[τ+1])
[0145] Where: max-pooling is the maximum pooling operator; max(*) is the maximum value operation; f[τ] is the τth eigenvalue in the pooling area.
[0146] S24, the fully connected layer is the last layer of the convolutional neural network output, which expands the multi-dimensional features into one-dimensional features, which is conducive to the classifier outputting the optimal value. The neurons in each layer are interconnected. The specific process is:
[0147] o(t)=F(w τ t+b)
[0148] Where: F(*) is the fully connected activation function; t and o(t) are the input and output of the fully connected layer respectively; w τ , b are the weight and bias of the fully connected layer respectively.
[0149] S25, the grid-type inverter parameter control model inputs the grid impedance data into the convolutional neural network, and outputs the optimal control parameters of the inverter through convolution, activation, pooling, and full connection operations. The model input and output are as follows:
[0150] The model input is the grid impedance, that is, the grid equivalent resistance r g , equivalent inductance L g , if the number of training set samples is n, then the training set input is:
[0151]
[0152] The model output is the inverter control parameters, mainly including the current regulation proportional coefficient k ip , current regulation integral coefficient k ii , voltage regulation proportional coefficient k vp , voltage regulation integral coefficient k iv , droop gain coefficient m pf , then the output is:
[0153]
[0154] In a specific embodiment of the present invention, for step S3: the photovoltaic-storage-grid inverter parameter control model determines the photovoltaic-storage-grid inverter control parameters according to the grid impedance value, the specific operation is as follows:
[0155] S31: Extract the grid impedance value, i.e. the grid equivalent resistance r g , equivalent inductance Lg and the grid equivalent resistance r g , equivalent inductance L g As input data, it is input into the parameter control model of the photovoltaic energy storage grid inverter, where the input formula is The output is:
[0156]
[0157] Among them, the convolutional neural network hyperparameters were optimized using the gazelle algorithm, and the actual control parameters and ideal control parameters of the inverter were used as algorithm fitness mapping to output the optimal convolutional neural network hyperparameters.
[0158] S32: Divide the input data into a training set and a test set; input the input data into a convolutional neural network, and train the parameter control model of the photovoltaic storage grid inverter using the training set based on the optimal hyperparameters. After convolution, activation, pooling, and full connection operations, forward calculate the loss function, and reversely update the parameters of the trained photovoltaic storage grid inverter parameter control model;
[0159] S33: If the maximum number of iterations is not reached, retrain according to the updated parameters;
[0160] If the maximum number of iterations is reached, the trained photovoltaic energy storage grid inverter parameter control is retained.
[0161] Model parameters, input the test set data into the trained photovoltaic energy storage grid inverter parameter control model
[0162] In the model, the optimal photovoltaic storage grid-forming inverter control parameter output is updated in real time, and the optimal photovoltaic storage grid-forming inverter control parameter is the grid-forming inverter control parameter.
[0163] In a specific embodiment of the present invention, the specific operation steps for step 4 are as follows: Analyze the characteristics of the grid-forming inverter, and use the Thevenin equivalent circuit to obtain the grid-forming inverter control model:
[0164]
[0165] In the formula, v o (s) is the inverter output voltage; v s (s) is the equivalent voltage source output voltage; A and B are inverter constant parameters; Z g (s) is the impedance of the large power grid; v g (s) is the voltage of the large power grid; R i is the equivalent resistance of the i-th node; s is the variable in the transfer function; λ i is the ith pole; n is the number of poles; Mi is a constant term; Z i-PI is the equivalent impedance of the PI regulator in the current inner loop control; k ip , k ii are the current regulation proportional coefficient and integral coefficient respectively; Z v-PI is the equivalent impedance of the PI regulator in the voltage outer loop control; k vp , k iv They are the voltage regulation proportional coefficient and integral coefficient respectively; G v is the voltage outer loop control gain coefficient; Z vc-l is the virtual equivalent impedance of the voltage outer loop control and filter capacitor; Z i-l Virtual equivalent impedance for current inner loop control; They are virtual positive impedance and negative impedance for equivalent droop control respectively; are the steady-state voltage and current positive frequencies respectively; They are the negative frequencies of steady-state voltage and current respectively; j represents the imaginary part and has no practical meaning; G pf is the droop control coefficient; m pf is the droop gain coefficient; ω f is the cut-off angular frequency of the low-pass filter.
[0166] The output stability of the inverter is determined by the poles. When the real parts of all poles are negative, the output is stable; when there is a pole with a positive real part, oscillation will occur at the corresponding pole frequency.
[0167] In a third aspect of the present invention, there is also provided a device for determining hyperparameters of a convolutional neural network using a gazelle algorithm, the device comprising:
[0168] Initialize a gazelle position unit, which is used to use a hyperparameter in the convolutional neural network as a gazelle position, wherein the hyperparameter is one or more of the number of neurons in all intermediate layers of the convolutional neural network, a learning rate, and a batch size;
[0169] Initialize gazelle position;
[0170] Determine a fitness unit, which is used to use the difference between the actual control parameter and the ideal parameter as the algorithm fitness function; wherein the actual control parameter is a hyperparameter combination directly obtained from the convolutional neural network, and the ideal parameter is a hyperparameter combination that reaches the optimal state in the convolutional neural network;
[0171] Determining a fitness corresponding to the gazelle position;
[0172] A judging unit is used to judge whether the fitness corresponding to the gazelle position satisfies a predetermined condition. If the predetermined condition is satisfied, the gazelle position corresponding to the predetermined condition is used as a target hyperparameter in the convolutional neural network.
[0173] In a fourth aspect of the present invention, there is also provided a device for optimizing a photovoltaic storage grid inverter using a convolutional neural network, wherein the hyperparameters of the convolutional neural network are optimized using the device as described above, and the device comprises:
[0174] A construction unit, used to construct a parameter control model of a photovoltaic energy storage grid inverter based on a convolutional neural network after hyperparameter optimization;
[0175] An input unit, used to input the measured grid impedance value into the photovoltaic energy storage grid inverter parameter control model;
[0176] A determination unit, used for the photovoltaic storage grid inverter parameter control model to determine the photovoltaic storage grid inverter control parameters according to the grid impedance value, wherein the photovoltaic storage grid inverter control parameters include the current regulation proportional coefficient k ip , current regulation integral coefficient k ii , voltage regulation proportional coefficient k vp , voltage regulation integral coefficient k iv , droop gain coefficient m pf ;
[0177] A stability judgment unit is used for the photovoltaic-storage-grid inverter control model to judge the stability of the photovoltaic-storage-grid inverter according to the photovoltaic-storage-grid inverter control parameters.
[0178] Regarding the apparatus in the above-mentioned embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment of the corresponding method, and will not be elaborated here.
[0179] The technical solution of the present invention will be further described below in conjunction with specific implementation methods.
[0180] An optimization control method for photovoltaic energy storage grid inverter based on Gazelle algorithm optimization convolutional neural network. Build a grid inverter control model and analyze the output voltage stability; establish an inverter parameter control model based on convolutional neural network, and optimize the convolutional neural network hyperparameters by using the strong optimization ability and fast search speed of Gazelle optimization algorithm. Figure 3 As shown, the following steps are included:
[0181] S1 builds a grid-type inverter control model to analyze the output voltage stability:
[0182] S11, the control part of the grid-connected inverter includes current control, voltage control, and droop control, and the grid-connected circuit part includes the LC filter equivalent resistance r f and equivalent inductance L f , large power grid equivalent equivalent resistance rg and equivalent inductance L g The grid-connected inverter can be equivalent to a voltage source, and the control methods include current inner loop control and voltage outer loop control. The current inner loop control synchronizes the grid-connected current with the command current to ensure a large power factor when connected to the grid; the voltage outer loop control plays a role in maintaining the stability of the DC voltage.
[0183] The current inner loop control expression is as follows:
[0184]
[0185] In the formula, Z i-PI is the equivalent impedance of the PI regulator in the current inner loop control; k ip , k ii They are the current regulation proportional coefficient and integral coefficient respectively; G i-PI is the current inner loop control gain coefficient; Z i-l Virtual equivalent impedance for the inner current loop control.
[0186] The voltage outer loop control expression is as follows:
[0187]
[0188] In the formula, Z v-PI is the equivalent impedance of the PI regulator in the voltage outer loop control; k vp , k iv They are the voltage regulation proportional coefficient and integral coefficient respectively; G v is the voltage outer loop control gain coefficient; Z vc-l It is the virtual equivalent impedance of voltage outer loop control and filter capacitor.
[0189] The inverter output voltage expression without droop control is:
[0190]
[0191] In the formula, They are respectively the positive frequency voltage output, voltage reference, and current output of the inverter without droop control.
[0192] At this time, the inverter output impedance is:
[0193]
[0194] The inverter outputs asymmetrical impedance under the influence of droop control, where the droop control expression is:
[0195]
[0196] In the formula, G pf is the droop control coefficient; m pfis the droop gain coefficient; ω f To cut off the low-pass filter angular frequency, the high-frequency noise content can be reduced through the low-pass filter.
[0197] Finally, the inverter output impedance expression considering droop control is:
[0198]
[0199] In the formula, They are respectively the equivalent droop control virtual positive impedance and negative impedance, and the calculation formula is:
[0200]
[0201] In the formula, are the steady-state voltage and current positive frequencies respectively; are the steady-state voltage, current and negative frequency respectively.
[0202] S12. Analyze the characteristics of the grid-type inverter and use the Thevenin equivalent circuit to obtain the output voltage of the grid-type inverter:
[0203]
[0204] In the formula, v o (s), Z o (s) are the inverter output voltage and output impedance respectively; v g (s), Z g (s) are the voltage and impedance of the large power grid respectively; v s (s) is the equivalent voltage source output voltage; G o (s) is the closed-loop transfer function; λ i is the ith pole; n is the number of poles; M i is a constant term.
[0205] The output stability of the inverter is determined by the poles. When the real parts of all poles are negative, the output is stable; when there is a pole with a positive real part, oscillation will occur at the corresponding pole frequency.
[0206] S2 establishes a parameter control model of a networked inverter based on a convolutional neural network:
[0207] A parameter control model of a grid-connected inverter is established based on a convolutional neural network. The real-time measured grid impedance is used as the input of the convolutional neural network model, and the inverter control parameters are used as the output. The input-output relationship is feature mapped, and the inverter control parameters are adaptively updated according to the changes in grid impedance, so that the system can always maintain a stable output.
[0208] Convolutional neural network is a typical deep learning method with strong nonlinear fitting and feature extraction capabilities. It can fit the relationship between grid impedance and inverter control parameters. It consists of convolution, activation, pooling, and full connection.
[0209] S21, the convolution layer is the core part of the network. The convolution kernel traverses all input points by sharing weights, and can extract features in a shorter time. The calculation formula is:
[0210]
[0211] Where Ai is the input of the i-th layer; is the operator for convolution operation; Wi is the convolution kernel weight of the i-th layer input; bi is the bias of the i-th layer input.
[0212] S22, the purpose of the activation layer is to change the result of the convolution nonlinearly, improve the generalization ability of the network, and perform this operation by adding an activation function. The expression is:
[0213]
[0214] Where: f(*) is the activation function; y τ is the output of the activation layer after the τth layer input.
[0215] S23. When the feature dimension of the activation layer output is too high, overfitting will occur. This phenomenon can be avoided through pooling operation. The common pooling operation is the maximum value operation, which selects the maximum value in the pooling area as the representative to achieve the dimensionality reduction effect. The calculation formula is:
[0216] max-pooling(f[τ-1],f[τ],f[τ+1])=
[0217] max(f[τ-1],f[τ],f[τ+1])
[0218] Where: max-pooling is the maximum pooling operator; max(*) is the maximum value operation; f[τ] is the τth eigenvalue in the pooling area.
[0219] S24, the fully connected layer is the last layer of the convolutional neural network output, which expands the multi-dimensional features into one-dimensional features, which is conducive to the classifier outputting the optimal value. The neurons in each layer are interconnected. The specific process is:
[0220] o(t)=F(w τ t+b)
[0221] Where: F(*) is the fully connected activation function; t and o(t) are the input and output of the fully connected layer respectively; w τ , b are the weight and bias of the fully connected layer respectively.
[0222] S25, the grid-type inverter parameter control model inputs the grid impedance data into the convolutional neural network, and outputs the optimal control parameters of the inverter through convolution, activation, pooling, and full connection operations. The model input and output are as follows:
[0223] The model input is the grid impedance, that is, the grid equivalent resistance r g , equivalent inductance L g , if the number of training set samples is n, then the training set input is:
[0224]
[0225] The model output is the inverter control parameters, mainly including the current regulation proportional coefficient k ip , current regulation integral coefficient k ii , voltage regulation proportional coefficient k vp , voltage regulation integral coefficient k iv , droop gain coefficient m pf , then the output is:
[0226]
[0227] S3 uses the Gazelle optimization algorithm to optimize the hyperparameters of convolutional neural networks with its strong optimization ability and fast search speed:
[0228] S31. Convolutional neural networks contain many hyperparameters, such as the number of neurons in all intermediate layers, learning rate, batch size, etc. It is difficult to select these parameters manually. Using intelligent optimization algorithms to find the best network hyperparameters can greatly improve network performance.
[0229] The gazelle algorithm is an intelligent swarm optimization algorithm proposed in recent years that simulates the gazelle hunting process. It has the advantages of strong optimization ability and fast convergence speed.
[0230] The formula for random initialization of gazelle population is:
[0231] x ij To indicate the position of the gazelle; Respectively represent the lower and upper limits of the dth hyperparameter;
[0232] Brownian motion is a random molecular thermal motion. The displacement process follows a normal distribution and the calculation formula is:
[0233]
[0234] In the formula, f b represents the Brownian motion position update formula; L represents the random molecular position; μ and δ are the mean and standard deviation of the Gaussian distribution, respectively, and μ=0, δ=1.
[0235] Levy flight randomly searches for the best solution by alternating high and low distance flights, which can effectively coordinate the global search and local search of the algorithm. The calculation formula is:
[0236]
[0237] Where, β is the Levy flight coefficient, which is 1.5; y = Normal (0,1 2 ); where σ x The calculation formula is:
[0238]
[0239] Where Γ(·) is the gamma function.
[0240] The development phase is used for scenarios without predators, where the free gazelle updates its position through Brownian motion, calculated as:
[0241] G i+1 =G i +s v ·r·r b ·(E i -r b G i )
[0242] In the formula, G i is the solution at the i-th iteration; s v is the moving speed; r is a random number between 0 and 1; r b is the Brownian motion random vector; E i is the matrix of the optimal gazelle at the i-th iteration.
[0243] When gazelles spot a predator, they use Lévy flight and Brownian motion to escape.
[0244] (1) Phase 1
[0245] The calculation formula for the gazelle's initial Levy flight to find prey is:
[0246] G i+1 =G i +s max ·λ·r·r L ·(E i -r L G i )
[0247] G i+1 =G i +s max ·λ σ ·r·r L·(E i -r L G i )
[0248] In the formula, s max is the maximum flight speed; σ The value is -1 or 1, indicating two flight directions; r L is the Levy flight random vector, r is a random number between 0 and 1;
[0249] (2) Second stage
[0250] G i+1 =G i +s max ·λ σ ·A b ·r b ·(E i -r L G i )
[0251] In the formula, A b is the cumulative effect coefficient.
[0252] S32. The steps for optimizing the hyperparameters of convolutional neural networks using the gazelle algorithm are as follows:
[0253] Step 1: Set the gazelle optimization algorithm parameters, initialize the gazelle population, and use the actual control parameters and ideal parameters as the algorithm fitness function;
[0254] Step 2: Use Levy flight and Brownian motion to update the gazelle position and calculate the individual fitness of the gazelle;
[0255] Step 3: Determine whether the maximum number of iterations has been reached. If yes, output the optimal convolutional network hyperparameters; if no, return to step 2 and iterate again.
[0256] S33. The specific steps of the optimization process of the photovoltaic storage grid inverter based on the gazelle algorithm to optimize the convolutional neural network are as follows:
[0257] Step 1: Extract the grid impedance and divide the input data into training set and test set;
[0258] Step 2: Input the input data into the convolutional neural network. After convolution, activation, pooling, and full connection operations, forward calculate the loss function and reverse update the model parameters.
[0259] Step 3: If the termination condition is not met, return to step 2, otherwise proceed to the next step;
[0260] Step 4: Input the online impedance data as a test set into the trained convolutional neural network model;
[0261] Step 5: Update the parameters of the grid-connected inverter in real time, and verify the effectiveness of the inverter parameter control method proposed in the present invention according to the actual grid stability.
[0262] Based on the above disclosed content, the present invention also provides an electronic device. Figure 4 As shown, the electronic device of an embodiment of the present disclosure includes at least one electrically connected processor and at least one memory, wherein the memory is electrically connected to the processor, wherein the memory stores instructions that can be executed 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 the method steps executed by the controller as above.
[0263] An embodiment of the present invention further provides a storable medium on which computer instructions are stored. When the computer instructions are executed by a processor, the steps in the method in the above embodiment are specifically performed.
[0264] An embodiment of the present invention further provides a computer program product, including computer instructions. When the computer instructions are executed by a processor, the steps in the method in the above embodiment are specifically followed.
[0265] It should be noted that the above content only illustrates the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications all fall within the protection scope of the claims of the present invention.
[0266] In order to verify the effect of the optimization control method of the photovoltaic energy storage grid inverter based on the gazelle algorithm to optimize the convolutional neural network proposed in this paper, a Figure 5 The model of the photovoltaic-storage grid-connected inverter connected to the large power grid shown in the figure includes four parts: photovoltaic power generation equipment, energy storage equipment, grid-connected inverter, and large power grid. The parameters of the grid-connected inverter are shown in Table 1.
[0267] Table 1 Parameters of grid-connected inverter
[0268]
[0269] The Gazelle optimization algorithm is used to optimize the convolutional neural network. The actual inverter control parameters and the inverter control parameter errors output by the network are used as the fitness function. The Gazelle algorithm finds the optimal network hyperparameters with the lowest fitness. The optimization process of the Gazelle algorithm is as follows: Figure 6As shown in the figure, when the number of algorithm iterations reaches 77, the fitness reaches the minimum value of 0.87. If the number of iterations continues to increase, the fitness remains stable. This shows that the gazelle algorithm proposed in the present invention has the advantages of strong optimization ability and fast convergence speed, which greatly improves the performance of the convolutional neural network. The optimized convolutional neural network hyperparameters are shown in Table 2.
[0270] Table 2 Convolutional neural network hyperparameters optimized by Gazelle algorithm
[0271]
[0272] In order to verify the effect of the grid-connected inverter parameter adaptive adjustment method proposed in the present invention when the grid impedance changes, the grid equivalent resistance and inductance changes are set as follows: Figure 7 As shown, the initial resistance and inductance are 0.1pu and 0.04pu respectively. At 1s, the resistance and inductance change to 0.041pu and 0.114pu respectively. At 2s, the resistance and inductance change to 0.088pu and 0.027pu respectively.
[0273] The inverter parameters are optimized using the convolutional neural network optimized by the gazelle optimization algorithm. The network loss function changes with the number of iterations as shown in the figure. Figure 8 As shown in the figure, when the number of network iterations reaches 700, the loss function is only 0.46, which means that the error between the inverter parameters output by the network and the ideal parameters is low, and the mapping relationship between the grid parameters and the inverter parameters can be fully fitted.
[0274] The inverter control parameters after convolutional neural network feature learning, that is, the current regulation proportional coefficient k ip , current regulation integral coefficient k ii , voltage regulation proportional coefficient k vp , voltage regulation integral coefficient k iv , droop gain coefficient m pf The change curves are as follows Figure 9-13 As shown, the voltage output curves without using parameter adaptive optimization and using the adaptive parameter optimization method of the present invention are as follows Fig.14 As shown. As can be seen from the figure, the output voltage of the inverter without using the parameter adaptive optimization method oscillates when the impedance changes, and the system becomes unstable; after using the method of the present invention, the various control parameters of the inverter can be updated in real time according to the change of the grid impedance. In the scenario of the grid impedance change occurring at 1 second, the voltage remains stable after a short oscillation of 0.2 seconds. In the scenario of the grid impedance change occurring at 2 seconds, the voltage remains stable after a short oscillation of 0.5 seconds. It shows that after the proposed inverter parameter adaptive adjustment method, the parameters can be controlled to restore the system to stability after the grid impedance changes, verifying the effectiveness of the method of the present invention.
[0275] In order to verify the superiority of the algorithm of the present invention, the method of the present invention is compared with artificial neural networks and traditional convolutional neural networks without hyperparameter optimization, and the model optimization results are shown in Table 3. It can be seen from the table that the output voltage quality of the method of the present invention after stabilization is the best, the output voltage quality of the artificial neural network is the worst, and the calculation time is the shortest. This is because artificial neural networks belong to shallow machine learning, with few parameters and low calculation amount, but weak feature learning ability, and cannot fully fit the relationship between grid impedance and inverter parameters; although traditional convolutional neural networks have strong feature learning ability, they have not been optimized by hyperparameters, and need to be further improved in fitting the relationship between grid impedance and inverter parameters, with low training efficiency, large calculation amount, and long calculation time; the convolutional neural network hyperparameters proposed in the present invention are optimized by the gazelle algorithm, which greatly improves the performance of the network, improves the efficiency of feature mapping grid impedance and inverter parameters, and can achieve the optimal voltage output when the calculation time is only 0.05s more than that of artificial neural networks. It shows that the method of the present invention can respond in time at a faster speed in actual grid operation, obtain inverter control parameters, and keep the voltage at the best output, verifying that the comprehensive performance of the method of the present invention is optimal, and has strong practical engineering significance.
[0276] Table 3 Comparison of results of different algorithms
[0277]
[0278] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for determining hyperparameters of a convolutional neural network using a gazelle algorithm, the method comprising: Using a hyperparameter in a convolutional neural network as a gazelle position, wherein the hyperparameter is one or more of the number of neurons in all intermediate layers of the convolutional neural network, a learning rate, and a batch size; Initialize gazelle position; The difference between the actual control parameters and the ideal parameters is used as the algorithm fitness function; where, The actual control parameters are the hyperparameter combinations directly obtained from the convolutional neural network, and the ideal parameters are the hyperparameter combinations that reach a predetermined state in the convolutional neural network; Determining the fitness corresponding to the gazelle position; It is determined whether the fitness corresponding to the gazelle position satisfies a predetermined condition. If the predetermined condition is satisfied, the gazelle position corresponding to the predetermined condition is used as a target hyperparameter in the convolutional neural network.
2. The method according to claim 1, wherein: The step of judging whether the fitness corresponding to the gazelle position satisfies a predetermined condition includes: It is determined whether the number of iterations is reached or the fitness is less than or equal to a predetermined value. If the number of iterations is reached or the fitness is less than or equal to the predetermined value, it is considered that the predetermined condition is met.
3. The method according to claim 1 or 2, wherein: The step of judging whether the fitness corresponding to the gazelle position satisfies a predetermined condition includes: Determine whether the number of iterations is reached or the fitness is less than or equal to a predetermined value; if the number of iterations is not reached or is greater than the predetermined value, update the gazelle position using Levy flight and Brownian motion, and continue to execute the step of determining the fitness corresponding to the gazelle position.
4. The method according to claim 1, wherein: Initialize the gazelle position by, Among them, x ij To indicate the position of the gazelle; They represent the lower and upper limits of the dth hyperparameter respectively; rand(0,1) represents a random value between 0 and 1.
5. The method according to claim 3, wherein: The step of updating the gazelle position by using Lévy flight and Brownian motion, and continuing to perform the step of determining the fitness corresponding to the gazelle position, comprises: Define the fitness corresponding to the position of each gazelle as F i =f(x i ),in, x i (t+1)=x i (t)+v i (t); Among them, x i (t) is the t-th generation position of the i-th gazelle; x i (t+1) is the t+1th generation position of the i-th gazelle; v i (t) is the speed of the ith gazelle in the tth generation; v i The update formula of (t) is: v i (t+1)=v i (t)+c1·r1·(p i (t)-x i (t))+c2·r2·(g(t)-x i (t)) Where: v i (t+1) is the speed of the ith gazelle in the t+1 generation, c1 and c2 are learning factors, r1 and r2 are random numbers between [0, 1]; p i (t) is the current optimal position of the i-th gazelle, and g(t) is the global optimal position.
6. A method for optimizing a photovoltaic storage grid inverter using a convolutional neural network, wherein: The hyperparameters of the convolutional neural network are optimized by the method according to any one of claims 1 to 5, wherein the method comprises: Based on the convolutional neural network, a parameter control model of a photovoltaic energy storage grid inverter is constructed; Inputting the measured grid impedance value into the photovoltaic energy storage grid inverter parameter control model; The photovoltaic storage grid inverter parameter control model determines the photovoltaic storage grid inverter control parameters according to the grid impedance value, wherein the photovoltaic storage grid inverter control parameters include the current regulation proportional coefficient k ip , current regulation integral coefficient k ii , voltage regulation proportional coefficient k vp , voltage regulation integral coefficient k iv and droop gain factor m pf ; The photovoltaic-storage-grid inverter control model determines the output stability of the photovoltaic-storage-grid inverter according to the photovoltaic-storage-grid inverter control parameters.
7. The method for optimizing and controlling a photovoltaic energy storage grid-type inverter based on a convolutional neural network according to claim 6 is characterized in that: Based on the convolutional neural network, a parameter control model of a photovoltaic energy storage grid inverter is constructed, including: The parameter control data of the photovoltaic storage grid inverter is input as input data into the convolutional neural network for iterative training to obtain the output inverter control parameters; wherein the parameter control data of the photovoltaic storage grid inverter includes the grid impedance value, and the grid impedance value includes the grid equivalent resistance r g , equivalent inductance L g , The input formula is: The output is: In the formula, A in represents the training set input; y out Represents the model output; r g (n) represents the equivalent impedance of the power grid in the nth training set; L g (n) represents the equivalent inductance of the power grid in the nth training set; k ip (n) represents the current adjustment ratio coefficient of the nth training set; k ii (n) represents the current regulation integral coefficient of the nth training set; k vp (n) represents the voltage regulation coefficient of the nth training set; k iv (n) represents the voltage regulation integral coefficient of the nth training set; m pf (n) represents the droop gain coefficient of the nth training set; The trained convolutional neural network is the parameter control model of the photovoltaic energy storage network inverter.
8. The method for optimizing and controlling a photovoltaic-storage grid-type inverter based on a convolutional neural network according to claim 7 is characterized in that: The process of inputting the parameter control data of the photovoltaic energy storage grid inverter into the convolutional neural network for iterative training includes: The input data is divided into a training set and a test set; the training set is used to train the parameter control model of the photovoltaic storage grid inverter, and after convolution, activation, pooling, and full connection operations, the loss function is forward calculated, and the parameters of the photovoltaic storage grid inverter parameter control model are reversely updated; If the maximum number of iterations is not reached, retrain according to the updated parameters; If the maximum number of iterations is reached, the trained photovoltaic storage grid-type inverter parameter control model parameters are retained, the test set data is input into the trained photovoltaic storage grid-type inverter parameter control model, and the optimal photovoltaic storage grid-type inverter control parameter output is updated in real time. The optimal photovoltaic storage grid-type inverter control parameters are the grid-type inverter control parameters.
9. The method for optimizing and controlling a photovoltaic energy storage grid-type inverter based on a convolutional neural network according to claim 6, characterized in that: Based on the current control, voltage control and droop control of the control part of the photovoltaic storage grid inverter, as well as the equivalent resistance and equivalent inductance of the LC filter connected to the grid circuit, and the equivalent equivalent resistance and equivalent inductance of the large power grid, the control model of the photovoltaic storage grid inverter is constructed using the Thevenin equivalent circuit.
10. The method for optimizing and controlling a photovoltaic-storage grid-type inverter based on a convolutional neural network according to claim 9, characterized in that: The control model of the photovoltaic-storage grid-connected inverter is: In the formula, v o (s) is the inverter output voltage; v s (s) is the equivalent voltage source output voltage; A and B are inverter constant parameters; Z g (s) is the impedance of the large power grid; v g (s) is the voltage of the large power grid; R i is the equivalent resistance of the i-th node; s is the variable in the transfer function; λ i is the ith pole; n is the number of poles; M i is a constant term; Z i-PI is the equivalent impedance of the PI regulator in the current inner loop control; k ip , k ii are the current regulation proportional coefficient and integral coefficient respectively; Z v-PI is the equivalent impedance of the PI regulator in the voltage outer loop control; k vp , k iv They are the voltage regulation proportional coefficient and integral coefficient respectively; G v is the voltage outer loop control gain coefficient; Z vc-l is the virtual equivalent impedance of the voltage outer loop control and filter capacitor; Z i-l Virtual equivalent impedance for current inner loop control; They are virtual positive impedance and negative impedance for equivalent droop control respectively; are the steady-state voltage and current positive frequencies respectively; They are the negative frequencies of steady-state voltage and current respectively; j represents the imaginary part and has no practical meaning; G pf is the droop control coefficient; m pf is the droop gain coefficient; ω f is the cut-off angular frequency of the low-pass filter.
11. The method for optimizing and controlling a photovoltaic-storage grid-type inverter based on a convolutional neural network according to claim 6, characterized in that: The photovoltaic-storage-grid inverter control model determines the stability of the photovoltaic-storage-grid inverter according to the photovoltaic-storage-grid inverter control parameters, including: The output stability of the inverter is determined by the poles. When the real parts of all poles are negative, the output is stable; when there is a pole with a positive real part, oscillation occurs at the corresponding pole frequency and the output is unstable.
12. A device for determining hyperparameters of a convolutional neural network using a gazelle algorithm, the device comprising: Initialize the gazelle position unit to use the hyperparameters in the convolutional neural network as the gazelle position, where The hyperparameter is one or more of the number of neurons in all intermediate layers of the convolutional neural network, the learning rate, and the batch size; Initialize gazelle position; Determine a fitness unit, which is used to use the difference between the actual control parameter and the ideal parameter as the algorithm fitness function; wherein the actual control parameter is a hyperparameter combination directly obtained from the convolutional neural network, and the ideal parameter is a hyperparameter combination that reaches the optimal state in the convolutional neural network; Determining the fitness corresponding to the gazelle position; A judging unit is used to judge whether the fitness corresponding to the gazelle position satisfies a predetermined condition. If the predetermined condition is satisfied, the gazelle position corresponding to the predetermined condition is used as a target hyperparameter in the convolutional neural network.
13. An optimization device for optimizing a photovoltaic storage grid inverter using a convolutional neural network, wherein: The hyperparameters of the convolutional neural network are obtained by optimizing using the device according to claim 12 or the hyperparameters of the convolutional neural network are obtained by optimizing using the method according to any one of claims 1 to 6, wherein the optimization device comprises: A construction unit, used to construct a parameter control model of a photovoltaic energy storage grid inverter based on a convolutional neural network after hyperparameter optimization; An input unit, used for inputting the measured grid impedance value into the parameter control model of the photovoltaic energy storage grid inverter; A determination unit, used for the photovoltaic storage grid inverter parameter control model to determine the photovoltaic storage grid inverter control parameters according to the grid impedance value, wherein the photovoltaic storage grid inverter control parameters include the current regulation proportional coefficient k ip , current regulation integral coefficient k ii , voltage regulation proportional coefficient k vp , voltage regulation integral coefficient k iv , droop gain coefficient m pf ; A stability judgment unit is used for the photovoltaic-storage-grid inverter control model to judge the stability of the photovoltaic-storage-grid inverter according to the photovoltaic-storage-grid inverter control parameters.
14. An electronic device, comprising at least one processor and at least one memory, wherein the memory is data-connected to the processor, wherein: The memory stores instructions that can be executed 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 method of any one of claims 1-5 or 6-11.
15. A computer storable medium, characterized in that: The storable medium stores computer instructions, and when the computer instructions are executed by the processor, the steps in the method as described in any one of claims 1-5 or 6-11 are specifically performed.
16. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the steps in the method as described in any one of claims 1-5 or 6-11 are specifically performed.
Citation Information
Cited By
Inverter power supply network construction type control method based on artificial neural network
CN121012108A
An inverter power supply network configuration type control method based on artificial neural network
CN121012108B
Network construction type inverter control method based on physical information neural network
CN121749390A
A network-constructing inverter control method based on physical information neural network
CN121749390B