Power grid typical operation mode generation method and system based on UMAP and k-means + + clustering

Through the UMAP and k-means++ clustering method, the problem that traditional manual selection methods are difficult to adapt to the complex situation of the current power system is solved, and efficient identification and analysis of typical operating modes of the power grid is achieved, and the safe and stable operation level of the power grid is improved.

CN120162637APending Publication Date: 2025-06-17GUANGXI POWER GRID CORP
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510131024.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-06
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

The traditional manual selection method is difficult to adapt to the current situation where large-scale new energy is connected to the grid of the power system, and it is impossible to effectively analyze a large amount of operating data and conduct timely analysis for the entire period.

Method used

UMAP and k-means++ clustering method are used to collect and organize the grid operation mode data and measurement data, normalize and dimensionality reduction processing, determine the optimal hyperparameter combination, and use the k-means++ algorithm for clustering to extract typical grid operation modes.

Benefits of technology

It realizes efficient identification of typical operating modes of the power grid, improves the scientific planning level of the power system, enhances the safe and stable operation of the power grid, and supports the optimized scheduling of the power grid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120162637A_ABST
    Figure CN120162637A_ABST
Patent Text Reader

Abstract

The invention discloses a power grid typical operation mode generation method and system based on UMAP and k-means + + clustering, and relates to the technical field of power systems, and the method comprises the steps: collecting power grid operation mode data and measurement data, carrying out the arrangement of the collected data, obtaining an initial sample set, carrying out the normalization processing of each equipment vector in the initial sample set, and obtaining a power grid typical operation mode; the method comprises the following steps: normalizing data of a power grid, performing dimension reduction processing on the normalized data, determining an optimal hyper-parameter combination, determining an optimal classification number by using an elbow rule, performing k-means + + clustering on a sample set, extracting a sample point closest to a central point in each category from a clustering result, and obtaining a typical operation mode of the power grid according to the sample point closest to the mahalanobis distance. According to the method, the data processing efficiency and accuracy are improved, the clustering effect is optimized, the optimal classification number is automatically determined, the safe and stable operation level of the power grid is improved, optimal dispatching of the power grid is supported, the coping capacity of the power grid to emergencies is enhanced, and intelligent development of the power grid is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power systems, and particularly to a method and system for generating typical operation modes of a power grid based on UMAP and k-means++ clustering. Background Art

[0002] In the process of analyzing the security and stability of a power system, selecting typical operation modes is an important prerequisite for analyzing various typical and extreme problems in the actual operation of the power grid. Especially in the current situation where the structure of the new power system is becoming increasingly complex, the traditional manual selection method has obvious drawbacks, including: being overly dependent on the past experience of professionals and not being able to well adapt to the situation of large-scale new energy grid connection in the current power system; only being applicable to small data volume situations and unable to perform timely analysis for the entire time period in the face of a large amount of operation data.

[0003] In addition, the extraction of typical operation modes of power systems based on machine learning algorithms has been widely discussed by scholars at home and abroad, but it is generally for the recognition of user electricity consumption patterns or the relevant analysis of power load curve data, and there is still a lack of application in processing power grid power flow data for power system operation mode analysis.

[0004] To solve the difficulties in analyzing a large amount of operation data of a complex power system with large-scale new energy grid connection by the traditional manual selection method and the lack of machine learning algorithms for analyzing power grid power flow data, the present invention provides a new method for extracting typical operation modes of a power grid. Summary of the Invention

[0005] In view of the above existing problems, the present invention provides a method and system for generating typical operation modes of a power grid based on UMAP and k-means++ clustering to solve the problems in the prior art that it cannot well adapt to the situation of large-scale new energy grid connection in the current power system and cannot perform timely analysis for the entire time period in the face of a large amount of operation data.

[0006] To solve the above technical problems, a method for generating typical operation modes of a power grid based on UMAP and k-means++ clustering is proposed, including,

[0007] Collecting power grid operation mode data and measurement data, and sorting out the collected data to obtain an initial sample set; normalizing each device vector in the initial sample set, performing dimensionality reduction on the normalized data, and determining the optimal hyperparameter combination; using the elbow method to determine the optimal number of clusters, performing k-means++ clustering on the sample set, extracting the sample points with the closest Mahalanobis distance to the center point in each category from the clustering results, and obtaining the typical operation modes of the power grid according to the sample points with the closest Mahalanobis distance.

[0008] As a preferred solution of the method for generating typical operation modes of a power grid based on UMAP and k-means++ clustering according to the present invention, wherein: the collection of power grid operation mode data includes monitoring and data acquisition system for at least one month of the power grid topology structure, the operation status of generating units, the load distribution, dispatching instructions and operation records, and the power grid security and stability control strategy;

[0009] The measured data includes the voltage amplitude and phase angle of nodes, the active power and reactive power of branches, the active power and reactive power of nodes, the active load and reactive load of nodes, the processing conditions of generating units, and the frequency and voltage levels of the power grid; the power grid topology structure includes lines, transformers and buses; the operation status of the generating units includes starting up, shutting down and load distribution.

[0010] As a preferred solution of the method for generating typical operation modes of a power grid based on UMAP and k-means++ clustering according to the present invention, wherein: the obtaining of the initial sample set includes removing invalid, incorrect and abnormal data points in the collected data, arranging the data at different time points in chronological order, performing power flow calculation on the power grid state at each time point, and obtaining the power flow distribution of each branch of the power grid;

[0011] The power flow calculation includes establishing a mathematical model of the power grid, using a power flow algorithm to solve the node voltage, phase angle and branch power flow, outputting the branch active power data at each time point, recording the branch active power data at each time point as a column vector of a dimension, and obtaining the initial sample set.

[0012] As a preferred solution of the method for generating typical operation modes of a power grid based on UMAP and k-means++ clustering according to the present invention, wherein: the performing of the normalization process includes recording each row vector in the matrix corresponding to the initial sample set as a device vector, and performing normalization processing on each device vector;

[0013] When x max -x min <0.01 MW, the data is not normalized and the vector remains unchanged. When x max -x min ≥0.01 MW, the data is normalized;

[0014] The normalization formula is expressed as:

[0015]

[0016] Wherein, is the normalized data, x max is the maximum value of the device vector, x minis the minimum value of the device vector, and x is the data before normalization.

[0017] As a preferred solution of the method for generating typical operation modes of the power grid based on UMAP and k-means++ clustering according to the present invention, wherein: the dimensionality reduction process includes selecting candidate values of hyperparameters, specifying the number of classifications in the clustering process, and using the UMAP method to perform dimensionality reduction on the data at each moment to obtain an effective sample set;

[0018] The UMAP method includes constructing a special weighted nearest neighbor graph of the original dimension of the data according to the initial sample set, defining a metric space, calculating the nearest neighbors of each sample in the metric space, and obtaining a local fuzzy simplex set {x a1 |x ak ∈R B , a = a1,..., a k}. Define the distance of the first nearest neighbor sample as:

[0019] ρ a = min{d(x a , x ac ) | 1 ≤ b ≤ k, d(x a , x ac ) > 0}

[0020] where B is the metric space, x a is the sample point, x ak are the k nearest neighbors of the sample in the metric space, ρ a is the distance of the first nearest neighbor sample, x ac is the c-th dimensional eigenvalue of the a-th sample, d is the Euclidean distance, R is the set of real numbers, and a and c are variable indices;

[0021] Calculate the topological structure weight of the original high-dimensional space, and adopt the t-distribution symmetrization rule to merge the fuzzy sets to obtain the symmetric global topological structure of the initial clustering sample set in the high-dimensional space. The formula is expressed as:

[0022]

[0023] W ab = W a|b + W b|a - W a|b W b|a

[0024] where W ab is the topological structure weight of the original high-dimensional space, exp is the exponential function, d is the Euclidean distance, ρ a is the distance of the first nearest neighbor sample, σ a is the length parameter, W a|b is the weight from sample a to sample b, Wb|a is the weight from sample b to sample a, x a and x b are sample points, a and b are variable indices;

[0025] Based on the symmetric normalized Laplacian operator for spectral embedding, construct the embedding similarity, and use the nonlinear least squares smoothing fitting formula to update p and q according to the set hyperparameters, obtain the cross-entropy, and calculate the cross-entropy of the fuzzy sets before and after embedding. Use SGD to optimize and converge the cross-entropy function until the iteration is completed to obtain the optimal result of the weight distribution, which is expressed by the formula:

[0026] V ab =[1 + p(y a - y b ) 2q -1

[0027]

[0028]

[0029] where y a and y b are the embedding vectors in the target dimensional space, p and q are hyperparameters, V ab is the similarity metric value between y a and y b min dist is the set embedding vector distance threshold, is the similarity metric value between the optimized y a and y b , CE(x, y) is the cross-entropy loss function, W ab (x) and W ab (y) are weight matrices, and log2 is the logarithm function with base 2.

[0030] As a preferred solution of the method for generating typical operation modes of the power grid based on UMAP and k-means++ clustering described in the present invention, wherein: the performing of k-means++ clustering includes selecting m samples from the sample set as the initial clustering centers, calculating the Mahalanobis distance between the samples and the clustering centers, evaluating the probability of a sample being selected as the next clustering center, selecting the sample with the highest probability as the next clustering center until m clustering centers are selected, respectively calculating the Mahalanobis distance between the samples and the m clustering centers, taking the category with the smallest distance as the category to which the sample belongs, and calculating the silhouette coefficient according to the clustering result to obtain the overall silhouette coefficient of the sample set;

[0031] The formula for the Mahalanobis distance is:

[0032] ​

[0033] Among them, x a is a sample point, f a is the clustering center, D(x a , f a ) is the Mahalanobis distance, S is the covariance matrix, a = 1, …, m, m is the total number of clusters, and a is the variable index;

[0034] The formula for evaluating the probability that a sample is the clustering center is:

[0035]

[0036] Among them, is the probability that the sample is selected as the next clustering center, x a is the sample point, a = 1, …, m, m is the total number of clusters, a is the variable index, and μ a is the mean vector of the current clustering center;

[0037] The formula for calculating the silhouette coefficient is:

[0038]

[0039]

[0040]

[0041] Among them, is the clustering category to which the sample point x a belongs, is the number of samples in the clustering category, D(x a , x o ) is the Mahalanobis distance between the sample point x a and x o , is the remaining cluster, is the number of samples in, x a and x o are sample points, a, o = 1, …, m, m is the total number of clusters, a and o are variable indexes, and g(x a ) is the average distance from the sample point x a to the remaining sample points in the belonging cluster, that is, the compactness, and h(x a ) is the average distance from the sample point x a to all sample points in the nearest remaining cluster, that is, the separation degree, and s(x a ) is the silhouette coefficient of the sample point x a ;

[0042] The formula for obtaining the overall silhouette coefficient of the sample set is:

[0043]

[0044] Among them, Z is the overall silhouette coefficient of the sample set, N is the total number of silhouette coefficients, x a is a sample point, s(x a ) is the silhouette coefficient of the sample point x a , and a is the variable index.

[0045] As a preferred solution of the method for generating typical operation modes of a power grid based on UMAP and k-means++ clustering according to the present invention, wherein: the obtaining of the typical operation modes of the power grid includes using the k-means++ algorithm to classify the effective sample set, taking the Mahalanobis distance between each sample and the center of its category as the sample error, calculating the sum of squared errors as the cost index of clustering, and using the elbow method to determine the optimal number of clusters, querying the clustering results, obtaining the sample points with the shortest Mahalanobis distance to the center point in each category, selecting the time scale of the sample points, and obtaining the typical operation modes at the moments of the sample points;

[0046] The formula for calculating the sum of squared errors is:

[0047]

[0048] Among them, x a is a sample point, a = 1,..., m, m is the total number of clusters, a is the variable index, μ a is the mean vector of the current cluster center, C a is the a-th cluster, and SSE is the sum of squared errors.

[0049] Another object of the present invention is to provide a system for generating typical operation modes of a power grid based on UMAP and k-means++ clustering. The present invention efficiently processes a large amount of operation data and improves the scientific planning level of the power system; the system of the present invention introduces the k-means++ algorithm to optimize the selection of the initial cluster center, improves the quality and stability of clustering, more accurately identifies the typical operation modes of the power grid, and by using the Mahalanobis distance instead of the Euclidean distance, takes into account the covariance structure of the data, further improves the accuracy of clustering, automatically determines the optimal number of clusters through the elbow method and the silhouette coefficient, avoids the subjectivity of artificially selecting parameters, and by identifying the typical operation modes, helps to discover potential risk points, take preventive measures in advance, improves the safe and stable operation level of the power grid, and provides a reference for power grid scheduling, supporting the optimal scheduling of the power grid.

[0050] As a preferred solution of the system for generating typical operation modes of a power grid based on UMAP and k-means++ clustering according to the present invention, it is characterized in that it includes a data collection and preprocessing module, a data normalization module, a data dimensionality reduction module, a k-means++ clustering module, and a typical operation mode extraction module.

[0051] The data collection and preprocessing module is used to collect and organize the power grid operation mode and measurement data to form an initial sample set.

[0052] The data normalization module is used to perform normalization processing on the device vectors in the initial sample set;

[0053] The data dimensionality reduction module is used to perform dimensionality reduction processing on the normalized data by using the UMAP method and select the optimal hyperparameter combination.

[0054] The k-means++ clustering module selects the initial clustering centers, calculates the Mahalanobis distance and the probability of a sample being selected as a clustering center, determines the optimal number of clusters, and calculates the silhouette coefficient.

[0055] The typical operation mode extraction module is used to calculate the sum of squared errors as the clustering cost index, determine the optimal number of clusters by using the elbow method, query the clustering results, select the sample points with the closest Mahalanobis distance to the center point, and determine the typical operation mode.

[0056] A computer device includes a memory and a processor. The memory stores a computer program. It is characterized in that when the processor executes the computer program, the steps of the method for generating the typical operation mode of the power grid based on UMAP and k-means++ clustering are implemented.

[0057] A computer-readable storage medium stores a computer program thereon. It is characterized in that when the computer program is executed by a processor, the steps of the method for generating the typical operation mode of the power grid based on UMAP and k-means++ clustering are implemented.

[0058] Advantages of the present invention: By collecting and organizing the power grid operation mode data and measurement data, the present invention realizes the systematic accumulation of data, ensures the comprehensiveness and accuracy of subsequent analysis, provides a rich and reliable data basis for power grid state analysis, and helps to reveal the power grid operation rules; by performing normalization processing on the device vectors, the interpretability of the data is improved, the influence of different dimensions on data analysis is eliminated, and the dimensionality reduction and clustering processes are made more effective and fair; by using the UMAP method to perform dimensionality reduction on the data and determine the optimal hyperparameter combination, not only the calculation efficiency is improved and the storage requirement is reduced, but also clearer data features are provided for clustering analysis; by using the k-means++ algorithm for clustering and calculating the Mahalanobis distance, the clustering quality and stability are improved, and the typical operation modes of the power grid are more accurately identified; by calculating the sum of squared errors and using the elbow method to determine the optimal number of clusters, the typical operation modes of the power grid are accurately extracted, providing a scientific basis for power grid scheduling, helping to formulate reasonable scheduling strategies, and improving the safety and economy of power grid operation. Description of the Drawings

[0059] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings, where:

[0060] Figure 1 It is the overall flowchart of the method for generating typical operation modes of the power grid based on UMAP and k-means++ clustering provided by an embodiment of the present invention.

[0061] Figure 2 It is the schematic diagram of the initial sample set data of the method for generating typical operation modes of the power grid based on UMAP and k-means++ clustering provided by an embodiment of the present invention.

[0062] Figure 3 It is the line graph for determining the number of clusters using the elbow method of the method for generating typical operation modes of the power grid based on UMAP and k-means++ clustering provided by an embodiment of the present invention.

[0063] Figure 4 It is the schematic diagram of the classification result of the method for generating typical operation modes of the power grid based on UMAP and k-means++ clustering provided by an embodiment of the present invention.

[0064] Figure 5 It is the system scheme flowchart of the system for generating typical operation modes of the power grid based on UMAP and k-means++ clustering provided by an embodiment of the present invention. Detailed implementation manners

[0065] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following will make a detailed description of the specific implementation manners of the present invention in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0066] Many specific details are set forth in the following description in order to fully understand the present invention. However, the present invention can also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.

[0067] Second, the "one embodiment" or "embodiment" mentioned herein refers to specific features, structures, or characteristics that may be included in at least one implementation manner of the present invention. The "in one embodiment" that appears in different places in this specification does not all refer to the same embodiment, nor is it an embodiment that is separately or selectively mutually exclusive with other embodiments.

[0068] The present invention will be described in detail with reference to the schematic diagrams. When describing the embodiments of the present invention in detail, for the convenience of explanation, the cross-sectional views showing the device structure will be enlarged locally in a non-general proportion, and the schematic diagrams are only examples and should not limit the scope of protection of the present invention herein. In addition, in actual production, three-dimensional spatial dimensions including length, width, and depth should be included.

[0069] At the same time, in the description of the present invention, it should be noted that the orientation or positional relationship indicated by terms such as "upper, lower, inner, and outer" is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation to the present invention. In addition, the terms "first, second, or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0070] Unless otherwise clearly defined and limited in the present invention, the terms "installed, connected, and coupled" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can also be a mechanical connection, an electrical connection, or a direct connection, and can also be indirectly connected through an intermediate medium, or can be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.

[0071] Example 1, refer to Figure 1 — Figure 4 , which is the first embodiment of the present invention. This embodiment provides a method for generating typical operation modes of a power grid based on UMAP and k-means++ clustering, including:

[0072] S1: Collect power grid operation mode data and measurement data, and organize the collected data to obtain an initial sample set.

[0073] The collection of the power grid operation mode data includes monitoring the power grid topology structure, the operating status of generator sets, the load distribution, dispatching instructions and operation records, and the power grid security and stability control strategy through the supervisory control and data acquisition system for at least one month;

[0074] The measured data includes the voltage amplitude and phase angle of nodes, the active power and reactive power of branches, the active power and reactive power of nodes, the active load and reactive load of nodes, the processing conditions of generating units, and the frequency and voltage levels of the power grid; the power grid topology structure includes lines, transformers, and buses; the operating states of the generating units include starting up, shutting down, and load distribution.

[0075] More specifically, as Figure 2 , the obtaining of the initial sample set includes removing invalid, incorrect, and abnormal data points from the collected data, arranging the data at different time points in chronological order, performing a power flow calculation on the power grid state at each time point, and obtaining the power flow distribution of each branch of the power grid.

[0076] The power flow calculation includes establishing a mathematical model of the power grid, using a power flow algorithm to solve for the node voltages, phase angles, and branch power flows, outputting the branch active power data at each time point, recording the branch active power data at each time point as a column vector of a certain dimension, and obtaining the initial sample set.

[0077] The node power equation is:

[0078]

[0079]

[0080] where n is the total number of nodes, i and j are node indices, P i is the injected active power of node i, Q i is the injected reactive power of node i, V i is the voltage amplitude of node i, θ i is the voltage phase angle of node i, G ij is the real part of the admittance matrix between node i and node j, i.e., conductance, B ij is the imaginary part of the admittance matrix between node i and node j, i.e., susceptance, V j is the voltage amplitude of node j, θ j is the voltage phase angle of node j;

[0081] The node voltage equation is:

[0082]

[0083]

[0084] where P i is the injected active power of node i, Q i is the injected reactive power of node i, V i is the voltage amplitude of node i, G ii is the real part of the self-admittance of node i, i.e., the conductance of node i, Bii The imaginary part of the self - admittance of node i, i.e., the susceptance of node i.

[0085] S2: Normalize each device vector in the initial sample set, perform dimensionality reduction on the normalized data, and determine the optimal combination of hyperparameters.

[0086] Furthermore, the normalization process includes: Denote each row vector in the matrix corresponding to the initial sample set as a device vector, and perform normalization processing for each device vector;

[0087] When x max -x min < 0.01MW, the data is not normalized and the vector remains unchanged. When x max -x min ≥0.01MW, perform normalization processing on the data;

[0088] The normalization formula is expressed as:

[0089]

[0090] Among them, is the normalized data, x max is the maximum value of the device vector, x min is the minimum value of the device vector, and x is the data before normalization.

[0091] Even further, the dimensionality reduction process includes: Select candidate values of hyperparameters, specify the number of classifications in the clustering process, and use the UMAP method to perform dimensionality reduction on the data at each moment to obtain an effective sample set;

[0092] The UMAP method includes constructing a special weighted nearest - neighbor graph of the original dimension of the data according to the initial sample set, defining a metric space, calculating the nearest neighbors of each sample in the metric space, and obtaining a local fuzzy simplex set {x a1 |x ak ∈R B , a = a1,…,a k}, and defining the distance of the first nearest - neighbor sample as:

[0093] ρ a = min{d(x a ,x ac )|1 ≤ b ≤ k, d(x a ,x ac )>0}

[0094] Among them, B is the metric space, x a is the sample point, x ak is the k nearest neighbors of the sample in the metric space, ρ ais the distance to the first nearest neighbor sample, x ac is the c-th dimensional eigenvalue of the a-th sample, d is the Euclidean distance, R is the set of real numbers, and a and c are variable indices;

[0095] Calculate the topological structure weight of the original high-dimensional space, and adopt the t-distribution symmetrization rule to merge the fuzzy sets to obtain the symmetric global topological structure of the initial clustering sample set in the high-dimensional space. The formula is expressed as:

[0096]

[0097] W ab = W a|b + W b|a - W a|b W b|a

[0098] Among them, W ab is the topological structure weight of the original high-dimensional space, exp is the exponential function, d is the Euclidean distance, ρ a is the distance to the first nearest neighbor sample, σ a is the length parameter, W a|b is the weight from sample a to sample b, W b|a is the weight from sample b to sample a, x a and x b are sample points, and a and b are variable indices;

[0099] Based on the symmetric normalized Laplacian operator, perform spectral embedding, construct the embedding similarity, and update p and q by non-linear least squares smoothing fitting according to the set hyperparameters to obtain the cross-entropy, and calculate the cross-entropy of the fuzzy sets before and after embedding. Use SGD to optimize and converge the cross-entropy function until the iteration is completed to obtain the optimal result of the weight distribution. The formula is expressed as:

[0100] V ab = [1 + p(y a - y b ) 2q -1

[0101]

[0102]

[0103] Among them, y a and y b are the embedding vectors in the target dimensional space, p and q are hyperparameters, V ab is the similarity metric value between y a and y b min dist is the set embedding vector distance threshold,​ For the optimized y a and y b The similarity metric value between them, CE(x, y) is the cross-entropy loss function, W ab (x) and W ab (y) are weight matrices, and log2 is the logarithm function with base 2.

[0104] It should be noted that the k-means++ clustering includes selecting m samples from the sample set as the initial clustering centers, calculating the Mahalanobis distance between the samples and the clustering centers, evaluating the probability of a sample being selected as the next clustering center, selecting the sample with the highest probability as the next clustering center until m clustering centers are selected, calculating the Mahalanobis distance between the samples and the m clustering centers respectively, taking the category with the smallest distance as the category to which the sample belongs, and calculating the silhouette coefficient according to the clustering result to obtain the overall silhouette coefficient of the sample set;

[0105] The formula for the Mahalanobis distance is:

[0106]

[0107] where, x a is the sample point, f a is the clustering center, D(x a , f a ) is the Mahalanobis distance, S is the covariance matrix, a = 1, …, m, m is the total number of clusters, and a is the variable index;

[0108] The formula for evaluating the probability of a sample being a clustering center is:

[0109]

[0110] where, is the probability of the sample being selected as the next clustering center, x a is the sample point, a = 1, …, m, m is the total number of clusters, a is the variable index, μ a is the mean vector of the current clustering center;

[0111] The formula for the silhouette coefficient is:

[0112]

[0113]

[0114]

[0115] where, is the cluster category to which the sample point x a belongs, is the number of samples in the cluster category, D(x a , xo ) is the Mahalanobis distance of the sample point x a and x o ; is the remaining clustering, is the number of samples in, x a and x o are sample points, a, o = 1, …, m, m is the total number of clusters, a and o are variable indices, g(x a ) is the average distance from the sample point x a to the remaining sample points in the belonging cluster, i.e., the compactness, h(x a ) is the average distance from the sample point x a to all sample points in the remaining nearest cluster, i.e., the separation degree, s(x a ) is the silhouette coefficient of the sample point x a ;

[0116] The formula for obtaining the overall silhouette coefficient of the sample set is:

[0117]

[0118] where Z is the overall silhouette coefficient of the sample set, N is the total number of silhouette coefficients, x a is the sample point, s(x a ) is the silhouette coefficient of the sample point x a ; a is the variable index.

[0119] S3: Use the elbow method to determine the optimal number of classifications, and perform k-means++ clustering on the sample set. Extract the sample points with the closest Mahalanobis distance to the center point in each category from the clustering results, and obtain the typical operation modes of the power grid according to the sample points with the closest Mahalanobis distance.

[0120] Furthermore, as Figure 3 , the obtaining of the typical operation modes of the power grid includes using the k-means++ algorithm to classify the effective sample set, taking the Mahalanobis distance between each sample and the center of the belonging category as the sample error, calculating the sum of squared errors as the cost index of clustering, and using the elbow method to determine the optimal number of classifications. As Figure 4 , query the clustering results, obtain the sample points with the closest Mahalanobis distance to the center point in each category, select the time scale of the sample points, and obtain the typical operation modes at the moments of the sample points;

[0121] The formula for calculating the sum of squared errors is:

[0122]

[0123] where x a is the sample point, a = 1, …, m, m is the total number of clusters, a is the variable index, μa is the mean vector of the current cluster center, C a is the a-th cluster, and SSE is the sum of squared errors.

[0124] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.

[0125] Example 2, referring to Figure 5 is the second embodiment of the present invention. This embodiment provides a power grid typical operation mode generation system based on UMAP and k-means++ clustering, including a data collection and preprocessing module M101, a data normalization module M201, a data dimensionality reduction module M301, a k-means++ clustering module M401, and a typical operation mode extraction module M501.

[0126] The data collection and preprocessing module M101 is used to collect and organize the power grid operation mode and measurement data to form an initial sample set.

[0127] The data normalization module M201 is used to perform normalization processing on the device vectors in the initial sample set;

[0128] The data dimensionality reduction module M301 is used to perform dimensionality reduction processing on the normalized data by using the UMAP method and select the optimal hyperparameter combination.

[0129] The k-means++ clustering module M401 selects the initial cluster center, calculates the Mahalanobis distance and the probability of the sample being selected as the cluster center, determines the optimal number of classifications, and calculates the silhouette coefficient.

[0130] The typical operation mode extraction module M501 is used to calculate the sum of squared errors as the clustering cost index, determine the optimal number of classifications by using the elbow method, query the clustering results, select the sample point with the closest Mahalanobis distance to the center point, and determine the typical operation mode.

[0131] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.

[0132] Example 3, the third embodiment of the present invention, which is different from the previous two embodiments in that:

[0133] When the above-mentioned functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this 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 for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs, etc., all kinds of media that can store program codes.

[0134] The logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in combination with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device.

[0135] More specific examples (non-exhaustive list) of computer-readable media include the following: electrical connection parts with one or more wirings (electronic devices), portable computer disk cartridges (magnetic devices), random access memories (RAMs), read-only memories (ROMs), erasable programmable read-only memories (EPROMs or flash memories), fiber optic devices, and portable compact disc read-only memories (CDROMs). Additionally, a computer-readable medium 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 media, then editing, interpreting, or otherwise processing it as necessary, and then storing it in a computer memory.

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

Claims

1. A method for generating typical operation modes of power grid based on UMAP and k-means++ clustering, characterized by: include, Collect grid operation mode data and measurement data, and organize the collected data to obtain an initial sample set; Normalize each device vector in the initial sample set, perform dimensionality reduction on the normalized data, and determine the optimal hyperparameter combination; The optimal number of categories is determined by the elbow rule, and the sample set is clustered by k-means++. The sample points with the closest Mahalanobis distance to the center point in each category are extracted from the clustering results. The typical operation mode of the power grid is obtained based on the sample points with the closest Mahalanobis distance.

2. The method for generating typical operation modes of power grid based on UMAP and k-means++ clustering according to claim 1, characterized in that: The collection of grid operation mode data includes at least one month of grid topology, operating status of generator sets, load distribution, dispatching instructions and operation records, and safety and stability control strategies of the grid through a monitoring and data acquisition system; The measured data include voltage amplitude and phase angle of the node, active power and reactive power of the branch, active power and reactive power of the node, active load and reactive load of the node, processing status of the generator set, and frequency and voltage level of the power grid; the power grid topology includes lines, transformers and busbars; the operating status of the generator set includes startup, shutdown and load distribution.

3. The method for generating typical operation modes of power grid based on UMAP and k-means++ clustering according to claim 2, characterized in that: The obtaining of the initial sample set includes removing invalid, erroneous and abnormal data points in the collected data, arranging the data at different time points in chronological order, performing power flow calculation on the power grid state at each time point, and obtaining the power flow distribution of each branch of the power grid; The power flow calculation includes establishing a mathematical model of the power grid, using a power flow algorithm to solve node voltage, phase angle and branch power flow, outputting branch active power data at each time point, recording the branch active power data at each time point as a dimensional column vector, and obtaining an initial sample set.

4. The method for generating typical operation modes of power grid based on UMAP and k-means++ clustering according to claim 3, characterized in that: The normalization process includes recording each row vector in the matrix corresponding to the initial sample set as a device vector, and performing normalization process on each device vector; When x max -x min <0.01MW, the data is not normalized and the vector is kept unchanged. max -x min When ≥0.01MW, the data were normalized; The normalization processing formula is expressed as: in, is the normalized data, x max is the maximum value of the device vector, x min is the minimum value of the device vector, and x is the data before normalization.

5. The method for generating typical operation modes of power grid based on UMAP and k-means++ clustering according to claim 4, characterized in that: The dimensionality reduction process includes selecting candidate values ​​of hyperparameters, specifying the number of classifications in the clustering process, and performing dimensionality reduction process on the data at each moment using the UMAP method to obtain a valid sample set; The UMAP method includes constructing a special weighted neighbor graph of the original dimension of the data according to the initial sample set, defining a metric space, calculating the nearest neighbor of each sample in the metric space, and obtaining a local fuzzy simplex set {x a1 |x ak ∈R B ,a=a1,…,a k }, define the distance of the first nearest neighbor sample as: ρ a =min{d(x a ,x ac )|1≤b≤k,d(x a ,x ac )>0} in , B is the metric space, x a is the sample point, x ak is the k nearest neighbors of the sample in the metric space, ρ a is the distance to the first nearest neighbor sample, x ac is the c-th dimension eigenvalue of the a-th sample, d is the Euclidean distance, R is a set of real numbers, a and c are variable indices; Calculate the topological structure weight of the original high-dimensional space, and use the t-distribution symmetry rule to merge the fuzzy set into the symmetric global topological structure of the initial clustering sample set in the high-dimensional space. The formula is expressed as: IN ab =In a|b +W b|a -IN a|b IN b|a Among them, W ab is the topological structure weight of the original high-dimensional space, exp is the exponential function, d is the Euclidean distance, ρ a is the distance to the first nearest neighbor sample, σ a is the length parameter, W a|b is the weight from sample a to sample b, W b|a is the weight from sample b to sample a, x a and x b is the sample point, a and b are the variable indexes; Based on the symmetric normalized Laplace operator, the spectrum is embedded, the embedding similarity is constructed, and the nonlinear least squares smooth fitting formula is used to update p and q according to the set hyperparameters to obtain the cross entropy, and the cross entropy of the fuzzy set before and after embedding is calculated. The cross entropy function is optimized and converged using SGD until the iteration is completed to obtain the optimal result of the weight distribution. The formula is expressed as: V ab =[1+p(y a -and b ) 2q ] -1 Among them, y a and b is the embedding vector in the target dimension space, p and q are hyperparameters, V ab for y a and b Similarity measure between dist is the embedding vector distance threshold set, After optimization, y a and b The similarity measure between them, CE(x,y) is the cross entropy loss function, W ab (x) and W ab (y) is the weight matrix, and log2 is the logarithmic function with base 2.

6. The method for generating typical operation modes of power grid based on UMAP and k-means++ clustering according to claim 5, characterized in that: The k-means++ clustering includes selecting m samples from the sample set as initial cluster centers, calculating the Mahalanobis distance between the sample and the cluster center, evaluating the probability of the sample being selected as the next cluster center, selecting the sample with the highest probability as the next cluster center, until m cluster centers are selected, respectively calculating the Mahalanobis distance between the sample and the m cluster centers, taking the category with the smallest distance as the category to which the sample belongs, calculating the silhouette coefficient according to the clustering result, and obtaining the overall silhouette coefficient of the sample set; The Mahalanobis distance formula is: Among them, x a is the sample point, f a is the cluster center, D(x a ,f a ) is the Mahalanobis distance, S is the covariance matrix, a=1,…,m, m is the total number of clusters, and a is the variable index; The probability formula for evaluating a sample as a cluster center is: Among them, is the probability of the sample being selected as the next cluster center, x a is the sample point, a=1,…,m, m is the total number of clusters, a is the variable index, μ a is the mean vector of the current cluster center; The silhouette coefficient calculation formula is: in, is the sample point x a The cluster category, is the number of samples in the cluster category, D(x a ,x o ) is the sample point x a and x o The Mahalanobis distance, is the remaining cluster, for The number of samples in x a and x o is a sample point, a, o = 1, ..., m, m is the total number of clusters, a and o are variable indices, g(x a ) is the sample point x a The average distance to the remaining sample points in the cluster is the compactness, h(x a ) is the sample point x a The average distance to all sample points in the remaining nearest cluster is the separation, s(x a ) is the sample point x a The silhouette coefficient; The formula for obtaining the overall silhouette coefficient of the sample set is: Among them, Z is the overall silhouette coefficient of the sample set, N is the total number of silhouette coefficients, and x a is the sample point, s(x a ) is the sample point x a The silhouette coefficient of , a is the variable index.

7. The method for generating typical operation modes of power grid based on UMAP and k-means++ clustering according to claim 6, characterized in that: The method of obtaining the typical operation mode of the power grid includes classifying the effective sample set by using the k-means++ algorithm, taking the Mahalanobis distance between each sample and the center of the category to which it belongs as the sample error, calculating the sum of squared errors as the cost index of clustering, and determining the optimal number of classifications by using the elbow method, querying the clustering results, obtaining the sample point in each category with the closest Mahalanobis distance to the center point, selecting the time scale of the sample point, and obtaining the typical operation mode at the time of the sample point; The formula for calculating the sum of squared errors is: Among them, x a is the sample point, a=1,…,m, m is the total number of clusters, a is the variable index, μ a is the mean vector of the current cluster center, C a is the a-th cluster, and SSE is the sum of squared errors.

8. A system using the method for generating typical operation modes of a power grid based on UMAP and k-means++ clustering as claimed in any one of claims 1 to 7, characterized in that: It includes data collection and preprocessing module, data normalization module, data dimension reduction module, k-means++ clustering module and typical operation mode extraction module; The data collection and preprocessing module is used to collect and organize the power grid operation mode and measurement data to form an initial sample set; The data normalization module is used to perform normalization processing on the device vectors in the initial sample set; The data dimension reduction module is used to perform dimension reduction processing on the normalized data using the UMAP method and select the optimal hyperparameter combination; The k-means++ clustering module selects the initial cluster center, calculates the Mahalanobis distance and the probability of a sample being selected as a cluster center, determines the optimal number of clusters, and calculates the silhouette coefficient; The typical operation mode extraction module is used to calculate the sum of squared errors as a clustering cost index, determine the optimal number of classifications using the elbow method, query the clustering results, select the sample points with the closest Mahalanobis distance to the center point, and determine the typical operation mode.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for generating a typical operation mode of a power grid based on UMAP and k-means++ clustering described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for generating a typical operation mode of a power grid based on UMAP and k-means++ clustering described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Medium-term extension period forecasting method, system and equipment for space-time circulation classification and medium

    CN120929864A

  • Method and device for optimizing measuring points of grain based on hybrid clustering

    CN121009720A