Power distribution network topology fast adaptive inference method and device based on meta learning
Patent Information
- Application Number
- CN202610704456.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-21
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2046-05-21
AI Technical Summary
[0003]然而,该架构的核心训练范式要求大量“量测数据-拓扑标签”的配对样本,而获取真实配电网的精确拓扑标签成本极高;并且该架构的训练与推断过程相分离,当面对一个全新的配电网区域时,必须收集大量该区域的标签数据重新训练模型,或进行全局微调,无法利用已有知识实现快速适应,严重影响配电网拓扑推断的效率
[0040]本申请实施例中的上述一个或多个技术方案,至少具有如下技术效果之一:
Smart Images

Figure CN122220888B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of smart grid technology, and in particular relates to a method and apparatus for fast adaptive inference of distribution network topology based on meta-learning. Background Technology
[0002] Distribution network topology inference is the process of inferring network connectivity relationships from grid node measurement data such as voltage, current, and power. Related technologies typically employ supervised deep learning-based methods to construct a distribution network measurement dataset with topological labels. A neural network is then used to learn a nonlinear mapping from measurement data to the topology, resulting in a trained machine learning model. During inference, measurement data from a new scenario is input into the trained model, and a topology classification result is obtained through a single forward propagation.
[0003] However, the core training paradigm of this architecture requires a large number of paired samples of "measurement data-topology labels", and obtaining accurate topology labels of real distribution networks is extremely costly. Furthermore, the training and inference processes of this architecture are separated. When faced with a completely new distribution network area, a large amount of label data for that area must be collected to retrain the model or to perform global fine-tuning. It is impossible to use existing knowledge to achieve rapid adaptation, which seriously affects the efficiency of distribution network topology inference. Summary of the Invention
[0004] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a method and apparatus for fast adaptive inference of distribution network topology based on meta-learning, so as to improve the efficiency of distribution network topology inference.
[0005] Firstly, this application provides a fast adaptive inference method for distribution network topology based on meta-learning, including: Obtain a first dataset; the first dataset includes multiple sets of first topology data of the distribution network and first measurement data of each distribution network; the first topology data represents the connection relationship between each node in the distribution network, and the first measurement data represents the operating status of each node in the distribution network; The first topological data is used as the label of the first measurement data to train the meta-initial model. Acquire second measurement data and topology tag data of the target distribution network; the topology tag data characterizes the connection relationships between some nodes in the target distribution network. The topology label data is used as the label for the second measurement data to train the meta-initial model and obtain the target topology inference model. Real-time measurement data of the target distribution network is acquired and input into the target topology inference model to obtain the target topology data of the target distribution network.
[0006] The meta-learning-based fast adaptive inference method for distribution network topology provided in this application first uses multiple sets of measurement data with complete topology labels as training datasets to train a meta-initial model with good initial parameters, which can quickly adapt to new data and be reused in different distribution networks. This allows the meta-initial model to be trained quickly with parameters close to the optimal solution for the target distribution network when inferring the topology of the target distribution network, based only on the target distribution network measurement data with partial topology labels. This results in a high-precision target topology inference model. Then, by inputting the real-time measurement data of the target distribution network into the target topology inference model, the target topology data of the target distribution network can be inferred. This reduces the data acquisition and model training costs required for the topology inference process of the target distribution network and improves the efficiency of distribution network topology inference.
[0007] According to one embodiment of this application, the meta-initial model includes: a feature extractor and a domain discriminator; the step of training the meta-initial model by using the first topological data as the label of the first measurement data includes: Obtain a second dataset; the second dataset includes multiple sets of third measurement data of the power distribution network, which are obtained through actual measurements; The first dataset contains all the first measurement data and the second dataset are merged to obtain the third dataset; the target measurement data are obtained by sampling from the third dataset. The target measurement data is input into the feature extractor to obtain the first node features; The first node feature is input into the domain discriminator to obtain the domain prediction probability; the domain prediction probability represents the probability that the target measurement data belongs to the second dataset; Based on the domain prediction probability and the domain label, a domain adversarial loss function is calculated; the domain label represents the dataset to which the target measurement data belongs. The parameters of the domain discriminator are updated with the goal of minimizing the domain adversarial loss function value; the parameters of the feature extractor are updated with the goal of maximizing the domain adversarial loss function value.
[0008] In this embodiment, by introducing an adversarial training mechanism, the parameters of the domain discriminator are updated with the goal of minimizing the domain adversarial loss function value. This improves the accuracy of the domain discriminator in identifying the source of measurement data. By updating the parameters of the feature extractor with the goal of maximizing the domain adversarial loss function value, the feature extractor is forced to learn features that the domain discriminator cannot distinguish, while retaining information that is effective for the topology inference task. This reduces the performance breakdown caused by the distribution difference between simulated data and real measurement data, enhances the generalization ability of the feature extractor, and thus enhances the accuracy of the meta-topology inference model.
[0009] According to one embodiment of this application, based on the formula:
[0010] The domain adversarial loss function is calculated; where, Let d represent the domain adversarial loss function, and d represent the domain label. This represents the domain prediction probability.
[0011] According to one embodiment of this application, the meta-initial model includes a feature extractor and a topology inference head; the step of training the meta-initial model by using the first topology data as a label for the first measurement data includes: Target first topology data is sampled from the first dataset, and the first measurement data corresponding to the target first topology data is divided into a first support set and a first query set; The first support set is input into the meta-initial model to obtain the second topology data; a first loss function is calculated based on the second topology data and the target first topology data; and the parameters of the topology inference head are updated based on the first loss function. The first query set is input into the meta-initial model after updating the parameters of the topology inference head to obtain the third topology data; the second loss function is calculated based on the third topology data and the target first topology data. The parameters of the feature extractor and the initial parameters of the topology inference head are updated based on the second loss function and the historical second loss function; the historical second loss function is calculated based on the historical first topology data.
[0012] In this embodiment, by updating the parameters of the topology inference head based on the loss of the second topology data relative to the first topology data, the ability of the topology inference head to adapt to different types of topologies can be improved. By combining the historical loss with the second loss function to update the parameters of the feature extractor, the overfitting of the feature extractor to part of the training data can be reduced, thereby improving the accuracy of the meta-initial model.
[0013] According to one embodiment of this application, based on the formula:
[0014] The first loss function is calculated; in, This represents the parameters of the feature extractor. The parameters representing the topology inference head, This represents the first loss function. E represents the set of connection edges of each node in the distribution network, and u and v represent the nodes of the distribution network. This represents the probability of the existence of edge uv.
[0015] According to one embodiment of this application, the step of using the topology label data as labels for the second measurement data to train the meta-initial model and obtain a target topology inference model includes: The second measurement data is divided into a second support set and a second query set; The second support set is input into the meta-initial model to obtain the fourth topology data; a third loss function is calculated based on the fourth topology data and the topology label data; and the parameters of the meta-initial model are updated based on the third loss function. The second query set is input into the updated meta-initial model to obtain the fifth topological data; the fourth loss function is calculated based on the fifth topological data and the topological label data. Calculate the difference between the third loss function and the fourth loss function. If the difference is less than the difference threshold, determine the meta-initial model as the target topology inference model.
[0016] In this embodiment, by calculating the difference between the third loss function and the fourth loss function, training is terminated when the difference is less than the difference threshold, which can reduce the possibility of model overfitting.
[0017] According to one embodiment of this application, the step of inputting the real-time measurement data into the target topology inference model to obtain the target topology data of the target distribution network includes: The real-time measurement data is input into the target topology inference model, and multiple random perturbations are added to the target topology inference model to obtain multiple candidate edges of the target distribution network, and each candidate edge corresponds to multiple existence probabilities. Based on the existence probabilities of each, the edge confidence corresponding to the candidate edge is calculated, and the candidate edge whose edge confidence is greater than the edge confidence threshold is determined as the target edge; The target topology data is generated based on each target edge.
[0018] In this embodiment, by adding multiple random perturbations to the target topology inference model during the topology inference process, candidate edges with multiple existence probabilities are obtained, and the edge confidence of the candidate edges is calculated based on each existence probability. This can quantify the uncertainty of the model's topology inference process. By determining the candidate edges with edge confidence greater than the edge confidence threshold as target edges, the accuracy of the target topology inference results can be improved.
[0019] According to one embodiment of this application, based on the formula:
[0020] Calculate the edge confidence; Where M represents the number of perturbations. This represents the edge confidence level corresponding to the candidate edge uv. Let represent the probability that the m-th candidate edge uv exists.
[0021] According to one embodiment of this application, the method further includes: Calculate the global confidence of the target topology data based on the edge confidence of each candidate edge; When the global confidence level is lower than the global confidence level threshold, the second measurement data and topology label data of the target distribution network are updated, and the target topology inference model is trained.
[0022] In this embodiment, by calculating the global confidence of the target topology data based on the edge confidence of each candidate edge, the uncertainty in the entire process of model topology inference can be quantified. By updating the data and retraining the model when the global confidence is lower than the global confidence threshold, the situation of decision errors caused by model erroneous inference can be reduced, thereby improving the accuracy of the final target topology data.
[0023] According to one embodiment of this application, based on the formula:
[0024] The global confidence level is calculated. in, Let E represent the global confidence level, and E represent the total number of candidate edges. This represents the edge confidence level corresponding to the candidate edge uv.
[0025] According to one embodiment of this application, the first measurement data includes measurement data of each node in the distribution network at multiple times. The measured data includes at least one of voltage, active power, reactive power, and voltage phase angle.
[0026] According to one embodiment of this application, obtaining the first dataset includes: The first topology data is generated based on the number of target nodes, the target structure type, and the target branch depth. Based on the target line impedance, target load curve, target operating scenario, target noise mode, and the first topology data, a simulated distribution network is generated and simulated to obtain the first measurement data corresponding to the simulated distribution network.
[0027] In this embodiment, by generating and simulating a simulated power distribution network, a large amount of measurement data with complete topological data annotation can be generated quickly, thereby reducing the need for manually annotated data and improving the construction efficiency of the first dataset. By configuring diverse simulation parameters, the diversity of the obtained training samples can be increased, thereby improving the generalization ability of the meta-initial model.
[0028] Secondly, this application provides a fast adaptive inference device for distribution network topology based on meta-learning, comprising: The first acquisition module is used to acquire a first dataset; the first dataset includes multiple sets of first topology data of the distribution network and first measurement data of each distribution network; the first topology data represents the connection relationship between each node in the distribution network, and the first measurement data represents the operating status of each node in the distribution network. The first training module is used to train a meta-initial model by using the first topological data as the label of the first measurement data. The second acquisition module is used to acquire second measurement data and topology tag data of the target distribution network; the topology tag data represents the connection relationship between some nodes in the target distribution network. The second training module is used to train the meta-initial model by using the topology label data as the label of the second measurement data to obtain the target topology inference model. The input module is used to acquire real-time measurement data of the target distribution network and input the real-time measurement data into the target topology inference model to obtain the target topology data of the target distribution network.
[0029] According to the meta-learning-based fast adaptive inference device for distribution network topology of this application, by first using multiple sets of measurement data with complete topology labels as training datasets, a meta-initial model with good initial parameters is trained, which can quickly adapt to new data and be reused in different distribution networks. When inferring the topology of the target distribution network, it is only necessary to train the meta-initial model based on the target distribution network measurement data with partial topology labels. The parameters of the meta-initial model can then quickly converge to near the optimal solution for the target distribution network, resulting in a high-precision target topology inference model. Then, by inputting the real-time measurement data of the target distribution network into the target topology inference model, the target topology data of the target distribution network can be inferred. Thus, the data acquisition and model training costs required for the topology inference process of the target distribution network can be reduced, and the efficiency of distribution network topology inference can be improved.
[0030] According to one embodiment of this application, the first training module is further configured to: Obtain a second dataset; the second dataset includes multiple sets of third measurement data of the power distribution network, which are obtained through actual measurements; The first dataset contains all the first measurement data and the second dataset are merged to obtain the third dataset; the target measurement data are obtained by sampling from the third dataset. The target measurement data is input into the feature extractor to obtain the first node features; The first node feature is input into the domain discriminator to obtain the domain prediction probability; the domain prediction probability represents the probability that the target measurement data belongs to the second dataset; Based on the domain prediction probability and the domain label, a domain adversarial loss function is calculated; the domain label represents the dataset to which the target measurement data belongs. The parameters of the domain discriminator are updated with the goal of minimizing the domain adversarial loss function value; the parameters of the feature extractor are updated with the goal of maximizing the domain adversarial loss function value.
[0031] According to one embodiment of this application, the first training module is further configured to: Target first topology data is sampled from the first dataset, and the first measurement data corresponding to the target first topology data is divided into a first support set and a first query set; The first support set is input into the meta-initial model to obtain the second topology data; a first loss function is calculated based on the second topology data and the target first topology data; and the parameters of the topology inference head are updated based on the first loss function. The first query set is input into the meta-initial model after updating the parameters of the topology inference head to obtain the third topology data; the second loss function is calculated based on the third topology data and the target first topology data. The parameters of the feature extractor and the parameters of the topology inference head are updated based on the second loss function and the historical second loss function; the historical second loss function is calculated based on the historical first topology data.
[0032] According to one embodiment of this application, the second training module is further configured to: The second measurement data is divided into a second support set and a second query set; The second support set is input into the meta-initial model to obtain the fourth topology data; a third loss function is calculated based on the fourth topology data and the topology label data; and the parameters of the meta-initial model are updated based on the third loss function. The second query set is input into the updated meta-initial model to obtain the fifth topological data; the fourth loss function is calculated based on the fifth topological data and the topological label data. Calculate the difference between the third loss function and the fourth loss function. If the difference is less than the difference threshold, determine the meta-initial model as the target topology inference model.
[0033] According to one embodiment of this application, the input module is further configured to: The real-time measurement data is input into the target topology inference model, and multiple random perturbations are added to the target topology inference model to obtain multiple candidate edges of the target distribution network, and each candidate edge corresponds to multiple existence probabilities. Based on the existence probabilities of each, the edge confidence corresponding to the candidate edge is calculated, and the candidate edge whose edge confidence is greater than the edge confidence threshold is determined as the target edge; The target topology data is generated based on each target edge.
[0034] According to one embodiment of this application, the first acquisition module is further configured to: The first topology data is generated based on the number of target nodes, the target structure type, and the target branch depth. Based on the target line impedance, target load curve, target operating scenario, target noise mode, and the first topology data, a simulated distribution network is generated and simulated to obtain the first measurement data corresponding to the simulated distribution network.
[0035] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the fast adaptive inference method for distribution network topology based on meta-learning as described in the first aspect above.
[0036] Fourthly, this application provides a fast adaptive inference system for distribution network topology based on meta-learning, comprising: A cloud-based training platform is used to acquire a first dataset; the first dataset includes multiple sets of first topology data of distribution networks and first measurement data of each distribution network; the first topology data represents the connection relationship between each node in the distribution network, and the first measurement data represents the operating status of each node in the distribution network; the first topology data is used as the label of the first measurement data to train a meta-initial model; the meta-initial model is then distributed to the regional edge computing nodes; A regional edge computing node is used to acquire second measurement data and topology label data of a target distribution network; the topology label data represents the connection relationship between some nodes in the target distribution network; the topology label data is used as the label of the second measurement data to train the meta-initial model to obtain a target topology inference model; real-time measurement data of the target distribution network is acquired and input into the target topology inference model to obtain the target topology data of the target distribution network; the target topology data is transmitted to the operation and maintenance terminal; The operation and maintenance terminal is used to display the target topology data.
[0037] Fifthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the fast adaptive inference method for distribution network topology based on meta-learning as described in the first aspect above.
[0038] In a sixth aspect, this application provides a chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the fast adaptive inference method for distribution network topology based on meta-learning as described in the first aspect above.
[0039] In a seventh aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the fast adaptive inference method for distribution network topology based on meta-learning as described in the first aspect above.
[0040] The above-described one or more technical solutions in the embodiments of this application have at least one of the following technical effects: According to the meta-learning-based fast adaptive inference method for distribution network topology proposed in this application, multiple sets of measurement data with complete topology labels are first used as training datasets to train a meta-initial model with good initial parameters, which can quickly adapt to new data and be reused in different distribution networks. When inferring the topology of the target distribution network, it is only necessary to train the meta-initial model based on the target distribution network measurement data with partial topology labels. The parameters of the meta-initial model can then quickly converge to near the optimal solution for the target distribution network, resulting in a high-precision target topology inference model. Then, the real-time measurement data of the target distribution network is input into the target topology inference model to infer the target topology data of the target distribution network. Thus, the data acquisition and model training costs required for the topology inference process of the target distribution network can be reduced, and the efficiency of distribution network topology inference can be improved.
[0041] In some embodiments, by introducing an adversarial training mechanism to update the parameters of the domain discriminator with the goal of minimizing the domain adversarial loss function value, the accuracy of the domain discriminator in identifying the source of measurement data can be improved. By updating the parameters of the feature extractor with the goal of maximizing the domain adversarial loss function value, the feature extractor can be forced to learn features that the domain discriminator cannot distinguish, while retaining information that is effective for the topology inference task. This reduces the performance breakdown caused by the distribution difference between simulated data and real measurement data, enhances the generalization ability of the feature extractor, and thus enhances the accuracy of the meta-topology inference model.
[0042] In some embodiments, updating the parameters of the topology inference head based on the loss of the second topology data relative to the first topology data can improve the ability of the topology inference head to adapt to different types of topologies. By updating the parameters of the feature extractor in combination with the historical loss second loss function, the overfitting of the feature extractor to part of the training data can be reduced, thereby improving the accuracy of the meta-initial model.
[0043] In some embodiments, by adding multiple random perturbations to the target topology inference model during the topology inference process, candidate edges with multiple existence probabilities are obtained, and the edge confidence of the candidate edges is calculated based on each existence probability. This can quantify the uncertainty of the model's topology inference process. By determining the candidate edges with edge confidence greater than the edge confidence threshold as target edges, the accuracy of the target topology inference results can be improved.
[0044] In some embodiments, by calculating the global confidence of the target topology data based on the edge confidence of each candidate edge, the uncertainty in the entire process of model topology inference can be quantified. By updating the data and retraining the model when the global confidence is lower than the global confidence threshold, the situation of decision errors caused by model erroneous inference can be reduced, thereby improving the accuracy of the final target topology data.
[0045] In some embodiments, by generating and simulating a simulated power distribution network, a large amount of measurement data with complete topological data annotations can be generated quickly, thereby reducing the need for manually annotated data and improving the construction efficiency of the first dataset. By configuring diverse simulation parameters, the diversity of the obtained training samples can be increased, thereby improving the generalization ability of the meta-initial model.
[0046] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0047] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This is a flowchart illustrating the fast adaptive inference method for distribution network topology based on meta-learning provided in this application embodiment; Figure 2 This is one of the architectural diagrams of the meta-initial model provided in the embodiments of this application; Figure 3This is the second schematic diagram of the architecture of the meta-initial model provided in the embodiments of this application; Figure 4 This is a schematic diagram of the fast adaptive inference process of distribution network topology based on meta-learning provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of the fast adaptive inference device for distribution network topology based on meta-learning provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application; Figure 7 This is a schematic diagram of the structure of the fast adaptive inference system for distribution network topology based on meta-learning provided in the embodiments of this application. Detailed Implementation
[0049] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0050] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0051] The following description, in conjunction with the accompanying drawings, details the fast adaptive inference method and apparatus for distribution network topology based on meta-learning provided in this application through specific embodiments and application scenarios.
[0052] Among them, the fast adaptive inference method for distribution network topology based on meta-learning can be applied to the terminal, specifically executed by the hardware or software in the terminal.
[0053] The terminal includes, but is not limited to, portable communication devices such as mobile phones or tablets with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads). It should also be understood that, in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads).
[0054] The following embodiments describe a terminal including a display and a touch-sensitive surface. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.
[0055] The fast adaptive inference method for distribution network topology based on meta-learning provided in this application embodiment can be executed by an electronic device or a functional module or entity within an electronic device capable of implementing the meta-learning-based fast adaptive inference method for distribution network topology. The electronic devices mentioned in this application embodiment include, but are not limited to, servers, industrial control computers, edge computing gateways, embedded processors, programmable logic controllers, IoT gateways, personal computers, workstations, cloud computing nodes, distributed computing systems, mobile terminals, intelligent inspection equipment, and field monitoring hosts. The following description uses an electronic device as an example to illustrate the fast adaptive inference method for distribution network topology based on meta-learning provided in this application embodiment.
[0056] like Figure 1 As shown, the fast adaptive inference method for distribution network topology based on meta-learning includes steps 110, 120, 130, 140 and 150.
[0057] Step 110: Obtain the first dataset; the first dataset includes multiple sets of first topology data of the distribution network and first measurement data of each distribution network; the first topology data represents the connection relationship between each node in the distribution network, and the first measurement data represents the operating status of each node in the distribution network.
[0058] This application is based on the meta-learning framework. Meta-learning is a machine learning paradigm whose core idea is to teach the model "how to learn." By training on a large number of different tasks, the model learns to adjust its learning strategies or parameters, so that when faced with a completely new task, the model can use the meta-knowledge it has learned before to quickly adapt with only a small amount of sample data and a few updates.
[0059] In this embodiment, a first dataset with complete topology data labels is used as the meta-training set for the meta-initial model. The first dataset includes multiple sets of first topology data for distribution networks, and first measurement data for each distribution network. For example, the first dataset contains K sets of data. ,in This represents the data corresponding to the i-th distribution network; ,in This represents the first topology data of the i-th distribution network. This represents the first measurement data of the i-th distribution network. The topology data and measurement data of the distribution network can be obtained through simulation generation, manual on-site collection, etc., and the first dataset can be constructed.
[0060] The first topology data characterizes the connectivity relationships between nodes in a distribution network. A node refers to an electrical connection point in the distribution network, which can be a location where current converges, branch connections occur, or line conditions change significantly. The first topology data can be in the form of set tuples, for example... ,in For a set of nodes, This is the set of edges connecting nodes; the first topological data can also be in the form of an adjacency matrix, for example... ,in The value can be 0 or 1. This indicates that there is a connecting edge between nodes u and v. This indicates that there is no connecting edge between nodes u and v; of course, the first topological data can also be in other forms such as an association matrix or an adjacency list, and this application embodiment does not limit this.
[0061] The first measurement data characterizes the operating status of each node in the distribution network. For example, in some embodiments, the first measurement data includes measurement data of each node in the distribution network at multiple times. The measurement data includes at least one of voltage, active power, reactive power, and voltage phase angle. Then, the first measurement data corresponding to the first topology data of the i-th group of distribution networks is... ,in .
[0062] Of course, one set of first topology data can correspond to multiple sets of first measurement data, such as measurement data of the same distribution network under different operating scenarios; the first measurement data can also include other parameters, such as current amplitude, electrical energy, temperature, etc.; the first measurement data can also be preprocessed, such as time alignment, outlier removal, missing value interpolation, normalization, etc., but this application embodiment does not limit this.
[0063] Step 120: Use the first topological data as the label for the first measurement data to train the meta-initial model.
[0064] Measurement data from each node in a power distribution network can reflect the connectivity between nodes. For example, according to Kirchhoff's laws, the sum of currents flowing into a node is zero, and the sum of voltage drops in the same loop is zero. Therefore, we can analyze the statistical correlation or conditional dependence between the current and voltage measurements of each node at different times, find node combinations that satisfy Kirchhoff's laws, and thus infer whether any two nodes are connected. This application employs a deep learning-based method, utilizing a neural network to learn a nonlinear mapping pattern from measurement data to topology, enabling the model to infer topology data from the input measurement data.
[0065] In the embodiments of this application, the Model-Agnostic Meta-Learning (MAML) algorithm can be used for meta-training.
[0066] First, we construct a meta-learning foundational model based on methods such as Generative Adversarial Networks (GANs) and Graph Neural Networks (GNNs). For each meta-training iteration, from the meta-training set... The task is obtained by random sampling. The first measurement data enter , obtain Topology data obtained from mapping measurement data ,according to Compared to the first topology data The loss function is updated during backpropagation. The parameters are determined. The meta-training iterations are repeated until the meta-training converges or a preset termination condition is met, thus obtaining a meta-initial model with well-defined parameters. .
[0067] Of course, in addition to optimization-based methods such as the MAML algorithm, other algorithms can be used to train the meta-initial model, such as metric-based methods like prototype networks and matching networks, and memory-based methods like MANN (Memory-Augmented Neural Network). This application does not limit the specific methods used in this embodiment.
[0068] Step 130: Obtain the second measurement data and topology tag data of the target distribution network; the topology tag data represents the connection relationship between some nodes in the target distribution network.
[0069] Based on the theoretical foundation of meta-learning, through meta-training on a large number of diverse tasks, the initial parameters learned by the model are located at a position sensitive to all tasks. That is, near these parameters, a small number of gradient updates for any new task can quickly bring the model to the vicinity of the optimal solution for that task. Mathematically, it can be proven that when the meta-training tasks are sufficiently diverse, the upper bound of the generalization error for new tasks is inversely proportional to the number of fine-tuning samples, meaning that only a small number of samples are needed to achieve good performance.
[0070] Therefore, after training the initial meta-model, when it is necessary to deploy the initial meta-model to a brand new real distribution network, only a small amount of labeled data of the target distribution network needs to be collected and the model parameters are finely adjusted. This allows the initial meta-model to quickly adapt to the current distribution network and thus obtain a high-precision target topology inference model.
[0071] The second measurement data of the target distribution network Z can be obtained from data acquisition devices such as the SCADA system (Supervisory Control and Data Acquisition), FTU (Feeder Terminal Unit), DTU (Distribution Terminal Unit), TTU (Transformer Terminal Unit), and smart meters of the target distribution network. The topology tag data of the target distribution network Z is obtained through methods such as manual inspection. In this embodiment, the topology label data only needs to include the connection relationships between some nodes in the target distribution network Z, such as labeling only the connection relationships of 10-20 key nodes, or only labeling the connection status of some lines. Compared to full training, the data collection and manual labeling costs required in this stage are significantly reduced.
[0072] Step 140: Use the topology label data as the label for the second measurement data, train the initial meta-model, and obtain the target topology inference model.
[0073] After obtaining the second measurement data and topology label data of the target distribution network, the meta-initial model is quickly fine-tuned. First, the meta-initial model obtained from meta-training is loaded. In each fine-tuning step, the second measurement data is... enter ,calculate Output topology data Compared to topological label data The loss function is calculated and updated using methods such as gradient descent. The parameters are then refined. The fine-tuning process is repeated until the preset iteration termination condition is met, thereby obtaining a target topology inference model with good performance. .
[0074] In this embodiment, a smaller number of iterations (e.g., 1-5 steps) can be set to reduce the risk of overfitting. Alternatively, freezing can be used... The fine-tuning process can be controlled by partial layers (such as the bottom-level temporal convolutional layer), but this application does not limit the implementation of this method.
[0075] Step 150: Obtain real-time measurement data of the target distribution network and input the real-time measurement data into the target topology inference model to obtain the target topology data of the target distribution network.
[0076] Training yields the target topology inference model Then, real-time measurement data of the target distribution network is acquired again. To improve the real-time performance of topology inference results, real-time measurement data will be used. Input target topology inference model The target topology data, which characterizes the connection relationships between nodes in the target distribution network, can be obtained by sequential forward propagation.
[0077] The meta-learning-based fast adaptive inference method for distribution network topology provided in this application first uses multiple sets of measurement data with complete topology labels as training datasets to train a meta-initial model with good initial parameters, which can quickly adapt to new data and be reused in different distribution networks. This allows the meta-initial model to be trained quickly with parameters close to the optimal solution for the target distribution network when inferring the topology of the target distribution network, based only on the target distribution network measurement data with partial topology labels. This results in a high-precision target topology inference model. Then, by inputting the real-time measurement data of the target distribution network into the target topology inference model, the target topology data of the target distribution network can be inferred. This reduces the data acquisition and model training costs required for the topology inference process of the target distribution network and improves the efficiency of distribution network topology inference.
[0078] In some embodiments, the meta-initial model includes: a feature extractor and a domain discriminator; the meta-initial model is trained by using first topological data as labels for first measurement data, including: Obtain the second dataset; the second dataset includes multiple sets of third measurement data of the distribution network, which are obtained from actual measurements; The first dataset contains all the first measurement data and the second dataset, which are then merged to obtain the third dataset; the target measurement data are then sampled from the third dataset. Input the target measurement data into the feature extractor to obtain the first node features; The first node feature is input into the domain discriminator to obtain the domain prediction probability; the domain prediction probability represents the probability that the target measurement data belongs to the second dataset; The domain adversarial loss function is calculated based on the domain prediction probability and the domain label; the domain label represents the dataset to which the target measurement data belongs. The parameters of the domain discriminator are updated with the goal of minimizing the domain adversarial loss function; the parameters of the feature extractor are updated with the goal of maximizing the domain adversarial loss function.
[0079] Because obtaining accurate distribution network topology labels is extremely costly, and the meta-training process requires a large amount of diverse meta-training data, the first dataset may contain a large amount of simulated or simulated-expanded first measurement data. However, there is a significant domain shift between simulated data and real measurement data. If the model trained on simulated data is directly applied to a real scenario, it may lead to a sharp decline in performance or even complete failure. Therefore, this application introduces a domain-adversarial training mechanism, which enables the feature representation learned by the feature extractor to be invariant to the attribute of "whether the data comes from the simulated domain or the real domain".
[0080] In the embodiments of this application, such as Figure 2 As shown, the meta-initial model includes a feature extractor and a domain discriminator. The feature extractor can be a Spatial-Temporal Graph Convolutional Network (ST-GCN) architecture, containing temporal graph convolutional layers and spatial graph convolutional layers, used to extract the spatiotemporal feature representations of each node from the input measurement data. The domain discriminator can be an MLP (Multi-Layer Perceptron) architecture, used to determine whether the corresponding measurement data belongs to the simulation domain or the real domain based on the features of the input nodes. Of course, other feature extractor and domain discriminator architectures can also be used; this embodiment does not limit this approach.
[0081] In this embodiment, a second dataset is first obtained; the second dataset includes multiple sets of third measurement data of the distribution network, which are obtained through actual measurements. The third measurement data does not require topology data labels, thereby reducing data acquisition and labeling costs.
[0082] Each third measurement data point can be associated with a domain label d=1, and each first measurement data point contained in the first dataset can be associated with a domain label d=0. These can then be merged into the second dataset to obtain a third dataset with domain labels. Of course, the first dataset may consist entirely of simulation data, or it may be a mixture of simulation and measured data. Domain labels can be assigned based on the actual source of the first measurement data; this embodiment does not limit this.
[0083] During training, target measurement data is obtained by sampling from a third dataset. In the forward propagation phase, the target measurement data is input into a feature extractor to obtain the first node features; the first node features are then input into a domain discriminator to obtain the domain prediction probability. The domain prediction probability characterizes the probability that the target measurement data belongs to the second dataset. In the embodiments of this application, the second dataset corresponds to the real domain, and the first dataset corresponds to the simulation domain.
[0084] Based on the calculated domain prediction probability Calculate the domain adversarial loss function based on the domain label d associated with the target measurement data. For example, in some embodiments, according to the formula:
[0085] The domain adversarial loss function is calculated; where, Let d represent the domain adversarial loss function, and d represent the domain label. This represents the domain prediction probability. Of course, other forms of domain adversarial loss functions can also be used, but this application does not limit this approach.
[0086] During the backpropagation phase, the parameters of the domain discriminator are updated with the goal of minimizing the domain adversarial loss function. This allows the discriminator to optimize by minimizing the domain classification error, enabling it to accurately distinguish between data from the simulated and real domains. Conversely, the parameters of the feature extractor are updated with the goal of maximizing the domain adversarial loss function. A gradient reversal layer (GRL) can be used to multiply the gradient by a negative constant when updating the feature extractor's parameters. This ensures that the feature extractor's optimization objective is to maximize the domain classification error, i.e., to learn features that the domain discriminator cannot distinguish.
[0087] An alternating optimization method can be used. First, fix the parameters of the feature extractor and update the parameters of the domain discriminator. Repeat this process for a certain number of rounds. Then, fix the parameters of the domain discriminator and update the parameters of the feature extractor. Repeat this process for another certain number of rounds. Repeat the above process until the training converges or the preset termination condition is reached.
[0088] In this embodiment, by introducing an adversarial training mechanism, the parameters of the domain discriminator are updated with the goal of minimizing the domain adversarial loss function value. This improves the accuracy of the domain discriminator in identifying the source of measurement data. By updating the parameters of the feature extractor with the goal of maximizing the domain adversarial loss function value, the feature extractor is forced to learn features that the domain discriminator cannot distinguish, while retaining information that is effective for the topology inference task. This reduces the performance breakdown caused by the distribution difference between simulated data and real measurement data, enhances the generalization ability of the feature extractor, and thus enhances the accuracy of the meta-topology inference model.
[0089] In some embodiments, the meta-initial model includes a feature extractor and a topology inference head; the meta-initial model is trained by using first topology data as labels for first measurement data, including: The target first topological data is sampled from the first dataset, and the first measurement data corresponding to the target first topological data is divided into the first support set and the first query set; Input the first support set into the meta-initial model to obtain the second topological data; calculate the first loss function based on the second topological data and the target first topological data; update the parameters of the topological inference head based on the first loss function; The first query set is input into the meta-initial model after updating the parameters of the topology inference head to obtain the third topology data; the second loss function is calculated based on the third topology data and the target first topology data. The parameters of the feature extractor and the initial parameters of the topology inference head are updated based on the second loss function and the historical second loss function; the historical second loss function is calculated based on the historical first topology data.
[0090] In this embodiment, rapid model adaptation is achieved through parameter sharing and task decoupling. For example... Figure 3 As shown, the meta-initial model includes a feature extractor and a topology inference head. The feature extractor can be a Spatial-Temporal Graph Convolutional Network (ST-GCN) architecture, containing temporal graph convolutional layers and spatial graph convolutional layers, used to extract the spatiotemporal feature representations of each node from the input measurement data. The topology inference head can be an MLP (Multi-Layer Perceptron) architecture, used to calculate the probability of a connection between nodes u and v based on the features of any two input nodes u and v, and output predicted topology data. The parameters of the feature extractor are... These are the shared parameters that meta-learning aims to optimize, and they will be updated based on the loss from all training tasks; the parameters of the topology inference head. These are task-specific parameters that are updated in each training task.
[0091] In each training session, starting from the first dataset Training task obtained by sampling ,in That is, the target's first topology data; Divided into the first training set and the first query set The division can be based on time or topological regions, etc., and this application does not limit this.
[0092] In the inner loop of each training task, the first training set is first processed. Input the initial meta-model to obtain second topological data, and calculate the first loss function based on the second topological data and the target first topological data. For example, in some embodiments, the second topological data is a set consisting of the existence probabilities of a series of edges, then according to the formula:
[0093] The first loss function is calculated; in, Indicates the parameters of the feature extractor. Parameters representing the topology inference header. Let E represent the first loss function, E represent the set of connection edges of each node in the distribution network, and u and v represent the nodes of the distribution network. This represents the probability of the existence of edge uv.
[0094] Based on the calculated first loss function The topology inference head is updated through one or more gradient updates. The parameters. For example, according to the formula:
[0095] Update the parameters of the topology inference head to .in, Indicates calculation about The gradient.
[0096] In this embodiment, by updating only the parameters of the topology inference head in the inner loop, the parameters of the feature extractor are kept stable, which can reduce the situation where the feature extractor overfits to a small amount of support set data for a single task.
[0097] Then, the first query set Meta-initial model after inputting parameters to update the topology inference head The third topological data is obtained; based on the third topological data and the target first topological data, the second loss function is calculated. .
[0098] Then, based on the second loss function and the historical second loss function, the parameters of the feature extractor and the initial parameters of the topology inference head are updated; the historical second loss function is calculated based on the historical first topology data. For example, the second loss function of the first N historical training tasks can be summed, and the parameters related to the second loss function can be calculated. The gradient, and according to the formula:
[0099] Update the parameters of the feature extractor. Simultaneously, update the initial parameters of the topology inference head. For subsequent training tasks, all will be based on Training will begin from this point.
[0100] Repeat the above training process until the meta-training converges or other preset termination conditions are met, to obtain the initial meta-model parameters. Then, when subsequent fine-tuning begins, it can be loaded directly. To initialize the meta-training model.
[0101] The meta-training process in this embodiment can be combined with the domain adversarial training process, and the total loss function of the feature extractor is as follows:
[0102] in It is a balancing parameter used to control the degree of emphasis placed on domain prediction loss during training.
[0103] In this embodiment, by updating the parameters of the topology inference head based on the loss of the second topology data relative to the first topology data, the ability of the topology inference head to adapt to different types of topologies can be improved. By combining the historical loss with the second loss function to update the parameters of the feature extractor, the overfitting of the feature extractor to part of the training data can be reduced, thereby improving the accuracy of the meta-initial model.
[0104] In some embodiments, topological label data is used as labels for the second measurement data to train a meta-initial model, resulting in a target topology inference model, including: The second measurement data is divided into a second support set and a second query set; The second support set is input into the meta-initial model to obtain the fourth topological data; the third loss function is calculated based on the fourth topological data and the topological label data; the parameters of the meta-initial model are updated based on the third loss function. The second query set is input into the updated meta-initial model to obtain the fifth topological data; the fourth loss function is calculated based on the fifth topological data and the topological label data. Calculate the difference between the third loss function and the fourth loss function. If the difference is less than the difference threshold, the initial meta-model is determined as the target topology inference model.
[0105] In this embodiment, the second measurement data is divided into a second support set for fine-tuning the model and a second query set for monitoring model performance. The second measurement data can be preprocessed and divided in the same way as the first measurement data; to avoid repetition, this will not be described further here.
[0106] The second support set is input into the meta-initial model to obtain the fourth topological data; based on the fourth topological data and the topological label data, the third loss function is calculated, and the calculation process of the third loss function can refer to the calculation process of the first loss function; based on the third loss function, the parameters of the meta-initial model are updated using methods such as gradient descent.
[0107] In this embodiment, a second query set is used to monitor the current performance of the meta-initial model. The second query set is input into the updated meta-initial model to obtain fifth topology data. Based on the fifth topology data and topology label data, a fourth loss function is calculated. The difference between the third and fourth loss functions is calculated, and the difference is compared with a preset difference threshold. If the difference is less than the threshold, fine-tuning stops, and the current meta-initial model is determined as the target topology inference model. Alternatively, the rate of change of the loss function can be used to determine whether fine-tuning needs to stop; for example, fine-tuning can be stopped when the value of the loss function no longer decreases. This embodiment does not limit this approach.
[0108] In this embodiment, by calculating the difference between the third loss function and the fourth loss function, training is terminated when the difference is less than the difference threshold, which can reduce the possibility of model overfitting.
[0109] In some embodiments, real-time measurement data is input into the target topology inference model to obtain target topology data of the target distribution network, including: Real-time measurement data is input into the target topology inference model, and multiple random perturbations are added to the target topology inference model to obtain multiple candidate edges of the target distribution network. Each candidate edge corresponds to multiple existence probabilities. Based on each existence probability, calculate the edge confidence corresponding to the candidate edge, and determine the candidate edge with an edge confidence greater than the edge confidence threshold as the target edge; Generate target topology data based on each target edge.
[0110] In this embodiment, the Monte Carlo Dropout method can be used to quantify the uncertainty in the model inference process by introducing random perturbations during the model training and inference phases. For example, a Dropout layer can be added after the feature extractor and key layers of the topology inference head of the meta-initial model, and enabled normally during meta-training and fine-tuning training. Different neurons are randomly dropped during the model's forward propagation to train the target topology inference model.
[0111] After inputting real-time measurement data X into the target topology inference model, for the same input data X, M forward propagations are performed. In each forward propagation, different neurons are randomly discarded as perturbations, thereby obtaining M different candidate topology data. Each candidate topology data point is a set consisting of multiple candidate edges. The result obtained by aggregating the constituent nodes of the candidate edges takes the form of... , This represents the probability that there is an edge between nodes u and v, i.e., the probability of the existence of candidate edge uv; This represents the probability of the existence of candidate edges uv obtained from the m-th forward propagation.
[0112] Of course, in addition to adding perturbation by randomly discarding neurons, other perturbation methods can be used, such as adding random noise to the input real-time measurement data, randomly discarding weighted connections, or randomly skipping different numbers of layers. This application does not limit these methods.
[0113] Based on the existence probabilities, the edge confidence corresponding to the candidate edge uv is calculated. For example, in some embodiments, it is based on the formula:
[0114] Calculate edge confidence; Where M represents the number of perturbations. This represents the edge confidence level corresponding to the candidate edge uv. Let represent the probability that the m-th candidate edge uv exists.
[0115] Of course, in addition to directly calculating the mean of the probability of existence as the edge confidence, other methods can be used to calculate the edge confidence, such as calculating the variance, calculating the confidence interval at a preset confidence level (such as 95%), etc. This application does not limit this.
[0116] After calculating the edge confidence score, the edge confidence score is compared with an edge confidence score threshold. Candidate edges with edge confidence scores greater than the threshold are identified as target edges. After evaluating the edge confidence scores for each candidate edge, target topology data is generated based on each target edge.
[0117] Of course, other processing methods can be set according to the edge confidence level, such as arranging on-site review or manual verification for candidate edges that are within the target edge confidence level range; different colors can be assigned to candidate edges with different edge confidence levels to render and display the topology diagram of the target distribution network, so that maintenance personnel can intuitively understand the topology inference results; and other data processing methods, which are not limited in this application embodiment.
[0118] In this embodiment, by adding multiple random perturbations to the target topology inference model during the topology inference process, candidate edges with multiple existence probabilities are obtained, and the edge confidence of the candidate edges is calculated based on each existence probability. This can quantify the uncertainty of the model's topology inference process. By determining the candidate edges with edge confidence greater than the edge confidence threshold as target edges, the accuracy of the target topology inference results can be improved.
[0119] In some embodiments, the method further includes: Calculate the global confidence of the target topology data based on the edge confidence of each candidate edge; When the global confidence level is lower than the global confidence level threshold, update the second measurement data and topology label data of the target distribution network, and train the target topology inference model.
[0120] In this embodiment of the application, the global confidence of the target topology data is evaluated to guide when the training data needs to be updated and the target topology inference model needs to be retrained.
[0121] The global confidence of the target topology data is calculated based on the edge confidence of each candidate edge. For example, in some embodiments, it can be based on the formula:
[0122] The global confidence level is calculated. in, Let E represent the global confidence level, and E represent the total number of candidate edges. This represents the edge confidence level corresponding to the candidate edge uv.
[0123] Of course, other methods can be used to calculate the global confidence level, such as average variance, average confidence interval width, etc., but this application does not limit this method.
[0124] In this embodiment, by calculating the global confidence of the target topology data based on the edge confidence of each candidate edge, the uncertainty in the entire process of model topology inference can be quantified. By updating the data and retraining the model when the global confidence is lower than the global confidence threshold, the situation of decision errors caused by model erroneous inference can be reduced, thereby improving the accuracy of the final target topology data.
[0125] In some embodiments, obtaining the first dataset includes: Generate the first topology data based on the number of target nodes, the target structure type, and the target branch depth; Based on the target line impedance, target load curve, target operating scenario, target noise mode, and first topology data, a simulated distribution network is generated and simulated to obtain the first measurement data corresponding to the simulated distribution network.
[0126] In the embodiments of this application, power distribution network simulation tools such as OpenDSS or GridLAB-D can be used to generate large-scale and diverse simulation datasets.
[0127] First, first topology data is generated based on the target number of nodes, target structure type, and target branch depth. The number of nodes refers to the total number of nodes in the distribution network; the structure type describes the physical connection pattern of the distribution network, such as radial or weak loop network; and the branch depth refers to the maximum number of branches traversed from the root node to the farthest node. Random sampling can be performed from preset ranges corresponding to each parameter, and the corresponding distribution network topology is generated based on the obtained target parameters to obtain the first topology data. Of course, other parameters affecting the topology structure can also be introduced, such as node type, number of feeders, and connectivity, but this embodiment does not limit this.
[0128] After obtaining the first topology data, a simulated distribution network is generated and simulated based on the target line impedance, target load curve, target operating scenario, target noise mode, and the first topology data. The line impedance is a composite parameter composed of the distribution network line resistance and reactance; the load curve describes the distribution network load variation pattern over time, such as residential load, commercial load, and industrial load, or a superposition of multiple different load patterns; the operating scenario describes the overall operating mode of the distribution network over a period of time, such as seasons and weather conditions, and can also include extreme scenarios such as voltage exceeding limits and load abrupt changes, as well as other types of scenarios and superpositions of different scenarios; the noise mode characterizes the error and interference characteristics present in the measurement data, and Gaussian noise, impulse noise, etc., with different signal-to-noise ratios can be randomly added to the simulated measurement data to simulate communication interference in the real measurement process. Of course, other simulation parameters can also be configured, such as measurement configuration and sampling frequency, which are not limited in this embodiment.
[0129] Random sampling can be performed from the preset range corresponding to each parameter. Based on the obtained target parameters and the first topology data, a simulated distribution network with corresponding topology and physical characteristics can be generated. The simulation can then be run according to the mode and scenario set by the target parameters to obtain the measurement data corresponding to the simulated distribution network output by the simulation tool. By repeating the process of sampling to determine the target parameters, simulating, and acquiring data, multiple sets of distribution network measurement data with complete topology data annotations can be obtained.
[0130] In this embodiment, by generating and simulating a simulated power distribution network, a large amount of measurement data with complete topological data annotation can be generated quickly, thereby reducing the need for manually annotated data and improving the construction efficiency of the first dataset. By configuring diverse simulation parameters, the diversity of the obtained training samples can be increased, thereby improving the generalization ability of the meta-initial model.
[0131] The following scenario illustrates the fast adaptive inference method for distribution network topology based on meta-learning provided in this application. For example... Figure 4As shown, in the meta-training phase, a first dataset including multiple sets of distribution network topology data and first measurement data of each distribution network is generated through simulation. A second dataset including multiple sets of distribution network third measurement data is obtained through actual measurements. The first topology data is used as the label for the first measurement data to perform meta-training on the meta-learning base model. Based on the third dataset obtained by merging the first measurement data and the second dataset, the meta-learning base model is subjected to domain adaptive adversarial training to obtain a meta-initial model with good initial parameters.
[0132] In the fast adaptive phase, second measurement data of the target distribution network and topology label data indicating some node connections are collected. Initial parameters obtained in the meta-training phase are loaded to initialize the meta-initial model. The topology label data is used as labels for the second measurement data, and the meta-initial model is rapidly fine-tuned using gradients to obtain a high-performance target topology inference model.
[0133] In the inference phase, real-time measurement data of the target distribution network is collected, and parameters obtained from the fast adaptive phase are loaded to initialize the target topology inference model. The real-time measurement data is input into the target topology inference model, and multiple random perturbations are added to the model to obtain multiple candidate edges of the target distribution network, each with multiple existence probabilities. The edge confidence of each candidate edge is calculated based on its existence probability, and the global confidence of the target topology data is calculated based on the edge confidence of each candidate edge. When the global confidence is greater than or equal to a global confidence threshold, the candidate edges with edge confidence greater than the threshold are identified as target edges, and target topology data is generated based on each target edge.
[0134] The fast adaptive inference method for distribution network topology based on meta-learning provided in this application can be executed by a device for fast adaptive inference of distribution network topology based on meta-learning. This application uses the execution of the fast adaptive inference method for distribution network topology based on meta-learning by the device as an example to illustrate the device provided in this application.
[0135] This application also provides a fast adaptive inference device for distribution network topology based on meta-learning.
[0136] like Figure 5 As shown, the fast adaptive inference device for distribution network topology based on meta-learning includes: The first acquisition module 510 is used to acquire a first dataset; the first dataset includes multiple sets of first topology data of the distribution network and first measurement data of each distribution network; the first topology data represents the connection relationship between each node in the distribution network, and the first measurement data represents the operating status of each node in the distribution network. The first training module 520 is used to train the meta-initial model by using the first topological data as the label of the first measurement data. The second acquisition module 530 is used to acquire the second measurement data and topology tag data of the target distribution network; the topology tag data represents the connection relationship between some nodes in the target distribution network. The second training module 540 is used to train the meta-initial model by using the topology label data as the label of the second measurement data, and to obtain the target topology inference model. The input module 550 is used to acquire real-time measurement data of the target distribution network and input the real-time measurement data into the target topology inference model to obtain the target topology data of the target distribution network.
[0137] According to the meta-learning-based fast adaptive inference device for distribution network topology of this application, by first using multiple sets of measurement data with complete topology labels as training datasets, a meta-initial model with good initial parameters is trained, which can quickly adapt to new data and be reused in different distribution networks. When inferring the topology of the target distribution network, it is only necessary to train the meta-initial model based on the target distribution network measurement data with partial topology labels. The parameters of the meta-initial model can then quickly converge to near the optimal solution for the target distribution network, resulting in a high-precision target topology inference model. Then, by inputting the real-time measurement data of the target distribution network into the target topology inference model, the target topology data of the target distribution network can be inferred. Thus, the data acquisition and model training costs required for the topology inference process of the target distribution network can be reduced, and the efficiency of distribution network topology inference can be improved.
[0138] In some embodiments, the first training module 520 is further configured to: Obtain the second dataset; the second dataset includes multiple sets of third measurement data of the distribution network, which are obtained from actual measurements; The first dataset contains all the first measurement data and the second dataset, which are then merged to obtain the third dataset; the target measurement data are then sampled from the third dataset. Input the target measurement data into the feature extractor to obtain the first node features; The first node feature is input into the domain discriminator to obtain the domain prediction probability; the domain prediction probability represents the probability that the target measurement data belongs to the second dataset; The domain adversarial loss function is calculated based on the domain prediction probability and the domain label; the domain label represents the dataset to which the target measurement data belongs. The parameters of the domain discriminator are updated with the goal of minimizing the domain adversarial loss function; the parameters of the feature extractor are updated with the goal of maximizing the domain adversarial loss function.
[0139] In some embodiments, the first training module 520 is further configured to: The target first topological data is sampled from the first dataset, and the first measurement data corresponding to the target first topological data is divided into the first support set and the first query set; Input the first support set into the meta-initial model to obtain the second topological data; calculate the first loss function based on the second topological data and the target first topological data; update the parameters of the topological inference head based on the first loss function; The first query set is input into the meta-initial model after updating the parameters of the topology inference head to obtain the third topology data; the second loss function is calculated based on the third topology data and the target first topology data. The parameters of the feature extractor and the initial parameters of the topology inference head are updated based on the second loss function and the historical second loss function; the historical second loss function is calculated based on the historical first topology data.
[0140] In some embodiments, the second training module 540 is further configured to: The second measurement data is divided into a second support set and a second query set; The second support set is input into the meta-initial model to obtain the fourth topological data; the third loss function is calculated based on the fourth topological data and the topological label data; the parameters of the meta-initial model are updated based on the third loss function. The second query set is input into the updated meta-initial model to obtain the fifth topological data; the fourth loss function is calculated based on the fifth topological data and the topological label data. Calculate the difference between the third loss function and the fourth loss function. If the difference is less than the difference threshold, the initial meta-model is determined as the target topology inference model.
[0141] In some embodiments, the input module 550 is further configured to: Real-time measurement data is input into the target topology inference model, and multiple random perturbations are added to the target topology inference model to obtain multiple candidate edges of the target distribution network. Each candidate edge corresponds to multiple existence probabilities. Based on each existence probability, calculate the edge confidence corresponding to the candidate edge, and determine the candidate edge with an edge confidence greater than the edge confidence threshold as the target edge; Generate target topology data based on each target edge.
[0142] In some embodiments, the input module 550 is further configured to: Calculate the global confidence of the target topology data based on the edge confidence of each candidate edge; When the global confidence level is lower than the global confidence level threshold, update the second measurement data and topology label data of the target distribution network, and train the target topology inference model.
[0143] In some embodiments, the first acquisition module 510 is further configured to: Generate the first topology data based on the number of target nodes, the target structure type, and the target branch depth; Based on the target line impedance, target load curve, target operating scenario, target noise mode, and first topology data, a simulated distribution network is generated and simulated to obtain the first measurement data corresponding to the simulated distribution network.
[0144] The fast adaptive inference device for distribution network topology based on meta-learning in this application embodiment can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, handheld computer, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM or self-service machine, etc. The embodiments of this application do not specifically limit it.
[0145] The fast adaptive inference device for distribution network topology based on meta-learning in this application embodiment can be a device with an operating system. This operating system can be Microsoft (Windows), Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0146] In some embodiments, such as Figure 6 As shown, this application embodiment also provides an electronic device 600, including a processor 601, a memory 602, and a computer program stored in the memory 602 and executable on the processor 601. When the program is executed by the processor 601, it implements the various processes of the above-described embodiment of the fast adaptive inference method for distribution network topology based on meta-learning, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0147] In some embodiments, such as Figure 7 As shown in the embodiments of this application, a fast adaptive inference system for distribution network topology based on meta-learning is also provided, including: The cloud training platform 710 is used to acquire the first dataset; the first dataset includes multiple sets of first topology data of the distribution network and first measurement data of each distribution network; the first topology data represents the connection relationship between each node in the distribution network, and the first measurement data represents the operating status of each node in the distribution network; the first topology data is used as the label of the first measurement data to train the meta-initial model; the meta-initial model is then distributed to the regional edge computing nodes. The regional edge computing node 720 is used to acquire the second measurement data and topology label data of the target distribution network; the topology label data represents the connection relationship between some nodes in the target distribution network; the topology label data is used as the label of the second measurement data to train the meta-initial model and obtain the target topology inference model; the real-time measurement data of the target distribution network is acquired and input into the target topology inference model to obtain the target topology data of the target distribution network; the target topology data is transmitted to the operation and maintenance terminal. The 730 maintenance terminal is used to display target topology data.
[0148] In this embodiment, the cloud training platform 710 can be a server that supports large-scale parallel training. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, and big data and artificial intelligence platforms.
[0149] The 720 regional edge computing node can be used for edge servers, industrial control computers, etc., deployed in various areas of the power distribution network (such as substations and switching stations).
[0150] The 730 maintenance terminal can be used by maintenance personnel for handheld mobile terminals, intelligent inspection equipment, on-site monitoring hosts, and power distribution network monitoring center hosts.
[0151] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described embodiment of the fast adaptive inference method for distribution network topology based on meta-learning, and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0152] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0153] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method for fast adaptive inference of distribution network topology based on meta-learning.
[0154] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0155] This application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described embodiments of the fast adaptive inference method for distribution network topology based on meta-learning, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0156] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0157] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0158] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0159] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0160] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0161] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
Claims
1. A fast adaptive inference method for distribution network topology based on meta-learning, characterized in that, include: Obtain the first dataset; the first dataset includes multiple sets of first topology data of the distribution network, and first measurement data of each distribution network; The first topology data represents the connection relationship between nodes in the distribution network, and the first measurement data represents the operating status of each node in the distribution network; the first measurement data is obtained through simulation. The first topological data is used as the label of the first measurement data to train the meta-initial model. Acquire second measurement data and topology tag data of the target distribution network; the topology tag data characterizes the connection relationships between some nodes in the target distribution network. The topology label data is used as the label for the second measurement data to train the meta-initial model and obtain the target topology inference model. The real-time measurement data of the target distribution network is obtained, and the real-time measurement data is input into the target topology inference model to obtain the target topology data of the target distribution network. The meta-initial model includes: a feature extractor and a domain discriminator; the domain discriminator is used to determine whether the measurement data corresponding to the input node features belongs to the simulation domain or the real domain; the step of training the meta-initial model by using the first topological data as the label of the first measurement data includes: Obtain a second dataset; the second dataset includes multiple sets of third measurement data of the power distribution network, which are obtained through actual measurements; The first dataset contains all the first measurement data and the second dataset are merged to obtain the third dataset; the target measurement data are obtained by sampling from the third dataset. The target measurement data is input into the feature extractor to obtain the first node features; The first node feature is input into the domain discriminator to obtain the domain prediction probability; the domain prediction probability represents the probability that the target measurement data belongs to the second dataset; Based on the domain prediction probability and the domain label, a domain adversarial loss function is calculated; the domain label represents the dataset to which the target measurement data belongs. The parameters of the domain discriminator are updated with the goal of minimizing the domain adversarial loss function value; the parameters of the feature extractor are updated with the goal of maximizing the domain adversarial loss function value.
2. The method according to claim 1, characterized in that, According to the formula: The domain adversarial loss function is calculated; where, Let d represent the domain adversarial loss function, and d represent the domain label. This represents the domain prediction probability.
3. The method according to claim 1, characterized in that, The meta-initial model further includes a topology inference head; the step of training the meta-initial model by using the first topology data as the label of the first measurement data includes: Target first topology data is sampled from the first dataset, and the first measurement data corresponding to the target first topology data is divided into a first support set and a first query set; The first support set is input into the meta-initial model to obtain the second topology data; a first loss function is calculated based on the second topology data and the target first topology data; and the parameters of the topology inference head are updated based on the first loss function. The first query set is input into the meta-initial model after updating the parameters of the topology inference head to obtain the third topology data; the second loss function is calculated based on the third topology data and the target first topology data. The parameters of the feature extractor and the initial parameters of the topology inference head are updated based on the second loss function and the historical second loss function; the historical second loss function is calculated based on the historical first topology data.
4. The method according to claim 3, characterized in that, According to the formula: The first loss function is calculated; in, This represents the parameters of the feature extractor. The parameters representing the topology inference head, This represents the first loss function. E represents the set of connection edges of each node in the distribution network, and u and v represent the nodes of the distribution network. This represents the probability of the existence of edge uv.
5. The method according to claim 1, characterized in that, The step of using the topology label data as labels for the second measurement data to train the meta-initial model and obtain the target topology inference model includes: The second measurement data is divided into a second support set and a second query set; The second support set is input into the meta-initial model to obtain the fourth topology data; a third loss function is calculated based on the fourth topology data and the topology label data; and the parameters of the meta-initial model are updated based on the third loss function. The second query set is input into the updated meta-initial model to obtain the fifth topological data; the fourth loss function is calculated based on the fifth topological data and the topological label data. Calculate the difference between the third loss function and the fourth loss function. If the difference is less than the difference threshold, determine the meta-initial model as the target topology inference model.
6. The method according to claim 1, characterized in that, The step of inputting the real-time measurement data into the target topology inference model to obtain the target topology data of the target distribution network includes: The real-time measurement data is input into the target topology inference model, and multiple random perturbations are added to the target topology inference model to obtain multiple candidate edges of the target distribution network, and each candidate edge corresponds to multiple existence probabilities. Based on the existence probabilities of each, the edge confidence corresponding to the candidate edge is calculated, and the candidate edge whose edge confidence is greater than the edge confidence threshold is determined as the target edge; The target topology data is generated based on each target edge.
7. The method according to claim 6, characterized in that, According to the formula: Calculate the edge confidence; Where M represents the number of perturbations. This represents the edge confidence level corresponding to the candidate edge uv. Let represent the probability that the m-th candidate edge uv exists.
8. The method according to claim 7, characterized in that, The method further includes: Calculate the global confidence of the target topology data based on the edge confidence of each candidate edge; When the global confidence level is lower than the global confidence level threshold, the second measurement data and topology label data of the target distribution network are updated, and the target topology inference model is trained.
9. The method according to claim 8, characterized in that, According to the formula: The global confidence level is calculated. in, This represents the global confidence level. This represents the total number of candidate edges.
10. The method according to claim 1, characterized in that, The first measurement data includes measurement data of each node in the distribution network at multiple times. The measured data includes at least one of voltage, active power, reactive power, and voltage phase angle.
11. The method according to claim 1, characterized in that, The process of obtaining the first dataset includes: The first topology data is generated based on the number of target nodes, the target structure type, and the target branch depth. Based on the target line impedance, target load curve, target operating scenario, target noise mode, and the first topology data, a simulated distribution network is generated and simulated to obtain the first measurement data corresponding to the simulated distribution network.
12. A fast adaptive inference device for distribution network topology based on meta-learning, characterized in that, include: The first acquisition module is used to acquire the first dataset; The first dataset includes multiple sets of first topology data of distribution networks, and first measurement data of each distribution network; The first topology data represents the connection relationship between nodes in the distribution network, and the first measurement data represents the operating status of each node in the distribution network. The first measurement data was obtained through simulation; The first training module is used to train a meta-initial model by using the first topological data as the label of the first measurement data. The second acquisition module is used to acquire second measurement data and topology tag data of the target distribution network; the topology tag data represents the connection relationship between some nodes in the target distribution network. The second training module is used to train the meta-initial model by using the topology label data as the label of the second measurement data to obtain the target topology inference model. The input module is used to acquire real-time measurement data of the target distribution network and input the real-time measurement data into the target topology inference model to obtain the target topology data of the target distribution network. The meta-initial model includes: a feature extractor and a domain discriminator; the first training module is further used for: Obtain a second dataset; the second dataset includes multiple sets of third measurement data of the power distribution network, which are obtained through actual measurements; The first dataset contains all the first measurement data and the second dataset are merged to obtain the third dataset; the target measurement data are obtained by sampling from the third dataset. The target measurement data is input into the feature extractor to obtain the first node features; The first node feature is input into the domain discriminator to obtain the domain prediction probability; the domain prediction probability represents the probability that the target measurement data belongs to the second dataset; Based on the domain prediction probability and the domain label, a domain adversarial loss function is calculated; the domain label represents the dataset to which the target measurement data belongs. The parameters of the domain discriminator are updated with the goal of minimizing the domain adversarial loss function value; the parameters of the feature extractor are updated with the goal of maximizing the domain adversarial loss function value.
13. The apparatus according to claim 12, characterized in that, The meta-initial model further includes a topology inference head; the first training module is also used for: Target first topology data is sampled from the first dataset, and the first measurement data corresponding to the target first topology data is divided into a first support set and a first query set; The first support set is input into the meta-initial model to obtain the second topology data; a first loss function is calculated based on the second topology data and the target first topology data; and the parameters of the topology inference head are updated based on the first loss function. The first query set is input into the meta-initial model after updating the parameters of the topology inference head to obtain the third topology data; the second loss function is calculated based on the third topology data and the target first topology data. The parameters of the feature extractor and the parameters of the topology inference head are updated based on the second loss function and the historical second loss function; the historical second loss function is calculated based on the historical first topology data.
14. The apparatus according to claim 12, characterized in that, The second training module is also used for: The second measurement data is divided into a second support set and a second query set; The second support set is input into the meta-initial model to obtain the fourth topology data; a third loss function is calculated based on the fourth topology data and the topology label data; and the parameters of the meta-initial model are updated based on the third loss function. The second query set is input into the updated meta-initial model to obtain the fifth topological data; the fourth loss function is calculated based on the fifth topological data and the topological label data. Calculate the difference between the third loss function and the fourth loss function. If the difference is less than the difference threshold, determine the meta-initial model as the target topology inference model.
15. The apparatus according to claim 12, characterized in that, The input module is also used for: The real-time measurement data is input into the target topology inference model, and multiple random perturbations are added to the target topology inference model to obtain multiple candidate edges of the target distribution network, and each candidate edge corresponds to multiple existence probabilities. Based on the existence probabilities of each, the edge confidence corresponding to the candidate edge is calculated, and the candidate edge whose edge confidence is greater than the edge confidence threshold is determined as the target edge; The target topology data is generated based on each target edge.
16. The apparatus according to claim 12, characterized in that, The first acquisition module is further configured to: The first topology data is generated based on the number of target nodes, the target structure type, and the target branch depth. Based on the target line impedance, target load curve, target operating scenario, target noise mode, and the first topology data, a simulated distribution network is generated and simulated to obtain the first measurement data corresponding to the simulated distribution network.
17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the fast adaptive inference method for distribution network topology based on meta-learning as described in any one of claims 1-11.
18. A fast adaptive inference system for distribution network topology based on meta-learning, characterized in that, include: A cloud-based training platform is used to acquire the first dataset; The first dataset includes multiple sets of first topology data of distribution networks, and first measurement data of each distribution network; The first topology data represents the connection relationship between nodes in the distribution network, and the first measurement data represents the operating status of each node in the distribution network. The first measurement data was obtained through simulation; The first dataset is used as the training dataset to train the meta-initial model; the meta-initial model is then distributed to the regional edge computing nodes. Regional edge computing nodes are used to acquire the second measurement data and topology tag data of the target distribution network; The topology label data characterizes the connection relationship between some nodes in the target distribution network; the second measurement data and the topology label data are used as training datasets to train the meta-initial model to obtain the target topology inference model; real-time measurement data of the target distribution network is obtained and input into the target topology inference model to obtain the target topology data of the target distribution network; The target topology data is transmitted to the operation and maintenance terminal; The operation and maintenance terminal is used to display the target topology data; The meta-initial model includes a feature extractor and a domain discriminator; the cloud training platform is also used for: Obtain a second dataset; the second dataset includes multiple sets of third measurement data of the power distribution network, which are obtained through actual measurements; The first dataset contains all the first measurement data and the second dataset are merged to obtain the third dataset; the target measurement data are obtained by sampling from the third dataset. The target measurement data is input into the feature extractor to obtain the first node features; The first node feature is input into the domain discriminator to obtain the domain prediction probability; the domain prediction probability represents the probability that the target measurement data belongs to the second dataset; Based on the domain prediction probability and the domain label, a domain adversarial loss function is calculated; the domain label represents the dataset to which the target measurement data belongs. The parameters of the domain discriminator are updated with the goal of minimizing the domain adversarial loss function value; the parameters of the feature extractor are updated with the goal of maximizing the domain adversarial loss function value.
Citation Information
Patent Citations
Variable topology network load flow calculation method based on meta transfer learning
CN116432359A
Intelligent power grid anomaly detection method and system based on graph neural network
CN119622562A