Disclosure of Invention
The invention aims to solve the technical problem that the extraction capability of the sequence characteristics of the convolutional layer in a model is weak and the fluctuation distribution of a generated scene deviates from a real sample in the prior art, and provides a method and a system for generating a medium-term wind power scene.
The technical scheme for solving the technical problems is as follows:
a medium-term wind power scene generation method comprises the following steps:
s1, acquiring preset conditions and wind power electric quantity data, wherein the preset conditions comprise interval types of wind power total energy or total time resolution;
s2, inputting the preset conditions and the wind power data into an optimized medium-term wind power scene generation model, and generating a wind power time sequence curve of a medium-term wind power scene; the convolution layers in the generator and the discriminator in the medium-term wind power scene generation model are replaced by a time sequence enhancement module; the time sequence enhancing module is used for reconstructing time sequence correlation of the characteristic diagram and outputting a convolution characteristic diagram with an N-order difference characteristic.
The invention has the beneficial effects that: the method comprises the steps of replacing a generator in a medium-term wind power scene generation model and a convolution layer in a discriminator with a time sequence enhancement module, optimizing the medium-term wind power scene generation model, improving the time sequence feature extraction capability of the convolution layer according to the optimized medium-term wind power scene generation model, inputting preset conditions and wind power data into the model, accurately generating a wind power time sequence curve of the medium-term wind power scene, reconstructing time sequence correlation of a feature map through the time sequence enhancement module, outputting a convolution feature map with an N-order difference characteristic, and effectively solving fluctuation deviation of the wind power time sequence curve of the medium-term wind power scene.
Further, before S2, the method further includes:
establishing a medium-term wind power scene generation model according to the improved conditional countermeasure neural network algorithm of the time sequence enhancement module; improving the conditional countermeasure neural network algorithm, comprising: replacing an antagonistic neural network in the conditional antagonistic neural network algorithm by a WGAN-GP algorithm to obtain an improved conditional antagonistic neural network algorithm;
inputting preset conditions, noise and training samples into the medium-term wind power scene generation model for training, and iterating and converging the medium-term wind power scene generation model to obtain the optimized medium-term wind power scene generation model.
The beneficial effect of adopting the further scheme is that: the improved conditional countermeasure neural network algorithm is obtained by replacing a countermeasure neural network in the conditional countermeasure neural network algorithm with the WGAN-GP algorithm, the improved conditional countermeasure neural network algorithm is combined with the time sequence enhancement module to establish a mid-term wind power scene generation model, the conditions of the rest part are consistent with those of the WGAN-GP, preset conditions, noise and training samples are input into the mid-term wind power scene generation model to be trained, the optimized mid-term wind power scene generation model is obtained, and the required wind power scene can be generated. The effects of establishing and optimizing the medium-term wind power scene generation model are achieved.
Further, the timing enhancement module is specifically configured to,
inputting the feature map F output by the previous layer into the time sequence enhancing module, and reshaping the feature map F into a sequence S by the time sequence enhancing module;
carrying out N-order differentiation on the remolded sequence S;
carrying out subtraction and filling on the samples in the sequence S after the N-order difference to ensure that the length of the sequence S is the same as that of the original sequence;
and performing dimension remodeling on the sequence S subjected to difference and filling, and performing cascade/summation on the channel dimension to form a new characteristic diagram tensor as the input of the next convolution layer.
The beneficial effect of adopting the further scheme is that: the time sequence correlation of the characteristic graph is reconstructed by the time sequence enhancement module, the convolution characteristic graph with the N-order difference characteristic is output, and the network structure of the CNN in the prior art cannot accurately express the distribution condition of the sequence difference, so that time sequence difference components are introduced into the input part of each time sequence enhancement module and are input into the CNN at the back, and the CNN is forced to learn by using the difference data, so that the problem that the traditional CNN network structure is poor in the distribution learning capability of the sequence difference is solved.
Further, the inputting of preset conditions, noise and training samples into the medium-term wind power scene generation model for training specifically includes:
and setting the preset condition, expanding the preset condition to the length which is the same as that of the noise, and inputting the preset condition, the noise and the training sample into the medium-term wind power scene generation model for training.
The beneficial effect of adopting the further scheme is that: the method comprises the steps of establishing an improved CGAN model through a Keras library based on a Tensorflow framework, setting the preset condition as the interval category of total wind power energy or the resolution ratio of total time, repeating and expanding the preset condition to the length the same as that of noise, ensuring that the splicing dimensionality of two tensors in input is the same, inputting the set condition, the noise and a training sample into a middle-term wind power scene generation model for training, obtaining an optimized model after training, and outputting a wind power scene capable of solving the problems of fluctuation and offset after training and optimizing from the model incapable of generating the wind power scene before training.
Further, the conditions further include: wind speed or temperature.
The beneficial effect of adopting the further scheme is that: the method and the device have the advantages that the preset electric quantity is used as an input condition, the condition can be various quantities, and the wind speed or the temperature can be included, so that various scenes can be generated.
Another technical solution of the present invention for solving the above technical problems is as follows:
a mid-term wind power scene generation system comprising:
the system comprises a data acquisition module, a data analysis system and a time sequence enhancement module;
the data acquisition module is used for acquiring preset conditions and wind power electric quantity data, wherein the preset conditions comprise interval types of wind power total energy or total time resolution;
the data analysis system is used for inputting the preset conditions and the wind power data into an optimized medium-term wind power scene generation model to generate a wind power time sequence curve of a medium-term wind power scene; the convolution layers in the generator and the discriminator in the medium-term wind power scene generation model are replaced by a time sequence enhancement module;
the time sequence enhancing module is used for reconstructing time sequence correlation of the characteristic diagram and outputting a convolution characteristic diagram with an N-order difference characteristic.
The invention has the beneficial effects that: the method comprises the steps of replacing a generator in a medium-term wind power scene generation model and a convolution layer in a discriminator with a time sequence enhancement module, optimizing the medium-term wind power scene generation model, improving the time sequence feature extraction capability of the convolution layer according to the optimized medium-term wind power scene generation model, inputting preset conditions and wind power data into the model, accurately generating a wind power time sequence curve of the medium-term wind power scene, reconstructing time sequence correlation of a feature map through the time sequence enhancement module, outputting a convolution feature map with an N-order difference characteristic, and effectively solving fluctuation deviation of the wind power time sequence curve of the medium-term wind power scene.
On the basis of the technical scheme, the invention can be further improved as follows.
Further, the generating model of the medium-term wind power scene specifically includes: the model generation module and the model optimization module;
the model generation module is used for establishing a medium-term wind power scene generation model according to the improved conditional countermeasure neural network algorithm of the time sequence enhancement module; improving the conditional countermeasure neural network algorithm, comprising: replacing an antagonistic neural network in the conditional antagonistic neural network algorithm by a WGAN-GP algorithm to obtain an improved conditional antagonistic neural network algorithm;
the model optimization module is used for inputting preset conditions, noise and training samples into the medium-term wind power scene generation model for training, and iterating and converging the medium-term wind power scene generation model to obtain the optimized medium-term wind power scene generation model.
The beneficial effect of adopting the further scheme is that: the improved conditional countermeasure neural network algorithm is obtained by replacing a countermeasure neural network in the conditional countermeasure neural network algorithm with the WGAN-GP algorithm, the improved conditional countermeasure neural network algorithm is combined with the time sequence enhancement module to establish a mid-term wind power scene generation model, the conditions of the rest part are consistent with those of the WGAN-GP, preset conditions, noise and training samples are input into the mid-term wind power scene generation model to be trained, the optimized mid-term wind power scene generation model is obtained, and the required wind power scene can be generated. The effects of establishing and optimizing the medium-term wind power scene generation model are achieved.
Further, the timing enhancement module is specifically configured to,
inputting the feature map F output by the previous layer into the time sequence enhancing module, and reshaping the feature map F into a sequence S by the time sequence enhancing module;
carrying out N-order differentiation on the remolded sequence S;
carrying out subtraction and filling on the samples in the sequence S after the N-order difference to ensure that the length of the sequence S is the same as that of the original sequence;
and performing dimension remodeling on the sequence S subjected to difference and filling, and performing cascade/summation on the channel dimension to form a new characteristic diagram tensor as the input of the next convolution layer.
The beneficial effect of adopting the further scheme is that: the time sequence correlation of the characteristic graph is reconstructed by the time sequence enhancement module, the convolution characteristic graph with the N-order difference characteristic is output, and the network structure of the CNN in the prior art cannot accurately express the distribution condition of the sequence difference, so that time sequence difference components are introduced into the input part of each time sequence enhancement module and are input into the CNN at the back, and the CNN is forced to learn by using the difference data, so that the problem that the traditional CNN network structure is poor in the distribution learning capability of the sequence difference is solved.
Further, the model optimization module is specifically configured to set the preset condition, extend the preset condition to a length equal to that of the noise, and input the preset condition, the noise, and the training sample into the medium-term wind power scene generation model for training.
The beneficial effect of adopting the further scheme is that: the method comprises the steps of establishing an improved CGAN model through a Keras library based on a Tensorflow framework, setting the preset condition as the interval category of total wind power energy or the resolution ratio of total time, repeating and expanding the preset condition to the length the same as that of noise, ensuring that the splicing dimensionality of two tensors in input is the same, inputting the set condition, the noise and a training sample into a middle-term wind power scene generation model for training, obtaining an optimized model after training, and outputting a wind power scene capable of solving the problems of fluctuation and offset after training and optimizing from the model incapable of generating the wind power scene before training.
Further, the conditions further include: wind speed or temperature.
The beneficial effect of adopting the further scheme is that: the method and the device have the advantages that the preset electric quantity is used as an input condition, the condition can be various quantities, the wind speed or the temperature can be included, and various scenes can be generated.
Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
The principles and features of this invention are described below in conjunction with the following drawings, which are set forth to illustrate, but are not to be construed to limit the scope of the invention.
As shown in fig. 1, a method for generating a medium-term wind power scene provided in an embodiment of the present invention includes:
s1, acquiring preset conditions and wind power data, wherein the preset conditions comprise interval types of wind power total energy or total time resolution;
the interval type of the total wind power energy can indicate the average electric quantity in 1 day or 5 days in a certain embodiment; the total wind power time resolution, in a certain embodiment, may be expressed as a resolution of an input condition, for example, if an output curve of 5 days is to be generated, a daily power interval is an average power per day, and a total power interval is an average power of 5 days; a more accurate prediction resolution reduces the uncertainty so that the input day/total charge interval depends on whether the predicted charge is a daily charge or a total charge.
The condition may be a variety of quantities, and may include wind speed, predicted electrical quantity, temperature, etc., and the predicted electrical quantity is used as an input condition herein as an algorithm input.
S2, inputting preset conditions and wind power data into the optimized medium-term wind power scene generation model, and generating a wind power time sequence curve of the medium-term wind power scene; the convolution layers in the generator and the discriminator in the medium-term wind power scene generation model are replaced by a time sequence enhancement module; and the time sequence enhancing module is used for reconstructing time sequence correlation of the characteristic diagram and outputting a convolution characteristic diagram with an N-order difference characteristic.
Establishing an improved CGAN model by utilizing a Keras library based on a Tensorflow framework, and replacing an antagonistic neural network in a conditional antagonistic neural network algorithm by a WGAN-GP algorithm to obtain an improved CGAN conditional antagonistic neural network algorithm; and simultaneously inputting the conditions, the noises and the training samples into the model for training, and obtaining a medium-term wind power scene generation model after the model is converged at enough iteration times. And inputting the interval type/total time resolution of the wind power total energy, the noise and the wind power electric quantity data into the trained middle-term wind power scene generation model to generate a wind power time sequence curve of the middle-term wind power scene.
The timing enhancement module is configured to reconstruct a timing relationship of the feature map and output a convolution feature map with an nth order difference characteristic, which in an embodiment, as shown in fig. 2, may be:
firstly, the timing sequence enhancement module reshapes the feature map F into a sequence S according to the following formula:
Fw×h×c→S m×c,
wherein, w, h, c and m are respectively the width, height and channel number of the characteristic diagram, and the channel number and length of the c and m remolded sequence are dimension parameters (shape) of Tensor; then, an N-order difference (N-DIFF) is performed on the reshaped S, the first 2D convolution layer, 128, (5, 5); a second 2D convolutional layer, 4, (5, 5), according to the following formula:
where S is a sample in S, and differencing to form a sequence of fluctuations S on a time scale NNAfter N differential operations, the sequences are m-N to N in lengthmZero padding is then used so that these short sequences are the same length as the original sequence.
The difference of order N is for each m01 to m0m-N and c01 to c0C, carrying out the difference in the formula to form a new sequence is the difference sequence.
Finally, the dimensionality of the N-DIFF sequences is reshaped into w multiplied by h multiplied by c, and cascading/summing is carried out on the channel dimensionality, the two tensors are spliced together in the channel (channel) direction, and the summing representation directly adds the two tensors. A new eigenmap tensor is formed as input for the subsequent convolutional layer. Due to the operation, the time sequence enhancing module can directly output the convolution characteristic diagram capable of reflecting the N-order difference characteristic.
The method comprises the steps of replacing a generator in a medium-term wind power scene generation model and a convolution layer in a discriminator with a time sequence enhancement module, optimizing the medium-term wind power scene generation model, improving the time sequence feature extraction capability of the convolution layer according to the optimized medium-term wind power scene generation model, inputting preset conditions and wind power data into the model, accurately generating a wind power time sequence curve of the medium-term wind power scene, reconstructing time sequence correlation of a feature map through the time sequence enhancement module, outputting a convolution feature map with an N-order difference characteristic, and achieving the effect of effectively solving fluctuation deviation of the wind power time sequence curve of the medium-term wind power scene.
Preferably, in any of the above embodiments, before S2, the method further includes:
establishing a medium-term wind power scene generation model according to the improved conditional adversarial neural network algorithm of the time sequence enhancement module; an improved conditional countermeasure neural network algorithm, comprising: replacing an antagonistic neural network in the conditional antagonistic neural network algorithm by a WGAN-GP algorithm to obtain an improved conditional antagonistic neural network algorithm;
and inputting preset conditions, noise and training samples into the medium-term wind power scene generation model for training, and iterating and converging the medium-term wind power scene generation model to obtain the optimized medium-term wind power scene generation model.
As shown in fig. 3, in a certain embodiment, a medium-term wind power scene generation model is established, a wind power day/total power interval is used as a condition, a conditional WGAN-GP algorithm is used as a main body, and a gradient penalty formula is as follows: lambda (1- | grad |)2And replacing the convolution layers in the generator and the discriminator in the model with a time sequence enhancement module, wherein the rest part of the model is consistent with the condition WGAN-GP, so as to obtain a medium-term wind power scene generation model.
In one embodiment, training the optimization model may include: the condition input mode is interval category/total time resolution of total wind power energy, and the interval category/total time resolution is repeated and expanded to the length same as that of noise, so that the dimension of splicing two tensors in input is ensured to be the same. As shown in fig. 4, (a) is classified by single day, and (b) is classified by total time. And according to the single-day/total electric quantity quantile of the wind energy, the wind power electric quantity intervals are evenly distributed. For the sake of simplicity, the present example only divides the electric quantity into three parts, which may be 0-1970 mw;
1970-3405 MW; 3405-installed capacity, and the normalized maximum value is the installed capacity multiplied by the total time threshold. An improved CGAN model is established by utilizing a Keras library based on a Tensorflow framework, conditions, noises and training samples are simultaneously input into the model for training, and after the model is converged with enough iteration times, a mid-term wind power scene generation model after training optimization can be obtained. The number of iterations is not particularly limited, and the iterations are performed for a period of time as much as possible.
The improved conditional countermeasure neural network algorithm is obtained by replacing a countermeasure neural network in the conditional countermeasure neural network algorithm with the WGAN-GP algorithm, the improved conditional countermeasure neural network algorithm is combined with the time sequence enhancement module to establish a mid-term wind power scene generation model, the rest conditions are consistent with the WGAN-GP, preset conditions, noise and training samples are input into the mid-term wind power scene generation model to be trained, the optimized mid-term wind power scene generation model is obtained, and the required wind power scene can be generated. The effects of establishing and optimizing the medium-term wind power scene generation model are achieved.
Preferably, in any of the above embodiments, the timing enhancement module is specifically configured to,
inputting the feature map F output by the previous layer into a time sequence enhancing module, and remolding the feature map F into a sequence S by the time sequence enhancing module;
carrying out N-order difference on the remolded sequence S;
carrying out subtraction and filling on the samples in the sequence S subjected to the N-order difference to ensure that the length of the sequence S is the same as that of the original sequence;
and performing dimensionality remodeling on the sequence S subjected to difference and filling, and performing cascade/summation on channel dimensionality to form a new characteristic diagram tensor as the input of the next convolution layer.
The time sequence correlation of the characteristic graph is reconstructed by the time sequence enhancement module, the convolution characteristic graph with the N-order difference characteristic is output, and the network structure of the CNN in the prior art cannot accurately express the distribution condition of the sequence difference, so that time sequence difference components are introduced into the input part of each time sequence enhancement module and are input into the CNN at the back, and the CNN is forced to learn by using the difference data, so that the problem that the traditional CNN network structure is poor in the distribution learning capability of the sequence difference is solved.
Preferably, in any of the above embodiments, inputting preset conditions, noise and training samples into the medium-term wind power scene generation model for training specifically includes:
and setting a preset condition, expanding the preset condition to the length which is the same as that of the noise, and inputting the preset condition, the noise and a training sample into the medium-term wind power scene generation model for training.
The method comprises the steps of establishing an improved CGAN model through a Keras library based on a Tensorflow framework, setting a preset condition as the resolution ratio of interval categories or total time of wind power total energy, repeating and expanding the preset condition to the length the same as that of noise, ensuring that the dimensionality of splicing two tensors in input is the same, inputting the set condition, the noise and a training sample into a middle-term wind power scene generation model for training, obtaining an optimized model after training, and outputting a wind power scene capable of solving the problems of fluctuation and offset after training and optimizing from the model incapable of generating the wind power scene before training.
Preferably, in any of the above embodiments, the conditions further comprise: wind speed or temperature.
The method and the device have the advantages that the preset electric quantity is used as an input condition, the condition can be various quantities, the wind speed or the temperature can be included, and various scenes can be generated.
In an embodiment, fig. 5 and 6 show the conditional probability density distribution of the wind power fluctuation of the first and second types of original samples, respectively, and the fluctuation distribution of the scene generated by the WGAN-GP model, with/without the timing enhancement module. It can be clearly seen that the model representing the inclusion of the timing enhancement module is closer to the actual distribution and that the wind power fluctuation distribution of the scene produced by the original WGAN-GP deviates significantly from the actual distribution. From the view of fluctuation distribution, the model is proved to be capable of capturing the time correlation of the wind power output more effectively.
In one embodiment, as shown in fig. 7, scene generation is performed under two different conditions of 100h and 8000h by using single-day classification conditions, so as to simulate the uncertainty of wind power. Training samples corresponding to 100h and 8000h (blue bold lines) are shown in fig. 7(a) and 7(b), and input conditions are also shown for the 8000h sample. The single-day classification condition may be an interval where the daily electric quantity is located as an input. The first class may be 1/3, the second class may be 2/3, and the third class may be 1.
Through the comparison, the conditional WGAN-GP model with the time sequence enhancement module can generate a middle-term wind power scene, and the learning performance related to the time sequence is superior to that of the traditional WGAN-GP model.
In one embodiment, a medium-term wind power scene generation system is provided, as shown in fig. 8, the system includes:
the system comprises a data acquisition module 11, a data analysis system 12 and a time sequence enhancement module;
the data acquisition module 11 is configured to acquire a preset condition and wind power electric quantity data, where the preset condition includes an interval type of wind power total energy or a total time resolution;
the interval type of the total wind power energy can indicate the average electric quantity in 1 day or 5 days in a certain embodiment; the total wind power time resolution, in a certain embodiment, may be expressed as a resolution of an input condition, for example, if an output curve of 5 days is to be generated, a daily power interval is an average power per day, and a total power interval is an average power of 5 days; a more accurate prediction resolution reduces the uncertainty so that the input day/total charge interval depends on whether the predicted charge is a daily charge or a total charge.
The condition may be a variety of quantities, and may include wind speed, predicted electrical quantity, temperature, etc., and the predicted electrical quantity is used as an input condition herein as an algorithm input.
The data analysis system 12 is configured to input preset conditions and wind power data into the optimized middle-stage wind power scene generation model, and generate a wind power timing curve of the middle-stage wind power scene; the convolution layers in the generator and the discriminator in the medium-term wind power scene generation model are replaced by a time sequence enhancement module;
establishing an improved CGAN model by utilizing a Keras library based on a Tensorflow framework, and replacing an antagonistic neural network in a conditional antagonistic neural network algorithm by a WGAN-GP algorithm to obtain an improved CGAN conditional antagonistic neural network algorithm; and simultaneously inputting the conditions, the noises and the training samples into the model for training, and obtaining a medium-term wind power scene generation model after the model is converged at enough iteration times. And inputting the interval type/total time resolution of the wind power total energy, the noise and the wind power electric quantity data into the trained middle-term wind power scene generation model to generate a wind power time sequence curve of the middle-term wind power scene.
The timing sequence enhancement module 13 is used for reconstructing the timing sequence correlation of the feature map and outputting a convolution feature map with an N-order difference characteristic. In one embodiment, as shown in fig. 2, the following may be used:
first, the timing enhancement module 13 reshapes the feature map F into a sequence S according to the following formula:
Fw×h×c→Sm×c,
wherein, w, h, c and m are respectively the width, height and channel number of the characteristic diagram, and the channel number and length of the c and m remolded sequence are dimension parameters (shape) of Tensor; then, an N-order difference (N-DIFF) is performed on the reshaped S, the first 2D convolution layer, 128, (5, 5); a second 2D convolutional layer, 4, (5, 5), according to the following formula:
where S is a sample in S, and differencing to form a sequence of fluctuations S on a time scale NNAfter N differential operations are performed, the sequences are m-N to m in length, respectively, and zero padding is then used so that the short sequences are the same length as the original sequence.
The difference of order N is for each m01 to m0m-N and c01 to c0C, carrying out the difference in the formula to form a new sequence is the difference sequence.
Finally, the dimensionality of the N-DIFF sequences is reshaped into w multiplied by h multiplied by c, and cascading/summing is carried out on the channel dimensionality, the two tensors are spliced together in the channel (channel) direction, and the summing representation directly adds the two tensors. A new eigenmap tensor is formed as input for the subsequent convolutional layer. With the above operation, the timing enhancement module 13 can directly output a convolution feature map that can reflect the N-th order difference characteristic.
The method comprises the steps of replacing a convolution layer in a generator and a discriminator in a medium-term wind power scene generation model with a time sequence enhancement module 13, optimizing the medium-term wind power scene generation model, improving the time sequence feature extraction capability of the convolution layer according to the optimized medium-term wind power scene generation model, inputting preset conditions and wind power data into the model, accurately generating a wind power time sequence curve of the medium-term wind power scene, reconstructing time sequence correlation of a feature map through the time sequence enhancement module 13, outputting a convolution feature map with N-order difference characteristics, and achieving the effect of effectively solving fluctuation deviation of the wind power time sequence curve of the medium-term wind power scene.
Preferably, in any of the embodiments, as shown in fig. 9, the generating a model of a medium-term wind power scene specifically includes: a model generation module 21 and a model optimization module 22;
the model generation module 21 is used for establishing a medium-term wind power scene generation model according to the time sequence enhancement module 13 in combination with the improved conditional adversarial neural network algorithm; an improved conditional countermeasure neural network algorithm, comprising: replacing an antagonistic neural network in the conditional antagonistic neural network algorithm by a WGAN-GP algorithm to obtain an improved conditional antagonistic neural network algorithm;
the model optimization module 22 is configured to input preset conditions, noise and training samples into the medium-term wind power scene generation model for training, and iterate and converge the medium-term wind power scene generation model to obtain an optimized medium-term wind power scene generation model.
As shown in fig. 3, in a certain embodiment, a medium-term wind power scene generation model is established, a wind power day/total power interval is used as a condition, a conditional WGAN-GP algorithm is used as a main body, a generator in the model and a convolution layer in a discriminator are replaced by a time sequence enhancement module 13, and the rest of the model is consistent with the conditional WGAN-GP, so that the medium-term wind power scene generation model is obtained.
In one embodiment, training the optimization model may include: the condition input mode is interval category/total time resolution of total wind power energy, and the interval category/total time resolution is repeated and expanded to the length same as that of noise, so that the dimension of splicing two tensors in input is ensured to be the same. As shown in fig. 4, (a) is classified by single day, and (b) is classified by total time. And according to the single-day/total electric quantity quantile of the wind energy, the wind power electric quantity intervals are evenly distributed. For the sake of simplicity, the present example only divides the electric quantity into three parts, which may be 0-1970 mw; 1970-3405 MW; 3405-installed capacity, and the normalized maximum value is the installed capacity multiplied by the total time threshold. An improved CGAN model is established by utilizing a Keras library based on a Tensorflow framework, conditions, noises and training samples are simultaneously input into the model for training, and after the model is converged with enough iteration times, a mid-term wind power scene generation model after training optimization can be obtained. The number of iterations is not particularly limited, and the iterations are performed for a period of time as much as possible.
The improved conditional countermeasure neural network algorithm is obtained by replacing the countermeasure neural network in the conditional countermeasure neural network algorithm with the WGAN-GP algorithm, the improved conditional countermeasure neural network algorithm is combined with the time sequence enhancement module 13 to establish a mid-term wind power scene generation model, the conditions of the rest part are consistent with the WGAN-GP, the preset conditions, the noise and the training samples are input into the mid-term wind power scene generation model to be trained, the optimized mid-term wind power scene generation model is obtained, and the required wind power scene can be generated. The effects of establishing and optimizing the medium-term wind power scene generation model are achieved.
Preferably, in any of the above embodiments, the timing enhancement module 13 is specifically configured to,
inputting the feature map F output by the previous layer into the time sequence enhancing module 13, and reshaping the feature map F into a sequence S by the time sequence enhancing module 13;
carrying out N-order difference on the remolded sequence S;
carrying out subtraction and filling on the samples in the sequence S subjected to the N-order difference to ensure that the length of the sequence S is the same as that of the original sequence;
and performing dimensionality remodeling on the sequence S subjected to difference and filling, and performing cascade/summation on channel dimensionality to form a new characteristic diagram tensor as the input of the next convolution layer.
The time sequence correlation of the characteristic graph is reconstructed by the time sequence enhancing module 13, a convolution characteristic graph with an N-order difference characteristic is output, and the network structure of the CNN in the prior art cannot accurately express the distribution condition of the sequence difference, so that a time sequence difference component is introduced into the input part of each time sequence enhancing module 13 and is input into the following CNN together, and the CNN is forced to learn by using the difference data, so that the problem that the traditional CNN network structure is poor in the distribution learning capability of the sequence difference is solved.
Preferably, in any of the above embodiments, the model optimization module 22 is specifically configured to set a preset condition, extend the preset condition to a length equal to that of the noise, and input the preset condition, the noise, and the training sample into the medium-term wind power scene generation model for training.
The method comprises the steps of establishing an improved CGAN model through a Keras library based on a Tensorflow framework, setting a preset condition as the resolution ratio of interval categories or total time of wind power total energy, repeating and expanding the preset condition to the length the same as that of noise, ensuring that the dimensionality of splicing two tensors in input is the same, inputting the set condition, the noise and a training sample into a middle-term wind power scene generation model for training, obtaining an optimized model after training, and outputting a wind power scene capable of solving the problems of fluctuation and offset after training and optimizing from the model incapable of generating the wind power scene before training.
Preferably, in any of the above embodiments, the conditions further comprise: wind speed or temperature.
The method and the device have the advantages that the preset electric quantity is used as an input condition, the condition can be various quantities, the wind speed or the temperature can be included, and various scenes can be generated.
The reader should understand that in the description of this specification, reference to the description of the terms "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described method embodiments are merely illustrative, and for example, the division of steps into only one logical functional division may be implemented in practice in another way, for example, multiple steps may be combined or integrated into another step, or some features may be omitted, or not implemented.
The above method, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
While the invention has been described with reference to specific embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.