New energy station output prediction method and device
By dividing and clustering numerical meteorological forecast data, combined with the output prediction model, the randomness and volatility of new energy power generation is solved, the prediction accuracy and stability are improved, and the power grid operation cost is reduced.
Patent Information
- Application Number
- CN202411659434.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-11-20
AI Technical Summary
The existing technology is difficult to effectively deal with the randomness and volatility of new energy power generation, which leads to the inability of overall regional power generation plans to be specifically carried out for different meteorological zones. In order to ensure the safety of the power grid, sufficient thermal power units need to be reserved, which increases the system operating costs and squeezes out the consumption space of wind power.
The numerical meteorological forecast data sequence is divided into fragments by using the sequence fragmentation method, and the fragment cluster corresponding to the multiple cluster centers is obtained through the clustering method to capture the output characteristics of the target field station under different meteorological conditions. Then, based on the output prediction model corresponding to the fragment cluster, the rapid change relationship between the output prediction data and the numerical meteorological forecast data is accurately captured.
It improves the recognition and scene division of extreme meteorology, enhances the prediction accuracy and stability of the output prediction model under extreme meteorology conditions, and reduces the operating costs of the power grid.
Smart Images

Figure CN119154294B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of new energy technologies, and more specifically, to a method and device for predicting output of a new energy station. Background Art
[0002] As the most mature and large-scale power generation methods among new energy sources, wind power and photovoltaics have developed rapidly around the world in recent years. However, as the penetration rate of wind power and photovoltaics in the power system continues to increase, their inherent disadvantages are gradually emerging. For example, the power generation efficiency of wind power and photovoltaics is easily affected by natural meteorological factors.
[0003] However, there is still a lack of effective countermeasures to deal with the randomness and volatility of renewable energy generation, which makes it impossible to carry out the overall regional power generation plan specifically for different meteorological zones; In addition, in order to ensure safety, the power system usually needs to retain sufficient thermal power units as backup power. However, this practice not only increases the system operation cost, but also squeezes the space for wind power consumption. Summary of the invention
[0004] In view of this, the present invention provides a method and device for predicting output of a new energy station.
[0005] One aspect of the present invention provides a method for predicting the output of a new energy station, comprising: obtaining a numerical meteorological forecast data sequence of a target station in a time period to be predicted and a timestamp sequence corresponding to the numerical meteorological forecast data sequence; segmenting the numerical meteorological forecast data sequence to obtain a plurality of data sequence segments; clustering the plurality of data sequence segments to obtain segment clusters corresponding to a plurality of cluster centers; for each segment cluster, based on at least one data sequence segment included above, determining from the timestamp sequence a timestamp sequence segment corresponding to each of the at least one data sequence segments; respectively inputting at least one data sequence segment included in the segment cluster and a timestamp sequence segment corresponding to each of the at least one data sequence segment into an output prediction model corresponding to the segment cluster to obtain at least one output prediction data segment corresponding to the segment cluster; based on at least one output prediction data segment corresponding to each of the plurality of segment clusters, obtaining an output prediction data sequence of the target station in the time period to be predicted.
[0006] According to an embodiment of the present invention, the at least one data sequence segment included in the above-mentioned segment cluster and the at least one timestamp sequence segment corresponding to the above-mentioned segment cluster are respectively input into the output prediction model corresponding to the above-mentioned segment cluster to obtain at least one output prediction data segment corresponding to the above-mentioned segment cluster, including: for each data sequence segment, the above-mentioned data sequence segment and the timestamp sequence segment corresponding to the above-mentioned data sequence segment are respectively embedded to obtain a first latent space vector and a second latent space vector; based on the above-mentioned first latent space vector and the above-mentioned second latent space vector, a third latent space vector is obtained; the above-mentioned third latent space vector is input into the encoder module to obtain a fourth latent space vector; the above-mentioned fourth latent space vector is linearly transformed to obtain the output prediction data segment corresponding to the above-mentioned data sequence segment; based on the output prediction data segment corresponding to each of the above-mentioned at least one data sequence segment, at least one output prediction data segment corresponding to the above-mentioned segment cluster is obtained.
[0007] According to an embodiment of the present invention, the encoder module includes N encoders; wherein, the third latent space vector is input into the encoder module to obtain a fourth latent space vector, including: for the i-th encoder, the output features of the i-1-th encoder are processed using a temporal window attention mechanism to obtain a first output feature; the first output feature and the input feature of the i-th encoder are residually connected and normalized to obtain a second output feature; the second output feature is input into a feedforward neural network to obtain a third output feature; the second output feature and the third output feature are residually connected and normalized to obtain the output feature of the i-th encoder.
[0008] According to an embodiment of the present invention, the above-mentioned use of the temporal window attention mechanism to process the input features of the above-mentioned i-th encoder to obtain the first output features includes: performing a linear transformation on the input features of the above-mentioned i-th encoder to obtain a query matrix, a key matrix and a value matrix; calculating the attention score between the above-mentioned query matrix and the above-mentioned key matrix to obtain the attention matrix; based on the above-mentioned attention matrix and the above-mentioned value matrix, obtaining the above-mentioned first output features.
[0009] According to an embodiment of the present invention, the above-mentioned numerical weather forecast data sequence is segmented to obtain multiple data sequence segments, including: determining multiple extreme points from multiple weather forecast data included in the above-mentioned numerical weather forecast data sequence; based on the above-mentioned multiple extreme points, the above-mentioned numerical weather forecast data sequence is segmented to obtain the above-mentioned multiple data sequence segments.
[0010] According to an embodiment of the present invention, the above-mentioned method also includes: smoothing the above-mentioned numerical weather forecast data sequence to obtain a target data sequence; wherein the above-mentioned segmentation of the above-mentioned numerical weather forecast data sequence to obtain multiple data sequence segments includes: segmentation of the above-mentioned target data sequence to obtain the above-mentioned multiple data sequence segments.
[0011] According to an embodiment of the present invention, the above-mentioned smoothing processing is performed on the above-mentioned numerical weather forecast data sequence to obtain a target data sequence, including: for the j-th weather forecast data among the multiple weather forecast data included in the above-mentioned numerical weather forecast data sequence, based on a preset window length, determining multiple target weather forecast data associated with the above-mentioned j-th weather forecast data; adjusting the j-1th smoothing weight based on the above-mentioned multiple target weather forecast data to obtain the j-th smoothing weight; obtaining the j-th smoothing data corresponding to the above-mentioned j-th weather forecast data based on the above-mentioned j-th smoothing weight and the j-1th smoothing data corresponding to the j-1th weather forecast data; and obtaining the above-mentioned target data sequence based on the smoothing data corresponding to each of the above-mentioned multiple weather forecast data.
[0012] According to an embodiment of the present invention, the j-1th smoothing weight is adjusted based on the above-mentioned multiple target meteorological forecast data to obtain the jth smoothing weight, including: calculating the standard deviation and the mean based on the above-mentioned multiple target meteorological forecast data; obtaining the dynamic error based on the above-mentioned standard deviation and the above-mentioned mean; and using the above-mentioned dynamic error to adjust the j-1th smoothing weight to obtain the jth smoothing weight.
[0013] According to an embodiment of the present invention, the above-mentioned clustering processing is performed on the above-mentioned multiple data sequence fragments to obtain fragment clusters corresponding to each of the multiple cluster centers, including: for each data sequence fragment, based on preset indicator items, constructing a data matrix corresponding to the above-mentioned data sequence fragment; based on the distances between the above-mentioned data matrix and each of the above-mentioned multiple cluster centers, determining the cluster center associated with the above-mentioned data matrix from the above-mentioned multiple cluster centers; for each cluster center, based on at least one data matrix associated with the above-mentioned cluster center, determining at least one data sequence fragment corresponding to the above-mentioned cluster center, and obtaining the fragment cluster corresponding to the above-mentioned cluster center.
[0014] Another aspect of the present invention provides a new energy station output prediction device, including: an acquisition module, used to acquire a numerical meteorological forecast data sequence of a target station in a time period to be predicted and a timestamp sequence corresponding to the above numerical meteorological forecast data sequence; a division module, used to segment the above numerical meteorological forecast data sequence to obtain multiple data sequence segments; a clustering module, used to cluster the above multiple data sequence segments to obtain segment clusters corresponding to multiple cluster centers; a first determination module, used to determine, for each segment cluster, from the above timestamp sequence, a timestamp sequence segment corresponding to each of the above at least one data sequence segment based on the above at least one data sequence segment included; a second determination module, used to input the at least one data sequence segment included in the above segment cluster and the timestamp sequence segment corresponding to each of the above at least one data sequence segment into an output prediction model corresponding to the above segment cluster, to obtain at least one output prediction data segment corresponding to the above segment cluster; a third determination module, used to obtain the output prediction data sequence of the above target station in the above time period to be predicted based on at least one output prediction data segment corresponding to each of the multiple segment clusters.
[0015] Another aspect of the present invention provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method.
[0016] Another aspect of the present invention provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.
[0017] Another aspect of the present invention provides a computer program product, the computer program product comprising computer executable instructions, and the instructions are used to implement the above method when executed.
[0018] According to an embodiment of the present invention, a sequence segmentation method is adopted to segment the numerical meteorological forecast data sequence, and a segment cluster corresponding to each of the multiple cluster centers is obtained through a clustering method to capture the output characteristics of the target station under different meteorological conditions, thereby quickly and effectively identifying numerical meteorological forecast data sequence segments with different degrees of fluctuation, which helps to improve the recognition of extreme weather and scene division; in addition, an output prediction model corresponding to the segment cluster is used to accurately capture the rapid changing relationship between the output prediction data and the numerical meteorological forecast data, thereby improving the accuracy and stability of the output prediction model under extreme meteorological conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0020] Figure 1 A flow chart of a method for predicting output of a new energy station according to an embodiment of the present invention is shown.
[0021] Figure 2 A schematic diagram of the structure of an output prediction model according to an embodiment of the present invention is shown.
[0022] Figure 3 A schematic diagram of an attention matrix according to a specific embodiment of the present invention is shown.
[0023] Figure 4 A schematic diagram of a volatility index extraction method according to a specific embodiment of the present invention is shown.
[0024] Figure 5 A flow chart of a training method and a prediction method according to a specific embodiment of the present invention is shown.
[0025] Figure 6 A block diagram of a new energy station output prediction device according to an embodiment of the present invention is shown.
[0026] Figure 7 A block diagram of an electronic device suitable for implementing a new energy station output prediction method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0027] Below, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present invention. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of embodiments of the present invention. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of concepts of the present invention.
[0028] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0029] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0030] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0031] Wind power and photovoltaic power, as the most mature and large-scale power generation methods among new energy sources, have developed rapidly around the world in recent years. New energy power generation methods not only help reduce dependence on fossil fuels and reduce greenhouse gas emissions, but also promote the optimization and upgrading of energy structure.
[0032] However, as the penetration rate of wind power and photovoltaic power in the power system continues to increase, their inherent shortcomings are gradually emerging, bringing new challenges to the safe and stable operation of the power grid. First, the power generation efficiency of wind power and photovoltaic power is easily affected by natural meteorological factors. For example, natural environmental factors such as fluctuations in wind speed and direction, changes in light intensity and sunshine time will directly affect the power generation of wind power and photovoltaic power. This randomness and volatility make it very difficult to predict renewable energy power generation, which brings great uncertainty to the scheduling and operation of the power system. Secondly, extreme meteorological conditions will not only lead to a decrease in the accuracy of renewable energy power generation prediction, but may also pose a threat to the safe and stable operation of the power grid.
[0033] In order to meet these challenges, the power system needs to take a series of measures to improve the prediction accuracy and stability of renewable energy power generation. However, there is still a lack of effective countermeasures to deal with the randomness and volatility of renewable energy power generation, which makes it impossible to carry out the overall regional power generation plan specifically for different meteorological zones, and only a more conservative strategy can be adopted to ensure the safe and stable operation of the power grid. In addition, in order to ensure safety, the power system usually needs to retain sufficient thermal power units as backup power. However, this practice not only increases the system operation cost, but also squeezes the space for wind power consumption.
[0034] In view of this, an embodiment of the present invention adopts a sequence segmentation method to segment the numerical meteorological forecast data sequence, and obtains segment clusters corresponding to multiple cluster centers through a clustering method to capture the output characteristics of the target station under different meteorological conditions, thereby quickly and effectively identifying numerical meteorological forecast data sequence segments with different degrees of fluctuation, which helps to improve the recognition and scene division of extreme weather; in addition, based on the output prediction model corresponding to the segment cluster, the rapid changing relationship between the output prediction data and the numerical meteorological forecast data is accurately captured, thereby improving the accuracy and stability of the output prediction model under extreme meteorological conditions.
[0035] Specifically, an embodiment of the present invention provides a method for predicting the output of a new energy station, comprising: obtaining a numerical meteorological forecast data sequence of a target station in a time period to be predicted and a timestamp sequence corresponding to the numerical meteorological forecast data sequence; segmenting the numerical meteorological forecast data sequence to obtain a plurality of data sequence segments; clustering the plurality of data sequence segments to obtain segment clusters corresponding to a plurality of cluster centers; for each segment cluster, based on at least one data sequence segment included, determining from a timestamp sequence a timestamp sequence segment corresponding to each of the at least one data sequence segments; respectively inputting at least one data sequence segment included in the segment cluster and a timestamp sequence segment corresponding to each of the at least one data sequence segments into an output prediction model corresponding to the segment cluster, to obtain at least one output prediction data segment corresponding to the segment cluster; based on at least one output prediction data segment corresponding to each of the plurality of segment clusters, obtaining an output prediction data sequence of the target station in the time period to be predicted.
[0036] Figure 1 A flow chart of a method for predicting output of a new energy station according to an embodiment of the present invention is shown.
[0037] like Figure 1 As shown, the method includes operations S101 to S106.
[0038] In operation S101, a numerical weather forecast data sequence of a target station in a time period to be predicted and a timestamp sequence corresponding to the numerical weather forecast data sequence are obtained.
[0039] According to an embodiment of the present invention, the target station may be used to characterize the new energy station to be predicted, wherein the new energy station may include but is not limited to a wind farm, a photovoltaic power station, and the like.
[0040] According to an embodiment of the present invention, multiple numerical weather forecast (Numerical Weather Prediction, NWP) data of the target station within the time period to be predicted can be obtained from the data center of the weather forecast system to form a numerical weather forecast data sequence, wherein the numerical weather forecast data may, for example, include wind speed, wind direction, temperature, irradiance, etc., and the numerical weather forecast data sequence may, for example, include a wind speed data sequence, a temperature data sequence, etc.
[0041] According to an embodiment of the present invention, a timestamp sequence corresponding to the numerical weather forecast data sequence of the target station in the forecast time period can also be obtained from the data center of the weather forecast system. The timestamp can be used to identify the time of each numerical weather forecast data. The format of the timestamp is not limited here. Taking the second-level timestamp as an example, if the acquisition time of the numerical weather forecast data A is 01:01:01 on January 1, 2000, the corresponding timestamp can be expressed as 20000101010101.
[0042] In operation S102, the numerical weather forecast data sequence is segmented to obtain a plurality of data sequence segments.
[0043] According to an embodiment of the present invention, the acquired numerical weather forecast data sequence is divided into a plurality of data sequence segments having similar characteristics or trends. The division method may include division based on special data value points, division based on data value change rate, and the like.
[0044] In operation S103, clustering is performed on the plurality of data sequence segments to obtain segment clusters corresponding to the plurality of cluster centers.
[0045] According to an embodiment of the present invention, multiple data sequence fragments are clustered based on multiple feature indicators to determine the cluster center to which each data sequence fragment belongs, and finally a fragment cluster corresponding to each cluster center is formed, which helps to subsequently select or train the most appropriate prediction model for each fragment cluster, thereby improving the accuracy and efficiency of the prediction.
[0046] According to an embodiment of the present invention, the cluster center is determined based on a historical numerical weather forecast data sequence of the target station in a historical period of time.
[0047] In operation S104, for each segment cluster, based on the at least one data sequence segment included therein, a time stamp sequence segment corresponding to each of the at least one data sequence segments is determined from the time stamp sequence.
[0048] According to an embodiment of the present invention, for each data sequence segment in a segment cluster, a start timestamp and an end timestamp can be determined from a timestamp sequence, a boundary of a timestamp sequence segment can be determined based on data corresponding to the start timestamp and the end timestamp of the data sequence segment in the timestamp sequence, and a timestamp sequence segment corresponding to each data sequence segment can be determined based on the boundaries of the timestamp sequence segment. These timestamp sequence segments can include all timestamps within the same time range as the data sequence segment.
[0049] In operation S105, at least one data sequence segment included in the segment cluster and a timestamp sequence segment corresponding to the at least one data sequence segment are respectively input into an output prediction model corresponding to the segment cluster to obtain at least one output prediction data segment corresponding to the segment cluster.
[0050] According to an embodiment of the present invention, the output prediction model corresponding to the segment cluster is trained using historical data related to the segment cluster.
[0051] According to an embodiment of the present invention, at least one data sequence segment included in a segment cluster and a timestamp sequence segment corresponding to at least one data sequence segment are respectively input into an output prediction model corresponding to the segment cluster, and the obtained at least one output prediction data segment corresponding to the segment cluster is consistent with the at least one input data sequence segment in terms of timestamp.
[0052] In operation S106, based on at least one output prediction data segment corresponding to each of the plurality of segment clusters, an output prediction data sequence of the target site in the time period to be predicted is obtained.
[0053] According to an embodiment of the present invention, at least one output prediction data segment corresponding to each of the plurality of segment clusters is spliced to obtain an output prediction data sequence within the time period to be predicted, wherein each moment included in the time period to be predicted corresponds to an output prediction data.
[0054] Based on this, an embodiment of the present invention adopts a sequence segmentation method to segment the numerical meteorological forecast data sequence, and obtains segment clusters corresponding to multiple cluster centers through a clustering method to capture the output characteristics of the target station under different meteorological conditions, thereby quickly and effectively identifying numerical meteorological forecast data sequence segments with different degrees of fluctuation, which helps to improve the recognition and scene division of extreme weather; in addition, based on the output prediction model corresponding to the segment cluster, the rapid changing relationship between the output prediction data and the numerical meteorological forecast data is accurately captured, thereby improving the accuracy and stability of the output prediction model under extreme meteorological conditions.
[0055] According to an embodiment of the present invention, at least one data sequence segment included in a segment cluster and at least one timestamp sequence segment corresponding to the segment cluster are respectively input into an output prediction model corresponding to the segment cluster to obtain at least one output prediction data segment corresponding to the segment cluster, including: for each data sequence segment, embedding processing is performed on the data sequence segment and the timestamp sequence segment corresponding to the data sequence segment to obtain a first latent space vector and a second latent space vector; based on the first latent space vector and the second latent space vector, a third latent space vector is obtained; the third latent space vector is input into an encoder module to obtain a fourth latent space vector; a linear transformation is performed on the fourth latent space vector to obtain an output prediction data segment corresponding to the data sequence segment; based on the output prediction data segments corresponding to each of the at least one data sequence segments, at least one output prediction data segment corresponding to the segment cluster is obtained.
[0056] According to an embodiment of the present invention, the output prediction model corresponding to the fragment cluster can be improved based on a neural network model with a self-attention mechanism, such as a Transformer model, to process at least one data sequence fragment included in the fragment cluster and at least one timestamp sequence fragment corresponding to the fragment cluster.
[0057] According to an embodiment of the present invention, the Transformer model is a deep neural network model for sequence to sequence (seq2seq) tasks, and the original Transformer model includes two parts: an encoder and a decoder.
[0058] Figure 2 A schematic diagram of the structure of an output prediction model according to an embodiment of the present invention is shown.
[0059] like Figure 2 As shown, the output prediction model includes an embedding layer, an encoder module and a fully connected layer. In the process of new energy station output prediction, it is only necessary to process the data sequence fragments of the input numerical meteorological forecast data sequence and output the corresponding output prediction data fragments. Therefore, in an embodiment of the present invention, the decoder part can be removed and only the encoder structure is retained. The fully connected layer is added after the encoder output and directly used as the output layer.
[0060] In an embodiment of the present invention, the embedding layer of the original Transformer model can also be replaced with a single-layer trainable convolutional neural network (CNN) to convert each data sequence fragment to be embedded into a first latent space vector, so that the information in the data sequence fragment can be mapped into a high-dimensional latent space to better capture the local characteristics of the numerical weather forecast data. For example, the single-layer trainable convolutional neural network input is a data sequence fragment of the numerical weather forecast data sequence, the convolution kernel size is a specifiable hyperparameter, and the output is the first latent space vector.
[0061] In an embodiment of the present invention, a timestamp embedding layer may be additionally added to the embedding layer of the original Transformer model to convert each timestamp sequence segment to be embedded into a second latent space vector.
[0062] According to an embodiment of the present invention, the first latent space vector is added to the second latent space vector to obtain a third latent space vector, and is input to the encoder structure. The expression of the third latent space vector is as follows:
[0063] (1);
[0064] In the formula, H represents the third latent space vector, h w (t) represents the first latent space vector, h TS (t) represents the second latent space vector.
[0065] According to an embodiment of the present invention, the third latent space vector is input into the encoder module, and the encoder module further extracts features of the third latent space vector and generates a higher-level representation to output a fourth latent space vector.
[0066] According to an embodiment of the present invention, a linear transformation is performed on the fourth latent space vector to obtain an output prediction data segment corresponding to the data sequence segment.
[0067] For each data sequence segment in the segment cluster, the above steps are performed to obtain the output prediction data segment corresponding to each data sequence segment. These output prediction data segments are combined to obtain at least one output prediction data segment corresponding to the segment cluster, which is used to evaluate the output of the station to be predicted in the entire segment cluster.
[0068] According to an embodiment of the present invention, the third latent space vector is input into the encoder module to obtain a fourth latent space vector, including: for the i-th encoder, using the temporal window attention mechanism to process the output feature of the i-1-th encoder to obtain a first output feature, wherein, when i=1, the output feature of the i-1-th encoder is represented as the third latent space vector; performing residual connection and normalization processing on the first output feature and the input feature of the i-th encoder to obtain a second output feature; inputting the second output feature into a feedforward neural network to obtain a third output feature; performing residual connection and normalization processing on the second output feature and the third output feature to obtain the output feature of the i-th encoder.
[0069] According to an embodiment of the present invention, a temporal window attention mechanism is used to process the input features of the i-th encoder to obtain a first output feature, including: performing a linear transformation on the input features of the i-th encoder to obtain a query matrix, a key matrix, and a value matrix; calculating the attention score between the query matrix and the key matrix to obtain an attention matrix; and obtaining the first output feature based on the attention matrix and the value matrix.
[0070] According to an embodiment of the present invention, Figure 2 The encoder module shown includes N encoders, each of which includes a temporal window attention layer, a first residual connection and normalization layer, a feedforward neural network, and a second residual connection and normalization layer. For the i-th encoder, its input features include two parts: when i=1, the input features of the i-th encoder are the third latent space vector output by the embedding layer. When i>1, the input features of the i-th encoder are the output features of the i-1-th encoder.
[0071] According to an embodiment of the present invention, the self-attention mechanism in the original Transformer model encoder can be improved by using the time series window attention mechanism to process the output features of the i-1th encoder, thereby obtaining the first output feature. The time series window attention mechanism can capture the time series dependencies in the time series data, especially only considering the positions before the current position and whose distance does not exceed the window length, to reduce the amount of calculation and improve the model's ability to capture time series information.
[0072] Specifically, you can use Figure 2 The temporal window attention layer shown linearly transforms the input features of the i-th encoder, such as the third latent space vector, to obtain the query matrix, key matrix and value matrix respectively, which are expressed as follows:
[0073] (2);
[0074] (3);
[0075] (4);
[0076] Where Q represents the query matrix, K represents the key matrix, V represents the value matrix, H represents the third latent space vector, and W Q , W K , W V Respectively represent the dimensions of T×d model The query matrix, key matrix, and value matrix of each data matrix, where T represents the sequence length of the input feature, d model Represents the hyperparameters of the Transformer model.
[0077] According to an embodiment of the present invention, the attention score between the query matrix and the key matrix is calculated to obtain the attention matrix. The specific calculation method is as follows:
[0078] (5);
[0079] In the formula, e i,j represents the attention score between the query matrix and the key matrix; q i and k j denotes the 𝑖th row of matrix Q and the 𝑗th row of matrix K respectively; w denotes the time window length; the attention score e between the query matrix and the key matrix i,j It is represented as the element at the i-th row and j-th column of the attention matrix E; where the dimension of the attention matrix E is T×T.
[0080] Figure 3 A schematic diagram of an attention matrix according to a specific embodiment of the present invention is shown.
[0081] like Figure 3 The dimension of the attention matrix shown is T×T, and the time window length is w, where the attention matrix includes the valid value distribution (see the light gray area) and invalid value distribution (see the dark gray area) of the attention scores.
[0082] According to an embodiment of the present invention, after obtaining the attention matrix based on the attention score between the query matrix and the key matrix, the attention matrix and the value matrix are concatenated to obtain the first output feature of the time series window attention layer output. The expression of the first output feature is as follows:
[0083] (6);
[0084] In the formula, H attn represents the first output feature.
[0085] According to an embodiment of the present invention, Figure 2 As shown, the first output feature is input into the first residual connection and normalization layer to perform a residual connection between the first output feature output by the time series window attention layer and the input feature of the i-th encoder, and the result after the residual connection is normalized to obtain the second output feature. For example, when i=1 and the input feature of the i-th encoder is the third latent space vector H, the expression of the second output feature is as follows:
[0086] (7);
[0087] Where H' attn Represents the second output feature, and Norm represents the residual connection and normalization processing function.
[0088] According to an embodiment of the present invention, the second output feature is input into a feedforward neural network to obtain a third output feature. The expression of the second output feature is as follows:
[0089] (8);
[0090] In the formula, H ffn represents the third output feature, ReLU represents the activation function, W ffn,1 , W ffn,2 、b ffn,1 and b ffn,2 Represents the model parameters of a feedforward neural network.
[0091] According to an embodiment of the present invention, the second output feature is input to the second residual connection and normalization layer, the second output feature and the third output feature are residually connected, and the result after the residual connection is normalized to obtain the output feature of the i-th encoder. Wherein, when i=N, the i-th encoder is the last encoder in the encoder module, and the output feature of the encoder is represented as the fourth latent space vector as the output of the encoder module. Specifically, the expression of the output feature of the i-th encoder is as follows:
[0092] (9);
[0093] In the formula, H i,o represents the output features of the i-th encoder.
[0094] According to an embodiment of the present invention, when the output feature of the i-th encoder is the fourth latent space vector, it is input into the fully connected layer to perform a linear transformation on the fourth latent space vector, thereby obtaining an output prediction data segment corresponding to the data sequence segment. Specifically, the expression of the output prediction data segment corresponding to the data sequence segment is as follows:
[0095] (10);
[0096] Where P o represents the output prediction data segment, b o Represents the model parameters of the fully connected layer.
[0097] Based on this, the embodiment of the present invention adopts the improved Transformer model obtained by the above-mentioned model improvement method, which can improve the output prediction model's ability to capture the time correlation of rapidly changing output data-numerical meteorological forecast data under extreme meteorological conditions. By setting the time window length, the model's step range for time correlation is effectively controlled to prevent it from being interfered by meteorological factors that are too far away, thereby achieving an improvement in the accuracy of output prediction data under extreme meteorological conditions where numerical meteorological forecast data fluctuates greatly and under general stable conditions.
[0098] According to an embodiment of the present invention, the method for predicting the output of a new energy station further includes: smoothing the numerical weather forecast data sequence to obtain a target data sequence.
[0099] According to an embodiment of the present invention, a numerical weather forecast data sequence is smoothed to obtain a target data sequence, including: for the j-th weather forecast data among the multiple weather forecast data included in the numerical weather forecast data sequence, based on a preset window length, determining multiple target weather forecast data associated with the j-th weather forecast data; adjusting the j-1th smoothing weight based on the multiple target weather forecast data to obtain the j-th smoothing weight; obtaining the j-th smoothing data corresponding to the j-th weather forecast data based on the j-th smoothing weight and the j-1th smoothing data corresponding to the j-1th weather forecast data; and obtaining the target data sequence based on the smoothing data corresponding to each of the multiple weather forecast data.
[0100] According to an embodiment of the present invention, for each weather forecast data in the numerical weather forecast data sequence, multiple target weather forecast data associated with the weather forecast data are determined based on a preset window length, wherein the target weather forecast data may include several data points before and after the jth weather forecast data.
[0101] For example, the preset window length can be determined based on the wind speed time correlation coefficient. In a specific embodiment of the present invention, the preset window length can be selected as M, and the target meteorological forecast data associated with the jth meteorological forecast data can include the jM / 2th meteorological forecast data to the j+M / 2th meteorological forecast data.
[0102] According to an embodiment of the present invention, based on multiple target meteorological forecast data, adjusting the j-1th smoothing weight to obtain the jth smoothing weight includes: calculating the standard deviation and the mean based on the multiple target meteorological forecast data; obtaining the dynamic error based on the standard deviation and the mean; and using the dynamic error to adjust the j-1th smoothing weight to obtain the jth smoothing weight.
[0103] For example, taking a weather forecast data sequence x(t) with a sequence length of T as an example, a specific embodiment of the present invention can use an exponential weighted average formula to smooth the sequence data. The expression of the smoothing process is as follows:
[0104] (11);
[0105] In the formula, represents the weighting coefficient, y i (t) represents the smoothed time series of weather forecast data, where t=1,2,…,T, T represents the sequence length, x i(t) represents the ith weather forecast data sequence. The larger the weighting coefficient, the more relevant the exponential weighted average is to the data sequence at the current moment, and vice versa. Therefore, in a specific embodiment of the present invention, the weighting coefficient can be dynamically adjusted by judging the stationarity of a fixed-length window including the current moment.
[0106] Specifically, for the i-th weather forecast data sequence x i (t), based on the preset window length M, determine the i-th weather forecast data sequence x i The boundary of (t) is based on the i-th weather forecast data sequence x i The boundary of (t) can intercept the i-th weather forecast data sequence x i (t) of the reference segment x b1 and x b2 , where the boundary expression is as follows:
[0107] (12);
[0108] (13);
[0109] Where b 1 represents the maximum boundary, b 2 Indicates the minimum boundary.
[0110] According to a specific embodiment of the present invention, for the first weather forecast data sequence, y 1 (t)=x 1 (t), and set the initial weighting coefficient β 1 =2 / (M+1), calculate the reference segment x of the weather forecast data sequence x(t) b1 and x b2 The standard deviation and mean of the weather forecast data series x(t) are calculated based on the reference segment x b1 and x b2 The standard deviation and mean of are used to calculate the allowable dynamic error. The dynamic error is calculated as follows:
[0111] (14);
[0112] In the formula, represents the dynamic error, represents the standard deviation, represents the mean, Represents a constant. The constant can be selected based on the specific distribution situation, and can be the mean value of the weather forecast data sequence x(t).
[0113] According to a specific embodiment of the present invention, the weighting coefficient is updated based on the dynamic error in the following manner:
[0114] (15);
[0115] In the formula, represents the updated weight coefficient, Represents the weighting coefficient before updating.
[0116] According to a specific embodiment of the present invention, based on the updated weighting coefficients and formula (11), multiple exponentially weighted averages are calculated to serve as a smoothed weather forecast data sequence.
[0117] According to another specific embodiment of the present invention, the preset window length M can be determined by the time correlation coefficient of the weather forecast data sequence. The time correlation calculation expression of the weather forecast data sequence is as follows:
[0118] (16);
[0119] In the formula, represents the k-step autocorrelation coefficient of the original data time series, x t Represents the original data time series, x t-k represents the original data time series with a lag of k steps, represents the covariance between two original data time series, Indicates the standard deviation of the original data time series. In the case of k=1,2,3,…, based on the k-step autocorrelation coefficients of multiple original data time series, find the first k value that meets the conditions. The conditional expressions that need to be met are as follows:
[0120] (17);
[0121] In the formula, k represents the original data time series m step autocorrelation coefficient. In this case, the preset window length is M=max(2,min(k m +1)).
[0122] According to an embodiment of the present invention, a numerical weather forecast data sequence is segmented to obtain a plurality of data sequence segments, including: determining a plurality of extreme points from a plurality of weather forecast data included in the numerical weather forecast data sequence; and segmenting the numerical weather forecast data sequence based on the plurality of extreme points to obtain a plurality of data sequence segments.
[0123] According to an embodiment of the present invention, segmenting a numerical weather forecast data sequence to obtain a plurality of data sequence segments includes: segmenting a target data sequence to obtain a plurality of data sequence segments.
[0124] According to a specific embodiment of the present invention, the smoothed weather forecast data time series sequence y is identified and marked. i For the extreme point in (t), for the convenience of calculation, the starting point can be defined as the first extreme point. For each point in the smoothed weather forecast data time series except the starting point, the following formula is used to determine whether it is an extreme point:
[0125] (18);
[0126] In the formula, e i Represents the i-th point y in the smoothed weather forecast data time series i Whether it is an extreme point, when e i =1, mark y i is an extreme point, otherwise y i Not an extreme point.
[0127] For the convenience of calculation, the last end point is defined as the last extreme point, and the total number of extreme points planned to be divided is Ne.
[0128] According to a specific embodiment of the present invention, the sequence is segmented according to multiple extreme value points, starting from i=1, for the sth extreme value point , if two extreme points meet the threshold requirement, the sequence between them is considered as a segment. The expression of the threshold requirement is as follows:
[0129] (19);
[0130] In the formula, and can be expressed as a pre-set hyperparameter, and The value of can be obtained by fitting the historical numerical weather forecast data series.
[0131] According to a specific embodiment of the present invention, i=1 is initialized. For each s>i, check whether the conditions of the segment definition are met. If the conditions are met, i=s, s=i+1, and the next segment is judged. If the two extreme points do not meet the above conditions, s is incremented by 1, and the next segment is judged. When s=Ne, and The sequence between them is considered as a segment and the segment division is ended.
[0132] According to an embodiment of the present invention, a plurality of data sequence fragments are clustered to obtain fragment clusters corresponding to a plurality of cluster centers, including: for each data sequence fragment, based on preset indicator items, constructing a data matrix corresponding to the data sequence fragment; based on the distances between the data matrix and each of the plurality of cluster centers, determining a cluster center associated with the data matrix from the plurality of cluster centers; for each cluster center, based on at least one data matrix associated with the cluster center, determining at least one data sequence fragment corresponding to the cluster center, to obtain a fragment cluster corresponding to the cluster center.
[0133] According to a specific embodiment of the present invention, the preset index item may include a first index, a second index, and a third index. The first index may be used to characterize the average slope within each sequence segment, the second index may be used to characterize the difference between the maximum value and the minimum value within each sequence segment, and the third index may be used to characterize the standard deviation of the sequence segment. Specifically, the expression of the preset index item is as follows:
[0134] (20);
[0135] (twenty one);
[0136] (twenty two);
[0137] In the formula, feat 1,i Indicates the first indicator, feat 2,i Indicates the second indicator, feat 3,i Represents the third index, y i,begin The value indicating the starting point of the sequence segment, y i,end The value indicating the end point of the sequence segment, y i,max Indicates the maximum value within the sequence segment, y i,min Represents the minimum value within the sequence fragment, Represents the standard deviation of the sequence fragment.
[0138] Figure 4 A schematic diagram of a volatility index extraction method according to a specific embodiment of the present invention is shown.
[0139] like Figure 4 As shown in the figure, taking the smoothed wind speed sequence as an example, the multi-point line represents the wind speed trend, and the broken line represents the trend of the fitted wind speed sequence. Point A and point B can represent two extreme points respectively. e,i -1 and V e,i They can represent the values of two extreme points, T i Indicates the length of the sequence segment, using V e,i-1 and V e,iThe smoothed wind speed sequence can be segmented to obtain multiple data sequences. In addition, based on the wind speed sequence trend line chart, the expressions of the first index and the second index can be extracted respectively:
[0140] (twenty three);
[0141] (twenty four).
[0142] According to a specific embodiment of the present invention, the maximum value of the average slope within the segment can be used to scale the second index and the third index to keep the scales of the two consistent during clustering. Specifically, the expressions of the scaled second index and the scaled third index are as follows:
[0143] (25);
[0144] (26);
[0145] In the formula, feat' 2,i Represents the second index after scaling, feat' 3,i Represents the third index after scaling, feat 1,i,max Indicates the maximum value of the first indicator, feat 2,i,max Indicates the maximum value of the second index, feat 3,i,max Indicates the maximum value of the third index.
[0146] According to an embodiment of the present invention, a data matrix corresponding to the data sequence segment is constructed based on the preset index item. The data matrix can be a multidimensional array, in which each row represents a data sequence segment and each column represents the value of an index item. For example, the first index, the scaled second index, and the scaled third index are organized into a data matrix with a dimension of Ns×3.
[0147] According to an embodiment of the present invention, based on the distance between the constructed data matrix and the preset multiple cluster centers, a cluster center associated with the current data matrix is determined from the multiple cluster centers. The distance between the data matrix and the preset multiple cluster centers can be determined using a measurement method such as Euclidean distance, Manhattan distance, cosine similarity, etc.
[0148] According to an embodiment of the present invention, for each cluster center, at least one data sequence fragment corresponding to the cluster center is determined based on at least one data matrix associated with the cluster center (i.e., the data matrix closest to the cluster center). The at least one data sequence fragment corresponding to the cluster center can be classified into a fragment cluster, indicating that they have similar characteristics or patterns to some extent. Through clustering processing, fragment clusters corresponding to multiple cluster centers are finally obtained. Each fragment cluster has a corresponding cluster center, and the cluster center can be regarded as the average characteristics or representatives of the data sequence fragments in the fragment cluster. Specifically, K-Means clustering can be performed on the behavioral clustering elements of the data matrix to obtain the clustering results, and the number of clusters can be selected according to the specific distribution of sequence fragments.
[0149] Based on this, the embodiment of the present invention constructs a multidimensional data matrix based on the average value, standard deviation, maximum value, minimum value, volatility and other index items of the data sequence to reduce the high-dimensional data sequence features to a low-dimensional index space, which is convenient for subsequent processing and analysis. In addition, by clustering multiple data sequence fragments, the obtained fragment clusters are used as subsequent model training and prediction data, so that the model can more accurately capture the changing trends and laws in the data sequence, thereby improving the accuracy of prediction and classification.
[0150] According to a specific embodiment of the present invention, based on the segment clusters corresponding to the multiple cluster centers and the improved Transformer model, the model is trained and verified, and can be used for actual wind power prediction.
[0151] Figure 5 A flow chart of a training method and a prediction method according to a specific embodiment of the present invention is shown.
[0152] like Figure 5 As shown, the training method includes operations S511 to S516, and the prediction method includes operations S521 to S526.
[0153] In operation S511, the historical data is normalized and preprocessed to obtain a numerical weather forecast data sequence.
[0154] In operation S512, the numerical weather forecast data sequence is smoothed to obtain a target data sequence.
[0155] In operation S513, extreme points are extracted from the target data sequence to segment the target data sequence into segments to obtain a plurality of data sequence segments.
[0156] In operation S514, fluctuation index items are extracted from the plurality of data sequence segments, and clustering is performed to obtain segment clusters corresponding to the plurality of cluster centers.
[0157] In operation S515, an improved Transformer model is built.
[0158] In operation S516, the model is trained based on the segment clusters corresponding to each of the plurality of cluster centers to obtain an optimal model.
[0159] In operation S521, the data to be predicted is normalized and preprocessed to obtain a numerical meteorological forecast data sequence to be predicted.
[0160] In operation S522, the numerical weather forecast data sequence to be predicted is smoothed to obtain a target data sequence to be predicted.
[0161] In operation S523, data classification is performed on the target data sequence to be predicted.
[0162] In operation S524, the input target data sequence to be predicted is predicted based on the optimal model to obtain a predicted sequence.
[0163] In operation S525, the predicted sequence is denormalized and concatenated.
[0164] In operation S526, the predicted power value to be predicted is output.
[0165] According to a specific embodiment of the present invention, the historical NWP data, historical measured meteorological data, historical new energy output data and corresponding timestamp data of the target new energy station are obtained before operation S511, and the time resolution of these historical data is 15 minutes. In addition, it is necessary to ensure that the collected meteorological data at least includes the wind speed 70m above the ground (including prediction and measurement), and the historical new energy output data at least includes the historical output active power of the power station.
[0166] According to a specific embodiment of the present invention, before operation S511, the acquired data is also included in data cleaning, and data cleaning may include identification and processing of missing data and abnormal data. For example, linear interpolation is used to supplement the data with a time interval of less than 2 hours (8 points at a resolution of 15 minutes) to exclude possible abnormal data or abnormal time points.
[0167] According to a specific embodiment of the present invention, the acquired raw data includes external meteorological factors and historical power generation of new energy sources, and the physical meanings, dimensions and orders of magnitude of different variables are different. In order to avoid these differences from having a negative impact on the training and reasoning prediction of the model, the meteorological data and power data other than the timestamp data can also be standardized to convert the data into a standard distribution form:
[0168] (27);
[0169] In the formula, represents the data after normalization. represents the variance of the data series, Represents the standard deviation of the data sequence, and its corresponding denormalization formula is as follows:
[0170] (28);
[0171] The above formula is used to normalize the meteorological factor sequences and wind power sequences, and the mean and variance of each factor are recorded and stored for subsequent denormalization.
[0172] According to a specific embodiment of the present invention, before operation S516, it also includes taking the fragment clusters corresponding to each of the multiple clustering centers as input, taking the historical power record value as a reference value, and using MSE as the training objective function for calculation. In terms of the selection of hyperparameters, the main hyperparameters include: model dimensions include [32, 64, 96, 128, 256, 384, 512], encoder layers include [2, 3, 4, 5, 6], temporal attention window lengths include [4, 5, 6, 7, 8, 9, 10, 11, 12], and embedding layer convolution lengths include [3, 4, 5, 6]. In addition, the present invention can also optimize hyperparameters through grid search.
[0173] According to a specific embodiment of the present invention, in operation S516, it also includes inputting the normalized meteorological data and timestamp data into the model as input data, calculating the training loss function with the model output value and the normalized wind power data and performing reverse gradient propagation training; the trained model needs to add an additional normalization module for the input meteorological data and a denormalization module for the output power prediction data after the output.
[0174] According to a specific embodiment of the present invention, in the prediction stage, the numerical meteorological forecast data for the time period to be predicted, such as the next 24h-72h, are respectively subjected to data preprocessing, wind speed segment division and clustering to construct a prediction input data set; and the corresponding meteorological data are input into a prediction model that has been trained and equipped with a meteorological data normalization module and a prediction power denormalization module. Each prediction model outputs the expected value of the predicted power in the corresponding time period, and the output predicted power is spliced to obtain the predicted value of wind power in the future time period.
[0175] According to a specific embodiment of the present invention, in the test phase, the prediction error index may include an average error index and a root mean square error index, which are defined as:
[0176] (29);
[0177] (30);
[0178] In the formula, represents the average error index, represents the root mean square error indicator, represents the normalized power prediction value, It represents the normalized measured power value, and Z represents the total number of power data points of the wind farm in the time period to be predicted.
[0179] According to a specific embodiment of the present invention, the measured data of a wind farm and the weather forecast data are analyzed as an example. The number of scene clustering clusters is set to 4, and its fluctuation characteristics gradually increase. Scenes 3 and 4 are regarded as extreme weather scenes. The calculation example test results are shown in the following table:
[0180] Table 1
[0181]
[0182] As shown in Table 1, the prediction accuracy of the new energy station output prediction method proposed in the present invention is significantly improved compared with the general prediction method in scenarios 3 and 4 with severe meteorological fluctuations.
[0183] Figure 6 A block diagram of a new energy station output prediction device according to an embodiment of the present invention is shown.
[0184] like Figure 6 As shown, the new energy station output prediction device includes an acquisition module 610 , a division module 620 , a clustering module 630 , a first determination module 640 , a second determination module 650 , and a third determination module 660 .
[0185] The acquisition module 610 is used to acquire the numerical weather forecast data sequence of the target station in the time period to be predicted and the time stamp sequence corresponding to the numerical weather forecast data sequence.
[0186] The division module 620 is used to divide the numerical weather forecast data sequence into segments to obtain multiple data sequence segments.
[0187] The clustering module 630 is used to perform clustering processing on multiple data sequence segments to obtain segment clusters corresponding to multiple cluster centers respectively.
[0188] The first determination module 640 is configured to determine, for each segment cluster, based on at least one data sequence segment included in the segment cluster, from the timestamp sequence a timestamp sequence segment corresponding to each of the at least one data sequence segments.
[0189] The second determination module 650 is used to input at least one data sequence segment included in the segment cluster and the timestamp sequence segment corresponding to the at least one data sequence segment into the output prediction model corresponding to the segment cluster, so as to obtain at least one output prediction data segment corresponding to the segment cluster.
[0190] The third determination module 660 is configured to obtain an output prediction data sequence of the target site in the time period to be predicted based on at least one output prediction data segment corresponding to each of the plurality of segment clusters.
[0191] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by a proper combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be executed.
[0192] For example, any multiple of the acquisition module 610, the partitioning module 620, the clustering module 630, the first determination module 640, the second determination module 650, and the third determination module 660 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present invention, at least one of the acquisition module 610, the partition module 620, the clustering module 630, the first determination module 640, the second determination module 650, and the third determination module 660 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or may be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by an appropriate combination of any of them. Alternatively, at least one of the acquisition module 610, the partition module 620, the clustering module 630, the first determination module 640, the second determination module 650, and the third determination module 660 may be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function may be executed.
[0193] It should be noted that the new energy station output prediction device part in the embodiment of the present invention corresponds to the new energy station output prediction method part in the embodiment of the present invention. The description of the new energy station output prediction device part specifically refers to the new energy station output prediction method part, which will not be repeated here.
[0194] Figure 7 A block diagram of an electronic device suitable for implementing a new energy station output prediction method according to an embodiment of the present invention is shown. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0195] like Figure 7As shown, the electronic device according to an embodiment of the present invention includes a processor 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory ROM 702 or the program loaded from the storage part 708 to the random access memory RAM 703. The processor 701 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include an on-board memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0196] In RAM 703, various programs and data required for the operation of the electronic device are stored. The processor 701, ROM 702 and RAM 703 are connected to each other via a bus 704. The processor 701 performs various operations of the method flow according to the embodiment of the present invention by executing the programs in ROM 702 and / or RAM 703. It should be noted that the program can also be stored in one or more memories other than ROM 702 and RAM 703. The processor 701 can also perform various operations of the method flow according to the embodiment of the present invention by executing the programs stored in the one or more memories.
[0197] According to an embodiment of the present invention, the electronic device may further include an input / output (I / O) interface 705, which is also connected to the bus 704. The electronic device may further include one or more of the following components connected to the input / output (I / O) interface 705: an input portion 706 including a keyboard, a mouse, etc.; an output portion 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 708 including a hard disk, etc.; and a communication portion 709 including a network interface card such as a LAN card, a modem, etc. The communication portion 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage portion 708 as needed.
[0198] According to an embodiment of the present invention, the method flow according to an embodiment of the present invention can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, the above-mentioned functions defined in the system of the embodiment of the present invention are executed. According to an embodiment of the present invention, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0199] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.
[0200] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device.
[0201] For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 702 and / or the RAM 703 described above and / or one or more memories other than the ROM 702 and the RAM 703 .
[0202] An embodiment of the present invention also includes a computer program product, which includes a computer program, which contains program code for executing the method provided by the embodiment of the present invention. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the new energy station output prediction method provided by the embodiment of the present invention.
[0203] When the computer program is executed by the processor 701, the above functions defined in the system / device of the embodiment of the present invention are executed. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0204] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 709, and / or installed from the removable medium 711. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0205] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0206] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments of the present invention can be combined and / or combined in various ways, even if such a combination or combination is not explicitly recorded in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features recorded in the various embodiments of the present invention can be combined and / or combined in various ways. All these combinations and / or combinations fall within the scope of the present invention.
[0207] The embodiments of the present invention are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment is described above, it does not mean that the measures in each embodiment cannot be used in combination advantageously. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.
Claims
1. A method for predicting the output of a new energy station, characterized in that: The method comprises: Acquire a numerical weather forecast data sequence of the target station in the time period to be predicted and a timestamp sequence corresponding to the numerical weather forecast data sequence; Dividing the numerical weather forecast data sequence into segments to obtain a plurality of data sequence segments; Performing clustering processing on the multiple data sequence fragments to obtain fragment clusters corresponding to multiple cluster centers, wherein the multiple cluster centers are determined based on the historical numerical meteorological forecast data sequence of the target station in a historical time period; For each segment cluster, based on at least one data sequence segment included in the segment cluster, determining from the timestamp sequence a timestamp sequence segment corresponding to each of the at least one data sequence segments; Inputting at least one data sequence segment included in the segment cluster and a timestamp sequence segment corresponding to each of the at least one data sequence segment into an output prediction model corresponding to the segment cluster to obtain at least one output prediction data segment corresponding to the segment cluster, including: For each data sequence segment, embedding the data sequence segment and the timestamp sequence segment corresponding to the data sequence segment respectively to obtain a first latent space vector and a second latent space vector, including: using a first Transformer model to convert the data sequence segment into the first latent space vector, the first Transformer model is obtained by replacing the embedding layer of the original Transformer model with a convolutional neural network; using a second Transformer model to convert the timestamp sequence segment corresponding to the data sequence segment into the second latent space vector, the second Transformer model is obtained by adding a timestamp embedding layer to the original Transformer model; Adding the first latent space vector and the second latent space vector to obtain a third latent space vector; Inputting the third latent space vector into an encoder module to obtain a fourth latent space vector; Performing a linear transformation on the fourth latent space vector to obtain an output prediction data segment corresponding to the data sequence segment; Based on the output prediction data segments corresponding to the at least one data sequence segment, obtaining at least one output prediction data segment corresponding to the segment cluster; Based on at least one output prediction data segment corresponding to each of the plurality of segment clusters, obtaining an output prediction data sequence of the target station in the time period to be predicted; The method further comprises: The numerical weather forecast data sequence is smoothed to obtain a target data sequence, including: For a j-th weather forecast data among a plurality of weather forecast data included in the numerical weather forecast data sequence, based on a preset window length, determining a plurality of target weather forecast data associated with the j-th weather forecast data; adjusting the j-1th smoothing weight based on the plurality of target weather forecast data to obtain the jth smoothing weight; Based on the j-th smoothing weight and the j-1-th smoothing data corresponding to the j-1-th weather forecast data, obtaining the j-th smoothing data corresponding to the j-th weather forecast data; and The target data sequence is obtained based on the smoothed data corresponding to each of the plurality of weather forecast data.
2. The method according to claim 1, characterized in that The encoder module includes N encoders; The step of inputting the third latent space vector into an encoder module to obtain a fourth latent space vector comprises: For the i-th encoder, use the temporal window attention mechanism to process the output feature of the i-1-th encoder to obtain the first output feature, wherein when i=1, the output feature of the i-1-th encoder is represented as the third latent space vector; Performing residual connection and normalization processing on the first output feature and the input feature of the i-th encoder to obtain a second output feature; Inputting the second output feature into a feedforward neural network to obtain a third output feature; The second output feature and the third output feature are subjected to residual connection and normalization processing to obtain the output feature of the i-th encoder, wherein, when i=N, the output feature of the i-th encoder is represented as the fourth latent space vector.
3. The method according to claim 2, characterized in that The method of processing the input feature of the i-th encoder by using the time sequence window attention mechanism to obtain the first output feature includes: Performing a linear transformation on the input features of the i-th encoder to obtain a query matrix, a key matrix, and a value matrix; Calculating the attention score between the query matrix and the key matrix to obtain an attention matrix; Based on the attention matrix and the value matrix, the first output feature is obtained.
4. The method according to claim 1, characterized in that The segmenting of the numerical weather forecast data sequence to obtain a plurality of data sequence segments includes: Determining a plurality of extreme value points from a plurality of meteorological forecast data included in the numerical meteorological forecast data sequence; Based on the multiple extreme points, the numerical weather forecast data sequence is segmented to obtain the multiple data sequence segments.
5. The method according to claim 1, wherein: The segmenting of the numerical weather forecast data sequence to obtain a plurality of data sequence segments includes: The target data sequence is divided into segments to obtain the multiple data sequence segments.
6. The method according to claim 1, characterized in that The adjusting the j-1th smoothing weight based on the plurality of target weather forecast data to obtain the jth smoothing weight comprises: Based on the multiple target weather forecast data, a standard deviation and a mean are calculated; Based on the standard deviation and the mean, a dynamic error is obtained, as shown in the following formula: ; In the formula, represents the dynamic error, represents the standard deviation, represents the mean, represents a constant; and The j-1th smoothing weight is adjusted by using the dynamic error to obtain the jth smoothing weight, as shown in the following formula: in, represents the jth smoothing weight, represents the j-1th smoothing weight, M represents the preset window length, represents the jth weather forecast data, Represents the j-1th smoothed data corresponding to the j-1th weather forecast data.
7. The method according to claim 1, characterized in that The clustering process is performed on the plurality of data sequence segments to obtain segment clusters corresponding to the plurality of cluster centers, including: For each data sequence segment, based on preset indicator items, construct a data matrix corresponding to the data sequence segment; determining a cluster center associated with the data matrix from among the plurality of cluster centers based on distances between the data matrix and each of the plurality of cluster centers; and For each cluster center, based on at least one data matrix associated with the cluster center, at least one data sequence segment corresponding to the cluster center is determined to obtain a segment cluster corresponding to the cluster center.
8. A new energy station output prediction device, characterized in that: The device comprises: An acquisition module, used to acquire a numerical weather forecast data sequence of a target station in a time period to be predicted and a timestamp sequence corresponding to the numerical weather forecast data sequence; A division module, used for dividing the numerical weather forecast data sequence into segments to obtain a plurality of data sequence segments; A clustering module, configured to perform clustering processing on the plurality of data sequence fragments to obtain fragment clusters corresponding to a plurality of cluster centers, wherein the plurality of cluster centers are determined based on a historical numerical meteorological forecast data sequence of the target station in a historical time period; A first determining module is configured to determine, for each segment cluster, based on at least one data sequence segment included in the segment cluster, from the timestamp sequence, a timestamp sequence segment corresponding to each of the at least one data sequence segments; The second determination module is used to input the at least one data sequence segment included in the segment cluster and the timestamp sequence segments corresponding to the at least one data sequence segment into the output prediction model corresponding to the segment cluster, to obtain at least one output prediction data segment corresponding to the segment cluster, including: For each data sequence segment, embedding the data sequence segment and the timestamp sequence segment corresponding to the data sequence segment respectively to obtain a first latent space vector and a second latent space vector, including: using a first Transformer model to convert the data sequence segment into the first latent space vector, the first Transformer model is obtained by replacing the embedding layer of the original Transformer model with a convolutional neural network; using a second Transformer model to convert the timestamp sequence segment corresponding to the data sequence segment into the second latent space vector, the second Transformer model is obtained by adding a timestamp embedding layer to the original Transformer model; Adding the first latent space vector and the second latent space vector to obtain a third latent space vector; Inputting the third latent space vector into an encoder module to obtain a fourth latent space vector; Performing a linear transformation on the fourth latent space vector to obtain an output prediction data segment corresponding to the data sequence segment; Based on the output prediction data segments corresponding to the at least one data sequence segment, obtaining at least one output prediction data segment corresponding to the segment cluster; A third determination module is used to obtain an output prediction data sequence of the target station in the time period to be predicted based on at least one output prediction data segment corresponding to each of the plurality of segment clusters; The device is also used for: The numerical weather forecast data sequence is smoothed to obtain a target data sequence, including: For a j-th weather forecast data among a plurality of weather forecast data included in the numerical weather forecast data sequence, based on a preset window length, determining a plurality of target weather forecast data associated with the j-th weather forecast data; adjusting the j-1th smoothing weight based on the plurality of target weather forecast data to obtain the jth smoothing weight; Based on the j-th smoothing weight and the j-1-th smoothing data corresponding to the j-1-th weather forecast data, obtaining the j-th smoothing data corresponding to the j-th weather forecast data; and The target data sequence is obtained based on the smoothed data corresponding to each of the plurality of weather forecast data.
Citation Information
Patent Citations
Distributed photovoltaic short-term power prediction method and device based on K-means + + and BILSTM
CN117035184A