Message passing graph neural network-based power grid voltage sag positioning method and system

The voltage sag localization method based on message-passing graph neural network solves the problem of insufficient voltage sag localization accuracy in the existing technology, realizes more efficient voltage sag source identification and localization, and improves the stability and response speed of the power system.

CN121656733APending Publication Date: 2026-03-13GUANGDONG DIANWANG GONGSI YUNFU POWER SUPPLY BUREAU
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-09
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing voltage sag location technologies rely on local measurement data, which makes it difficult to fully reflect the overall picture of voltage sag events. Furthermore, when dealing with complex power network topologies, they struggle to effectively capture the complex relationships between nodes, resulting in insufficient location accuracy and slow response speed.

Method used

A voltage sag localization method based on message passing graph neural networks (MP-GNNs) is adopted. By acquiring voltage sag feature data and topology data of the power grid, preprocessing them, a voltage sag localization feature map is constructed. Then, a pre-trained target voltage sag localization model is used to predict the sag source, outputting multiple initial sag source prediction probability values. Finally, the location corresponding to the highest probability value is taken as the voltage sag localization result of the power grid.

Benefits of technology

It improves the accuracy and real-time performance of voltage sag source location in the power grid, enables more accurate identification of voltage sag propagation paths, enhances location accuracy and accelerates calculation speed, and provides more reliable support for real-time monitoring and operation and maintenance of the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121656733A_ABST
    Figure CN121656733A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of power distribution network voltage sag positioning, and discloses a power grid voltage sag positioning method and system based on a message passing graph neural network. Voltage sag characteristic data and topological data of a power grid are obtained and preprocessed, and a voltage sag positioning characteristic graph is constructed; and inputting a preset target voltage sag positioning model by adopting the voltage sag positioning characteristic graph to carry out sag source prediction, outputting a plurality of initial sag source prediction probability values, and taking a positioning position corresponding to the maximum initial sag source prediction probability value as a voltage sag positioning result of the power grid. According to the method, a data preprocessing means is combined with a model prediction mode, the accuracy of power grid voltage sag source positioning is powerfully improved, and the technical problem of how to improve the accuracy of power grid voltage sag source positioning is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of voltage sag location technology in power distribution networks, and in particular to a method and system for locating voltage sags in power distribution networks based on message-passing graph neural networks. Background Technology

[0002] With the development of advanced science and technology, more and more power electronic sensitive devices are being applied in various industries. However, this has led to increasingly prominent power quality problems, among which voltage sag, as one of the most serious power quality issues, has attracted great attention from the power grid and users. Voltage sags typically have a serious impact on the stability of the power system and the normal operation of equipment, potentially causing malfunctions, shutdowns, or damage to sensitive equipment. Therefore, a deep understanding of the propagation laws of voltage sags is particularly important. Clarifying its propagation characteristics helps to effectively identify and locate the specific location of voltage sag sources, thus providing a theoretical basis for timely and accurate operation and maintenance. This is crucial for ensuring the safe and stable operation of the power system.

[0003] While voltage sag localization techniques have made some progress, several shortcomings remain. For example, traditional methods often rely on localized measurement data, which may not fully reflect the overall picture of voltage sag events. Furthermore, existing technologies often struggle to effectively capture the complex relationships between nodes when dealing with complex power network topologies, resulting in insufficient localization accuracy and slow response times. Therefore, a more advanced method is urgently needed to improve the accuracy and real-time performance of voltage sag source localization. Summary of the Invention

[0004] This invention provides a method and system for locating grid voltage sags based on message-passing graph neural networks, solving the technical problem of how to improve the accuracy of grid voltage sag source location.

[0005] The first aspect of this invention provides a method for locating power grid voltage sags based on a message-passing graph neural network, comprising:

[0006] The voltage sag characteristic data and topology data of the power grid are acquired and preprocessed to construct a voltage sag location feature map;

[0007] The voltage sag location feature map is used as input to a preset target voltage sag location model to predict sag sources, and multiple initial sag source prediction probability values ​​are output.

[0008] The location corresponding to the largest initial sag source prediction probability value is taken as the voltage sag location result of the power grid.

[0009] Optionally, the preset target voltage sag localization model includes a feature extraction layer, a node state update layer, an edge state update layer, and an output layer. The voltage sag localization feature map is input into the preset target voltage sag localization model to predict sag sources, and multiple initial sag source prediction probability values ​​are output, including:

[0010] The voltage sag location feature map is input into the feature extraction layer for feature extraction, resulting in multiple node feature vectors and edge feature vectors;

[0011] The node state is updated by inputting the multiple node feature vectors and edge feature vectors into the node state update layer to obtain multiple updated node feature vectors.

[0012] The edge state is updated by inputting the multiple node feature vectors and edge feature vectors into the edge state update layer to obtain multiple updated edge feature vectors.

[0013] The updated node feature vectors and edge feature vectors are input into the output layer for probability prediction to obtain multiple initial transient source prediction probability values.

[0014] Optionally, the process of constructing the preset target voltage sag location model includes:

[0015] The voltage sag characteristic data and topology data of the power grid are acquired and preprocessed to generate a feature map dataset;

[0016] The feature map dataset is divided into a feature map training set and a feature map test set;

[0017] The feature map training set is used as input to the preset initial voltage sag localization model to generate training prediction probability values;

[0018] Calculate the cross-entropy loss value of the trained predicted probability values;

[0019] When the cross-entropy loss value is less than the preset loss value threshold, a target voltage sag location model is generated.

[0020] Optionally, it also includes:

[0021] When the cross-entropy loss value is greater than or equal to the preset loss value threshold, the model parameters of the preset initial voltage sag positioning model are optimized using the differential evolution algorithm.

[0022] Jump to the step of using the feature map dataset as input to the preset initial voltage sag localization model to generate training prediction probability values, until the cross-entropy loss value is less than the preset loss value threshold.

[0023] Optionally, optimizing the model parameters of the preset initial voltage sag location model using the differential evolution algorithm includes:

[0024] Multiple target individuals are randomly generated to obtain an initial population, wherein each target individual represents a set of model parameters;

[0025] Mutation operations are performed on each target individual in the initial population to obtain an intermediate population composed of the mutated individuals.

[0026] The target individuals are cross-operated with the mutated individuals in the intermediate population to obtain an experimental population composed of the trial individuals.

[0027] A selection operation is performed between each target individual and each test individual in the test population to obtain a target population composed of each candidate individual;

[0028] Determine whether the current iteration count meets the preset iteration count threshold;

[0029] If the current iteration number meets the preset iteration number threshold, then based on each candidate individual, the feature map test set is used to input the preset initial voltage sag localization model to generate multiple candidate verification loss values.

[0030] The candidate individual associated with the smallest candidate validation loss value is selected as the optimal model parameter.

[0031] Optionally, the step of performing a crossover operation between each of the target individuals and each of the mutated individuals in the intermediate population to obtain a trial population composed of each trial individual includes:

[0032] Determine the dimension index of the current mutant individual, and match the mutant model parameters associated with the dimension index from the mutant individual as the first trial model parameters of the trial individual;

[0033] A preset random number generation function is called to generate random numbers for the remaining dimension-related mutation model parameters in the mutated individuals, resulting in a random number sequence;

[0034] Each random number in the random number sequence is compared with a preset crossover probability;

[0035] If the random number is less than the preset crossover probability, then the parameter associated with the random number is used as the second trial model parameter of the trial individual;

[0036] If the random number is greater than or equal to the preset crossover probability, then the target model parameter within the target individual that is in the same dimension as the random number is used as the second trial model parameter of the trial individual.

[0037] By integrating the parameters of the first trial model and the parameters of the second trial model, a trial individual is obtained;

[0038] Traverse the intermediate population and obtain the trial population composed of each trial individual based on the traversal results.

[0039] Optionally, the step of selecting each of the target individuals and each of the test individuals in the test population to obtain a target population composed of candidate individuals includes:

[0040] Based on each target individual and the associated trial individual, the preset initial voltage sag localization model is input using the feature map test set to generate target verification loss value and trial verification loss value;

[0041] Compare the target verification loss value with the trial verification loss value;

[0042] If the trial verification loss value is less than the target verification loss value, then the trial individual associated with the trial verification loss value is taken as a candidate individual;

[0043] If the trial verification loss value is greater than or equal to the target verification loss value, then the target individual associated with the target verification loss value is taken as a candidate individual.

[0044] Optionally, it also includes:

[0045] If the current iteration count does not meet the preset iteration count threshold, then the target population is used as the new initial population;

[0046] Based on the new initial population, the process jumps to the step of performing mutation operations on each target individual within the initial population to obtain an intermediate population composed of each mutated individual.

[0047] Optionally, the voltage sag characteristic data includes the voltage sag amplitude of the disturbed node, sag phase angle, sag duration, power output, load type, load power, transformer type, transformer capacity, equipment aging degree, and branch impedance.

[0048] Optionally, the step of acquiring voltage sag characteristic data and topology data of the power grid and performing preprocessing to construct a voltage sag location feature map includes:

[0049] The load type, the transformer type, and the equipment aging degree are quantitatively coded.

[0050] The voltage sag amplitude of the disturbed node, the sag phase angle, the sag duration, the power output, the load power, the transformer capacity, and the branch impedance are standardized.

[0051] The topology data is mapped to a graph structure, where nodes in the graph structure represent physical nodes of the power grid, and edges in the graph structure represent lines.

[0052] The quantized and encoded load type, transformer type, and equipment aging degree, as well as the standardized voltage sag amplitude, sag phase angle, sag duration, power output, load power, and transformer capacity of the disturbed node are stored in the node.

[0053] The standardized branch impedance is stored within the edge to obtain a voltage sag location feature map.

[0054] A second aspect of the present invention provides a power grid voltage sag location system based on a message-passing graph neural network, comprising:

[0055] The preprocessing module is used to acquire voltage sag characteristic data and topology data of the power grid and perform preprocessing to construct a voltage sag location feature map;

[0056] The voltage sag source prediction module is used to predict sag sources by inputting the voltage sag location feature map into the preset target voltage sag location model, and outputs multiple initial sag source prediction probability values.

[0057] The voltage sag location module is used to take the location corresponding to the largest initial voltage sag source prediction probability value as the voltage sag location result of the power grid.

[0058] As can be seen from the above technical solutions, the present invention has the following advantages:

[0059] This invention provides a method and system for locating voltage sags in a power grid based on a message-passing graph neural network. First, voltage sag characteristic data and topology data of the power grid are acquired and preprocessed to construct a voltage sag location feature map. This map visually represents the topological structure and electrical characteristics of different parts of the power grid, laying a solid foundation for accurate sag source location. Then, a pre-trained target voltage sag location model is used to accurately analyze and predict the input voltage sag location feature map. This model is trained based on a message-passing graph neural network, which effectively performs message passing and feature aggregation on the graph structure, fully exploring the potential relationships between nodes and edges. Through learning and training on a large amount of historical data, the model can learn the complex patterns and rules of power grid voltage sags, thus accurately analyzing and predicting the input voltage sag location feature map. Finally, the model outputs multiple initial sag source prediction probability values, and the location corresponding to the highest probability value is selected as the location result of the power grid voltage sag. This invention employs data preprocessing techniques combined with model prediction methods, which significantly improves the accuracy of locating voltage sag sources in the power grid and solves the technical problem of how to improve the accuracy of locating voltage sag sources in the power grid. Attached Figure Description

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

[0061] Figure 1 This is a flowchart illustrating the steps of a grid voltage sag localization method based on a message-passing graph neural network, as provided in Embodiment 1 of the present invention.

[0062] Figure 2 This is a flowchart illustrating the steps of a power grid voltage sag location method based on a message-passing graph neural network provided in Embodiment 2 of the present invention.

[0063] Figure 3 This is a schematic diagram of the structure of the preset target voltage sag positioning model provided in Embodiment 2 of the present invention;

[0064] Figure 4 This is another step flowchart of a power grid voltage sag location method based on a message-passing graph neural network provided in Embodiment 2 of the present invention;

[0065] Figure 5 This is a structural block diagram of a power grid voltage sag location system based on a message-passing graph neural network, provided in Embodiment 3 of the present invention. Detailed Implementation

[0066] This invention provides a method and system for locating grid voltage sags based on a message-passing graph neural network, which addresses the technical problem of improving the accuracy of grid voltage sag source location.

[0067] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0068] Traditional location methods often rely on local measurement data, which may not fully reflect the overall picture of voltage sag events. Furthermore, existing technologies often struggle to effectively capture the complex relationships between nodes when dealing with complex power network topologies, resulting in insufficient location accuracy and slow response times.

[0069] Currently, Message Passing Graph Neural Networks (MP-GNNs), as an emerging deep learning algorithm, have demonstrated significant advantages in extracting network topology information and predicting bus and branch states. Their unique structure enables them to efficiently process network data and capture the complex relationships between nodes (such as buses and branches), thus more accurately reflecting the dynamic characteristics of power systems. MP-GNNs have now been widely applied in various fields of power systems. Whether in fault detection, state estimation, load forecasting, or renewable energy integration, MP-GNNs have shown superior performance. Through in-depth analysis of the power network topology, MP-GNNs can not only improve prediction accuracy but also accelerate computation and enhance decision support.

[0070] Against this backdrop, utilizing MP-GNNs to address this problem is particularly important. Through its unique message-passing mechanism, MP-GNNs can effectively aggregate and transmit node information, capturing the complex relationships between buses and branches in power systems, thereby more accurately identifying the propagation path of voltage sags. This method not only improves positioning accuracy but also accelerates computation speed, providing more reliable support for real-time monitoring and operation and maintenance of power systems. Therefore, using message-passing graph neural networks to study the voltage sag localization problem has broad application prospects and significant theoretical implications.

[0071] This invention provides a method and system for locating voltage sags in power grids based on message-passing graph neural networks. First, by analyzing factors influencing voltage sag propagation, data such as voltage sag amplitude, duration, grid topology, generator output, and load are obtained to construct a voltage sag location feature map. Then, a message-passing graph neural network model is established, and the network model is trained using the feature map data to extract and update feature data on grid buses and branches. This obtains a nonlinear mapping between the location and type of voltage sag sources and the influencing factors, thereby achieving precise location of the voltage sag source. Finally, a differential evolution algorithm is used to iteratively update the hyperparameter combination of the network model to achieve the global optimum of the loss function.

[0072] Please see Figure 1 , Figure 1 This is a flowchart illustrating the steps of a power grid voltage sag location method based on a message-passing graph neural network, as provided in Embodiment 1 of the present invention.

[0073] This invention provides a method for locating power grid voltage sags based on a message-passing graph neural network, comprising:

[0074] Step 101: Obtain voltage sag characteristic data and topology data of the power grid and perform preprocessing to construct a voltage sag location feature map.

[0075] Voltage sag feature data refers to a voltage sag location feature map constructed by multi-dimensional fusion of electrical quantities, equipment parameters, and topology attributes.

[0076] Topology data refers to structured data on the connection relationships and physical parameters of all electrical equipment in a power grid.

[0077] Preprocessing refers to the technical process of transforming voltage sag characteristic data and topology data of the power grid into a structured, standardized, and machine learning-parsable format. The final output of the preprocessing process is a graph data structure that integrates electrical characteristics and topological relationships (i.e., a voltage sag location feature map).

[0078] A voltage sag location feature map is a graph data structure that integrates grid topology with voltage sag features to characterize the propagation path and impact range of sag events in the power grid.

[0079] In this embodiment of the invention, voltage sag feature data and topology data of the power grid are first obtained. Then, the voltage sag feature data is quantized, encoded and standardized. Then, a graph structure is mapped according to the topology data. Finally, the processed data is reasonably stored in the nodes and edges of the graph structure to construct a voltage sag location feature graph that can be used for voltage sag location, which serves as the input of a preset target voltage sag location model.

[0080] Step 102: Use the voltage sag location feature map as input to the preset target voltage sag location model to predict the sag source and output multiple initial sag source prediction probability values.

[0081] A pre-set target voltage sag localization model refers to a pre-configured model used to locate voltage sag sources in the power grid. The pre-set target voltage sag localization model is trained using message-passing graph neural networks (MP-GNNs).

[0082] Voltage sag source prediction refers to the process of analyzing and processing the voltage sag location feature map using a pre-set target voltage sag location model to infer the source location of the voltage sag phenomenon.

[0083] The initial sag source prediction probability value refers to the predicted probability value output by the preset target voltage sag location model for each possible sag source. In a real power grid, there may be multiple locations or devices that could be sag sources. The preset target voltage sag location model cannot definitively determine which is the true sag source, so it assigns a probability value to each possible sag source, indicating the likelihood that the location or device is a sag source. These probability values ​​are the preliminary prediction results of the preset target voltage sag location model.

[0084] In this embodiment of the invention, the voltage sag location feature map is used as the input to a pre-trained target voltage sag location model to predict potential voltage sag sources in the power grid. Since multiple locations or devices in a real power grid system may be sources of voltage sags, the model cannot definitively determine which is the true source. Therefore, the model outputs multiple initial sag source prediction probability values, each corresponding to a possible sag source location or device, indicating the likelihood that the location or device is a sag source.

[0085] Step 103: Use the location corresponding to the largest initial sag source prediction probability value as the voltage sag location result of the power grid.

[0086] In this embodiment of the invention, voltage sags are often caused by a specific fault point or abnormal condition. The preset target voltage sag location model, through learning from a large amount of data, can identify the locations or devices that best match the characteristics of voltage sags and assign them high probability values. Therefore, the location or device with the highest probability value is usually the one that best meets the conditions causing voltage sags. Thus, the highest initial sag source prediction probability value is used as the voltage sag location result of the power grid.

[0087] In this invention, voltage sag characteristic data and topology data of the power grid are first acquired and preprocessed to construct a voltage sag location feature map. This map visually presents the topological structure and electrical characteristics of different parts of the power grid, laying a solid foundation for accurate sag source location. Then, a pre-trained target voltage sag location model is used to accurately analyze and predict the input voltage sag location feature map. This model is trained based on a message-passing graph neural network, which effectively performs message passing and feature aggregation on the graph structure, fully exploring the potential relationships between nodes and edges. Through learning and training on a large amount of historical data, the model can learn the complex patterns and rules of power grid voltage sags, thus accurately analyzing and predicting the input voltage sag location feature map. Finally, the model outputs multiple initial sag source prediction probability values, and the location corresponding to the highest probability value is selected as the power grid voltage sag location result. This invention, by combining data preprocessing with model prediction, significantly improves the accuracy of power grid voltage sag source location, solving the technical problem of how to improve the accuracy of power grid voltage sag source location.

[0088] Please see Figure 2 , Figure 2 This is a flowchart illustrating the steps of a power grid voltage sag location method based on a message-passing graph neural network, as provided in Embodiment 2 of the present invention.

[0089] Please see Figure 4 , Figure 4 This is another step flowchart of a power grid voltage sag location method based on a message-passing graph neural network provided in Embodiment 2 of the present invention.

[0090] This invention provides a method for locating power grid voltage sags based on a message-passing graph neural network, comprising:

[0091] Step 201: Obtain voltage sag characteristic data and topology data of the power grid and perform preprocessing to construct a voltage sag location feature map.

[0092] Furthermore, the voltage sag characteristic data includes the voltage sag amplitude of the disturbed node, sag phase angle, sag duration, power output, load type, load power, transformer type, transformer capacity, equipment aging degree, and branch impedance.

[0093] It should be noted that voltage sags not only affect the normal operation of electrical equipment but may also cause equipment failures in industrial production. Therefore, accurately locating the source of voltage sags is particularly important. Locating the source of voltage sags first requires identifying the factors affecting the distribution of voltage sags:

[0094] 1. Power Grid Structure

[0095] Topology characteristics: In a power grid, buses connect different branches. Voltage sags often occur on the branches and propagate towards the bus. The bus structure (e.g., parallel or series connection) affects voltage propagation characteristics. The connection method between nodes (e.g., star, ring, or tree structure) directly determines the propagation path of voltage changes. For example, a ring structure can provide redundancy in certain situations, thereby mitigating the effects of sags.

[0096] Equipment Configuration: The type and rated capacity of the transformer have a significant impact on voltage sags. Large-capacity transformers, due to their high impedance characteristics, may cause significant voltage sags when the load suddenly increases. The response speed and characteristics of circuit breakers and protection devices directly affect the voltage recovery after a fault. Slow-response protection devices may fail to disconnect the fault in time, resulting in a larger voltage drop.

[0097] 2. Power output

[0098] Power output has a significant impact on the propagation of voltage sags, directly affecting the reliability and stability of the power grid. Higher power output better maintains grid voltage levels, especially during load surges or faults, where sufficient power support effectively prevents rapid voltage drops. Conversely, insufficient power output, particularly under high loads or sudden events, causes voltage to drop rapidly, exacerbating voltage sags.

[0099] 3. Electrical load

[0100] Loads employing rectifiers and power electronic equipment often exhibit nonlinear characteristics, generating harmonics. This not only affects voltage quality but can also cause greater fluctuations in voltage sags. The level of power load also influences voltage sag propagation. Under low load conditions, the power grid has a relatively high tolerance for voltage fluctuations, and voltage drops depend more on changes in power output. However, at lower load levels, the inductive reactance of transmission lines is relatively high, which may make voltage sag propagation more pronounced. Under high load conditions, the power grid is already close to its load-bearing limits, and any additional load increase or fault will increase the risk of voltage sags. In this situation, voltage sags can not only propagate rapidly at the fault point but may also have multiple impacts throughout the entire power grid.

[0101] 4. Equipment aging

[0102] Equipment aging, insulation damage, or overload can all lead to equipment failure, directly affecting voltage stability. For example, a short circuit in a transformer winding will cause a significant drop in the corresponding bus voltage.

[0103] Therefore, this invention uses the above-mentioned factors influencing voltage sag distribution as feature inputs to train a network model to achieve accurate voltage sag localization. The voltage sag localization feature map contains the following data:

[0104]

[0105] Further, step 201 may include the following sub-steps:

[0106] S11. Quantify and encode the load type, transformer type, and equipment aging degree.

[0107] Quantization encoding refers to the process of converting non-numerical categorical data (such as equipment type or load type) into numerical form so that machine learning models can process it.

[0108] In this embodiment of the invention, voltage sag characteristic data is acquired, and categorical characteristic data is quantized and encoded. Categorical characteristic data includes load type, transformer type, and equipment aging degree. Load type (industrial / commercial / residential) uses one-hot encoding, with industrial load being [1,0,0], commercial load being [0,1,0], and residential load being [0,0,1]. Transformer type (autotransformer / two-winding / three-winding) uses ordered numerical labels, with each type corresponding to a value. Among transformer types, autotransformer is 1, two-winding transformer is 2, and three-winding transformer is 3. Equipment aging degree uses ordered numerical labels (such as 1, 2, 3).

[0109] S12. Standardize the voltage sag amplitude, sag phase angle, sag duration, power output, load power, transformer capacity and branch impedance of the disturbed node.

[0110] Standardization refers to a data preprocessing technique that aims to transform data into a form with specific standard characteristics to facilitate analysis, comparison, and modeling.

[0111] The standardization formula is as follows:

[0112]

[0113] In the formula, This represents the standardized numerical value. This represents the value before standardization. This represents the average value in the sample data. This represents the variance in the sample data.

[0114] In this embodiment of the invention, voltage sag characteristic data is obtained, and numerical characteristic data of different dimensions are standardized. The numerical characteristic data includes the voltage sag amplitude, sag phase angle, sag duration, power output, load power, transformer capacity and branch impedance of the disturbed node. The voltage sag amplitude, sag phase angle, power output, load power and transformer capacity of the disturbed node are standardized using Z-score (standard deviation standardization) (mean=0, variance=1). The sag duration is normalized to the [0, 1] interval using Min-Max (minimum-maximum normalization). The branch impedance is split into real part (R) and imaginary part (X) and standardized respectively.

[0115] S13. Map the topology data to a graph structure, where nodes in the graph structure represent physical nodes of the power grid, and edges in the graph structure represent lines.

[0116] In this embodiment of the invention, the topology data includes, but is not limited to, a list of nodes (buses, generator connection points, load connection points, transformer connection points) and a list of branches (connections of transmission lines, transformers, switching equipment, etc.). Each electrical node is mapped to a physical node in the graph, and each physical node is assigned a unique identifier. The start and end points of the edges are determined according to the branch connection relationships, and the direction is determined by the actual power flow direction.

[0117] S14. Store the quantized and encoded load type, transformer type, and equipment aging degree, as well as the standardized voltage sag amplitude, sag phase angle, sag duration, power output, load power, and transformer capacity of the disturbed node in the node.

[0118] In this embodiment of the invention, each physical node stores the quantized and encoded load type, transformer type, and equipment aging degree, as well as the standardized voltage sag amplitude, sag duration, power output, load power, and transformer capacity of the disturbed node.

[0119] S15. Store the standardized branch impedance in the edge to obtain the voltage sag location feature map.

[0120] In this embodiment of the invention, the standardized branch impedance is stored on each edge, and the feature matrix of each node is concatenated with the feature matrix of the edge to construct a voltage sag location feature map.

[0121] It should be noted that the pre-set target voltage sag localization model is trained based on the MP-GNN model. MP-GNN is a deep neural network that extends convolution to graph-structured data, capable of extracting feature information of nodes and edges based on network topology, and is widely used in graph state prediction, node state prediction, and edge state prediction problems. Therefore, this invention mines the nonlinear mapping relationship between power grid data, sag features, and voltage sag sources based on the network characteristics of MP-GNN, achieving rapid and accurate localization of voltage sag sources. The following is the process of using MP-GNN for line state prediction. Compared with traditional neural networks, message-passing graph neural networks can extract features of nodes and edges based on topological connections. Voltage sag localization feature map. , Represents the set of nodes in the graph. This represents the set on top of the graph. It represents a graph that includes topological, node, and edge features.

[0122]

[0123]

[0124] In the formula, The number of power grid buses. This represents the number of branches. Node Each feature represents the voltage sag of the disturbed node. Temporary descent phase angle Duration of temporary descent Power output Load type Load power Transformer type Transformer capacity and the degree of equipment aging The characteristic of side E is the branch impedance. .

[0125] In this embodiment of the invention, the specific implementation process of step 201 is similar to that of step 101, and will not be repeated here.

[0126] Furthermore, the pre-set target voltage sag localization model includes a feature extraction layer, a node state update layer, an edge state update layer, and an output layer.

[0127] Please see Figure 3 The output of the feature extraction layer is connected to the input of the node state update layer and the edge state update layer, respectively, and the outputs of the node state update layer and the edge state update layer are connected to the input of the output layer.

[0128] Step 202: Use the voltage sag localization feature map as input to the feature extraction layer for feature extraction to obtain multiple node feature vectors and edge feature vectors.

[0129] In this embodiment of the invention, a voltage sag location feature map is used. The input feature extraction layer performs feature extraction, obtaining feature vectors for multiple nodes, where the current node is defined as... Then the current node is The feature vector at time t is Adjacent nodes are Then the adjacent nodes are The feature vector at time step is Define the edge between the current node and its neighboring nodes as Then the edge between the current node and its neighboring nodes is The edge feature vector at time step is .

[0130] Step 203: Input multiple node feature vectors and edge feature vectors into the node state update layer to update the node state, and obtain multiple updated node feature vectors.

[0131] In practical implementation, to facilitate the method's implementation, the above process can be converted into a formulaic encapsulation, where the node message update process function for each node can be as follows:

[0132]

[0133]

[0134] In the formula, For the current node Its in It continuously receives information from adjacent nodes and edges. For the current node Update its own status information after receiving a message. The current node The set of adjacent nodes, , Each is the current node and adjacent nodes exist The feature vector at time step, For the current node With adjacent nodes Features of the space between edges The current node exist The message function at each moment. The current node exist The update function at each moment.

[0135] In this embodiment of the invention, adjacent nodes are grouped together, and the current node is used as the... The feature vector and adjacent nodes at time 1 The feature vector at time step and the edges between the current node and its neighboring nodes are in The edge feature vector at time step is input to the message update process function to update the information and obtain the updated node feature vector.

[0136] Step 204: Input multiple node feature vectors and edge feature vectors into the edge state update layer to update the edge state, and obtain multiple updated edge feature vectors.

[0137] In practical implementation, to facilitate the method's implementation, the above process can be converted into a formulaic encapsulation, where the edge message update process function for each edge can be as follows:

[0138]

[0139]

[0140] In the formula, For the current node and adjacent nodes The edge is It continuously receives information from adjacent nodes and edges. For nodes Update its own status information after receiving a message. and The message and state update functions for the edges.

[0141] In this embodiment of the invention, similar to the node update method, the edge also receives vector information from the node and the edge, and updates the information through the edge message update process function to obtain the updated edge feature vector.

[0142] Step 205: Input and output the layer with multiple updated node feature vectors and edge feature vectors to perform probability prediction and obtain multiple initial transient source prediction probability values.

[0143] It is worth mentioning that the output layer consists of a fully connected layer and a sigmoid function.

[0144] In practical implementation, to facilitate the method's implementation, the above process can be converted into a formulaic encapsulation, where the edge state prediction function can be as follows:

[0145]

[0146] In the formula Through the current node and adjacent nodes The output of edge state prediction is based on the features. This represents the model's prediction interface. Its core function is to input data and output the model's prediction results. The sigmoid function can be used to obtain results in the range [0,1], representing the initial prediction probability that the edge is a temporary source.

[0147] In this embodiment of the invention, an output layer maps the node features after the last iteration to the edge state, and the edge state prediction function outputs the initial transient source prediction probability value of each edge.

[0148] Step 206: Use the location corresponding to the largest initial sag source prediction probability value as the voltage sag location result of the power grid.

[0149] In this embodiment of the invention, the specific implementation process of step 206 is similar to that of step 103, and will not be repeated here.

[0150] Furthermore, the process of constructing the pre-set target voltage sag location model includes:

[0151] A1. Obtain voltage sag characteristic data and topology data of the power grid and perform preprocessing to generate a feature map dataset.

[0152] In this embodiment of the invention, this step is similar to the preprocessing process of S11-S15, and will not be described again here.

[0153] A2. Divide the feature map dataset into a feature map training set and a feature map test set.

[0154] In this embodiment of the invention, the feature map dataset is divided into a feature map training set and a feature map test set.

[0155] A3. Use the feature map training set as input to the preset initial voltage sag localization model to generate training prediction probability values.

[0156] In this embodiment of the invention, this step is similar to steps 202-205, and will not be described again here.

[0157] A4. Calculate the cross-entropy loss value of the training prediction probability.

[0158] The optimal objective is to minimize the multi-class cross-entropy loss function, as shown in the following equation:

[0159]

[0160] In the formula, This represents the cross-entropy loss value. This represents the total number of feature maps in the training set. The true labels are: edges containing the correct landing source are assigned a value of 1, and all other edges are assigned a value of 0. This is because only edges containing the correct landing source are considered. , The i-th edge represents the edge containing the temporary descent source, and the others... The actual loss can be simplified as follows:

[0161]

[0162] In the formula, This represents the model's predicted probability of the actual transient source edge.

[0163] In this embodiment of the invention, the cross-entropy loss value of the training prediction probability value is calculated.

[0164] A5. When the cross-entropy loss value is less than the preset loss value threshold, a target voltage sag location model is generated.

[0165] The preset loss threshold refers to a standard value that is set in advance during the model training process to measure the model performance.

[0166] In this embodiment of the invention, when the cross-entropy loss value is less than a preset loss value threshold, a target voltage sag location model is generated.

[0167] A6. When the cross-entropy loss value is greater than or equal to the preset loss value threshold, the model parameters of the preset initial voltage sag positioning model are optimized using the differential evolution algorithm.

[0168] Differential Evolution (DE) is an evolutionary algorithm for global optimization, particularly well-suited for optimizing continuous functions. Its basic idea is to generate new candidate solutions through difference and mutation operations, thereby efficiently exploring and utilizing the search space.

[0169] The location and type of transient source are selected as the target state of the edge. The network model is trained by inputting the training set data. The model parameters are optimized by the differential evolution algorithm, including hyperparameters such as the number of network model layers, the number of hidden layer neurons, and the learning rate.

[0170] Furthermore, A6 may include the following sub-steps:

[0171] A61. Randomly generate multiple target individuals to obtain an initial population, where each target individual represents a set of model parameters.

[0172] In this embodiment of the invention, multiple target individuals are randomly generated, each target individual representing a set of model parameters, and an initial population is generated. Each target individual in the population represents a solution, which is usually randomly initialized within a given upper and lower bound.

[0173]

[0174] In the formula, This indicates the target individual's ID number within the population. Indicates the number of generations, typically 100. <G<500, Indicates population size.

[0175] A62. Perform mutation operations on each target individual in the initial population to obtain an intermediate population composed of each mutated individual.

[0176] In this embodiment of the invention, for each target individual in the initial population, a corresponding mutated individual is generated using the following formula, and the mutation operation is as follows:

[0177]

[0178] In the formula, Indicates the first The variant individuals generated in each generation, Indicates the first The first generation randomly selected from the initial population The target individuals are the basis vectors for the mutation operation. The individual number is randomly selected and is different from the number i. It is a mutation operator, usually between [0, 2], which controls the scaling of the difference variable.

[0179] A63. Cross-operation is performed between each target individual and each mutated individual in the intermediate population to obtain a trial population composed of each trial individual.

[0180] Furthermore, A63 may include the following sub-steps:

[0181] A631. Determine the dimension index of the current mutant individual, and match the mutant model parameters associated with the dimension index from the mutant individual as the first trial model parameters of the trial individual.

[0182] Dimension index refers to the randomly selected parameter dimension number (such as the first dimension in a vector). Each component.

[0183] The parameters of the mutation model refer to the mutated individuals. The parameter value in a certain dimension.

[0184] A632. Call the preset random number generation function to generate random numbers for the remaining dimensions of the variant model parameters in the variant individuals, and obtain a random number sequence.

[0185] A random number sequence refers to a sequence of values ​​generated by a random number generation function, with a length equal to the dimension of the solution vector minus one.

[0186] A633. Compare each random number in the random number sequence with the preset crossover probability.

[0187] The preset crossover probability refers to the threshold for controlling the replacement probability of the parameter, which ranges from [0, 1].

[0188] A634. If the random number is less than the preset crossover probability, the parameter associated with the random number will be used as the second trial model parameter for the trial individual.

[0189] A635. If the random number is greater than or equal to the preset crossover probability, then the target model parameter within the target individual that is in the same dimension as the random number is used as the second trial model parameter of the trial individual.

[0190] Target model parameters refer to the target individual The original parameter value in a certain dimension. Used to compete with the parameters of the mutation model to determine whether to enter the trial individual.

[0191] A636. Integrate the parameters of the first trial model with the parameters of the second trial model to obtain the trial individual.

[0192] A637. Traverse the intermediate population and obtain the trial population composed of each trial individual based on the traversal results.

[0193] In this embodiment of the invention, the mutated individual is combined with the target individual to generate a trial individual. The crossover operation is as follows:

[0194]

[0195]

[0196] In the formula, Indicates the first In the middle, testing the individual In the Components in the random dimension Indicates the first In generations, mutated individuals In the Components in the random dimension Indicates the first In the generation, the target individual In the Components in the random dimension This represents a random number generation function that uniformly distributes random numbers between 0 and 1. Describes a sequence of random selections between [1, D]. Indicates a dimension index. The crossover operator has a preset crossover probability, typically between [0, 1]. Otherwise, Indicates the first In the generation, from mutated individuals With target individuals Trial individuals generated through crossover operations.

[0197] To facilitate understanding, the following is an example of the application of cross operations:

[0198] Assuming the target individual: =[3, 64, 0.005] (Number of layers, number of neurons, learning rate).

[0199] Mutant individuals: =[4, 72, 0.008].

[0200] Random index: =2 (second dimension).

[0201] Random number generation: =[0.85, 0.92, 0.45] (corresponding to the three dimensions respectively).

[0202] Crossover process:

[0203] Dimension 1 ( =1)

[0204] =0.85≤0.9 (preset crossover probability), select =4.

[0205] Dimension 2 ( =2)

[0206] Forced selection =72 (even if) =0.92>0.9).

[0207] Dimension 3 ( =3)

[0208] =0.45≤0.9 (preset crossover probability), select =0.008.

[0209] Results of trial individuals: =[4, 72, 0.008].

[0210] A64. Select each target individual from each test individual in the test population to obtain the target population composed of each candidate individual.

[0211] Furthermore, A64 may include the following sub-steps:

[0212] A641. Based on each target individual and the associated trial individuals, the target verification loss value and the trial verification loss value are generated by inputting the feature map test set into the preset initial voltage sag localization model.

[0213] In this embodiment of the invention, firstly, the target individual is assigned to a preset initial voltage sag localization model. Then, the feature map test set is used to input the preset initial voltage sag localization model to predict the sag source. The prediction result is compared with the real label to generate the target verification loss value. Then, the trial individual associated with the target individual is assigned to the preset initial voltage sag localization model. Then, the feature map test set is used to input the preset initial voltage sag localization model to predict the sag source. The prediction result is compared with the real label to generate the trial verification loss value.

[0214] A642. Compare the target verification loss value with the trial verification loss value.

[0215] In this embodiment of the invention, the target verification loss value is compared with the trial verification loss value.

[0216] A643. If the trial verification loss value is less than the target verification loss value, then the trial individual associated with the trial verification loss value is taken as a candidate individual.

[0217] In this embodiment of the invention, if the trial verification loss value is less than the target verification loss value, then the trial individual associated with the trial verification loss value is taken as a candidate individual.

[0218] A644. If the trial verification loss value is greater than or equal to the target verification loss value, then the target individual associated with the target verification loss value is taken as a candidate individual.

[0219] In this embodiment of the invention, if the trial verification loss value is greater than or equal to the target verification loss value, then the target individual associated with the target verification loss value is taken as a candidate individual.

[0220] A65. Determine whether the current iteration count meets the preset iteration count threshold.

[0221] In this embodiment of the invention, it is determined whether the current iteration number meets the preset iteration number threshold. It is worth mentioning that the termination condition of the differential evolution algorithm can also be defined as ending the algorithm when the objective function is less than the threshold, the maximum number of generations is reached, or the change in population fitness is minimal.

[0222] A66. If the current iteration number meets the preset iteration number threshold, then based on each candidate individual, the feature map test set is used to input the preset initial voltage sag localization model to generate multiple candidate verification loss values.

[0223] In this embodiment of the invention, if the current iteration number meets the preset iteration number threshold, each candidate individual is assigned to the preset initial voltage sag localization model, and then the feature map test set is used to input the preset initial voltage sag localization model to predict the sag source. The prediction results are compared with the true labels to generate multiple candidate verification loss values.

[0224] A67. Select the candidate individual associated with the smallest candidate validation loss value as the optimal model parameter.

[0225] In this embodiment of the invention, the loss function is a quantitative indicator that measures the difference between the model's prediction and the true value. The smaller the value, the more accurate the model prediction. Therefore, minimizing the loss function makes the model parameters approach the optimal solution. Thus, the candidate individual associated with the smallest candidate validation loss value is selected as the optimal model parameter.

[0226] A68. If the current iteration count does not meet the preset iteration count threshold, then the target population will be used as the new initial population.

[0227] In this embodiment of the invention, if the current iteration number does not meet the preset iteration number threshold, the target population is used as the new initial population.

[0228] A69. Based on the new initial population, jump to the step of performing mutation operations on each target individual in the initial population to obtain an intermediate population composed of each mutated individual.

[0229] In this embodiment of the invention, based on the new initial population, the process jumps to the step of performing mutation operations on each target individual in the initial population to obtain an intermediate population composed of each mutated individual, until the current iteration number meets the preset iteration number threshold, or meets other preset termination conditions (such as when the objective function is less than the threshold or when the population fitness change is minimal).

[0230] Based on the loss values, target individuals and trial individuals are evaluated, and the better ones are selected to enter the next generation. The specific selection process is as follows:

[0231]

[0232] It should be noted that here... Indicates a candidate individual.

[0233] In the formula, Indicates the first In the process, candidate individuals are selected from either the trial individuals or the target individuals based on their loss values. Indicates the first The target individual in the equation represents a potential solution to the optimization problem. Indicates the first The trial individuals in the generation, generated through mutation and crossover, are newly generated potential solutions. This represents the objective function.

[0234] It should be noted that the optimal combination of supermodel parameters for predicting voltage sags is obtained by iteratively updating the differential evolution algorithm, and a voltage sag localization model is constructed.

[0235] A7. Jump to the step of using the feature map dataset as input to the preset initial voltage sag localization model to generate training prediction probability values ​​until the cross-entropy loss value is less than the preset loss value threshold.

[0236] In this embodiment of the invention, after optimizing the model parameters using the differential evolution algorithm, the process jumps to the step of using the feature map dataset as input to the preset initial voltage sag localization model to generate training prediction probability values, until the cross-entropy loss value is less than the preset loss value threshold.

[0237] Finally, the feature map test set can be used to input the trained target voltage sag localization model to predict the location and type of voltage sag source, and then compared with the actual sag source to verify the accuracy of the method of this patent.

[0238] It is worth mentioning that the present invention has the following advantages:

[0239] 1) Precise positioning: Using MP-GNNs to study the voltage sag positioning problem can enhance the identification of voltage sag propagation paths and improve positioning accuracy, which will provide important support for the reliable operation of power systems.

[0240] 2) Real-time performance: It accelerates the calculation speed, improves the real-time monitoring capability of voltage sag events, and further promotes the development of power quality monitoring and management technology, with broad application potential.

[0241] 3) Comprehensive analysis: The connection and attribute information between nodes help to establish a more accurate voltage sag propagation model, which makes the model take into account the impact of the entire network and enhances the robustness of sag source location.

[0242] Please see Figure 5 , Figure 5 This is a structural block diagram of a power grid voltage sag location system based on a message-passing graph neural network, provided in Embodiment 3 of the present invention.

[0243] This invention provides a power grid voltage sag localization system based on a message-passing graph neural network, comprising:

[0244] The preprocessing module 301 is used to acquire voltage sag characteristic data and topology data of the power grid and perform preprocessing to construct a voltage sag location feature map.

[0245] The voltage sag source prediction module 302 is used to predict sag sources by inputting a preset target voltage sag location model with a voltage sag location feature map and output multiple initial sag source prediction probability values.

[0246] The voltage sag location module 303 is used to take the location corresponding to the largest initial voltage sag source prediction probability value as the voltage sag location result of the power grid.

[0247] Furthermore, the pre-set target voltage sag localization model includes a feature extraction layer, a node state update layer, an edge state update layer, and an output layer. The sag source prediction module 302 includes:

[0248] The feature extraction submodule is used to extract features from the input feature extraction layer using the voltage sag localization feature map, and obtain multiple node feature vectors and edge feature vectors.

[0249] The node state update submodule is used to update the node state by inputting multiple node feature vectors and edge feature vectors into the node state update layer, and obtain multiple updated node feature vectors.

[0250] The edge state update submodule is used to update the edge state by inputting multiple node feature vectors and edge feature vectors into the edge state update layer, and obtain multiple updated edge feature vectors.

[0251] The probability prediction submodule is used to perform probability prediction by inputting multiple updated node feature vectors and edge feature vectors into the output layer, and obtain multiple initial transient source prediction probability values.

[0252] Furthermore, the process of constructing the pre-set target voltage sag location model includes:

[0253] The voltage sag characteristic data and topology data of the power grid are acquired and preprocessed to generate a feature map dataset;

[0254] The feature map dataset is divided into a feature map training set and a feature map test set;

[0255] The feature map training set is used as input to the preset initial voltage sag localization model to generate training prediction probability values;

[0256] Calculate the cross-entropy loss value of the training predicted probability values;

[0257] When the cross-entropy loss value is less than the preset loss value threshold, a target voltage sag location model is generated.

[0258] Furthermore, it also includes:

[0259] When the cross-entropy loss value is greater than or equal to the preset loss value threshold, the model parameters of the preset initial voltage sag positioning model are optimized using the differential evolution algorithm.

[0260] Jump to the step of using the feature map dataset as input to the preset initial voltage sag localization model to generate training prediction probability values ​​until the cross-entropy loss value is less than the preset loss value threshold.

[0261] Furthermore, the model parameters of the preset initial voltage sag location model are optimized using the differential evolution algorithm, including:

[0262] Multiple target individuals are randomly generated to obtain an initial population, where each target individual represents a set of model parameters;

[0263] Mutation operations are performed on each target individual in the initial population to obtain an intermediate population composed of the mutated individuals.

[0264] Crossover operations were performed between each target individual and each mutated individual in the intermediate population to obtain an experimental population composed of each trial individual.

[0265] The target population is obtained by selecting each target individual from each test individual in the test population.

[0266] Determine whether the current iteration count meets the preset iteration count threshold;

[0267] If the current iteration number meets the preset iteration number threshold, then based on each candidate individual, the feature map test set is used to input the preset initial voltage sag localization model to generate multiple candidate verification loss values.

[0268] The candidate individual associated with the smallest candidate validation loss value is selected as the optimal model parameter.

[0269] Furthermore, crossover operations are performed between each target individual and each mutated individual in the intermediate population to obtain an experimental population composed of each test individual, including:

[0270] Determine the dimension index of the current mutant individual, and match the mutant model parameters associated with the dimension index from the mutant individual as the first trial model parameters of the trial individual;

[0271] The preset random number generation function is called to generate random numbers for the remaining dimensions of the variant model parameters in the variant individuals, resulting in a random number sequence.

[0272] Each random number in the random number sequence is compared with a preset crossover probability;

[0273] If the random number is less than the preset crossover probability, the parameter associated with the random number will be used as the second trial model parameter for the trial individual.

[0274] If the random number is greater than or equal to the preset crossover probability, then the target model parameters within the target individual that are in the same dimension as the random number are used as the second trial model parameters of the trial individual.

[0275] By integrating the parameters of the first and second trial models, the trial individuals are obtained;

[0276] Traverse the intermediate population and obtain the trial population composed of each trial individual based on the traversal results.

[0277] Furthermore, a selection operation is performed between each target individual and each trial individual in the trial population to obtain the target population composed of each candidate individual, including:

[0278] Based on each target individual and the associated trial individuals, the target verification loss value and the trial verification loss value are generated by inputting the feature map test set into the preset initial voltage sag localization model.

[0279] Compare the target validation loss value with the trial validation loss value;

[0280] If the trial verification loss value is less than the target verification loss value, then the trial individual associated with the trial verification loss value is taken as a candidate individual;

[0281] If the trial verification loss value is greater than or equal to the target verification loss value, then the target individual associated with the target verification loss value is taken as a candidate individual.

[0282] Furthermore, it also includes:

[0283] If the current iteration count does not meet the preset iteration count threshold, the target population will be used as the new initial population.

[0284] Based on the new initial population, the process jumps to the step of performing mutation operations on each target individual within the initial population to obtain an intermediate population composed of each mutated individual.

[0285] Furthermore, the voltage sag characteristic data includes the voltage sag amplitude of the disturbed node, sag phase angle, sag duration, power output, load type, load power, transformer type, transformer capacity, equipment aging degree, and branch impedance.

[0286] Furthermore, the preprocessing module 301 includes:

[0287] The quantization coding submodule is used to quantize and code load type, transformer type, and equipment aging level.

[0288] The standardization processing submodule is used to standardize the voltage sag amplitude, sag phase angle, sag duration, power output, load power, transformer capacity and branch impedance of the disturbed node.

[0289] The data mapping submodule is used to map topology data into a graph structure, where nodes in the graph structure represent physical nodes of the power grid, and edges in the graph structure represent lines.

[0290] The first storage submodule is used to store the quantized and encoded load type, transformer type and equipment aging degree, as well as the standardized disturbance node voltage sag amplitude, sag phase angle, sag duration, power output, load power and transformer capacity in the node.

[0291] The second storage submodule is used to store the standardized branch impedance within the edge to obtain the voltage sag location feature map.

[0292] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0293] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0294] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0295] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

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

[0297] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for locating voltage sags in power grids based on message-passing graph neural networks, characterized in that, include: The voltage sag characteristic data and topology data of the power grid are acquired and preprocessed to construct a voltage sag location feature map; The voltage sag location feature map is used as input to a preset target voltage sag location model to predict sag sources, and multiple initial sag source prediction probability values ​​are output. The location corresponding to the largest initial sag source prediction probability value is taken as the voltage sag location result of the power grid.

2. The grid voltage sag localization method based on message-passing graph neural network according to claim 1, characterized in that, The preset target voltage sag localization model includes a feature extraction layer, a node state update layer, an edge state update layer, and an output layer. The voltage sag localization feature map is input into the preset target voltage sag localization model to predict sag sources, and multiple initial sag source prediction probability values ​​are output, including: The voltage sag location feature map is input into the feature extraction layer for feature extraction, resulting in multiple node feature vectors and edge feature vectors; The node state is updated by inputting the multiple node feature vectors and edge feature vectors into the node state update layer to obtain multiple updated node feature vectors. The edge state is updated by inputting the multiple node feature vectors and edge feature vectors into the edge state update layer to obtain multiple updated edge feature vectors. The updated node feature vectors and edge feature vectors are input into the output layer for probability prediction to obtain multiple initial transient source prediction probability values.

3. The grid voltage sag localization method based on message-passing graph neural network according to claim 1, characterized in that, The construction process of the preset target voltage sag location model includes: The voltage sag characteristic data and topology data of the power grid are acquired and preprocessed to generate a feature map dataset; The feature map dataset is divided into a feature map training set and a feature map test set; The feature map training set is used as input to the preset initial voltage sag localization model to generate training prediction probability values; Calculate the cross-entropy loss value of the trained predicted probability values; When the cross-entropy loss value is less than the preset loss value threshold, a target voltage sag location model is generated.

4. The grid voltage sag localization method based on message-passing graph neural network according to claim 3, characterized in that, Also includes: When the cross-entropy loss value is greater than or equal to the preset loss value threshold, the model parameters of the preset initial voltage sag positioning model are optimized using the differential evolution algorithm. Jump to the step of using the feature map dataset as input to the preset initial voltage sag localization model to generate training prediction probability values, until the cross-entropy loss value is less than the preset loss value threshold.

5. The grid voltage sag localization method based on message-passing graph neural network according to claim 4, characterized in that, The optimization of the model parameters of the preset initial voltage sag location model using the differential evolution algorithm includes: Multiple target individuals are randomly generated to obtain an initial population, wherein each target individual represents a set of model parameters; Mutation operations are performed on each target individual in the initial population to obtain an intermediate population composed of the mutated individuals. The target individuals are cross-operated with the mutated individuals in the intermediate population to obtain an experimental population composed of the trial individuals. A selection operation is performed between each target individual and each test individual in the test population to obtain a target population composed of each candidate individual; Determine whether the current iteration count meets the preset iteration count threshold; If the current iteration number meets the preset iteration number threshold, then based on each candidate individual, the feature map test set is used to input the preset initial voltage sag localization model to generate multiple candidate verification loss values. The candidate individual associated with the smallest candidate validation loss value is selected as the optimal model parameter.

6. The grid voltage sag localization method based on message-passing graph neural network according to claim 5, characterized in that, The method of cross-crossing each target individual with each mutated individual in the intermediate population to obtain an experimental population composed of each test individual includes: Determine the dimension index of the current mutant individual, and match the mutant model parameters associated with the dimension index from the mutant individual as the first trial model parameters of the trial individual; A preset random number generation function is called to generate random numbers for the remaining dimension-related mutation model parameters in the mutated individuals, resulting in a random number sequence; Each random number in the random number sequence is compared with a preset crossover probability; If the random number is less than the preset crossover probability, then the parameter associated with the random number is used as the second trial model parameter of the trial individual; If the random number is greater than or equal to the preset crossover probability, then the target model parameter within the target individual that is in the same dimension as the random number is used as the second trial model parameter of the trial individual. By integrating the parameters of the first trial model and the parameters of the second trial model, a trial individual is obtained; Traverse the intermediate population and obtain the trial population composed of each trial individual based on the traversal results.

7. The grid voltage sag localization method based on message-passing graph neural network according to claim 5, characterized in that, The step of selecting from each target individual and each test individual in the test population to obtain a target population composed of candidate individuals includes: Based on each target individual and the associated trial individual, the preset initial voltage sag localization model is input using the feature map test set to generate target verification loss value and trial verification loss value; Compare the target verification loss value with the trial verification loss value; If the trial verification loss value is less than the target verification loss value, then the trial individual associated with the trial verification loss value is taken as a candidate individual; If the trial verification loss value is greater than or equal to the target verification loss value, then the target individual associated with the target verification loss value is taken as a candidate individual.

8. The grid voltage sag localization method based on message-passing graph neural network according to claim 5, characterized in that, Also includes: If the current iteration count does not meet the preset iteration count threshold, then the target population is used as the new initial population; Based on the new initial population, the process jumps to the step of performing mutation operations on each target individual within the initial population to obtain an intermediate population composed of each mutated individual.

9. The method for locating power grid voltage sags based on message-passing graph neural networks according to claim 1, characterized in that, The voltage sag characteristic data includes the voltage sag amplitude, sag phase angle, sag duration, power output, load type, load power, transformer type, transformer capacity, equipment aging degree, and branch impedance of the disturbed node. The process of acquiring and preprocessing the voltage sag characteristic data and topology data of the power grid to construct a voltage sag location feature map includes: The load type, the transformer type, and the equipment aging degree are quantitatively coded. The voltage sag amplitude of the disturbed node, the sag phase angle, the sag duration, the power output, the load power, the transformer capacity, and the branch impedance are standardized. The topology data is mapped to a graph structure, where nodes in the graph structure represent physical nodes of the power grid, and edges in the graph structure represent lines. The quantized and encoded load type, transformer type, and equipment aging degree, as well as the standardized voltage sag amplitude, sag phase angle, sag duration, power output, load power, and transformer capacity of the disturbed node are stored in the node. The standardized branch impedance is stored within the edge to obtain a voltage sag location feature map.

10. A power grid voltage sag localization system based on a message-passing graph neural network, characterized in that, include: The preprocessing module is used to acquire voltage sag characteristic data and topology data of the power grid and perform preprocessing to construct a voltage sag location feature map; The voltage sag source prediction module is used to predict sag sources by inputting the voltage sag location feature map into the preset target voltage sag location model, and outputs multiple initial sag source prediction probability values. The voltage sag location module is used to take the location corresponding to the largest initial voltage sag source prediction probability value as the voltage sag location result of the power grid.