A wind power output clustering method and system based on a DTW-Kmedoids algorithm

By improving the DTW-Kmedoids algorithm to process the nonlinear characteristics of wind power output data, optimizing cluster number selection and establishing performance evaluation indicators, the representativeness and stability issues in wind power output scenario generation are resolved, providing more accurate grid dispatch support.

CN119807791BActive Publication Date: 2025-11-21GUIZHOU POWER GRID CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411767787.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-11-21
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

Existing methods for generating wind power output scenarios have limited effectiveness when processing nonlinear data, generate scenarios with poor representativeness, are sensitive to initial parameters leading to unstable clustering results, and lack automated cluster number selection and effect evaluation mechanisms.

Method used

An improved DTW-Kmedoids algorithm is adopted to calculate the similarity of wind power output curves through dynamic time bending distance, and the Kmedoids clustering algorithm is combined to optimize the center point. The elbow rule is used to determine the optimal number of clusters, and a clustering effect evaluation index system is established.

Benefits of technology

The generated wind power output scenarios are more representative and stable, effectively covering data diversity, providing reliable grid dispatch and planning support, and improving the reliability and applicability of the clustering process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807791B_ABST
    Figure CN119807791B_ABST
Patent Text Reader

Abstract

The application discloses a wind power output clustering method and system based on a DTW-Kmedoids algorithm, relates to the technical field of wind power output scene generation, and comprises the following steps: interpolating, reducing the dimension, normalizing and smoothing processing of wind power historical data; adopting a dynamic time warping (DTW) algorithm to perform distance measurement, adopting a Kmedoids clustering algorithm to perform iteration, obtaining a clustering result, and outputting the center curve of each cluster; calculating the error sum of squares of each cluster for the clustering results of different cluster numbers, and adopting an elbow rule to determine the optimal cluster number; generating a typical wind power output scene curve according to the clustering result under the optimal cluster number, and establishing a clustering effect evaluation index system. The application introduces the dynamic time warping distance algorithm, can adapt to the nonlinear change of the wind power output curve, improves the accuracy of similarity measurement through dynamic matching of time series, makes the generated typical scene more representative, makes the clustering center point more representative, and further makes the stability of the generated wind power output scene better.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wind power output scene generation technology, and in particular to a wind power output clustering method and system based on the DTW-Kmedoids algorithm. Background Technology

[0002] Existing methods for generating wind power output scenarios typically employ clustering and time series similarity analysis techniques, including K-means and K-medoids clustering algorithms, and Dynamic Time Warp (DTW) distance methods. K-means clustering is widely used and suitable for large-scale data segmentation and center scene generation, but it is sensitive to initial conditions and has limited effectiveness when handling nonlinear data. K-medoids selects actual samples as center points, making it suitable for small-scale data but highly dependent on the selection of initial center points. The DTW algorithm performs excellently in time series similarity calculations, especially suitable for analyzing nonlinear variations in wind power output, but its computational cost is high when combined with clustering algorithms. While these techniques can generate relatively typical wind power output scenarios, they are insufficient in handling data complexity and nonlinear characteristics.

[0003] While existing methods have achieved some success in scene generation, they still have shortcomings. First, traditional clustering methods have limited effectiveness in handling nonlinear data, resulting in poor representativeness of the generated scenes. Second, existing methods are sensitive to initial parameters, particularly lacking stability in the selection of centroids and cluster numbers, leading to unstable clustering results. Furthermore, cluster number selection is crucial, but existing methods lack automated optimization criteria, making it difficult to ensure that the generated typical scenes fully encompass data diversity. In addition, most existing technologies lack a systematic clustering performance evaluation mechanism, making it difficult to comprehensively assess clustering quality.

[0004] Therefore, how to effectively handle the nonlinear characteristics of data, optimize the selection of cluster numbers, and systematically evaluate the clustering effect when generating representative wind power output scenarios is an urgent problem to be solved by those skilled in the art.

[0005] This solution addresses the shortcomings of existing wind power output scenario generation methods by proposing a novel approach based on improved Dynamic Time Warping Distance (DTW) and Kmedoids clustering algorithms to construct more representative wind power output scenarios. First, this invention introduces DTW distance calculation to adapt to the nonlinear characteristics of wind power output curves, and improves the accuracy of similarity measurement through dynamic time series matching. Second, the improved Kmedoids algorithm incorporates the elbow rule during clustering to determine the optimal number of clusters, ensuring a reasonable and representative number of generated scenarios. Furthermore, this solution establishes a set of clustering effect evaluation metrics to systematically analyze and optimize clustering results, thereby improving the quality and stability of typical scenarios. This approach aims to solve problems in existing technologies such as poor representativeness of typical scenarios, unreasonable cluster selection, and difficulty in evaluating clustering effects, providing more accurate and reliable data support for wind power output scheduling and planning in power systems. Summary of the Invention

[0006] In view of the above-mentioned problems, the present invention is proposed.

[0007] Therefore, the problems this invention aims to solve are: how to address the limited effectiveness of traditional clustering methods in handling nonlinear data and the poor representativeness of the generated scenarios; the sensitivity of existing methods to initial parameters, particularly the lack of stability in the selection of centroids and cluster numbers, leading to unstable clustering results. Furthermore, cluster number selection is crucial, but existing methods lack automated optimization criteria, making it difficult to ensure that the generated typical scenarios fully encompass data diversity. In addition, most existing technologies lack a systematic clustering performance evaluation mechanism, making it difficult to comprehensively assess clustering quality.

[0008] To address the aforementioned technical problems, this invention provides the following technical solution: a wind power output clustering method based on the DTW-Kmedoids algorithm, comprising: interpolating, reducing dimensionality, standardizing, and smoothing historical wind power data; using the Dynamic Time Warping (DTW) algorithm for distance measurement, iterating using the Kmedoids clustering algorithm to obtain clustering results, and outputting the center curve of each cluster; calculating the sum of squared errors of each cluster for clustering results with different numbers of clusters, and determining the optimal number of clusters using the elbow rule; generating typical wind power output scenario curves based on the clustering results with the optimal number of clusters, and establishing a clustering effect evaluation index system.

[0009] As a preferred embodiment of the wind power output clustering method based on the DTW-Kmedoids algorithm described in this invention, the interpolation, dimensionality reduction, normalization, and smoothing processes include: completing missing data in historical wind power output data using cubic spline interpolation; performing dimensionality reduction processing on the data by averaging the wind power output values ​​within the same hour to obtain the hourly wind power output value, thus obtaining the 24-hour wind power output curve for the day, denoted as P.t24 ={P1,P2,...,P 24 The data is standardized by dividing the wind power output data by the total installed capacity of wind turbines to obtain the per-unit value of wind power output. Mean smoothing is then used to smooth the data, removing short-term fluctuations and noise from the wind power output curve. The 24-hour wind power output curve P is then input. t24 Smoothing threshold θ s Smoothing times N s Calculate the absolute value of the difference between two consecutive data points, denoted as ΔP. i =P i -P i-1 If ΔP i Less than the smoothing threshold θ s If ΔP is not smoothed, the data remains unchanged. i Less than the smoothing threshold θ s Then for data point P i Perform smoothing and update P. i The value is represented as:

[0010]

[0011] Repeat the steps until the number of smoothing operations reaches N. s Output the smoothed historical wind power output curve P.

[0012] As a preferred embodiment of the wind power output clustering method based on the DTW-Kmedoids algorithm described in this invention, the output of the center curve of each cluster includes: calculating the similarity between each wind power output curve using the Dynamic Time Bending Distance (DTW) algorithm, generating a distance matrix, and using the distance matrix as a basis, performing multiple iterations of the Kmedoids clustering algorithm to optimize the position of the center curve of each cluster, obtaining a clustering result containing the optimal number of clusters and the center curve of each cluster; calculating the DTW distance between any two wind power output curves using the Dynamic Time Bending Distance (DTW) algorithm; and randomly selecting K curves from the dataset as initial cluster center points, represented as:

[0013] C = {C1, C2, ..., C} K}

[0014] Among them, C k It is a historical wind power output curve P j The complete time series; calculate P for each curve. j The DTW distance from all center curves will be used to determine the curve P. j Assigned to the center C with the smallest distance from DTW k The cluster it belongs to is represented as:

[0015]

[0016] Among them, Dis(P) j C k ) is P j and C k The DTW distance between them; for each cluster k, a new center curve is selected within the cluster such that the average DTW distance between the center curve and other curves within the cluster is minimized, expressed as:

[0017]

[0018] Where, N k Let k be the number of curves in cluster k; repeat the iteration, gradually optimizing the position of the center curve until the center curve stops updating or the preset iteration limit is reached; after the iteration is completed, output the center curve C of each cluster. k .

[0019] As a preferred embodiment of the wind power output clustering method based on the DTW-Kmedoids algorithm described in this invention, wherein: the DTW distance includes if there are two historical wind power output curves, respectively P j ={P j,1 ,P j,2 ,...,P j,24} and P k ={P k,1 ,P k,2 ,...,P k,24}; Construct a cost matrix, defining a 24×24 dimensional cost matrix d, where each element d(m,n) represents the Euclidean distance between time m and n, expressed as:

[0020]

[0021] Among them, P j,m For P j The point P at time m on the curve k,n For P k The point at time n on the curve; construct a cumulative distance matrix, define a cumulative distance matrix D, and record the minimum cumulative distance on the path. During initialization, let the cumulative distance of the starting point D(1,1) = d(1,1), and set the elements of the first row and first column to the cumulative distance to each point. Calculate the cumulative distance D(m,n) at any position, expressed as:

[0022] D(m,n)=d(m,n)+min(D1,D2,D3)

[0023] Where D1 = D(m-1,n) represents the distance from the top to (m,n), D2 = D(m,n-1) represents the distance from the left to (m,n), and D3 = D(m-1,n-1) represents the distance from the top left to (m,n). The optimal traversal path is determined by finding an optimal traversal path W from the top left corner to the bottom right corner. Each point on the path represents P. j and P k The alignment relationship between the two sequences is such that the alignment error is minimized. The optimal traversal path W is a set of points, represented as:

[0024] W = {(m1,n1),(m2,n2),...,(m L ,n L )}

[0025] Where L is the path length; the path must satisfy boundary conditions, monotonicity conditions, and continuity conditions; the boundary conditions refer to the path starting at (1,1) and ending at (24,24); the monotonicity conditions refer to the path's inversion of m and n, which must satisfy m... l+1 ≥m l And n l+1 ≥n l The continuity condition refers to the fact that adjacent points on the path can only move in the horizontal, vertical, or diagonal directions; tracing back along the cumulative distance matrix D, the shortest path that satisfies the condition is the optimal traversal path W; calculate the DTW distance, sequence P. j and P k DTW distance Dis(P) j ,P k The distance is defined as the average distance between all points on the optimal traversal path W, expressed as:

[0026]

[0027] Among them, Dis(P) j ,P k ) is P j and P k The DTW distance between them.

[0028] As a preferred embodiment of the wind power output clustering method based on the DTW-Kmedoids algorithm described in this invention, the determination of the optimal number of clusters includes, for each possible number of clusters K, after completing Kmedoids clustering, calculating the sum of squared errors SSE for each cluster, that is, the sum of squared distances from the data point to the center of its cluster, expressed as:

[0029]

[0030] A small SSE value indicates a tight clustering result. Calculate the SSE value for each cluster number, and plot an elbow plot with the number of clusters K on the horizontal axis and the SSE value on the vertical axis. Determine the optimal number of clusters K based on the elbow plot. best The K value corresponding to the elbow is the optimal number of clusters.

[0031] As a preferred embodiment of the wind power output clustering method based on the DTW-Kmedoids algorithm described in this invention, the generation of typical wind power output scenario curves includes determining the optimal cluster number K. best The historical wind power output data was clustered using DTW-Kmedoids to obtain clustering results. The center curve of each cluster was used as the curve of a typical wind power output scenario, forming a typical wind power output scenario set Ω. P A clustering performance evaluation index system was constructed to quantitatively assess the clustering performance.

[0032] As a preferred embodiment of the wind power output clustering method based on the DTW-Kmedoids algorithm described in this invention, the clustering effect evaluation index system includes the intra-cluster average distance, and the intra-cluster average distance Intra k A smaller value indicates that the data points within the cluster are densely distributed, resulting in a good clustering effect.

[0033]

[0034] Among them, Intra k C is the average distance within the cluster. k Let N be the center curve of cluster k. k Let Inter be the number of curves in cluster k; a large average distance Inter between clusters indicates a high degree of separation between different clusters, expressed as:

[0035]

[0036] Where M is the cluster combination number, which is equal to the number of combinations of randomly selecting any 2 elements from cluster K, and C... k and C l These are the center curves of clusters k and l, respectively; the i-th historical wind power curve P. i24 Profile coefficient SC i Represented as:

[0037]

[0038] Where, α i Let β be the average DTW distance between sample i and other curves in the same cluster. i The average DTW distance between sample i and the nearest other intracluster curves; the average silhouette coefficient of all samples is calculated. The quality of the entire cluster is evaluated as follows:

[0039]

[0040] Intra k Inter-cluster average distance (Inter), average profile coefficient The three indicators constitute the evaluation index system for clustering effect.

[0041] Another objective of this invention is to provide a system for wind power output clustering based on the DTW-Kmedoids algorithm, which solves a wind power output clustering problem based on the DTW-Kmedoids algorithm by constructing a wind power output clustering system.

[0042] To address the aforementioned technical problems, this invention provides the following technical solution: a wind power output clustering system based on the DTW-Kmedoids algorithm, comprising a data processing module, a clustering module, an optimal cluster number determination module, and a system establishment module; the data processing module is used to perform interpolation, dimensionality reduction, per-unitization, and smoothing processing on historical wind power data; the clustering module is used to perform distance measurement using the Dynamic Time Warping (DTW) algorithm, iterate using the Kmedoids clustering algorithm, obtain clustering results, and output the center curve of each cluster; the optimal cluster number determination module is used to calculate the sum of squared errors of each cluster for clustering results with different cluster numbers, and determine the optimal cluster number using the elbow rule; the system establishment module is used to generate typical wind power output scenario curves based on the clustering results under the optimal cluster number, and establish a clustering effect evaluation index system.

[0043] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of a wind power output clustering method based on the DTW-Kmedoids algorithm as described above.

[0044] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a wind power output clustering method based on the DTW-Kmedoids algorithm as described above.

[0045] The beneficial effects of this invention are as follows: The wind power output clustering method based on the DTW-Kmedoids algorithm introduced in this invention incorporates the Dynamic Time Warp (DTW) distance algorithm, which can adapt to the nonlinear changes in wind power output curves. By dynamically matching time series, the accuracy of similarity measurement is improved, making the generated typical scenarios more representative. The improved Kmedoids clustering algorithm reduces the sensitivity to initial conditions, making the cluster centers more representative, thus resulting in better stability of the generated wind power output scenarios and providing more reliable data support for grid dispatch and planning. The elbow rule is used to determine the optimal number of clusters, effectively solving the problem of relying on empirical judgment for cluster number selection in traditional clustering methods. This ensures that the generated scenarios effectively cover the diversity of wind power output while avoiding over- or under-clustering, improving the rationality of the scenarios. This invention establishes a systematic clustering effect evaluation index, comprehensively analyzes and optimizes the generated typical scenarios, ensuring scenario quality while improving the reliability and applicability of the clustering process. Attached Figure Description

[0046] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 The flowchart shows a wind power output clustering method based on the DTW-Kmedoids algorithm provided in the first embodiment of the present invention.

[0048] Figure 2 The first embodiment of the present invention provides an overall flowchart of a wind power output clustering method based on the DTW-Kmedoids algorithm.

[0049] Figure 3 The diagram shows a structure of a wind power output clustering system based on the DTW-Kmedoids algorithm, which is provided as a second embodiment of the present invention. Detailed Implementation

[0050] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0051] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0052] Example 1, referring to Figure 1 and Figure 2 This is the first embodiment of the present invention, which provides a wind power output clustering method based on the DTW-Kmedoids algorithm, including: interpolating, reducing dimensionality, standardizing and smoothing historical wind power data; using the Dynamic Time Warping (DTW) algorithm for distance measurement, iterating with the Kmedoids clustering algorithm to obtain clustering results, and outputting the center curve of each cluster; calculating the sum of squared errors of each cluster for clustering results with different numbers of clusters, and determining the optimal number of clusters using the elbow rule; generating typical wind power output scenario curves based on the clustering results with the optimal number of clusters, and establishing a clustering effect evaluation index system.

[0053] This invention pertains to the technical field of wind power output scenario generation, with a particular focus on extracting representative wind power output scenarios through clustering algorithms to support grid dispatch and optimization. The wind power output scenario generation technology aims to analyze the characteristics of wind power output and provide reliable power prediction and dispatch data through the construction of typical scenarios, thereby improving the controllability of wind power output and the stability of the power system. This field involves multiple technical directions, including data processing, cluster analysis, and time series similarity measurement, and is widely used in the planning and dispatch decisions of wind power systems.

[0054] S1. Perform interpolation, dimensionality reduction, per-unit normalization, and smoothing on historical wind power data. For example... Figure 2 As shown.

[0055] S1.1 To fill in the missing data in the historical wind power output data, cubic spline interpolation is used.

[0056] S1.2 Dimensionality reduction of the data. Power data acquisition systems typically collect data at 5-minute sampling intervals, resulting in historical wind power output data with excessively high dimensionality, increasing algorithm complexity. Therefore, the average wind power output value within the same hour is taken as the wind power output value for that hour, yielding the 24-hour wind power output curve for the day, denoted as P. t24 ={P1,P2,...,P 24}

[0057] S1.3. Standardize the data by dividing the wind power output data by the total installed capacity of the wind turbines to obtain the per-unit value of the wind power output.

[0058] S1.4. The mean smoothing method is used to smooth the data, removing short-term fluctuations and noise in the wind power output curve, making the time series more stable, thereby improving the effect of subsequent clustering, as detailed below:

[0059] S1.4.1 Input 24-hour wind power output curve P t24 Smoothing threshold θs Smoothing times N s .

[0060] S1.4.2 Calculate the absolute value of the difference between two consecutive data points, denoted as ΔP. i =P i -P i-1 .

[0061] S1.4.3, If ΔP i Less than the smoothing threshold θ s If ΔP, then no smoothing is performed, and the data remains unchanged. i Less than the smoothing threshold θ s Then for data point P i Perform smoothing and update P. i The value of is expressed mathematically as follows:

[0062]

[0063] S1.4.4, Repeat S1.4.2 to S1.4.4 until the number of smoothing operations reaches N. s Output the smoothed historical wind power output curve P.

[0064] S2. The distance measurement is performed using the Dynamic Time Warping (DTW) algorithm, and the Kmedoids clustering algorithm is used for iteration to obtain the clustering results. The center curve of each cluster is output.

[0065] The similarity between the wind power output curves is calculated using the Dynamic Time Warp Distance (DTW) algorithm to generate a distance matrix. Based on this matrix, the center curve position of each cluster is optimized through multiple iterations using the Kmedoids clustering algorithm. Finally, the clustering result containing the optimal number of clusters and the center curve of each cluster is obtained.

[0066] S2.1 Calculate the DTW distance between any two wind power output curves using the Dynamic Time Warp Distance (DTW) algorithm, as follows:

[0067] Assume there are two historical wind power output curves, namely P j ={P j,1 ,P j,2 ,...,P j,24} and P k ={P k,1 ,P k,2 ,...,P k,24},

[0068] S2.1.1 Constructing the cost matrix:

[0069] Define a 24×24 dimensional cost matrix d, where each element d(m,n) represents the Euclidean distance between time points m and n, reflecting the matching cost of the sequence at different time points. Its mathematical expression is as follows:

[0070]

[0071] S2.1.2 Constructing the cumulative distance matrix:

[0072] Define a cumulative distance matrix D to record the minimum cumulative distance along the path. Initialize the cumulative distance at the starting point as D(1,1) = d(1,1), and set the elements of the first row and first column to the cumulative distance to each point, ensuring the path extends from the starting point to the edge of the matrix. Then calculate the cumulative distance D(m,n) at any position, with the following mathematical expression:

[0073] D(m,n)=d(m,n)+min(D1,D2,D3)

[0074] Where D1 = D(m-1,n) represents the distance from the top to (m,n); D2 = D(m,n-1) represents the distance from the left to (m,n); and D3 = D(m-1,n-1) represents the distance from the top left to (m,n) (usually a continuation of the best alignment path).

[0075] S2.1.3 Determine the optimal crossing path:

[0076] The core of DTW distance is to find an optimal traversal path W from the top left corner to the bottom right corner, where each point on the path represents P. j and P k The alignment relationship between the two sequences is such that the alignment error is minimized. The optimal traversal path W is a set of points, and its mathematical expression is as follows:

[0077] W = {(m1,n1),(m2,n2),...,(m L ,n L )}

[0078] Where L is the path length, and the path must meet the following conditions:

[0079] Boundary conditions: The path starts at (1,1) and ends at (24,24).

[0080] Monotonicity condition: m and n in the path cannot backtrack, and m must satisfy the condition. l+1 ≥m l And n l+1 ≥n l .

[0081] Continuity condition: Adjacent points on the path can only move in the horizontal, vertical, or diagonal directions.

[0082] Backtracking along the cumulative distance matrix D, the shortest path that satisfies the above conditions is the optimal traversal path W.

[0083] S2.1.4 Calculate DTW distance:

[0084] Sequence P j and P k DTW distance Dis(P) j ,P k The distance () is defined as the average distance between all points on the optimal traversal path W, and its mathematical expression is as follows:

[0085]

[0086] S2.2. Randomly select K curves from the dataset as the initial cluster centers, denoted as C = {C1, C2, ..., C...} K}, where each C k It is a historical wind power output curve P j The complete time series.

[0087] S2.3. Using the method in S2.1, calculate P for each curve. j The DTW distance from all center curves will be used to determine the curve P. j Assigned to the center C with the smallest distance from DTW k The cluster it belongs to has the following mathematical expression:

[0088]

[0089] S2.4 For each cluster k, select a new center curve C within the cluster. k This minimizes the average DTW distance between the central curve and other curves within the cluster, and its mathematical expression is as follows:

[0090]

[0091] Where, N k denoted as the number of curves in cluster k.

[0092] S2.5, repeat S2.3 and S2.4 to gradually optimize the position of the center curve until the center curve stops updating or reaches the preset maximum number of iterations.

[0093] S2.6 After the iteration is complete, output the center curve C of each cluster. k .

[0094] S3. For clustering results with different numbers of clusters, calculate the sum of squared errors for each cluster and use the elbow rule to determine the optimal number of clusters.

[0095] For clustering results with different numbers of clusters, the sum of squared errors (SSE) of each cluster is calculated, and the elbow rule is used to determine the optimal number of clusters based on the SSE calculation results.

[0096] S3.1 For each possible number of clusters K, after completing the Kmedoids clustering, calculate the sum of squared errors (SSE) for each cluster, which is the sum of squared distances from each data point to the center of its cluster. Its mathematical expression is as follows:

[0097]

[0098] The smaller the SSE value, the tighter the clustering result.

[0099] S3.2 Calculate the SSE value corresponding to the clustering results for different numbers of clusters, and plot the elbow diagram with the number of clusters K as the horizontal axis and the SSE value as the vertical axis.

[0100] S3.3 Determine the optimal number of clusters K based on the elbow diagram. best In the elbow plot, locate the "elbow" position of the SSE value, which is the point where the rate of decrease in the SSE value slows significantly. The K value at the elbow position is the optimal cluster number K. best This is because increasing the number of clusters at this point has less impact on the SSE value. While increasing the number of clusters after this point can reduce SSE, the improvement in cluster density within each cluster is limited, making it difficult to significantly improve the clustering effect. Therefore, the K value corresponding to this elbow can be considered the optimal number of clusters.

[0101] S4. Based on the clustering results under the optimal number of clusters, generate typical wind power output scenario curves and establish a clustering effect evaluation index system.

[0102] Based on the clustering results under the optimal number of clusters, typical wind power output scenario curves are generated, and a clustering effect evaluation index system is established.

[0103] S4.1, Based on the optimal number of clusters K determined in S3 best The historical wind power output data was clustered using DTW-Kmedoids to obtain clustering results. The center curve of each cluster was used as the curve of a typical wind power output scenario, forming a typical wind power output scenario set Ω. P .

[0104] S4.2 Construct a clustering effect evaluation index system to quantitatively evaluate the clustering effect. The index system specifically includes the following indicators:

[0105] S4.2.1 Intra-cluster Distance:

[0106] Intra-cluster average distance kThis is used to measure the similarity between data points within each cluster and their central curve. A smaller average distance within a cluster indicates a denser distribution of data points and a better clustering effect. Its mathematical expression is as follows:

[0107]

[0108] Among them, C k The center curve of cluster k; N k denoted as the number of curves in cluster k.

[0109] S4.2.2 Inter-cluster Distance:

[0110] The average inter-cluster distance Inter measures the degree of separation between different clusters. A larger average inter-cluster distance indicates a higher degree of separation between different clusters, resulting in more discernible clustering results. Its mathematical expression is as follows:

[0111]

[0112] Where M is the cluster combination number, which is equal to the number of combinations of randomly selecting any 2 elements from cluster K; C k and C l These are the center curves for clusters k and l, respectively.

[0113] S4.2.3, Silhouette Coefficient:

[0114] The silhouette coefficient is used to measure the overall clustering effect, and the i-th historical wind power curve P i24 The silhouette coefficient SC of (hereinafter referred to as sample i) i The mathematical expression is as follows:

[0115]

[0116] Where, α i β is the average DTW distance between sample i and other curves in the same cluster; i Let be the average DTW distance between sample i and the nearest other intra-cluster curve.

[0117] Profile coefficient SC i The value of is in the range of [-1, 1]. A value close to 1 indicates good clustering, a value close to 0 indicates the sample is on the cluster boundary, and a negative value indicates the sample is more suitable to be assigned to another cluster. The quality of the entire clustering can be evaluated by calculating the average silhouette coefficient SC of all samples, and its mathematical expression is as follows:

[0118]

[0119] Intrak Inter-cluster average distance (Inter), average profile coefficient The three indicators constitute the clustering effect evaluation index system, which can evaluate the quality of clustering results from multiple perspectives such as intra-cluster compactness, inter-cluster separation, and overall clustering quality, ensuring that the generated typical wind power output scenario curves have high representativeness and accuracy.

[0120] The key point of this invention is to propose a wind power output scenario generation method based on an improved Dynamic Time Warp (DTW) distance metric and the Kmedoids clustering algorithm. This method can handle the nonlinear characteristics of wind power output data and automatically determine the optimal number of clusters by combining the elbow rule, making the generation of typical scenarios more representative and reasonable. Simultaneously, this scheme designs a clustering effect evaluation index system to systematically evaluate the clustering results, thereby improving the quality and stability of typical scenarios. This scheme significantly improves the generation effect of wind power output scenarios by optimizing the distance metric, clustering algorithm, and result evaluation mechanism, providing accurate and reliable support for new energy grid connection and power system dispatching, and has high technical innovation and practical value.

[0121] Example 2, refer to Figure 3 This is the second embodiment of the present invention, which differs from the previous embodiment in that it provides a wind power output clustering system based on the DTW-Kmedoids algorithm, including: a data processing module 100, a clustering module 200, an optimal cluster number determination module 300, and a system establishment module 400.

[0122] The data processing module 100 is used to perform interpolation, dimensionality reduction, per-unit normalization, and smoothing on historical wind power data.

[0123] The clustering module 200 is used to perform distance measurement using the Dynamic Time Warping (DTW) algorithm, and iteratively uses the Kmedoids clustering algorithm to obtain the clustering results and output the center curve of each cluster.

[0124] The optimal cluster number determination module 300 is used to calculate the sum of squared errors of each cluster based on the clustering results with different cluster numbers, and to determine the optimal cluster number using the elbow rule.

[0125] The system establishment module 400 is used to generate typical wind power output scenario curves based on the clustering results under the optimal number of clusters, and to establish a clustering effect evaluation index system.

[0126] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0127] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0128] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0129] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0130] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A wind power output clustering method based on the DTW-Kmedoids algorithm, characterized in that: include, Interpolation, dimensionality reduction, per-unit normalization, and smoothing are performed on historical wind power data; The distance measurement is performed using the Dynamic Time Warping (DTW) algorithm, and the Kmedoids clustering algorithm is used for iteration to obtain the clustering results. The center curve of each cluster is output. For clustering results with different numbers of clusters, the sum of squared errors for each cluster is calculated, and the elbow rule is used to determine the optimal number of clusters; Based on the clustering results under the optimal number of clusters, typical wind power output scenario curves are generated, and a clustering effect evaluation index system is established. The output of the center curve of each cluster includes calculating the similarity between the wind power output curves using the Dynamic Time Bending Distance (DTW) algorithm, generating a distance matrix, and using the distance matrix as a basis, performing multiple iterations through the Kmedoids clustering algorithm to optimize the position of the center curve of each cluster, thereby obtaining a clustering result containing the optimal number of clusters and the center curve of each cluster. The Dynamic Time Warp Distance (DTW) algorithm is used to calculate the DTW distance between any two wind power output curves. K curves are randomly selected from the dataset as the initial cluster centers, denoted as follows: C={C1,C2,....,C K } Among them, C k It is a historical wind power output curve P j The complete time series; Calculate P for each curve j The DTW distance from all center curves will be used to determine the curve P. j Assigned to the center C with the smallest distance from DTW k The cluster it belongs to is denoted as, Among them, Dis(P) j C k ) is P j and C k DTW distance between them; For each cluster k, a new center curve is selected within the cluster such that the average DTW distance between the center curve and other curves within the cluster is minimized. This is denoted as: Where, N k The number of curves in cluster k; Repeat the iterations to gradually optimize the position of the center curve until the center curve stops updating or reaches the preset maximum number of iterations. After the iteration is complete, output the center curve C of each cluster. k ; Determining the optimal number of clusters involves, for each possible number of clusters K, calculating the sum of squared errors (SSE) for each cluster after completing Kmedoids clustering. SSE is the sum of squared distances from each data point to its cluster center, expressed as: If the SSE value is small, it indicates that the clustering results are tight; Calculate the SSE value corresponding to the clustering results for different numbers of clusters, and plot the elbow plot with the number of clusters K as the horizontal axis and the SSE value as the vertical axis. Determine the optimal number of clusters K based on the elbow diagram. best The K value corresponding to the elbow is the optimal number of clusters.

2. The wind power output clustering method based on the DTW-Kmedoids algorithm as described in claim 1, characterized in that: The interpolation, dimensionality reduction, per-unitization and smoothing processes include using cubic spline interpolation to complete missing data in historical wind power output data. The data is dimensionality reduced by averaging the wind power output values ​​within the same hour to obtain the hourly wind power output value, thus yielding the 24-hour wind power output curve for the day, denoted as P. t24 ={P1,P2,...,P 24 }; The data is normalized by dividing the wind power output data by the total installed capacity of the wind turbines to obtain the wind power output per unit value. The mean smoothing method is used to smooth the data, removing short-term fluctuations and noise in the wind power output curve. The 24-hour wind power output curve P is input. t24 Smoothing threshold θ s Smoothing times N s Calculate the absolute value of the difference between two consecutive data points, denoted as ΔP. i =P i -P i-1 If ΔP i Less than the smoothing threshold θ s If ΔP is not smoothed, the data remains unchanged. i Less than the smoothing threshold θ s Then for data point P i Perform smoothing and update P. i The value of is represented as . Repeat the steps until the number of smoothing operations reaches N. s Output the smoothed historical wind power output curve P.

3. The wind power output clustering method based on the DTW-Kmedoids algorithm as described in claim 2, characterized in that: The DTW distance includes, if there are two historical wind power output curves, P j ={P j,1 ,P j,2 ,...,P j,24 } and P k ={P k,1 ,P k,2 ,...,P k,24 }; Construct a cost matrix, defining a 24×24 dimensional cost matrix d, where each element d(m,n) represents the Euclidean distance between time m and n, denoted as , Among them, P j,m For P j The point P at time m on the curve k,n For P k The point on the curve at time n; Construct a cumulative distance matrix, defining a cumulative distance matrix D to record the minimum cumulative distance along the path. Initialize the matrix by setting the cumulative distance of the starting point D(1,1) = d(1,1), and setting the elements of the first row and first column to the cumulative distance to each point. Calculate the cumulative distance D(m,n) at any position, represented as follows: D(m,n)=d(m,n)+min(D1,D2,D3) Where D1 = D(m-1,n) represents the distance from the top to (m,n), D2 = D(m,n-1) represents the distance from the left to (m,n), and D3 = D(m-1,n-1) represents the distance from the top left to (m,n). Determine the optimal traversal path: Find an optimal traversal path W from the top left corner to the bottom right corner, where each point on the path represents P. j and P k The alignment relationship between the two sequences is such that the alignment error is minimized. The optimal traversal path W is a set of points, denoted as: W={(m1,n1),(m2,n2),...,(m L n L )} Where L is the path length; The path needs to satisfy boundary conditions, monotonicity conditions, and continuity conditions; The boundary condition refers to the path starting at (1,1) and ending at (24,24); The monotonicity condition refers to the fact that m and n in the path cannot go back, and m must satisfy the condition. l+1 ≥m l And n l+1 ≥n l ; The continuity condition means that adjacent points on the path can only move in the horizontal, vertical, or diagonal directions; Backtracking along the cumulative distance matrix D, the shortest path that satisfies the conditions is the optimal traversal path W; Calculate the DTW distance for sequence P. j and P k DTW distance Dis(P) j ,P k The distance is defined as the average distance between all points on the optimal traversal path W, denoted as . Among them, Dis(P) j ,P k ) is P j and P k The DTW distance between them.

4. The wind power output clustering method based on the DTW-Kmedoids algorithm as described in claim 3, characterized in that: The generation of typical wind power output scenario curves includes determining the optimal cluster number K. best The historical wind power output data was clustered using DTW-Kmedoids to obtain clustering results. The center curve of each cluster was used as the curve of a typical wind power output scenario, forming a typical wind power output scenario set Ω. P ; A clustering performance evaluation index system is constructed to quantitatively assess the clustering effect.

5. The wind power output clustering method based on the DTW-Kmedoids algorithm as described in claim 4, characterized in that: The constructed clustering effect evaluation index system includes the intra-cluster average distance and the intra-cluster average distance (Intra). k A smaller value indicates that the data points within the cluster are densely distributed, resulting in good clustering performance. Among them, Intra k C is the average distance within the cluster. k Let N be the center curve of cluster k. k The number of curves in cluster k; A large average inter-cluster distance Inter indicates a high degree of separation between different clusters, denoted as , Where M is the cluster combination number, which is equal to the number of combinations of randomly selecting any 2 elements from cluster K, and C... k and C l These are the center curves of clusters k and l, respectively; The i-th historical wind power curve P i24 Profile coefficient SC i Represented as, Where, α i Let β be the average DTW distance between sample i and other curves in the same cluster. i The average DTW distance between sample i and the nearest other curve within the same cluster; By calculating the average silhouette coefficient of all samples The quality of the entire cluster is evaluated as follows: Intra k Inter-cluster average distance (Inter), average profile coefficient The three indicators constitute the evaluation index system for clustering effect.

6. A system employing a wind power output clustering method based on the DTW-Kmedoids algorithm as described in any one of claims 1 to 5, characterized in that: It includes a data processing module (100), a clustering module (200), an optimal cluster number determination module (300), and a system establishment module (400); The data processing module (100) is used to perform interpolation, dimensionality reduction, per-unit normalization and smoothing on historical wind power data; The clustering module (200) is used to perform distance measurement using the Dynamic Time Warping (DTW) algorithm, iterate using the Kmedoids clustering algorithm, obtain clustering results, and output the center curve of each cluster. The optimal cluster number determination module (300) is used to calculate the sum of squared errors of each cluster based on the clustering results of different cluster numbers, and to determine the optimal cluster number using the elbow rule; The system establishment module (400) is used to generate typical wind power output scenario curves based on the clustering results under the optimal number of clusters, and to establish a clustering effect evaluation index system.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the wind power output clustering method based on the DTW-Kmedoids algorithm according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the wind power output clustering method based on the DTW-Kmedoids algorithm as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and system for determining typical scene of rural energy supply and consumption

    CN115293924A

  • Wind power typical scene construction method and system under multi-characteristic quantity index based on improved K-means algorithm

    CN115344996A