A power distribution network power quality disturbance perception method, electronic equipment, storage medium and product
By introducing a trend-aware window mechanism and a sparse query space attention strategy into the distribution network, the problems of extracting temporal features and computational complexity of power quality disturbances in new distribution networks are solved, enabling real-time and accurate perception of power quality disturbances and efficient source tracing of disturbances.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NARI TECH CO LTD
- Filing Date
- 2026-04-09
- Publication Date
- 2026-07-21
AI Technical Summary
Existing technologies for handling power quality disturbances in new distribution networks suffer from problems such as limited extraction of time-series features, excessive reliance on physical topology, and high computational complexity across the entire network, making it difficult to meet real-time requirements.
By introducing a trend-aware window mechanism and a sparse query space attention strategy, and by capturing multi-scale time-series waveform features and using a sparse attention module, the computational resource consumption is reduced, enabling real-time and accurate perception of power quality disturbances in large-scale distribution networks and efficient source tracing and localization.
It improves the perception accuracy of multi-scale time-series features, breaks through the bottleneck of computing power and topology dependence, realizes accurate identification of complex power quality disturbances and rapid source tracing of disturbances, and ensures the robustness of the model under complex working conditions.
Smart Images

Figure CN122437260A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of new power system technology, specifically a method, electronic device, storage medium and product for sensing power quality disturbances in distribution networks. Background Technology
[0002] New power distribution networks are gradually evolving into complex systems with a high proportion of distributed renewable energy sources (such as photovoltaics and wind power) and diverse new loads (such as electric vehicles and energy storage) deeply integrated. The randomness and volatility on both the source and load sides are significantly enhanced, leading to increasingly frequent and complex power quality problems such as voltage dips, short-term interruptions, and harmonic distortion. Accurate real-time sensing, propagation analysis, and source tracing of power quality disturbances are crucial for ensuring the safe and stable operation of the power distribution network.
[0003] Currently, the monitoring and analysis of power quality in distribution networks mainly relies on physical model-based methods and data-driven methods. Physical model-based methods (such as impedance analysis and state estimation methods) typically require accurate grid topology parameters and line impedance information. However, modern distribution networks operate flexibly, frequently undergoing topology reconfiguration via tie switches, making it difficult to obtain physical parameters in real time or introducing errors, thus limiting the practical application of such methods.
[0004] In recent years, with the improvement of intelligent measurement systems, data-driven methods based on deep learning (such as Convolutional Neural Networks (CNN), Recurrent Neural Networks (RNN), and Graph Neural Networks (GNN)) have gradually become a research hotspot. However, existing data-driven methods still face the following severe challenges when dealing with power quality problems in large-scale new distribution networks:
[0005] First, there are limitations to time-series feature extraction. Power quality disturbance data exhibits both millisecond-level transient waveform features (such as the drop edge of a voltage slump) and minute-level steady-state trend features (such as the periodic changes in photovoltaic output). Traditional RNN or LSTM models struggle to efficiently capture these multi-scale long- and short-term dependencies simultaneously, and are prone to gradient vanishing problems when processing long sequences, making it difficult to distinguish complex disturbance patterns with similar values but opposite trends.
[0006] Second, spatial modeling relies excessively on topology. Mainstream spatiotemporal graph neural network (ST-GNN) methods typically require a predefined, fixed adjacency matrix to describe the connections between nodes. As mentioned earlier, distribution network topologies change frequently, and the predefined static graph structure cannot reflect the real-time electrical connection status. Furthermore, multi-layer graph convolution operations can easily lead to "over-smoothing" of features, making it difficult for the model to distinguish the differences in disturbance characteristics between different nodes.
[0007] Third, the computational bottleneck of the entire network. Although the standard Transformer architecture can capture global spatial dependencies through self-attention mechanism, its computational complexity is quadratic with the number of nodes. As the number of monitoring nodes in the distribution network increases (reaching thousands or even tens of thousands), the attention computation of the entire network will consume huge amounts of computing resources and GPU memory, making it difficult to meet the stringent real-time requirements of online power quality monitoring, and also unable to quickly locate the critical path of disturbance propagation.
[0008] Therefore, there is an urgent need to develop a new method for sensing and tracing power quality disturbances in distribution networks that does not rely on precise physical topology, can efficiently process large-scale node data, and has the ability to extract multi-scale spatiotemporal features. Summary of the Invention
[0009] Purpose of the Invention: To address the problems of existing technologies in handling power quality disturbances in new distribution networks, such as single temporal feature extraction, over-reliance on physical topology, and high computational complexity across the entire network making it difficult to meet real-time requirements, this invention aims to provide a power quality disturbance sensing method, electronic device, storage medium, and product for distribution networks. By introducing a trend-aware window mechanism to accurately capture multi-scale temporal waveform features, and combining it with a sparse query space attention strategy, this invention significantly reduces computational resource consumption without requiring predefined precise topology, achieving real-time and accurate sensing of power quality disturbances in large-scale distribution networks and efficient source tracing and localization.
[0010] Technical solution: In a first aspect, the present invention proposes a method for sensing power quality disturbances in a distribution network, comprising:
[0011] The monitoring data collected in real time from the power distribution network is preprocessed to generate the input tensor for the current moment;
[0012] The input tensor is input into the power quality disturbance perception model, and the predicted power quality status of the distribution network at future time is output.
[0013] The power quality disturbance sensing model includes: multiple trend sensing window attention modules with different window lengths, a sparse query space attention module, a gated linear module, and an output module.
[0014] The trend-aware window attention module takes the input tensor as input, captures millisecond-level power quality disturbances, and outputs a time-series feature tensor.
[0015] The sparse query space attention module takes the temporal feature tensor as input, captures the spatial propagation path of power quality disturbances in the distribution network, and outputs the spatial feature tensor.
[0016] The temporal feature tensor and spatial feature tensor are residually added and normalized to obtain the fused intermediate feature tensor;
[0017] The gated linear module is used to perform gated filtering on the fused intermediate feature tensor to obtain the filtered feature tensor.
[0018] The output module is used to map the filtered feature tensor back to the physical dimension of the power quality index space to obtain the predicted power quality status value.
[0019] Furthermore, the preprocessing includes:
[0020] A graph signal matrix is generated using monitoring data collected from the power distribution network. The graph signal matrix includes: electrical quantity characteristics and environmental and source load characteristics.
[0021] Based on the graph signal matrix, a spatiotemporal tensor is constructed;
[0022] The spacetime tensor is standardized to obtain a standardized spacetime tensor.
[0023] Based on learnable intraday time embedding dictionaries and intraweek date embedding dictionaries, the corresponding embedding vectors are retrieved from the timestamps of the monitoring data collected from the distribution network and concatenated to generate a time embedding tensor.
[0024] The input tensors include: a standardized spatiotemporal tensor and a temporal embedding tensor.
[0025] Furthermore, the trend-aware window attention module uses one-dimensional convolution to generate query and key vectors, and extracts multi-scale temporal waveform features of the input tensor through a sliding window mechanism to obtain a temporal feature tensor.
[0026] Furthermore, the trend-aware window attention module uses one-dimensional convolution to generate query and key vectors, and extracts multi-scale temporal waveform features of the input tensor through a sliding window mechanism to obtain a temporal feature tensor, including:
[0027] A high-dimensional spatiotemporal hidden layer representation is obtained by transforming the standardized spatiotemporal tensor through a linear projection layer.
[0028] A convolution operation is performed on the convolution kernel parameters of the one-dimensional convolutional neural network and the high-dimensional spatiotemporal hidden layer representation to generate a query tensor and a key tensor. A value tensor is generated using the high-dimensional spatiotemporal hidden layer through a linear transformation.
[0029] The entire time series length is divided into multiple non-overlapping time windows. Within each independent time window, dot product attention is calculated using the corresponding query tensor, key tensor, and value tensor to obtain the attention output tensor for each time window.
[0030] The attention output tensors of all time windows are reassembled along the time dimension to restore the original time series length. Then, the temporal embedding tensor is fused with the concatenated attention output tensor through an output linear projection layer to obtain the temporal feature tensor.
[0031] Furthermore, the sparse query spatial attention module takes the temporal feature tensor as input, captures the spatial propagation path of power quality disturbances in the distribution network, and outputs a spatial feature tensor, including:
[0032] Using the aforementioned temporal feature tensor, the information entropy of each node in the entire network is calculated; based on the information entropy, all nodes in the network are divided into key nodes and passive query nodes.
[0033] For critical nodes, perform full standard attention computation to obtain the attention features of the critical nodes;
[0034] For a passive query node, identify the key node with the strongest relevance to it, and use the attention feature of the key node as the attention feature of the passive query node.
[0035] The attention features of key nodes and passive query nodes are recombined in the original node order to output a spatial feature tensor.
[0036] Furthermore, the information entropy of each node in the entire network is calculated using the temporal feature tensor; based on the information entropy, key nodes are selected from all nodes in the network, including:
[0037] The temporal feature tensor is linearly transformed to map to the spatial attention subspace, generating the query matrix, key matrix, and value matrix of all network nodes;
[0038] Randomly sample the key matrices of several nodes from the key matrix of all nodes in the network to form a reference key set;
[0039] Calculate the dot product correlation between the query vector of each node in the entire network and the reference key set to obtain the correlation score matrix;
[0040] Based on the aforementioned correlation scoring matrix, the probability distribution is obtained;
[0041] Based on the probability distribution, calculate the information entropy of the query vector for each node in the entire network;
[0042] Based on the information entropy, all nodes in the network are sorted in ascending order, and the nodes with the smallest entropy values are selected as the key node set, while the remaining nodes are selected as the passive query node set.
[0043] Furthermore, the gated linear module is used to perform gated filtering on the fused intermediate feature tensors to obtain filtered feature tensors, including:
[0044] The gated linear module includes two parallel linear transformation paths. One linear transformation path is used to extract the content information of the fused intermediate feature tensor, and the other linear transformation path generates control gating through the Sigmoid activation function. The two are then multiplied element-wise to generate the filtered feature tensor.
[0045] Furthermore, it also includes:
[0046] The attention features of all network nodes are extracted from the sparse query space attention module in the power quality disturbance perception model.
[0047] Based on the attention characteristics of key nodes, determine the source of disturbances to the distribution network quality;
[0048] Construct a directed graph of perturbation propagation from passive query nodes to key nodes, and formulate an operation and maintenance plan based on the directed graph of perturbation propagation.
[0049] Secondly, the present invention provides an electronic device, the electronic device comprising:
[0050] At least one processor;
[0051] and a memory communicatively connected to the at least one processor;
[0052] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform a power quality disturbance sensing method for a power distribution network.
[0053] Thirdly, the present invention proposes a computer-readable storage medium storing computer instructions for causing a processor to execute a method for sensing power quality disturbances in a power distribution network.
[0054] Fourthly, the present invention proposes a computer program product, which includes a computer program that, when executed by a processor, implements a method for sensing power quality disturbances in a power distribution network.
[0055] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0056] (1) The method of the present invention improves the perception accuracy of multi-scale time-series features, including: through the trend perception window mechanism, it can simultaneously capture millisecond-level transient waveforms and minute-level steady-state trends, solve the problem of misjudgment caused by the coupling of source load fluctuations and fault features in the new distribution network, and significantly improve the recognition accuracy of complex power quality disturbances;
[0057] (2) The method of the present invention breaks through the bottleneck of computing power and topology dependence, including adopting a sparse query space attention strategy, abandoning the dependence on precise physical topology, and reducing the computational complexity of the whole network correlation analysis to the level, making it possible to carry out real-time online monitoring and anti-topology reconfiguration analysis in large-scale distribution networks.
[0058] (3) The method of the present invention achieves accurate source tracing and noise reduction of disturbance sources, including: by utilizing the directional nature of sparse attention weights, it is possible to intuitively trace the disturbance propagation path and locate the source node, thus realizing "perception is source tracing"; at the same time, combined with the gating fusion mechanism, it effectively filters out on-site measurement noise and ensures the robustness of the model under complex working conditions. Attached Figure Description
[0059] Figure 1 This is a flowchart illustrating a power quality disturbance sensing method for a distribution network proposed in this invention.
[0060] Figure 2 This is a diagram illustrating the overall framework of the power quality disturbance sensing model proposed in this invention.
[0061] Figure 3 This is a flowchart illustrating the model training and online application execution process of the method of this invention. Detailed Implementation
[0062] The technical solution of the present invention will now be further described in conjunction with the accompanying drawings and embodiments.
[0063] Example 1
[0064] like Figure 1 As shown in the figure, this invention proposes a novel power quality disturbance sensing method for distribution networks based on spatiotemporal sparse attention, including:
[0065] Step 1: Collect power quality time-series data and source-load environmental characteristic data of each monitoring node in the distribution network, perform preprocessing and time embedding coding, and construct a historical spatiotemporal training sample set.
[0066] This step aims to establish a mathematical model of the power distribution network and process multi-source heterogeneous data to provide standardized input for subsequent deep learning models. Specifically, it includes the following sub-steps:
[0067] S100: Define the distribution network topology structure, including: abstracting the new distribution network into a directed graph structure. ,in, Let N represent the set of all monitoring nodes in the distribution network, where N is the total number of monitoring nodes in the distribution network, and E represents the set of electrical connection edges between the monitoring nodes.
[0068] S110: Construct the power quality characteristic matrix, including:
[0069] Based on the distribution network topology, at each sampling time t, the power quality and source-load characteristic data of all network nodes are denoted as a graph signal matrix. ,in, The input feature dimension for each node comprises two parts: electrical quantity features and environmental and source load features. Electrical quantity features include three-phase voltage amplitude, current, total harmonic distortion (THD), and three-phase imbalance. Environmental and source load features include the area's illuminance, wind speed, and node load power.
[0070] If the length of the historical observation window is set to T, then the original historical spatiotemporal tensor is constructed. Represented as:
[0071]
[0072] S120: Data standardization preprocessing, including:
[0073] Due to the significant differences in the dimensions of data such as voltage, harmonics, and illumination, it is necessary to modify the original historical spatiotemporal tensor. Z-score normalization is performed to obtain the normalized spacetime tensor. :
[0074]
[0075] In the formula, These are indices representing time, node, and feature dimension, respectively. and These are the mean and standard deviation of the k-th feature on the training set, respectively. This is the standardized spacetime tensor.
[0076] S130: Construct source payload temporal embeddings, including:
[0077] To enable the model to perceive the periodic patterns of renewable energy output and load changes, a time-series embedding representation needs to be constructed. Two learnable embedding dictionaries are defined: an intraday time-series embedding dictionary. and weekday date embedding dictionary Based on the timestamps of the input data, the corresponding embedding vectors are retrieved and concatenated to generate a temporal embedding tensor. :
[0078]
[0079] In the formula, N day d represents the total number of sampling points in a day. emb The dimension of the embedded vector. This is the intraday time index sequence corresponding to the input sequence. The input sequence is the index sequence of the "day of the week" corresponding to the input sequence. To perform a table lookup operation, and broadcast along node dimension N, ensuring that the time feature covers all nodes in the network. This refers to the splicing operation along the feature dimension.
[0080] Finally, step 1 outputs the standardized spacetime tensor. and temporal embedding tensor This serves as the input for subsequent deep learning models.
[0081] Step 2: Construct a trend-aware window attention module, using one-dimensional convolution to generate query and key vectors, and extracting multi-scale time-series waveform features from the sample set through a sliding window mechanism. This includes:
[0082] First, the standardized spacetime tensor constructed in step 1... The input is fed into the trend-aware window attention module. To map the original physical quantities to a high-dimensional feature space, the normalized input tensor is first processed through a linear projection layer. The transformation yields a high-dimensional spatiotemporal hidden layer representation. The calculation formula is:
[0083]
[0084] In the formula, and These are the learnable weight matrix and bias vector, respectively. This represents the feature channel dimension within the model.
[0085] Next, in order to effectively capture the local waveform trends in the power quality data of the distribution network, this embodiment of the invention improves the traditional method of generating query and key vectors using Transformer, and adopts a one-dimensional convolutional neural network (1D-CNN) to represent the high-dimensional spatiotemporal hidden layer along the time dimension. Perform feature extraction. Define the convolution kernel parameters as follows: and The convolution kernel size is k. Convolution operations are performed to generate the query tensor Q and the key tensor K, respectively. The calculation formula is as follows: as well as This convolution-based generation method utilizes the local receptive field of the convolution kernel, enabling the generated Q and K to sense and encode local rising or falling trends in the voltage and current sequences, thereby distinguishing perturbation states with similar values but opposite trends. Simultaneously, a value tensor is generated through linear transformation. ,in This is the weight matrix.
[0086] Subsequently, to reduce the computational complexity of long sequences and focus on local temporal dependencies, a sliding window mechanism is introduced. The entire historical observation window length T is divided into M non-overlapping time windows, each with a time length of w, i.e. For the m-th time window, extract the corresponding local query from the slice of the global tensor. Local bonds Local values Dot product attention is performed within each independent window to capture the power quality perturbation characteristics within that window period. The attention output for the m-th window is... The calculation is as follows:
[0087]
[0088] In the formula, This indicates the transpose operation. This is a scaling factor used to prevent the gradient vanishing problem caused by excessively large dot product results.
[0089] Finally, the attention outputs of all M windows are reassembled along the time dimension to restore the original time length T, and then passed through an output linear projection layer. Feature fusion is performed. To incorporate the temporal regularity of the source load environment into the perturbation features, the temporal embedding tensor generated in step 1 is used. Concatenating the attention output with the input yields a comprehensive temporal feature tensor that incorporates trend perception and periodic patterns. This serves as the input for subsequent spatial propagation modules. By stacking multiple of these modules with different window lengths w, the model can simultaneously capture millisecond-level transient power quality disturbances and minute-level steady-state voltage deviations, enabling the extraction of multi-scale time-series waveform features.
[0090] Step 3: Construct a sparse query space attention module, filter high-activity key nodes based on entropy values, and calculate the interaction weights between active nodes and all nodes in the network to extract spatial propagation features. This includes:
[0091] The comprehensive time-series feature tensor from which time-series waveform features are extracted The input is fed into the sparse query space attention module, aiming to solve the problem of excessive computational complexity in the correlation analysis of all network nodes in large-scale new distribution networks, and to accurately capture the spatial propagation path of power quality disturbances in the network.
[0092] First, a linear transformation is performed on the comprehensive temporal feature tensor to map it to the spatial attention subspace, generating query matrices for all network nodes. Key matrix Sum matrix .
[0093] To identify key nodes (i.e., active nodes) that play a dominant role in perturbation propagation, this invention proposes a sparse measurement strategy based on information entropy. First, the key matrix of N nodes in the entire network... A subset of nodes is randomly sampled as the reference key set. The number of samples is set to Where c is a constant coefficient, logarithmic sampling significantly reduces the computational dimensionality. Next, the query vector for each node in the entire network is calculated. With reference key set The dot product correlation is used to obtain the correlation score matrix, and then the Softmax function is used to transform it into a probability distribution P. ij :
[0094]
[0095] Based on this probability distribution, calculate the information entropy of the query vector for each node. :
[0096]
[0097] Information entropy The physical meaning corresponds to the degree of concentration of disturbance perception at distribution network nodes.
[0098] Based on the calculated entropy value Sort all nodes in the network in ascending order and select the top U nodes with the smallest entropy values as the key node set. The remaining nodes form a set of passive query nodes. For key nodes, a full standard attention computation is performed, aggregating the spatial features of the entire network to capture global perturbation propagation dependencies, and their attention features... for:
[0099]
[0100] For passive query nodes, complex attention calculations are no longer performed. Instead, based on the correlation matrix between the node and the key nodes, the index idx of the key node with the strongest correlation is found, and the attention output of that key node is directly used as the feature approximation value of the passive node. Finally, the attention features of key nodes and passive query nodes are reassembled in the original node index order to output a feature tensor containing spatial propagation information. This step, while ensuring the capture of global spatial dependencies across the entire network, reduces the computational complexity from O(N^2) to O(N^2). 2 The computation time was reduced to O(N logN), enabling efficient perception and source analysis of power quality disturbances in large-scale distribution networks.
[0101] Step 4: Use gated linear units to fuse and denoise the extracted spatiotemporal features, and connect them to the output layer of a multilayer perceptron to establish a complete power quality disturbance perception model for the distribution network.
[0102] To deeply integrate the spatial propagation features extracted by the sparse spatial attention module with the temporal trend features extracted in step 2, and to effectively filter out the random measurement noise commonly found in distribution network field monitoring data, a robust perception model is established. This step introduces residual connections and gated linear units (GLUs). First, the feature tensor containing spatial propagation information output in step 3 is... The temporal feature tensor output in step 2 By performing residual summation and layer normalization, the fused intermediate feature tensor is obtained. This is to address the gradient degradation problem in deep network training.
[0103] Subsequently, a GLU gating layer is constructed to denoise and filter the features. The GLU comprises two parallel linear transformation paths: one path extracts content information, and the other generates a control gating function using a sigmoid activation function. The two paths are then multiplied element-wise. The calculation formula is as follows:
[0104]
[0105] In the formula, , and The weight matrix is a learnable matrix. It is the Sigmoid activation function. It represents the Hadamaji.
[0106] Finally, the feature tensors after gating are... The input is fed into the output layer. The output layer consists of two fully connected neural networks that map the high-dimensional hidden feature space back to the physical-dimensional power quality index space. The output prediction is calculated as follows: ,in For the final generated prediction tensor, T out For the predicted future time step, C out This refers to the dimensions of the output power quality indicators.
[0107] Step 5: Input the historical spatiotemporal training sample set into the power quality disturbance perception model, calculate the average absolute percentage error and comprehensive loss between the predicted output and the true value, and iteratively update the model parameters through the backpropagation algorithm;
[0108] This step aims to use the constructed historical spatiotemporal training sample set to perform supervised learning training on the power quality disturbance sensing model, so that the model parameters converge to the optimal solution. The specific implementation process is as follows:
[0109] First, the historical spatiotemporal training sample set constructed in step 1 is divided into a training set, a validation set, and a test set. Using a mini-batch stochastic gradient descent or Adam optimizer strategy, a batch of input samples is randomly drawn from the training set each time. The input is fed into the model established in step 4, and the predicted output tensor for this batch is calculated through forward propagation. .
[0110] Next, the error between the predicted output and the true value is calculated. To balance the absolute prediction accuracy and sensitivity to the relative trend of power quality disturbance amplitude, this invention constructs a comprehensive loss function, which is composed of a weighted average absolute percentage error (MAPE) term and an average absolute error (MAE) term. Let the total number of samples in the batch be M, and the true value of the i-th sample be Y. i The predicted value is The loss terms are defined as follows:
[0111] Mean Absolute Percentage Error (MAPE) measures the relative deviation of a predicted value. For indicators such as voltage sags, the percentage error better reflects the severity of the deviation. The calculation formula is:
[0112]
[0113] Mean Absolute Error (MAE) measures the absolute deviation of predicted values, ensuring numerical stability during the initial training phase. The formula is:
[0114]
[0115] Comprehensive loss function :
[0116]
[0117] In the formula, and To balance the weighting coefficients of relative error and absolute error, This is an L2 regularization term used to constrain model parameters. This reduces the complexity of the model and prevents it from overfitting with small sample sizes.
[0118] Finally, the backpropagation algorithm is executed. Based on the calculated comprehensive loss... The gradient of each learnable parameter in the model is calculated using the chain rule. The model parameters are iteratively updated using the Adam optimization algorithm according to the following formula:
[0119]
[0120] In the formula, For learning rate, and These are the first-order moment estimates and second-order moment estimates of the gradient, respectively. Repeat the above process until the overall loss no longer decreases on the validation set or reaches the preset number of iterations. Save the optimal model parameters to complete training.
[0121] Step 6: Input the real-time monitoring data collected from the distribution network into the trained power quality disturbance perception model, output the predicted power quality status value, and locate the key nodes of disturbance propagation based on sparse attention weights.
[0122] This step deploys the trained model to the edge computing terminal or cloud master station of the distribution network to perform real-time monitoring tasks. First, it accesses the latest monitoring data from each node of the distribution network in real time, preprocesses it according to the method described in step 1, and generates the input tensor for the current moment. This tensor is then input into the trained power quality disturbance perception model. After forward computation, the predicted power quality status of all nodes in the network at future moments is directly obtained at the output layer, providing early warnings for operation and maintenance personnel.
[0123] Simultaneously, to achieve source localization of disturbances, an attention weight matrix is extracted from the sparse query space attention module in step 3 of the model. The focus is on analyzing the attention distribution of "active nodes" to "passive nodes":
[0124] (1) Key node identification: If an active node receives a high amount of attention weight from multiple passive nodes downstream, it indicates that the node is the dominant player in the current network information flow, and is therefore identified as the key source node for disturbance propagation.
[0125] (2) Propagation path backtracking: Based on the directionality of attention weight, a directed graph of disturbance propagation from passive nodes to active nodes is constructed to intuitively show the diffusion path of voltage sag or harmonic pollution in the distribution network, and to assist maintenance personnel in quickly cutting off fault sources or adjusting operation mode.
[0126] Example 2
[0127] The second embodiment of the present invention differs from the first two embodiments in that:
[0128] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion 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 described in the various embodiments of this 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.
[0129] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0130] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0131] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
Claims
1. A method for sensing power quality disturbances in a distribution network, characterized in that: include: The monitoring data collected in real time from the power distribution network is preprocessed to generate the input tensor for the current moment; The input tensor is input into the power quality disturbance perception model, and the predicted power quality status of the distribution network at future time is output. The power quality disturbance sensing model includes: multiple trend sensing window attention modules with different window lengths, a sparse query space attention module, a gated linear module, and an output module. The trend-aware window attention module takes the input tensor as input, captures millisecond-level power quality disturbances, and outputs a time-series feature tensor. The sparse query space attention module takes the temporal feature tensor as input, captures the spatial propagation path of power quality disturbances in the distribution network, and outputs the spatial feature tensor. The temporal feature tensor and spatial feature tensor are residually added and normalized to obtain the fused intermediate feature tensor; The gated linear module is used to perform gated filtering on the fused intermediate feature tensor to obtain the filtered feature tensor. The output module is used to map the filtered feature tensor back to the physical dimension of the power quality index space to obtain the predicted power quality status value.
2. The method for sensing power quality disturbances in a distribution network according to claim 1, characterized in that: The preprocessing includes: A graph signal matrix is generated using monitoring data collected from the power distribution network. The graph signal matrix includes: electrical quantity characteristics and environmental and source load characteristics. Based on the graph signal matrix, a spatiotemporal tensor is constructed; The spacetime tensor is standardized to obtain a standardized spacetime tensor. Based on learnable intraday time embedding dictionaries and intraweek date embedding dictionaries, the corresponding embedding vectors are retrieved from the timestamps of the monitoring data collected from the distribution network and concatenated to generate a time embedding tensor. The input tensors include: a standardized spatiotemporal tensor and a temporal embedding tensor.
3. The method for sensing power quality disturbances in a distribution network according to claim 2, characterized in that: The trend-aware window attention module uses one-dimensional convolution to generate query and key vectors, and extracts multi-scale temporal waveform features of the input tensor through a sliding window mechanism to obtain a temporal feature tensor.
4. The method for sensing power quality disturbances in a distribution network according to claim 3, characterized in that: The trend-aware window attention module uses one-dimensional convolution to generate query and key vectors, and extracts multi-scale temporal waveform features of the input tensor through a sliding window mechanism to obtain a temporal feature tensor, including: A high-dimensional spatiotemporal hidden layer representation is obtained by transforming the standardized spatiotemporal tensor through a linear projection layer. A convolution operation is performed on the convolution kernel parameters of the one-dimensional convolutional neural network and the high-dimensional spatiotemporal hidden layer representation to generate a query tensor and a key tensor. A value tensor is generated using the high-dimensional spatiotemporal hidden layer through a linear transformation. The entire time series length is divided into multiple non-overlapping time windows. Within each independent time window, dot product attention is calculated using the corresponding query tensor, key tensor, and value tensor to obtain the attention output tensor for each time window. The attention output tensors of all time windows are reassembled along the time dimension to restore the original time series length. Then, the temporal embedding tensor is fused with the concatenated attention output tensor through an output linear projection layer to obtain the temporal feature tensor.
5. The method for sensing power quality disturbances in a distribution network according to claim 4, characterized in that: The sparse query spatial attention module takes the temporal feature tensor as input, captures the spatial propagation path of power quality disturbances in the distribution network, and outputs a spatial feature tensor, including: Using the aforementioned temporal feature tensor, the information entropy of each node in the entire network is calculated; based on the information entropy, all nodes in the network are divided into key nodes and passive query nodes. For critical nodes, perform full standard attention computation to obtain the attention features of the critical nodes; For a passive query node, identify the key node with the strongest relevance to it, and use the attention feature of the key node as the attention feature of the passive query node. The attention features of key nodes and passive query nodes are recombined in the original node order to output a spatial feature tensor.
6. The method for sensing power quality disturbances in a distribution network according to claim 5, characterized in that: The information entropy of each node in the entire network is calculated using the temporal feature tensor. Based on the aforementioned information entropy, key nodes are selected from all network nodes, including: The temporal feature tensor is linearly transformed to map to the spatial attention subspace, generating the query matrix, key matrix, and value matrix of all network nodes; Randomly sample the key matrices of several nodes from the key matrix of all nodes in the network to form a reference key set; Calculate the dot product correlation between the query vector of each node in the entire network and the reference key set to obtain the correlation score matrix; Based on the aforementioned correlation scoring matrix, the probability distribution is obtained; Based on the probability distribution, calculate the information entropy of the query vector for each node in the entire network; Based on the information entropy, all nodes in the network are sorted in ascending order, and the nodes with the smallest entropy values are selected as the key node set, while the remaining nodes are selected as the passive query node set.
7. The method for sensing power quality disturbances in a distribution network according to claim 1, characterized in that: The gated linear module is used to perform gated filtering on the fused intermediate feature tensors to obtain filtered feature tensors, including: The gated linear module includes two parallel linear transformation paths. One linear transformation path is used to extract the content information of the fused intermediate feature tensor, and the other linear transformation path generates control gating through the Sigmoid activation function. The two are then multiplied element-wise to generate the filtered feature tensor.
8. The method for sensing power quality disturbances in a distribution network according to claim 5, characterized in that: Also includes: The attention features of all network nodes are extracted from the sparse query space attention module in the power quality disturbance perception model. Based on the attention characteristics of key nodes, determine the source of disturbances to the distribution network quality; Construct a directed graph of perturbation propagation from passive query nodes to key nodes, and formulate an operation and maintenance plan based on the directed graph of perturbation propagation.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, which is then executed by the at least one processor to enable the at least one processor to perform the power quality disturbance sensing method for the distribution network as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the power quality disturbance sensing method for a distribution network as described in any one of claims 1-8.
11. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the power quality disturbance sensing method for power distribution networks as described in any one of claims 1-8.