Photovoltaic data cleaning method based on raster data image processing
The photovoltaic data cleaning method based on raster data image processing solves the problems of low photovoltaic data cleaning efficiency and insufficient recognition ability in the existing technology, achieves efficient and accurate data processing and pattern recognition, and improves the accuracy of photovoltaic power prediction. performance and economic benefits.
Patent Information
- Application Number
- CN202411045783.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-08-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing photovoltaic data cleaning methods have limited effects when processing rasterized data and image processing. They have low efficiency, insufficient recognition capabilities, and complex parameter settings, resulting in the loss of important information and inaccurate data.
Using methods based on raster data image processing, including preliminary data cleaning, rasterization and pictorialization, opening operations and contour extraction, maximum contour extraction and resolution selection, weight determination and discreteness calculation, image processing technology is used to eliminate noise, Extract major contours and evaluate cleaning effects to ensure data quality and pattern recognition capabilities.
It improves data processing efficiency and accuracy, enhances complex pattern recognition capabilities, simplifies operating procedures, reduces professional requirements, ensures the retention of key information, and improves the accuracy and economic benefits of short-term photovoltaic power forecasting.
Smart Images

Figure CN118570495A
Abstract
Description
Technical Field
[0001] The invention relates to a photovoltaic data cleaning method, in particular to a photovoltaic data cleaning method based on grid data image processing. Background Art
[0002] Photovoltaic power generation is a clean and sustainable form of energy. However, the operation and monitoring of photovoltaic power generation systems often generate a large amount of data. These data may contain missing values, outliers, and noise, which brings challenges to the analysis and application of photovoltaic data. Therefore, photovoltaic data cleaning, as an important part of data preprocessing, plays a vital role in ensuring data quality and improving data availability and reliability.
[0003] In recent years, many research advances have been made in the field of data cleaning, including technologies in missing value processing, outlier detection and processing, data denoising, and many other aspects. In particular, some targeted methods and technologies have been proposed for photovoltaic data cleaning. For example, photovoltaic data cleaning methods based on interpolation and outlier detection algorithms can effectively handle missing values and outliers in the data. In addition, there are also related technologies for time series data cleaning, such as sliding window smoothing, exponential weighted moving average, etc. These technologies are of great significance for the preprocessing of photovoltaic power generation data. Although the existing methods have improved the efficiency and accuracy of data cleaning to a certain extent, when faced with rasterized data and image-processed photovoltaic data, the effects of these traditional methods, which are mostly based on statistics and regression, are still limited.
[0004] In response to the data cleaning needs in the field of photovoltaic power generation, the relevant patent documents each disclose different methods. These patent documents are all committed to identifying and processing outliers from a large amount of photovoltaic power generation data to improve the accuracy and reliability of data analysis. For example, patent document CN117290666A proposes a photovoltaic abnormal power data cleaning method, which uses variance change points combined with correlation analysis to identify the type of abnormal data, including single-point outliers and continuous outliers, and repairs the detected abnormal data through a linear regression model, thereby ensuring the integrity and accuracy of the data and supporting efficient data modeling and decision analysis. For example, patent document CN117932228A introduces a photovoltaic abnormal data cleaning method and system based on a two-step Bayesian network. The method first processes sample data to establish a conditional probability model of photovoltaic current and voltage, and removes abnormal data based on confidence intervals. The characteristics of this method are that it takes into account the influence of temperature and irradiance, processes current and voltage data separately, ensures the efficient operation of the photovoltaic system, and reduces maintenance costs. For example, patent document CN114090559A focuses on a two-step quantile algorithm for cleaning abnormal data of photovoltaic power plants. By collecting historical operation data and meteorological data of photovoltaic power plants, and applying a two-step quantile algorithm to clean them according to the relationship between irradiance and power, and temperature and power, this method helps to organize and reconstruct data, so that the distribution trend of normal data is more in line with the actual working status.
[0005] These technical solutions do not provide sufficiently good solutions to the efficiency, information loss, and interpretability issues of PV data cleaning. Summary of the invention
[0006] The purpose of the present invention is to provide a photovoltaic data cleaning method based on raster data image processing, which can improve the efficiency of large-scale data processing, enhance the ability to recognize complex patterns, simplify the operation process, reduce professional requirements, prevent the loss of important information, and can quickly and accurately process photovoltaic data sets, improve the ability to identify outliers and retain key information, so that non-professionals can also operate easily, so as to solve the problems of low efficiency and inaccuracy, insufficient recognition ability, and complex parameter settings of existing photovoltaic data cleaning methods.
[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is as follows: A photovoltaic data cleaning method based on raster data image processing (or a photovoltaic abnormal data cleaning method based on raster data image processing) has a technical solution that includes the following steps: S1: Photovoltaic data collection and preliminary cleaning, to obtain photovoltaic data, and photovoltaic abnormal data analysis indicates that there is a close relationship between photovoltaic power generation and radiation data. Due to equipment failures, data acquisition equipment problems and other factors that may occur during data collection, a large amount of abnormal data may be generated. In order to improve the accuracy of subsequent prediction models, preliminary data cleaning must be performed first to delete abnormal data, especially those data records that are obviously abnormal, such as total light radiation and power generation data with only one record of 0, which are obvious abnormal values; Step S1 is a data acquisition and preliminary processing step; S2: Data rasterization and image processing. Next, the collected data is mapped to the grid blocks through rasterization processing. Considering the characteristics of night data, the data needs to be properly corrected to avoid image distortion. The corrected raster data is mapped into different colors through numerical values to complete the image processing of the raster data, forming images under different resolution conditions to meet different analysis needs. S3: Image opening and contour extraction: The image generated in step S2 is opened by image processing technology, first corroded and then expanded to eliminate noise, separate the contours of dense areas and smooth the boundaries of large contours. After the opening, the image is binarized and the main contours in the data are extracted by setting an appropriate threshold (i.e., by setting a reasonable threshold) to achieve the cleaning goal. S4: Maximum contour extraction and resolution selection. After the image opening operation and contour extraction, the maximum contour areas extracted at different resolutions are counted and compared. Since the threshold selection of images with different resolutions shows a 4-fold relationship, area alignment is performed on this basis to select the appropriate image resolution (i.e., select the appropriate image resolution) to achieve the purpose of obtaining the maximum contour area with the minimum threshold. Therefore, it is necessary to find a balance between the threshold and the image resolution. S5: Weight determination, discreteness calculation, and cleaning effect evaluation. The weight is determined according to the number of times each value appears in the data matrix. The weighted discreteness is calculated using the weight to determine the degree of data concentration. A smaller intra-class discreteness indicates that the data cleaning effect is good. Finally, the results of weight determination and discreteness calculation are combined with the needs of actual photovoltaic short-term power prediction to quantitatively evaluate the data cleaning effect.
[0008] In the above technical solution, a preferred technical solution may be that the step S1 specifically includes: S1.1: Accurately obtain (collect) photovoltaic data from the sensor system of the photovoltaic station. Photovoltaic data includes important radiation data such as total light radiation, direct radiation, and scattered radiation. The total light radiation is the sum of direct radiation and scattered radiation. These radiation data are the basis for evaluating and optimizing the power generation efficiency of the photovoltaic system and are related to the power generation efficiency of the photovoltaic system. In order to capture the subtle changes in radiation data and ensure the high quality and integrity of the data, the radiation data collection frequency is once every 15 minutes. The frequency setting can not only ensure the continuity in time, but also avoid missing important changes due to too low data collection frequency, or generating a large amount of redundant data due to too high frequency, ensuring the practicality of the data and the efficiency of management, so as to ensure the capture of subtle characteristics of data changes and ensure data quality and integrity.
[0009] The above irradiation data is closely related to photovoltaic power generation, because photovoltaic systems use solar energy to convert into electrical energy. Direct radiation refers to radiation directly from the sun, which is related to factors such as the angle of the sun and the transparency of the atmosphere. Under ideal conditions, the stronger the direct radiation, the more light energy the photovoltaic cell module absorbs, so the photovoltaic power generation will increase with the increase of direct radiation. Scattered radiation refers to radiation from the sun that reaches the ground after being scattered in the atmosphere. It is related to factors such as atmospheric particulate matter and clouds. Although scattered radiation is not as strong as direct radiation, it can still provide a certain amount of light energy for photovoltaic cell modules, so it will also affect photovoltaic power generation.
[0010] As shown in the equation G=D+SA, G refers to total light radiation, D refers to direct radiation, and SA refers to scattered radiation. Total light radiation is the sum of direct radiation and scattered radiation. It is an important indicator to measure the total amount of solar radiation. Total light radiation directly affects the power generation efficiency of photovoltaic battery components, so there is a very close relationship between total light radiation and power. Generally speaking, the stronger the total light radiation, the higher the photovoltaic power generation power. Figure 2 This is a scatter plot of the total light radiation and power generation of a photovoltaic station. Figure 2 It can be seen that the relationship between photovoltaic power generation and total radiation is not a simple linear relationship, but has certain fluctuation characteristics. In addition, it can be found that there are many abnormal data in the data collection process. If these data are directly used for the training of power prediction models, it will undoubtedly lead to large prediction errors. First of all, equipment failure is an important reason for abnormal data, such as Figure 2 Circle B in the figure; Secondly, data acquisition equipment problems are also a common cause of abnormal data, such as Figure 2 In addition, factors such as artificial power restrictions can also lead to the generation of a large amount of abnormal data, such as Figure 2 Circle C in the picture.
[0011] S1.2: Perform preliminary data cleaning and preprocessing, including deleting abnormal data and processing missing data to ensure the accuracy and reliability of subsequent analysis. The abnormal data refers to data in which only one of the total light radiation and power generation data is 0. This step specifically performs preliminary data cleaning and preprocessing operations on the acquired photovoltaic data. This step includes removing obvious outliers, such as unreasonable data records introduced by faults or errors, and processing missing data, aiming to improve the quality of the data set. During the data cleaning process, repeated or frequently occurring data points are retained, while sparsely occurring data are removed. Measures that may be taken during the processing include, but are not limited to, using historical data for reasonable estimation, using professional algorithms to interpolate missing points, etc. The key to this preprocessing step is to ensure that the data entering the next step of rasterization and imaging processing has high reliability and accuracy, laying a solid data foundation for subsequent data cleaning and analysis.
[0012] In the above technical solution, a preferred technical solution may also be that the step S2 specifically includes: S2.1: The photovoltaic data is mapped to the grid blocks through the rasterization process. Here, the photovoltaic station in central China is taken as an example. The installed capacity of a photovoltaic station is 150MW, and the standard total radiation range is 0-1500W / m². In the rasterization process, the ratio of standard total radiation to installed capacity is 1W / m²:1KW, and finally 1600×1600 grid blocks are generated. The photovoltaic data is mapped to the grid blocks, the amount of data in each grid block is counted, and the rasterized data table is generated.
[0013] S2.2: After rasterization, the generated raster data (which cannot be directly generated as image data) is corrected. In particular, considering the characteristics of nighttime data, in order to avoid distortion in subsequent image processing, the data volume of the grid block (0,0) is corrected. The grid block (0,0) represents the data with the lowest radiation or no radiation. Since the nighttime data is basically in this grid block, its data volume accounts for half of the total data volume. If the raster table is directly converted into an image, it will cause image distortion. The correction method is to replace it with the maximum value in other grid blocks to avoid image distortion; then, through numerical mapping, the raster data is converted into images of different colors (the process of imageization is actually to map the raster data into different colors through numerical values), similar to the process of converting matrix data into heat maps. This correction strategy ensures the accuracy and practicality of the mapped data image.
[0014] In the above technical solution, a preferred technical solution may also be that step S3 specifically includes: S3.1: Before extracting contours, the rasterized image must be grayscaled and binarized. The color image must be converted into a grayscale image and then into a binary image to simplify the image data and highlight the target contour features. The choice of threshold is crucial. Setting the threshold too low will include all data points, which goes against the purpose of cleaning; setting the threshold too high will separate the pixels, making it difficult to extract effective contours.
[0015] S3.2: Open operation is adopted to corrode the image first and then dilate it, that is, first use the corrosion formula Calculate and then use the expansion formula Dilate the image to eliminate small pixels, separate narrow areas in the contour, and smooth the boundaries of large contours. That is, eliminate noise points and smooth the edges of contours through erosion and dilation. This step helps ensure that the largest contour area is extracted to contain valid data. S3.3: Extract the main contours to ensure the accuracy and efficiency of data cleaning. Figure 5 As shown, reducing the image resolution is another contour extraction method. The main contour extraction method is that the image after the resolution reduction needs to be restored to the original resolution, so subsequent restoration processing must be performed. Multiple sets of processing flows are designed, and the difference is only in the resolution of the image. The present invention can design 6 sets of processing flows, set 6 sets of resolution images, and the resolution of adjacent images differs by 4 times. Therefore, when selecting the opening operation and the binarization threshold, the threshold selection of adjacent images should differ by 4 times to ensure adaptability to images with different resolutions. Through this series of operations, photovoltaic data can be effectively processed, ensuring the smooth progress of the data cleaning process, and providing an accurate data basis for subsequent prediction models.
[0016] In the above technical solution, a preferred technical solution may also be that the step S4 specifically includes: S4.1: In photovoltaic data processing, it is necessary to balance the relationship between threshold selection and contour area to count and select the maximum contour extraction and appropriate image resolution. According to the results after opening operation, contour extraction and smoothing, the maximum contour area statistics of adjacent images are obtained. The threshold selection between adjacent images is 4 times aligned. When counting the contour area, the corresponding area alignment operation is required to ensure that the contour area of the image with smaller resolution is correspondingly enlarged by 4 times. The selection of threshold is inversely proportional to the contour area. Under the same threshold, the image resolution is proportional to the contour area. The present invention aims to select the smallest possible threshold (i.e., the smallest threshold) to obtain the maximum contour area. It is necessary to find a balance between the threshold and the image resolution to determine the appropriate parameters for contour extraction. It is crucial to find a balance between the threshold and the image resolution to obtain the most suitable contour extraction parameters. The data cleaning process is essentially a clustering process, in which the intra-class dispersion is an important evaluation index. A smaller intra-class dispersion indicates a better data cleaning effect. At the same time, it is necessary to ensure that the amount of data is not affected, so it is crucial to introduce weights. Determining the weights involves the following steps: first, extract all the coordinates of each value in the matrix to form a coordinate set; second, treat these coordinates as a sample set and use the number of samples as weights; finally, apply these weights to calculate the weighted discreteness, ensuring that the number of samples is correctly considered.
[0017] S4.2: The corrected raster data will be further converted into an image by mapping values to colors, similar to the process of generating a heat map. In this way, different data values will correspond to pixels of different colors, which can intuitively present the data distribution and highlight abnormal data points. In addition, the generated data image will support different resolution levels to meet various analysis needs.
[0018] In the above technical solution, a preferred technical solution may also be that the step S5 specifically includes: S5.1: Weight selection and dispersion calculation. The data cleaning process is actually a clustering process, in which the dispersion within the class It can be used to evaluate the effect of data cleaning. Pursuing a smaller intra-class discreteness is the goal of cleaning. While ensuring the amount of data, choosing the appropriate weight is the key. The weight determination step is to first extract all coordinates in the matrix for each value to form a coordinate set, and then regard all coordinates of the value as a sample set. When calculating the weighted discreteness, use the number of samples as the weight so that the weight of each sample is equal to the number of times the value appears in the matrix. The purpose of this is to ensure that when calculating the weighted discreteness, there will be a corresponding impact for the different number of occurrences of each value. Then, according to the weighted discreteness calculation formula, these weights are applied to calculate the discreteness to ensure that the number of samples is correctly applied as the weight.
[0019] In order to achieve this step, the present invention provides a cleaning criterion , The formula is ,when S Take the maximum value, When taking the minimum value, can achieve the maximum value; ,in, S is the area, which is the converted area based on a resolution of 1600 pixels × 1600 pixels. N is the total amount of data, k is the sample size, It is i The number of data points for each sample, It is i The discreteness matrix of samples, , is the weighted discreteness, n is the sample size, It is i The coordinates of the samples, are the coordinates of the sample mean, It is i The weight of the samples, Indicates i The Euclidean distance between a sample and the sample mean. This formula is similar to the ordinary variance calculation formula, except that the square of the deviation of each sample point is weighted by its corresponding weight. After cleaning by the above method, the number of valid data points is counted. E , and the valid data points E are used for further analysis and calculation.
[0020] S5.2: Quantitative evaluation of data cleaning effect. In order to evaluate the actual effect of the photovoltaic data cleaning method based on raster data image processing proposed in the present invention, three methods are compared. In addition to the method proposed in the present invention, the other two methods are the fusion of Pearson correlation coefficient interpolation method and cubic spline interpolation. That is, the method of step S5.1 above, the fusion of Pearson correlation coefficient interpolation method, and the cubic spline interpolation method are used. In the quantitative evaluation process, the data cleaned by these three methods are substituted into the CS-LSTM model for training; the power prediction algorithm supporting short-term photovoltaic data set training is the CS-LSTM algorithm model. The CS-LSTM algorithm model is an algorithm that combines CNN and LSTM. When setting the training parameters, the algorithm adopts an automatic adjustment parameter method. When the loss value does not change in 20 training cycles, it will automatically stop, and the learning rate will also be linearly adjusted according to the loss value. Further, in terms of photovoltaic power prediction, the data after weight determination and discreteness calculation are applied to CS-LSTM model training. This model combines the advantages of CNN and LSTM, and can improve the prediction accuracy through automatic parameter and learning rate adjustment. In step S5, the actual effect of the present invention is comprehensively evaluated by calculating the accuracy and mean square error (MSE) of the present method, the fusion Pearson correlation coefficient interpolation method, and the cubic spline interpolation method under three conditions. Specifically, an important role of photovoltaic data cleaning is the power prediction of photovoltaic stations (i.e., the cleaning of photovoltaic data is used as the power prediction of photovoltaic stations), where the accuracy of power prediction is the only indicator to test the prediction effect, and the short-term prediction accuracy forecast formula is as follows: , , in, NRMSE represents the normalized root mean square error, Indicates t The predicted photovoltaic power value at a time point is Indicates t The actual value of photovoltaic power at a time point, Cap Indicates installed capacity, PA Indicates the prediction accuracy. In step S5, the area S , Number of valid data points E、 In-sample dispersion , Cleaning Guidelines Then the mean square error and the short-term photovoltaic power prediction accuracy are calculated. The mean square error reflects the average deviation between the model prediction value and the actual observation value. The short-term photovoltaic power prediction accuracy is a quantitative evaluation of the cleaning effect. S The converted area is based on a resolution of 1600 pixels x 1600 pixels.
[0021] The present invention provides a photovoltaic data cleaning method based on raster data image processing, which is intended to process a large amount of data generated during the operation and monitoring of photovoltaic power generation systems, including missing values, outliers and noise. Because data quality directly affects the accuracy of power prediction and the safe and stable operation of the power grid. The present invention adopts a photovoltaic data cleaning method based on raster data image processing, including data rasterization, image processing technology (such as opening operation, contour extraction, filtering processing, etc.) and selecting the best contour according to the discreteness and area criteria. After image processing, the scattered point data within the selected contour is retained as the cleaned data. By comparing the power prediction accuracy of different algorithms, the effectiveness of the data cleaning effect is quantitatively evaluated. The evaluation results show that this method can effectively improve data quality, ensure that the data retained after data cleaning better reflects the inherent laws of photovoltaic data, improve the accuracy of short-term power prediction effects, and solve the problem that photovoltaic data cleaning in traditional methods is not efficient and accurate enough.
[0022] In summary, the present invention introduces a photovoltaic data cleaning method based on image processing, which significantly improves the quality and efficiency of data processing. Experiments have shown that the use of cleaned data in the power generation prediction model can improve the accuracy by more than 4% compared with the traditional method, and reduce the prediction cost by more than 12%. Through image data and visual processing technology, the technical bias of traditional methods is overcome, and the hidden patterns in the data, such as periodic fluctuations and unconventional change trends, are revealed, which brings good economic benefits to photovoltaic data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a block diagram of the photovoltaic data cleaning method based on raster data image processing of the present invention.
[0024] Figure 2 It is a scatter plot of total light radiation and power generation of a photovoltaic station involved in the present invention.
[0025] Figure 3 It is a structural diagram of the photovoltaic data cleaning method based on raster data image processing involved in the present invention.
[0026] Figure 4 This is the rasterized data graph involved in the present invention.
[0027] Figure 5 This is a resolution reduction processing diagram involved in the present invention.
[0028] Figure 6 This is a diagram of the CS-LSTM model involved in the present invention.
[0029] Figure 7 In order to adopt the method of the present invention, the data of the first photovoltaic power station with an installed capacity of 150 MW in a certain place (place X) is finally cleaned as a contour map.
[0030] Figure 8 The final cleaning result diagram of the data of the first photovoltaic power station with an installed capacity of 150 MW in a certain place (place X) using the method of the present invention.
[0031] Fig. 9 The final cleaning result diagram of the data of the second photovoltaic power station with an installed capacity of 150 MW in a certain place (place X) using the method of the present invention.
[0032] Fig.10 The final cleaning result diagram of the data of the third photovoltaic power station with an installed capacity of 150 MW in a certain place (place X) using the method of the present invention. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described in conjunction with the embodiments below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the following embodiments, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] Example 1: Figure 1 , Figure 2 , Figure 3 , Figure 4 , Figure 5 , Figure 6 , Figure 7 , Figure 8 , Fig. 9 , Fig.10 As shown, the photovoltaic data cleaning method based on raster data image processing of the present invention comprises the following steps: S1: Photovoltaic data collection and preliminary cleaning, obtain photovoltaic data, and photovoltaic abnormal data analysis points out that there is a close relationship between photovoltaic power generation and radiation data. Due to equipment failures, data acquisition equipment problems and other factors that may occur during the data collection process, a large amount of abnormal data may be generated. In order to improve the accuracy of the subsequent prediction model, it is necessary to first perform preliminary data cleaning and delete abnormal data, especially those data records that are obviously abnormal, such as the total light radiation and power generation data, there is only one record with a data value of 0, which are obvious abnormal values; step S1 is a data acquisition and preliminary processing step. The above step S1 specifically includes: S1.1: Accurately obtain photovoltaic data from the sensor system of the photovoltaic station. Photovoltaic data includes important radiation data such as total light radiation, direct radiation, and scattered radiation. The total light radiation is the sum of direct radiation and scattered radiation. These radiation data are the basis for evaluating and optimizing the power generation efficiency of the photovoltaic system and are related to the power generation efficiency of the photovoltaic system. In order to capture the subtle changes in radiation data and ensure the high quality and integrity of the data, the radiation data acquisition frequency is once every 15 minutes. The frequency setting can not only ensure the continuity in time, but also avoid missing important changes due to too low data acquisition frequency, or generating a large amount of redundant data due to too high frequency, ensuring the practicality of the data and the efficiency of management, so as to ensure the capture of subtle characteristics of data changes and ensure data quality and integrity.
[0035] The above irradiation data is closely related to photovoltaic power generation, because photovoltaic systems use solar energy to convert into electrical energy. Direct radiation refers to radiation directly from the sun, which is related to factors such as the angle of the sun and the transparency of the atmosphere. Under ideal conditions, the stronger the direct radiation, the more light energy the photovoltaic cell module absorbs, so the photovoltaic power generation will increase with the increase of direct radiation. Scattered radiation refers to radiation from the sun that reaches the ground after being scattered in the atmosphere. It is related to factors such as atmospheric particulate matter and clouds. Although scattered radiation is not as strong as direct radiation, it can still provide a certain amount of light energy for photovoltaic cell modules, so it will also affect photovoltaic power generation.
[0036] As shown in the equation G=D+SA, G refers to total light radiation, D refers to direct radiation, and SA refers to scattered radiation. Total light radiation is the sum of direct radiation and scattered radiation. It is an important indicator to measure the total amount of solar radiation. Total light radiation directly affects the power generation efficiency of photovoltaic battery components, so there is a very close relationship between total light radiation and power. Generally speaking, the stronger the total light radiation, the higher the photovoltaic power generation power. Figure 2 This is a scatter plot of the total light radiation and power generation of a photovoltaic station. Figure 2 It can be seen that the relationship between photovoltaic power generation and total radiation is not a simple linear relationship, but has certain fluctuation characteristics. In addition, it can be found that there are many abnormal data in the data collection process. If these data are directly used for the training of power prediction models, it will undoubtedly lead to large prediction errors. First of all, equipment failure is an important reason for abnormal data, such as Figure 2 Circle B in the figure; Secondly, data acquisition equipment problems are also a common cause of abnormal data, such as Figure 2 In addition, factors such as artificial power restrictions can also lead to the generation of a large amount of abnormal data, such as Figure 2 Circle C in the picture.
[0037] S1.2: Perform preliminary data cleaning and preprocessing, including deleting abnormal data and processing missing data to ensure the accuracy and reliability of subsequent analysis. The abnormal data refers to data in which only one of the total light radiation and power generation data is 0. This step specifically performs preliminary data cleaning and preprocessing operations on the acquired photovoltaic data. This step includes removing obvious outliers, such as unreasonable data records introduced by faults or errors, and processing missing data, aiming to improve the quality of the data set. During the data cleaning process, repeated or frequently occurring data points are retained, while sparsely occurring data are removed. Measures that may be taken during the processing include, but are not limited to, using historical data for reasonable estimation, using professional algorithms to interpolate missing points, etc. The key to this preprocessing step is to ensure that the data entering the next step of rasterization and imaging processing has high reliability and accuracy, laying a solid data foundation for subsequent data cleaning and analysis.
[0038] S2: Data rasterization and image processing. Next, the collected data is mapped to the grid blocks through rasterization processing. Considering the characteristics of night data, the data needs to be properly corrected to avoid image distortion. The corrected raster data is mapped into different colors through numerical values to complete the image processing of the raster data and form images under different resolution conditions to meet different analysis requirements. The above step S2 specifically includes: S2.1: The photovoltaic data is mapped to the grid blocks through the rasterization process. Here, the photovoltaic station in Central China is taken as an example. The installed capacity of a photovoltaic station is 150MW, and the standard total radiation range is 0-1500W / m². In the rasterization process, the ratio of the standard total radiation to the installed capacity is 1W / m²: 1KW, and finally 1600×1600 grid blocks are generated. The photovoltaic data is mapped to the grid blocks, and the amount of data in each grid block is counted to generate a rasterized data table, such as Figure 4 shown.
[0039] S2.2: After rasterization, the generated raster data (which cannot be directly generated as image data) is corrected. In particular, considering the characteristics of nighttime data, in order to avoid distortion in subsequent image processing, the data volume of the grid block (0,0) is corrected. The grid block (0,0) represents the data with the lowest radiation or no radiation. Since the nighttime data is basically in this grid block, its data volume accounts for half of the total data volume. If the raster table is directly converted into an image, it will cause image distortion. The correction method is to replace it with the maximum value in other grid blocks to avoid image distortion; then, through numerical mapping, the raster data is converted into images of different colors (the process of imageization is actually to map the raster data into different colors through numerical values), similar to the process of converting matrix data into heat maps. This correction strategy ensures the accuracy and practicality of the mapped data image.
[0040] S3: Image opening and contour extraction: Through image processing technology, the image generated in step S2 is opened, first corroded and then expanded to eliminate small noise, separate the contours of dense areas and smooth the boundaries of large contours. After the opening operation, the image is binarized and the main contours in the data are extracted by setting an appropriate threshold to achieve the cleaning goal. The above step S3 specifically includes: S3.1: Before extracting contours, the rasterized image must be grayscaled and binarized. The color image must be converted into a grayscale image and then into a binary image to simplify the image data and highlight the target contour features. The choice of threshold is crucial. Setting the threshold too low will include all data points, which goes against the purpose of cleaning; setting the threshold too high will separate the pixels, making it difficult to extract effective contours.
[0041] S3.2: Open operation is adopted to corrode the image first and then dilate it, that is, first use the corrosion formula Calculate and then use the expansion formula Dilate the image to eliminate small pixels, separate narrow areas in the contour, and smooth the boundaries of large contours. That is, eliminate noise points and smooth the edges of contours through erosion and dilation. This step helps ensure that the largest contour area is extracted to contain valid data. S3.3: Extract the main contours to ensure the accuracy and efficiency of data cleaning. Figure 5As shown, reducing the image resolution is another contour extraction method. The main contour extraction method is that the image after the resolution is reduced needs to be restored to the original resolution, so subsequent restoration processing must be performed. Multiple sets of processing flows are designed, and the difference is only in the resolution of the image. The present invention can design 6 sets of processing flows and set 6 sets of images with different resolutions. This setting corresponds to Table 1 below. The resolutions of adjacent images differ by 4 times. Therefore, when selecting the opening operation and the binarization threshold, the threshold selection of adjacent images should differ by 4 times to ensure adaptability to images with different resolutions. Through this series of operations, photovoltaic data can be effectively processed, ensuring the smooth progress of the data cleaning process, and providing an accurate data basis for subsequent prediction models.
[0042] S4: Maximum contour extraction and resolution selection. After the image opening operation and contour extraction, the maximum contour area extracted at different resolutions is counted and compared. Since the threshold selection of images with different resolutions shows a 4-fold relationship, area alignment is performed on this basis to select the appropriate image resolution. This can achieve the purpose of obtaining the maximum contour area with the minimum threshold, so it is necessary to find a balance between the threshold and the image resolution. The above step S4 specifically includes: S4.1: In photovoltaic data processing, it is necessary to balance the relationship between threshold selection and contour area to count and select the maximum contour extraction and appropriate image resolution. According to the results after opening operation, contour extraction and smoothing, the maximum contour area statistics of adjacent images are obtained. The threshold selection between adjacent images is 4 times aligned. When counting the contour area, the corresponding area alignment operation is required to ensure that the contour area of the image with smaller resolution is correspondingly expanded by 4 times. The selection of threshold is inversely proportional to the contour area. Under the same threshold, the image resolution is proportional to the contour area. The present invention aims to select the minimum threshold to obtain the maximum contour area. It is necessary to find a balance between the threshold and the image resolution to determine the appropriate parameters for contour extraction. It is crucial to find a balance between the threshold and the image resolution to obtain the most suitable contour extraction parameters, and the data cleaning process is essentially a clustering process, in which the intra-class discreteness is an important evaluation index. Smaller intra-class discreteness indicates better data cleaning effect, and it is necessary to ensure that the amount of data is not affected, so it is crucial to introduce weights. Determining the weights involves the following steps: first, extract all the coordinates of each value in the matrix to form a coordinate set; second, treat these coordinates as a sample set and use the number of samples as weights; finally, apply these weights to calculate the weighted discreteness, ensuring that the number of samples is correctly considered.
[0043] S4.2: The corrected raster data will be further converted into an image by mapping values to colors, similar to the process of generating a heat map. In this way, different data values will correspond to pixels of different colors, which can intuitively present the data distribution and highlight abnormal data points. In addition, the generated data image will support different resolution levels to meet various analysis needs.
[0044] S5: weight determination, discreteness calculation, cleaning effect evaluation, determine the weight according to the number of times each value appears in the data matrix, use the weight to calculate the weighted discreteness, and judge the concentration of the data. A smaller intra-class discreteness indicates a good data cleaning effect. Finally, through the results of weight determination and discreteness calculation, combined with the needs of actual photovoltaic short-term power prediction, the data cleaning effect is quantitatively evaluated. The above step S5 specifically includes: S5.1: Weight selection and dispersion calculation. The data cleaning process is actually a clustering process, in which the dispersion within the class It can be used to evaluate the effect of data cleaning. Pursuing a smaller intra-class discreteness is the goal of cleaning. While ensuring the amount of data, choosing the appropriate weight is the key. The weight determination step is to first extract all coordinates in the matrix for each value to form a coordinate set, and then regard all coordinates of the value as a sample set. When calculating the weighted discreteness, use the number of samples as the weight so that the weight of each sample is equal to the number of times the value appears in the matrix. The purpose of this is to ensure that when calculating the weighted discreteness, there will be a corresponding impact for the different number of occurrences of each value. Then, according to the weighted discreteness calculation formula, these weights are applied to calculate the discreteness to ensure that the number of samples is correctly applied as the weight.
[0045] In order to achieve this step, the present invention provides a cleaning criterion , The formula is , when S Take the maximum value, When taking the minimum value, can achieve the maximum value; ,in, S is the area, which is the converted area based on a resolution of 1600 pixels × 1600 pixels. N is the total amount of data, k is the sample size, It is i The number of data points for each sample, It is i The discreteness matrix of samples, , is the weighted discreteness, n is the sample size, It is i The coordinates of the samples, are the coordinates of the sample mean, It is i The weight of the samples, Indicates i The Euclidean distance between a sample and the sample mean. This formula is similar to the ordinary variance calculation formula, except that the square of the deviation of each sample point is weighted by its corresponding weight. After cleaning by the above method, the number of valid data points is counted. E , and the valid data points E are used for further analysis and calculation.
[0046] S5.2: Quantitatively evaluate the data cleaning effect. In order to evaluate the actual effect of the photovoltaic data cleaning method based on raster data image processing proposed in the present invention, three methods are compared. In addition to the method proposed in the present invention, the other two methods are the fusion of Pearson correlation coefficient interpolation method and cubic spline interpolation. That is, the method of step S5.1 above, the fusion of Pearson correlation coefficient interpolation method, and the cubic spline interpolation method are used. In the quantitative evaluation process, the data cleaned by these three methods are substituted into the CS-LSTM model for training; the power prediction algorithm that supports short-term photovoltaic data set training is the CS-LSTM algorithm model. The CS-LSTM algorithm model is an algorithm that combines CNN and LSTM, such as Figure 6 As shown, the algorithm adopts an automatic parameter adjustment method when setting training parameters. When the loss value does not change in 20 training cycles, it will stop automatically, and the learning rate will also be linearly adjusted according to the loss value. Furthermore, in terms of photovoltaic power prediction, the data after weight determination and discreteness calculation is applied to CS-LSTM model training. This model combines the advantages of CNN and LSTM, and can improve prediction accuracy through automatic parameter and learning rate adjustment. In step S5, the actual effect of the present invention will be comprehensively evaluated by calculating the accuracy and mean square error (MSE) of this method under three conditions: fusion of Pearson correlation coefficient interpolation method and cubic spline interpolation. Specifically, an important role of photovoltaic data cleaning is the power prediction of photovoltaic stations, where the accuracy of power prediction is the only indicator to test the prediction effect, and the short-term prediction accuracy forecast formula is as follows: , , in, NRMSE represents the normalized root mean square error, Indicates t The predicted photovoltaic power value at a time point is Indicates t The actual value of photovoltaic power at a time point, Cap Indicates installed capacity, PA Indicates the prediction accuracy.
[0047] The area obtained in step S5 is S , Number of valid data points E , In-sample dispersion , Cleaning Guidelines Parameters such as , see Table 1. Then calculate the mean square error, photovoltaic short-term power prediction accuracy, the mean square error reflects the average deviation between the model prediction value and the actual observation value, photovoltaic short-term power prediction accuracy is a quantitative evaluation of the cleaning effect, the area S The converted area is based on a resolution of 1600 pixels x 1600 pixels.
[0048] The following is a test experiment of the present invention, in which the first photovoltaic power station with an installed capacity of 150 MW in a certain place (place X) is selected for data cleaning. As shown in Table 1, according to different thresholds, the images of different resolutions are binarized and the maximum contour is extracted. The area can be obtained by selecting the largest contour for calculation. S (Converted area based on 1600 pixels × 1600 pixels resolution), number of valid data points (number of valid samples in the data set) E , In-sample dispersion Sw , cleaning guidelines Jw And several other parameters. See Table 1.
[0049]
[0050] From Table 1, we can see that the maximum cleaning criterion coefficient can be obtained in the rasterized image with a resolution of 200 pixels × 200 pixels, and the threshold is 1. Figure 7 , Figure 8 As shown, Figure 7 a refers to the smooth convex hull, Figure 7 b refers to the original outline. In order to test the applicability of the present invention, the experiment also selected two other photovoltaic power stations in a certain place (place X) (namely, the second photovoltaic power station and the third photovoltaic power station mentioned above) for verification. When the method proposed in the present invention is used for data cleaning, when the threshold is 2 and the resolution is 100 pixels × 160 pixels, the cleaning criterion system of the second photovoltaic power station is the largest; when the threshold is 3 and the resolution is 100 pixels × 160 pixels, the cleaning criterion coefficient of the third photovoltaic power station is the largest. The cleaning results are shown in Figure 2. Fig. 9 , Fig.10 shown.
[0051] In summary, the present invention provides a photovoltaic data cleaning method based on raster data image processing, which rasterizes the irradiance-power scattered data after simple cleaning, and generates rasterized images of different resolutions according to different raster step sizes. The rasterized image is subjected to image processing technology, such as opening operation, contour extraction, filtering processing, etc., to select the contour that meets specific standards as the best contour, and then select the scattered data within the contour as the data to be retained. The present invention introduces a photovoltaic data cleaning method based on image processing, which significantly improves the data processing quality and efficiency. Experiments have shown that the cleaned data used in the power generation prediction model can improve the accuracy by more than 4% compared with the traditional method, and reduce the prediction cost by more than 12%. Through image data and visual processing technology, the technical bias of traditional methods is overcome, and the hidden patterns in the data, such as periodic fluctuations and unconventional change trends, are revealed, which brings good economic benefits to photovoltaic data processing.
Claims
1. A photovoltaic data cleaning method based on raster data image processing, characterized in that It includes the following steps: S1: Photovoltaic data collection and preliminary cleaning, obtain photovoltaic data, first perform preliminary data cleaning and delete abnormal data; S2: Data rasterization and image processing: Through rasterization processing, the collected data is mapped to grid blocks. Considering the characteristics of night data, the data needs to be corrected to avoid image distortion. The corrected raster data is mapped into different colors through numerical values to complete the image processing of raster data and form images under different resolution conditions to meet different analysis needs. S3: Image opening and contour extraction: The image generated in step S2 is opened by image processing technology, first corroded and then expanded to eliminate noise, separate the contours of dense areas and smooth the boundaries of large contours. After the opening, the image is binarized and the main contours in the data are extracted by setting appropriate thresholds to achieve the cleaning goal. S4: Maximum contour extraction and resolution selection. After the image opening operation and contour extraction, the maximum contour areas extracted at different resolutions are counted and compared. According to the threshold selection of images with different resolutions, a 4-fold relationship is presented. On this basis, area alignment is performed, and the appropriate image resolution is selected. The maximum contour area is obtained with the minimum threshold. S5: Weight determination, discreteness calculation, and cleaning effect evaluation. The weight is determined according to the number of times each value appears in the data matrix. The weighted discreteness is calculated using the weight to determine the degree of data concentration. A smaller intra-class discreteness indicates that the data cleaning effect is good. Finally, the results of weight determination and discreteness calculation are combined with the needs of actual photovoltaic short-term power prediction to quantitatively evaluate the data cleaning effect.
2. The photovoltaic data cleaning method based on raster data image processing according to claim 1 is characterized in that Step S1 comprises: S1.1: Accurately collect photovoltaic data from the sensor system of the photovoltaic station. Photovoltaic data includes important radiation data such as total light radiation, direct radiation, and scattered radiation. The total light radiation is the sum of direct radiation and scattered radiation. The radiation data collection frequency is once every 15 minutes to ensure that the subtle characteristics of data changes are captured and the data quality and integrity are ensured; S1.2: Perform preliminary data cleaning and preprocessing, including deleting abnormal data and processing missing data, to ensure the accuracy and reliability of subsequent analysis. The abnormal data refers to the data in which only one of the total light radiation and power generation data is 0.
3. The photovoltaic data cleaning method based on raster data image processing according to claim 1 is characterized in that Step S2 comprises: S2.1: Map the photovoltaic data to the grid blocks through the rasterization process. The installed capacity of a photovoltaic station is 150MW, and the standard total radiation range is 0-1500W / m². In the rasterization process, the ratio of the standard total radiation to the installed capacity is 1W / m²:1KW, and finally 1600×1600 grid blocks are generated. The photovoltaic data is mapped to the grid blocks, and the amount of data in each grid block is counted to generate a rasterized data table; S2.2: After rasterization, the generated raster data is corrected. In particular, considering the characteristics of night data, the data volume of the grid block (0,0) is corrected. The grid block (0,0) represents the data with the lowest radiation or no radiation. The correction method is to replace it with the maximum value in other grid blocks to avoid image distortion. Subsequently, the raster data is converted into images of different colors through numerical mapping.
4. The photovoltaic data cleaning method based on raster data image processing according to claim 1 or 2, characterized in that Step S3 comprises: S3.1: Before extracting the contour, the rasterized image must be grayscaled and binarized, and the color image must be converted into a grayscale image and then into a binary image to simplify the image data and highlight the target contour features; S3.2: Open operation is adopted to corrode the image first and then dilate it, that is, first use the corrosion formula Calculate and then use the expansion formula Dilate the image to eliminate small pixels, separate narrow areas in the contour, and smooth the boundaries of large contours, that is, eliminate noise points and smooth the contour edges through erosion and dilation processing to ensure that the largest contour area is extracted to contain valid data; S3.3: Extract the main contours. The method of extracting the main contours is that the image after resolution reduction needs to be restored to the original resolution eventually, so subsequent restoration processing must be performed. Multiple sets of processing flows are designed. The only difference is the resolution of the image. The resolution of adjacent images differs by 4 times. When selecting the opening operation and binarization threshold, the threshold selection of adjacent images should differ by 4 times to ensure adaptability to images of different resolutions.
5. The photovoltaic data cleaning method based on raster data image processing according to claim 1 is characterized in that Step S4 comprises: S4.1: Balance the relationship between threshold selection and contour area to count and select the maximum contour extraction and appropriate image resolution. According to the results after opening operation, contour extraction and smoothing, the maximum contour area statistics of adjacent images are obtained. The threshold selection between adjacent images is 4-fold alignment. When counting the contour area, the corresponding area alignment operation is required to ensure that the contour area of the image with smaller resolution is correspondingly expanded by 4 times. The minimum threshold is selected to obtain the maximum contour area. The balance point between the threshold and the image resolution is found to determine the appropriate parameters for contour extraction; introduce weights, and the determination of weights involves the following steps: first, extract all coordinates of each value in the matrix to form a coordinate set; second, regard these coordinates as a sample set, and use the number of samples as weights; finally, apply these weights to calculate the weighted discreteness to ensure that the number of samples is correctly considered; S4.2: The corrected raster data will be further converted into images through value-to-color mapping. In this way, different data values will correspond to pixels of different colors, thereby intuitively presenting the data distribution and highlighting abnormal data points.
6. The photovoltaic data cleaning method based on raster data image processing according to claim 1 is characterized in that Step S5 includes: S5.1: Weight selection and dispersion calculation. The data cleaning process is a clustering process, in which the dispersion within the class Used to evaluate the effect of data cleaning. The goal of cleaning is to pursue a smaller intra-class discreteness. While ensuring the amount of data, appropriate weights are selected. The weight determination step is to first extract all coordinates in the matrix for each value to form a coordinate set, and then regard all coordinates of the value as a sample set. When calculating the weighted discreteness, use the number of samples as the weight so that the weight of each sample is equal to the number of times the value appears in the matrix. Then, according to the weighted discreteness calculation formula, these weights are applied to calculate the discreteness to ensure that the number of samples is correctly applied as the weight. To achieve this step, a cleaning guideline is provided. , The formula is , when S Take the maximum value, When taking the minimum value, can achieve the maximum value; ,in, S is the area, which is the converted area based on a resolution of 1600 pixels × 1600 pixels. N is the total amount of data, k is the sample size, It is i The number of data points for each sample, It is i The discreteness matrix of samples, , is the weighted discreteness, n is the sample size, It is i The coordinates of the samples, are the coordinates of the sample mean, It is i The weight of the samples, Indicates i The Euclidean distance between a sample and the sample mean; After cleaning by the above method, the number of valid data points is counted E , and the valid data points E are used for further analysis and calculation; S5.2: Quantitatively evaluate the data cleaning effect, using the method of step S5.1 above, the fusion Pearson correlation coefficient interpolation method, and the cubic spline interpolation method. In the quantitative evaluation process, the data cleaned by these three methods are substituted into the CS-LSTM model for training; the power prediction algorithm that supports short-term photovoltaic data set training is the CS-LSTM algorithm model. The CS-LSTM algorithm model is an algorithm that combines CNN and LSTM. When setting training parameters, the algorithm adopts an automatic adjustment parameter method. When the loss value does not change after 20 training cycles, it will automatically stop, and the learning rate will also be linearly adjusted according to the loss value.
7. The photovoltaic data cleaning method based on raster data image processing according to claim 6 is characterized in that Step S5.2 also includes: by calculating the accuracy and mean square error of the method of step S5.1 above and the three conditions of integrating Pearson correlation coefficient interpolation method and cubic spline interpolation, the actual effect is comprehensively evaluated, and the cleaning of photovoltaic data is used as the power prediction of photovoltaic stations. The accuracy of power prediction is an indicator for testing the prediction effect. The short-term prediction accuracy forecast formula is as follows: , , in, NRMSE represents the normalized root mean square error, Indicates t The predicted photovoltaic power value at a time point is Indicates t The actual value of photovoltaic power at a time point, Cap Indicates installed capacity, PA Indicates the prediction accuracy.
8. The photovoltaic data cleaning method based on raster data image processing according to claim 6 is characterized in that The area obtained in step S5 is S , Number of valid data points E , In-sample dispersion , Cleaning Guidelines Parameters, and then calculate the mean square error and photovoltaic short-term power prediction accuracy. The mean square error reflects the average deviation between the model prediction value and the actual observation value. The photovoltaic short-term power prediction accuracy is a quantitative evaluation of the cleaning effect. S The converted area is based on a resolution of 1600 pixels x 1600 pixels.
Citation Information
Patent Citations
Pavement crack digital image extraction, crack repair and crack parameter calculation method
CN112419250A
METHOD FOR DETERMINING THE DEGRADATION OF ARABLE LAND BASED ON REMOTE SENSING OF THE EARTH
EA202292093A1
