Photovoltaic ultra-short-term power prediction method
By processing the L2-level data of Fengyun 4 A Star and the optical flow method analysis, the numerical forecast radiation value was corrected, and the problem of insufficient impact of cloud movement and occlusion in ultra-short-term photovoltaic prediction was solved, which significantly improved the prediction accuracy.
Patent Information
- Application Number
- CN202411093668.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-11-22
AI Technical Summary
The existing photovoltaic power prediction methods have insufficient consideration of the impact of cloud movement and occlusion on solar radiation, resulting in low ultra-short-term prediction accuracy.
By extracting and processing the L2 level data of Fengyun 4 A Star, using the optical flow method to analyze the pixel movement, correct the numerical forecast radiation value, and combine it with cosine similarity calculation to improve the accuracy of radiation value prediction, and input it into the prediction model for power predict.
It improves the accuracy of ultra-short-term power prediction of photovoltaics and improves prediction accuracy, especially in the prediction effect of cloud movement and occlusion.
Smart Images

Figure CN119005428A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of power prediction, and in particular relates to a photovoltaic ultra-short-term power prediction method. Background Art
[0002] Photovoltaic power forecasting generally uses two methods: physical models and data-driven models. Physical models make predictions based on mathematical formulas based on photovoltaic cell characteristics, solar radiation and meteorological factors. Although these methods can provide accurate predictions in some cases, they require a large amount of sensor data, which increases cost and complexity. Data-driven models rely on historical photovoltaic power generation data and related meteorological data, and use machine learning and deep learning algorithms to establish complex data patterns to predict future power output. These methods can process complex data more efficiently and improve prediction accuracy. However, these methods are insufficient when considering the impact of cloud movement and shading on solar radiation. Summary of the invention
[0003] In order to solve the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a photovoltaic ultra-short-term power prediction method to solve the problems mentioned in the background technology.
[0004] The technical solution adopted by this photovoltaic ultra-short-term power prediction method to solve its technical problems is:
[0005] A photovoltaic ultra-short-term power prediction method is provided, comprising:
[0006] Step 1: Extract and interpolate the L2 data of Fengyun-4A;
[0007] Step 2: Plot the processed FY-4A L2 data and process the generated image using the optical flow method;
[0008] Step 3: Use the optical flow method to obtain the movement of pixels;
[0009] Step 4: Comprehensively calculate the movement of the pixel points and the values of the pixel points to obtain the possible weather conditions at the next moment;
[0010] Step 5: Correct the numerical forecast radiation value according to the weather conditions at the current moment and the weather conditions at the next moment, and perform cosine similarity calculation with the actual radiation value to obtain numerical forecast radiation value data that is closer to the actual radiation value data;
[0011] Step 6: Send the corrected numerical forecast radiation value data together with the basic forecast data into the designed forecast model for power forecasting.
[0012] Furthermore, the step 1 includes obtaining the Fengyun-4A L2 data (CLM product) from the Fengyun Satellite Remote Sensing Data Network, selecting the Chinese region and 4000M resolution data for use, the format of which is an NC file, and extracting the NC file into a csv file through python code.
[0013] Furthermore, the step 2 includes using python code to plot the csv file generated in the first step to obtain a weather condition image for each unit time.
[0014] Furthermore, the step 3 includes using a Farneback-based optical flow algorithm to infer the motion information of each pixel in the next frame and recording it in a csv file.
[0015] Further, the step 4 includes adjusting the coordinate direction so that the X axis is positive to the right and the Y axis is positive downward;
[0016] The 2500 X-axis speeds and 2500 Y-axis speeds are combined into the speed weather matrix S_matrix[x_speed,y_speed,V] and the coordinate weather matrix V_matrix[X,Y,V] at time t;
[0017] Calculate the coordinate weather matrix W_matrix[X,Y,W] at time t+1, W_matrix[X,Y,W]=S_matrix[x_speed,y_speed,V]+V_matrix[X,Y,V];
[0018] Extract and save the weather conditions V and W of the V and W matrices at the four coordinates [24,24], [24,25], [25,24], and [25,25] to form weather lists V_list[V1,V2,V3,V4] and W_list[W1,W2,W3,W4] for use; V_list[V1,V2,V3,V4] is the weather condition at time t, and W_list[W1,W2,W3,W4] is the weather condition at time t+1;
[0019] Since the time interval between each frame is the same, the coordinates at time t+1 can be easily calculated; the formula is as follows:
[0020] x=x0+V x
[0021] y=y0+V y ,
[0022] Among them, the weather list W_list[W1, W2, W3, W4] is the possible weather conditions of the pixel point (the location) at the next moment.
[0023] Furthermore, in step 5, the cosine similarity is obtained by calculating the cosine value of the angle between the two vectors. The closer the cosine value is to 1, the closer the angle is to 0 degrees, that is, the more similar the two vectors are. The formula for calculating the cosine similarity is as follows:
[0024]
[0025] V_list[V1,V2,V3,V4] and W_list[W1,W2,W3,W4] are used as input X, and the difference D between the true value and the numerical forecast radiation value is used as output Y. They are sent to the linear regression model for training and prediction, and the test set data is sent to the trained model for prediction to obtain the difference. Since the difference between the numerical forecast radiation values is too large, they need to be classified and corrected, and the radiation value cannot be negative. Therefore, when the numerical forecast radiation value is greater than 400, the value plus the difference of 0.3 is used as the new numerical forecast radiation value; when the numerical forecast radiation value is less than 400, the value minus the difference of 0.2 is used as the new value. On the test set, the cosine similarity between the numerical forecast radiation value and the true value before correction is 89.34%, and the cosine similarity between the numerical forecast radiation value and the true value after correction is 89.39%. The improvement at this time is 0.05% in terms of features, which is a great improvement when reflected in the power prediction.
[0026] Further, in step 6, according to the relevant provisions and methods of the State Grid on ultra-short-term power forecasting, the accuracy of its power forecast is determined by calculating the daily root mean square error (RMSE); the calculation formula of the daily root mean square error is as follows:
[0027]
[0028] Acc = (1-rRMSE)*100%;
[0029] Among them, P Pi is the actual power, P Mi is the predicted power and Cap is the installed capacity.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] 1. A photovoltaic ultra-short-term power prediction method exemplified in the present invention solves the problem of insufficient consideration of cloud movement and shading in photovoltaic ultra-short-term prediction tasks.
[0032] 2. A photovoltaic ultra-short-term power prediction method exemplified in the present invention solves the accuracy problem in photovoltaic ultra-short-term power prediction and improves the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0034] Figure 1 This is a flow chart of photovoltaic ultra-short-term power prediction based on the L2-level data of Fengyun-4A satellite.
[0035] Figure 2 It is a CLM cloud map of weather changes in a certain area within a period of time of the present invention;
[0036] Figure 3 It is a velocity coordinate schematic diagram of the present invention;
[0037] Figure 4 It is a graph showing changes in radiation value and power generation within a week of the present invention;
[0038] Figure 5 It is a radiation value and power variation diagram of a clear day in the present invention;
[0039] Figure 6 It is a prediction model diagram of the present invention. DETAILED DESCRIPTION
[0040] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.
[0041] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0042] Embodiment 1:
[0043] like Figure 1 As shown, this embodiment provides a photovoltaic ultra-short-term power prediction method, including:
[0044] Step 1: Extract and interpolate the L2 data of Fengyun-4A;
[0045] Step 2: Plot the processed FY-4A L2 data and process the generated image using the optical flow method;
[0046] Step 3: Use the optical flow method to obtain the movement of pixels;
[0047] Step 4: Comprehensively calculate the movement of the pixel points and the values of the pixel points to obtain the possible weather conditions at the next moment;
[0048] Step 5: Correct the numerical forecast radiation value according to the weather conditions at the current moment and the weather conditions at the next moment, and perform cosine similarity calculation with the actual radiation value to obtain numerical forecast radiation value data that is closer to the actual radiation value data;
[0049] Step 6: Send the corrected numerical forecast radiation value data together with the basic forecast data into the designed forecast model for power forecasting.
[0050] In this embodiment, the step 1 includes obtaining the L2 data (CLM product) of Fengyun-4A satellite from the Fengyun satellite remote sensing data network, selecting the Chinese region and 4000M resolution data for use, the format of which is an NC file, and extracting the NC file into a csv file through python code, wherein the CLM variable represents the weather conditions, and the CLM variable includes a fill value (127), a space range (126), clouds (0), possibly clouds (1), possibly sunny (2), and sunny (3). In the process from the NC file to the csv file, it is only necessary to extract the data within the 50*50 range of the target location; in addition, since the L2 data of Fengyun-4A satellite is not in units of 15 minutes, but the photovoltaic ultra-short-term power prediction uses data in units of 15 minutes, the linear interpolation method is used to interpolate the L2 data of Fengyun-4A satellite into a data format with 15 minutes as a unit time.
[0051] In this embodiment, the step 2 includes using Python code to draw a graph on the csv file generated in the first step to obtain a weather condition image for each unit time, such as Figure 2 As shown, different pixel values represent different weather conditions, and the presence of clouds and the direction of cloud movement can be determined based on the movement of these pixels.
[0052] In this embodiment, step 3 includes using the Farneback-based optical flow algorithm to infer the motion information of each pixel in the next frame and recording it in a csv file. By using the Farneback-based optical flow algorithm, motion information including 2500 axial speeds relative to the X axis and 2500 axial speeds relative to the Y axis can be obtained.
[0053] In this embodiment, step 4 includes adjusting the coordinate direction so that the X axis is positive to the right and the Y axis is positive to the downward;
[0054] The 2500 X-axis speeds and 2500 Y-axis speeds are combined into the speed weather matrix S_matrix[x_speed,y_speed,V] and the coordinate weather matrix V_matrix[X,Y,V] at time t;
[0055] Calculate the coordinate weather matrix W_matrix[X,Y,W] at time t+1, W_matrix[X,Y,W]=S_matrix[x_speed,y_speed,V]+V_matrix[X,Y,V];
[0056] Extract and save the weather conditions V and W of the V and W matrices at the four coordinates [24,24], [24,25], [25,24], and [25,25] to form weather lists V_list[V1,V2,V3,V4] and W_list[W1,W2,W3,W4] for use; V_list[V1,V2,V3,V4] is the weather condition at time t, and W_list[W1,W2,W3,W4] is the weather condition at time t+1;
[0057] like Figure 3 As shown, since the time interval between each frame is the same, the coordinates at time t+1 can be easily calculated; the formula is as follows:
[0058] x=x0+V x
[0059] y=y 0 +V y ;
[0060] Among them, the weather list W_list[W1, W2, W3, W4] is the possible weather conditions of the pixel point (the location) at the next moment.
[0061] In this embodiment, the step 5 is as follows: Figure 4 and Figure 5 As shown in the figure, the actual radiation value directly determines the actual capacity of photovoltaic power generation. However, the prediction task is essentially a challenge without a real value to rely on. The completion of photovoltaic power prediction can only rely on the obtained numerical forecast radiation value. Given the limited accuracy of the numerical forecast radiation value, we need to make it closer to the real radiation value through correction, so as to improve the level of predicted power: by calculating the cosine value of the angle between the two vectors, we can get the cosine similarity. The closer the cosine value is to 1, the closer the angle is to 0 degrees, that is, the more similar the two vectors are. The formula for calculating the cosine similarity is as follows:
[0062]
[0063] V_list[V1,V2,V3,V4] and W_list[W1,W2,W3,W4] are used as input X, and the difference D between the true value and the numerical forecast radiation value is used as output Y. They are sent to the linear regression model for training and prediction, and the test set data is sent to the trained model for prediction to obtain the difference. Since the difference between the numerical forecast radiation values is too large, they need to be classified and corrected, and the radiation value cannot be negative. Therefore, when the numerical forecast radiation value is greater than 400, the value plus the difference of 0.3 is used as the new numerical forecast radiation value; when the numerical forecast radiation value is less than 400, the value minus the difference of 0.2 is used as the new value. On the test set, the cosine similarity between the numerical forecast radiation value and the true value before correction is 89.34%, and the cosine similarity between the numerical forecast radiation value and the true value after correction is 89.39%. The improvement at this time is 0.05% in terms of features, which is a great improvement when reflected in the power prediction.
[0064] In this embodiment, in step 6, according to the relevant regulations and methods of the State Grid on ultra-short-term power forecasting, the accuracy of its power forecast is determined by calculating the daily root mean square error (RMSE); the calculation formula of the daily root mean square error is as follows:
[0065]
[0066] Acc = (1-rRMSE)*100%;
[0067] Among them, P Pi is the actual power, P Mi is the predicted power and Cap is the installed capacity.
[0068] This method solves the problem of insufficient consideration of cloud movement and shading in the ultra-short-term photovoltaic prediction task, solves the accuracy problem in the ultra-short-term photovoltaic power prediction, and improves the prediction accuracy.
[0069] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the present application.
[0070] Except for the technical features described in the specification, the remaining technical features are known technologies to those skilled in the art. In order to highlight the innovative features of the present invention, the remaining technical features will not be described here in detail.
Claims
1. A photovoltaic ultra-short-term power prediction method, characterized in that it includes: Step 1: Extract and interpolate the L2 data of Fengyun-4A; Step 2: Plot the processed FY-4A L2 data and process the generated image using the optical flow method; Step 3: Use the optical flow method to obtain the movement of pixels; Step 4: Comprehensively calculate the movement of the pixel points and the values of the pixel points to obtain the possible weather conditions at the next moment; Step 5: Correct the numerical forecast radiation value according to the weather conditions at the current moment and the weather conditions at the next moment, and perform cosine similarity calculation with the actual radiation value to obtain numerical forecast radiation value data that is closer to the actual radiation value data; Step 6: Send the corrected numerical forecast radiation value data together with the basic forecast data into the designed forecast model for power forecasting.
2. A photovoltaic ultra-short-term power prediction method according to claim 1, characterized in that: The step 1 includes obtaining the Fengyun-4A L2 data (CLM product) from the Fengyun Satellite Remote Sensing Data Network, selecting the Chinese region and 4000M resolution data for use, the format of which is an NC file, and extracting the NC file into a csv file through python code.
3. A photovoltaic ultra-short-term power prediction method according to claim 2, characterized in that: The step 2 includes using python code to draw a graph on the csv file generated in the first step to obtain a weather condition image for each unit time.
4. A photovoltaic ultra-short-term power prediction method according to claim 3, characterized in that: The step 3 includes using the Farneback-based optical flow algorithm to infer the motion information of each pixel in the next frame and recording it in a csv file.
5. A photovoltaic ultra-short-term power prediction method according to claim 4, characterized in that: The step 4 includes adjusting the coordinate direction X axis to the right as positive and Y axis to the downward as positive; The 2500 X-axis speeds and 2500 Y-axis speeds are combined into the speed weather matrix S_matrix[x_speed,y_speed,V] and the coordinate weather matrix V_matrix[X,Y,V] at time t; Calculate the coordinate weather matrix W_matrix[X,Y,W] at time t+1, W_matrix[X,Y,W]=S_matrix[x_speed,y_speed,V]+V_matrix[X,Y,V]; Extract and save the weather conditions V and W of the V and W matrices at the four coordinates [24,24], [24,25], [25,24], and [25,25] to form weather lists V_list[V1,V2,V3,V4] and W_list[W1,W2,W3,W4] for use; V_list[V1,V2,V3,V4] is the weather condition at time t, and W_list[W1,W2,W3,W4] is the weather condition at time t+1; Since the time interval between each frame is the same, the coordinates at time t+1 can be easily calculated; the formula is as follows: x=x0+V x y=y0+V y , Among them, the weather list W_list[W1, W2, W3, W4] is the possible weather conditions of the pixel point (the location) at the next moment.
6. A photovoltaic ultra-short-term power prediction method according to claim 5, characterized in that: In step 5, the cosine similarity is obtained by calculating the cosine value of the angle between the two vectors. The closer the cosine value is to 1, the closer the angle is to 0 degrees, that is, the more similar the two vectors are. The formula for calculating the cosine similarity is as follows: V_list[V1,V2,V3,V4] and W_list[W1,W2,W3,W4] are used as input X, and the difference D between the true value and the numerical forecast radiation value is used as output Y. It is sent to the linear regression model for training and prediction, and the test set data is sent to the trained model for prediction to get the difference; Since the difference between the numerical forecast radiation values is too large, they need to be corrected according to classification, and the radiation value cannot be negative. Therefore, when the numerical forecast radiation value is greater than 400, the value plus 0.3 difference is used as the new numerical forecast radiation value; when the numerical forecast radiation value is less than 400, the value minus 0.2 difference is used as the new value; On the test set, the cosine similarity between the numerical forecast radiation value and the true value before correction is 89.34%, and the cosine similarity between the numerical forecast radiation value and the true value after correction is 89.39%. The improvement at this time is in terms of features, which is 0.05%, and when reflected in the power prediction, it is a great improvement.
7. A photovoltaic ultra-short-term power prediction method according to claim 6, characterized in that: In step 6, according to the relevant regulations and methods of the State Grid on ultra-short-term power forecasting, the accuracy of its power forecast is determined by calculating the daily root mean square error (RMSE); the calculation formula of the daily root mean square error is as follows: Acc = (1-rRMSE)*100%; Among them, P Pi is the actual power, P Mi is the predicted power and Cap is the installed capacity.
