Model training method and device and wind power prediction method
By multi-dimensionally encoding and fusion of the historical data of each station in the wind farm group, target features are generated, and the deep learning model, especially the Transformer model, predicting wind power is solved, and the problem of not fully considering the spatio-temporal coupling characteristics in the prior art is solved, and the prediction accuracy is improved.
Patent Information
- Application Number
- CN202411792229.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-04-04
AI Technical Summary
The existing wind power power prediction methods do not fully consider the spatial and temporal coupling characteristics between stations in the region, resulting in low prediction accuracy.
By obtaining the historical data of each station in the wind farm group, fusion of time encoding, location encoding and similarity matrix, generating target features, and using these features to train deep learning models, especially Transformer models, to predict wind power.
It fully integrates the timing and spatial characteristics of each station in the region, improves the accuracy of wind power prediction, and solves the problem of low prediction accuracy.
Smart Images

Figure CN119760425A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of new energy, and specifically, to a model training method, device and wind power prediction method. Background Art
[0002] With the rapid development of renewable energy generation, wind power forecasting technology has received increasing attention. Traditional forecasting methods are mostly based on statistical analysis and machine learning algorithms (such as support vector machines, neural networks, etc.), and are mostly independent forecasts for a single energy site.
[0003] The relevant wind farm power prediction methods do not fully consider the complex spatiotemporal coupling characteristics between stations in the region. When processing spatial information, they rely on simple distance metrics, making it difficult to effectively model the impact of spatial relationships such as geographical distance and meteorological correlation between stations on power output. In the time dimension, their modeling capabilities are limited, and their ability to capture long-term dependencies is insufficient, affecting prediction accuracy.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The present application provides a model training method, device and wind power prediction method to at least solve the technical problem of low wind power prediction accuracy caused by not fully considering the spatiotemporal coupling characteristics between stations in the prediction area.
[0006] According to one aspect of the present application, a model training method is provided, including: obtaining a historical data set corresponding to each station in a wind farm group, wherein the historical data set includes the following historical data: wind power data, meteorological data, numerical weather forecast data, wind turbine status data, and grid access condition data; time-coding the historical data corresponding to each station to obtain multiple first coding results corresponding to each station, and position-coding the historical data corresponding to each station to obtain multiple second coding results corresponding to each station; determining the similarity between historical data of the same type corresponding to different stations to obtain multiple similarity matrices, and determining a third coding result corresponding to each station based on the multiple similarity matrices; fusing the multiple first coding results, multiple second coding results, and third coding results corresponding to each station to obtain target features; and using the target features to train a deep learning model.
[0007] Optionally, the deep learning model is trained using the target features, including: inputting the target features into an attention layer in the deep learning model, wherein the attention layer includes: multiple attention heads, and performing the following operations through different attention heads: calculating the correlation between internal elements in the encoding results, and calculating the correlation between the encoding results to obtain multiple attention calculation results, wherein the encoding results include: multiple first encoding results, multiple second encoding results, and third encoding results; concatenating the multiple attention calculation results to obtain a first feature vector; performing a linear transformation on the first feature vector to obtain a second feature vector; inputting the second feature vector into a fully connected layer, and performing a weighted summation process on the internal elements in the second feature vector through the fully connected layer to obtain a third feature vector output by the fully connected layer; inputting the third feature vector into an output layer to obtain the predicted wind power of each site at the first target time point output by the output layer; determining a loss function based on the difference between the predicted wind power at the first target time point and the actual wind power at the first target time point; and obtaining a deep learning model that has completed training when the function value of the loss function is less than a preset threshold.
[0008] Optionally, the similarity between historical data of the same type corresponding to different stations is determined to obtain multiple similarity matrices, including: calculating the similarity matrix between the wind power data of any two stations in the wind farm group at the second target time point, and obtaining a first similarity matrix corresponding to each station; calculating the similarity matrix between the meteorological data of any two stations in the wind farm group at the second target time point, and obtaining a second similarity matrix corresponding to each station; calculating the similarity matrix between the numerical weather forecast data of any two stations in the wind farm group at the second target time point, and obtaining a third similarity matrix corresponding to each station; calculating the similarity matrix between the wind turbine status data of any two stations in the wind farm group at the second target time point, and obtaining a fourth similarity matrix corresponding to each station; calculating the similarity matrix between the grid access condition data of any two stations in the wind farm group at the second target time point, and obtaining a fifth similarity matrix corresponding to each station.
[0009] Optionally, according to multiple similarity matrices, the third coding result corresponding to each station is determined, including: fusing the first similarity matrix corresponding to each station with the wind power data to obtain a first fusion result; fusing the second similarity matrix corresponding to each station with the meteorological data to obtain a second fusion result; fusing the third similarity matrix corresponding to each station with the numerical weather forecast data to obtain a third fusion result; fusing the fourth similarity matrix corresponding to each station with the wind turbine status data to obtain a fourth fusion result; fusing the fifth similarity matrix corresponding to each station with the grid access condition data to obtain a fifth fusion result; normalizing the first fusion result, the second fusion result, the third fusion result, the fourth fusion result, and the fifth fusion result corresponding to each station respectively to obtain a first processing result, a second processing result, a third processing result, a fourth processing result, and a fifth processing result; performing weighted summation on the first processing result, the second processing result, the third processing result, the fourth processing result, and the fifth processing result corresponding to each station to obtain a third coding result corresponding to each station.
[0010] Optionally, the wind turbine status data includes at least one of the following: wind turbine operating data, generator operating data, bearing operating data, gearbox operating data; the grid access condition data includes at least one of the following: access point voltage amplitude, voltage frequency access point current amplitude, power factor, grid fault type, grid fault content; after obtaining the historical data set corresponding to each station in the wind farm group, the method also includes: encoding the unstructured data in the historical data set, and normalizing the structured data in the historical data set.
[0011] Optionally, after obtaining the trained deep learning model, the method also includes: determining the error between the power peak of the predicted wind power within a preset time period output by the deep learning model and the power peak of the actual wind power within the preset time period, and determining the standard deviation of the predicted wind power within the preset time period output by the deep learning model; if the error is not within the first preset interval and / or the standard deviation is not within the second preset interval, adjusting the hyperparameters of the deep learning model and retraining the deep learning model.
[0012] According to another aspect of the present application, a method for predicting wind power is also provided, including: obtaining working data corresponding to each station in a wind farm group, wherein the working data includes at least one of the following: historical wind power data, meteorological data, numerical weather forecast data, wind turbine status data, and grid access condition data; inputting the working data into a deep learning model to obtain the predicted wind power for each station output by the deep learning model, wherein the deep learning model is obtained by training using the above model training method.
[0013] According to another aspect of the present application, a model training device is also provided, including: an acquisition module, used to acquire a historical data set corresponding to each station in a wind farm group, wherein the historical data set includes the following historical data: wind power data, meteorological data, numerical weather forecast data, wind turbine status data, and grid access condition data; a coding module, used to time-code the historical data corresponding to each station respectively to obtain multiple first coding results corresponding to each station, and position-code the historical data corresponding to each station to obtain multiple second coding results corresponding to each station; a determination module, used to determine the similarity between historical data of the same type corresponding to different stations, to obtain multiple similarity matrices, and to determine the third coding result corresponding to each station according to the multiple similarity matrices; a fusion module, used to fuse the multiple first coding results, multiple second coding results and third coding results corresponding to each station to obtain target features; a training module, used to train a deep learning model using the target features.
[0014] According to another aspect of the present application, a non-volatile storage medium is also provided, the storage medium includes a stored program, wherein when the program runs, the device where the storage medium is located is controlled to execute the above model training method.
[0015] According to another aspect of the present application, an electronic device is provided, including: a memory and a processor, the processor being used to run a program stored in the memory, wherein the above model training method is executed when the program is running.
[0016] According to another aspect of the present application, a computer program is also provided, wherein the above model training method is implemented when the computer program is executed by a processor.
[0017] According to another aspect of the present application, a computer program product is also provided, which includes a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above model training method is implemented.
[0018] In the present application, a historical data set corresponding to each station in a wind farm group is obtained, wherein the historical data set includes the following historical data: wind power data, meteorological data, numerical weather forecast data, wind turbine status data, and grid access condition data; the historical data corresponding to each station is time-coded to obtain multiple first coding results corresponding to each station, and the historical data corresponding to each station is position-coded to obtain multiple second coding results corresponding to each station; the similarity between historical data of the same type corresponding to different stations is determined to obtain multiple similarity matrices, and the third coding result corresponding to each station is determined based on the multiple similarity matrices; the multiple first coding results, multiple second coding results, and third coding results corresponding to each station are fused to obtain target features; the target features are used to train a deep learning model, thereby achieving the purpose of fully integrating the temporal characteristics and spatial characteristics of each station in the region, thereby achieving the technical effect of improving the accuracy of wind power prediction, and further solving the technical problem of low wind power prediction accuracy caused by not fully considering the spatiotemporal coupling characteristics between stations in the prediction area. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0020] Figure 1 is a flow chart of a model training method according to an embodiment of the present application;
[0021] Figure 2 is a flow chart of another model training method according to an embodiment of the present application;
[0022] Figure 3 is a flow chart of a wind power prediction method according to an embodiment of the present application;
[0023] Figure 4 is a structural diagram of a model training device according to an embodiment of the present application;
[0024] Figure 5 It is a hardware structure block diagram of a computer terminal according to a model training method of an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:
[0028] Transformer: A deep learning model architecture based on the attention mechanism, which can effectively process long-distance dependencies in sequence data and excels in fields such as natural language processing. Compared with traditional recurrent neural networks (RNN) and long short-term memory networks (LSTM), it is more efficient in processing long-distance dependencies, especially in sequence data modeling. The Transformer architecture is mainly composed of an encoder and a decoder, and the self-attention mechanism (Self-Attention) and multi-head attention mechanism (Multi-Head Attention) are the core components of Transformer. It can process sequence data in parallel and improve computing efficiency. Numerical Weather Forecast (NWP): According to the actual atmospheric conditions, under certain initial and boundary conditions, numerical calculations are performed on large computers to solve the set of fluid mechanics and thermodynamics equations that describe the weather evolution process. A method for predicting the atmospheric motion state and weather phenomena in a certain period of time in the future, and its data is used as an important input to the power prediction model of the present invention.
[0029] In the related art, traditional prediction methods are mostly based on statistical analysis and machine learning algorithms (such as support vector machines, neural networks, etc.), and are mostly independent predictions for a single energy site. Therefore, there is a problem of low accuracy in wind power prediction. In order to solve this problem, a relevant solution is provided in the embodiments of the present application, which is described in detail below.
[0030] According to an embodiment of the present application, a method embodiment of a model training method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0031] Figure 1 is a flow chart of a model training method according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0032] Step S102, obtaining a historical data set corresponding to each station in the wind farm group, wherein the historical data set includes the following historical data: wind power data, meteorological data, numerical weather forecast data, wind turbine status data, and grid access condition data.
[0033] In step S102, data is collected from sources such as the SCADA system of the wind farm, the real-time and historical records of the weather station, the numerical weather forecast service, the operating status monitoring system of the wind turbine, and the power grid dispatch center. During the collection process, it is necessary to ensure that the above data covers a sufficiently long period of time to include changes in various meteorological conditions and operating status.
[0034] Among them, wind power data includes but is not limited to the power output recorded by each wind farm at a specific time point, meteorological data includes but is not limited to wind speed, wind direction, temperature, humidity, air pressure, etc., numerical weather forecast data includes but is not limited to the predicted values of wind speed, temperature, radiation intensity, etc. in future time periods, wind turbine status data includes but is not limited to the wind turbine's speed, pitch angle, vibration and other operating status parameters, grid access condition data includes but is not limited to the voltage and frequency of the wind farm grid connection point and other data reflecting the impact of the grid operation status on wind power output.
[0035] Step S104, time-encoding the historical data corresponding to each station to obtain a plurality of first encoding results corresponding to each station, and position-encoding the historical data corresponding to each station to obtain a plurality of second encoding results corresponding to each station.
[0036] Specifically, add time features to the data at a specific time point for each station, which can be minutes, hours, working days, days, months, etc., and then use a fixed embedding method to build the corresponding time embedding layer. After converting the data to a long integer, calculate and superimpose the time coding vector to obtain the time coding, that is, the multiple first coding results corresponding to each station. Use sine and cosine functions to generate position coding vectors for the data corresponding to each station, ensuring that each position coding contains the geographic coordinate information of the station, so as to perform position coding on the historical data corresponding to each station and obtain multiple second coding results corresponding to each station.
[0037] Step S106, determining the similarity between the same type of historical data corresponding to different stations, obtaining a plurality of similarity matrices, and determining the third encoding result corresponding to each station according to the plurality of similarity matrices.
[0038] Specifically, the similarities between different stations are calculated, such as geographical distance similarity based on longitude and latitude, meteorological data similarity (including real-time meteorological and NWP data), and power output similarity. Among them, geographical distance similarity can use the great circle distance formula to calculate the geographical distance between stations, construct an N×N geographical distance matrix, and perform normalization. Meteorological similarity can solve the cosine similarity of the meteorological data of each station, and construct the similarity matrix of real-time meteorological and NWP data respectively. The matrix size is also N×N, and normalized. Power similarity can calculate the correlation coefficient of historical power data, construct an N×N power similarity matrix, and also perform normalization.
[0039] After obtaining the above similarity matrix, the three similarity matrices are weighted, and the weights can be preset values or automatically adjusted through model training. The weighted matrices are weighted fused, and the similarity matrix can be fused with the corresponding original data (or encoded data) by using dot product (corresponding elements are multiplied and summed), splicing and full connection layer processing, or element-by-element multiplication to form a weighted similarity code and determine the third encoding result corresponding to each station.
[0040] Step S108, fusing the multiple first encoding results, the multiple second encoding results and the third encoding result corresponding to each station to obtain the target feature.
[0041] To fuse the time coding, position coding and weighted similarity coding results, we can use a comprehensive application of splicing, linear transformation and multi-head attention mechanism to fuse the multiple coding results of each station into a target feature to form a higher-dimensional feature representation as the input for subsequent model processing.
[0042] Step S110, training the deep learning model using the target features.
[0043] First, we use the Transformer framework to build a deep learning model. The model design includes the encoder and decoder structures, as well as the self-attention mechanism and multi-head attention mechanism to capture the long-term dependencies and multi-dimensional features of the input data. The multi-head attention mechanism consists of multiple heads, each with its own query (Q), key (K), and value (V) matrices. For each head, the weight matrices of the query vector (Q), key vector (K), and value vector (V) are initialized respectively. (i=1, 2, ..., h), these weight matrices are used to convert the input data into the Q, K, V vectors corresponding to each head. For each position in the input sequence, the Q, K, V vectors of each head are calculated by linear transformation. For example, for the i-th head, Where X, is the input sequence after embedding layer and position encoding. Then, the attention score of each head is calculated as follows: Among them, d k is the dimension of vector K, which is used to scale the dot product attention score to avoid the gradient of the Softmax function disappearing due to the dot product being too large. The attention outputs of the h heads are concatenated to obtain a concatenated vector. Then, they are integrated through a linear layer to obtain the final output of the multi-head attention mechanism. This output contains the comprehensive attention information of different positions in the input sequence, and can capture the complex relationships in the data, such as the mutual influence between different sites, the dynamic correlation between wind power and meteorological factors, etc.
[0044] Then, the target features fused in step S108 are used as input and input into the deep learning model for training. During the training process, the model continuously adjusts parameters through the back propagation algorithm to minimize the error between the predicted result and the actual power value. Loss functions such as root mean square error (RMSE) and mean absolute error (MAE) can be used as optimization targets, and model parameters can be adjusted through optimization algorithms such as Adam and RMSprop. The hyperparameters of the model are adjusted using the validation set to avoid overfitting and underfitting, and to ensure that the model has good generalization ability.
[0045] After the training is completed, the model performance is evaluated using the test set. During the actual prediction, the real-time data is input into the model, and the model will output the power forecast value of each wind farm station in the future time range, providing forecast information for wind farms and power grid dispatching.
[0046] According to the above steps, a historical data set corresponding to each station in the wind farm group is obtained, wherein the historical data set includes the following historical data: wind power data, meteorological data, numerical weather forecast data, wind turbine status data, and grid access condition data; the historical data corresponding to each station is time-coded to obtain multiple first coding results corresponding to each station, and the historical data corresponding to each station is position-coded to obtain multiple second coding results corresponding to each station; the similarity between historical data of the same type corresponding to different stations is determined to obtain multiple similarity matrices, and the third coding result corresponding to each station is determined based on the multiple similarity matrices; the multiple first coding results, multiple second coding results, and third coding results corresponding to each station are fused to obtain target features; the target features are used to train the deep learning model, thereby achieving the purpose of fully integrating the temporal characteristics and spatial characteristics of each station in the region, thereby achieving the technical effect of improving the accuracy of wind power prediction.
[0047] The following Figure 1 The steps shown are exemplary and explanatory.
[0048] According to some optional embodiments of the present application, training a deep learning model using target features can be achieved by the following method: inputting the target features into an attention layer in the deep learning model, wherein the attention layer includes: multiple attention heads, and performing the following operations respectively through different attention heads: calculating the correlation between internal elements in the encoding results, and calculating the correlation between the encoding results to obtain multiple attention calculation results, wherein the encoding results include: multiple first encoding results, multiple second encoding results, and third encoding results; concatenating the multiple attention calculation results to obtain a first feature vector; performing a linear transformation on the first feature vector to obtain a second feature vector; inputting the second feature vector into a fully connected layer, and performing a weighted summation process on the internal elements in the second feature vector through the fully connected layer to obtain a third feature vector output by the fully connected layer; inputting the third feature vector into an output layer to obtain the predicted wind power of each site at the first target time point output by the output layer; determining a loss function based on the difference between the predicted wind power at the first target time point and the actual wind power at the first target time point; and obtaining a deep learning model that has completed training when the function value of the loss function is less than a preset threshold.
[0049] In the above embodiment, the target feature is input into the attention layer of the deep learning model, wherein the attention layer includes multiple attention heads. Each attention head independently calculates the correlation between internal elements in the encoding result, as well as the correlation between different encoding results. The encoding result can be a time encoding result (multiple first encoding results), a position encoding result (multiple second encoding results) and a weighted similarity encoding result (third encoding result) extracted from the historical data.
[0050] It should be noted that each attention head executes the self-attention mechanism respectively, calculates the dot product attention scores of the query vector (Q), the key vector (K) and the value vector (V), and thus calculates the output vector of each attention head, which is spliced together to form a first eigenvector. Then, the first eigenvector is linearly transformed, and the dimension of the eigenvector is adjusted through a fully connected layer to obtain a second eigenvector. The second eigenvector is input into the fully connected layer, and the fully connected layer is used to perform weighted sum processing on each element in the eigenvector, and the features are further extracted and fused to obtain the third eigenvector after nonlinear transformation, wherein the fully connected layer can capture the complex nonlinear relationship between the features and improve the prediction ability of the model. The third eigenvector is then input into the output layer, wherein the output layer can be a fully connected layer, and its output dimension matches the prediction target. In this embodiment, the output layer predicts the power value of each wind farm station and outputs the predicted wind power of each station at the first target time point.
[0051] Finally, the loss function is calculated based on the difference between the predicted wind power and the actual wind power at the first target time point (i.e., the prediction error). Among them, the loss function can be a root mean square error, mean absolute error, etc., which can quantify the difference between the model prediction and the true value. When the function value of the loss function is less than the preset threshold, it means that the model training has reached a satisfactory level. At this time, the model training adjusts the model parameters (including the weights and biases of the encoder, attention layer, and fully connected layer) through the back propagation algorithm and optimizer to minimize the loss function. Among them, the preset threshold is set according to the prediction requirements and accuracy requirements of the model. When the threshold is reached or the training round reaches the preset value, the model training is completed.
[0052] Through the above specific implementation steps, a wind power prediction method based on multi-dimensional feature fusion and Transformer model is proposed, which can effectively handle the complexity of power prediction of each station in the wind farm group and improve the prediction accuracy. After the model training is completed, it can be used to predict the wind power of each station in the wind farm group in real time, providing accurate data support for the operation control of the wind farm and the dispatch of the power grid to adapt to the changing wind power environment and prediction needs.
[0053] According to some other optional embodiments of the present application, determining the similarity between historical data of the same type corresponding to different stations to obtain multiple similarity matrices can be achieved by the following method: calculating the similarity matrix between the wind power data of any two stations in the wind farm group at the second target time point to obtain a first similarity matrix corresponding to each station; calculating the similarity matrix between the meteorological data of any two stations in the wind farm group at the second target time point to obtain a second similarity matrix corresponding to each station; calculating the similarity matrix between the numerical weather forecast data of any two stations in the wind farm group at the second target time point to obtain a third similarity matrix corresponding to each station; calculating the similarity matrix between the wind turbine status data of any two stations in the wind farm group at the second target time point to obtain a fourth similarity matrix corresponding to each station; calculating the similarity matrix between the grid access condition data of any two stations in the wind farm group at the second target time point to obtain a fifth similarity matrix corresponding to each station.
[0054] In the above embodiment, for any two stations in the wind farm group, their wind power data at the second target time point are extracted. The similarity between the wind power data of the two stations can be calculated using statistical methods such as Pearson correlation coefficient, cosine similarity or Spearman rank correlation coefficient. Based on the similarity, an N×N matrix (N is the total number of stations) is constructed, which is the first similarity matrix, and then normalized to ensure that the matrix elements are between 0 and 1, reflecting the relative similarity of the power data between the stations.
[0055] Similarly, extract the meteorological data of any two stations at the second target time point, including but not limited to wind speed, wind direction, temperature, humidity, etc. Use the above similarity calculation method to calculate the similarity between the meteorological data of each station and generate an N×N second similarity matrix. Similarly, extract the NWP data of any two stations in the wind farm group, including but not limited to future wind speed forecast, temperature forecast, rainfall probability, etc. Use the above similarity calculation method to construct an N×N third similarity matrix to reflect the similarity of the NWP data of each station.
[0056] Similarly, the wind turbine status data of each station in the wind farm group is collected, including but not limited to wind turbine speed, pitch angle, generator temperature, etc. Using the above-mentioned similarity calculation method, the similarity of wind turbine status data of any two stations is calculated, and an N×N fourth similarity matrix is generated, which is normalized to unify the data magnitude. The grid access condition data of each station in the wind farm group is obtained, including but not limited to grid connection point voltage, current, frequency, etc. The similarity of grid access condition data of any two stations is calculated, and an N×N fifth similarity matrix is generated to ensure that the elements of the similarity matrix are within a unified interval and normalized.
[0057] It can be understood that when calculating the similarity matrix, the Pearson correlation coefficient is used to measure the linear dependency strength and calculate the correlation between two variables, which is used for the similarity calculation of the above wind power, meteorological, and NWP data. The cosine similarity is used to calculate the angular similarity between vectors, which is used in the above meteorological data, wind turbine status data, and grid access condition data to evaluate their proximity in the feature space. The Spearman rank correlation coefficient is used for similarity calculation of non-normally distributed meteorological data.
[0058] In some optional embodiments of the present application, determining the third coding result corresponding to each station based on multiple similarity matrices can be achieved by the following method: fusing the first similarity matrix corresponding to each station with the wind power data to obtain a first fusion result; fusing the second similarity matrix corresponding to each station with the meteorological data to obtain a second fusion result; fusing the third similarity matrix corresponding to each station with the numerical weather forecast data to obtain a third fusion result; fusing the fourth similarity matrix corresponding to each station with the wind turbine status data to obtain a fourth fusion result; fusing the fifth similarity matrix corresponding to each station with the grid access condition data to obtain a fifth fusion result; normalizing the first fusion result, the second fusion result, the third fusion result, the fourth fusion result, and the fifth fusion result corresponding to each station to obtain a first processing result, a second processing result, a third processing result, a fourth processing result, and a fifth processing result; performing weighted summation on the first processing result, the second processing result, the third processing result, the fourth processing result, and the fifth processing result corresponding to each station to obtain a third coding result corresponding to each station.
[0059] In the above embodiment, the first similarity matrix of each station (the similarity matrix based on wind power data) is fused with the historical wind power data of the station. Specifically, the fusion method can be element-by-element multiplication and summation, or it can be fused through a more complex layer (such as a fully connected layer) to ensure that the similarity information is injected into the wind power data. Among them, element-by-element multiplication is to multiply the first similarity matrix and the wind power data vector element by element, so that each weight in the matrix is multiplied by the corresponding power value, reflecting the degree of correlation between power data between different stations. The fully connected layer fusion is to input the first similarity matrix and the wind power data vector into a fully connected layer, and by learning the weight parameters, let the model automatically decide how to fuse the two types of information to generate a more advanced feature representation.
[0060] Similarly, similar operations can be performed on meteorological data, and the second similarity matrix of each station can be fused with the historical meteorological data to obtain the second fusion result. The method used is similar to the first fusion result, and element-by-element multiplication or full connection layer fusion is selected according to specific needs. The third similarity matrix of each station (based on the similarity of numerical weather forecast data) is fused with the NWP data to generate the third fusion result, and the same method is used for fusion processing. The fourth similarity matrix of each station is calculated and fused with the historical wind turbine status data to obtain the fourth fusion result, and the fusion strategy remains consistent. Similarly, the grid access condition data is fused with the fifth similarity matrix to obtain the fifth fusion result.
[0061] Furthermore, each of the fusion results generated above is normalized to ensure that all features are within the same numerical range. The normalization method may be MinMax normalization, Z-score normalization, or L2 norm normalization.
[0062] After normalization, the first processing result, the second processing result, the third processing result, the fourth processing result, and the fifth processing result of each station are weighted and summed. The weight of the weighted summation can be set based on the relative importance of each data type to the wind power forecast, or it can be automatically learned through model training. For example, if it is found that meteorological data has the greatest impact on the forecast result, a higher weight can be set for the second processing result (meteorological data fusion result).
[0063] Finally, each station will get a third encoding result that integrates time, space and similarity information. This encoding result will be used as the input feature of subsequent deep learning models (such as Transformer models) to learn the complex dynamics of wind farm power output.
[0064] Through the above steps, the historical data of each station is fused with the similarity matrix to generate a comprehensive coding result containing information such as power, meteorology, numerical weather forecast, wind turbine status, grid access conditions, etc. This processing process makes full use of the correlation and similarity of historical data between stations, provides a richer feature representation for wind power forecasting, and helps to improve the prediction accuracy and reliability of the model.
[0065] As some optional embodiments of the present application, the wind turbine status data includes at least one of the following: wind turbine operating data, generator operating data, bearing operating data, gearbox operating data; the grid access condition data includes at least one of the following: access point voltage amplitude, voltage frequency access point current amplitude, power factor, grid fault type, grid fault content.
[0066] After obtaining the historical data set corresponding to each station in the wind farm group, the following steps may be performed: encoding the unstructured data in the historical data set, and normalizing the structured data in the historical data set.
[0067] In the above embodiment, the acquired wind turbine status data and grid access condition data are first encoded and processed. For discrete data such as grid fault types, One-Hot encoding is used to convert them into binary vectors, where each position represents a fault type. If there is such a fault type, the position is 1, otherwise it is 0. For the content of the grid fault, if the information is detailed enough, text encoding technology such as TF-IDF or BERT is used for vectorization processing and converted into a structured feature vector. Then, the encoded wind turbine status data feature vector is fused with the normalized grid access condition data feature vector, and they can be combined into a longer vector by splicing to ensure that the model input contains all relevant features. For each station, the fused data sequence is sorted by time, and a time series matrix is constructed so that the data vector at each time point contains all processed wind turbine status and grid access condition information to form a complete input sequence.
[0068] Finally, after completing the above encoding and normalization processing, the encoding results of power, meteorology, numerical weather forecast, wind turbine status, grid access conditions, etc. are weighted and fused according to the weighted similarity encoding process to obtain the weighted similarity encoding of each station. The time encoding, location encoding and weighted similarity encoding are fused to form the final target feature vector for deep learning model processing.
[0069] Through the above steps, unstructured data is encoded into structured feature vectors, and structured data is normalized to eliminate dimensional differences, so that all historical data can be effectively understood and utilized by the deep learning model. Ultimately, the time series data of each site contains rich information on wind turbine status and grid access conditions, providing a solid data foundation for subsequent wind power forecasting. In practical applications, these preprocessing steps can significantly improve the training speed and prediction accuracy of the model, while ensuring that the model can adapt to the characteristics of different sites and changes in grid conditions.
[0070] In some optional embodiments of the present application, after obtaining a trained deep learning model, it can be implemented by the following method: determining the error between the power peak of the predicted wind power within a preset time period output by the deep learning model and the power peak of the actual wind power within the preset time period, and determining the standard deviation of the predicted wind power within the preset time period output by the deep learning model; if the error is not within the first preset interval and / or the standard deviation is not within the second preset interval, adjusting the hyperparameters of the deep learning model, and retraining the deep learning model.
[0071] In the above embodiment, the output of the model (the predicted wind power within a preset time period) is compared with the actual wind power data within the same time period using the test set data. The error between the peak power predicted by the model and the peak power in the actual data is calculated. The error can be measured by a variety of statistical indicators, such as root mean square error and mean absolute error.
[0072] Specifically, determine whether the error obtained by the above calculation is within the first preset interval, and whether the standard deviation of the predicted data is within the second preset interval. For example, the first preset interval can be the maximum error range acceptable in engineering, and the second preset interval reflects the requirements for the stability of the prediction results. If the calculated error or standard deviation is not within the preset interval, it indicates that the current training effect of the model does not meet the requirements. At this time, it is necessary to adjust the hyperparameters of the model and retrain the model. Hyperparameter adjustment can be learning rate adjustment, batch size adjustment, number of iterations adjustment or regularization parameter adjustment. Among them, the learning rate adjustment affects the speed and accuracy of model learning by increasing or decreasing the learning rate; the batch size adjustment affects the training speed and stability of the model by changing the amount of data input into the model in each batch; the number of iterations adjustment increases the number of iterations to give the model more opportunities to optimize parameters; regularization parameter adjustment is used to prevent model overfitting.
[0073] It is worth noting that after adjusting the hyperparameters, the model is retrained with the training set data. Through multiple cycles of optimization, the model can be gradually adjusted to achieve better performance indicators. Repeat the above steps until the prediction error and standard deviation of the model meet the requirements of the preset range, indicating that the model has high accuracy and stability when processing wind power prediction tasks.
[0074] Through the above specific implementation methods, the performance of the wind power prediction model based on the Transformer architecture can be systematically evaluated, and the model can be optimized through hyperparameter adjustment to obtain prediction results that are closer to reality and meet the needs of wind farm operation and maintenance and grid dispatching. This process is a common iterative optimization method in deep learning model training. Through repeated evaluation and adjustment, the optimal state of the model can be found and the overall quality of wind power prediction can be improved. In actual operation, it may also be necessary to monitor the loss curve of the training process, performance indicators on the validation set, etc., to comprehensively judge the effect of hyperparameter adjustment.
[0075] According to an embodiment of the present application, a method for predicting wind power is also provided, the method comprising the following steps: obtaining working data corresponding to each station in a wind farm group, wherein the working data comprises at least one of the following: historical wind power data, meteorological data, numerical weather forecast data, wind turbine status data, and grid access condition data; inputting the working data into a deep learning model to obtain the predicted wind power for each station output by the deep learning model, wherein the deep learning model is Figure 1 The model training method is used to train the obtained
[0076] In the above embodiments, the wind speed, wind direction, temperature, humidity and other information of each station location are obtained in real time through a weather station or satellite remote sensing technology. It can be weather forecast data for a period of time in the future (such as a few hours to a few days) from a meteorological bureau or professional meteorological service, such as wind speed, wind direction, temperature, air pressure and other forecast values. It can be real-time reading of wind turbine operating status data from the monitoring system of the wind farm, such as speed, vibration signal, temperature, oil pressure, wind wheel angle, etc. It can be real-time acquisition of voltage, current, power factor, and grid fault information of wind power access points from the grid dispatching system.
[0077] After obtaining the above working data, the real-time meteorological data is connected and matched with the NWP data to ensure that the timestamps are consistent so that the model can use both real-time and forecast information. For unstructured data such as vibration signals, signal processing techniques (such as Fourier transform, wavelet transform) are used to convert them, and then encoded into feature vectors through convolutional neural networks. Numerical data such as voltage, current, and power factor are normalized by MinMax or Z-score to eliminate the impact of dimensions so that they can be effectively compared in the model. The above data are fused, either by splicing or by fusion through a custom layer, and then the same time encoding, position encoding, and weighted similarity encoding methods as in the training phase are used to generate encoding results containing real-time information.
[0078] Finally, the preprocessed and encoded real-time data is input into the trained deep learning model. The deep learning model uses a multi-head attention mechanism, a feedforward neural network layer, residual connections, and layer normalization to generate a predicted wind power value for each station through the multi-station power output layer.
[0079] Through the above steps, the wind power of each station in the wind farm group can be predicted in real time, providing accurate prediction information for wind farm operation and maintenance and power grid dispatching, which is helpful to optimize power system operation and improve resource utilization.
[0080] Figure 2 is a flowchart of another model training method according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0081] Step S201: data input and preprocessing.
[0082] Collect historical power data from multiple wind farms, including real-time meteorological data and numerical weather forecast data, classify them into time series data sets for each farm, and construct them into N×T×D tensors, where N is the number of farms, T is the time step, and D is the number of features contained at each time point. Encode unstructured data and normalize structured data. Pay special attention to the processing of power data and meteorological data to ensure data quality and format consistency.
[0083] Step S202: time coding.
[0084] Create a time encoding layer, construct a fixed embedding layer for hours, weekdays, days, months, and minutes, with an output dimension of d model The time information (such as the specific time point) is converted into a long integer and input into the time coding layer to obtain the encoding vector of each time point, and then these vectors are added to generate a representation of the comprehensive time information. After time coding, the data dimension becomes N×T×d model , making each data point rich in time information, so that the model can better learn the law of power changes over time.
[0085] Step S203: position coding.
[0086] Based on the sine and cosine functions, a position encoding vector is generated for each station, and the dimension is also d model , forming a periodic representation of location information, which makes it easier for the model to understand and utilize spatial relationships.
[0087] Step S204: weighted similarity analysis and encoding.
[0088] The similarity of longitude and latitude distance, meteorological similarity (including real-time meteorological and NWP data) and power similarity between stations are calculated to form an N×N matrix. Among them, the similarity of longitude and latitude distance calculates the geographical distance between two stations based on the longitude and latitude information of each station; the meteorological similarity considers the real-time meteorological data and NWP data respectively. For each time point, the current real-time meteorological characteristics are compared and analyzed with the real-time meteorological characteristics within a certain period of history. The meteorological similarity between two stations is calculated using cosine similarity or other similarity measurement methods, and two meteorological similarity matrices (one corresponding to the real-time meteorology and the other corresponding to NWP) are obtained.
[0089] The above matrix is normalized so that its value is in the interval [0,1] to ensure the consistency and comparability of the similarity measurement.
[0090] Similarity matrices of different categories are fused into a comprehensive similarity representation through weighted averaging or custom weighting functions; weights can be set statically or dynamically learned through model training.
[0091] The weighted similarity matrix can be fused with the original data by expanding the similarity matrix into a tensor with the same dimension as the original data (i.e., N×T×d model ), and perform operations such as element-by-element multiplication or addition with the original data. After weighted similarity encoding, a comprehensive feature tensor is obtained, but the data dimension is still N×T×d model .
[0092] Step S205: Transformer encoder processing.
[0093] The feature tensor fused from the above steps is input into the Transformer encoder. The encoder automatically learns the long-distance dependencies between data from different stations through a multi-head attention mechanism to capture the intrinsic spatiotemporal characteristics of the data. The output of the encoder is still N×T×d model , but after layer normalization, residual connection and other operations, each element contains a deeper feature representation, providing richer information for subsequent predictions.
[0094] Step S206: feature extraction.
[0095] The data processed by the Transformer encoder is input into the fully connected layer. The fully connected layer captures the nonlinear interaction between features through weighted summation and activation function, and further refines and optimizes the feature representation.
[0096] Step S207: power prediction.
[0097] The output of the fully connected layer in the above step is passed to the multi-station power output layer, which outputs the power value of each station within the predicted time step to form an N×T×1 tensor, where each element represents the power prediction value of a specific station at a specific time.
[0098] Step S208: model prediction and verification.
[0099] The model is trained based on the data of all stations, and the similarity and complementarity between stations are used to improve the prediction ability; the model parameters and hyperparameters, such as learning rate, batch size and number of iterations, are adjusted through repeated experiments to optimize the model performance; the accuracy of the model prediction is evaluated using indicators such as root mean square error and mean absolute error to ensure the consistency of the model under different stations and time conditions. In the whole process, the data of multiple stations are jointly trained to build a complete process from data collection, preprocessing, feature encoding and fusion, to Transformer encoding and final power prediction. During the training process, the model can fully explore the inherent correlation and complementarity between different stations, allowing the data of each station to "cooperate" with each other, thereby effectively improving the accuracy of power prediction. Moreover, the model's potential can be further explored and its performance can be optimized by continuously fine-tuning and optimizing the model's parameters (such as the weights and biases of each layer of the neural network) and hyperparameters (such as learning rate, batch size, number of iterations, etc.).
[0100] It is worth noting that by introducing real-time meteorological data and numerical weather forecast data, the model can more accurately simulate and predict the dynamic changes of wind power, especially in the synergy between sites and the influence of meteorological conditions. The implementation of the entire process ensures that the model can efficiently learn and utilize various features, thereby achieving high-precision wind power prediction.
[0101] Figure 3 is a flow chart of a wind power prediction method according to an embodiment of the present application, such as Figure 3 As shown, the method comprises the following steps:
[0102] Step S301: data collection and preprocessing.
[0103] In step S301, the working data corresponding to each station in the wind farm group is collected, including: wind power real-time meteorological data, station historical power data, and NWP. Specifically, the meteorological data of each station is collected in real time through the meteorological stations or satellite remote sensing data installed at each wind farm station, including but not limited to wind speed, wind direction, temperature, humidity, air pressure, etc.; the power output data of each station in the past period of time is extracted from the historical records of the wind farm; the numerical weather forecast data from professional meteorological service agencies is obtained, including but not limited to predicted wind speed, wind direction, temperature, etc., and combined with the station historical data and real-time data to provide a reference for future meteorological conditions for the model. The above-collected wind power real-time meteorological data, station historical power data, and NWP are integrated to construct a three-dimensional tensor N×T×D, where N is the number of stations, T is the time step, and D is the number of features contained at each time point, to ensure the time alignment of the data for input into the deep learning model.
[0104] Step S302, deep learning model input and application.
[0105] The preprocessed data tensors are input into the Transformer wind power joint power prediction model based on multi-dimensional encoding fusion, where the input layer of the model is designed to receive tensors of N×T×D dimensions to ensure that all collected features can be effectively utilized. Timestamp information is added to the input data to ensure that the model can understand the time order and periodicity of the data. By constructing a fixed embedded time encoding layer, the time dimension (such as minutes, hours, weekdays, days, and months) is encoded as N×T×d model The vector representation of .
[0106] Step S303: outputting wind power prediction results.
[0107] In step S303, the trained optimal model is used to predict the future wind power of each station in the wind farm group. The real-time wind power meteorological data, station historical power data, NWP, etc. are input into the model to obtain the wind power forecast value of the corresponding station in the future. The prediction results are applied to actual scenarios such as wind farm operation management and power grid dispatching to provide decision support for the optimized operation of wind farms, power control and stable operation of power grids, such as reasonably arranging the start and stop of wind turbines and adjusting the load distribution of power grids according to the prediction results.
[0108] Through the above steps, the Transformer wind power joint power prediction model based on multi-dimensional coding fusion can deeply process and analyze the real-time meteorological data, historical power data and NWP data of each station in the wind farm group, and finally generate accurate wind power prediction results, providing strong support for the operation management of wind farms and grid dispatching. Throughout the process, the design and training process of the model ensures the comprehensive utilization and in-depth understanding of the data, thereby improving the accuracy and reliability of the prediction.
[0109] Figure 4 is a structural diagram of a model training device according to an embodiment of the present application, such as Figure 4 As shown, the device comprises:
[0110] The acquisition module 40 is used to acquire the historical data set corresponding to each station in the wind farm group, wherein the historical data set includes the following historical data: wind power data, meteorological data, numerical weather forecast data, wind turbine status data, and grid access condition data.
[0111] The encoding module 42 is used to perform time encoding on the historical data corresponding to each station to obtain multiple first encoding results corresponding to each station, and to perform position encoding on the historical data corresponding to each station to obtain multiple second encoding results corresponding to each station.
[0112] The determination module 44 is used to determine the similarity between the same type of historical data corresponding to different stations, obtain multiple similarity matrices, and determine the third encoding result corresponding to each station according to the multiple similarity matrices.
[0113] The fusion module 46 is used to fuse the multiple first encoding results, the multiple second encoding results and the third encoding results corresponding to each station to obtain the target feature.
[0114] The training module 48 is used to train the deep learning model using the target features.
[0115] Optionally, the acquisition module 40 is further configured to, after acquiring the historical data set corresponding to each station in the wind farm group, perform the following steps: encoding the unstructured data in the historical data set, and normalizing the structured data in the historical data set.
[0116] Optionally, the determination module 44 is also used to perform the following steps: calculate the similarity matrix between the wind power data of any two stations in the wind farm group at the second target time point, and obtain the first similarity matrix corresponding to each station; calculate the similarity matrix between the meteorological data of any two stations in the wind farm group at the second target time point, and obtain the second similarity matrix corresponding to each station; calculate the similarity matrix between the numerical weather forecast data of any two stations in the wind farm group at the second target time point, and obtain the third similarity matrix corresponding to each station; calculate the similarity matrix between the wind turbine status data of any two stations in the wind farm group at the second target time point, and obtain the fourth similarity matrix corresponding to each station; calculate the similarity matrix between the grid access condition data of any two stations in the wind farm group at the second target time point, and obtain the fifth similarity matrix corresponding to each station; fuse the first similarity matrix corresponding to each station with the wind power data. Obtain a first fusion result; fuse the second similarity matrix corresponding to each station with the meteorological data to obtain a second fusion result; fuse the third similarity matrix corresponding to each station with the numerical weather forecast data to obtain a third fusion result; fuse the fourth similarity matrix corresponding to each station with the wind turbine status data to obtain a fourth fusion result; fuse the fifth similarity matrix corresponding to each station with the grid access condition data to obtain a fifth fusion result; normalize the first fusion result, the second fusion result, the third fusion result, the fourth fusion result, and the fifth fusion result corresponding to each station respectively to obtain a first processing result, a second processing result, a third processing result, a fourth processing result, and a fifth processing result; perform weighted summation on the first processing result, the second processing result, the third processing result, the fourth processing result, and the fifth processing result corresponding to each station to obtain a third coding result corresponding to each station.
[0117] Optionally, the training module 48 is also used to perform the following steps: input the target feature into the attention layer in the deep learning model, wherein the attention layer includes: multiple attention heads, and the following operations are performed respectively through different attention heads: calculate the correlation between internal elements in the encoding result, and calculate the correlation between the encoding results to obtain multiple attention calculation results, wherein the encoding result includes: multiple first encoding results, multiple second encoding results, and third encoding results; concatenate the multiple attention calculation results to obtain a first feature vector; perform linear transformation on the first feature vector to obtain a second feature vector; input the second feature vector into the fully connected layer, and perform weighted summation processing on the internal elements in the second feature vector through the fully connected layer to obtain a third feature vector output by the fully connected layer; input the third feature vector into the output layer to obtain the predicted wind power of each site at the first target time point output by the output layer; determine the loss function based on the difference between the predicted wind power at the first target time point and the actual wind power at the first target time point; when the function value of the loss function is less than a preset threshold, a deep learning model that has completed training is obtained.
[0118] Optionally, the wind turbine status data includes at least one of the following: wind turbine operating data, generator operating data, bearing operating data, gearbox operating data; the grid access condition data includes at least one of the following: access point voltage amplitude, voltage frequency access point current amplitude, power factor, grid fault type, grid fault content.
[0119] After obtaining the trained deep learning model, the model training device is also used to: determine the error between the power peak of the predicted wind power within a preset time period output by the deep learning model and the power peak of the actual wind power within the preset time period, and determine the standard deviation of the predicted wind power within the preset time period output by the deep learning model; if the error is not within the first preset interval and / or the standard deviation is not within the second preset interval, adjust the hyperparameters of the deep learning model and retrain the deep learning model.
[0120] It should be noted that the above Figure 4 The modules in the embodiment may be program modules (e.g., a set of program instructions for implementing a specific function) or hardware modules. For the latter, they may be expressed in the following forms, but are not limited thereto: the expression form of the above modules is a processor, or the functions of the above modules are implemented by a processor.
[0121] It should be noted that Figure 4 The preferred implementation of the illustrated embodiment can be found in Figure 1 The relevant description of the illustrated embodiment will not be repeated here.
[0122] Figure 5FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a model training method. Figure 5 As shown, the computer terminal 50 may include one or more (502a, 502b, ..., 502n are used to illustrate) processors 502 (the processor 502 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 504 for storing data, and a transmission module 506 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 5 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 5 More or fewer components as shown, or with Figure 5 Different configurations shown.
[0123] It should be noted that the one or more processors 502 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 50. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0124] The memory 504 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the model training method in the embodiment of the present application. The processor 502 executes various functional applications and data processing by running the software programs and modules stored in the memory 504, that is, the above-mentioned model training method is realized. The memory 504 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 504 may further include a memory remotely arranged relative to the processor 502, and these remote memories may be connected to the computer terminal 50 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0125] The transmission module 506 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 50. In one example, the transmission module 506 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 506 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0126] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 50 .
[0127] It should be noted that, in some optional embodiments, the above Figure 5 The computer terminal shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 5 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer terminal described above.
[0128] It should be noted that Figure 5 The computer terminal shown is used to execute Figure 1 The model training method shown, therefore the relevant explanations in the execution method of the above commands are also applicable to the electronic device and will not be repeated here.
[0129] An embodiment of the present application also provides a non-volatile storage medium, which includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above model training method.
[0130] A program for a non-volatile storage medium to perform the following functions: obtaining a historical data set corresponding to each station in a wind farm group, wherein the historical data set includes the following historical data: wind power data, meteorological data, numerical weather forecast data, wind turbine status data, and grid access condition data; time-coding the historical data corresponding to each station to obtain a plurality of first coding results corresponding to each station, and position-coding the historical data corresponding to each station to obtain a plurality of second coding results corresponding to each station; determining the similarity between historical data of the same type corresponding to different stations to obtain a plurality of similarity matrices, and determining a third coding result corresponding to each station based on the plurality of similarity matrices; fusing the plurality of first coding results, the plurality of second coding results, and the third coding results corresponding to each station to obtain a target feature; and using the target feature to train a deep learning model.
[0131] An embodiment of the present application also provides an electronic device, including: a memory and a processor, the processor being used to run a program stored in the memory, wherein the above model training method is executed when the program is running.
[0132] The processor is used to run a program that performs the following functions: obtaining a historical data set corresponding to each station in a wind farm group, wherein the historical data set includes the following historical data: wind power data, meteorological data, numerical weather forecast data, wind turbine status data, and grid access condition data; time-coding the historical data corresponding to each station to obtain multiple first coding results corresponding to each station, and position-coding the historical data corresponding to each station to obtain multiple second coding results corresponding to each station; determining the similarity between historical data of the same type corresponding to different stations to obtain multiple similarity matrices, and determining a third coding result corresponding to each station based on the multiple similarity matrices; fusing the multiple first coding results, multiple second coding results, and third coding results corresponding to each station to obtain target features; and using the target features to train a deep learning model.
[0133] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0134] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0135] In the above-mentioned embodiments of the present application, the collected information is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary protection measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0136] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0137] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0138] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0139] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0140] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A model training method, characterized in that: include: Acquire a historical data set corresponding to each station in the wind farm group, wherein the historical data set includes the following historical data: wind power data, meteorological data, numerical weather forecast data, wind turbine status data, and grid access condition data; Performing time coding on the historical data corresponding to each of the stations to obtain a plurality of first coding results corresponding to each of the stations, and performing position coding on the historical data corresponding to each of the stations to obtain a plurality of second coding results corresponding to each of the stations; Determine the similarity between the same type of historical data corresponding to different stations to obtain a plurality of similarity matrices, and determine the third encoding result corresponding to each station according to the plurality of similarity matrices; Fusing the plurality of the first encoding results, the plurality of the second encoding results, and the third encoding result corresponding to each of the stations to obtain a target feature; The deep learning model is trained using the target features.
2. The method according to claim 1, characterized in that: The deep learning model is trained using the target features, including: Input the target feature into the attention layer in the deep learning model, wherein the attention layer includes: a plurality of attention heads, and the following operations are respectively performed through different attention heads: calculating the correlation between internal elements in the encoding result, and calculating the correlation between the encoding results, to obtain a plurality of attention calculation results, wherein the encoding result includes: a plurality of the first encoding results, a plurality of the second encoding results, and the third encoding result; Concatenate the plurality of attention calculation results to obtain a first feature vector; Performing a linear transformation on the first eigenvector to obtain a second eigenvector; inputting the second eigenvector into a fully connected layer, and performing a weighted summation process on internal elements in the second eigenvector through the fully connected layer to obtain a third eigenvector output by the fully connected layer; Inputting the third eigenvector into an output layer, obtaining the predicted wind power of each of the stations at a first target time point output by the output layer; A loss function is determined based on the difference between the predicted wind power at the first target time point and the actual wind power at the first target time point; when the function value of the loss function is less than a preset threshold, a deep learning model that has completed training is obtained.
3. The method according to claim 1, characterized in that Determine the similarity between the same type of historical data corresponding to different stations, and obtain multiple similarity matrices, including: Calculating a similarity matrix between wind power data of any two of the wind farms in the wind farm group at a second target time point to obtain a first similarity matrix corresponding to each of the wind farms; Calculating a similarity matrix between meteorological data of any two of the wind farms in the wind farm group at the second target time point to obtain a second similarity matrix corresponding to each of the wind farms; Calculating a similarity matrix between numerical weather forecast data of any two of the wind farms in the wind farm group at the second target time point, to obtain a third similarity matrix corresponding to each of the wind farms; Calculating a similarity matrix between wind turbine status data of any two of the wind farms in the wind farm group at the second target time point to obtain a fourth similarity matrix corresponding to each of the wind farms; A similarity matrix between the grid access condition data of any two of the wind farms in the wind farm group at the second target time point is calculated to obtain a fifth similarity matrix corresponding to each of the wind farms.
4. The method according to claim 3, characterized in that Determining, according to the plurality of similarity matrices, a third encoding result corresponding to each of the stations, comprises: The first similarity matrix corresponding to each of the stations is fused with the wind power data to obtain a first fusion result; the second similarity matrix corresponding to each of the stations is fused with the meteorological data to obtain a second fusion result; the third similarity matrix corresponding to each of the stations is fused with the numerical weather forecast data to obtain a third fusion result; the fourth similarity matrix corresponding to each of the stations is fused with the wind turbine status data to obtain a fourth fusion result; the fifth similarity matrix corresponding to each of the stations is fused with the grid access condition data to obtain a fifth fusion result; Normalizing the first fusion result, the second fusion result, the third fusion result, the fourth fusion result, and the fifth fusion result corresponding to each station to obtain a first processing result, a second processing result, a third processing result, a fourth processing result, and a fifth processing result; The first processing result, the second processing result, the third processing result, the fourth processing result, and the fifth processing result corresponding to each of the stations are weightedly summed to obtain the third coding result corresponding to each of the stations.
5. The method according to claim 1, characterized in that The historical data corresponding to each of the stations is time-coded to obtain a plurality of first coding results corresponding to each of the stations, including: Convert the historical data corresponding to each of the stations into a preset data type respectively, wherein the preset data type includes: long integer data; After converting the historical data corresponding to each of the stations into the preset data type, respectively calculating encoding vectors of different types of historical data within a plurality of different preset time lengths, to obtain a plurality of first encoding vectors corresponding to each type of historical data in each of the stations; Adding a plurality of first coding vectors corresponding to each type of historical data in each of the stations to generate the first coding result corresponding to each type of historical data, and obtaining a plurality of the first coding results corresponding to each of the stations; Position encoding is performed on the historical data corresponding to each of the stations to obtain a plurality of second encoding results corresponding to each of the stations, including: Obtaining the longitude and latitude coordinates of each of the stations, and determining a position coding vector corresponding to the longitude and latitude coordinates of each of the stations; The position coding vector of each station is concatenated with the wind power data, the meteorological data, the numerical weather forecast data, the wind turbine status data, and the grid access condition data of the station to obtain a plurality of second coding results corresponding to each station.
6. The method according to claim 1, characterized in that The wind turbine status data includes at least one of the following: wind turbine operating data, generator operating data, bearing operating data, gearbox operating data; The grid access condition data includes at least one of the following: access point voltage amplitude, voltage frequency access point current amplitude, power factor, grid fault type, grid fault content; After obtaining the historical data set corresponding to each station in the wind farm group, the method further includes: The unstructured data in the historical data set is encoded, and the structured data in the historical data set is normalized.
7. The method according to claim 2, characterized in that: After obtaining the trained deep learning model, the method further includes: Determine the error between the power peak of the predicted wind power within a preset time period output by the deep learning model and the power peak of the actual wind power within the preset time period, and determine the standard deviation of the predicted wind power within the preset time period output by the deep learning model; If the error is not within the first preset interval and / or the standard deviation is not within the second preset interval, adjust the hyperparameters of the deep learning model and retrain the deep learning model.
8. A method for predicting wind power, characterized in that: include: Acquire working data corresponding to each station in the wind farm group, wherein the working data includes at least one of the following: historical wind power data, meteorological data, numerical weather forecast data, wind turbine status data, and grid access condition data; The working data is input into a deep learning model to obtain the predicted wind power for each of the sites output by the deep learning model, wherein the deep learning model is obtained by training using the model training method described in any one of claims 1 to 7.
9. A model training device, characterized in that: include: An acquisition module is used to acquire a historical data set corresponding to each station in the wind farm group, wherein the historical data set includes the following historical data: wind power data, meteorological data, numerical weather forecast data, wind turbine status data, and grid access condition data; An encoding module, used to respectively perform time encoding on the historical data corresponding to each of the stations to obtain a plurality of first encoding results corresponding to each of the stations, and to perform position encoding on the historical data corresponding to each of the stations to obtain a plurality of second encoding results corresponding to each of the stations; A determination module, used to determine the similarity between the same type of historical data corresponding to different stations, obtain a plurality of similarity matrices, and determine the third encoding result corresponding to each station according to the plurality of similarity matrices; A fusion module, used for fusing the plurality of the first encoding results, the plurality of the second encoding results and the third encoding result corresponding to each of the stations to obtain a target feature; A training module is used to train the deep learning model using the target features.
10. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the model training method described in any one of claims 1 to 7.
11. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the model training method described in any one of claims 1 to 7 when running.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the model training method described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Wind power prediction method and device, equipment and storage medium
CN120454061A