Power prediction method, system and device based on sample clustering and storage medium

Through the power prediction method based on sample clustering, the DTW distance calculation formula is improved, isolated or weak correlation sample points are eliminated, and the power prediction model is established, which solves the problem of insufficient accuracy in the power prediction of wind power and photovoltaics in the existing technology, and improves the dynamic balance ability and new energy consumption capacity of the power system.

CN119944674AActive Publication Date: 2025-05-06NARI TECH CO LTD

Patent Information

Application Number
CN202510424282.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2025-05-06
Estimated Expiration
2045-04-07

AI Technical Summary

Technical Problem

The existing technology is difficult to achieve high-accurate wind power and photovoltaic power prediction, which leads to difficulty in dynamic balancing of the power system when load changes, affecting the new energy consumption capacity and the safety and stability of the power grid.

Method used

Using a power prediction method based on sample clustering, by obtaining the time series data of the historical samples of the power system, preprocessing and feature construction, calculating the correlation between the preferred features and the predicted target value, improving the DTW distance calculation formula, performing sample point clustering, eliminating isolated or weak correlation sample points, and establishing a power prediction model for prediction.

Benefits of technology

It improves the accuracy of power forecasts, enhances the ability to absorb new energy, ensures the safe and stable operation of the power grid, and reduces operating costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119944674A_ABST
    Figure CN119944674A_ABST
Patent Text Reader

Abstract

The invention discloses a power prediction method, system and device based on sample clustering, and a storage medium, and the method comprises the steps: obtaining a time series data set of a historical sample of a power system, carrying out the preprocessing, extracting basic features, selecting important features from the basic features, carrying out the feature construction, and obtaining derivative features; randomly extracting other features, putting the features into a plurality of sub-feature sets, and carrying out preliminary feature selection; performing optimal feature selection on the preliminary features, the important features and the derivative features; a clustering distance calculation formula is improved through the correlation and the change rate of the optimized features, the sample points are clustered, a data set obtained after the isolated or weak-correlation sample points are removed serves as a training set and a test set, an electric power prediction model is trained, and electric power prediction is conducted through the electric power prediction model. The operation cost is saved by adopting a feature grouping method, and the prediction precision is improved by predicting the time series of the power industry after noise reduction processing is carried out by introducing a sample clustering algorithm of correlation and change rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to power system prediction, and in particular to a power prediction method, device, equipment and storage medium based on sample clustering. Background Art

[0002] In recent years, new energy represented by photovoltaic and wind power will gradually replace traditional energy, showing a good development prospect. Due to the randomness and volatility of wind power and photovoltaic, their large-scale access to the power grid has brought an impact on the safe and stable operation of the power system.

[0003] Due to the difficulty in storing large amounts of electric energy and the ever-changing power demand, the system power generation should be dynamically balanced with the changes in load. Predicting the future output power of wind power and photovoltaic power in advance and reserving space for absorption based on the prediction results are important technical means to improve the level of new energy absorption and ensure the safety of the power system. The accuracy of power prediction directly affects whether the reserved absorption space is reasonable. In the case of poor prediction accuracy, in order to ensure system safety, the conventional power reserve is increased, squeezing out the space for new energy absorption, resulting in an increase in the amount of wind and solar power abandoned. Establishing a high-accuracy wind power and photovoltaic power prediction system, and scientifically formulating scheduling plans and reserving reasonable absorption space based on the prediction results are effective measures to improve the absorption capacity of new energy.

[0004] At the same time, as the basis for safe and stable dispatch, the accuracy and stabilization of load forecasting will further improve the automation level of the power grid dispatching system and enhance the degree of economic dispatching. It will become an important basis for the electricity spot market system to formulate clearing plans, affecting the reliability of clearing plans. It will also become a solid foundation for the new generation of power grid intelligent dispatching systems, providing reliable and latest load demand information for power grid decision-making.

[0005] In addition, the smooth conduct of power market bidding transactions must be based on a scientific and reasonable bidding algorithm. As the core issue of power market transactions, the ultimate goal of the bidding algorithm is to improve its economic efficiency under the conditions of safe and stable operation of the system. In this process, accurate prediction of clearing prices plays an important role.

[0006] In addition to the above prediction needs, the power industry also has many other physical quantity predictions that are of practical significance to the safe and stable operation of the power grid. All of these physical quantities have the characteristics of time series and periodicity. In this case, accurate prediction and analysis of time series becomes an urgent problem to be solved. Summary of the invention

[0007] Purpose of the invention: In view of the above shortcomings, the present invention provides a power prediction method, device, equipment and storage medium based on sample clustering to improve prediction accuracy.

[0008] Technical solution: To solve the above problems, the present invention adopts a power prediction method based on sample clustering, which includes the following steps: Obtain a time series data set of historical samples of the power system, preprocess the time series data set, extract basic features, select important features from the basic features, perform feature construction on the important features to obtain derived features, use the important features and derived features as seed features, randomly extract the remaining features from the basic features except the important features and put them into several sub-feature sets, perform preliminary feature selection on each sub-feature set to obtain preliminary features; perform feature selection on the preliminary features and seed features to obtain preferred features; The correlation between each preferred feature and the predicted target value in the power system history samples is calculated, and the absolute value of the first-order differential of the correlation and the preferred feature value is used as the weight to improve the DTW distance calculation formula between sample points; According to the improved DTW distance calculation formula, the sample points are clustered, and isolated or weakly correlated sample points are eliminated. The data set without isolated or weakly correlated sample points is used as the training set and the test set. The power prediction model is trained by the training set and the test set, and the power prediction model is used to perform power prediction.

[0009] Furthermore, the preprocessing of the time series data set includes introducing a sliding window, calculating the standard deviation of a single feature in the sliding window, and removing features with a standard deviation less than The window width of the sliding window is the number of continuous constant values.

[0010] Furthermore, the improved DTW distance calculation formula is: ; ; in, is the i-th sample point in time series A, is the jth sample point in time series B, , To specify a constant, For sample points Selected features The characteristic value of For sample points Selected features The characteristic value of For preferred features The correlation between the predicted target value and For sample points Selected features First-order differential of eigenvalue and sample points Selected features The absolute value of the difference of the first differentials of the eigenvalues, is the total number of preferred features.

[0011] Furthermore, the metric for the correlation between the preferred feature and the predicted target value includes using the maximum information coefficient MIC.

[0012] Furthermore, when clustering the sample points, the weighted mean of all sample points in each cluster in the clustering result is calculated respectively, and the weighted mean of all sample points in the data set is calculated, and the weighted mean of each cluster is compared with the weighted mean of the data set. The sample points in the clusters whose weighted means exceed the threshold range are identified as isolated or weakly correlated sample points and are removed; The calculation formula of the weighted mean of the cluster is: ; in, Cluster The number of sample points in , Cluster The optimal feature of the jth sample point The characteristic value of Select features for the jth sample point First-order differential of the eigenvalue.

[0013] Furthermore, the preliminary feature selection includes filtering selection and wrapping selection. When filtering selection is adopted, the feature correlation metric adopted includes a combination of maximum information coefficient MIC and Pearson correlation coefficient, and features with the highest maximum information coefficient MIC and Pearson correlation coefficient are alternately selected.

[0014] The present invention also adopts a power prediction system based on sample clustering, comprising: The feature selection module is used to obtain a historical sample data set of the power system, preprocess the data set, extract basic features, select important features from the basic features, perform feature construction on the important features to obtain derived features, use the important features and the derived features as seed features, randomly extract the remaining features except the important features from the basic features and put them into several sub-feature sets, perform preliminary feature selection on each sub-feature set to obtain preliminary features, perform feature selection on the sub-preliminary features and the seed features to obtain preferred features; The sample clustering module is used to calculate the correlation between each preferred feature and the predicted target value in the historical samples of the power system, and use the absolute value of the first-order differential of the correlation and the preferred feature value as weights to improve the DTW distance calculation formula between sample points; according to the improved DTW distance calculation formula, the sample points are clustered to eliminate isolated or weakly correlated sample points; The prediction module is used to use the data set with isolated or weakly correlated sample points removed as the training set and the test set, train the power prediction model through the training set and the test set, and perform power prediction through the power prediction model.

[0015] The present invention also adopts a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0016] The present invention also adopts a computer-readable storage medium on which a computer program is stored, and the computer program implements the steps of the above method when executed by a processor.

[0017] Beneficial effects: Compared with the prior art, the significant advantages of the present invention are that it uses a feature grouping method to save operating costs, and the sample clustering algorithm is used to perform noise reduction processing to improve the prediction accuracy of the time series forecast in the power industry. The clustering distance calculation introduces correlation and change rate to reflect the importance and change trends of different preferred features, and increases the weight of important features in prediction, thereby improving the prediction accuracy. The feature grouping reduces the computing power requirements and saves operating costs. The noise reduction processing based on sample clustering predicts the time series of many physical quantities in the power industry, which improves the prediction accuracy and can serve as a powerful supplement and alternative to existing prediction and analysis methods. The present invention improves the prediction capability of the time series of many physical quantities in the power industry, and provides important technical support for promoting the improvement of power balance in the power grid in the power industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a schematic diagram of the flow chart of the prediction method in the present invention.

[0019] Figure 2 It is a block diagram of the feature grouping and feature selection principles in the present invention. DETAILED DESCRIPTION

[0020] Example 1

[0021] like Figure 1 As shown, in this embodiment, a power prediction method based on sample clustering is implemented. The prediction method is mainly implemented by clustering and purifying historical data and influencing factor data. The implementation process is as follows: Due to the diversity of sources and technical and resource limitations that may occur during data collection, data quality is difficult to guarantee. There are a large number of isolated points and weakly correlated sample data in the data set, which will cause errors in the final generated prediction model and reduce prediction accuracy. To address these problems, a data set of historical samples is collected in advance, and various conventional preprocessing is performed on the data samples. Assume that the processed data set obtained at this time is . On this basis, some time and physical features are selected as important features, and feature construction, i.e. feature engineering, is carried out based on them. The obtained features are called derived features. There are many construction methods. Since it is a time series, we can first construct that each date is the natural day of the year, the natural day of the month, and each hour is the hour of the day. Secondly, we select features that are particularly important in the physical logic sense. Derived features can be the mth power of important feature values ​​(m is an integer not equal to 0), and we can also construct nth-order differences, as well as time shift the features by n time points (n is a natural number). For new energy or load-related forecasts, wind speed, wind direction, and irradiance are important features that are strongly related to physical logic. Specifically, specify wind speed of 10m (ws10), wind speed of 30m (ws30), wind speed of 50 (ws50), wind speed of 70m (ws70), wind speed of 80m (ws80), wind speed of 100m (ws100), wind speed of 120m (ws120), specify wind direction of 10m (wd10), wind direction of 30m (wd30), wind direction of 50m (wd50), wind direction of 70m (wd70), 80m wind direction (wd80), 100m wind direction (wd100), 120m wind direction (wd120), direct radiation (DirectR), scattered radiation (DiffuseR), if it is a wind power related prediction, the height range of wind speed and wind direction is usually 10m to a height slightly higher than the height of the wind turbine (in this embodiment, there are 7 wind speed related, 7 wind direction related, and 2 irradiance related, a total of 16). In addition, the rest of the meteorological data is still very large. For each type of physical characteristics representing wind speed, wind speed, wind direction, and irradiance, 2nd, 3rd, first-order differences, and second-order differences are constructed respectively, totaling 16*4=64.

[0022] Since there are so many features including the above important features and derived features, feature selection is indispensable, which inevitably requires a lot of computing power support. However, current application sites, especially distributed new energy engineering sites, usually lack such computing power. Figure 2 As shown, here, the concepts of seed features and feature grouping are introduced, and the above important features and derived features are designated as seed features, which may be recorded as SF (seed feature, in this embodiment, SF is 64). For other features, a series of sub-feature sets are established respectively, totaling M. From all the remaining available features, features are randomly extracted as much as possible and put into M sub-feature sets respectively, and the number of features contained in each sub-feature set is made as equal as possible.

[0023] Perform preliminary feature selection on each sub-feature set, and obtain n preliminary features for each sub-feature set, for a total of n*M preliminary features (in this embodiment, select M=3, n=4, then n*M=12). The preliminary feature selection can be selected by filtering selection, wrapping selection or other methods, which will not be repeated here. In this embodiment, the filtering selection method is adopted, and the maximum information coefficient (MIC) and the Pearson Correlation Coefficient (PCC) are selected as the standard for measuring the importance of feature correlation, that is, the first choice is the maximum information coefficient MIC, and the second choice is the Pearson Correlation Coefficient PCC. The features with the highest scores are selected alternately. If the selected feature has been selected, the feature with the second highest score is selected (other correlation measurement standards can be selected, and the number of correlation measurement standards can also be multiple, as long as the rotation is satisfied). After selecting M*n features for all feature subsets, if the number is still large, such as greater than a certain set value L (L=40 in this embodiment), it can be considered to group again and repeat the above steps. Feature selection is performed on the selected n*M features and SF seed features to select the final preferred features (in this embodiment, M=3, n=4, SF=64). The number of preferred features can be determined according to actual conditions.

[0024] For the data set required for training, due to equipment failure, calculation error or other reasons, there will be continuous constant values ​​or approximately constant values ​​due to superposition of noise (except for the full power state of new energy or the photovoltaic output of 0 at night). In order to remove these constant values, a sliding window is introduced, and the width of the window is the number of continuous constant values. By calculating the standard deviation of a single feature in the sliding window, the standard deviation close to 0 is removed (it can be set as needed). , is a natural number) of sample points.

[0025] In addition, there must be a large number of isolated points or data with weak correlation with the prediction target in the data set. Cluster the sample points and remove isolated or weakly correlated sample points. Since the DTW distance can better track the time offset and trend change differences, the DTW distance is selected as the measurement standard for cluster analysis. Before using DTW as the cluster distance for cluster analysis, optimize the cluster distance.

[0026] During the calculation of the DTW distance function, the calculation formula is as follows: ; in, is the i-th sample point in time series A, is the jth sample point in time series B.

[0027] In the above formula, the elements of the distance matrix are measured using the Euclidean distance. In order to reflect the importance and change trends of different selected features, the above distance matrix element distance is measured by introducing correlation and change rate. The calculation formula is improved as follows: ; in, , It is an arbitrarily specified constant used to proportionally adjust the value when the value is too small to affect the calculation accuracy. For sample points Selected features The characteristic value of For sample points Selected features The characteristic value of For preferred features The correlation between the predicted target value and For sample points Selected features First-order differential of eigenvalue and sample points Selected features The absolute value of the difference of the first differentials of the eigenvalues, is the total number of preferred features.

[0028] For any preferred feature in the data set, the correlation between it and the predicted target, i.e., the label, is calculated. In this embodiment, MIC is used as the correlation metric (other metrics can be selected according to different scenarios and effects), and normalization is performed to obtain ; At the same time, select the first-order differential of the sample point on each preferred feature , as the rate of change metric; thus, for any two sample points, the absolute value of the difference between the first-order differentials of each preferred feature of the two sample points is calculated and normalized to obtain .

[0029] Since the k-means model fitting results are often circular clusters, the cluster fitting effect for many other specific graphics is not ideal. Therefore, the Gaussian mixture model (GMM) that can fit the distribution of data of any shape is selected. Calculate the clustering results for each cluster separately. The weighted mean of all samples according to the correlation metric and first-order differential of the preferred features and the predicted target, i.e., label, is: ; in, Cluster The number of samples in Cluster The optimal feature of the jth sample point The characteristic value of Select features for the jth sample point The first-order differential of the eigenvalue. Using the same method, calculate the data set The weighted mean of all samples in the cluster. If the mean of a cluster is much higher than the mean of the data set, the cluster data is considered to be an isolated point or a weakly correlated sample. The range of excess can be adjusted according to different data sets. The data sets obtained after eliminating isolated or weakly correlated sample data are used as training sets and test sets to establish a time series prediction model, ultimately achieving the goal of significantly improving prediction accuracy.

[0030] Example 2

[0031] In this embodiment, a power prediction system based on sample clustering includes: The feature selection module is used to obtain a historical sample data set of the power system, preprocess the data set, extract basic features, select important features from the basic features, perform feature construction on the important features to obtain derived features, use the important features and the derived features as seed features, randomly extract the remaining features except the important features from the basic features and put them into several sub-feature sets, perform preliminary feature selection on each sub-feature set to obtain preliminary features, perform feature selection on the sub-preliminary features and the seed features to obtain preferred features; The sample clustering module is used to calculate the correlation between each preferred feature and the predicted target value in the historical samples of the power system, and use the absolute value of the first-order differential of the correlation and the preferred feature value as weights to improve the DTW distance calculation formula between sample points; according to the improved DTW distance calculation formula, the sample points are clustered to eliminate isolated or weakly correlated sample points; The prediction module is used to use the data set with isolated or weakly correlated sample points removed as the training set and the test set, train the power prediction model through the training set and the test set, and perform power prediction through the power prediction model.

[0032] Example 3

[0033] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0034] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0035] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0036] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0037] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.

Claims

1. A power forecasting method based on sample clustering, characterized in that: The following steps are involved: Obtain a time series data set of historical samples of the power system, preprocess the time series data set, extract basic features, select important features from the basic features, perform feature construction on the important features to obtain derived features, use the important features and derived features as seed features, randomly extract the remaining features from the basic features except the important features and put them into several sub-feature sets, perform preliminary feature selection on each sub-feature set to obtain preliminary features; perform feature selection on the preliminary features and seed features to obtain preferred features; The correlation between each preferred feature and the predicted target value in the power system history samples is calculated, and the absolute value of the first-order differential of the correlation and the preferred feature value is used as the weight to improve the DTW distance calculation formula between sample points; According to the improved DTW distance calculation formula, the sample points are clustered, and isolated or weakly correlated sample points are eliminated. The data set without isolated or weakly correlated sample points is used as the training set and the test set. The power prediction model is trained by the training set and the test set, and the power prediction model is used to perform power prediction.

2. The power forecasting method according to claim 1, characterized in that: The preprocessing of the time series data set includes: introducing a sliding window, calculating the standard deviation of a single feature in the sliding window, and removing the feature with a standard deviation less than The window width of the sliding window is the number of continuous constant values.

3. The power forecasting method according to claim 2, characterized in that: The improved DTW distance calculation formula is: ; ; in, is the i-th sample point in time series A, is the jth sample point in time series B, , To specify a constant, For sample points Selected features The characteristic value of For sample points Selected features The characteristic value of The preferred feature The correlation between the predicted target value and For sample points Selected features First-order differential of eigenvalue and sample points Selected features The absolute value of the difference of the first differentials of the eigenvalues, is the total number of preferred features.

4. The power forecasting method according to claim 3, characterized in that: The metric of the correlation between the preferred features and the predicted target value includes using the maximum information coefficient MIC.

5. The power forecasting method according to claim 3, characterized in that: When clustering the sample points, the weighted mean of all sample points in each cluster in the clustering result is calculated respectively, and the weighted mean of all sample points in the data set is calculated, and the weighted mean of each cluster is compared with the weighted mean of the data set. The sample points in the clusters whose weighted means exceed the threshold range are identified as isolated or weakly correlated sample points and are removed; The calculation formula of the weighted mean of the cluster is: ; in, Cluster The number of sample points in , Cluster The optimal feature of the jth sample point The characteristic value of Select features for the jth sample point First-order differential of the eigenvalue.

6. The power forecasting method according to claim 1, characterized in that: The preliminary feature selection includes filtering selection and wrapping selection. When filtering selection is adopted, the feature correlation metric adopted includes a combination of maximum information coefficient MIC and Pearson correlation coefficient, and the features with the highest maximum information coefficient MIC and Pearson correlation coefficient are alternately selected.

7. A power forecasting system based on sample clustering, characterized in that: include: The feature selection module is used to obtain a historical sample data set of the power system, preprocess the data set, extract basic features, select important features from the basic features, perform feature construction on the important features to obtain derived features, use the important features and the derived features as seed features, randomly extract the remaining features except the important features from the basic features and put them into several sub-feature sets, perform preliminary feature selection on each sub-feature set to obtain preliminary features, perform feature selection on the sub-preliminary features and the seed features to obtain preferred features; The sample clustering module is used to calculate the correlation between each preferred feature and the predicted target value in the historical samples of the power system, and use the absolute value of the first-order differential of the correlation and the preferred feature value as weights to improve the DTW distance calculation formula between sample points; according to the improved DTW distance calculation formula, the sample points are clustered to eliminate isolated or weakly correlated sample points; The prediction module is used to use the data set with isolated or weakly correlated sample points removed as the training set and the test set, train the power prediction model through the training set and the test set, and perform power prediction through the power prediction model.

8. The power forecasting system according to claim 7, characterized in that: The improved DTW distance calculation formula is: ; ; in, is the i-th sample point in time series A, is the jth sample point in time series B, , To specify a constant, For sample points Selected features The characteristic value of For sample points Selected features The characteristic value of The preferred feature The correlation between the predicted target value and For sample points Selected features First-order differential of eigenvalue and sample points Selected features The absolute value of the difference of the first differentials of the eigenvalues, is the total number of preferred features.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Power grid line loss prediction method and device, storage medium and equipment

    CN114781693A

  • Two-stage short-term power load prediction method based on feature selection and dimensionality reduction clustering

    CN117713037A

Cited By

  • Characteristic distance measurement method and system for dimension reduction visualization of power system data

    CN121705756A

  • Dam deformation prediction method and system

    CN121935893A