Method for realizing solar power generation prediction based on hierarchical relationship
By constructing a hierarchical solar power generation prediction method, and utilizing techniques such as sliding time window modules and graph convolutional networks, the hierarchical and dynamic change characteristics between generators are extracted, solving the problem of inaccurate prediction in existing technologies and achieving more efficient solar power generation prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DALIAN UNIV OF TECH
- Filing Date
- 2023-02-07
- Publication Date
- 2026-05-29
AI Technical Summary
Existing solar power generation forecasting technologies fail to effectively capture the hierarchical relationships and dynamic changes between generators, resulting in inaccurate forecasts, especially over long periods and with large amounts of data, making it difficult to accurately predict solar power generation.
By constructing a hierarchical prediction method, utilizing a sliding time window module, an allocation matrix module, a time graph learning layer module, a time convolution module, and a hierarchical aggregation module, combined with an encoder and decoder, the hierarchical structure and dynamic change features between generators are extracted. Graph convolutional networks and time convolutional networks are then used for data processing and prediction.
It improves the accuracy of solar power generation prediction, reduces computational complexity and storage requirements, effectively captures long-term information, dynamically extracts relationships between generators, provides simple and direct prediction conclusions, and reduces the waste of solar energy usage.
Smart Images

Figure CN116341707B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to solar power generation technology, and more specifically, to the prediction of solar power generation. Background Technology
[0002] Solar thermal power generation is a renewable energy generation method that combines photothermal conversion, large-scale thermal storage, and grid synchronization. Due to its grid-friendly characteristics, it is increasingly being used by factories and households.
[0003] The "Action Plan for Achieving Carbon Peak Before 2030," issued by the State Council in October 2021, explicitly proposes: Actively develop solar thermal power generation and promote the establishment of integrated renewable energy power generation bases that complement and regulate solar thermal, photovoltaic, and wind power. Accelerate the construction of a new power system. Construct a new power system with a gradually increasing proportion of new energy sources and promote the large-scale optimization and allocation of clean power resources. Vigorously enhance the comprehensive regulation capacity of the power system, accelerate the construction of flexible regulation power sources, and accelerate the demonstration and application of new energy storage technologies.
[0004] The government provides atmospheric support for solar power generation. To protect the environment and reduce electricity consumption, the rational utilization of solar resources is an urgent issue. For example, for a factory power plant, analyzing real-time data can reduce the probability of wasted electricity and provide simple, direct, and objective conclusions through prediction, which is beneficial for the factory's business decisions. When a power plant provides usage data for a certain period, it may also provide relevant data characteristics, such as the number of generators in each power plant and the specific characteristics of each generator. Using this data as input to a predictive model allows for the generation of results for a specific time period, facilitating subsequent analysis and utilization.
[0005] Time series forecasting technology has undergone frequent updates and upgrades, evolving from basic to complex models. Traditional forecasting models include linear autoregressive methods, such as the ARIMA model (Autoregressive Integrated Moving Average model), machine learning models such as ANN (Artificial Neural Network), SVR (Support Vector Regression, an important application branch of Support Vector Machine SVM), and deep learning models such as RNN (Recurrent Neural Networks) and LSTM (Long Short-Term Memory).
[0006] With the advent of the information age and the increase in data volume, climate conditions and environmental factors are the main factors affecting generator efficiency. If generators are located close to each other, their environmental conditions are similar, including similar levels of sunlight, humidity, and temperature. This means that generators located close to each other have a strong correlation in power generation. Therefore, the data will exhibit a hierarchical relationship due to geographical structure (this hierarchical relationship will be explained in detail later).
[0007] Current research also includes some studies on hierarchical data. Basic sequences can be used to decompose time series, and embedded mean attributes can be used to replace the data's mean to achieve model constraints and improve the accuracy of matrix factorization. A novel global-local method applying deep factorial models has been proposed, which more comprehensively considers deep neural networks and graph structures. Regularization methods for high-dimensional time series with missing values have been proposed, significantly improving the matrix factorization methods required for this prediction technique. A temporal convolution technique has been proposed to achieve matrix factorization regularization. Graph convolution and temporal convolution have been proposed to predict multivariate time series. Currently, however, there is no particularly suitable solution for predicting time series data with hierarchical relationships. Summary of the Invention
[0008] This invention proposes a method for predicting solar power generation based on hierarchical relationships. By reasonably exploring the characteristics of hierarchical data of solar generators, it aims to achieve accurate prediction and solve the following problems:
[0009] 1. In terms of time. Optoelectronic time-series data has a large time span, involving many years of data. Past design methods have the problem of forgetting due to the large amount of data. Improving the accuracy of prediction results due to the large amount of data is a challenge.
[0010] 2. Regarding data volume: As the country places greater emphasis on optoelectronic technology, the technology is developing year by year, and the total number of generators is gradually increasing. Current technologies utilize graph networks to capture the close and inseparable correlations between data points. However, in the view of this invention, generators not only contain correlations but also a deeper structure, namely hierarchical relationships. How to reflect the importance of these hierarchical relationships is also a challenge of this technology.
[0011] 3. There are dynamic changes between generator data. Generators will adjust according to conditions, and as external conditions become more severe and losses increase, generators will be upgraded or replaced. Furthermore, changes in geographical location will lead to dynamic changes between generators. Therefore, extracting the graph relationships of these dynamic changes is a challenge.
[0012] To achieve the above objectives, the present invention provides a method for predicting solar power generation based on hierarchical relationships, comprising the following steps:
[0013] S1, Data Processing;
[0014] Obtain raw data: The raw data is two-dimensional data. The vertical axis is generator type, and the horizontal axis is historical time, daily historical generator power generation, region of each generator, power station, historical power generation of the power station, historical inverter power, historical discharger power, generator type, temperature, light intensity, humidity, solar irradiance, soil moisture, CO2, air pressure, wind direction, instantaneous wind speed, weekday, month, year, season, and holiday type.
[0015] Use data completion to align all historical times and integrate the data;
[0016] The definition of obtaining three-dimensional data is The time frame for power generation tier data is represented by T, which includes all historical time periods, with each value representing one day. N represents the number of generators. All other features are collectively defined as D, referred to as the overall feature. Predicted usage... This represents the total power generation of all generators in the coming day; it also retrieves hierarchical information: there are N generators, and each generator belongs to a specific region. Types of areas, which power station do these areas belong to? Power plants;
[0017] S2, Sliding Time Window Module;
[0018] Input: Input X into the sliding time window module;
[0019] The process of the window module is as follows: In X, with a step size p, the window length... Slide to the right to obtain a time window; the step size is p slides to the right each time to obtain a time window;
[0020] Output: Convert the time series data into multiple time window data, with a final number of time windows of c, and the i-th time window being c. , , where c = T - ( -p); where the power generation corresponding to each time window is the power generation at the next time node of that time length;
[0021] S3, Allocation Matrix Module;
[0022] The number of generators N and the number of regions are obtained from S1. Number of power plants ;
[0023] Set the zero matrix Dimension N* The first dimension is the number of generators, and the second dimension is the number of regions. If in X, the i-th generator belongs to the j-th region: then The value in the i-th row and j-th column is set to 1 to obtain the distribution matrix. The number of power plants belonging to all regions is set as ;
[0024] Set the zero matrix Dimensions * The first dimension is the number of regions, and the second dimension is the number of power plants. If in X, the i-th region belongs to the j-th power plant: then The value in the i-th row and j-th column is set to 1 to obtain the distribution matrix. ;
[0025] The allocation matrix is derived from the hierarchical relationship of the generator data itself. , ;
[0026] S4, Time Map Learning Layer Module; including steps S41 and S42;
[0027] Step S41, matrix decomposition:
[0028] Two matrices are randomly generated, one being the node embedding matrix. Time embedding matrix k is the embedding dimension. Represents the embedding vector of the i-th node, each row This represents the embedding vector for the j-th time window; multiplying the embedding vectors corresponding to the i-th node and the j-th time window yields the value of the future power generation for that time window. The result obtained by multiplying is approximately equal to the total power generation of all generators in the j-th time window. The embedding matrix will be updated during learning, using L2 regularization as the loss function to update both matrices. For the i-th data point, the update formula is as follows:
[0029]
[0030] This represents the first loss function of the algorithm in this design. The T in the upper right corner indicates matrix transpose in mathematical operations;
[0031] Step S42, the time-map learning layer, is implemented based on the following formula:
[0032]
[0033]
[0034]
[0035] It is the node characteristic matrix. It is the embedding vector of the j-th time window. , , , These are four parameters in a neural network, which are updated and set during training. Sensitivity coefficient;
[0036] Using the selection function argtopk(), S42 is obtained Select the k largest positions:
[0037]
[0038] The resulting adjacency matrix To perform sparsity operations, for j=1…N, set the data at positions other than the first k maximum values to 0 to reduce computation:
[0039]
[0040] Finally, the adjacency matrix corresponding to the i-th time window is obtained. This resulted in a graph structure that changes dynamically over time.
[0041] S5, encoder, includes two functional modules
[0042] Module 1: Temporal Convolution Module
[0043] Step a:
[0044] Original data: obtained by S1 ,in Set up three updatable non-zero weight matrices. , , , ;
[0045] Specific process:
[0046] use and three updatable weight matrices , , Multiplying them separately yields the results. matrix, matrix, matrix;
[0047]
[0048] Similarly All lines , ..., ,use matrix, matrix, Perform the same operations on the matrix as in the formula above;
[0049] Output: Get ,… To piece them together
[0050] Step b:
[0051] Input: Input the Z obtained in step a into a one-dimensional convolution conv1d, input the result into the ReLU activation function, and then input the result into the max pooling operation; specifically implemented as follows:
[0052]
[0053] Output: This represents the result of encoding time using the i-th time window obtained through the temporal convolution module;
[0054] Module 2: Hierarchical Aggregation Module
[0055] Step c:
[0056] Input: the result obtained from S4 , and the module obtained The input is fed into a graph convolutional network. This is the weight matrix that needs to be trained, and the formula is as follows:
[0057]
[0058]
[0059] Output: Updated
[0060]
[0061] The GCN formulas used in the following processes are all operated on the same basis;
[0062] Step d:
[0063] Input: Get S4 The result obtained in step c The allocation matrix obtained by S3 Enter the DIFFPOOL formula;
[0064]
[0065]
[0066]
[0067] Output: The updated graph structure obtained Updated data features ;
[0068] Step e:
[0069] Input: The result obtained in step d , Input to, via GCN module:
[0070]
[0071] Output: Receive updated information ;
[0072] After completing the two functional modules in S5, the following steps should be implemented:
[0073] Step f:
[0074] Input: The result obtained in step d The result obtained in step e S3 obtains the allocation matrix Input the DIFFPOOL module;
[0075]
[0076] Output: The updated graph structure obtained Updated data features ;
[0077] Step g:
[0078] Input: The result obtained in step f , Input to the GCN module:
[0079]
[0080] Output: Receive updated information ;
[0081] Step h:
[0082] The result obtained in step c Step e yielded Step g yields splicing, and obtaining it from S1 Add them together to get ( () represents the encoder output.
[0083] Step i:
[0084] Will = Repeat steps a through h, and finally obtain the result after step i. ;
[0085] Step j:
[0086] In step i = Repeat steps a through h, and finally obtain the result after step j. ;
[0087] S6, Decoder
[0088] The decoder uses a fully connected neural network, represented by the function F(x).
[0089] Input: the result obtained from S5 The input is fed into a fully connected layer, which is represented by the function F(x);
[0090]
[0091] Output: Final predicted value .
[0092] In the preferred embodiment, in step S1, the temperature includes historical daily temperatures and the daily temperatures predicted for the next month by the National Weather Service; the illumination includes historical illumination and the daily illumination predicted for the next month by the National Weather Service; and the humidity includes historical humidity data and the daily humidity predicted for the next month by the National Weather Service.
[0093] In the preferred approach, the results are evaluated as follows:
[0094] Get S6 S1 obtained S41 obtained Pre-set the maximum number of iterations, minimum threshold, and sensitivity coefficient. The loss function is calculated together, and the formula is:
[0095]
[0096] After training with the maximum number of iterations, Training ends when the value is less than the minimum threshold.
[0097] The evaluation indicators are MAE, MAPE, and RMSE, and the formulas are as follows:
[0098]
[0099] In the formula, and These represent the predicted and actual values of solar power generation, respectively.
[0100] The present invention has the following beneficial effects:
[0101] 1. Solar power generation data is long-term and extremely large in volume. This design method uses a sparsity self-attention mechanism and time distillation technology to reduce computational complexity, reduce computational storage requirements, capture long-term information, and achieve high speed.
[0102] 2. For solar power generation, environmental conditions, similar regions, and similar sunlight exposure lead to a high correlation between generators. Therefore, generator data exhibits a hierarchical relationship based on geographical location. Conventional methods simply input all data (generator type, time, daily historical generator power generation, region of each generator, power station, historical power generation of the power station, historical inverter power, historical generator power, generator type, solar irradiance, soil moisture, CO2, air pressure, wind direction, instantaneous wind speed and temperature, sunlight, humidity, day of the week, month, year, season, and holiday type) as a single layer into the model to obtain the final result. No existing model can explore the relationships between data, but this design extracts this structure and obtains a three-layer structure (generator-region-power station). The extracted structure is represented by an allocation matrix and combined with the characteristics of generator data nodes, improving the aggregation relationship of generator nodes. This more effectively improves prediction accuracy.
[0103] 3. In addition to the known static hierarchical relationships, solar energy changes over time, and there are dynamic changes between solar generators, such as machine wear. This design method dynamically extracts the relationships that change over time in order to learn the dynamic situation of generator data changing over time.
[0104] This invention's method can predict solar power generation data in real-world scenarios. Compared to previously unused hierarchical relationship concepts, this method uncovers the characteristics of the data, revealing a hierarchical structure, such as the correlation between generator-region-power station data. Furthermore, it dynamically extracts hidden features from the data itself during computation, perfectly combining hierarchical relationships and temporal characteristics. This allows for targeted and accurate prediction of generator power output.
[0105] When large enterprises, companies, and factories encounter difficulties in efficiently and accurately exploring the hidden information within large amounts of hierarchical data when dealing with real-world business problems, this invention provides a simple, direct, and objective predictive conclusion. This reduces the waste and consumption of solar energy, and is beneficial for local factories' business decisions regarding solar power generation. Attached Figure Description
[0106] Figure 1 This is a schematic diagram illustrating the hierarchical structure extracted from example data.
[0107] Figure 2 This is a schematic diagram of the overall prediction system design structure of the present invention.
[0108] Figure 3 This is a schematic diagram of the dimensions of the input data obtained by processing the original data.
[0109] Figure 4 This is a schematic diagram of the sliding time window module's sliding process. Detailed Implementation
[0110] Currently, solar energy data is time-series data, and most of it only considers environmental factors and location information, using historical time for prediction. Some people use graph structures to make predictions on similar data, but so far no data on solar power generation has been found to show a hierarchical structure.
[0111] For generator data, climatic conditions and environmental factors are the main factors affecting generator efficiency. If generators are located close to each other, their environmental conditions are similar, including similar levels of sunlight, humidity, and temperature. This means that generators located close to each other have a strong correlation in power generation. Figure 1 The first figure on the left shows the correlation between generators 1-8, which is represented by a solid black line.
[0112] Therefore, data will exhibit a hierarchical relationship due to geographical structure. For example, if several generators have similar overall conditions, they can be classified into the same region. If these regions are geographically close, they will belong to the same power plant. Figure 1 The left side shows a three-layer structure diagram. This three-layer structure, consisting of a generator, a regional power station, and a power plant, represents a hierarchical relationship.
[0113] To more intuitively understand that there is a hierarchical relationship in the generator data, such as Figure 1 As shown in the three-layer structure on the right, generators 2, 3, and 4 are located close to each other and belong to area 2. Generators 7 and 8 belong to area 3, and generators 5 and 8 belong to area 4. Meanwhile, areas 1 and 2 belong to power station 1, and areas 3 and 4 belong to power station 2.
[0114] This data is called hierarchical data. Of course, the three-layer structure above is just an example; in reality, there will be many more layers. In summary, not only does each layer of data have a specific relationship, but there are also corresponding relationships connecting these layers.
[0115] Based on the above hierarchical concepts, the overall framework of this invention is divided into: a data acquisition module, a sliding time window module, an allocation matrix module, a time-graph learning layer module, a time convolution module, and a hierarchical node aggregation module. The specific design is as follows: Figure 2 Once the data is obtained, the allocation matrix is first derived from the original data. Then, a sliding window technique is used to filter the original data, resulting in different input data. This data is then input into the time-map learning layer module to obtain an adjacency matrix that changes over time. The input data is then processed by an encoder and a decoder to obtain the predicted usage data. The encoder includes a temporal convolution module and a hierarchical data aggregation module. In this design, there are three encoder layers to make the algorithm's learning more accurate and detailed.
[0116] The specific steps of this invention are as follows:
[0117] 1. A method for predicting solar power generation based on hierarchical relationships, characterized by comprising the following steps:
[0118] S1, Data Processing
[0119] Obtain raw data: The raw data is two-dimensional data. The vertical axis represents generator type, and the horizontal axis represents historical time (day). The data includes daily historical generator power generation, the region where each generator is located, the power station where it is located, the historical power generation of the power station, historical inverter power, historical generator power, generator type, temperature (including historical daily temperature and the daily temperature predicted by the National Weather Service for the next month), sunshine (including historical sunshine and the daily sunshine predicted by the National Weather Service for the next month), humidity (including historical humidity data and the daily humidity predicted by the National Weather Service for the next month), solar irradiance, soil moisture, CO2, air pressure, wind direction, instantaneous wind speed, weekday, month, year, season, and holiday type (national statutory holidays).
[0120] The original data is processed, data completion is performed, all historical time periods are aligned, and the data is integrated. The resulting 3D data is defined as follows: The time frame for power generation tier data is represented by T, encompassing all historical time periods. Each value represents one day and includes the number of generators, N. All other features are collectively defined as D, referred to as the overall feature. Predicted usage. This represents the total power generation of all generators in the coming day. Obtaining this information reveals the hierarchical structure, i.e., there are N generators, and each generator belongs to a specific region. Types of areas, which power station do these areas belong to? A power plant.
[0121] S2, Sliding Time Window Module.
[0122] Input: Input X into the sliding time window module.
[0123] Procedure: In X, with a step size p and a window length of... Swipe right to obtain a time window. Each swipe right p times creates a time window, and the length of this time window is the window length. .
[0124] Output: Convert the time series data into multiple time window data. The final number of these time windows is c, and the i-th time window is... , , where c = T - ( -p). The power generation corresponding to each time window is the power generation at the next time node of that time length.
[0125] S3, Allocation Matrix Module.
[0126] The number of generators N and the number of regions are obtained from S1. Number of power plants .
[0127] Set the zero matrix Dimension N* The first dimension is the number of generators, and the second dimension is the number of regions. If in X, the i-th generator belongs to the j-th region: then The value in the i-th row and j-th column is set to 1 to obtain the distribution matrix. The number of power plants belonging to all regions is set as .
[0128] Set the zero matrix Dimensions * The first dimension is the number of regions, and the second dimension is the number of power plants. If in X, the i-th region belongs to the j-th power plant: then The value in the i-th row and j-th column is set to 1 to obtain the distribution matrix. .
[0129] The allocation matrix is derived from the hierarchical relationship of the generator data itself. , .
[0130] S4, Time Map Learning Layer Module
[0131] S4 includes S41 and S42.
[0132] S41:
[0133] Matrix decomposition:
[0134] Two matrices are randomly generated, one being the node embedding matrix. Time embedding matrix k is the embedding dimension. Represents the embedding vector of the i-th node, each row Let represent the embedding vector for the j-th time window. The goal is to multiply the embedding vectors corresponding to the i-th node and the j-th time window to obtain the future power generation value for that time window. The result obtained by multiplying is approximately equal to the total power generation of all generators in the j-th time window. The embedding matrix will be updated during learning, using an L2 regularization term (concept 7.1.1 in the book: Goodfellow I, Bengio Y, Courville A. Deep learning[M]. MIT press, 2016. hereinafter abbreviated as Deep learning) as the loss function to update the two matrices. For the i-th data point, the update formula is as follows:
[0135]
[0136] This represents the first loss function of the algorithm in this design. The T in the upper right corner indicates matrix transpose in mathematical operations;
[0137] S42: Time-map learning layer:
[0138] The formula is as follows:
[0139]
[0140]
[0141]
[0142] It is the node characteristic matrix. It is the embedding vector of the j-th time window. , , , These are four parameters in a neural network, which are updated and set during training. The sensitivity coefficient controls the size of the adjacency matrix; a larger value results in a larger adjacency matrix. Subtraction and the ReLU function are used to regularize the adjacency matrix, yielding... It is the adjacency matrix corresponding to the i-th time window;
[0143] Use the selection function argtopk() to select the k largest positions from a vector:
[0144]
[0145] The resulting adjacency matrix To perform sparsity operations, for j=1…N, set the data at positions other than the first k maximum values to 0 to reduce computation:
[0146]
[0147] Finally, the adjacency matrix corresponding to the i-th time window is obtained. This yields a graph structure that changes dynamically over time, represented by an adjacency matrix.
[0148] The S5 encoder includes two functional modules.
[0149] Module 1: Temporal Convolution Module
[0150] Step a:
[0151] Input: What S1 obtained ,in Set up three updatable weight matrices , , ,
[0152] process:
[0153] use and three updatable weight matrices , , Multiplying them separately yields the results. matrix, matrix, Matrix. Softmax function reference (see page 159, section 6.29 of the book *Deep Learning* for formula and concept).
[0154]
[0155] Similarly All lines , ..., ,use matrix, matrix, Perform the same operations on the matrix as in the formula above;
[0156] Output: The output obtained is ,… To piece them together
[0157] Step b:
[0158] Input: The Z obtained in step a is input into a one-dimensional convolution conv1d (refer to the concept in 7.9.1 of the book Deep Learning). The result is input into the ReLU activation function (refer to the concept on page 150 of the book Deep Learning). Then, the result is input into the max pooling operation (refer to the concept in Chapter 9.2 of the book Deep Learning) to reduce dimensionality and storage requirements. Specifically, it is implemented as follows:
[0159]
[0160] Output: This represents the result of encoding time using the i-th time window obtained through the temporal convolution module;
[0161] Module 2: Hierarchical Aggregation Module
[0162] Step c:
[0163] Input: The structure of the generator dynamic change information graph obtained from S4. The output obtained from the first module of S51 Input into a graph convolutional network (GCN, all GCN formulas below follow the same operation). This is the weight matrix that needs to be trained, and the formula is as follows:
[0164]
[0165]
[0166] Output: Updated
[0167]
[0168] Step d:
[0169] Input: The structure of the generator dynamic change information graph obtained from S4. The update information obtained in step c for this stage S3 obtains the allocation matrix Enter the DIFFPOOL formula (the following DIFFPOOL formulas all follow the same operation), (T in the upper right corner represents the matrix transpose operation).
[0170]
[0171]
[0172] Output: The updated graph structure obtained Updated data features ;
[0173] Step e:
[0174] Input: The result obtained in step d , Input to the GCN module:
[0175]
[0176] Output: Receive updated information ;
[0177] Step f:
[0178] Input: The result obtained in step d The result obtained in step e S3 obtains the allocation matrix Input the DIFFPOOL module;
[0179]
[0180] Output: The updated graph structure obtained Updated data features ;
[0181] Step g:
[0182] Input: The result obtained in step f , Input to the GCN module:
[0183]
[0184] Output: Receive updated information ;
[0185] The steps for the two sub-modules in S5 have ended.
[0186] Step h:
[0187] The result obtained in step c Step e yielded Step g yields splicing, and obtaining it from S1 Add them together to get ( ) represents the encoder output.
[0188] Step i:
[0189] Will = Repeat steps a through h, and finally obtain the result after step i. .
[0190] Step j:
[0191] In step i = Repeat steps a through h, and finally obtain the result after step j. .
[0192] S6, Decoder
[0193] The fully connected neural network is used, and the final fully connected layer is represented by the function F(x).
[0194] Input: The result obtained from S5 The input is fed into a fully connected layer, which is represented by the function F(x);
[0195]
[0196] Output: Final predicted value .
[0197] S7, Overall Loss Function
[0198] Get S6 S1 obtained S41 obtained Pre-set the maximum number of iterations, minimum threshold, and sensitivity coefficient. The loss function is calculated together, and the formula is:
[0199] .
[0200] After training with the maximum number of iterations, Training ends when the value is less than the minimum threshold.
[0201] S8, Evaluation Indicators
[0202] A method for predicting solar power generation based on hierarchical relationships is used, and the results are evaluated:
[0203] The evaluation indicators are MAE, MAPE, and RMSE, and the formulas are shown in claim 3, where, divide and sum These represent the predicted and actual values of solar power generation, respectively.
[0204] Example 1:
[0205] S1. Obtain Data
[0206] Input: Raw data, which is two-dimensional data. The vertical axis represents generator types (90 types of generators), and the horizontal axis represents time (from January 1, 2018 to December 31, 2020, referred to as historical time). The data includes daily historical generator power generation, the region (Region 1 to Region 20) for each generator type, the power station (Power Station 1 to Power Station 9), the historical power generation of the power station, historical inverter power, historical generator power, generator type (Type 1 to Type 5), and temperature (including historical daily temperature and the National Weather Service forecast for January 1, 2021). - Daily temperature as of January 31, 2021), sunshine (including historical sunshine, and the National Weather Service's forecast for daily sunshine from January 1 to January 31, 2021), humidity (including historical humidity data, and the National Weather Service's forecast for daily humidity from January 1 to January 31, 2021), solar irradiance, soil moisture, CO2, air pressure, wind direction, instantaneous wind speed, day of the week, month, year, season, whether it is a holiday (if it is not a holiday, this value should be empty; if it is a holiday, the type of holiday should be specified), and holiday type (national statutory holidays).
[0207] The original data is processed, data completion is performed, all historical times are aligned, and the data is integrated. The time for power generation tier data is represented by T, encompassing all historical times, with each value representing one day. This includes the number of generators N. All other features are collectively defined as D, referred to as the overall features, including: power generation of each generator at a historical time, its location, the power plant it belongs to, the power generation of each power plant at a historical time, historical inverter power, historical discharger power, generator type, historical daily temperature, and the predicted daily temperature for the next month based on national weather forecasts. Other comparable features include sunshine, humidity, historical daily weekdays, months, years, seasons, and holiday types. This data is defined as... The data dimensions are as follows: Figure 3 .exist Figure 3 The dashed line on the right represents the predicted power generation of each of the generators. , The output can be modified according to the requirements. For example, out=3 predicts the electricity usage for 3 days, but for now, out=1, so the final predicted usage will be... This represents the total power output of all generators in the coming day, i.e. .
[0208] Additionally, the following information is obtained from data X to extract the hierarchical structure: there are N generators, and each generator belongs to a specific region. Types of areas, which power station do these areas belong to? A type of power plant. For example... Figure 1 .
[0209] To facilitate the explanation of the formulas below, we perform a data slicing operation. Using NumPy, a commonly used tool for storing and processing large matrices, we obtain a portion of the data, but the numbers are sorted starting from 1. The slicing operation is left-closed and right-closed. For example, if B is a 5*2*3 tensor, B[2:4,:,1] means taking rows 2 to 4 of the first dimension of B, all columns of the second dimension, and the first page of the third dimension. This results in a 3*2*1 dimensional tensor.
[0210] S2. Sliding time window module.
[0211] Input: Input X into the sliding time window module, such as... Figure 4 In the diagram, the gray block represents a sliding block, moving in the X region with a step size p, which is the length of the window. Swipe right to obtain a time window. Each swipe right p times creates a time window, and the length of this time window is the window length. .
[0212] Output: Convert the time series data into multiple time window data. The final number of these time windows is c, and the i-th time window is... , , where c = T - ( -p).
[0213] The power generation corresponding to each time window is the power generation at a certain time node under that time length. For example, if the current time window is from day 5 to day 10, the power generation for 3 days (Tout=3) is the value for day 11 to day 13.
[0214] S3. Assignment Matrix Module.
[0215] The number of generators N and the number of regions are obtained from S1. Number of power plants .
[0216] Set the zero matrix Dimension N* The first dimension is the number of generators, and the second dimension is the number of regions. If in X, the i-th generator belongs to the j-th region: then The value in the i-th row and j-th column is set to 1 to obtain the distribution matrix. The number of power plants belonging to all regions is set as .
[0217] Set the zero matrix Dimensions * The first dimension is the number of regions, and the second dimension is the number of power plants. If in X, the i-th region belongs to the j-th power plant: then The value in the i-th row and j-th column is set to 1 to obtain the distribution matrix. .
[0218] The allocation matrix is derived from the hierarchical relationship of the generator data itself. , These two allocation matrices are used for the S6 module. The effectiveness of this module is shown in Table 3, Ablation Experiments, under the "Hierarchical Relationship" results.
[0219] S4, Time Map Learning Layer Module
[0220] S4 includes S41 and S42.
[0221] S41:
[0222] Matrix decomposition:
[0223] Two matrices are randomly generated, one being the node embedding matrix. Time embedding matrix k is the embedding dimension. Represents the embedding vector of the i-th node, each row Let represent the embedding vector for the j-th time window. The goal is to multiply the embedding vectors corresponding to the i-th node and the j-th time window to obtain the future power generation value for that time window. Therefore, we hope... The result obtained by multiplying is approximately equal to the total power generation of all generators in the j-th time window. The embedding matrix will be updated during learning, using an L2 regularization term (concept 7.1.1 in the book: Goodfellow I, Bengio Y, Courville A. Deep learning[M]. MITpress, 2016. hereinafter abbreviated as Deep learning) as the loss function to update the two matrices. For the i-th data point, the update formula is as follows:
[0224]
[0225] This represents the first loss function of the algorithm in this design, and the T in the upper right corner represents the matrix transpose in mathematical operations.
[0226] The effectiveness of this module is shown in Table 3, Ablation Experiments, under the "Random Embedding" results.
[0227] S42: Time-map learning layer:
[0228] Generators can experience various unforeseen events, leading to increased losses, machine malfunctions, and dynamic changes in lighting and temperature environments. Therefore, it's crucial to extract a time-varying adjacency matrix to capture the inter-generator and temporal characteristics.
[0229] The formula is as follows:
[0230]
[0231]
[0232]
[0233] It is the node characteristic matrix. It is the embedding vector of the j-th time window. , , , These are four parameters in a neural network, which are updated and set during training. The sensitivity coefficient controls the size of the adjacency matrix; a larger value results in a larger adjacency matrix. Subtraction and the ReLU function (refer to the concept of activation functions in "Machine Learning") are used to regularize the adjacency matrix, resulting in... It is the adjacency matrix corresponding to the i-th time window.
[0234] Use the selection function argtopk() to select the k largest positions from a vector:
[0235]
[0236] The resulting adjacency matrix To perform sparsity operations, for j=1…N, set the data at positions other than the first k maximum values to 0 to reduce computation:
[0237]
[0238] Finally, the adjacency matrix corresponding to the i-th time window is obtained. A dynamically changing graph structure was obtained, represented by an adjacency matrix. The effectiveness of this module is shown in Table 3, Ablation Experiments, under the "Graph Module" section.
[0239] S5. Encoder
[0240] The brackets in the following text represent data slicing operations. The tool Numpy (you can search "Numpy, slicing" on Baidu Encyclopedia) is used to obtain a portion of the data. The numbers are sorted starting from 1, and the slicing operation is left-closed and right-closed.
[0241] This structure contains two sub-modules:
[0242] Module 1: Temporal Convolution Module
[0243] Step a:
[0244] Input: What S1 obtained ,in Set up three updatable weight matrices , , ,
[0245] process:
[0246] use and three updatable weight matrices , , Multiplying them separately yields the results. matrix, matrix, Matrix. Softmax function reference (see page 159, section 6.29 of the book *Deep Learning* for formula and concept).
[0247]
[0248] Similarly All lines , ..., ,use matrix, matrix, Perform the same operations on the matrix as in the formula above;
[0249] Output: The output obtained is ,… To piece them together
[0250] Step b:
[0251] Input: The Z obtained in step a is input into a one-dimensional convolution conv1d (refer to the concept in 7.9.1 of the book Deep Learning). The result is input into the ReLU activation function (refer to the concept on page 150 of the book Deep Learning). Then, the result is input into the max pooling operation (refer to the concept in Chapter 9.2 of the book Deep Learning) to reduce dimensionality and storage requirements. Specifically, it is implemented as follows:
[0252]
[0253] Output: This represents the result of encoding time using the i-th time window obtained through the temporal convolution module;
[0254] Module 2: Hierarchical Aggregation Module
[0255] Step c:
[0256] Input: The structure of the generator dynamic change information graph obtained from S4. The output obtained from the first module of S51 Input into a graph convolutional network (GCN, all GCN formulas below follow the same operation). This is the weight matrix that needs to be trained, and the formula is as follows:
[0257]
[0258]
[0259] Output: Updated
[0260]
[0261] Step d:
[0262] Input: The structure of the generator dynamic change information graph obtained from S4. The update information obtained in step c for this stage S3 obtains the allocation matrix Enter the DIFFPOOL formula (the following DIFFPOOL formulas all follow the same operation), (T in the upper right corner represents the matrix transpose operation).
[0263]
[0264]
[0265] Output: The updated graph structure obtained Updated data features ;
[0266] Step e:
[0267] Input: The result obtained in step d , Input to the GCN module:
[0268]
[0269] Output: Receive updated information ;
[0270] The steps for the two sub-modules in S5 have ended.
[0271] Step f:
[0272] Input: The result obtained in step d The result obtained in step e S3 obtains the allocation matrix Input the DIFFPOOL module;
[0273]
[0274] Output: The updated graph structure obtained Updated data features ;
[0275] Step g:
[0276] Input: The result obtained in step f , Input to the GCN module:
[0277]
[0278] Output: Receive updated information ;
[0279] Step h:
[0280] The result obtained in step c Step e yielded Step g yields splicing, and obtaining it from S1 Add them together to get ( ) represents the encoder output.
[0281] Step i:
[0282] Will = Repeat steps a through h, and finally obtain the result after step i. .
[0283] Step j:
[0284] In step i = Repeat steps a through h, and finally obtain the result after step j. .
[0285] S6, Decoder
[0286] The fully connected neural network is used, and the final fully connected layer is represented by the function F(x).
[0287] Input: The result obtained from S5 The input is fed into a fully connected layer, which is represented by the function F(x);
[0288]
[0289] Output: Final predicted value .
[0290] S7, Overall Loss Function
[0291] Get S6 S1 obtained S41 obtained Pre-set the maximum number of iterations, minimum threshold, and sensitivity coefficient. The loss function is calculated together, and the formula is:
[0292] .
[0293] Set the maximum number of iterations to 500. After training... Training ends when the value is less than the minimum threshold of 0.01.
[0294] S8 Evaluation Indicators
[0295] A method for predicting solar power generation based on hierarchical relationships is used, and the results are evaluated:
[0296] The evaluation indicators are MAE, MAPE, and RMSE, and the formulas are shown in claim 3, where, divide and sum These represent the predicted and actual values of solar power generation, respectively.
[0297] Example 2:
[0298] This invention uses hierarchical data from the Kaggle platform, primarily used by developers and data scientists for hosting machine learning competitions, managing databases, and writing and sharing code, as experimental data. The data used is the M5 dataset from the Kaggle website. The M5 dataset includes five years of data from three states from 2011 to 2016. Due to the long timeframe, this invention extracts 305 leaf nodes from the data as the first set of experiments (E1), while using obtained private solar power generation data (E2) to verify the accuracy of the design method. The maximum number of iterations is set to 500, the minimum threshold to 0.01, and each experiment is trained 500 times, with 10 cross-validations.
[0299] 1) Evaluation Indicators: In this section, the present invention compares the amount of data used with the amount of data used in the original dataset, applying the following evaluation indicators: Mean Absolute Error (MAE), Mean Square Error (MSE), and Root Mean Square Error (RMSE). The length of the input time window for the experimental degree is also considered. and the length of future prediction time The corresponding numbers are: 24-3, 24-6, 24-12, 96-24, 96-48.
[0300] 2) Baseline algorithm:
[0301] LSTM: Long Short-Term Memory model based on RNN model, proposed to solve the gradient vanishing problem of RNN model.
[0302] DeepGLO
[13] : is a basic model for hierarchical data. (Hereinafter referred to as DGO)
[0303] MTGNN
[14] is a model that integrates graph learning layers, graph convolution, and temporal convolution.
[0304] Informer
[12] : is an improved model for predicting long-term series based on transformer.
[0305] 3) Experimental results:
[0306] Table 1 shows the E1 data results, and Table 2 shows the E2 data results. Enter the time window length. and the length of future prediction time The results are 12-3, 12-6, 96-24, and 96-48, respectively. Evaluation metrics used are MAE, MSE, and RMSE. The algorithm is compared with four baseline algorithms. Experimental results are the average of 10 independent replicates. Bold text in the tables represents the best results. Tables 1 and 2 show results that are superior to other models, except for a few data points where the results are close. This demonstrates the effectiveness of the algorithm and its ability to accurately predict hierarchical data.
[0307] Table 1: E1 Data Results
[0308]
[0309] Table 2: E2 Data Results
[0310]
[0311] 4) Comparative experiment:
[0312] In comparative experiments, this invention will demonstrate the importance of three modules: random embedding, hierarchical networks, and graph convolutional networks.
[0313] The first line shows all modules used;
[0314] The second row of random embedding means not using the features of the data itself. In the S4 module, this invention uses an approximation with the original generator data to update the matrix.
[0315] The third row does not use hierarchical relationships. The original data only contains generator type, time, daily historical generator power generation, region of each generator, power station, historical power generation of the power station, historical inverter power, historical generator power, generator type, solar irradiance, soil moisture, CO2, air pressure, wind direction, instantaneous wind speed and temperature, sunlight, humidity, day of the week, month, year, season, and holiday type (national statutory holidays). These data are merely the inherent characteristics. From the acquired data, this invention can determine that generators 2, 3, and 4 have similar temperatures, humidity, solar irradiance, soil moisture, CO2, air pressure, wind direction, and instantaneous wind speed and temperature in their vicinity, and the data shows they all belong to region 2. Similarly, generators belonging to regions 5 and 6 have similar temperatures, humidity, solar irradiance, soil moisture, CO2, air pressure, wind direction, and instantaneous wind speed and temperature in their vicinity, and the data shows they all belong to generator 6. This information is used to obtain the hierarchical relationship between N generators, N1 types of regions, and N2 types of power plants. The hierarchical structure is then extracted from S3, and finally, an allocation matrix is used. , In S6, an allocation matrix is used to aggregate the features of each generator node.
[0316] The fourth line does not use a graph structure; the graph structure that changes over time is obtained in S4 using an adjacency matrix. This indicates that the adjacency matrix was also used in S6 to learn the dynamic changes in generator data over time.
[0317] As shown in Table 3, the horizontal axis represents the output lengths of 3, 6, 24, and 48. The bolded results in the table represent the best performance, and the evaluation metric is MSE. The table shows that the overall algorithm framework performs best, demonstrating that the chosen methods of using the data update matrix, designing hierarchical modules, and designing the graph structure module are efficient and reasonable.
[0318] Table 3 Ablation Experiment
[0319]
[0320] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Those skilled in the art will understand that the examples of this application can be provided as methods or systems. Embodiments can be adopted in combination with software and hardware aspects, and the design method can be implemented on one or more computers containing computer-usable program code, and can be implemented using various computer languages. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in this invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of this invention.
Claims
1. A method for predicting solar power generation based on hierarchical relationships, characterized in that, Includes the following steps: S1, Data Processing; Obtain raw data: The raw data is two-dimensional data. The vertical axis is generator type, and the horizontal axis is historical time, daily historical generator power generation, region of each generator, power station, historical power generation of the power station, historical inverter power, historical discharger power, generator type, temperature, light intensity, humidity, solar irradiance, soil moisture, CO2, air pressure, wind direction, instantaneous wind speed, weekday, month, year, season, and holiday type. Use data completion to align all historical times and integrate the data; The definition of obtaining three-dimensional data is The time of the power generation tier data is represented by T, which includes all historical time, with each value being one day. N represents the number of generators. All other features are collectively defined as D, which is called the overall feature. Forecast usage This represents the total power generation of all generators in the coming day; it also retrieves hierarchical information: there are N generators, and each generator belongs to a specific region. Types of areas, which power station do these areas belong to? Power plants; S2, Sliding Time Window Module; Input: Input X into the sliding time window module; The process of the window module is as follows: In X, with a step size p, the window length... Slide to the right to obtain a time window; the step size is p slides to the right each time to obtain a time window; Output: Convert the time series data into multiple time window data, with a final number of time windows of c, and the i-th time window being c. , , where c = T - ( -p); where the power generation corresponding to each time window is the power generation at the next time node of that time length; S3, Allocation Matrix Module; The number of generators N and the number of regions are obtained from S1. Number of power plants ; Set the zero matrix Dimension N* The first dimension is the number of generators, and the second dimension is the number of regions. If in X, the i-th generator belongs to the j-th region: then The value in the i-th row and j-th column is set to 1 to obtain the distribution matrix. The number of power plants belonging to all regions is set as ; Set the zero matrix Dimensions * The first dimension is the number of regions, and the second dimension is the number of power plants. If in X, the i-th region belongs to the j-th power plant: then The value in the i-th row and j-th column is set to 1 to obtain the distribution matrix. ; The allocation matrix is derived from the hierarchical relationship of the generator data itself. , ; S4, Time-Graph Learning Layer Module; Including steps S41 and S42; Step S41, matrix decomposition: Two matrices are randomly generated, one being the node embedding matrix. Time embedding matrix k is the embedding dimension. Represents the embedding vector of the i-th node, each row This represents the embedding vector for the j-th time window; multiplying the embedding vectors corresponding to the i-th node and the j-th time window yields the value of the future power generation for that time window. The result obtained by multiplying is approximately equal to the total power generation of all generators in the j-th time window. The embedding matrix will be updated during learning, using L2 regularization as the loss function to update both matrices. For the i-th data point, the update formula is as follows: This represents the first loss function of the algorithm in this design. The T in the upper right corner indicates matrix transpose in mathematical operations; Step S42, the time-map learning layer, is implemented based on the following formula: It is the node characteristic matrix. It is the embedding vector of the j-th time window. , , , These are four parameters in a neural network, which are updated and set during training. Sensitivity coefficient; Using the selection function argtopk(), S42 is obtained Select the k largest positions: The resulting adjacency matrix To perform sparsity operations, for j=1…N, set the data at positions other than the first k maximum values to 0 to reduce computation: Finally, the adjacency matrix corresponding to the i-th time window is obtained. This resulted in a graph structure that changes dynamically over time. S5, encoder, includes two functional modules Module 1: Temporal Convolution Module Step a: Original data: obtained by S1 ,in Set up three updatable non-zero weight matrices. , , , ; Specific process: use and three updatable weight matrices , , Multiplying them separately yields the results. matrix, matrix, matrix; Similarly All lines , ..., ,use matrix, matrix, Perform the same operations on the matrix as in the formula above; Output: Get ,… To piece them together Step b: Input: Input the Z obtained in step a into a one-dimensional convolution conv1d, input the result into the ReLU activation function, and then input the result into the max pooling operation; specifically implemented as follows: Output: This represents the result of encoding time using the i-th time window obtained through the temporal convolution module; Module 2: Hierarchical Aggregation Module Step c: Input: the result obtained from S4 , and the module obtained The input is fed into a graph convolutional network. This is the weight matrix that needs to be trained, and the formula is as follows: Output: Updated The GCN formulas used in the following processes are all operated on the same basis; Step d: Input: Get S4 The result obtained in step c The allocation matrix obtained by S3 Enter the DIFFPOOL formula; Output: The updated graph structure obtained Updated data features ; Step e: Input: The result obtained in step d , Input to, via GCN module: Output: Receive updated information ; After completing the two functional modules in S5, the following steps should be implemented: Step f: Input: The result obtained in step d The result obtained in step e S3 obtains the allocation matrix Input the DIFFPOOL module; Output: The updated graph structure obtained Updated data features ; Step g: Input: The result obtained in step f , Input to the GCN module: Output: Receive updated information ; Step h: The result obtained in step c Step e yielded Step g yields splicing, and obtaining it from S1 Add them together to get ( () represents the encoder output. Step i: Will = Repeat steps a through h, and finally obtain the result after step i. ; Step j: In step i = Repeat steps a through h, and finally obtain the result after step j. ; S6, Decoder The decoder uses a fully connected neural network, represented by the function F(x). Input: the result obtained from S5 The input is fed into a fully connected layer, which is represented by the function F(x); Output: Final predicted value .
2. The method for predicting solar power generation based on hierarchical relationships according to claim 1, characterized in that, In step S1, the temperature includes historical daily temperatures and the daily temperatures predicted for the next month by the National Weather Service; the illumination includes historical illumination and the daily illumination predicted for the next month by the National Weather Service; and the humidity includes historical humidity data and the daily humidity predicted for the next month by the National Weather Service.
3. The method for predicting solar power generation based on hierarchical relationships according to claim 1, through evaluation of the results: Get S6 S1 obtained S41 obtained Pre-set the maximum number of iterations, minimum threshold, and sensitivity coefficient. The loss function is calculated together, and the formula is: After training with the maximum number of iterations, Training ends when the value is less than the minimum threshold. The evaluation indicators are MAE, MAPE, and RMSE, and the formulas are as follows: In the formula, and These represent the predicted and actual values of solar power generation, respectively.