Regional photovoltaic output prediction method, device and equipment in high-temperature weather and storage medium
By clustering and meteorological data analysis of photovoltaic power stations, a photovoltaic power generation power prediction model is generated under high temperature weather, which solves the problem of photovoltaic power prediction in high temperature weather, and improves prediction accuracy and power system stability.
Patent Information
- Application Number
- CN202411457140.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2024-12-13
AI Technical Summary
The existing technology lacks regional photovoltaic power prediction methods for high-temperature weather, which makes it difficult for the power grid to maintain balance between power and load in high-temperature weather, affecting the stable operation of the power system.
By clustering the photovoltaic power stations in the target power station area, dividing them into several convergence areas, and selecting representative power stations from each convergence area to obtain meteorological forecast data and historical photovoltaic power generation power, using LightGBM algorithm and Pearson correlation coefficient and other methods Generation success rate prediction model, predicts photovoltaic power generation power in high temperature weather.
It improves the accuracy of regional photovoltaic power prediction in high temperature weather, provides reliable decision-making basis for the power dispatching department, enhances the power grid's ability to absorb new energy, and ensures the stable operation of the power system.
Smart Images

Figure CN119134332A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of renewable energy power generation prediction, and in particular to a method, device, equipment and storage medium for predicting regional photovoltaic output under high temperature weather. Background Art
[0002] In recent years, the installed capacity of photovoltaic power generation has grown rapidly, and the proportion of photovoltaic power generation in the country's total annual power generation has become increasingly higher. However, due to the influence of complex and changeable meteorological factors, the output power of photovoltaic power generation has the characteristics of randomness, volatility and intermittency. Especially in hot weather, the output of photovoltaic stations will fluctuate in a short period of time, making it difficult for the power system to maintain the balance of power supply and load in real time, which poses a huge challenge to the power grid. Therefore, it is particularly important to accurately predict the power of photovoltaic power stations under hot weather. Predicting the photovoltaic output power under hot weather can provide a reliable decision-making basis for the power dispatching department, improve the power grid's ability to absorb new energy such as solar energy, and ensure the stable operation of the power system. In recent years, although there have been a lot of related research on regional power prediction, there are few studies on regional photovoltaic power prediction under hot weather, and there is a lack of regional photovoltaic power prediction methods under hot weather. Summary of the invention
[0003] The present invention provides a method, device, equipment and storage medium for predicting regional photovoltaic output under high temperature weather, so as to solve the technical problem that the prior art lacks means for predicting regional photovoltaic power under high temperature weather.
[0004] In order to solve the above technical problems, an embodiment of the present invention provides a method for predicting regional photovoltaic output under high temperature weather, comprising:
[0005] Clustering the photovoltaic power stations in the target power station area, dividing the target power station area into several aggregation areas, and selecting a photovoltaic power station in each aggregation area as a representative power station;
[0006] Acquire weather forecast data of each representative power station, and obtain the high temperature conditions of each representative power station at a future moment according to the weather forecast data; wherein the high temperature conditions are: whether the representative power station will experience high temperature weather at each future moment;
[0007] Input the weather forecast data and high temperature conditions of each representative power station into a preset power prediction model of the corresponding representative power station, so that the power prediction model predicts the photovoltaic power generation power of the representative power station under future high temperature weather according to the weather forecast data and high temperature conditions, and outputs the predicted photovoltaic power generation power of the corresponding representative power station under future high temperature weather;
[0008] According to the predicted photovoltaic power generation power of each representative power station under future high temperature weather, the predicted photovoltaic power generation power of each convergence area under future high temperature weather is calculated, and then the sum of the predicted photovoltaic power generation power of all convergence areas under future high temperature weather is taken as the total predicted photovoltaic power generation power of the target power station area under future high temperature weather.
[0009] As a preferred solution, the photovoltaic power stations in the target power station area are clustered to divide the target power station area into several convergence areas, including:
[0010] Obtain the historical photovoltaic power generation power of each photovoltaic power station in the target power station area;
[0011] Determine the number of clusters in the target power station area according to a preset elbow rule, and randomly select photovoltaic power stations with the same number as the number of clusters as centroids;
[0012] According to the historical photovoltaic power generation of each photovoltaic power station, the Euclidean distance from each photovoltaic power station to each centroid is calculated, and then each photovoltaic power station is assigned to the cluster where the centroid corresponding to the minimum Euclidean distance is located, and the centroid of each cluster is updated to the average value of all photovoltaic power stations in the cluster until the cluster assignment results of all photovoltaic power stations no longer change, and the same number of clusters as the number of clusters are obtained, and each cluster is used as the convergence area.
[0013] As a preferred solution, the calculation formula of the Euclidean distance is:
[0014]
[0015] x={x1,x2,...,xm};
[0016] y={y1,y2,...,y m};
[0017] Among them, x represents the historical photovoltaic power generation time series of the photovoltaic power station, y represents the historical photovoltaic power generation time series of the photovoltaic power station as the centroid, and x i represents the historical photovoltaic power generation value of the photovoltaic power station at the i-th moment, y i represents the historical photovoltaic power generation value of the photovoltaic power station as the centroid at the i-th moment, and m represents the length of the time series.
[0018] As a preferred solution, the step of selecting a photovoltaic power station in each convergence area as a representative power station includes:
[0019] According to the historical photovoltaic power generation of each photovoltaic power station, the total historical photovoltaic power generation of each convergence area is calculated;
[0020] For each convergence area, the Pearson correlation coefficient between the historical photovoltaic power generation of each photovoltaic power station in the convergence area and the total historical photovoltaic power generation of the convergence area is calculated, and the photovoltaic power station with the largest Pearson correlation coefficient with the total historical photovoltaic power generation of the convergence area is taken as the representative power station of the convergence area.
[0021] As a preferred solution, the generation of the power prediction model includes:
[0022] Obtaining historical photovoltaic power generation and historical weather forecast data of each representative power station, and obtaining historical high temperature conditions of each representative power station at historical moments according to the historical weather forecast data;
[0023] Generate a corresponding model training set according to the historical photovoltaic power generation, historical weather forecast data and historical high temperature conditions;
[0024] Perform grid search on the preset GridSearchCV library to obtain the corresponding optimal model parameters;
[0025] According to the model training set, the optimal model parameters and the preset LightGBM algorithm, the optimal model parameters are used as the model parameters of the preset LightGBM regression model, the historical meteorological forecast data and historical high temperature conditions of each representative power station are used as input, and the historical photovoltaic power generation power of the corresponding representative power station is used as output. The LightGBM regression model is trained to obtain the corresponding power prediction model.
[0026] As a preferred solution, the grid search is performed on the preset GridSearchCV library to obtain the corresponding optimal model parameters, including:
[0027] Define a parameter space;
[0028] Generate all hyperparameter combinations corresponding to the parameter space;
[0029] The model training set is divided into a new training set and a validation set according to a preset ratio. For each hyperparameter combination, the LightGBM regression model is trained according to the hyperparameter combination and the training set, and the negative mean square error under the hyperparameter combination is calculated according to the validation set. The hyperparameter combination with the largest negative mean square error is selected as the corresponding optimal model parameter.
[0030] As a preferred solution, the predicted photovoltaic power generation power of each convergence area under future high temperature weather is calculated based on the predicted photovoltaic power generation power of each representative power station under future high temperature weather, including:
[0031] The predicted photovoltaic power generation power of each representative power station under future high temperature weather is input into a preset convergence area power calculation model, so that the convergence area power calculation model calculates the predicted photovoltaic power generation power of the convergence area under future high temperature weather according to the predicted photovoltaic power generation power of each representative power station under future high temperature weather, and outputs the predicted photovoltaic power generation power of each convergence area under future high temperature weather.
[0032] On the basis of the above-mentioned embodiment, another embodiment of the present invention provides a regional photovoltaic output prediction device under high temperature weather, comprising: a target power station regional clustering module, a weather forecast data acquisition module, a representative power station photovoltaic power generation prediction module, and a total predicted photovoltaic power generation calculation module;
[0033] The target power station area clustering module is used to cluster the photovoltaic power stations in the target power station area, divide the target power station area into a number of convergence areas, and select a photovoltaic power station in each convergence area as a representative power station;
[0034] The weather forecast data acquisition module is used to acquire the weather forecast data of each representative power station, and obtain the high temperature conditions of each representative power station at a future moment according to the weather forecast data; wherein the high temperature condition is: whether the representative power station is experiencing high temperature weather at each future moment;
[0035] The representative power station photovoltaic power generation prediction module is used to input the weather forecast data and high temperature conditions of each representative power station into a preset power prediction model of the corresponding representative power station, so that the power prediction model predicts the photovoltaic power generation power of the representative power station under future high temperature weather according to the weather forecast data and high temperature conditions, and outputs the predicted photovoltaic power generation power of the corresponding representative power station under future high temperature weather;
[0036] The total predicted photovoltaic power calculation module is used to calculate the predicted photovoltaic power generation of each convergence area under future high temperature weather based on the predicted photovoltaic power generation power of each representative power station under future high temperature weather, and then calculate the sum of the predicted photovoltaic power generation power of all convergence areas under future high temperature weather as the total predicted photovoltaic power generation power of the target power station area under future high temperature weather.
[0037] Based on the above embodiments, another embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the method for predicting regional photovoltaic output under high temperature weather described in the above embodiments of the invention is implemented.
[0038] Based on the above embodiments, another embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the regional photovoltaic output prediction method under high temperature weather described in the above invention embodiment.
[0039] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0040] The present invention provides a method for predicting regional photovoltaic output under high temperature weather, clustering each photovoltaic power station in the target power station area, dividing the target power station area into several convergence areas, and selecting a photovoltaic power station as a representative power station in each convergence area; obtaining meteorological forecast data of each representative power station, and obtaining the high temperature conditions of each representative power station at a future moment according to the meteorological forecast data; inputting the meteorological forecast data and the high temperature conditions of each representative power station into a preset power prediction model of the corresponding representative power station, so that the power prediction model predicts the photovoltaic power generation power of the representative power station under future high temperature weather according to the meteorological forecast data and the high temperature conditions, and outputs the predicted photovoltaic power generation power of the corresponding representative power station under future high temperature weather; according to the predicted photovoltaic power generation power of each representative power station under future high temperature weather, the predicted photovoltaic power generation power of each convergence area under future high temperature weather is calculated, and then the sum of the predicted photovoltaic power generation power of all convergence areas under future high temperature weather is used as the total predicted photovoltaic power generation power of the target power station area under future high temperature weather. Through the present invention, the regional photovoltaic power under high temperature weather can be predicted, thereby improving the accuracy of regional photovoltaic power prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a flow chart of a method for predicting regional photovoltaic output under high temperature weather provided by one embodiment of the present invention;
[0042] Figure 2 It is a schematic diagram of the power prediction steps under hot weather;
[0043] Figure 3 is a schematic diagram of the elbow with k as the x-axis and SSE as the y-axis;
[0044] Figure 4 It is a structural schematic diagram of a regional photovoltaic output prediction device under high temperature weather provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0047] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0048] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0049] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0050] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).
[0051] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0052] Embodiment 1
[0053] Please refer to Figure 1 , is a flow chart of a method for predicting regional photovoltaic output under high temperature weather provided by an embodiment of the present invention, comprising the following specific steps:
[0054] S1. Clustering the photovoltaic power stations in the target power station area, dividing the target power station area into several aggregation areas, and selecting a photovoltaic power station in each aggregation area as a representative power station;
[0055] Preferably, clustering the photovoltaic power stations in the target power station area and dividing the target power station area into a number of convergence areas includes: obtaining the historical photovoltaic power generation power of each photovoltaic power station in the target power station area; determining the number of clusters in the target power station area according to a preset elbow rule, and randomly taking the photovoltaic power stations with the same number as the number of clusters as the centroids; calculating the Euclidean distance from each photovoltaic power station to each centroid according to the historical photovoltaic power generation power of each photovoltaic power station, and then allocating each photovoltaic power station to the cluster where the centroid corresponding to the minimum Euclidean distance is located, and updating the centroid of each cluster to the average value of all photovoltaic power stations in the cluster until the cluster allocation results of all photovoltaic power stations no longer change, and obtaining the same number of clusters as the number of clusters, and taking each cluster as the convergence area.
[0056] Preferably, the calculation formula of the Euclidean distance is:
[0057]
[0058] x={x1,x2,...,xm};
[0059] y={y1,y2,...,y m};
[0060] Among them, x represents the historical photovoltaic power generation time series of the photovoltaic power station, y represents the historical photovoltaic power generation time series of the photovoltaic power station as the centroid, and x i represents the historical photovoltaic power generation value of the photovoltaic power station at the i-th moment, y irepresents the historical photovoltaic power generation value of the photovoltaic power station as the centroid at the i-th moment, and m represents the length of the time series.
[0061] Preferably, the method of selecting a photovoltaic power station in each convergence area as a representative power station includes: calculating the total historical photovoltaic power generation power of each convergence area based on the historical photovoltaic power generation power of each photovoltaic power station; for each convergence area, calculating the Pearson correlation coefficient between the historical photovoltaic power generation power of each photovoltaic power station in the convergence area and the total historical photovoltaic power generation power of the convergence area, and taking the photovoltaic power station with the largest Pearson correlation coefficient with the total historical photovoltaic power generation power of the convergence area as the representative power station of the convergence area.
[0062] Specifically, in order to address the problem that the prior art lacks a means of regional photovoltaic power prediction under high temperature weather, the present invention clusters the photovoltaic power stations in the target power station area through the K-means algorithm to obtain multiple convergence areas, and then calculates the correlation coefficient on this basis to obtain the representative station in each area. For the historical forecast meteorological data of each representative station, according to relevant standards, the time when high temperatures occurred in history is screened out to obtain high temperature identification results. Based on this result, the LightGBM algorithm is used to give a power prediction model for the representative station under high temperature conditions, and then the univariate linear regression is used according to the output prediction results of each representative station under high temperature to obtain the power prediction model of each convergence area under high temperature. Finally, the output results of each convergence area are added to obtain the regional output prediction under high temperature. Please refer to Figure 2 , is a schematic diagram of power prediction steps under high temperature weather. The specific steps are as follows:
[0063] 1. Data Acquisition and Data Preprocessing
[0064] (1) Data acquisition: This includes two data sources: one is the historical photovoltaic power generation data and historical weather forecast data of each photovoltaic power station, and the other is the weather forecast data of each photovoltaic power station;
[0065] (2) Data preprocessing: Data preprocessing is the normalization of two data sources, including the processing of data granularity and missing values, to facilitate subsequent model processing.
[0066] The preprocessing of the measured power data of each station is mainly to process the two types of data into data with a time resolution of 15 minutes and unify the units of the two types of data from different stations. At the same time, data quality control is required, data with poor quality are deleted, and missing values are filled.
[0067] The preprocessing of weather forecast data is to interpolate it to 15 minutes. At the same time, data quality control is required to exclude data of poor quality.
[0068] 2. Selection of representative power stations
[0069] Representative site selection model: The input x of this model is the historical power of each photovoltaic power station in the region, and the output y is the selection result of the representative site. The specific steps are as follows:
[0070] 1. According to the k-means clustering algorithm, multiple convergence areas are obtained:
[0071] The historical power of each photovoltaic station is merged according to time, clustered using the k-means algorithm, and the number of clusters is determined according to the elbow rule.
[0072] The main process of the k-means algorithm is as follows: First, randomly determine k initial photovoltaic sites as centroids. Then, for each site in the data set, calculate the Euclidean distance to each centroid, and assign it to the cluster corresponding to the centroid with the smallest Euclidean distance. After completing the above steps, update the centroid of each cluster to the average value of all sites in the cluster. Repeat the above method (calculate centroid-assign-recalculate) until the cluster allocation results of all photovoltaic sites no longer change. The multiple clusters obtained are multiple convergence areas.
[0073] The Euclidean distance formula is as follows:
[0074] Assume x = {x1, x2, ..., x m},y={y1,y2,...,y m}, then the Euclidean distance between x and y
[0075] In the above formula, x represents the historical photovoltaic power generation time series of the photovoltaic power station, y represents the historical photovoltaic power generation time series of the photovoltaic power station as the centroid, and x i represents the historical photovoltaic power generation value of the photovoltaic power station at the i-th moment, y i represents the historical photovoltaic power generation value of the photovoltaic power station as the centroid at the i-th moment, and m represents the length of the time series.
[0076] The number of clusters k is determined according to the elbow rule. The idea of the elbow rule is as follows:
[0077] Increase the number of clusters k from 2 to n-1, and calculate the relationship between SSE and the number of cluster categories k. The SSE formula is as follows:
[0078]
[0079] Where k represents the number of clusters, x represents the sample data points, and μ j represents the centroid of the jth cluster, c j Represents the sample data set contained in the jth cluster.
[0080] Please refer to Figure 3 , is a schematic diagram of the elbow with k as the x-axis and SSE as the y-axis. Figure 3 It can be seen that as the value of k increases, SSE will first decrease rapidly. When k takes a certain value, the change of SSE tends to be gentle. Even if k increases again, the value of SSE will not change significantly. The elbow diagram drawn at this time is like a person's elbow. The critical point at the elbow is taken as the optimal number of clusters determined by the elbow rule, such as Figure 3 The optimal number of clusters shown is 3.
[0081] 2. For each convergence area, the Pearson correlation coefficients between all stations in the area and the total output of the area are calculated, and the stations with the largest correlation coefficient with the total output of the convergence area are selected as representative stations of the convergence area.
[0082] S2. Obtaining weather forecast data of each representative power station, and obtaining the high temperature conditions of each representative power station at a future moment according to the weather forecast data; wherein the high temperature conditions are: whether the representative power station will experience high temperature weather at each future moment;
[0083] 3. High temperature identification
[0084] Its input x is the weather forecast data of the representative station, and the output y is the high temperature recognition result of the representative station, that is, whether high temperature weather occurs at the corresponding time. The specific steps are as follows:
[0085] According to the "Meteorological Disaster Warning Signal Release and Dissemination Method (implemented in June 2007)" and the Extreme High Temperature Monitoring Index (QX / T280-2015), a temperature greater than 35 degrees Celsius is defined as high temperature. The 2-meter temperature in the weather forecast data is used as the input x, and y is the recognition result. If x is greater than 35 degrees Celsius, it means that high temperature occurs at this moment, and the corresponding y value is 1, otherwise it is 0.
[0086] S3, inputting the weather forecast data and high temperature conditions of each representative power station into a preset power prediction model of the corresponding representative power station, so that the power prediction model predicts the photovoltaic power generation power of the representative power station under future high temperature weather according to the weather forecast data and high temperature conditions, and outputs the predicted photovoltaic power generation power of the corresponding representative power station under future high temperature weather;
[0087] Preferably, the generation of the power prediction model includes: obtaining the historical photovoltaic power generation power and historical weather forecast data of each representative power station, and obtaining the historical high temperature conditions of each representative power station at historical moments based on the historical weather forecast data; generating a corresponding model training set based on the historical photovoltaic power generation power, historical weather forecast data and historical high temperature conditions; performing a grid search on the preset GridSearchCV library to obtain the corresponding optimal model parameters; based on the model training set, the optimal model parameters and the preset LightGBM algorithm, using the optimal model parameters as the model parameters of the preset LightGBM regression model, taking the historical weather forecast data and historical high temperature conditions of each representative power station as input, and taking the historical photovoltaic power generation power of the corresponding representative power station as output, training the LightGBM regression model to obtain the corresponding power prediction model.
[0088] Preferably, the grid search is performed on the preset GridSearchCV library to obtain the corresponding optimal model parameters, including: defining a parameter space; generating all hyperparameter combinations corresponding to the parameter space; dividing the model training set according to a preset ratio into a new training set and a validation set, and for each hyperparameter combination, the LightGBM regression model is trained according to the hyperparameter combination and the training set, and the negative mean square error under the hyperparameter combination is calculated according to the validation set, and the hyperparameter combination with the largest negative mean square error is selected as the corresponding optimal model parameter.
[0089] 4. Power prediction model for representative stations under high temperature weather
[0090] A LightGBM regression model with root mean square error as an indicator is established based on weather forecast data, high temperature identification results and measured power. Its input x is weather forecast data and high temperature identification results, and its output y is the power prediction result of a representative station under high temperature weather. The specific steps are as follows:
[0091] 1. Data processing: Combine the weather forecast data, high temperature recognition results and measured power into a data set according to time, and only retain the data with a value of 1 in the high temperature recognition result to obtain a new data set X. Divide the data set X into a training set D1 and a test set according to a certain ratio.
[0092] 2. Model training: Use the GridSearchCV library in Python to perform grid search to find the optimal parameters of the Lightgbm algorithm, and set the optimal parameters as the parameters for training the Lightgbm model. Then call the Python library LightGBM algorithm, input the training set data into the algorithm, and evaluate the model effect on the test set.
[0093] Among them, the grid search exhaustively searches all possible combinations in the given parameter space, and then selects the best parameter combination based on the negative mean square error. The larger the negative mean square error, the better. The negative mean square error formula is The detailed steps of grid search are as follows:
[0094] (1) Define parameter space param_grid = {'n_estimators':[100,300,500],'max_depth':[6,8,10]};
[0095] (2) Generate all possible hyperparameter combinations. For the above example, there are 3×3=9 combinations, including {'n_estimators':100,'max_depth':6}, {'n_estimators':100,'max_depth':8}, {'n_estimators':100,'max_depth':10}, {'n_estimators':300,'max_depth':6}, etc.
[0096] (3) The training set data D1 is divided into a new training set D2 and a validation set according to a certain ratio. Each hyperparameter combination is applied to the Lightgbm model. D2 is used for training, and the validation set is used to calculate the negative mean square error under each parameter. The parameter with the largest negative mean square error is selected as the optimal parameter.
[0097] Among them, the Lightgbm algorithm is a machine learning algorithm based on the gradient boosted decision tree (GBDT). In the regression task, the prediction result of LightGBM is generated by the weighted sum of a series of decision trees. GBDT is an iterative decision tree algorithm that corrects the errors of the previous tree by gradually adding new trees. Each tree learns the residual of the previous tree (that is, the difference between the true value and the predicted value) and optimizes the model by minimizing the loss function. The workflow of LightGBM is as follows:
[0098] (1) Initialization: At the beginning, a constant is usually used as the initial prediction value. This constant is usually the mean of y in the training set. Here, the initial prediction value is set to
[0099] (2) Iteration: In each iteration, LightGBM calculates the residual between the current prediction and the true value. A new decision tree is trained by minimizing the root mean square error, which fits these residuals as best as possible. The new tree is added to the model to form a new prediction.
[0100] After each iteration, the predicted value is updated as:
[0101]
[0102] in: is the predicted value after the tth iteration; is the predicted value after the t-1th iteration; η is the learning rate, which is used to control the contribution of each tree; f t (x) is the decision tree obtained by training at the tth iteration.
[0103] (3) Final prediction: After T iterations, the final prediction value is:
[0104]
[0105] The root mean square error formula is as follows:
[0106]
[0107] Where n is the number of samples, P Mi is the actual power at time i, P Pi is the predicted power at time i. The smaller the root mean square error RMSE is, the better.
[0108] S4. Based on the predicted photovoltaic power generation power of each representative power station under future high temperature weather, the predicted photovoltaic power generation power of each convergence area under future high temperature weather is calculated, and then the sum of the predicted photovoltaic power generation power of all convergence areas under future high temperature weather is taken as the total predicted photovoltaic power generation power of the target power station area under future high temperature weather.
[0109] Preferably, the predicted photovoltaic power generation power of each convergence area under future high temperature weather is calculated based on the predicted photovoltaic power generation power of each representative power station under future high temperature weather, including: inputting the predicted photovoltaic power generation power of each representative power station under future high temperature weather into a preset convergence area power calculation model, so that the convergence area power calculation model calculates the predicted photovoltaic power generation power of the convergence area under future high temperature weather according to the predicted photovoltaic power generation power of each representative power station under future high temperature weather, and outputs the predicted photovoltaic power generation power of each convergence area under future high temperature weather.
[0110] 5. Regional Power Prediction Model
[0111] Its input x is the result of the power prediction model of the representative station under high temperature weather, and the output y is the result of the regional power prediction. The specific steps are as follows:
[0112] 1. Taking the historical measured power of each representative station as x, the historical measured output of all photovoltaic stations in the convergence area as y, and the mean square error as the indicator, a univariate linear regression algorithm is used to establish a power prediction model for multiple convergence areas. The model establishment process takes convergence area A and its representative station a as an example:
[0113] (1) Data processing: The historical measured power of the representative station is combined with the historical measured power of the aggregation area A to obtain a new data set D, where the historical measured power of the representative station is x and the historical measured power of the aggregation area A is y.
[0114] (2) Divide the data set D into a training set and a test set according to a certain ratio. The data of the training set is trained using the univariate linear regression method with the mean square error as the objective function. The univariate linear regression model expression is f(x i )=kx i +b, mean square error Find k and b by minimizing the mean square error:
[0115]
[0116]
[0117] in For x i Taking the convergence area A and its representative station a as an example, since there is only one representative station in each area, is the historical average power of the representative station a at each moment, where x i is the power value of the representative station a at the i-th moment in history, where i represents the moment.
[0118] Substitute the obtained k and b into the formula f(x i )=kx i +b, a univariate linear regression equation can be obtained, namely, the power prediction model of the convergence area A.
[0119] 2. Finally, the power prediction results of multiple convergence areas in step a are accumulated to obtain the regional power prediction result.
[0120] Embodiment 2
[0121] Please refer to Figure 4 , is a schematic diagram of the structure of a regional photovoltaic output prediction device under high temperature weather provided by an embodiment of the present invention, the device comprising: a target power station area clustering module, a weather forecast data acquisition module, a representative power station photovoltaic power generation prediction module and a total predicted photovoltaic power generation calculation module;
[0122] The target power station area clustering module is used to cluster the photovoltaic power stations in the target power station area, divide the target power station area into a number of convergence areas, and select a photovoltaic power station in each convergence area as a representative power station;
[0123] The weather forecast data acquisition module is used to acquire the weather forecast data of each representative power station, and obtain the high temperature conditions of each representative power station at a future moment according to the weather forecast data; wherein the high temperature condition is: whether the representative power station is experiencing high temperature weather at each future moment;
[0124] The representative power station photovoltaic power generation prediction module is used to input the weather forecast data and high temperature conditions of each representative power station into a preset power prediction model of the corresponding representative power station, so that the power prediction model predicts the photovoltaic power generation power of the representative power station under future high temperature weather according to the weather forecast data and high temperature conditions, and outputs the predicted photovoltaic power generation power of the corresponding representative power station under future high temperature weather;
[0125] The total predicted photovoltaic power calculation module is used to calculate the predicted photovoltaic power generation of each convergence area under future high temperature weather based on the predicted photovoltaic power generation power of each representative power station under future high temperature weather, and then calculate the sum of the predicted photovoltaic power generation power of all convergence areas under future high temperature weather as the total predicted photovoltaic power generation power of the target power station area under future high temperature weather.
[0126] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0127] Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0128] Embodiment 3
[0129] Accordingly, an embodiment of the present invention provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for predicting regional photovoltaic output under high temperature weather as described in the above-mentioned embodiment of the invention is implemented.
[0130] The electronic device may be a computing device such as a desktop computer, a notebook, a palm computer, a cloud server, etc. The device may include, but is not limited to, a processor and a memory.
[0131] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the device, and various interfaces and lines are used to connect various parts of the entire device.
[0132] Embodiment 4
[0133] Accordingly, an embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the regional photovoltaic output prediction method under high temperature weather described in the above-mentioned embodiment of the invention.
[0134] The memory can be used to store the computer program, and the processor realizes various functions of the device by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0135] The storage medium is a computer-readable storage medium, and the computer program is stored in the computer-readable storage medium. When the computer program is executed by the processor, the steps of each method embodiment described above can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0136] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for predicting regional photovoltaic output under high temperature weather, characterized in that: include: Clustering the photovoltaic power stations in the target power station area, dividing the target power station area into several aggregation areas, and selecting a photovoltaic power station in each aggregation area as a representative power station; Acquire weather forecast data of each representative power station, and obtain the high temperature conditions of each representative power station at a future moment according to the weather forecast data; wherein the high temperature conditions are: whether the representative power station will experience high temperature weather at each future moment; Input the weather forecast data and high temperature conditions of each representative power station into a preset power prediction model of the corresponding representative power station, so that the power prediction model predicts the photovoltaic power generation power of the representative power station under future high temperature weather according to the weather forecast data and high temperature conditions, and outputs the predicted photovoltaic power generation power of the corresponding representative power station under future high temperature weather; According to the predicted photovoltaic power generation power of each representative power station under future high temperature weather, the predicted photovoltaic power generation power of each convergence area under future high temperature weather is calculated, and then the sum of the predicted photovoltaic power generation power of all convergence areas under future high temperature weather is taken as the total predicted photovoltaic power generation power of the target power station area under future high temperature weather.
2. The method for predicting regional photovoltaic output under high temperature weather according to claim 1, characterized in that: The photovoltaic power stations in the target power station area are clustered to divide the target power station area into several convergence areas, including: Obtain the historical photovoltaic power generation power of each photovoltaic power station in the target power station area; Determine the number of clusters in the target power station area according to a preset elbow rule, and randomly select photovoltaic power stations with the same number as the number of clusters as centroids; According to the historical photovoltaic power generation of each photovoltaic power station, the Euclidean distance from each photovoltaic power station to each centroid is calculated, and then each photovoltaic power station is assigned to the cluster where the centroid corresponding to the minimum Euclidean distance is located, and the centroid of each cluster is updated to the average value of all photovoltaic power stations in the cluster until the cluster assignment results of all photovoltaic power stations no longer change, and the same number of clusters as the number of clusters are obtained, and each cluster is used as the convergence area.
3. The method for predicting regional photovoltaic output under high temperature weather as claimed in claim 2, characterized in that: The calculation formula of the Euclidean distance is: x={x1,x2,...,x m }; y={y1,y2,...,y m }; Among them, x represents the historical photovoltaic power generation time series of the photovoltaic power station, y represents the historical photovoltaic power generation time series of the photovoltaic power station as the centroid, and x i represents the historical photovoltaic power generation value of the photovoltaic power station at the i-th moment, y i represents the historical photovoltaic power generation value of the photovoltaic power station as the centroid at the i-th moment, and m represents the length of the time series.
4. The method for predicting regional photovoltaic output under high temperature weather as claimed in claim 3, characterized in that: The step of selecting a photovoltaic power station in each convergence area as a representative power station includes: According to the historical photovoltaic power generation of each photovoltaic power station, the total historical photovoltaic power generation of each convergence area is calculated; For each convergence area, the Pearson correlation coefficient between the historical photovoltaic power generation of each photovoltaic power station in the convergence area and the total historical photovoltaic power generation of the convergence area is calculated, and the photovoltaic power station with the largest Pearson correlation coefficient with the total historical photovoltaic power generation of the convergence area is taken as the representative power station of the convergence area.
5. The method for predicting regional photovoltaic output under high temperature weather according to claim 1, characterized in that: The generation of the power prediction model includes: Obtaining historical photovoltaic power generation and historical weather forecast data of each representative power station, and obtaining historical high temperature conditions of each representative power station at historical moments according to the historical weather forecast data; Generate a corresponding model training set according to the historical photovoltaic power generation, historical weather forecast data and historical high temperature conditions; Perform grid search on the preset GridSearchCV library to obtain the corresponding optimal model parameters; According to the model training set, the optimal model parameters and the preset LightGBM algorithm, the optimal model parameters are used as the model parameters of the preset LightGBM regression model, the historical meteorological forecast data and historical high temperature conditions of each representative power station are used as input, and the historical photovoltaic power generation power of the corresponding representative power station is used as output. The LightGBM regression model is trained to obtain the corresponding power prediction model.
6. The method for predicting regional photovoltaic output under high temperature weather as claimed in claim 5, characterized in that: The grid search of the preset GridSearchCV library is performed to obtain the corresponding optimal model parameters, including: Define a parameter space; Generate all hyperparameter combinations corresponding to the parameter space; The model training set is divided into a new training set and a validation set according to a preset ratio. For each hyperparameter combination, the LightGBM regression model is trained according to the hyperparameter combination and the training set, and the negative mean square error under the hyperparameter combination is calculated according to the validation set. The hyperparameter combination with the largest negative mean square error is selected as the corresponding optimal model parameter.
7. The method for predicting regional photovoltaic output under high temperature weather according to claim 1, characterized in that: The predicted photovoltaic power generation power of each convergence area under future high temperature weather is calculated based on the predicted photovoltaic power generation power of each representative power station under future high temperature weather, including: The predicted photovoltaic power generation power of each representative power station under future high temperature weather is input into a preset convergence area power calculation model, so that the convergence area power calculation model calculates the predicted photovoltaic power generation power of the convergence area under future high temperature weather according to the predicted photovoltaic power generation power of each representative power station under future high temperature weather, and outputs the predicted photovoltaic power generation power of each convergence area under future high temperature weather.
8. A regional photovoltaic output prediction device under high temperature weather, characterized in that: include: Target power station area clustering module, weather forecast data acquisition module, representative power station photovoltaic power generation prediction module and total predicted photovoltaic power generation calculation module; The target power station area clustering module is used to cluster the photovoltaic power stations in the target power station area, divide the target power station area into a number of convergence areas, and select a photovoltaic power station in each convergence area as a representative power station; The weather forecast data acquisition module is used to acquire the weather forecast data of each representative power station, and obtain the high temperature conditions of each representative power station at a future moment according to the weather forecast data; wherein the high temperature condition is: whether the representative power station is experiencing high temperature weather at each future moment; The representative power station photovoltaic power generation prediction module is used to input the weather forecast data and high temperature conditions of each representative power station into a preset power prediction model of the corresponding representative power station, so that the power prediction model predicts the photovoltaic power generation power of the representative power station under future high temperature weather according to the weather forecast data and high temperature conditions, and outputs the predicted photovoltaic power generation power of the corresponding representative power station under future high temperature weather; The total predicted photovoltaic power calculation module is used to calculate the predicted photovoltaic power generation of each convergence area under future high temperature weather based on the predicted photovoltaic power generation power of each representative power station under future high temperature weather, and then calculate the sum of the predicted photovoltaic power generation power of all convergence areas under future high temperature weather as the total predicted photovoltaic power generation power of the target power station area under future high temperature weather.
9. An electronic device, characterized in that: It comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements the regional photovoltaic output prediction method under high temperature weather as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the regional photovoltaic output prediction method under high temperature weather as described in any one of claims 1 to 7.
