A method for identifying a hybrid topology of a transformer distribution network and a microgrid

By using a binary classification algorithm based on the voltage time series of smart meters, combined with similarity coefficients and graph theory features, the high cost and dynamic changes in distribution network topology identification are solved, achieving low-cost and high-precision topology reconstruction that adapts to the dynamic access and exit of distributed energy devices.

CN122154117APending Publication Date: 2026-06-05SHANGHAI YIJUNENG ENERGY INFORMATION TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI YIJUNENG ENERGY INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-02-10
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing methods for identifying power grid topology are ill-suited to the dynamic changes in topology caused by the large-scale access and disconnection of distributed energy devices, and are costly and cannot accurately monitor and update the power grid topology.

Method used

A binary classification algorithm based on smart meter voltage time series is adopted to reconstruct the topology of distribution network and microgrid by calculating similarity coefficients and graph theory features. Machine learning and deep learning algorithms are used to determine the node connection relationship, requiring only voltage data input.

Benefits of technology

It achieves high-precision and low-cost topology reconstruction of distribution networks and microgrids, is applicable to diversified power distribution networks, adapts to frequent changes in topology, reduces data acquisition costs and deployment complexity, has a wide range of applications, and has good cross-scenario mobility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122154117A_ABST
    Figure CN122154117A_ABST
Patent Text Reader

Abstract

The application relates to a method for identifying a hybrid topology of a transformer distribution network and a microgrid. The method comprises collecting voltage time series recorded by intelligent electricity meters of each node in the distribution network and the microgrid to be identified; preprocessing the voltage time series to obtain aligned voltage time series; calculating a similarity coefficient based on the aligned voltage time series of each pair of nodes; constructing a dissimilarity complete connection graph based on the similarity coefficient; obtaining a graph theory feature of each pair of nodes based on the dissimilarity complete connection graph; constructing an input set and an output set of the node pair based on the similarity coefficient and the graph theory feature of each pair of nodes; inputting the input set and the output set into a binary classification algorithm model to output a classification result of whether the node pair is connected; and reconstructing a topology structure of the distribution network and the microgrid based on the classification result of each node pair. The application can restore the topology structure of the distribution network or the microgrid with high precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of machine learning and deep learning technologies, and in particular to a method for hybrid topology identification across transformer distribution networks and microgrids. Background Technology

[0002] In modern power systems, accurately identifying the topology of distribution networks and microgrids is a critical task, essential for ensuring stable power system operation, optimizing power quality, and improving operational efficiency. Besides traditional substations and distribution lines, distributed energy devices such as energy storage systems, charging stations, photovoltaic power generation, and wind power generation, and the microgrids they form, have become an increasingly important and growing component of modern distribution networks. With the widespread application of these distributed energy devices, the topology of distribution networks and microgrids has become more dynamic and complex.

[0003] Currently, common methods for distribution network topology management include static topology management and dynamic topology management. Static topology management, based on design drawings and manual inspections, is only suitable for distribution networks with relatively simple and stable topologies. With the frequent connection and disconnection of distributed energy devices from the distribution network, the later maintenance of static topology management requires significant manpower and time. Delayed updates can lead to inaccurate grid topology information used as a basis for decision-making. Dynamic topology management, based on real-time data from SCADA systems and sensors, can monitor and update the distribution network topology in real time. However, the deployment and maintenance of SCADA systems are costly, including investments in hardware, software, and communication infrastructure. As more distributed energy devices are connected to the distribution network, the cost of SCADA systems will further increase.

[0004] Therefore, current commonly used distribution network topology identification methods are insufficient to meet the needs of today's diversified power distribution networks under the background of new energy sources. New topology identification methods must be able to adapt to the large-scale access and disconnection of distributed energy devices in the distribution network, and their impact on the load flow of the distribution network. Summary of the Invention

[0005] To address this, the present invention provides a method for identifying hybrid topologies of distribution networks and microgrids across transformers. This method employs a binary classification algorithm that uses the voltage correlation characteristics between each pair of nodes in both the distribution network and the microgrid as input to identify the connection relationships between these pairs of nodes, thereby reconstructing the topology of both the distribution network and the microgrid. Even when the topologies of some distribution networks and microgrids change frequently, this method only requires voltage measurement data from smart meters as input and can simultaneously monitor and update the topologies of both the distribution network and the microgrid.

[0006] To address the aforementioned technical problems, this invention provides a method for identifying hybrid topologies across transformer distribution networks and microgrids, comprising: Collect voltage time series data recorded by smart meters at each node in the distribution network and microgrid to be identified; The voltage time series is preprocessed to obtain an aligned voltage time series; Based on the aligned voltage time series of each pair of nodes, a similarity coefficient is calculated; wherein, the similarity coefficient includes Pearson correlation coefficient, Spearman correlation coefficient, Kendall correlation coefficient, time series difference standard deviation, cosine similarity coefficient, co-trend coefficient, and mutual information; Based on the similarity coefficient, a dissimilarity fully connected graph is constructed; based on the dissimilarity fully connected graph, the graph theory features of each pair of nodes are obtained, and the graph theory features include the shortest distance weight, shortest distance step size, minimum spanning tree distance weight, and minimum spanning tree distance step size for each pair of nodes corresponding to each of the similarity coefficients; The input and output sets of each node pair are constructed based on the similarity coefficient and graph theory features of each pair of nodes. Input the input set and output set into the binary classification algorithm model, and output the classification result of whether the node is connected; Based on the classification results of each node pair, the topology of the distribution network and microgrid is reconstructed.

[0007] In one embodiment of the present invention, the voltage time series recorded by smart meters at each node in the distribution network and microgrid to be identified is collected, including: The sampling window duration shall not be less than 24 hours; When a smart meter records three-phase voltage, the average of the three-phase voltage is taken as the single voltage value of the smart meter. When the sampling frequencies of the various smart meters are inconsistent, the voltage time series is resampled to the same sampling frequency.

[0008] In one embodiment of the present invention, the voltage time series is preprocessed to obtain an aligned voltage time series, including: The voltage time series is processed by time sorting, deduplication, singular value clearing, linear interpolation filling, and timestamp alignment.

[0009] In one embodiment of the present invention, a similarity coefficient is calculated based on the aligned voltage time series of each pair of nodes, including: Suppose two voltage timing sequences located at timestamps 1, 2, 3, ..., N and N is the number of sampling points in the time series; Pearson correlation coefficient The calculation is as follows: ; Among them, is the covariance of X and Y, and are the standard deviations of X and Y respectively, and the formulas are as follows: ; ; ; where i is the i-th sampling point, and represent the average values of X and Y respectively; Spearman correlation coefficient is calculated by Pearson correlation coefficient for the ascending order sorting results of X and Y, and its calculation formula is as follows: ; where R(X) and R(Y) respectively represent the ranks, that is, the ranking positions, of the corresponding values in X and Y, that is, the ranking positions of each value after sorting in ascending order in its sequence; Kendall correlation coefficient quantifies the degree of ordinal association between X and Y; for any two pairs of tuples and in X and Y, , that is, when timestamp i is earlier than timestamp j, their ordinal association means either satisfying or satisfying ; Kendall correlation coefficient has the formula: ; where sgn represents the sign function, that is, it outputs 1 when greater than 0, 0 when equal to 0, and -1 when less than 0; N(N - 1) / 2 calculates the number of all subscript combinations that satisfy i < j; Standard deviation of time series difference has the following calculation formula: ; Assume that in a distribution network or a microgrid cluster, the standard deviation of the time series difference of each pair of node voltage time series is , D is the set of the standard deviations of the time series differences of all node pairs' voltages, then the normalized is: ; Cosine similarity coefficient has the following calculation formula: ; where, The angle formed by the voltage vectors for each time interval, with a range of [0, 180°); This indicates that the voltage timing X is within the time interval. Vectors within, This indicates that the voltage timing Y is within the time interval. Vectors within; When the angle is closer to 0, the voltage vector directions are more similar, and the cosine value is closer to 1; when the angle is closer to 180°, the voltage vector directions are more different, and the cosine value is closer to -1. Common trend coefficient It records the percentage of intervals where X and Y both rise or fall, out of the total number of intervals. The formula for calculating this percentage is: ; Where sgn represents the sign function, that is, outputting 1 when greater than 0, outputting 0 when equal to 0, and outputting -1 when less than 0; Mutual Information Mutual information measures the amount of information one variable contains about another, and also represents the degree to which knowing one variable reduces the uncertainty about the other. For discrete variables such as voltage time series, the formula for calculating mutual information is: ; Where p(x, y) represents the joint probability that X and Y simultaneously take specific values ​​x and y, and p(x) and p(y) represent the marginal probabilities when X takes a specific value x and when Y takes a specific value y, respectively; the greater the mutual information between two time series, the more similar the two time series are in shape; conversely, the less similar the two time series are in shape. Assuming that in a distribution network or microgrid cluster, the mutual information of voltage timing for each pair of nodes is... Let M be the set of voltage timing mutual information for all node pairs, then the normalized... for: .

[0010] In one embodiment of the present invention, a dissimilarity fully connected graph is constructed based on the aforementioned similarity coefficients, including: Based on the distance weight between any two nodes, and using each node as a vertex of the graph, construct a dissimilar fully connected graph. The distance weight is obtained by subtracting the similarity coefficient between any two nodes from 1.

[0011] In one embodiment of the present invention, based on the dissimilarity fully connected graph, the graph theory features of each pair of nodes are obtained, including: Obtain the set of all nodes in the dissimilar fully connected graph, the set of direct connection distances between all pairs of nodes, and the set of distance weights between each pair of nodes. Then, calculate the shortest distance weight for each pair of nodes based on Dijkstra's algorithm. The distance weight between each pair of nodes in the dissimilar fully connected graph is uniformly set to 1, and the shortest path step length between each pair of nodes is calculated based on Dijkstra's algorithm. Based on Kruskal's algorithm or Prim's algorithm, construct a minimum spanning tree on the dissimilar fully connected graph; The minimum spanning tree path distance weight between each pair of nodes is calculated based on the minimum spanning tree. The distance weight between each pair of nodes in the dissimilar fully connected graph is uniformly set to 1, and the minimum spanning tree path step between each pair of nodes is calculated on the minimum spanning tree.

[0012] In one embodiment of the present invention, it further includes: When the number of node pairs to be processed is N and the computational cost for calculating the shortest path distance weight, shortest path step size, minimum spanning tree path distance weight, and minimum spanning tree path step size exceeds a preset threshold, the N node pairs are divided into There are N batches, where each batch contains B pairs of nodes and B < N; For each batch, the shortest distance weight, shortest path step size calculation, and minimum spanning tree construction based on Dijkstra's algorithm are performed to generate the graph theory features corresponding to that batch. Each batch contains an equal number of interconnected node pairs and an equal number of unconnected node pairs.

[0013] In one embodiment of the present invention, constructing the input set and output set of each node pair based on the similarity coefficient and the graph theory features includes: The similarity coefficients corresponding to each pair of nodes are combined with graph theory features to form 35 voltage features. The 35 voltage features of each pair of nodes map whether the pair of nodes are physically connected. 1 indicates that the pair of nodes are connected to each other, and 0 indicates that the pair of nodes are not connected to each other. Assume that there are a total of N pairs of nodes in the multi-transformer, mixed distribution network and microgrid. The distribution network and microgrid generate an N-row, 35-column input matrix, where each row represents a pair of nodes and each column is a voltage feature. Each row outputs 0 or 1. Therefore, the output matrix of the distribution network and microgrid has an N-row, 1-column shape.

[0014] In one embodiment of the present invention, the input set and output set are input into a binary classification algorithm model, and the classification result of whether the node is connected is output, including: Multiple rounds of cross-validation are performed on the input and output sets, and the model parameters are optimized based on the cross-validation results; The binary classification algorithm model includes any one of the following: logistic regression, support vector machine, K-nearest neighbor algorithm, decision tree, random forest, decision tree-based Boosting model, multilayer perceptron, and convolutional neural network. In each round of cross-validation, the input set and output set are divided into K parts, K-1 parts are used as the training set and the remaining 1 part is used as the validation set, and the process is repeated K times to ensure that each data subset is used as a validation set for evaluation. Based on the comprehensive evaluation metrics of the validation set, the optimal parameter combination is determined by grid search, random search, or Bayesian optimization. To address the characteristic that most node pairs in topology identification problems are not connected, a hierarchical cross-validation method is adopted to maintain the ratio of category 0 to category 1 samples in each partitioned dataset consistent with the total dataset.

[0015] In one embodiment of the present invention, the input set and output set are input into a binary classification algorithm model, and the classification result of whether the node is connected is output, including: Output the connection relationship for each pair of nodes, where the connection relationship is a binary category, with category 1 indicating that the pair of nodes are connected to each other and category 0 indicating that the pair of nodes are not connected.

[0016] The technical solution of the present invention has the following advantages compared with the prior art: The present invention discloses a method for hybrid topology identification of cross-transformer distribution networks and microgrids. Based on the voltage data of smart meters at each node of the distribution network and microgrid from different transformers, which are mixed together, the method selects voltage-related data features and uses machine learning and deep learning algorithms for binary classification to determine the connection relationship of each pair of nodes, thereby reconstructing the topology of each distribution network and microgrid.

[0017] In the voltage data scenario of actual distribution networks or microgrids, this invention can accurately restore the topology of distribution networks or microgrids. In the test of one embodiment, the obtained F1 score (a comprehensive evaluation index in binary or multi-class classification tasks) can reach more than 95%, indicating that the node identification results of connection relationships have high accuracy and stability.

[0018] This invention has low input data requirements, only needing to acquire the voltage timing data of each node, without the need to collect additional electrical quantities such as current, power, and power factor, thus reducing data acquisition costs and deployment complexity.

[0019] The feature construction and calculation process of this invention is simple. The features used are mainly related, similar and graph theory path features. It does not rely on complex iterative solutions or high-dimensional optimization calculations. It is easy to implement in engineering and has high computational efficiency.

[0020] This invention has stronger topology restoration capabilities, applicable to the identification of tree-like radial topologies, and can also effectively restore topologies containing loop structures, covering more actual network configurations.

[0021] This invention has a wide range of applications and can be adapted to power distribution networks and microgrid scenarios with different voltage levels, exhibiting good cross-scenario portability and engineering versatility. Attached Figure Description

[0022] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings.

[0023] Figure 1 This is a flowchart of the method for identifying hybrid topologies of cross-transformer distribution networks and microgrids according to the present invention. Detailed Implementation

[0024] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.

[0025] In this invention, "several" means one or more, "multiple" means two or more, "greater than," "less than," "exceeding," etc., are understood to exclude the stated number; "above," "below," "within," etc., are understood to include the stated number. In the description of this invention, the terms "first" and "second" are used only to distinguish technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.

[0026] In this invention, unless otherwise explicitly defined, the terms "setting," "installing," and "connecting" should be interpreted broadly. For example, they can refer to a direct connection or an indirect connection through an intermediate medium; a fixed connection, a detachable connection, or an integrally formed connection; a mechanical connection, an electrical connection, or a connection capable of mutual communication; or the internal connection of two components or the interaction between two components. Those skilled in the art can reasonably determine the specific meaning of the above terms in this invention based on the specific content of the technical solution.

[0027] Reference Figure 1 As shown, the present invention provides a method for identifying a hybrid topology of a cross-transformer distribution network and a microgrid, comprising the following steps: Step S1: Collect the voltage time series recorded by smart meters at each node in the distribution network and microgrid to be identified.

[0028] Since many distribution networks are designed as a hybrid three-phase / single-phase system, supporting both three-phase and single-phase power supply, and microgrids also experience the coexistence of AC and DC power, the average voltage value recorded by smart meters for three-phase voltages should be taken as the single voltage value for that meter. The sampling window duration should be at least 24 hours. All smart meters must have the same sampling frequency, or be resampled to the same frequency.

[0029] Step S2: Preprocess the voltage time series to obtain an aligned voltage time series. Specifically, this includes sorting the voltage time series by time, deduplication, emptying singular values, linear interpolation padding, and timestamp alignment.

[0030] Step S3: Calculate the similarity coefficient based on the aligned voltage time series of each pair of nodes; wherein the similarity coefficient includes Pearson correlation coefficient, Spearman correlation coefficient, Kendall correlation coefficient, time series difference standard deviation, cosine similarity coefficient, co-trend coefficient, and mutual information.

[0031] Since current flowing through impedance causes voltage drop, two smart meters that are close in circuitry in a distribution network and microgrid will have two similar voltage time series. Therefore, the similarity of the voltages of two nodes can be used as one of the characteristics to identify whether they are interconnected. This invention will use seven similarity coefficients: Pearson correlation coefficient, Spearman correlation coefficient, Kendall correlation coefficient, standard deviation of time series difference, cosine similarity coefficient, common trend coefficient, and mutual information.

[0032] Suppose two voltage timing sequences located at timestamps 1, 2, 3, ..., N and Let N be the number of sampling points in the time series; then the calculation logic for the above 7 similarity coefficients is as follows: (a) Pearson correlation coefficient : ; in, Let X and Y be the covariances. and The standard deviations of X and Y are respectively, and the formulas are as follows: ; ; ; Where i is the i-th sampling point, and respectively represent the average values of X and Y.

[0033] (II) Spearman correlation coefficient : The Spearman correlation coefficient calculates the Pearson correlation coefficient for the ascending order sorting results of X and Y. Its calculation formula is as follows: ; where, R(X) and R(Y) respectively represent the ranks (ranking positions) corresponding to each value in X and Y, that is, the ranking position of each value after sorting in ascending order in its sequence.

[0034] (III) Kendall correlation coefficient : The Kendall correlation coefficient quantifies the degree of ordinal association between X and Y; for any two pairs of tuples and , , that is, timestamp i is earlier than timestamp j, their ordinal association means either is satisfied, or is satisfied; the formula for the Kendall correlation coefficient is: ; where, sgn represents the sign function, that is, it outputs 1 when greater than 0, 0 when equal to 0, and -1 when less than 0; N(N - 1) / 2 calculates the number of all subscript combinations that satisfy i < j.

[0035] (IV) Standard deviation of time series difference : The calculation formula for the standard deviation of time series difference is as follows: .

[0036] The greater the standard deviation of the difference between two time series, the more discrete the distribution of the difference, and the less similar the shapes of the two time series; conversely, it means that the distribution of the difference is more concentrated, and the shapes of the two time series are more similar.

[0037] In this invention, the value ranges of other similarity coefficients are all [-1, 1], and the similarity coefficient is positively correlated with the similarity. However, for the standard deviation of time series difference, , and the standard deviation of time series difference is negatively correlated with the similarity. For the unified calculation of subsequent feature engineering, this case not only needs to normalize the value range of the standard deviation of time series difference to [-1, 1], but also needs to make the normalized standard deviation of time series difference and time series similarity positively correlated.

[0038] Assuming that in a distribution network or microgrid cluster, the standard deviation of the timing difference between voltage timing sequences of each pair of nodes is... Then the normalized for: .

[0039] (v) Cosine Similarity: The cosine similarity coefficient records the cosine value of the angle formed by the voltage vectors of X and Y in each time interval. Since the range of the angle is [0, 180°), the closer the angle is to 0, the more similar the voltage vector directions, and the closer the cosine value is to 1; the closer the angle is to 180°, the greater the difference in voltage vector directions, and the closer the cosine value is to -1. The formula for calculating the cosine similarity coefficient of two complete time series is as follows: .

[0040] (vi) Concurrent Trend Coefficient: The co-trend coefficient records the proportion of intervals where X and Y rise or fall together out of the total number of intervals. Its calculation formula is: ; Here, sgn represents the sign function, which outputs 1 when it is greater than 0, 0 when it is equal to 0, and -1 when it is less than 0.

[0041] (vii) Mutual Information: Mutual information measures the amount of information one variable contains about another; it also represents the degree to which knowing one variable reduces the uncertainty about the other. For discrete variables such as voltage time series, the formula for calculating mutual information is: ; Here, p(x, y) represents the joint probability that X and Y simultaneously take specific values ​​x and y, and p(x) and p(y) represent the marginal probabilities when X takes a specific value x and when Y takes a specific value y, respectively.

[0042] The greater the mutual information between two time series, the more similar the two time series are in shape; conversely, the less similar the two time series are in shape.

[0043] In this invention, the value range of other similarity coefficients is [-1, 1]. However, for mutual information, For the purpose of unified calculation of subsequent feature engineering, the value range of mutual information needs to be normalized to [-1, 1].

[0044] Assuming that in a distribution network or microgrid cluster, the mutual information of voltage timing for each pair of nodes is... Then the normalized for: ; Of the seven similarity coefficients listed above, five have a range of [-1, 1], and two others, after normalization, also have a range of [-1, 1]. The closer the similarity coefficient is to 1, the more positively correlated and similar the shapes of the two voltage time series are. A coefficient of 1 represents perfect correlation, meaning the two time series have identical shapes. Conversely, the closer the similarity coefficient is to -1, the more negatively correlated the shapes of the two voltage time series are, meaning that when one curve rises, the other curve falls.

[0045] Therefore, the closer the seven similarity coefficients of two voltage time series are to 1, the more similar the changing trends of the two voltage time series are, the closer the smart meters recording these two voltage time series are in the circuit, and the higher the probability of them being connected to each other. Due to the different logic used to measure similarity, the output values ​​of these seven similarity coefficients are not equal.

[0046] The above 7 similarity coefficient values ​​are used as part of the features.

[0047] Step S4: Based on the similarity coefficient, construct a dissimilar fully connected graph; based on the dissimilar fully connected graph, obtain the graph theory features of each pair of nodes, the graph theory features include the shortest distance weight, shortest distance step size, minimum spanning tree distance weight, and minimum spanning tree distance step size for each pair of nodes corresponding to each similarity coefficient.

[0048] Specifically, based on the distance weight between any two nodes, and using each node as a vertex of the graph, a dissimilar fully connected graph is constructed. The distance weight is obtained by subtracting the similarity coefficient between any two nodes from 1.

[0049] It should be noted that since a similarity coefficient of 1 represents two voltage time series with completely identical shapes, and 1 is the maximum value that the similarity coefficient can reach, the 1-similarity coefficient measures the dissimilarity of two voltage time series. The larger the 1-similarity coefficient, the greater the dissimilarity between the two voltage time series. In a distribution network, microgrid, or distribution network connecting one or more microgrids, if the 1-similarity coefficient of each pair of nodes is regarded as the distance weight of each pair of nodes, then based on the distance weight from each node to every other node, all nodes can form a "dissimilarity" fully connected graph. In this dissimilarity fully connected graph, all distance weights are non-negative, so the shortest distance from node to node reflects the probability of nodes connecting to each other. The shorter the distance between two nodes, the greater the probability of them connecting, and vice versa. This is based on the shortest distance weight of each pair of nodes and the overall minimum distance weight of all nodes.

[0050] Specifically, based on the dissimilarity fully connected graph, the graph theory features of each pair of nodes are obtained, including: Obtain the set of all nodes in the dissimilar fully connected graph, the set of direct connection distances between all pairs of nodes, and the set of distance weights between each pair of nodes. Then, calculate the shortest distance weight for each pair of nodes based on Dijkstra's algorithm. The distance weight between each pair of nodes in the dissimilar fully connected graph is uniformly set to 1, and the shortest path step length between each pair of nodes is calculated based on Dijkstra's algorithm. Based on Kruskal's algorithm or Prim's algorithm, construct a minimum spanning tree on the dissimilar fully connected graph; The minimum spanning tree path distance weight between each pair of nodes is calculated based on the minimum spanning tree. The distance weight between each pair of nodes in the dissimilar fully connected graph is uniformly set to 1, and the minimum spanning tree path step between each pair of nodes is calculated on the minimum spanning tree.

[0051] It should be noted that Dijkstra's algorithm can be used to calculate the shortest distance from a given starting node to all other nodes in a graph with non-negative edge weights. The algorithm iteratively processes the currently shortest undetermined node and updates the distances of its neighbors in turn until the shortest path to all nodes is determined. Simultaneously, the algorithm records the predecessor node of each path so that the specific path from the starting node to each other node can be reconstructed when needed. The pseudocode of the algorithm is as follows:

[0052] Where V represents the set of all nodes, and E represents the set of direct distances between all pairs of nodes. V, E, represent the set of weights for the direct connection distances between each pair of points. These constitute all the elements of a fully connected graph G. `s` represents the source node. `dict` represents a key-value mapping structure implemented using a hash table, where each key maps to a numerical value. `dist` represents the length of the shortest path from the source node to all target nodes, and `prev` represents the node one step before each other on the shortest path from the source node to all target nodes.

[0053] Let a certain similarity coefficient be denoted as , This represents the similarity coefficient of voltage time series for all point pairs in a distribution network or microgrid cluster. Then, in a fully connected dissimilarity graph based on this similarity coefficient, it can be used... We calculate the shortest path for each pair of nodes in a dissimilarity fully connected graph based on seven different similarity coefficients, and thus obtain seven shortest distance weights between each pair of nodes.

[0054] When we change the weight of the direct distance between point pairs in a dissimilar fully connected graph from If the value is uniformly set to 1, then the direct distance between each pair of nodes represents the single-step step length.

[0055] Therefore, it is possible to utilize We calculate the shortest path step length for each pair of nodes in a fully connected graph with dissimilarity based on seven different similarity coefficients, thus obtaining seven shortest distance step lengths between each pair of nodes.

[0056] In a fully connected graph, a spanning tree is a tree diagram that contains all nodes of the fully connected graph. In the smart meter dissimilarity fully connected graph generated in Step 4, the spanning tree with the smallest total edge length (globally uncorrelated) is the minimum spanning tree, which represents the tree combination with the highest overall similarity of node voltages.

[0057] Common algorithms for constructing minimum spanning trees are Kruskal's algorithm and Prim's algorithm. Kruskal's algorithm starts by selecting the edge with the smallest weight and gradually adds edges that do not form cycles until a complete spanning tree structure is formed. Prim's algorithm starts from a single node and adds the node corresponding to the edge with the smallest weight connected to the spanning tree each time until a complete spanning tree structure is formed.

[0058] Kruskal's pseudocode is:

[0059] The pseudocode for Prim is:

[0060] Where V represents the set of all nodes, and E represents the set of direct distances between all pairs of nodes. V, E, represent the set of weights for the direct connection distances between each pair of points. These constitute all the elements of a fully connected graph G.

[0061] This invention can use either the Kruskal algorithm or the Prim algorithm to construct the minimum spanning tree.

[0062] In a minimum spanning tree, there is one and only one path from one node to another.

[0063] Based on a fully connected graph of dissimilarity with a certain similarity coefficient, we can utilize... We calculate the minimum spanning tree path for each pair of nodes in a dissimilarity fully connected graph based on 7 different similarity coefficients, and thus obtain 7 minimum spanning tree distance weights between each pair of nodes.

[0064] When the weights of the direct distances between point pairs in a fully connected, dissimilar graph are changed from... If the value is uniformly set to 1, then the direct distance between each pair of nodes represents the single-step step length.

[0065] Therefore, it is possible to utilize We calculate the minimum spanning tree path step for each pair of nodes in a fully connected graph with dissimilarity based on 7 different similarity coefficients. This gives us 7 minimum spanning tree distance steps between each pair of nodes.

[0066] Therefore, the feature engineering constructed through the above steps includes the following five categories of features: Similarity coefficient; ; ; ; ; Each feature class has seven values ​​based on a different similarity coefficient; therefore, a total of 35 features were constructed in this case. These features are based on a specific time window, which is greater than or equal to 24 hours.

[0067] Step S5: Construct the input set and output set of the node pair based on the similarity coefficient and graph theory features of each pair of nodes.

[0068] The 35 voltage characteristics of each pair of nodes map whether the pair of nodes are physically connected. In this case, 1 indicates that the pair of nodes are connected and 0 indicates that the pair of nodes are not connected.

[0069] Assuming there are a total of N pairs of nodes in multiple cross-transformer, mixed distribution networks and microgrids, these distribution networks and microgrids will generate an N-row, 35-column input matrix, where each row represents a pair of nodes and each column represents a feature. Each row outputs either 0 or 1, so the output matrix of these distribution networks and microgrids has a shape of N rows and 1 column.

[0070] When the number of hybrid distribution networks and microgrids is large, and the number of node pairs is enormous, the computational cost of calculating Dijkstra's distance and minimum spanning tree increases significantly. To address this, a batch processing approach can be adopted. Assuming the distribution network and microgrid cluster contains N pairs of nodes, and the computational cost of calculating Dijkstra's distance and minimum spanning tree based on these N pairs of nodes is too high, we allow each batch to contain B pairs of nodes, where B < N, and each batch contains an equal proportion of connected node pairs and an equal proportion of unconnected node pairs. Therefore, the task of calculating the Dijkstra's distance and minimum spanning tree for N nodes at once is broken down into calculations... This involves calculating the Dijkstra distance and minimum spanning tree for B pairs of nodes. This approach significantly reduces computational overhead and increases computational speed, accelerating feature construction.

[0071] Step S6: Input the input set and output set into the binary classification algorithm model, and output the classification result of whether the node is connected.

[0072] Collect voltage time series data of multiple distribution networks and multiple microgrids with known topologies over the past 24 hours, construct voltage characteristics according to steps 3 to 6, and construct input and output sets according to step 7.

[0073] A binary classification algorithm model was selected to perform multiple rounds of cross-validation on the dataset, and the model parameters were optimized based on the results of each round of cross-validation.

[0074] Commonly used machine learning binary classification algorithms include logistic regression, support vector machine, k-nearest neighbors, decision tree, random forest, and decision tree-based boosting methods; commonly used deep learning binary classification algorithms include multilayer perceptron and convolutional neural network.

[0075] The following is a description of the algorithm: (a) Logistic Regression: The task of logistic regression is to learn the feature mapping of each sample to its classification result by substituting the features and classification result of each sample into the following formula: ; in, This represents the binary classification result for sample i. , This represents the f-th feature value of sample i. There are a total of p feature values. These represent the weighting coefficients in the fitting process. This represents the bias term in the fitting process.

[0076] (ii) Support Vector Machine: Support Vector Machines (SVMs) take the features and classification results of each sample and feed them into the following optimization objective to learn a hyperplane that separates samples of different classes as correctly as possible while maximizing the margin between samples: ; The constraints are: ; in, This represents the feature vector of sample i. This represents the classification result of sample i. w is the hyperplane normal vector, and b is the bias term. These are slack variables, used to allow for some samples to be misclassified. C is the regularization coefficient, used to balance maximizing the margin and minimizing the classification error; Support Vector Machine (SVM) To maximize the classification margin, while using a penalty term To control classification errors.

[0077] (III) K-Nearest Neighbors Algorithm: The K-Nearest Neighbors algorithm uses the features and classification result of each sample in the following formula to calculate similarity based on sample features and to predict the classification of samples based on their K nearest neighbors: ; ; in, This represents the feature vector of sample i. This represents the classification result of sample i. This represents the predicted classification value for sample i. This represents the set of K nearest neighbor samples of sample i, usually determined by Euclidean distance or other similarity measures; mode represents the category that appears most frequently among the K neighbors, i.e., the majority voting principle.

[0078] (iv) Decision Tree: The decision tree algorithm takes the features and classification result of each sample and feeds them into the following process to train the tree structure through feature partitioning and to map the sample features to the classification result through the predicted values ​​of the leaf nodes: During the training phase, a decision tree is constructed by recursively partitioning the feature space of the training samples. The optimal feature is selected at each partition. and splitting threshold To maximize node purity or minimize the objective function: ; Wherein, Gain is the partitioning gain function, such as information gain, Gini coefficient, or mean square error; The set of samples for the parent node; The set of child node samples divided according to the partition; Recursively partition until the stopping condition is met (maximum depth, minimum number of samples, or sufficient purity of leaf nodes); Predicted value for each leaf node Determined by the leaf node sample; After training, for new samples The prediction can be represented by a leaf node mapping as follows: ; Where L is the total number of leaf nodes. The predicted value for each leaf node, The feature vector representing sample i. Indicates the first The feature space region corresponding to each leaf node. 1 indicates that the indicator function is active when a sample falls into a leaf node. The value is 1 if the condition is met, otherwise it is 0. This represents the classification prediction value of sample i to be predicted.

[0079] (v) Random Forest: Random forests through ensemble Decision Tree This implements the mapping from sample features to prediction results. During training, each tree uses a bootstrap sampling method to generate a training subset, and randomly selects a subset of features at each node for partitioning, thereby increasing model diversity.

[0080] In the prediction phase, for the sample The output is either the average of the predictions from each tree or the voting results: ; Random forests reduce the risk of overfitting from a single tree by ensembling multiple random decision trees, thereby improving the stability and accuracy of classification or regression.

[0081] (vi) Boosting method based on decision tree: The decision tree-based Boosting method trains multiple weak decision trees iteratively. These are combined into a strong learner to achieve the mapping from sample features to prediction results.

[0082] Each iteration trains a new tree by fitting the residuals or gradient information from the previous iteration, thereby gradually optimizing the overall prediction performance. ; During training, the objective function is typically minimized: ; in, For loss function, This is a regularization term for the tree, used to control the model complexity.

[0083] (vii) Multilayer perceptron: The task of a multilayer perceptron is to transform the feature vector of the input sample into a multilayer perceptron. The mapping to the prediction result involves progressively learning a nonlinear representation of the input features through several fully connected layers and activation functions. ; ; ; in, For input features, For the first Hidden layer output of the layer, and For the first Layer weights and biases For activation function, Map the output layer to predicted values ​​or probabilities. This represents the classification prediction result for sample i to be predicted.

[0084] (viii) Convolutional Neural Networks: The task of convolutional neural networks is to map the feature matrix of input samples (such as images or one-dimensional / multi-dimensional sequences) into prediction results, and to extract local and global features step by step through convolutional layers, activation layers, pooling layers, and fully connected layers. ; ; in, For the first The layer's input feature map / feature matrix / feature vector; and For the first The kernel weights and biases of the layer, where * indicates a convolution operation. For activation functions; Mapping the fully connected layer to the output prediction, This represents the classification prediction result for sample i to be predicted.

[0085] The aforementioned algorithms can undergo N rounds of cross-validation on the dataset to optimize model parameters. In each round of cross-validation, the dataset is divided into K equal parts, with K-1 parts used as the training set for training and the remaining part as the validation set for validation. Each round of cross-validation involves K training and evaluation iterations to ensure all data is used as both training and validation sets. After each round of cross-validation, the model performance is evaluated based on the overall performance of the validation sets, and parameters are adjusted accordingly to optimize the model. After completing one round of cross-validation, the optimal parameter combination for the binary classification model can be selected based on the overall performance of all validation sets using methods such as grid search, random search, or Bayesian optimization. The updated parameters are then applied to the next round of cross-validation until all N rounds of cross-validation are completed, resulting in the optimal model parameter configuration with the best overall performance.

[0086] For cross-validation, the data partitioning can be chosen by randomly dividing the data into K equal parts before each round of cross-validation, or by fixing the partitioning scheme before the first round of cross-validation, ensuring that the same data partitioning is used for each round of training and validation. Furthermore, considering the characteristic that most node pairs in topology recognition problems are not connected, a hierarchical cross-validation method can be adopted. This involves maintaining the ratio of category 0 to category 1 samples in each partitioned data set consistent with or approximately consistent with the total dataset, thereby improving the stability and reliability of model training and validation, as well as enhancing the model's generalization ability.

[0087] Step S7: Based on the classification results of each node pair, reconstruct the topology of the distribution network and microgrid. Output the connection relationship for each node pair, where the connection relationship is a binary category, with category 1 indicating that the node pair is connected to each other and category 0 indicating that the node pair is not connected.

[0088] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0089] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0090] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0091] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

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

Claims

1. A method for identifying hybrid topologies across transformer distribution networks and microgrids, characterized in that, Including: Collect the voltage time series recorded by the smart meters at each node in the distribution network and microgrid to be recognized; Preprocess the voltage time series to obtain the aligned voltage time series; Calculate the similarity coefficients based on the aligned voltage time series for each pair of nodes; wherein, the similarity coefficients include Pearson correlation coefficient, Spearman correlation coefficient, Kendall correlation coefficient, standard deviation of time series difference, cosine similarity coefficient, co-trend coefficient, and mutual information; Construct a dissimilarity complete connection graph based on the similarity coefficients; based on the dissimilarity complete connection graph, obtain the graph theory features of each pair of nodes respectively, and the graph theory features include the shortest distance weight, shortest distance step, minimum spanning tree distance weight, and minimum spanning tree distance step corresponding to each similarity coefficient for each pair of nodes; Construct the input set and output set of the node pair based on the similarity coefficients and the graph theory features of each pair of nodes; Input the input set and output set into a binary classification algorithm model, and output the classification result of whether the node pair is connected; Reconstruct the topological structures of the distribution network and microgrid based on the classification results of each node pair.

2. The method for identifying hybrid topology of cross-transformer distribution networks and microgrids according to claim 1, characterized in that, Collect the voltage time series recorded by the smart meters at each node in the distribution network and microgrid to be recognized, including: The sampling window duration is not less than 24 hours; When the smart meter records three-phase voltages, take the average value of the three-phase voltages as the single voltage value of the smart meter; When the sampling frequencies of each smart meter are inconsistent, resample the voltage time series to the same sampling frequency.

3. The method for identifying hybrid topology of cross-transformer distribution networks and microgrids according to claim 1, characterized in that, Preprocess the voltage time series to obtain the aligned voltage time series, including: Perform operations on the voltage time series including sorting by time, removing duplicates, setting singular values to null, linearly interpolating to fill gaps, and timestamp alignment.

4. The method for identifying hybrid topology of cross-transformer distribution networks and microgrids according to claim 1, characterized in that, Calculate the similarity coefficients based on the aligned voltage time series for each pair of nodes, including: Suppose two voltage timing sequences located at timestamps 1, 2, 3, ..., N and N is the number of sampling points in the time series; Pearson correlation coefficient The calculation is as follows: ; in, Let X and Y be the covariances. and The standard deviations of X and Y are respectively, and the formulas are as follows: ; ; ; Where i is the i-th sampling point, and These represent the average values ​​of X and Y, respectively. Spearman correlation coefficient The Pearson correlation coefficient is calculated based on the ascending sorted results of X and Y. The calculation formula is as follows: ; Where R(X) and R(Y) respectively represent the ranks, i.e., the ranking positions, of the corresponding values in X and Y, that is, the ranking position of each value after sorting its sequence in ascending order; The Kendall correlation coefficient quantifies the degree of ordinal association between X and Y; for any two pairs of tuples in X and Y... and , That is, timestamp i is earlier than timestamp j, and their sequential association means that either satisfies Either satisfy Kendall correlation coefficient The formula is: ; Where sgn represents the sign function, that is, output 1 when greater than 0, output 0 when equal to 0, and output -1 when less than 0; N(N - 1) / 2 calculates the number of all subscript combinations that satisfy i < j; Time series difference standard deviation The calculation formula is as follows: ; Assuming that in a distribution network or microgrid cluster, the standard deviation of the timing difference between voltage timing sequences of each pair of nodes is... Let D be the set of standard deviations of voltage timing differences for all nodes. Then the normalized... for: ; Cosine similarity coefficient The calculation formula is as follows: ; in, The angle formed by the voltage vectors for each time interval, with a range of [0, 180°); This indicates that the voltage timing X is within the time interval. Vectors within, This indicates that the voltage timing Y is within the time interval. Vectors within; When the included angle is closer to 0, the directions of the voltage vectors are more convergent, and the cosine value is closer to 1; when the included angle is closer to 180°, the directions of the voltage vectors have a greater difference, and the cosine value is closer to -1; Common trend coefficient It records the percentage of intervals where X and Y both rise or fall, out of the total number of intervals. The formula for calculating this percentage is: ; Where sgn represents the sign function, that is, output 1 when greater than 0, output 0 when equal to 0, and output -1 when less than 0; Mutual Information Mutual information measures the amount of information one variable contains about another, and also represents the degree to which knowing one variable reduces the uncertainty about the other. For discrete variables such as voltage time series, the formula for calculating mutual information is: ; Where p(x, y) represents the joint probability that X and Y simultaneously take the specific values x and y, and p(x) and p(y) respectively represent the marginal probabilities when X takes the specific value x and when Y takes the specific value y; the greater the mutual information between two time series, the more similar the shapes of the two time series are; conversely, the less similar the shapes of the two time series are; Assuming that in a distribution network or microgrid cluster, the mutual information of voltage timing for each pair of nodes is... Let M be the set of voltage timing mutual information for all nodes, then the normalized... for: 。 5. The method for identifying hybrid topology of cross-transformer distribution networks and microgrids according to claim 1, characterized in that, Construct a dissimilarity complete connection graph based on each of the similarity coefficients, including: Construct a dissimilarity complete connection graph based on the distance weights between any two nodes and using each node as a vertex of the graph; The distance weight is obtained by subtracting the similarity coefficient between any two nodes from 1.

6. The method for identifying a hybrid topology of a cross-transformer distribution network and a microgrid according to claim 1, characterized in that, Based on the dissimilarity fully connected graph, the graph theory features of each pair of nodes are obtained, including: Obtain the set of all nodes in the dissimilar fully connected graph, the set of direct connection distances between all pairs of nodes, and the set of distance weights between each pair of nodes. Then, calculate the shortest distance weight for each pair of nodes based on Dijkstra's algorithm. The distance weight between each pair of nodes in the dissimilar fully connected graph is uniformly set to 1, and the shortest path step length between each pair of nodes is calculated based on Dijkstra's algorithm. Based on Kruskal's algorithm or Prim's algorithm, construct a minimum spanning tree on the dissimilar fully connected graph; The minimum spanning tree path distance weight between each pair of nodes is calculated based on the minimum spanning tree. The distance weight between each pair of nodes in the dissimilar fully connected graph is uniformly set to 1, and the minimum spanning tree path step between each pair of nodes is calculated on the minimum spanning tree.

7. The method for identifying a hybrid topology of a cross-transformer distribution network and a microgrid according to claim 6, characterized in that, Also includes: When the number of node pairs to be processed is N and the computational cost for calculating the shortest path distance weight, shortest path step size, minimum spanning tree path distance weight, and minimum spanning tree path step size exceeds a preset threshold, the N node pairs are divided into There are N batches, where each batch contains B pairs of nodes and B < N; For each batch, the shortest distance weight, shortest path step size calculation, and minimum spanning tree construction based on Dijkstra's algorithm are performed to generate the graph theory features corresponding to that batch. Each batch contains an equal number of interconnected node pairs and an equal number of unconnected node pairs.

8. The method for identifying a hybrid topology of a cross-transformer distribution network and a microgrid according to claim 1, characterized in that, The input and output sets of each node pair are constructed based on the similarity coefficient and the graph theory features, including: The similarity coefficients corresponding to each pair of nodes are combined with graph theory features to form 35 voltage features. The 35 voltage features of each pair of nodes map whether the pair of nodes are physically connected. 1 indicates that the pair of nodes are connected to each other, and 0 indicates that the pair of nodes are not connected to each other. Assume that there are a total of N pairs of nodes in the multi-transformer, mixed distribution network and microgrid. The distribution network and microgrid generate an N-row, 35-column input matrix, where each row represents a pair of nodes and each column is a voltage feature. Each row outputs 0 or 1. Therefore, the output matrix of the distribution network and microgrid has an N-row, 1-column shape.

9. The method for identifying hybrid topology of cross-transformer distribution networks and microgrids according to claim 1, characterized in that, The input and output sets are input into a binary classification algorithm model, and the classification result of whether the node is connected is output, including: Multiple rounds of cross-validation are performed on the input and output sets, and the model parameters are optimized based on the cross-validation results; The binary classification algorithm model includes any one of the following: logistic regression, support vector machine, K-nearest neighbor algorithm, decision tree, random forest, decision tree-based Boosting model, multilayer perceptron, and convolutional neural network. In each round of cross-validation, the input set and output set are divided into K parts, K-1 parts are used as the training set and the remaining 1 part is used as the validation set, and the process is repeated K times to ensure that each data subset is used as a validation set for evaluation. Based on the comprehensive evaluation index of the validation set, the optimal parameter combination is determined by grid search, random search or Bayesian optimization. To address the characteristic that most node pairs in topology identification problems are not connected, a hierarchical cross-validation method is adopted to maintain the ratio of category 0 to category 1 samples in each partitioned dataset consistent with the total dataset.

10. The method for identifying a hybrid topology of a cross-transformer distribution network and a microgrid according to claim 1, characterized in that, The input and output sets are input into a binary classification algorithm model, and the classification result of whether the node is connected is output, including: Output the connection relationship for each pair of nodes, where the connection relationship is a binary category, where category 1 indicates that the pair of nodes are connected to each other, and category 0 indicates that the pair of nodes are not connected.