A method for precise treatment of power grid power quality
By using dynamic PQ knowledge graphs and multimodal feature extraction technology, combined with causal reasoning and reinforcement learning, the problem of multi-source data fusion for power quality disturbances in the power grid is solved, thereby improving the accuracy and efficiency of power quality governance and making it suitable for complex power grid environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID JIANGSU ELECTRIC POWER CO LIANYUNGANG POWER SUPPLY CO
- Filing Date
- 2026-02-27
- Publication Date
- 2026-06-12
AI Technical Summary
Existing technologies cannot effectively integrate multi-source data in the monitoring and management of power quality disturbances in power grids, resulting in insufficient data value mining, inability to accurately locate the root cause of disturbances, and a lack of targeted management measures.
We employ a dynamic PQ knowledge graph combined with multimodal features and causal reasoning. We achieve multi-source entity alignment by improving the CEA model, extract features using GAF image encoding and LSTM encoding, perform graph convolutional embedding based on GCN, screen candidate causes, and generate the optimal governance action through reinforcement learning.
It achieves improved accuracy and efficiency in power quality management, with rapid response and high stability, making it suitable for complex power grid environments.
Smart Images

Figure CN122198718A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power quality management technology, and more specifically, to a method for precise management of power grid power quality. Background Technology
[0002] With the advancement of new power system construction, the large-scale grid connection of distributed power sources, the centralized access of electric vehicle charging piles and nonlinear industrial loads, the operating conditions of distribution networks are becoming increasingly complex, and power quality (PQ) disturbances are becoming more prominent, mainly manifested as harmonic distortion, voltage sags, three-phase imbalance, and voltage deviations. These problems not only lead to abnormal operation of sensitive loads but also exacerbate equipment losses, reduce grid transmission efficiency, and seriously affect power supply reliability and quality, becoming a key bottleneck restricting the high-quality development of new power systems. Related technical research has been conducted within the industry: some solutions focus on the monitoring and visualization of PQ disturbances, achieving spatial display of disturbance events by collecting voltage and current waveform data; some technologies use signal processing and machine learning methods to achieve accurate classification of PQ disturbance types; and other research introduces knowledge graph technology to attempt to integrate grid static topology and operational data, providing support for multi-source data association.
[0003] Currently, existing technologies have made some progress in PQ monitoring and disturbance classification, but there are still many shortcomings: existing methods mostly rely on single PQ monitoring data and fail to effectively integrate SCADA real-time operation data, equipment ledger static data, dispatch log text data, and environmental impact data, resulting in insufficient data value mining and an inability to comprehensively depict the correlation between PQ disturbances and power grid lines, loads, equipment, and the environment; existing disturbance classification technologies can only identify what kind of disturbance has occurred, but cannot construct an explainable causal chain, making it difficult to accurately locate the root cause of the disturbance, resulting in a lack of targeted governance measures. Summary of the Invention
[0004] To address the aforementioned technical issues, this invention provides a method for precise governance of power grid power quality. It breaks down data silos through a dynamic PQ knowledge graph, ensures accurate root cause identification through multimodal features and causal reasoning, automates the entire governance process through reinforcement learning, and balances effectiveness, cost, and constraints through a reward function. This results in fast governance response, high stability, and effectively improves the accuracy and efficiency of power quality governance.
[0005] To achieve the above objectives, the technical solution of the present invention is as follows:
[0006] A method for precise management of power grid power quality includes the following steps:
[0007] S1. Collect power quality monitoring data, SCADA data, static data, text data, environmental data, and operational constraint-related data. Perform missing value filling, outlier removal, and normalization on the collected raw data to obtain a standardized dataset.
[0008] S2. Define five types of entities: line entity, load entity, equipment entity, power quality disturbance entity, and mitigation measure entity, as well as four types of relationships: topology connection, power supply association, causal association, and mitigation association. Use an improved CEA model to achieve multi-source entity alignment and dynamically mount real-time standardized data to the corresponding entities to form a time-updated graph structure.
[0009] S3. Spatial features of power quality disturbance signals are extracted using GAF image encoding, and temporal features are extracted using LSTM encoding. Multimodal fusion features are obtained through attention mechanism fusion. Graph convolution embedding is performed on the dynamic power quality knowledge graph based on multi-relation GCN to generate low-dimensional embedding vectors for each entity.
[0010] S4. Filter candidate cause entities within the 3-hop neighborhood of the PQ disturbance entity, quantify the causal strength between the candidate cause and the power quality disturbance based on conditional mutual information, use the backdoor criterion to eliminate false associations, and sort the candidate causes by combining causal strength and path length, outputting the Top-3 root causes and causal paths.
[0011] S5. Predefine the governance action space, construct a policy network with GCN-MLP hybrid architecture, take the power quality disturbance entity embedding vector, Top-1 root cause entity embedding vector, target power quality index and operation constraint related data as input, train the policy network by improving the PPO algorithm, output the optimal governance action and execute it.
[0012] S6. Monitor power quality indicators and operational constraint data after governance in real time, and use the status, optimal action and reward in the governance process to form training samples to update the policy network and value network. Iterate from S2 to S5 every 5 minutes to dynamically adjust the governance strategy.
[0013] As a preferred embodiment of the present invention, the power quality monitoring data in S1 includes voltage and current waveforms, total harmonic distortion rate, voltage sag depth, sag duration and three-phase imbalance, and the sampling rate of the voltage and current waveforms is 2kHz.
[0014] The SCADA data includes line active power, line reactive power, bus voltage, switch status and transformer load rate, and the SCADA data is updated at a frequency of 100ms.
[0015] The static data includes equipment ledgers and power grid topology. The equipment ledgers include rated parameters and installation locations. The power grid topology includes line connection relationships and voltage levels. The text data includes dispatch logs, fault work orders, and governance history records.
[0016] The environmental data includes wind speed, light intensity, and temperature, and the environmental data is updated every 1 minute.
[0017] The operational constraint data is divided into static constraint data and dynamic constraint data. Static constraint data is taken from static data and includes line rated current, equipment rated capacity, allowable range of bus voltage, and upper limit of DG rated output. Dynamic constraint data is taken from SCADA data and includes real-time line current, real-time equipment load rate, and real-time bus voltage.
[0018] As a preferred embodiment of the present invention, the attributes of the line entity in S2 include line ID, voltage level, resistance, reactance, length, and real-time current.
[0019] The attributes of the load entity include load ID, load type, rated power and real-time harmonic emission level. The load type includes industrial, residential and impact. The real-time harmonic emission level is expressed as a percentage of total harmonic distortion.
[0020] The attributes of the device entity include device ID, device type, rated capacity and real-time status. Device types include transformer, SVG and APF, and real-time status includes normal and abnormal.
[0021] The attributes of the power quality disturbance entity include disturbance ID, disturbance type, occurrence time, and set of affected nodes. The disturbance type includes sag, harmonics, and imbalance, and the occurrence time is accurate to milliseconds.
[0022] The attributes of the governance measure entity include measure ID, governance measure type, implementation cost, and effective time. Governance measure types include parameter adjustment and equipment switching.
[0023] The four types of relationships are topology connection, power supply association, causal association and governance association. The topology connection represents the physical connection relationship between the line and the bus, and between the bus and the equipment. The power supply association represents the power supply relationship between the line and the load, and between the equipment and the load. The causal association represents the disturbance triggering relationship between the equipment and the disturbance, and between the load and the disturbance. The governance association represents the governance correspondence relationship between the measures and the disturbance, and between the measures and the equipment.
[0024] As a preferred embodiment of the present invention, the improved CEA model described in S2 calculates entity similarity through four-dimensional similarity fusion, and the four-dimensional similarity fusion formula is as follows:
[0025]
[0026] in, For structural similarity weights, For attribute similarity weights, Weighted by name similarity. The similarity weights for the PQ index are... , , , ,and ; For topological similarity, cosine similarity is calculated after extracting features from adjacent subgraphs based on GCN; The attribute similarity is the reciprocal of the normalized Euclidean distance between the device's rated parameters and voltage level. Name similarity is calculated using edit distance, with the following formula:
[0027]
[0028] for and Edit distance, for Name length, for Name length; PQ index similarity, and total harmonic distortion rate and voltage deviation index Pearson correlation coefficient for entity association;
[0029] The improved CEA model uses Softmax cross-entropy as the alignment loss function, and the formula is as follows:
[0030]
[0031] in, , For the two sets of data source entities to be aligned, For indicator functions, and When they are the same entity Otherwise, it is 0. For temperature parameters, The model optimization objective is to minimize Ensure that the entity alignment accuracy is no less than 98%.
[0032] As a preferred embodiment of the present invention, the dynamic mounting described in S2 is achieved through entity attribute vectors, and the formula for the entity attribute vectors is:
[0033]
[0034] in, These are static attributes of an entity, including attributes such as line resistance and equipment rated capacity, which are determined and do not change. These are dynamic attributes of the entity, including attributes such as real-time current and total harmonic distortion rate, which are updated every 100ms. The timestamp is used; the graph adopts an incremental update method, updating only the changed entity attributes and relationship strengths, and the time taken for a single update does not exceed 50ms.
[0035] As a preferred embodiment of the present invention, the multimodal feature extraction in S3 uses GAF image encoding to extract spatial features, combines LSTM encoding to extract temporal features, and fuses them through an attention mechanism;
[0036] The steps of the GAF image encoding include: the first step is signal normalization, which involves converting the voltage sampling sequence... Mapping to the interval [-1, 1], the formula is:
[0037]
[0038] in, , The sampling length;
[0039] The second step is polar coordinate transformation, the formula is:
[0040]
[0041] in, , The angle corresponding to the time series;
[0042] The third step is to construct the Gram matrix, using the following formula:
[0043]
[0044] in, The fourth step involves extracting spatial features from the GAF image using a lightweight CNN, focusing on pixel values. The lightweight CNN comprises two convolutional layers and one pooling layer;
[0045] The steps of the LSTM encoding include: first, sequence segmentation, and... By window size Divided into 64 segments;
[0046] The second step is to update the 3-layer LSTM network. The network update formula is as follows:
[0047]
[0048] in, For input gate, For the Gate of Oblivion For output gate, It is a Sigmoid activation function and , In cellular state, In hidden state, , This is the weight matrix. For bias vectors, For element-wise product, Normalized voltage data for each segment;
[0049] The third step is to retrieve the hidden state at the last moment. As a temporal characteristic The attention mechanism fusion formula is as follows:
[0050]
[0051] in, The attention weight is given by the following formula:
[0052]
[0053] The attention weight vector is used to output the fused features. .
[0054] As a preferred embodiment of the present invention, the graph convolutional embedding in S3 is implemented based on a multi-relation GCN, firstly constructing an initial node feature matrix:
[0055]
[0056] in, For the characteristics of power quality disturbance entities fusion, The attribute vectors of other entities are normalized to the interval [0,1]. The total number of non-power quality perturbation entities; the multi-relation GCN includes 3 layers of graph convolutional updates, the first... The layer update formula is:
[0057]
[0058] in, , For relationship The normalized adjacency matrix, For relationship The adjacency matrix, for The degree matrix, For relationship A dedicated weight matrix, For globally shared weight matrix, The LeakyReLU activation function is The output of the graph convolution embedding includes power quality perturbation entity embedding. Other entity embeddings , This is the index of the entity in the initial node feature matrix.
[0059] As a preferred embodiment of the present invention, the causal strength quantification in S4 is based on conditional mutual information, and the formula for conditional mutual information is:
[0060]
[0061] in, For power quality disturbance entities, As a candidate cause entity, It is a mixed variable that includes three core variables: operating scenario type, bus voltage level, and total DG output. For conditional entropy and , For expectation operator, The conditional probability density is solved using the k=5 nearest neighbor estimation algorithm, and the solution is based on the entity embedding of power quality perturbation. Candidate reason entity embedding and hybrid variable embedding The causal strength is normalized, and the normalization formula is:
[0062]
[0063] in, For the set of candidate reasons, , A larger value indicates a candidate reason With disturbance The more significant the causal relationship, the better.
[0064] As a preferred embodiment of the present invention, the false association elimination in S4 is based on the backdoor criterion, which checks whether there is a backdoor path for the top 5 candidate causes with the highest causal strength. If it exists, adjust the set of promiscuous variables to... Recalculate conditional mutual information And update the causal strength After adjustment The entity; the root cause ranking combines causal strength and path length, and the ranking score formula is:
[0065]
[0066] in, for and The shortest path length, The threshold for the number of hops is used to output the top-3 root cause entities and causal paths.
[0067] The Top-3 root cause entities contain the entity embeddings for each root cause, such as the Top-1 entity embeddings. Top-2 entity embedding Top-3 entity embedding All are 256-dimensional; the Top-3 root cause entities also contain causal path information and causal strength scores. .
[0068] As a preferred embodiment of the present invention, the governance action space in S5 includes six types of governance actions, namely... SVG reactive power output adjustment APF harmonic compensation adjustment OLTC gear adjustment Load transfer, DG active power output limit and Interconnection switch on / off; middle kVar, adjust the step size to 50kVar; middle %, For the 3rd, 5th, and 7th harmonics, adjust the step size to 10%; middle Each voltage setting has a range of ±0.5% adjustment. middle A maximum of 3 load nodes can be transferred; middle %, is a percentage limit based on rated output; middle 0 indicates open, 1 indicates closed, and a maximum of 2 switches can be operated at a time;
[0069] The policy network is a GCN-MLP hybrid architecture, with state input. ,in For the embedding of the top-1 root cause entity, The target power quality index, The constraint vector is formed by splicing the standardized static constraint data output by S1 with the real-time dynamic constraint data, and includes constraints such as the upper limit of line current, equipment capacity limit, and DG output range.
[0070] The policy network output formula is:
[0071]
[0072] The normalized adjacency matrix is used; the reward function formula is:
[0073]
[0074] in, , , To improve power quality indicators before the treatment, To determine the power quality indicators after the treatment, To achieve the target improvement, , For the set of actions to be performed, For the cost of action, To maximize the cost of action, , For line current exceeding the limit, For voltage exceeding the limit, For the corresponding constraint limits, , The policy network is trained using an improved PPO algorithm, with the objective function being:
[0075]
[0076] in, For policy network parameters, For parameters before the update, It is the dominant function and , For value networks, The subsequent state after the action is performed. As a discount factor, This is the cutting factor.
[0077] The beneficial technical effects of this invention are:
[0078] In this invention, the dynamic PQ knowledge graph achieves accurate alignment of multi-source entities by improving the CEA model, and uniformly mounts static topology, real-time operation, text logs, and environmental data to entity attributes, thereby improving data utilization and comprehensively depicting the relationship between PQ disturbances and various elements of the power grid.
[0079] By integrating GAF image coding and LSTM multimodal feature embedding technology, the spatial-temporal characteristics of PQ perturbations are fully captured. By combining conditional mutual information and backdoor criterion causal reasoning methods, the Top-3 root causes and explainable causal paths are accurately output, with high root cause identification accuracy, providing a clear basis for targeted governance.
[0080] The reinforcement learning policy generation model based on the GCN-MLP hybrid architecture can automatically output the optimal governance action, with a short governance response time and significantly improved efficiency compared to manual decision-making. It can complete the entire process of tracing, decision-making, and execution without human intervention.
[0081] The reward function design takes into account the improvement of PQ indicators, governance costs and compliance with operational constraints. Through a dynamic iterative closed loop every 5 minutes, it updates the graph attributes, feature embedding and governance strategies in real time, resulting in high stability of governance effects. It is suitable for various application scenarios such as industrial parks, new energy-rich areas and urban core area power distribution networks. Attached Figure Description
[0082] Figure 1 This is a schematic diagram of the overall process of the present invention. Detailed Implementation
[0083] In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, the specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0084] Combination Figure 1 The present invention provides the following embodiments:
[0085] A method for precise management of power grid power quality includes the following steps:
[0086] S1. Collect power quality monitoring data, SCADA data, static data, text data, environmental data, and operational constraint-related data. Perform missing value filling, outlier removal, and normalization on the collected raw data to obtain a standardized dataset.
[0087] S2. Define five types of entities: line entity, load entity, equipment entity, power quality disturbance entity, and mitigation measure entity, as well as four types of relationships: topology connection, power supply association, causal association, and mitigation association. Use an improved CEA model to achieve multi-source entity alignment and dynamically mount real-time standardized data to the corresponding entities to form a time-updated graph structure.
[0088] S3. Spatial features of power quality disturbance signals are extracted using GAF image encoding, and temporal features are extracted using LSTM encoding. Multimodal fusion features are obtained through attention mechanism fusion. Graph convolution embedding is performed on the dynamic power quality knowledge graph based on multi-relation GCN to generate low-dimensional embedding vectors for each entity.
[0089] S4. Filter candidate cause entities within the 3-hop neighborhood of the PQ disturbance entity, quantify the causal strength between the candidate cause and the power quality disturbance based on conditional mutual information, use the backdoor criterion to eliminate false associations, and sort the candidate causes by combining causal strength and path length, outputting the Top-3 root causes and causal paths.
[0090] S5. Predefine the governance action space, construct a policy network with GCN-MLP hybrid architecture, take the power quality disturbance entity embedding vector, root cause entity embedding vector, target power quality index and operation constraint related data as input, train the policy network by improving the PPO algorithm, output the optimal governance action and execute it.
[0091] S6. Monitor power quality indicators and operational constraint data after governance in real time, and use the status, optimal action and reward in the governance process to form training samples to update the policy network and value network. Iterate from S2 to S5 every 5 minutes to dynamically adjust the governance strategy.
[0092] Furthermore, the power quality monitoring data mentioned in S1 includes voltage and current waveforms, total harmonic distortion, voltage sag depth, sag duration, and three-phase imbalance, with the voltage and current waveforms sampled at a rate of 2kHz.
[0093] The SCADA data includes line active power, line reactive power, bus voltage, switch status and transformer load rate, and the SCADA data is updated at a frequency of 100ms.
[0094] The static data includes equipment ledgers and power grid topology. The equipment ledgers include rated parameters and installation locations. The power grid topology includes line connection relationships and voltage levels. The text data includes dispatch logs, fault work orders, and governance history records.
[0095] The environmental data includes wind speed, light intensity, and temperature, and the environmental data is updated every 1 minute.
[0096] The operational constraint data is divided into static constraint data and dynamic constraint data. Static constraint data is taken from static data and includes line rated current, equipment rated capacity, allowable range of bus voltage, and upper limit of DG rated output. Dynamic constraint data is taken from SCADA data and includes real-time line current, real-time equipment load rate, and real-time bus voltage.
[0097] Multi-source data covering power grid operation status, equipment characteristics, and environmental impact are selected in a targeted manner. The sampling rate and update frequency are set by matching the requirements of subsequent algorithm modules to ensure the timeliness and integrity of the data. Preprocessing operations address issues such as missing data, abnormal interference, and dimensional differences, providing a high-quality, uniformly scaled data foundation for subsequent steps such as dynamic map construction and feature extraction, and avoiding governance deviations caused by data defects.
[0098] The collected raw data is cleaned and standardized to provide high-quality data for subsequent core technology modules:
[0099] Missing value imputation: The KNN interpolation algorithm is used to fill in missing values for key data such as voltage and power.
[0100] Outlier removal: Based on the 3σ criterion, impulse noise and erroneously collected values are removed from the monitoring data;
[0101] Data normalization: Maps continuous data such as voltage and power to the [-1,1] interval to eliminate dimensional differences. The formula is:
[0102]
[0103] in, The minimum value of the data. This represents the maximum value of the data.
[0104] Furthermore, the attributes of the line entity described in S2 include line ID, voltage level, resistance, reactance, length, and real-time current;
[0105] The attributes of the load entity include load ID, load type, rated power and real-time harmonic emission level. The load type includes industrial, residential and impact. The real-time harmonic emission level is expressed as a percentage of total harmonic distortion.
[0106] The attributes of the device entity include device ID, device type, rated capacity and real-time status. Device types include transformer, SVG and APF, and real-time status includes normal and abnormal.
[0107] The attributes of the power quality disturbance entity include disturbance ID, disturbance type, occurrence time, and set of affected nodes. The disturbance type includes sag, harmonics, and imbalance, and the occurrence time is accurate to milliseconds.
[0108] The attributes of the governance measure entity include measure ID, governance measure type, implementation cost, and effective time. Governance measure types include parameter adjustment and equipment switching.
[0109] The four types of relationships are topology connection, power supply association, causal association and governance association. The topology connection represents the physical connection relationship between the line and the bus, and between the bus and the equipment. The power supply association represents the power supply relationship between the line and the load, and between the equipment and the load. The causal association represents the disturbance triggering relationship between the equipment and the disturbance, and between the load and the disturbance. The governance association represents the governance correspondence relationship between the measures and the disturbance, and between the measures and the equipment.
[0110] Based on the core logic of power quality governance—disturbance-root cause-governance—five types of entities are defined to cover all governance elements, and four types of relationships are defined to depict the physical connections and logical associations between elements. Entity attributes integrate static inherent characteristics and dynamic operating states, and relationship semantics are aligned with the operating rules of the power grid, providing a framework for the structured fusion of multi-source data and supporting the accuracy of subsequent causal reasoning and strategy generation.
[0111] Furthermore, the improved CEA model described in S2 calculates entity similarity through four-dimensional similarity fusion. The four-dimensional similarity fusion formula is as follows:
[0112]
[0113] in, For structural similarity weights, For attribute similarity weights, Weighted by name similarity. The similarity weights for the PQ index are... , , , ,and ; For topological similarity, cosine similarity is calculated after extracting features from adjacent subgraphs based on GCN; The attribute similarity is the reciprocal of the normalized Euclidean distance between the device's rated parameters and voltage level. Name similarity is calculated using edit distance, with the following formula:
[0114]
[0115] for and Edit distance, for Name length, for Name length; PQ index similarity, and total harmonic distortion rate and voltage deviation index Pearson correlation coefficient for entity association;
[0116] The improved CEA model uses Softmax cross-entropy as the alignment loss function, and the formula is as follows:
[0117]
[0118] in, , For the two sets of data source entities to be aligned, For indicator functions, and When they are the same entity Otherwise, it is 0. For temperature parameters, The model optimization objective is to minimize Ensure that the entity alignment accuracy is no less than 98%.
[0119] This study comprehensively characterizes entity relationships from four dimensions: topological location, inherent attributes, identification information, and the impact of power quality. Weight allocation is adapted to the importance of different data types. Alignment accuracy is optimized through the Softmax cross-entropy loss function to solve the problem of entity naming ambiguity across data sources, ensuring the uniqueness and consistency of entities in the graph, and providing a reliable association foundation for subsequent feature fusion and causal inference.
[0120] Furthermore, the dynamic mounting described in S2 is achieved through entity attribute vectors, and the formula for the entity attribute vector is:
[0121]
[0122] in, These are static attributes of an entity, including attributes such as line resistance and equipment rated capacity, which are determined and do not change. These are dynamic attributes of the entity, including attributes such as real-time current and total harmonic distortion rate, which are updated every 100ms. The timestamp is used; the graph adopts an incremental update method, updating only the changed entity attributes and relationship strengths, and the time taken for a single update does not exceed 50ms.
[0123] Entity attribute vectors integrate static attributes, dynamic attributes, and timestamps to achieve a unified representation of static structure, dynamic state, and time-series traceability. The incremental update strategy only updates changed data, avoiding the waste of resources in full reconstruction of the map, ensuring that the map update efficiency matches the data acquisition frequency, and providing real-time synchronized structured data support for subsequent modules.
[0124] Furthermore, the multimodal feature extraction described in S3 uses GAF image encoding to extract spatial features, combines LSTM encoding to extract temporal features, and fuses them through an attention mechanism;
[0125] The steps of the GAF image encoding include: the first step is signal normalization, which involves converting the voltage sampling sequence... Mapping to the interval [-1, 1], the formula is:
[0126]
[0127] in, , The sampling length;
[0128] The second step is polar coordinate transformation, the formula is:
[0129]
[0130] in, , The angle corresponding to the time series;
[0131] The third step is to construct the Gram matrix, using the following formula:
[0132]
[0133] in, The fourth step involves extracting spatial features from the GAF image using a lightweight CNN, focusing on pixel values. The lightweight CNN comprises two convolutional layers and one pooling layer;
[0134] The steps of the LSTM encoding include: first, sequence segmentation, and... By window size Divided into 64 segments;
[0135] The second step is to update the 3-layer LSTM network. The network update formula is as follows:
[0136]
[0137] in, For input gate, For the Gate of Oblivion For output gate, It is a Sigmoid activation function and , In cellular state, In hidden state, , This is the weight matrix. For bias vectors, For element-wise product, Normalized voltage data for each segment;
[0138] The third step is to retrieve the hidden state at the last moment. As a temporal characteristic The attention mechanism fusion formula is as follows:
[0139]
[0140] in, The attention weight is given by the following formula:
[0141]
[0142] The attention weight vector is used to output the fused features. .
[0143] GAF transforms a one-dimensional voltage signal into a two-dimensional image, capturing the spatial correlation features between sampling points; LSTM mines the temporal evolution of the signal; the attention mechanism adaptively allocates the weights of two types of features, strengthens the contribution of key features for different types of perturbations, comprehensively characterizes the essential characteristics of PQ perturbations, and provides high-quality, multi-dimensional feature support for subsequent graph embedding.
[0144] Furthermore, the graph convolutional embedding described in S3 is implemented based on a multi-relation GCN, first constructing an initial node feature matrix:
[0145]
[0146] in, For the characteristics of power quality disturbance entities fusion, The attribute vectors of other entities are normalized to the interval [0,1]. The total number of non-power quality perturbation entities; the multi-relation GCN includes 3 layers of graph convolutional updates, the first... The layer update formula is:
[0147]
[0148] in, , For relationship The normalized adjacency matrix, For relationship The adjacency matrix, for The degree matrix, For relationship A dedicated weight matrix, For globally shared weight matrix, The LeakyReLU activation function is The output of the graph convolution embedding includes power quality perturbation entity embedding. Other entity embeddings , This is the index of the entity in the initial node feature matrix.
[0149] The initial feature matrix integrates PQ perturbation fusion features with other entity attribute vectors to ensure a unified input dimension; a multi-relationship dedicated weight matrix adapts to different relation semantics and strengthens targeted feature delivery; the 3-layer GCN gradually integrates topological relations and entity attribute information, transforming high-dimensional structured data into low-dimensional dense vectors, which retains core features while reducing computational complexity and improving the efficiency of subsequent causal inference.
[0150] As a preferred embodiment of the present invention, the causal strength quantification in S4 is based on conditional mutual information, and the formula for conditional mutual information is:
[0151]
[0152] in, For power quality disturbance entities, As a candidate cause entity, It is a mixed variable that includes three core variables: operating scenario type, bus voltage level, and total DG output. For conditional entropy and , For expectation operator, The conditional probability density is solved using the k=5 nearest neighbor estimation algorithm, and the solution is based on the entity embedding of power quality perturbation. Candidate reason entity embedding and hybrid variable embedding The causal strength is normalized, and the normalization formula is:
[0153]
[0154] in, For the set of candidate reasons, , A larger value indicates a candidate reason With disturbance The more significant the causal relationship, the better.
[0155] By introducing confounding variables to eliminate interference from third-party factors such as operating scenarios and topology, conditional mutual information accurately characterizes the true causal relationship by quantifying the degree of uncertainty reduction of PQ perturbation when known candidate causes are combined with confounding variables. Normalization processes map causal strength to a unified interval, enabling horizontal comparability of different candidate causes and providing an objective quantitative basis for root cause ranking.
[0156] Before quantifying the causal strength, candidate cause screening is required, specifically:
[0157] Within the 3-hop neighborhood of the PQ disturbance entity, potential root cause entities are screened, with the screening criterion being: the entity type is a load entity. or equipment entity The relation constraint is related to the PQ perturbation entity. There is a direct or indirect causal relationship. Inverse relationship; dynamic attribute constraint is the time when the disturbance occurs. The dynamic attribute change rate is >10%, and the formula is: The candidate set was optimized by removing fusion similarity. The entity balances search efficiency and comprehensiveness.
[0158] Furthermore, the spurious association elimination described in S4 is based on the backdoor criterion, which checks for the existence of backdoor paths among the top 5 candidate causes in terms of causal strength. If it exists, adjust the set of promiscuous variables to... Recalculate conditional mutual information And update the causal strength After adjustment The entity; the root cause ranking combines causal strength and path length, and the ranking score formula is:
[0159]
[0160] in, for and The shortest path length, The threshold for the number of hops is used to output the top-3 root cause entities and causal paths.
[0161] The Top-3 root cause entities contain the entity embeddings for each root cause, such as the Top-1 entity embeddings. Top-2 entity embedding Top-3 entity embedding All are 256-dimensional; the Top-3 root cause entities also contain causal path information and causal strength scores. .
[0162] The backdoor criterion identifies and eliminates spurious associations formed through uncontrolled confounding variables, ensuring the authenticity of causal relationships; the path length penalty term reduces the priority of long-path root causes, avoiding the uncertainty brought about by indirect associations; the ranking score integrates causal strength and path reliability, outputting the interpretable Top-3 root causes, providing a clear target for the generation of targeted governance strategies.
[0163] Furthermore, the governance action space described in S5 includes six types of governance actions, namely... SVG reactive power output adjustment APF harmonic compensation adjustment OLTC gear adjustment Load transfer, DG active power output limit and Interconnection switch on / off; middle kVar, adjust the step size to 50kVar; middle %, For the 3rd, 5th, and 7th harmonics, adjust the step size to 10%; middle Each voltage setting has a range of ±0.5% adjustment. middle A maximum of 3 load nodes can be transferred; middle %, is a percentage limit based on rated output; middle 0 indicates open, 1 indicates closed, and a maximum of 2 switches can be operated at a time;
[0164] The policy network is a GCN-MLP hybrid architecture, with state input. ,in For Top-k root cause entity embedding, The target power quality index, The constraint vector is formed by splicing the standardized static constraint data output by S1 with the real-time dynamic constraint data, and includes constraints such as the upper limit of line current, equipment capacity limit, and DG output range.
[0165] The policy network output formula is:
[0166]
[0167] The normalized adjacency matrix is used; the reward function formula is:
[0168]
[0169] in, , , The power quality indicators before the treatment, To determine the power quality indicators after the treatment, To achieve the target improvement, , For the set of actions to be performed, For the cost of action, To maximize the cost of action, , For line current exceeding the limit, For voltage exceeding the limit, For the corresponding constraint limits, , The policy network is trained using an improved PPO algorithm, with the objective function being:
[0170]
[0171] in, For policy network parameters, For parameters before the update, It is the dominant function and , For value networks, The subsequent state after the action is performed. As a discount factor, This is the cutting factor.
[0172] The governance action space is precisely matched with the root cause type to ensure the targeting of actions; the state input fully covers the perturbation features, root cause information, target requirements and operational constraints, providing a complete basis for policy generation; the "GCN+MLP" architecture integrates topological constraints and feature mapping, and the reward function balances governance effect, economic cost and operational safety; the improved PPO algorithm ensures training stability by limiting the policy update amplitude and achieves adaptive optimal governance action output.
[0173] The specific steps for S6 are as follows:
[0174] Real-time collection of core data after treatment, including PQ indicators and operational constraints. PQ indicators include THD, voltage deviation, three-phase imbalance, etc., while operational constraints include line current, equipment capacity, etc., to assess whether the treatment effect meets the standards.
[0175] The state of the governance process Optimal action ,award As training samples, the policy network and value network are iteratively updated to optimize the decision-making logic.
[0176] The entire process of key links is iterated every 5 minutes to ensure that the governance strategy is continuously adapted to changes in the power grid operation status. Under the scenarios of ±15% load fluctuation and ±20% DG output fluctuation, the stability of the governance effect is ≥85%.
[0177] In summary, the power distribution network of a certain provincial industrial park covers 12 10kV lines, 3 photovoltaic power stations, and 26 industrial enterprises. Among them, 11 enterprises have nonlinear loads such as electric arc furnaces and frequency converters, which frequently experience power quality problems such as harmonic distortion and voltage dips, resulting in the shutdown of precision equipment and a decline in production efficiency. A precise governance solution is urgently needed.
[0178] The method of this invention is applied to implement governance: First, voltage and current waveforms are collected at a sampling rate of 2kHz through a multi-source data acquisition module, SCADA data is updated every 100ms, and environmental data such as wind speed and temperature are collected every 1min. Static and text data such as equipment ledgers and scheduling logs are integrated simultaneously, and standardized datasets are formed after KNN interpolation and 3σ criterion preprocessing.
[0179] Based on this dataset, a dynamic PQ knowledge graph was constructed, defining five types of entities (line, load, equipment, etc.) and four types of relationships (topological connection, causal association, etc.). Cross-system entity alignment was achieved through an improved CEA model, and real-time data was dynamically mounted at a frequency of 100ms, with a single graph update taking 42ms. For detected THD exceeding the standard disturbance, GAF-LSTM was used to extract multimodal features, and a 256-dimensional entity embedding vector was generated through a 3-layer multi-relation GCN.
[0180] Candidate causes are screened within the 3-hop neighborhood of the PQ perturbation entity. The causal strength is quantified by conditional mutual information. False associations are eliminated by combining the backdoor criterion. The Top-3 root causes are output: Top-1 is the sudden increase in harmonic emission of nonlinear load of a steel company, Top-2 is the overload of Line-08, and Top-3 is the fluctuation of photovoltaic power output.
[0181] The policy network takes the disturbance and Top-1 root cause embedding vector, the target THD ≤ 5%, and operational constraints as inputs, and outputs the optimal action: the APF 3 / 5 / 7th harmonic compensation amounts are adjusted to 80% / 75% / 70% respectively, and two lightly loaded nodes on Line-08 are simultaneously transferred to adjacent lines. Real-time monitoring after the treatment shows that THD has dropped to 4.1%, and the voltage sag depth is ≤ 3%, fully meeting the standards.
[0182] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for precise management of power grid power quality, characterized in that, Includes the following steps: S1. Collect power quality monitoring data, SCADA data, static data, text data, environmental data, and operational constraint-related data. Perform missing value filling, outlier removal, and normalization on the collected raw data to obtain a standardized dataset. S2. Based on the standardized dataset output by S1, five types of entities are defined: line entities, load entities, equipment entities, power quality disturbance entities, and governance measures entities. Four types of relationships are defined: topology connection, power supply association, causal association, and governance association. An improved CEA model is used to align multi-source entities and dynamically mount real-time standardized data to the corresponding entities to form a time-updated graph structure. S3. Based on the dynamic power quality knowledge graph constructed in S2, for the voltage / current waveform signals of power quality disturbance entities, spatial features of power quality disturbance signals are extracted by GAF image encoding, temporal features are extracted by LSTM encoding, and multimodal fusion features are obtained by attention mechanism fusion. Based on the multi-relation GCN, graph convolution embedding is performed on the dynamic power quality knowledge graph to generate low-dimensional embedding vectors for each entity. S4. Using the low-dimensional embedding vectors of each entity generated in S3, candidate causal entities are screened in the 3-hop neighborhood of the PQ disturbance entity. The causal strength between the candidate causes and the power quality disturbance is quantified based on conditional mutual information. The backdoor criterion is used to eliminate false associations. The candidate causes are ranked by combining causal strength and path length. The Top-3 root causes and causal paths are output to clarify the root source and propagation path of the PQ disturbance. S5. Predefine the governance action space, construct a policy network with GCN-MLP hybrid architecture, take the power quality disturbance entity embedding vector, Top-1 root cause entity embedding vector, target power quality index and operation constraint related data as input, train the policy network by improving the PPO algorithm, output the optimal governance action and execute it. S6. Monitor power quality indicators and operational constraint data after governance in real time, and use the status, optimal action and reward in the governance process to form training samples to update the policy network and value network. Iterate from S2 to S5 every 5 minutes to dynamically adjust the governance strategy.
2. The method for precise management of power grid power quality according to claim 1, characterized in that, The power quality monitoring data mentioned in S1 includes voltage and current waveforms, total harmonic distortion, voltage sag depth, sag duration, and three-phase imbalance. The sampling rate of the voltage and current waveforms is 2kHz. The SCADA data includes line active power, line reactive power, bus voltage, switch status and transformer load rate, and the SCADA data is updated at a frequency of 100ms. The static data includes equipment ledgers and power grid topology. The equipment ledgers include rated parameters and installation locations. The power grid topology includes line connection relationships and voltage levels. The text data includes dispatch logs, fault work orders, and governance history records. The environmental data includes wind speed, light intensity, and temperature, and the environmental data is updated every 1 minute. The operational constraint data is divided into static constraint data and dynamic constraint data. Static constraint data is taken from static data and includes line rated current, equipment rated capacity, allowable range of bus voltage, and upper limit of DG rated output. Dynamic constraint data is taken from SCADA data and includes real-time line current, real-time equipment load rate, and real-time bus voltage.
3. The method for precise management of power grid power quality according to claim 2, characterized in that, The attributes of the line entity described in S2 include line ID, voltage level, resistance, reactance, length, and real-time current; The attributes of the load entity include load ID, load type, rated power and real-time harmonic emission level. The load type includes industrial, residential and impact. The real-time harmonic emission level is expressed as a percentage of total harmonic distortion. The attributes of the device entity include device ID, device type, rated capacity and real-time status. Device types include transformer, SVG and APF, and real-time status includes normal and abnormal. The attributes of the power quality disturbance entity include disturbance ID, disturbance type, occurrence time, and set of affected nodes. The disturbance type includes sag, harmonics, and imbalance, and the occurrence time is accurate to milliseconds. The attributes of the governance measure entity include measure ID, governance measure type, implementation cost, and effective time. Governance measure types include parameter adjustment and equipment switching. The four types of relationships are topology connection, power supply association, causal association and governance association. The topology connection represents the physical connection relationship between the line and the bus, and between the bus and the equipment. The power supply association represents the power supply relationship between the line and the load, and between the equipment and the load. The causal association represents the disturbance triggering relationship between the equipment and the disturbance, and between the load and the disturbance. The governance association represents the governance correspondence relationship between the measures and the disturbance, and between the measures and the equipment.
4. The method for precise management of power grid power quality according to claim 1, characterized in that, The improved CEA model described in S2 calculates entity similarity through four-dimensional similarity fusion. The four-dimensional similarity fusion formula is as follows: in, For structural similarity weights, For attribute similarity weights, Weighted by name similarity. The similarity weights for the PQ index are as follows: ; For topological similarity, cosine similarity is calculated after extracting features from adjacent subgraphs based on GCN; The attribute similarity is the reciprocal of the normalized Euclidean distance between the device's rated parameters and voltage level. Name similarity is calculated using edit distance, with the following formula: for and Edit distance, for Name length, for Name length; PQ index similarity, and total harmonic distortion rate and voltage deviation index Pearson correlation coefficient for entity association; The improved CEA model uses Softmax cross-entropy as the alignment loss function, and the formula is as follows: in, , For the two sets of data source entities to be aligned, For indicator functions, and When they are the same entity Otherwise, it is 0. For the temperature parameter, the model optimization objective is to minimize... .
5. The method for precise management of power grid power quality according to claim 4, characterized in that, The dynamic mounting described in S2 is achieved through entity attribute vectors, and the formula for entity attribute vectors is: in, These are static attributes of an entity, including attributes such as line resistance and equipment rated capacity, which are determined and do not change. These are dynamic attributes of the entity, including attributes such as real-time current and total harmonic distortion rate, which are updated every 100ms. The timestamp is used; the graph adopts an incremental update method, updating only the changed entity attributes and relationship strengths, and the time taken for a single update does not exceed 50ms.
6. The method for precise management of power grid power quality according to claim 1, characterized in that, The multimodal feature extraction described in S3 uses GAF image encoding to extract spatial features, combines LSTM encoding to extract temporal features, and fuses them through an attention mechanism; The steps of the GAF image encoding include: the first step is signal normalization, which involves converting the voltage sampling sequence... Mapping to the interval [-1, 1], the formula is: in, , The sampling length; The second step is polar coordinate transformation, the formula is: in, , The angle corresponding to the time series; The third step is to construct the Gram matrix, using the following formula: in, The fourth step involves extracting spatial features from the GAF image using a lightweight CNN, focusing on pixel values. The lightweight CNN comprises two convolutional layers and one pooling layer; The steps of the LSTM encoding include: first, sequence segmentation, and... By window size Divided into 64 segments; The second step is to update the 3-layer LSTM network. The network update formula is as follows: in, For input gate, For the Gate of Oblivion For output gate, It is a Sigmoid activation function and , In cellular state, In hidden state, , This is the weight matrix. For bias vectors, For element-wise product, Normalized voltage data for each segment; The third step is to retrieve the hidden state at the last moment. As a temporal characteristic The attention mechanism fusion formula is as follows: ; in, The attention weight is given by the following formula: ; The attention weight vector is used to output the fused features. .
7. The method for precise management of power grid power quality according to claim 6, characterized in that, The graph convolutional embedding described in S3 is based on a multi-relation GCN, which first constructs an initial node feature matrix: in, For the characteristics of power quality disturbance entities fusion, The attribute vectors of other entities are normalized to the interval [0,1]. The total number of non-power quality perturbation entities; the multi-relation GCN includes 3 layers of graph convolutional updates, the first... The layer update formula is: in, , For relationship The normalized adjacency matrix, For relationship The adjacency matrix, for The degree matrix, For relationship A dedicated weight matrix, For globally shared weight matrix, The LeakyReLU activation function is The output of the graph convolution embedding includes power quality perturbation entity embedding. Other entity embeddings , This is the index of the entity in the initial node feature matrix.
8. The method for precise management of power grid power quality according to claim 1, characterized in that, The causal strength quantification described in S4 is based on conditional mutual information, and the formula for conditional mutual information is: in, For power quality disturbance entities, As a candidate cause entity, It is a mixed variable that includes three core variables: operating scenario type, bus voltage level, and total DG output. For conditional entropy and , For expectation operator, The conditional probability density is solved using the k=5 nearest neighbor estimation algorithm, and the solution is based on the entity embedding of power quality perturbation. Candidate reason entity embedding and hybrid variable embedding The causal strength is normalized, and the normalization formula is: in, For the set of candidate reasons, , A larger value indicates a candidate reason With disturbance The more significant the causal relationship, the better.
9. The method for precise management of power grid power quality according to claim 8, characterized in that, The spurious association elimination described in S4 is based on the backdoor criterion, which checks for the existence of backdoor paths for the top 5 candidate causes with the strongest causality. If it exists, adjust the set of promiscuous variables to... Recalculate conditional mutual information And update the causal strength After adjustment The entity; the root cause ranking combines causal strength and path length, and the ranking score formula is: in, for and The shortest path length, The threshold for the number of hops is used to output the top-3 root cause entities and causal paths. The Top-3 root cause entities contain the entity embeddings for each root cause, such as the Top-1 entity embeddings. Top-2 entity embedding Top-3 entity embedding All are 256-dimensional; the Top-3 root cause entities also contain causal path information and causal strength scores. .
10. The method for precise management of power grid power quality according to claim 9, characterized in that, The governance action space described in S5 includes six types of governance actions, namely: SVG reactive power output adjustment APF harmonic compensation adjustment OLTC gear adjustment Load transfer, DG active power output limit and Interconnection switch on / off; middle kVar, adjust the step size to 50kVar; middle %, For the 3rd, 5th, and 7th harmonics, adjust the step size to 10%; middle Each voltage setting has a range of ±0.5% adjustment. middle A maximum of 3 load nodes can be transferred; middle %, is a percentage limit based on rated output; middle 0 indicates open, 1 indicates closed, and a maximum of 2 switches can be operated at a time; The policy network is a GCN-MLP hybrid architecture, with state input. ,in For the embedding of the top-1 root cause entity, The target power quality index; The constraint vector is formed by splicing the standardized static constraint data output by S1 with the real-time dynamic constraint data, and includes constraints such as the upper limit of line current, equipment capacity limit, and DG output range. The policy network output formula is: The normalized adjacency matrix is used; the reward function formula is: in, , , To improve power quality indicators before the treatment, To determine the power quality indicators after the treatment, To achieve the target improvement, , For the set of actions to be performed, For the cost of action, To maximize the cost of action, , For line current exceeding the limit, For voltage exceeding the limit, For the corresponding constraint limits, , The policy network is trained using an improved PPO algorithm, with the objective function being: in, For policy network parameters, For parameters before the update, It is the dominant function and , For value networks, The subsequent state after the action is performed. As a discount factor, This is the cutting factor.