Small hydropower station cluster planning and grouping method, equipment and medium
By constructing a multi-dimensional clustering analysis framework and an improved k-means++ algorithm, the problems of data acquisition difficulties and unreasonable grouping in the partitioning of small hydropower plant clusters were solved, and adaptive cluster planning and grouping were realized, improving the automation and practicality of small hydropower plant cluster partitioning.
Patent Information
- Application Number
- CN202511322560.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-16
- Publication Date
- 2026-02-10
AI Technical Summary
Existing methods for dividing small hydropower clusters rely on high-precision real-time data that is difficult to obtain, ignore watershed hydrological characteristics, and lack the integration of domain knowledge in traditional k-means algorithms, resulting in unreasonable grouping schemes that are difficult to apply effectively in the field of small hydropower.
A multi-dimensional clustering analysis framework is constructed, integrating geospatial features and watershed features. An improved k-means++ algorithm is adopted, and the optimal number of clusters is automatically determined through a multi-dimensional evaluation index system to generate a small hydropower station cluster grouping scheme.
Under conditions of data scarcity, an adaptive grouping of small hydropower station clusters was achieved, providing a cluster partitioning scheme with reasonable spatial distribution and unified watershed attributes, thereby improving the automation and practicality of the partitioning.
Smart Images

Figure CN121504227A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of power system and renewable energy scheduling, and particularly relates to a small hydropower cluster planning grouping method, equipment and medium. BACKGROUND
[0002] With the global energy transformation, the division and scheduling of distributed energy clusters have made some progress. Existing researches mostly start from the perspective of power grid coupling characteristics, such as considering line resistance, voltage sensitivity, power transmission distribution factor, active power angle sensitivity and other electrical characteristics for clustering of distributed energy; there are also researches directly using geographical location and administrative boundaries as the basis for cluster division for subsequent management and coordination; in addition, clustering analysis methods using historical operation data of large-scale renewable small hydropower stations have also been proposed. However, the current small hydropower cluster division method has three major technical bottlenecks: first, most existing distributed energy division methods rely on high-precision real-time data or monitoring grids, while small hydropower stations are limited by communication, monitoring equipment and environmental factors, and often cannot obtain continuous, complete and uniform format data, further exacerbating the difficulty of analysis and modeling in the context of hydropower; second, simply using administrative boundaries or geographical proximity principles ignores the influence of watershed hydrological characteristics on power generation synergy, resulting in unreasonable division of small hydropower stations in the same watershed; third, the traditional k-means algorithm relies on manual preset cluster number and lacks an evaluation system that integrates domain knowledge, making it easy to produce grouping schemes that are not feasible in engineering. The above technical deficiencies make it difficult for division models based on electrical characteristics or data-driven to play a role in the field of small hydropower, so there is an urgent need for a cluster division method suitable for the context of small hydropower. SUMMARY
[0003] In view of the above existing problems, the present application is proposed.
[0004] Therefore, the present application provides a small hydropower cluster planning grouping method, which can overcome the shortcomings of existing research cluster division methods in data-driven, clustering rationality and engineering scenario applicability. Specifically, the method constructs a multi-dimensional clustering analysis framework integrating geographical spatial features, watershed features and domain professional knowledge around the core needs of small hydropower cluster management, and realizes adaptive grouping of small hydropower clusters through a small amount of data-driven clustering algorithm, providing a small hydropower cluster division scheme that is spatially distributed reasonably, has uniform watershed attributes and coordinated operation characteristics for regional power grid scheduling.
[0005] To solve the above technical problems, the application provides the following technical scheme: a small hydropower cluster planning grouping method, comprising the following steps: acquiring multi-source data of each small hydropower station, performing preprocessing and feature engineering, and constructing a small hydropower cluster feature space model; constructing mathematical validity indexes and field rationality indexes, and establishing a multi-dimensional evaluation index system of a k-means clustering algorithm; executing an improved k-means++ clustering algorithm, selecting an initial clustering center based on a k-means++ strategy, judging a convergence condition, and generating clustering schemes under different K values; for each clustering scheme, calculating the values of each index in the multi-dimensional evaluation index system, and generating evaluation results of the clustering schemes under different K values; based on the multi-dimensional index evaluation system, performing preliminary screening on the K values, constructing a derived evaluation index based on the sum of squared errors, assigning index weights and calculating the comprehensive scores corresponding to each K value, selecting the K value with the highest comprehensive score as the optimal clustering number, and determining the optimal clustering k value; and outputting a small hydropower cluster grouping scheme corresponding to the optimal clustering number.
[0006] As a preferred scheme of the small hydropower cluster planning grouping method, the preprocessing and feature engineering comprises acquiring multi-source data of each small hydropower station, including the longitude, latitude and basin information of each small hydropower station.
[0007] The multi-source data is cleaned and aligned to construct a basic data set.
[0008] Based on the basic data set, the Haversine formula is used to calculate the geographic distance matrix between small hydropower stations.
[0009] According to the geographic distance matrix, the average geographic proximity of each small hydropower station is extracted.
[0010] The basin labels are encoded and mapped to convert discrete basin labels into ordered numerical values.
[0011] The longitude, latitude, average geographic proximity and basin encoding information are fused to construct the feature vector of each small hydropower station, and each feature is standardized to form a standardized feature matrix.
[0012] As a preferred scheme of the small hydropower cluster planning grouping method, the calculation of the geographic distance matrix between small hydropower stations comprises the following steps: acquiring the longitude information λ i and the latitude information The spherical distance Haversine formula is used to construct the geographic distance matrix D between small hydropower stations.
[0013]
[0014] Wherein, d ijR is the average radius of the earth, and
[0015]
[0016] Δλ=λ j -λ i
[0017] wherein, is the latitude difference between two points, and Δλ is the longitude difference between two points, respectively, the latitude of the i-th small hydropower station and the j-th small hydropower station, and λ i , λ j respectively, the longitude of the i-th small hydropower station and the j-th small hydropower station.
[0018] The geographical distance matrix D is obtained by calculating the distance between all small hydropower stations two by two, the diagonal elements of the matrix are zero and satisfy the symmetry, and the expression is:
[0019]
[0020] wherein, n is the total number of small hydropower stations.
[0021] As a preferred scheme of the small hydropower cluster planning grouping method, wherein: the average geographical proximity of each small hydropower station includes extracting the average geographical proximity of each small hydropower station according to the geographical distance matrix D quantify the spatial distribution density of the small hydropower station,
[0022]
[0023] The encoding mapping of the watershed label is based on the basic data set, and the original watershed label set of the small hydropower is obtained as Ω={w1, w2,…, w m}, wherein m represents the total number of three-level watersheds in all n small hydropower stations, the discrete label is converted into a classification variable, and the classification variable is converted into ordered number watershed encoding information W i ={1, 2,…, m} through a classification mapping function.
[0024] As a preferred scheme of the small hydropower cluster planning grouping method, wherein: the mathematical effectiveness index includes the error sum of squares SSE, the contour coefficient and the Gap index.
[0025] The field rationality index includes the within-cluster watershed consistency WCI and the geographical closeness GWB.
[0026] As a preferred scheme of the small hydropower cluster planning grouping method, the improved k-means++ clustering algorithm comprises inputting feature space model data, initializing a cluster number K;
[0027] Input the constructed small hydropower feature space model data set, and initialize the current cluster number K=0;
[0028] Perform a cluster number increment operation K=K+1, randomly select K initial cluster centers from the data set based on the k-means++ initial center selection strategy;
[0029] Dynamic clustering division is realized through iterative calculation:
[0030] Calculate the Euclidean distance of each sample from all current cluster centers, and divide each sample into a temporary cluster closest to the cluster;
[0031] Recalculate the coordinates of each cluster center according to the sample distribution of the temporary cluster;
[0032] Determine whether the division result changes according to the preset convergence condition, if the change occurs, return to recalculate the Euclidean distance of each sample from all current cluster centers, continue iteration, otherwise go to the next step;
[0033] Save the cluster division scheme corresponding to the current K value, and calculate the cluster division evaluation index value through a multidimensional evaluation index system;
[0034] Calculate SSE, calculate the silhouette coefficient, calculate the Gap index, calculate WCI, calculate GWB, determine whether the current K value reaches the preset maximum cluster number N, if K<N, return to randomly select K initial cluster centers to continue the next round of cluster division, otherwise go to the next step;
[0035] Output all K∈[1,N] corresponding cluster division schemes and multidimensional evaluation index result sets to provide quantitative basis for optimal cluster number selection.
[0036] As a preferred scheme of the small hydropower cluster planning grouping method, the improved k-means++ clustering algorithm comprises inputting feature space model data, initializing a cluster number K;
[0037] Perform preliminary screening and redundancy elimination to reduce abnormal k value schemes;
[0038] Based on the elbow judgment rule according to the SSE curve, an SSE derived evaluation index is constructed;
[0039] The indexes are dimensionally converted, the original index value is squared to expand the feature difference, and each index is mapped to a [0, 1] score space through Min-Max normalization.
[0040] The weights of each index are allocated, the comprehensive score is calculated, and the optimal k value is determined.
[0041] As a preferred scheme of the small hydropower cluster planning grouping method, the elbow method based on the maximum vertical distance is used to construct a reference straight line connecting the first and last points of the SSE curve, the Euclidean vertical distance D(k) of each k value corresponding point to the current straight line is calculated, the distance is taken as the evaluation standard, and the calculation method is,
[0042]
[0043] wherein the coordinates of the first and last points of the SSE curve are P1(x1, y1) and P2(x2, y2), the SSE k (x0, y0) is the SSE value when the cluster number is k;
[0044] The elbow method based on the first-order difference is used to capture the maximum value point of the SSE descending rate through the first-order difference, the first-order difference value ΔSSE(k) is taken as the evaluation standard, and the calculation method is:
[0045] ΔSSE(k)=SSE(k-1)-SSE(k)
[0046] wherein SSE(k-1) is the error sum of squares corresponding to the cluster number k-1; and SSE(k) is the error sum of squares corresponding to the cluster number k;
[0047] The elbow method based on the second-order difference is used to calculate the second-order difference value of the SSE curve, and identify the peak point of curvature mutation, and the second-order difference value C(k) is taken as the evaluation standard:
[0048] C(k)=ΔSSE(k+1)-ΔSSE(k)
[0049] wherein ΔSSE(k+1) is the first-order difference value when the cluster number is k+1.
[0050] The application provides a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the steps of the small hydropower cluster planning grouping method when executing the computer program.
[0051] The application provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the small hydropower cluster planning grouping method when executed by a processor.
[0052] The beneficial effects of the present application: under the condition of data deficiency, by extracting two types of core features of geographic coordinates and basin attributes, the dynamic monitoring data collection problem is avoided, and the spatial topology mapping of ''meteorology-hydrology-power grid'' is constructed, which provides a feasible technical path for efficient and feasible cluster division.
[0053] The present application constructs a multi-dimensional evaluation system considering mathematical effectiveness and field rationality, deeply integrates expert experience into cluster quality evaluation, enables the improved k-means algorithm to automatically determine the optimal cluster number, significantly reduces manual intervention, and improves the automation degree and practicability of the division process. BRIEF DESCRIPTION OF DRAWINGS
[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0055] Figure 1 A small hydropower cluster planning grouping method process schematic diagram is provided for an embodiment of the present application.
[0056] Figure 2 A small hydropower cluster feature space model establishment process of a small hydropower cluster planning grouping method is provided for an embodiment of the present application.
[0057] Figure 3 A multi-dimensional evaluation index system calculation process of a small hydropower cluster planning grouping method is provided for an embodiment of the present application.
[0058] Figure 4 An improved k-means algorithm-based small hydropower cluster division algorithm framework of a small hydropower cluster planning grouping method is provided for an embodiment of the present application.
[0059] Figure 5 An optimal cluster number k value determination method process based on a multi-dimensional index evaluation system of a small hydropower cluster planning grouping method is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.
[0061] Embodiment 1, refer to Figure 1 As a first embodiment of the present application, the embodiment provides a small hydropower cluster planning grouping method, comprising:
[0062] S1: data preprocessing and feature engineering are performed, and a small hydropower cluster feature space model is constructed.
[0063] S2: a multi-dimensional evaluation index system of the k-means clustering algorithm is established by combining mathematical effectiveness indexes and field rationality indexes.
[0064] S3: an improved k-means++ clustering algorithm is executed, and clustering scheme evaluation results under different k values are generated.
[0065] S4: based on the multi-dimensional index evaluation system, the optimal clustering k value is determined.
[0066] S5: a small hydropower cluster planning grouping scheme is output.
[0067] It should be noted that the embodiment can solve the problem of how to construct a clustering model suitable for the characteristics of small hydropower stations under the condition of limited small hydropower station data; how to obtain a cluster division scheme more in line with the engineering practice of small hydropower application scenarios; the k-means algorithm is often used to solve the cluster division problem, and how to adaptively select the optimal cluster number of the clustering algorithm to reduce the manual auxiliary decision-making process.
[0068] Embodiment 2, refer to Figures 2-5 As an embodiment of the present application, based on the above embodiment, a small hydropower cluster planning grouping method is provided.
[0069] Further, in the embodiment of the present application, step S1 performs data preprocessing and feature engineering to construct a small hydropower cluster feature space model, and the specific steps include S1.1-S1.5:
[0070] S1.1, multi-source data fusion cleaning, obtaining n small hydropower station basic information, extracting the longitude data λ i , latitude data basin code information W i and other key information, through standardized cleaning and spatial attribute data alignment, forming a basic data set X b , the manifestation form is as follows:
[0071]
[0072] S1.2, geographical distance matrix modeling, on the basis of step S1.1, obtaining small hydropower geographical position longitude information λ i and latitude information The geographic distance matrix D between small hydropower stations is constructed by using the spherical distance Haversine formula. The spherical distance Haversine formula is as follows:
[0073]
[0074] In the formula, d ij is the geographic distance between the i th and j th small hydropower stations; Δλ=λ j -λ i , R = 6371 km is the average radius of the earth, is the difference in latitude between the two points, Δλ is the difference in longitude between the two points, λ i and λ j are the latitudes of the i th and j th small hydropower stations, respectively, i, j ∈ {1, 2, 3, …, n}, and n is the total number of small hydropower stations.
[0075] The geographic distance matrix D is calculated by calculating the distance between all small hydropower stations in pairs, and its diagonal elements are zero and satisfy the symmetry, which is expressed as follows:
[0076]
[0077] S1.3, Derivation of spatial density characteristics, according to the geographic distance matrix D, the average geographic proximity of each small hydropower station is extracted The spatial distribution density of small hydropower stations is quantified, and the calculation method is as follows:
[0078]
[0079] Further, when is small, it indicates that the small hydropower station is located in a high-density area, with close electrical coupling and a distributed basis for collaborative optimization, while the edge small hydropower station with a large value is usually long in transmission distance and loose in topology, and is suitable for distributed autonomous control.
[0080] S1.4, Basin coding classification mapping, the original basin label set of small hydropower is obtained as Ω = {w1, w2, …, w m}, where m represents the total number of three-level basins in all n power stations, the discrete label is converted to a classification variable, and the classification variable is converted to ordered number basin coding information W i = {1, 2, …, m} through a classification mapping function.
[0081] Further, in the small-scale same-basin scenario, the ordered number coding simplifies the data preprocessing and directly maps the business management unit, significantly improving the result interpretability.
[0082] S1.5, feature space reconstruction and standardization, according to the i-th small hydropower feature space reconstruction, longitude data λ i , latitude data average geographical proximity and basin encoding information W i , after Z-score standardization, the feature space model x i of the i-th small hydropower is constructed, which is expressed as follows:
[0083]
[0084] Where "~" represents the value after Z-score standardization, and standardization can eliminate the dimensional differences of each dimension and ensure the subsequent distance quantity and weight allocation unbiased.
[0085] Further, the feature space model of n small hydropowers The feature matrix X of n x 4 can be directly used for distance calculation between clusters in k-means algorithm. The small hydropower cluster feature space model not only integrates geographical distribution and basin coupling information, but also provides compatible input data for subsequent clustering algorithm.
[0086] Further, in the embodiments of the present application, step S2 combines mathematical effectiveness indicators and field rationality indicators to establish a multi-dimensional evaluation index system for k-means clustering algorithm, and the specific steps include S2.1-S2.2:
[0087] S2.1, construct mathematical effectiveness indicators, including sum of squared errors (SSE), silhouette coefficient and Gap index.
[0088] The sum of squared errors (SSE) index is used to measure the overall deviation between the sample points in the cluster and the cluster center, and is used to evaluate the convergence degree of the algorithm. The calculation method of SSE is as follows:
[0089]
[0090] In the formula, |C c | represents the number of samples in cluster c, K is the number of clustering clusters, μ c is the center point of the c-th cluster, and x c,p is the p-th sample in the c-th cluster.
[0091] The silhouette coefficient index is calculated based on the clustering quality of each sample, which is used to quantify the similarity of each sample point with the same cluster samples and the dissimilarity with the nearest neighbor cluster samples, thereby providing evaluation for the entire clustering result. The calculation method of the silhouette coefficient s(p) is as follows:
[0092]
[0093] In the formula, a(p) is the tightness in the same cluster, that is, the average distance of p from all other samples in the same cluster; b(p) is the separation degree of the adjacent cluster, that is, the average distance of sample p from other nearest neighbor clusters.
[0094] Further, the Gap index in the step S2.1 is an unsupervised evaluation index for determining the optimal number of clusters in the data set, which evaluates the rationality of clustering by comparing the difference between the actual data clustering result and the clustering result under the uniform reference distribution, and the calculation method of the Gap index is as follows:
[0095]
[0096] In the formula, B is the generation number of the reference data set, W k is the within-cluster error sum of squares of the real data when the clustering is k, W kb is the within-cluster error sum of squares of the bth reference data set.
[0097] S2.2, a field rationality index is constructed, which supplements the consideration of the watershed management rules and geographical spatial characteristics according to the actual needs of the small hydropower station cluster division, and introduces two indexes of within-cluster watershed consistency (Watershed Consistency Index, WCI) and geographical within-block (Geographic Within-block, GWB).
[0098] The within-cluster watershed consistency (WCI) index is used to quantify the matching degree of the small hydropower station clustering result and the watershed management rules, and the goal is to measure whether the clustering model effectively meets the business requirement that “small hydropower stations in the same watershed should be as much as possible clustered in the same cluster”. For each cluster, the distribution of its samples in the watershed label is counted, and the watershed m with the highest proportion is selected as the dominant watershed. The calculation method of the within-cluster watershed consistency (WCI) is as follows:
[0099]
[0100] In the formula, c is the cluster number, n c, m c is the number of samples of the mth watershed in the cth cluster. c
[0101] The geographical tightness (GWB) index is used to quantify the concentration degree of each small hydropower station in the clustering result in the geographical space. The larger the value is, the more concentrated the small hydropower stations are distributed in space, which meets the requirement of geographical connectivity in engineering. The geographical tightness of the cth cluster is defined as the reciprocal of the average geographical distance between all small hydropower stations in the cluster, and the calculation method of the geographical tightness (GWB) is as follows:
[0102]
[0103] where avg_distance c is the average Haversine geographical distance between each pair of small hydropower stations within cluster c. If cluster c is a single-sample cluster, the calculation is modified to the average geographical proximity of the small hydropower station
[0104] Further, in the embodiments of the present application, step S3 performs an improved k-means++ clustering algorithm to generate clustering scheme evaluation results under different k values, and the specific steps include S3.1-S3.6:
[0105] S3.1, input the small hydropower feature space model data set constructed in step S1, and initialize the current cluster number K = 0;
[0106] S3.2, perform a cluster number increment operation K = K + 1, and randomly select K initial cluster centers from the data set based on the k-means++ initial center selection strategy;
[0107] S3.3, perform dynamic clustering division through iterative calculation:
[0108] S3.3.1, calculate the Euclidean distance of each sample from all current cluster centers, and divide each sample into the nearest cluster to form a temporary cluster;
[0109] S3.3.2, recalculate the coordinates of each cluster center according to the sample distribution of the temporary cluster;
[0110] S3.3.3, determine whether the division result changes according to the preset convergence condition, if the result changes, return to step S3.3.1 for further iteration, otherwise, proceed to step S3.4;
[0111] S3.4, save the clustering division scheme corresponding to the current K value, and calculate the cluster division evaluation index value through the multi-dimensional evaluation index system of step S2;
[0112] calculate SSE, calculate the silhouette coefficient, calculate the Gap index, calculate the watershed consistency index WCI, and calculate the geographical compactness GWB;
[0113] S3.5, determine whether the current K value reaches the preset maximum cluster number N, if K < N, return to step S3.2 to continue the next round of clustering division, otherwise, proceed to step S3.6;
[0114] S3.6, output all clustering division schemes corresponding to K ∈ [1, N] and their multi-dimensional evaluation index result set, to provide a quantitative basis for optimal cluster number selection.
[0115] Further, in the embodiments of the present application, step S4 determines the optimal clustering k value based on the multi-dimensional index evaluation system, and outputs the small hydropower cluster planning grouping scheme, and the specific steps include S4.1-S4.6:
[0116] S4.1, obtain the clustering scheme and evaluation results, traverse all possible clustering numbers k in a given range based on the improved k-means algorithm, obtain the candidate scheme set and multi-dimensional evaluation index data set under each k value of step S3.6, and the multi-dimensional evaluation index data set at least includes the evaluation values of within-cluster sum of squares SSE, silhouette coefficient, Gap statistic, watershed consistency index WCI, and geographical compactness GWB.
[0117] S4.2, preliminary screening and redundancy elimination, characterized in that, the preliminary screening and redundancy elimination operation is performed to reduce abnormal k value schemes, which includes the following steps:
[0118] S4.2.1, eliminate the extreme clustering scheme of k = 1;
[0119] S4.2.2, when the total amount of samples is N, set the upper limit of the maximum clustering number k value as 2 / 3N, and eliminate redundant schemes;
[0120] S4.2.3, eliminate abnormal k values that produce a single sample cluster ratio exceeding 1 / 3N.
[0121] S4.3, SSE derived evaluation index construction, based on the elbow judging rule according to the SSE curve, three kinds of elbow judging mathematical methods based on the SSE curve are proposed in the embodiments.
[0122] S4.3.1, elbow method based on maximum perpendicular distance, a reference straight line connecting the first and last points of the SSE curve is constructed, the Euclidean perpendicular distance D(k) of each k value corresponding point to the straight line is calculated, and the distance is taken as the evaluation standard, and the calculation method is as follows:
[0123]
[0124] In the formula, the coordinates of the first and last two points of the SSE curve are P1(x1, y1) and P2(x2, y2), SSE k (x0, y0) is the SSE value when the clustering number is k.
[0125] S4.3.2, elbow method based on first-order difference, the maximum value point of the SSE descending rate is captured through the first-order difference, and the first-order difference value ΔSSE(k) is taken as the evaluation standard, and the calculation method is as follows:
[0126] ΔSSE(k) = SSE(k-1) - SSE(k)
[0127] Wherein, SSE(k-1) is the error sum of squares corresponding to the cluster number k-1; SSE(k) is the error sum of squares corresponding to the cluster number k.
[0128] S4.3.3, elbow method based on second-order difference, calculate the second-order difference value of SSE curve, identify the peak point of curvature mutation, and take the second-order difference value C(k) as the evaluation standard.
[0129] C(k) = ΔSSE(k+1) - ΔSSE(k)
[0130] Wherein, ΔSSE(k+1) is the first-order difference value when the cluster number is k+1.
[0131] S4.4, evaluation index dimension conversion, in view of the problem of non-uniform index dimension, square the original index value to expand the feature difference, and map each index to the [0, 1] score space through Min-Max normalization, and the Min-Max normalization mapping formula is:
[0132]
[0133] In the formula, x represents the original value of the sample, X represents the sample set, min(X) represents the minimum value in the sample set, and max(X) represents the maximum value in the sample set.
[0134] S4.5, multi-dimensional index weight distribution, according to the importance, the weight of each index is distributed, and the role of mathematical effectiveness and field rationality in comprehensive evaluation is highlighted. The evaluation weights of mathematical effectiveness index and field rationality index are each 50% of the total weight. In the mathematical effectiveness index, the elbow method based on maximum vertical distance has a weight of 15%, the elbow method based on first-order difference has a weight of 5%, the elbow method based on second-order difference has a weight of 10%, the contour coefficient has a weight of 10%, and the Gap statistics has a weight of 10%. The weights of WCI and GWB indexes of field rationality index are each 25%.
[0135] S4.6, comprehensive score and optimal k value determination, record the independent evaluation score f l (k) of the ith evaluation index for different k value schemes, form a standardized score matrix, calculate the comprehensive score of each candidate k value according to the preset weight of each index, and the comprehensive score calculation method under different k value schemes is as follows:
[0136]
[0137] In the formula, ω l is the weight value of the lth evaluation index, f l (k) represents the independent evaluation score of the lth evaluation index under the current k value scheme, and L is the dimension of the evaluation index.
[0138] The comprehensive score and the optimal k value determination directly output the k value scheme with the highest comprehensive score as the clustering algorithm output result.
[0139] Embodiment 3 is a third embodiment of the present application, which is different from the first two embodiments in that:
[0140] The embodiment also provides an electronic device suitable for a small hydropower cluster planning grouping case, including a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to realize the small hydropower cluster planning grouping method proposed in the above embodiment.
[0141] The embodiment also provides a storage medium having a computer program stored thereon, and the program is executed by a processor to realize the small hydropower cluster planning grouping method proposed in the above embodiment.
[0142] The storage medium proposed in the embodiment and the small hydropower cluster planning grouping method proposed in the above embodiment belong to the same inventive concept, and the technical details not described in detail in the embodiment can be referred to the above embodiment, and the embodiment has the same beneficial effects as the above embodiment.
[0143] From the above description of the embodiments, those skilled in the art can clearly understand that the present application can be realized by means of software and necessary universal hardware, and of course can also be realized by hardware. Based on such understanding, the technical solutions of the present application or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer readable storage medium, such as a floppy disk, a read-only memory (ROM), a random access memory (RAM), a FLASH memory, a hard disk or an optical disk, and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods of various embodiments of the present application.
[0144] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and not to limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the present application, and all should be covered in the scope of the claims of the present application.
Claims
1. A method for planning and grouping small hydropower clusters, characterized in that: include, We acquire multi-source data from various small hydropower stations, perform preprocessing and feature engineering, and construct a feature space model of the small hydropower cluster. Construct mathematical effectiveness indicators and domain rationality indicators, and establish a multi-dimensional evaluation index system for the k-means clustering algorithm; The improved k-means++ clustering algorithm is executed. Initial cluster centers are selected based on the k-means++ strategy, the convergence condition is determined, and clustering schemes under different K values are generated. For each clustering scheme, the values of each indicator in the multi-dimensional evaluation index system are calculated, and the evaluation results of the clustering schemes under different K values are generated. Based on a multi-dimensional index evaluation system, the K value is initially screened, a derived evaluation index based on the sum of squared errors is constructed, index weights are assigned and the comprehensive score corresponding to each K value is calculated, the K value with the highest comprehensive score is selected as the optimal number of clusters, and the optimal clustering k value is determined. Output the small hydropower cluster grouping scheme corresponding to the optimal number of clusters.
2. The small hydropower cluster planning and grouping method as described in claim 1, characterized in that: The preprocessing and feature engineering includes acquiring multi-source data from each small hydropower station, including the longitude, latitude, and watershed information of each small hydropower station. Clean and align multi-source data to build a basic dataset; Based on the aforementioned dataset, the Haversine formula is used to calculate the geographical distance matrix between small hydropower stations; The average geographical proximity of each small hydropower station is extracted based on the geographical distance matrix. Encode and map watershed labels to convert discrete watershed labels into ordered values; By integrating longitude, latitude, average geographical proximity, and watershed coding information, a feature vector for each small hydropower station is constructed, and each feature is standardized to form a standardized feature matrix.
3. The small hydropower cluster planning and grouping method as described in claim 2, characterized in that: The calculation of the geographical distance matrix between small hydropower stations includes obtaining the longitude information λ of the geographical locations of the small hydropower stations. i Latitude and longitude information The geographical distance matrix D between small hydropower stations is constructed using the Haversine formula for spherical distance. Where, d ij Let R be the geographical distance between the i-th and j-th small hydropower stations, and R be the average radius of the Earth. Dλ=λ j -l i in, Let Δλ be the latitude difference between the two points, and Δλ be the longitude difference between the two points. Let λ be the latitude of the i-th and j-th small hydropower stations, respectively. i , λ j These are the longitudes of the i-th and j-th small hydropower stations, respectively. The geographical distance matrix D is obtained by calculating the pairwise distances of all small hydropower stations. The diagonal elements of the matrix are zero and it satisfies symmetry. Its representation is as follows: Where n is the total number of small hydropower stations.
4. The small hydropower cluster planning and grouping method as described in claim 3, characterized in that: The extraction of the average geographical proximity of each small hydropower station includes extracting the average geographical proximity of each small hydropower station based on the geographical distance matrix D. Quantifying the spatial distribution density of small hydropower stations The process of encoding and mapping watershed labels involves obtaining the original watershed label set for small hydropower projects based on a basic dataset, as Ω = {w1, w2, ..., w...}. m }, where m represents the total number of third-level watersheds in all n power stations. Discrete labels are converted into categorical variables, and the categorical variables are converted into ordered watershed coding information W through a classification mapping function. i ={1,2,…,m}.
5. The small hydropower cluster planning and grouping method as described in claim 4, characterized in that: The mathematical validity indicators include the sum of squared errors (SSE), silhouette coefficient, and gap index. The domain rationality indicators include intra-cluster watershed consistency (WCI) and geographic compactness (GWB).
6. The small hydropower cluster planning and grouping method as described in claim 5, characterized in that: The improved k-means++ clustering algorithm includes inputting feature space model data and initializing the number of clusters K; Input the dataset of the constructed small hydropower feature space model, and initialize the current number of clusters K = 0; Perform an incremental clustering operation K = K + 1, and randomly select K initial cluster centers from the dataset based on the k-means++ initial center selection strategy; Dynamic clustering partitioning is achieved through iterative computation: Calculate the Euclidean distance between each sample and all current cluster centers, and assign each sample to the nearest cluster to form a temporary cluster; The coordinates of each cluster center are recalculated based on the sample distribution of the temporary cluster; The system determines whether the partitioning result has changed based on the preset convergence criteria. If it has changed, it returns to recalculate the Euclidean distance between each sample and all current cluster centers and continues the iteration; otherwise, it proceeds to the next step. Save the clustering partitioning scheme corresponding to the current K value, and calculate the cluster partitioning evaluation index value through a multi-dimensional evaluation index system; Calculate SSE, calculate the silhouette coefficient, calculate the Gap index, calculate WCI, calculate GWB, and determine whether the current K value reaches the preset maximum number of clusters N. If K < N, return to the previous step to randomly select K initial cluster centers again and continue the next round of clustering division. Otherwise, proceed to the next step; Output the clustering division schemes and multi-dimensional evaluation index result sets corresponding to all K ∈ [1, N], providing a quantitative basis for the selection of the optimal number of clusters.
7. The small hydropower cluster planning and grouping method as described in claim 6, characterized in that: The determination of the optimal clustering k value includes traversing all possible numbers of clusters k within a given range through an improved k-means++ clustering algorithm to obtain the clustering schemes and evaluation results under each k value; Perform preliminary screening and redundancy elimination to reduce abnormal k value schemes; Based on the elbow judgment rule according to the SSE curve, construct a derivative evaluation index of SSE; Perform dimension conversion on each index. The original index values are squared to expand the feature differences, and each index is mapped to the [0, 1] scoring space through Min-Max normalization; Assign weights to each index, calculate the comprehensive score, and determine the optimal k value.
8. The small hydropower cluster planning and grouping method as described in claim 7, characterized in that: The construction of the derivative evaluation index of SSE includes, based on the elbow method of the maximum vertical distance, constructing a reference line connecting the start and end points of the SSE curve, calculating the Euclidean vertical distance D(k) from the point corresponding to each k value to the current line, and using the distance as the evaluation criterion. The calculation method is as follows: The coordinates of the first and last points of the SSE curve are P1(x1,y1) and P2(x2,y2), respectively. k (x0, y0) is the SSE value when the number of clusters is k; Based on the elbow method of the first-order difference, capture the maximum value point of the SSE decline rate through the first-order difference, and use the first-order difference value ΔSSE(k) as the evaluation criterion. The calculation method is: ΔSSE(k) = SSE(k - 1) - SSE(k) where SSE(k - 1) is the sum of squared errors corresponding to the number of clusters k - 1, and SSE(k) is the sum of squared errors corresponding to the number of clusters k; Based on the elbow method of the second-order difference, calculate the second-order difference value of the SSE curve, identify the peak point of the curvature mutation, and use the second-order difference value C(k) as the evaluation criterion: C(k) = ΔSSE(k + 1) - ΔSSE(k) where ΔSSE(k + 1) is the first-order difference value corresponding to the number of clusters k + 1.
9. 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 a small hydropower cluster planning grouping method described in any one of claims 1 to 8.
10. 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 a small hydropower cluster planning grouping method described in any one of claims 1 to 8.