A power distribution network multi-harmonic source tracing quantification method, system, device and medium
By preprocessing and reconstructing two-dimensional spatiotemporal feature maps of power quality time series data of multiple nodes in the distribution network, and combining harmonic spatiotemporal feature extraction and bidirectional constraint optimization, the problem of tracing and quantifying responsibility of multiple harmonic sources in the existing technology has been solved. This has enabled accurate positioning and high-precision tracing of harmonic sources in the distribution network, meeting the needs of real-time monitoring and governance under complex operating conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WENZHOU ELECTRIC POWER BUREAU
- Filing Date
- 2026-05-09
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies rely on physical models or artificial feature priors for tracing and quantifying the responsibility of multiple harmonic sources in distribution networks. They lack generalization ability, cannot achieve end-to-end joint modeling of the coupling of time-domain dynamic characteristics and spatial propagation, have difficulty capturing fine-grained spatiotemporal correlations between multiple harmonic sources, and have poor decoupling ability in multi-source coupling scenarios. They cannot meet the engineering needs for precise harmonic control under complex distribution network conditions.
By preprocessing the collected power quality time series data of multiple nodes in the distribution network, a two-dimensional spatiotemporal feature map is reconstructed. Harmonic spatiotemporal features are jointly extracted to capture multi-scale local spatiotemporal features and global spatiotemporal correlation features of harmonics. Initial harmonic source location decoding results and responsibility quantification results are generated by using dual-branch shared features for joint decoding. Harmonic pollution source tracing quantification results are generated by combining bidirectional joint constraint optimization.
It achieves precise location and high-precision source tracing of harmonic sources, reduces false alarm rate, improves the accuracy of responsibility quantification in scenarios with strong coupling of multiple harmonic sources, and meets the engineering requirements of online real-time monitoring and closed-loop management of power distribution networks.
Smart Images

Figure CN122153351A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of harmonic monitoring technology in power distribution networks, and in particular to a method, system, equipment, and medium for tracing and quantifying multiple harmonic sources in power distribution networks. Background Technology
[0002] With the comprehensive advancement of the construction of new power systems, a large proportion of distributed new energy sources and high-density power electronic equipment are being connected to medium and low voltage distribution networks. These devices all have strong nonlinear operating characteristics, and during their operation, they continuously inject a large amount of harmonic and interharmonic currents into the grid, causing a series of problems such as grid voltage waveform distortion, which seriously threatens the safe and stable operation of the distribution network. Compared with the transmission network, the medium and low voltage distribution network has the characteristics of large node scale and frequent topological changes. Moreover, in engineering scenarios where multiple harmonic sources coexist, the harmonic currents emitted by harmonic sources at different locations will undergo complex superposition and coupling at the point of common coupling after propagation through the grid. Single-point monitoring alone cannot distinguish the pollution source of harmonic distortion, nor can it quantify the degree of contribution of each harmonic source to the distortion. Therefore, achieving accurate source tracing and positioning of multiple harmonic sources and quantifying the responsibility of each harmonic source for harmonic pollution has become a key technical support for carrying out precise harmonic governance.
[0003] However, traditional physical model-based methods heavily rely on accurate power grid topology and impedance parameters. In reality, frequent changes in distribution network topology, time-varying network impedance characteristics due to distributed generation switching, and measurement errors and aging biases in line parameters can easily lead to model mismatch, resulting in severe errors in location and quantification results. Furthermore, these methods have extremely high requirements for the number and location of monitoring devices. Given the large scale of distribution network nodes, installing high-precision power quality monitoring devices at all nodes is extremely costly. In scenarios with insufficient measurements, convergence or multiple solutions are prone to occur. Moreover, in scenarios with multiple harmonic sources superimposed and coupled, traditional methods cannot effectively decouple the independent contributions of different harmonic sources, achieving only coarse-grained location, which is insufficient to meet the engineering requirements of precise responsibility quantification and has extremely poor adaptability to unsteady harmonics. Additionally, traditional machine learning methods heavily rely on manual prior knowledge for feature extraction, and their model generalization ability is severely compromised when power grid conditions change. The current spatiotemporal modeling methods suffer from several shortcomings. They are fundamentally fragmented, mostly based on single-node features, failing to establish harmonic propagation relationships between multiple nodes. This results in a high misjudgment rate in multi-harmonic source scenarios and makes responsibility quantification difficult. Furthermore, deep learning-based spatiotemporal feature modeling methods employ a transformer-graph neural network fusion architecture. They extract harmonic amplitude and phase through Fast Fourier Transform (FFT), then use transformers to capture temporal dependencies, and rely on topological priors to construct a graph neural network for spatial modeling. However, this spatial modeling heavily relies on known topology, making it unsuitable for the frequent changes in distribution network structures. The initial FFT stage suffers from inherent distortions such as spectral leakage for unsteady harmonics, leading to the loss of fine-grained information. The shallow fusion of transformers and graph neural networks struggles to accurately model the fine-grained causal relationships of harmonic source emission, grid propagation, and node superposition. In multi-source coupling scenarios, decoupling capabilities are poor, and computational complexity is high, making it difficult to balance accuracy and real-time performance.
[0004] In summary, existing technologies for tracing and quantifying the responsibility of multiple harmonic sources in distribution networks suffer from several drawbacks. They rely heavily on physical models or prior knowledge of artificial features, have insufficient generalization capabilities, cannot achieve end-to-end joint modeling of the coupling between temporal dynamic characteristics and spatial propagation, struggle to capture fine-grained spatiotemporal correlations between multiple harmonic sources, and exhibit poor decoupling capabilities in multi-source coupling scenarios. These shortcomings make it difficult for existing technologies to meet the engineering requirements for precise harmonic control under complex distribution network conditions. Summary of the Invention
[0005] To address the above technical problems, this invention provides a method, system, equipment, and medium for tracing and quantifying multiple harmonic sources in power distribution networks.
[0006] In a first aspect, the present invention provides a method for tracing and quantifying multiple harmonic sources in a power distribution network, the method comprising the following steps: The collected power quality time series data of multiple nodes in the distribution network are preprocessed to obtain standardized multi-node time series data; The standardized multi-node time series data is reconstructed into a two-dimensional spatiotemporal feature map, and the two-dimensional spatiotemporal feature map is subjected to joint extraction of harmonic spatiotemporal features to obtain multi-scale harmonic local spatiotemporal features. Based on the local spatiotemporal characteristics of the multi-scale harmonics, the spatiotemporal propagation correlation and coupling characteristics of the harmonic wavelength range of multiple harmonic sources in the global spatiotemporal dimension are captured, and the global spatiotemporal correlation characteristics of harmonics are obtained. The multi-scale harmonic local spatiotemporal features and the harmonic global spatiotemporal correlation features are deeply fused across levels to obtain multi-scale spatiotemporal fusion features. Based on the multi-scale spatiotemporal fusion features, the initial harmonic source localization decoding result and the initial harmonic responsibility quantization result are generated synchronously through joint decoding of dual-branch shared features. The initial harmonic source location decoding result and the initial harmonic responsibility quantification result are subjected to bidirectional joint constraint optimization to generate the power distribution network harmonic pollution source tracing quantification result.
[0007] In a further implementation, the step of reconstructing the standardized multi-node time-series data into a two-dimensional spatiotemporal feature map includes: The standardized multi-node temporal data is linearly transformed by a single-point convolutional layer to obtain the initial feature tensor; Spatiotemporal prior knowledge is injected into the initial feature tensor by two-dimensional position encoding to obtain a spatiotemporally encoded feature tensor; The spatiotemporal encoded feature tensor is reconstructed into a two-dimensional spatiotemporal feature map with a preset number of feature channels as the channel dimension.
[0008] In a further implementation, the step of jointly extracting harmonic spatiotemporal features from the two-dimensional spatiotemporal feature map to obtain multi-scale harmonic local spatiotemporal features includes: The two-dimensional spatiotemporal feature map is subjected to multi-dimensional local feature extraction using a parallel multi-scale convolutional kernel group to obtain the initial local spatiotemporal features; By using a four-level downsampling hierarchy, the initial local spatiotemporal features are extracted and scaled stepwise to obtain multi-scale harmonic local spatiotemporal features. The parallel multi-scale convolution kernel group includes a single-row, three-column convolution kernel for capturing local temporal features of harmonic time dimension, a three-row, single-column convolution kernel for capturing local spatial features of observation node dimension, and a three-row, three-column convolution kernel for capturing local coupling features of harmonic spatiotemporal joint.
[0009] In a further implementation, the step of capturing the harmonic wavelength range spatiotemporal propagation correlation coupling characteristics of multiple harmonic sources in the global spatiotemporal dimension based on the multi-scale harmonic local spatiotemporal characteristics to obtain the global spatiotemporal correlation characteristics of harmonics includes: A three-layer stacked lightweight converter encoder is constructed; each layer of the lightweight converter encoder includes a multi-head self-attention mechanism, a feedforward neural network, layer normalization, and residual connections; The local spatiotemporal features of the multi-scale harmonics are divided into multiple non-overlapping local windows to obtain a subset of local spatiotemporal features; Calculate the node impedance based on the target distribution network topology and the target distribution network line transformer impedance parameters, and construct a normalized electrical distance matrix between different observation nodes; Based on the pre-set attention weight coefficients and attention bias base values, the normalized electrical distance matrix is converted into an electrical distance bias matrix, and a causal mask matrix is constructed based on the harmonic propagation time-series causal characteristics of the local spatiotemporal feature subset. In each layer of the lightweight converter encoder, the local spatiotemporal feature subset is self-attention calculated using a multi-head self-attention mechanism based on the electrical distance bias matrix and the causal mask matrix to obtain the self-attention output features. The self-attention output features of each lightweight converter encoder are sequentially input into a feedforward neural network, layer normalization, and residual connection for nonlinear feature transformation and gradient propagation. Through the three-layer stacked lightweight converter encoder, the long-range time dependence and propagation coupling features of multiple observation nodes in the global spatiotemporal dimension are extracted layer by layer to obtain the global spatiotemporal correlation features of harmonics.
[0010] In a further implementation, the step of performing cross-level deep fusion of the multi-scale harmonic local spatiotemporal features and the harmonic global spatiotemporal correlation features to obtain multi-scale spatiotemporal fused features includes: A bidirectional fusion architecture of a fusion feature pyramid network and a path aggregation network is constructed. The bidirectional fusion architecture is used to gradually fuse the global spatiotemporal correlation features of harmonics with the local spatiotemporal features of multi-scale harmonics through a top-down upsampling operation to obtain shallow fusion features. The shallow fusion features are gradually fused with the harmonic global spatiotemporal correlation features through a bottom-up downsampling operation to obtain global fusion features; By integrating the shallow fusion features and the global fusion features, a multi-scale spatiotemporal fusion feature is obtained.
[0011] In a further implementation, the step of synchronously generating the initial harmonic source localization decoding result and the initial harmonic responsibility quantization result based on the multi-scale spatiotemporal fusion features through joint decoding of dual-branch shared features includes: The multi-scale spatiotemporal fusion features are mapped to feature dimensionality reduction through convolutional layers and fully connected layers to generate node-level shared feature vectors. The node-level shared feature vectors are then input in parallel into the harmonic source localization branch and the harmonic responsibility quantization branch. In the harmonic source localization branch, a fully connected layer is used to perform harmonic source localization analysis on the node-level shared feature vector to obtain the initial harmonic source localization decoding result; the initial harmonic source localization decoding result includes the harmonic source confidence probability value, the harmonic source type, and the predicted value of the harmonic source emission characteristics; In the harmonic responsibility quantification branch, the absolute value of the harmonic contribution of each harmonic source to the single harmonic distortion is calculated based on the initial harmonic source localization decoding result and the node-level shared feature vector. The responsibility ratio of each harmonic source for single harmonic distortion is calculated based on the absolute value of the harmonic contribution, thus obtaining the single harmonic responsibility ratio. Based on the single harmonic responsibility ratio and the harmonic distortion rate of each harmonic voltage, calculate the comprehensive responsibility ratio of each harmonic source for the total harmonic distortion rate. By combining the absolute value of the harmonic contribution, the proportion of responsibility for a single harmonic, and the proportion of overall responsibility, the initial harmonic responsibility quantification result is obtained.
[0012] In a further implementation, the step of performing bidirectional joint constraint optimization on the initial harmonic source location decoding result and the initial harmonic responsibility quantification result to generate the power distribution network harmonic pollution source tracing quantification result includes: The theoretical contribution value of harmonic voltage generated by each harmonic source at the observation node is calculated based on the predicted value of the harmonic source emission characteristics, and the mean square error between the absolute value of the harmonic contribution and the theoretical contribution value of the harmonic voltage is calculated to obtain the physical constraint loss value of the harmonic source. The harmonic responsibility quantization branch is iteratively optimized using the physical constraint loss value of the harmonic source to obtain the harmonic responsibility quantization correction result. The observation nodes are screened based on the confidence probability value of the harmonic source and the preset confidence threshold to obtain a set of candidate harmonic source nodes; Based on the set of candidate harmonic source nodes, extract the comprehensive responsibility ratio of each candidate harmonic source node from the initial harmonic responsibility quantification results; The contribution weight of each harmonic source candidate node is obtained by normalizing the maximum value of the comprehensive responsibility ratio of the candidate nodes. The confidence probability value of the harmonic source is constrained and optimized using the contribution weight to obtain the optimized confidence value; The set of candidate harmonic sources is used to determine the actual harmonic source nodes based on the confidence optimization value, resulting in the set of harmonic source nodes optimized by bidirectional joint constraints. Extract the initial harmonic source location decoding results and the harmonic responsibility quantification correction results corresponding to the set of harmonic source nodes, and integrate them to generate the quantification results of harmonic pollution source tracing in the power distribution network.
[0013] Secondly, the present invention provides a multi-harmonic source tracing and quantification system for power distribution networks, the system comprising: The data acquisition module is used to preprocess the collected power quality time series data of multiple nodes in the distribution network to obtain standardized multi-node time series data. The local analysis module is used to reconstruct the standardized multi-node time series data into a two-dimensional spatiotemporal feature map, and to jointly extract harmonic spatiotemporal features from the two-dimensional spatiotemporal feature map to obtain multi-scale harmonic local spatiotemporal features. The global analysis module is used to capture the harmonic wavelength spatiotemporal propagation correlation and coupling characteristics of multiple harmonic sources in the global spatiotemporal dimension based on the local spatiotemporal characteristics of the multi-scale harmonics, and obtain the global spatiotemporal correlation characteristics of harmonics. The feature fusion module is used to perform cross-level deep fusion of the multi-scale harmonic local spatiotemporal features and the harmonic global spatiotemporal correlation features to obtain multi-scale spatiotemporal fused features. The decoding and quantization module is used to generate the initial harmonic source localization decoding result and the initial harmonic responsibility quantization result synchronously by jointly decoding the dual-branch shared features based on the multi-scale spatiotemporal fusion features. The constraint optimization module is used to perform bidirectional joint constraint optimization on the initial harmonic source location decoding result and the initial harmonic responsibility quantification result to generate the power distribution network harmonic pollution source tracing quantification result.
[0014] Thirdly, the present invention also provides a computer device, including a processor and a memory, the processor being connected to the memory, the memory being used to store a computer program, and the processor being used to execute the computer program stored in the memory, so that the computer device performs the steps of implementing the above-described method.
[0015] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0016] This invention provides a method, system, device, and medium for tracing and quantifying multiple harmonic sources in a distribution network. The method preprocesses collected power quality time-series data from multiple nodes in the distribution network to obtain standardized multi-node time-series data. This standardized multi-node time-series data is reconstructed into a two-dimensional spatiotemporal feature map, and harmonic spatiotemporal features are jointly extracted from the two-dimensional spatiotemporal feature map to obtain multi-scale local harmonic spatiotemporal features. Based on these multi-scale local harmonic spatiotemporal features, the harmonic wavelength-range spatiotemporal propagation correlation and coupling characteristics of multiple harmonic sources in the global spatiotemporal dimension are captured to obtain global harmonic spatiotemporal correlation features. The multi-scale local harmonic spatiotemporal features and the global harmonic spatiotemporal correlation features are deeply fused across levels to obtain multi-scale spatiotemporal fusion features. Based on these multi-scale spatiotemporal fusion features, initial harmonic source location decoding results and initial harmonic responsibility quantification results are synchronously generated through dual-branch shared feature joint decoding. The initial harmonic source location decoding results and the initial harmonic responsibility quantification results are then subjected to bidirectional joint constraint optimization to generate quantification results for harmonic pollution tracing in the distribution network. Compared with existing technologies, this method achieves accurate spatial location and high-precision source tracing of harmonic sources through a spatiotemporal correlation modeling architecture and a two-way joint constraint mechanism, reduces the false alarm rate of location and improves the accuracy of responsibility quantification in scenarios with strong coupling of multiple harmonic sources, thus meeting the engineering requirements of online real-time monitoring and closed-loop management of power distribution networks. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the process for tracing and quantifying multiple harmonic sources in a power distribution network provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the overall architecture of dual-branch joint constraint and reverse correction provided in an embodiment of the present invention; Figure 3 This is a block diagram of a power distribution network multi-harmonic source tracing and quantification system provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention.
[0018] Figure labeling: 101, Data acquisition module; 102, Local analysis module; 103, Global analysis module; 104, Feature fusion module; 105, Decoding and quantization module; 106, Constraint optimization module. Detailed Implementation
[0019] The embodiments of the present invention are described in detail below with reference to the accompanying drawings. The embodiments are given for illustrative purposes only and should not be construed as limiting the present invention. The accompanying drawings are for reference and illustration only and do not constitute a limitation on the scope of patent protection of the present invention, because many changes can be made to the present invention without departing from the spirit and scope of the present invention.
[0020] Figure 1This is a schematic diagram of the process for tracing and quantifying multiple harmonic sources in a distribution network according to an embodiment of the present invention. The present invention provides a method for tracing and quantifying multiple harmonic sources in a distribution network, such as... Figure 1 As shown, the method includes the following steps: S1. Preprocess the collected power quality time series data of multiple nodes in the distribution network to obtain standardized multi-node time series data.
[0021] This embodiment deploys power quality monitoring terminals within the target low-voltage distribution network, prioritizing deployment at the point of common coupling (PCC). Coupling (PCC), distributed renewable energy grid connection points, key nonlinear load access points, and feeder start and end nodes are among the observation nodes. The number of power quality monitoring terminals is controlled between three and ten to reduce hardware deployment costs. In this embodiment, the power quality monitoring terminals synchronously collect the instantaneous values of three-phase voltage and three-phase current of each observation node in the distribution network, using a sampling frequency of no less than 10 kHz to fully capture the dynamic characteristics of the 25th harmonic and below. All power quality monitoring terminals achieve high-precision time synchronization through BeiDou or Global Positioning System, with the synchronization error strictly controlled within one millisecond to ensure the consistency of the time base of the multi-node time series data. In this embodiment, the collected power quality time series data of the distribution network multi-node is transmitted to the data processing platform in real time via the power communication network. Then, in this embodiment, the data processing platform performs standardization preprocessing on the collected power quality time series data of the distribution network multi-node to obtain standardized multi-node time series data, thereby eliminating data noise, time asynchrony, and dimensionality issues. The impact of differences on the model is addressed through a preprocessing process. This process involves using the high-precision timestamps of each power quality monitoring terminal as a benchmark, and employing linear interpolation to align the power quality time series data of all observation nodes in the distribution network to a unified time axis. This eliminates spatiotemporal misalignments caused by acquisition delays and clock errors, ensuring that the sampled data from different nodes correspond one-to-one at the same time. Next, this embodiment uses the three-standard-deviation criterion to identify abnormal sampling points in the power quality time series data of the distribution network. Abnormal values and missing data caused by communication packet loss are filled in using linear interpolation of adjacent valid sampling points. Furthermore, the three-phase voltage and three-phase current data channels of each observation node are subjected to minimum-maximum normalization processing. This involves calculating the difference between the original sampled value and the minimum value of the time series data for that channel, and then dividing it by the difference between the maximum and minimum values of the time series data for that channel. This maps all values to a closed interval between zero and one, effectively eliminating the influence of dimensional differences and amplitude magnitudes. This results in standardized multi-node time series data, providing reliable data support for subsequent accurate location of harmonic sources and quantification of responsibility.
[0022] Based on this, to construct the structured samples required for model training, this embodiment uses a fixed time window to slide slice the preprocessed data during model training. The time window is set to 200 milliseconds (corresponding to ten power frequency cycles), and the sliding step size is set to 100 milliseconds. The dimension of each sample is the number of monitoring nodes multiplied by the number of sampling points within a single time window multiplied by six data channels. The six data channels correspond to three-phase voltage and three-phase current. In this embodiment, a supervision label is created for each sample. The sample supervision labels are generated in batches through an electromagnetic transient simulation platform and supplemented by manual verification through on-site measured events. The sample supervision labels include whether each node is a harmonic. The model includes binary labels for the source, labels for the nonlinear load type corresponding to the non-harmonic source (such as distributed photovoltaic inverters, electric vehicle charging piles, etc.), the true values of the amplitude and phase of the second to twenty-fifth harmonic currents emitted by the harmonic source, the contribution of each harmonic source to the harmonic voltage distortion of the common connection point and each observation node, the responsibility ratio of a single harmonic and the comprehensive responsibility ratio of the total harmonic distortion rate. In this embodiment, the completed full sample set is divided into training set, validation set and test set according to the proportion. The training set is augmented with data operations such as adding Gaussian white noise, time series micro-shift, and amplitude random scaling to improve the robustness and generalization ability of the model to actual operating noise and fluctuations.
[0023] S2. The standardized multi-node time series data is reconstructed into a two-dimensional spatiotemporal feature map, and the two-dimensional spatiotemporal feature map is subjected to joint extraction of harmonic spatiotemporal features to obtain multi-scale harmonic local spatiotemporal features.
[0024] In some implementations, the step of reconstructing the standardized multi-node time-series data into a two-dimensional spatiotemporal feature map includes: The standardized multi-node temporal data is linearly transformed by a single-point convolutional layer to obtain the initial feature tensor; Spatiotemporal prior knowledge is injected into the initial feature tensor by two-dimensional position encoding to obtain a spatiotemporally encoded feature tensor; The spatiotemporal encoded feature tensor is reconstructed into a two-dimensional spatiotemporal feature map with a preset number of feature channels as the channel dimension.
[0025] This embodiment achieves deep fusion of local fine-grained harmonic features and global long-range spatiotemporal correlations by constructing an end-to-end spatiotemporal feature extraction architecture, completely eliminating the dependence on manual feature priors and topological priors. Specifically, for the input standardized multi-node time-series data containing N observation nodes, t consecutive sampling times, and six data channels (three-phase voltage and three-phase current), this embodiment performs a linear weighted transformation on the six data channels using a 1*1 single-point convolutional layer, mapping the low-dimensional channel dimension to a high-dimensional feature space (preferably mapped to 64-dimensional feature channels in this embodiment), thereby generating an initial feature tensor containing rich semantic information. Its dimension changes from the original number of observation nodes, time length, and six channels to the number of nodes, time length, and high-dimensional feature channels. Then, in order for the model to perceive the chronological order of time and the spatial topological relationship of nodes, this embodiment injects learnable temporal position codes and node position codes into the initial feature tensor, obtaining spatiotemporal codes. The spatiotemporal coding feature tensor consists of two parts: a temporal location coding tensor and a node location coding tensor. The former is used to mark the temporal sequence relationship between different sampling times, giving the model sensitivity to time series data. The latter is used to mark the relative spatial distribution relationship of each observation node, giving the model spatial perception of the power grid topology. It should be noted that this coding mechanism is data-driven. The model can learn the temporal pattern and spatial correlation through training, without relying on cumbersome prior topological information of the distribution network. Finally, in order to adapt to the processing requirements of the YOLO convolutional neural network for two-dimensional image format, this embodiment performs dimensional rearrangement and format reconstruction on the spatiotemporal coding feature tensor. The original three-dimensional data in the order of nodes, time, and channels is reshaped into a two-dimensional spatiotemporal feature map with the number of feature channels as the depth, the number of nodes as the height, and the time length as the width. This two-dimensional spatiotemporal feature map can ensure that the inherent structure of these data in time and space is accurately captured and expressed while retaining the multi-node full network temporal sequence information.
[0026] After completing the spatiotemporal encoding and two-dimensional feature map reconstruction of standardized multi-node time-series data, in order to accurately capture the local fine-grained dynamic information of distribution network harmonic signals in both spatiotemporal dimensions, and addressing the limitation of traditional convolutional networks in effectively handling both time series and spatial node relationships simultaneously, this embodiment introduces an improved lightweight YOLOv8 backbone network to capture the multi-scale local spatiotemporal features of harmonic signals, fully preserving the fine-grained dynamic information of harmonics. Specifically, considering the dual characteristics of distribution network harmonic signals in both time and space dimensions, this embodiment improves the convolutional module of the lightweight YOLOv8 backbone network, designing a parallel multi-scale convolutional kernel group. The parallel multi-scale convolutional kernel group includes a 1×3 convolutional kernel and 3... The system employs a 1×1 convolutional kernel and a 3×3 convolutional kernel. The 1×3 kernel is used to capture local temporal features in the harmonic time dimension, accurately extracting transient changes and fluctuation characteristics of harmonic signals within a single observation node. The 3×1 kernel is used to capture local spatial features in the observation node dimension, extracting harmonic coupling and spatial distribution characteristics between different observation nodes at the same time. The 3×3 kernel is used to capture local coupling features of harmonic spatiotemporal joint, mining harmonic correlation characteristics within a small spatiotemporal dimension. This embodiment overcomes the inherent defects of traditional single-stage target detection networks, which are only suitable for image spatial feature extraction and cannot specifically capture temporal-node two-dimensional spatiotemporal features, through the parallel design of the above-mentioned multi-scale convolutional kernels.
[0027] This embodiment utilizes the aforementioned parallel multi-scale convolutional kernel group to extract multi-dimensional local features from the two-dimensional spatiotemporal feature map, obtaining initial local spatiotemporal features. Based on this, this embodiment sets up an improved lightweight YOLOv8 backbone network with a four-level cascaded downsampling hierarchy. This four-level downsampling hierarchy is used to perform step-by-step feature extraction and scale transformation on the initial local spatiotemporal features, obtaining multi-scale harmonic local spatiotemporal features. In this embodiment, each downsampling hierarchy consists of a lightweight C2F module (Cross Stage Partial Network). The Fusion architecture reduces the number of model parameters and computational complexity while ensuring efficient feature gradient propagation and cross-level fusion capabilities. A four-level downsampling hierarchy sequentially downsamples the input 2D spatiotemporal feature map by 4x, 8x, 16x, and 32x, outputting four sets of harmonic local spatiotemporal features at different scales. The 4x downsampled harmonic local spatiotemporal features are shallow, fine-grained features that retain rich high-frequency details and fully reproduce fine-grained information such as harmonic transient changes and interharmonics. The 8x and 16x downsampled harmonic local spatiotemporal features are... The mid-level features, with harmonic local spatiotemporal features downsampled by 8x and 16x, accurately capture the mesoscale dynamic changes of harmonics; the harmonic local spatiotemporal features downsampled by 32x are deep-level features, effectively extracting the steady-state characteristics and large-scale local spatial correlation features of harmonics. This embodiment, through the above-mentioned multi-scale hierarchical feature extraction design, fully covers harmonic features of different time scales and different spatial ranges, solving the problem that fine-grained harmonic information is easily lost in the traditional pre-feature extraction process, and providing a rich and discriminative local feature foundation for subsequent long-range spatiotemporal correlation modeling.
[0028] S3. Based on the local spatiotemporal characteristics of the multi-scale harmonics, capture the spatiotemporal propagation correlation and coupling characteristics of the harmonic wavelength range of the multi-harmonic sources in the global spatiotemporal dimension to obtain the global spatiotemporal correlation characteristics of the harmonics.
[0029] In some implementations, the step of capturing the harmonic wavelength range spatiotemporal propagation correlation coupling characteristics of multiple harmonic sources in the global spatiotemporal dimension based on the multi-scale harmonic local spatiotemporal characteristics to obtain the global spatiotemporal correlation characteristics of harmonics includes: A three-layer stacked lightweight converter encoder is constructed; each layer of the lightweight converter encoder includes a multi-head self-attention mechanism, a feedforward neural network, layer normalization, and residual connections; The local spatiotemporal features of the multi-scale harmonics are divided into multiple non-overlapping local windows to obtain a subset of local spatiotemporal features; Calculate the node impedance based on the target distribution network topology and the target distribution network line transformer impedance parameters, and construct a normalized electrical distance matrix between different observation nodes; Based on the pre-set attention weight coefficients and attention bias base values, the normalized electrical distance matrix is converted into an electrical distance bias matrix, and a causal mask matrix is constructed based on the harmonic propagation time-series causal characteristics of the local spatiotemporal feature subset. In each layer of the lightweight converter encoder, the local spatiotemporal feature subset is self-attention calculated using a multi-head self-attention mechanism based on the electrical distance bias matrix and the causal mask matrix to obtain the self-attention output features. The self-attention output features of each lightweight converter encoder are sequentially input into a feedforward neural network, layer normalization, and residual connection for nonlinear feature transformation and gradient propagation. Through the three-layer stacked lightweight converter encoder, the long-range time dependence and propagation coupling features of multiple observation nodes in the global spatiotemporal dimension are extracted layer by layer to obtain the global spatiotemporal correlation features of harmonics.
[0030] After extracting multi-scale harmonic local spatiotemporal features using an improved lightweight YOLOv8 backbone network, this embodiment constructs a long-range spatiotemporal correlation modeling unit based on a lightweight Transformer encoder to further capture the long-range propagation coupling characteristics and complex time dependencies of multiple harmonic sources in the global spatiotemporal dimension. This aims to solve the feature decoupling problem in multi-harmonic source superposition scenarios. The long-range spatiotemporal correlation modeling unit first selects a 32x downsampled deep feature of the multi-scale harmonic local spatiotemporal features as input. This 32x downsampled deep feature contains rich global coarse-grained spatiotemporal semantics. In the specific implementation, this embodiment uses a window-based multi-head self-attention mechanism to divide the input 32x downsampled deep feature into multiple non-overlapping local windows, obtaining a subset of local spatiotemporal features. Within each local window, the local spatiotemporal feature subset is further processed. This implementation uses self-attention computation to extract local spatiotemporal correlations and introduces a cross-window connection mechanism to enable information interaction between different local windows. This reduces the computational complexity from quadratic to linear, improving inference efficiency. To ensure the attention mechanism accurately matches the physical propagation laws of harmonics in the power grid, this embodiment improves the self-attention computation process. It incorporates spatial propagation attenuation constraints and temporal causality constraints on top of standard multi-head self-attention, using the electrical distance between nodes as an optional bias term. It does not rely on precise power grid topology and parameters, and thus learns the correlation weights of harmonic characteristics between different nodes through data-driven autonomous learning. This accurately models the full-link causal correlation of harmonic source emission, power grid propagation, and multi-node superimposed response, providing core support for subsequent multi-harmonic source decoupling. Specifically, for the h-th attention head, its self-attention computation process is as follows: In this embodiment, the query matrix and the transpose of the key matrix are multiplied to obtain the attention score matrix. Then, the attention score matrix is scaled by dividing it by the square root of the single attention head feature dimension to stabilize the gradient. Subsequently, an electrical distance bias matrix and a causal mask matrix are added. Finally, after activation by a normalized exponential function, the matrix is multiplied by the value matrix to output a self-attention output feature that fuses global spatiotemporal correlations. The query matrix, key matrix, and value matrix are obtained by linear transformation of the input local spatiotemporal feature subsets, and their dimensions are determined by the total length of the local spatiotemporal feature subsets and the single attention head feature dimension.
[0031] For spatial propagation attenuation constraints, this embodiment sets an electrical distance bias matrix to incorporate these constraints. Specifically, based on the target distribution network topology and the transformer impedance parameters of the target distribution network lines, the node impedance matrix is calculated using the node voltage method. The magnitudes of the mutual impedance elements in the node impedance matrix are extracted as the electrical distances between nodes, forming an electrical distance matrix. The physical meaning of the electrical distance between nodes is the amplitude of the harmonic voltage response generated at another node when a unit harmonic current is injected from one node. It reflects the ease or difficulty of harmonic propagation between two nodes. Electrical distance is a core scalar characterizing the harmonic propagation attenuation characteristics between distribution network nodes. Then, this embodiment performs... Minimum-maximum normalization is used to obtain a normalized electrical distance matrix, eliminating magnitude differences between different distribution networks. In attention calculation, learnable attention weight coefficients and attention bias base values are set for each attention head. These learnable attention weight coefficients and attention bias base values map the normalized electrical distance matrix to the node-level bias value of the corresponding attention head. The node-level bias value is defined as the negative attention weight coefficient multiplied by the normalized electrical distance plus the attention bias base value. The negative sign of the attention weight coefficient indicates that a larger electrical distance results in stronger harmonic propagation attenuation and lower inter-node characteristic correlation; therefore, a smaller node-level bias value is preferable. The formula for calculating the node-level bias value is as follows: In the formula, This represents the node-level bias value between observation node i and observation node j in the h-th attention head; is the weighting coefficient for the h-th attention head, which is a learnable parameter used to adjust the degree of influence of electrical distance on the bias value; The normalized electrical distance between observation node i and observation node j ranges from zero to one. is the attention bias base value of the h-th attention head, which is a learnable parameter used to adjust the base offset of the bias value; ij is a combination of subscripts, where i represents the i-th observation node in the distribution network, j represents the j-th observation node in the distribution network, and ij together identify the observation node pair.
[0032] This embodiment constructs a node-level bias matrix based on node-level bias values. After normalization using an exponential function, the corresponding attention weights are lower, thus conforming to the physical laws of harmonic propagation attenuation. Finally, the node-level bias matrix is expanded into an electrical distance bias matrix with dimensions completely consistent with the attention weight matrix. During expansion, the bias values are only related to the monitoring nodes corresponding to the sequence elements and are independent of time. It should be noted that when there is a topology prior scenario, this embodiment calculates the node impedance matrix based on the node voltage method of circuit theory using the distribution network topology and line transformer impedance parameters, and directly extracts the mutual impedance modulus to obtain the electrical distance matrix, providing an accurate physical quantitative characterization of the spatial attenuation characteristics of harmonic propagation. When there is no distribution network topology and impedance parameters, this electrical distance bias matrix can be set to a zero matrix. The model can then autonomously learn the correlation weights between nodes through a purely data-driven approach, fitting the propagation law that changes in the current of harmonic injection nodes will cause corresponding changes in the node voltage and current along the propagation path, and autonomously learn the spatial attenuation characteristics of harmonic propagation without the need for manual input of physical constraints.
[0033] To address the temporal causality constraint, this embodiment uses a causal mask matrix to incorporate this constraint. Since harmonic propagation exhibits strict temporal causality—meaning past harmonic emissions affect future grid responses, but future signals cannot influence the past—this embodiment defines the elements of the causal mask matrix as follows: when the time step of the subsequent element in the sequence is greater than the time step of the preceding element, the causal mask value is negative infinity. After normalization, the corresponding attention weight is zero, forcing the model to focus only on the impact of past moments on the current moment, strictly adhering to the temporal causal law of harmonic propagation, and avoiding interference from future information on historical features. When the time step of the subsequent element in the sequence is not greater than the time step of the preceding element, the causal mask value is zero. The formula for calculating self-attention is: In the formula, Let h be the query matrix for the h-th attention head; Let h be the key matrix of the h-th attention head; This is the value matrix of the h-th attention head; the superscript T is the transpose operator. The feature dimension of a single attention head is the length of the query vector or key vector in each attention head. This is a scaling factor used to scale the dot product result to a suitable range, preventing the gradient of the Softmax function from vanishing due to excessively large values. Let be the electrical distance bias matrix for the h-th attention head, which is used to incorporate the physical constraints of the electrical distance between nodes on the attention weights; For causal masking matrix, it is used to incorporate temporal causal constraints on harmonic propagation, ensuring that the model only focuses on temporal information from the past to the present; This is a self-attention function, used to calculate the attention weights between elements in the input sequence and generate a weighted feature output; The normalization exponential function is used to transform the input values into a probability distribution such that the sum of all output elements is one.
[0034] This embodiment, through the fusion of the aforementioned window self-attention mechanism and physical characteristic constraints, enables the lightweight converter encoder, after multi-layer stacking, to output harmonic global spatiotemporal correlation features representing the full-link causal relationship of harmonic source emission, grid propagation, and multi-node superimposed response. This provides core feature support for subsequent accurate decoupling and responsibility quantification of multiple harmonic sources. This embodiment adopts a three-layer stacked Transformer encoder structure, progressively constructing spatiotemporal correlation representations from short-range to long-range through a hierarchical approach. The physical essence of this full-link causal relationship can be decomposed into three stages: harmonic source nodes emitting harmonic current at time t (emission stage); harmonic current propagating through the distribution network line undergoing amplitude attenuation and phase shift (propagation stage); and the superposition of multi-harmonic source harmonic currents at each node after propagation, causing voltage / current waveform distortion at the node at time t (response stage). Specifically, the first layer, the bottom encoder, is used for short-range spatiotemporal correlation modeling, capturing the response through a local window self-attention mechanism. The first layer uses the dynamic changes in harmonic timing between adjacent moments within a unified observation node to characterize the transient characteristics of harmonic emission and its propagation correlation with adjacent nodes. Specifically, it extracts the harmonic timing variation features between adjacent moments within the same node (reflecting the transient characteristics of harmonic source emission) and models the harmonic feature correlation between adjacent nodes at the same moment (reflecting short-distance propagation characteristics). The second layer, a mid-level encoder, is used for mid-range spatiotemporal correlation modeling. Based on a cross-window connection mechanism, it fuses the features of multiple local windows to effectively capture the propagation path correlation of harmonics between multiple feeders and multiple nodes, as well as the superposition characteristics of multiple harmonic sources at the same observation node, achieving accurate modeling of harmonic propagation path characteristics and multi-node superposition rules. The third layer, a high-level encoder, is used for long-range spatiotemporal correlation modeling. Through globally optimized self-attention weights, it captures the full-link mapping relationship of the emission characteristics and propagation path attenuation characteristics of harmonic source nodes, as well as the response characteristics of remote nodes, ultimately achieving causal correlation modeling of the three stages of emission, propagation, and response.
[0035] In this embodiment, each Transformer encoder layer consists of a multi-head self-attention layer, a feedforward neural network layer, a layer normalization layer, and a residual connection structure. Through multi-layer encoding, the long-range dependency and propagation coupling characteristics of multi-node harmonics in the global spatiotemporal dimension are gradually extracted. The final output dimension of the three-layer encoder is the harmonic global spatiotemporal correlation feature with the number of channels, nodes, and time steps. This harmonic global spatiotemporal correlation feature is a quantitative representation of the end-to-end causal relationship. Each feature point of the harmonic global spatiotemporal correlation feature not only contains the local harmonic features of the corresponding node and time step, but also deeply integrates the factors leading to this harmonic global spatiotemporal correlation feature. By combining the emission information of harmonic sources and the attenuation information of harmonic propagation paths, a causal binding between harmonic response and harmonic source emission is achieved. This global spatiotemporal correlation feature of harmonics is input into the subsequent cross-level spatiotemporal feature fusion module and the multi-scale local features output by the YOLO backbone network for deep fusion. Finally, it is input into the dual-branch joint decoding module, providing core feature support for decoupling, location positioning, and responsibility quantification of multiple harmonic sources. Because the modeling of the full-link causal relationship has been completed in the global spatiotemporal correlation feature of harmonics, the subsequent dual-branch joint decoding module can accurately distinguish the independent contributions of different harmonic sources, effectively solving the decoupling problem in multi-harmonic source coupling scenarios.
[0036] S4. Perform cross-level deep fusion of the multi-scale harmonic local spatiotemporal features and the harmonic global spatiotemporal correlation features to obtain multi-scale spatiotemporal fusion features.
[0037] In some embodiments, the step of performing cross-level deep fusion of the multi-scale harmonic local spatiotemporal features and the harmonic global spatiotemporal correlation features to obtain multi-scale spatiotemporal fused features includes: A bidirectional fusion architecture of a fusion feature pyramid network and a path aggregation network is constructed. The bidirectional fusion architecture is used to gradually fuse the global spatiotemporal correlation features of harmonics with the local spatiotemporal features of multi-scale harmonics through a top-down upsampling operation to obtain shallow fusion features. The shallow fusion features are gradually fused with the harmonic global spatiotemporal correlation features through a bottom-up downsampling operation to obtain global fusion features; By integrating the shallow fusion features and the global fusion features, a multi-scale spatiotemporal fusion feature is obtained.
[0038] After completing the multi-scale local spatiotemporal feature extraction of the improved YOLOv8 backbone network and the global spatiotemporal correlation modeling of the lightweight Transformer encoder, this embodiment addresses the issues that while local features contain rich fine-grained dynamic information, they lack global causal context, and while global features capture long-range propagation correlations, they lack fine-grained details. This embodiment employs a bidirectional fusion architecture combining a Feature Pyramid Network (FPN) and a Path Aggregation Network (PAN) to construct a cross-level spatiotemporal feature fusion unit. This achieves deep complementarity between multi-scale local features and globally correlated features. Specifically, this embodiment first performs top-down upsampling fusion, integrating the lightweight Transformer encoder... The output 32x downsampled global spatiotemporal correlation feature map is used as the top-level feature. Through upsampling operations, it is gradually fused with the 16x, 8x, and 4x downsampled feature maps output by the improved YOLO backbone network to obtain shallow fused features. In this process, the harmonic source emission, power grid propagation, and multi-node response full-link causal correlation information contained in the global features are transferred to the shallow features. This enables the shallow fine-grained features, which originally only focused on the transient changes of a single node or the short-distance propagation of adjacent nodes, to have the ability to perceive the global spatiotemporal context. For example, the shallow features with 4x downsampling can only capture harmonic transient changes. After fusion, they can be associated with the emission characteristics of upstream harmonic sources and the attenuation law of the propagation path.
[0039] Then, this embodiment performs bottom-up downsampling fusion, passing the shallow, fine-grained features of the fused global information back to the harmonic global spatiotemporal correlation features through a downsampling operation, resulting in global fused features. This supplements the global features output by the lightweight Transformer encoder with fine-grained dynamic details of harmonics. The deep global features, which originally focused on the steady-state correlation of long-range propagation, can incorporate key details such as shallow transient changes and interharmonics after fusion, avoiding information loss due to over-downsampling. After the above bidirectional fusion processing, the shallow fused features and global fused features are integrated, ultimately outputting three different sets of features. The spatiotemporal fusion features at different scales correspond to fine-grained (4x downsampling), mesoscale (8x or 16x downsampling), and global scale (32x downsampling fusion). Fine-grained features incorporate transient details of global causal relationships, mesoscale features take into account the dynamic changes of local propagation characteristics and global relationships, and global scale features integrate the steady-state characteristics of fine-grained dynamics and long-range causality. This fully covers the full-dimensional features of harmonics from transient changes to steady-state propagation and from local nodes to the global network, providing a feature foundation with dual support of local details and global causality for the subsequent accurate localization and responsibility quantification of multiple harmonic sources.
[0040] S5. Based on the multi-scale spatiotemporal fusion features, the initial harmonic source localization decoding result and the initial harmonic responsibility quantization result are generated synchronously through joint decoding of dual-branch shared features.
[0041] In some implementations, the step of synchronously generating the initial harmonic source localization decoding result and the initial harmonic responsibility quantization result by joint decoding of dual-branch shared features based on the multi-scale spatiotemporal fusion features includes: The multi-scale spatiotemporal fusion features are mapped to feature dimensionality reduction through convolutional layers and fully connected layers to generate node-level shared feature vectors. The node-level shared feature vectors are then input in parallel into the harmonic source localization branch and the harmonic responsibility quantization branch. In the harmonic source localization branch, a fully connected layer is used to perform harmonic source localization analysis on the node-level shared feature vector to obtain the initial harmonic source localization decoding result; the initial harmonic source localization decoding result includes the harmonic source confidence probability value, the harmonic source type, and the predicted value of the harmonic source emission characteristics; In the harmonic responsibility quantification branch, the absolute value of the harmonic contribution of each harmonic source to the single harmonic distortion is calculated based on the initial harmonic source localization decoding result and the node-level shared feature vector. The responsibility ratio of each harmonic source for single harmonic distortion is calculated based on the absolute value of the harmonic contribution, thus obtaining the single harmonic responsibility ratio. Based on the single harmonic responsibility ratio and the harmonic distortion rate of each harmonic voltage, calculate the comprehensive responsibility ratio of each harmonic source for the total harmonic distortion rate. By combining the absolute value of the harmonic contribution, the proportion of responsibility for a single harmonic, and the proportion of overall responsibility, the initial harmonic responsibility quantification result is obtained.
[0042] To achieve accurate localization and responsibility quantification of multiple harmonic sources, this embodiment sets up a dual-branch shared feature joint decoding unit. Figure 2 This is a schematic diagram of the overall architecture of the dual-branch joint constraint and reverse correction provided in this embodiment of the invention. The dual-branch shared feature joint decoding unit adopts a dual-branch shared feature architecture, achieving collaborative decoding of localization and quantization tasks through unified feature input. This ensures that the two branches complete decoding based on the same spatiotemporal features, fundamentally guaranteeing the inherent consistency of localization and quantization results. Specifically, after obtaining the multi-scale spatiotemporal fusion features after cross-level fusion, this embodiment inputs the multi-scale spatiotemporal fusion features into the shared feature decoding layer. The shared feature decoding layer completes feature dimensionality reduction and mapping through convolutional layers and fully connected layers, generating a dimension of... The node-level shared feature vector, where, The dimension of the node-level shared feature vector after dimensionality reduction is that the node-level shared feature vector fully integrates the time-domain dynamic characteristics and spatial propagation coupling characteristics of harmonics. Each observation node corresponds to a set of independent node-level shared feature vectors, which can be adapted to the decoding requirements of the entire task of harmonic source localization, type classification, emission characteristic prediction, and responsibility quantization, thus ensuring the feature homogeneity and intrinsic consistency of the results of multiple tasks from the root.
[0043] Then, in this embodiment, the harmonic source localization branch is decoded. This branch is responsible for locating the spatial position of harmonic sources, identifying their types, and detecting their harmonic emission characteristics. The branch sets up three parallel harmonic source location detection heads: a harmonic source type classification head and a harmonic emission characteristic detection head. Based on node-level shared feature vectors, the harmonic source location detection head uses two fully connected layers combined with a Sigmoid activation function to output the confidence probability value of each node in the distribution network as a harmonic source. Nodes with a harmonic source confidence probability value higher than a preset confidence threshold are identified as harmonic source nodes, and the node number and spatial location are output, achieving accurate localization of multiple harmonic sources. After completing the harmonic source node localization, the following dimensions are used to... The node-level shared feature vector is used to extract the feature vectors corresponding to nodes identified as harmonic sources, which serve as input features for the subsequent two detection heads. The harmonic source type classification head, based on the feature vectors corresponding to the located harmonic source nodes, outputs the classification probability of the nonlinear load type corresponding to the harmonic source through a fully connected layer and a Softmax activation function. The type with the highest probability is selected as the final classification result, achieving harmonic source type identification and providing a targeted basis for subsequent precise harmonic management. Similarly, the harmonic emission characteristic detection head, based on the corresponding feature vectors of the harmonic source nodes, outputs the amplitude and phase prediction values of the 2nd to 25th harmonic currents emitted by the harmonic source through a fully connected layer and a linear activation function, obtaining the predicted values of the harmonic source emission characteristics. This provides a physical constraint basis for subsequent responsibility quantification. The three parallel harmonic source location detection heads, harmonic source type classification heads, and harmonic emission characteristic detection heads share the same node-level shared feature vector, ensuring that the location nodes, classification nodes, and emission characteristic prediction nodes are completely corresponding, avoiding the problem of misalignment of multi-task results. At the same time, only one feature decoding is needed to support the three detection tasks simultaneously, greatly reducing the computational overhead of the model and adapting to the engineering requirements of online real-time source tracing in power distribution networks. In this embodiment, the harmonic source confidence probability values, harmonic source type, and harmonic source emission characteristic prediction values output by the three parallel harmonic source location detection heads, harmonic source type classification heads, and harmonic emission characteristic detection heads are organized into the initial harmonic source location decoding results.
[0044] Finally, this embodiment performs harmonic responsibility quantification branch decoding. This harmonic responsibility quantification branch is responsible for calculating the contribution of each harmonic source to harmonic distortion and quantifying the responsibility ratio. Responsibility quantification is completed based on the output of the harmonic source localization branch. In the harmonic responsibility quantification branch decoding, this embodiment first uses a harmonic contribution regression head based on the node-level shared feature vector and the initial harmonic source localization decoding results. Then, through a fully connected layer and a linear activation function, it outputs the absolute value of the contribution of each harmonic source to the 2nd to 25th harmonic voltage distortion of the target observation node, accurately quantifying the absolute value of each harmonic source's harmonic contribution to a single harmonic distortion. In the single harmonic responsibility ratio calculation process, this embodiment calculates the responsibility ratio of each harmonic source to the single harmonic distortion of the target node based on the absolute value of the harmonic contribution, obtaining the single harmonic responsibility ratio. The specific formula for calculating the single harmonic responsibility ratio is as follows: In the formula, The percentage of single harmonic responsibility of the m-th harmonic source for the g-th harmonic distortion of the target observation node; denoted as the absolute value of the contribution of the m-th harmonic source to the g-th harmonic distortion of the target observation node; M is the total number of located harmonic sources; m is the harmonic source index; and g is the harmonic order, which ranges from 2 to 25.
[0045] In the comprehensive harmonic responsibility quantification stage, this embodiment calculates the comprehensive responsibility ratio of each harmonic source to the total harmonic distortion rate of the node based on the responsibility ratio of each harmonic and the voltage harmonic distortion rate of each harmonic at the target observation node. Here, the voltage harmonic distortion rate of the g-th harmonic at the target node represents the degree of distortion of that specific harmonic at the observation node. The specific formula for calculating the comprehensive responsibility ratio is as follows: In the formula, The percentage of responsibility of the m-th harmonic source for the total harmonic distortion of the target observation node; Let be the voltage harmonic distortion rate of the g-th harmonic at the target node, which reflects the severity of that harmonic. denoted as the absolute value of the contribution of the e-th harmonic source to the g-th harmonic distortion of the target observation node; e is the harmonic source index.
[0046] The above-mentioned comprehensive responsibility ratio results can be directly used for power quality assessment and harmonic pollution responsibility allocation. This embodiment achieves synchronous generation and inherent consistency guarantee of harmonic source location and responsibility quantification through a dual-branch shared feature joint decoding architecture, providing comprehensive, accurate and interpretable technical support for the source tracing and quantification of multiple harmonic sources in the distribution network.
[0047] S6. Perform bidirectional joint constraint optimization on the initial harmonic source location decoding result and the initial harmonic responsibility quantification result to generate the power distribution network harmonic pollution source tracing quantification result.
[0048] In some implementations, the step of performing bidirectional joint constraint optimization on the initial harmonic source location decoding result and the initial harmonic responsibility quantification result to generate the power distribution network harmonic pollution source tracing quantification result includes: The theoretical contribution value of harmonic voltage generated by each harmonic source at the observation node is calculated based on the predicted value of the harmonic source emission characteristics, and the mean square error between the absolute value of the harmonic contribution and the theoretical contribution value of the harmonic voltage is calculated to obtain the physical constraint loss value of the harmonic source. The harmonic responsibility quantization branch is iteratively optimized using the physical constraint loss value of the harmonic source to obtain the harmonic responsibility quantization correction result. The observation nodes are screened based on the confidence probability value of the harmonic source and the preset confidence threshold to obtain a set of candidate harmonic source nodes; Based on the set of candidate harmonic source nodes, extract the comprehensive responsibility ratio of each candidate harmonic source node from the initial harmonic responsibility quantification results; The contribution weight of each harmonic source candidate node is obtained by normalizing the maximum value of the comprehensive responsibility ratio of the candidate nodes. The confidence probability value of the harmonic source is constrained and optimized using the contribution weight to obtain the optimized confidence value; The set of candidate harmonic sources is used to determine the actual harmonic source nodes based on the confidence optimization value, resulting in the set of harmonic source nodes optimized by bidirectional joint constraints. Extract the initial harmonic source location decoding results and the harmonic responsibility quantification correction results corresponding to the set of harmonic source nodes, and integrate them to generate the quantification results of harmonic pollution source tracing in the power distribution network.
[0049] After obtaining the initial harmonic source location decoding result from the harmonic source location branch and the initial harmonic responsibility quantization result from the harmonic responsibility quantization branch, to ensure the physical consistency and engineering reliability of the initial harmonic source location decoding result and the initial harmonic responsibility quantization result, this embodiment designs a dual-branch joint constraint mechanism to achieve mutual verification and collaborative optimization between the harmonic source location branch and the harmonic responsibility quantization branch. Specifically, this embodiment uses the predicted value of harmonic source emission characteristics output by the harmonic source location branch (including the amplitude and phase information of the 2nd to 25th harmonic currents) as the prior physical constraint for calculating the contribution of the harmonic responsibility quantization branch, ensuring that the harmonic responsibility quantization result strictly conforms to the physical emission of the harmonic source. Based on the characteristics and circuit propagation laws, the contribution result of the harmonic responsibility quantification branch is used to back-correct the harmonic source confidence of the harmonic source localization branch. The probability value of the harmonic source confidence is dynamically adjusted based on the contribution, effectively filtering out false alarm nodes with extremely low contribution, significantly reducing the false alarm rate of localization, and improving the engineering practicality of the localization results. In specific implementation, the dual-branch joint constraint mechanism is executed collaboratively in two dimensions: joint loss backpropagation correction in the inference and training phases. In the inference phase, false alarm nodes are filtered through confidence value correction, and in the training phase, model parameters are collaboratively optimized through joint loss backpropagation. Specifically, the confidence backpropagation correction in the inference phase is executed as follows: This embodiment sets a pre-defined confidence threshold for initial screening. Observation nodes with a harmonic source confidence probability value not lower than this pre-defined confidence threshold are included in the harmonic source candidate node set. Then, the harmonic source candidate node set is input into the harmonic responsibility quantification branch. The comprehensive responsibility ratio of each harmonic source candidate node in the set is obtained through the harmonic contribution regression head. The physical meaning of this comprehensive responsibility ratio is the actual contribution of the observation node to harmonic pollution. Next, this embodiment performs maximum value normalization processing on the comprehensive responsibility ratio in the harmonic source candidate node set to obtain the contribution of each harmonic source candidate node. The weighting is calculated by dividing the overall responsibility ratio of a candidate harmonic source node by the maximum overall responsibility ratio in the set of candidate harmonic source nodes. This assigns a weight of one to the node with the highest contribution, and scales the remaining candidate harmonic source nodes according to their contribution ratios. This maps the contribution to the zero-to-one range, matching the confidence level. The original harmonic source confidence probability value is then multiplied by one and added to the product of the correction intensity coefficient and the contribution weight minus 0.5. This contribution weighting optimizes the original harmonic source confidence probability value, resulting in an optimized confidence level. The specific formula for calculating the optimized confidence level is as follows: In the formula, This is the optimized confidence value for the i-th observation node; Let be the harmonic source confidence probability value of the i-th observation node; The contribution weight of the i-th observation node; To correct the intensity coefficient, it should be noted that the preferred value of the correction intensity coefficient is 0.8, and the value range of the correction intensity coefficient is from zero to one. Those skilled in the art can flexibly adjust it according to the false alarm rate control requirements of the engineering scenario. When the contribution weight is greater than 0.5, the node contribution is at a medium-high level among candidate nodes, and the corrected confidence is higher than the original harmonic source confidence probability value, strengthening the judgment weight of the real harmonic source. When the contribution weight is less than 0.5, the node contribution is low, and the corrected confidence is lower than the original harmonic source confidence probability value, weakening the judgment weight of low contribution nodes. When the contribution weight is close to zero, the node has no actual harmonic contribution, and the corrected confidence is greatly reduced, providing a basis for filtering falsely judged nodes. Finally, this embodiment sets a final confidence judgment threshold. Nodes with a confidence optimization value not lower than the final confidence judgment threshold are judged as the final real harmonic source nodes, and nodes with a confidence optimization value lower than the final confidence judgment threshold are judged as falsely judged nodes and removed. In this embodiment, the preferred value of the final judgment threshold can be set to 0.5.
[0050] During the training phase, this embodiment implements the reverse constraint of the quantization branch on the localization branch from the root of model training, ensuring the consistency of the results of the two tasks. The reverse correction during the training phase achieves parameter-level collaborative optimization through backpropagation of the multi-task joint loss function. The multi-task joint loss function is a weighted sum of the position detection loss term of the harmonic source localization branch, the type classification loss term of the harmonic source localization branch, the contribution regression loss term of the harmonic responsibility quantization branch, the emission characteristic prediction loss, and the localization-quantization joint constraint loss term. The position detection loss term of the harmonic source localization branch adopts the binary cross-entropy loss function, which is used to optimize the accuracy of harmonic source node localization; the type classification loss term of the harmonic source localization branch adopts the multi-class cross-entropy loss function, which is used to optimize the accuracy of harmonic source type classification; the contribution regression loss term of the harmonic responsibility quantization branch adopts the mean square error loss function, which is used to optimize the regression accuracy of harmonic contribution and responsibility ratio; and the emission characteristic prediction loss adopts the mean square error loss function.
[0051] This embodiment sets a location-quantization joint constraint loss term in the multi-task joint loss function. This location-quantization joint constraint loss term adopts the mean square error loss form. Specifically, it calculates the average of the sum of squares of the differences between the confidence probability values output by the harmonic source location branch and the comprehensive responsibility proportion output by the harmonic responsibility quantization branch in all observation nodes after being mapped by a normalized exponential function. The normalized comprehensive responsibility proportion is the comprehensive responsibility proportion of a certain observation node divided by the maximum comprehensive responsibility proportion of all nodes. The maximum comprehensive responsibility proportion of all nodes is the maximum value of the comprehensive responsibility proportion among all nodes. The physical meaning of this location-quantization joint constraint loss term is to force the confidence probability value output by the harmonic source location branch to maintain consistency with the contribution proportion output by the harmonic responsibility quantization branch. That is, for nodes with higher harmonic distortion contribution, the harmonic source location branch's confidence probability value is higher than the harmonic responsibility quantization branch's contribution proportion. The confidence probability value output by the source localization branch should be higher, and vice versa. During the backpropagation process of model training, the gradient of this localization-quantization joint constraint loss term will be simultaneously passed to all network parameters of the harmonic source localization branch and the harmonic responsibility quantization branch. If the harmonic source localization branch outputs a high confidence value to a node that has no actual contribution, the localization-quantization joint constraint loss term will generate a large loss value. During backpropagation, the feature extraction parameters of the harmonic source localization branch will be corrected to reduce the confidence output of that observation node. If the contribution calculation of the harmonic responsibility quantization branch deviates significantly from the output of the harmonic source localization branch, the gradient will simultaneously correct the regression parameters of the harmonic responsibility quantization branch to ensure the collaborative optimization of the two tasks and reduce the false alarm rate of the model from the root. The mathematical expression of the localization-quantization joint constraint loss term is: In the formula, The location-quantization joint constraint loss value; N is the total number of observation nodes in the distribution network; Let be the harmonic source confidence probability value of the i-th observation node; This represents the overall responsibility percentage of the i-th observation node; This represents the maximum overall responsibility percentage for all nodes. This is the Sigmoid activation function.
[0052] After the confidence correction in the inference phase and the joint loss backpropagation optimization in the training phase, the final quantitative result of multi-harmonic source tracing in the distribution network is output. This result fully includes the total number of harmonic sources in the distribution network, the spatial location number and equipment type of each harmonic source, the amplitude and phase of the second to twenty-fifth harmonic current emitted by each harmonic source, and the single harmonic responsibility ratio and comprehensive harmonic responsibility ratio of each harmonic source to the point of common coupling and each monitoring node. This embodiment ensures that the quantitative result conforms to the harmonic propagation law through physical prior constraints, and filters out misjudgments in location through reverse confidence correction, ultimately achieving accurate location and reasonable quantification of harmonic source tracing, providing accurate and quantifiable decision-making basis for harmonic management in the distribution network.
[0053] After model training and optimization, this embodiment can be deployed to a power distribution network project site to achieve online real-time source tracing and responsibility quantification of multiple harmonic sources. The system uses on-site power quality monitoring terminals to collect raw time-series data of three-phase voltage and current from multiple nodes in real time. Following a preprocessing procedure, the system performs time synchronization alignment, outlier and missing value handling, and data normalization of the multi-node data. Real-time sample data meeting the model input requirements is generated with an update cycle of 200 milliseconds. Subsequently, the preprocessed real-time samples are input into the deployed model, which automatically performs end-to-end spatiotemporal feature extraction, multi-scale feature fusion, and dual-branch joint decoding, achieving millisecond-level time accuracy. The system outputs harmonic source tracing results and responsibility quantification results. The model inference results are further output to the power quality monitoring and governance platform of the distribution network, realizing the visualization of the location of harmonic sources on the power grid topology map, the automated generation of reports on the responsibility ratio of each harmonic source, the real-time alarm push of harmonic exceedance events, and the source tracing query and retrospective analysis of historical harmonic events. This provides data support and decision-making basis for the precise governance of harmonic pollution and the assessment of power quality responsibility. At the same time, this embodiment needs to regularly collect the measured data of newly added harmonic events on site and the operation data after the power grid topology change to carry out incremental training of the model and continuously improve the model's adaptability to changes in on-site operating conditions and the accuracy of source tracing.
[0054] In summary, this embodiment fundamentally overcomes the core bottlenecks of existing technologies through an end-to-end spatiotemporal correlation modeling architecture. Compared with physical model-based methods that rely on prior information such as precise topology and line impedance parameters, this embodiment directly uses the original voltage and current time-series data of multiple nodes as input, completely eliminating the strong dependence on the physical model of the power grid. Compared with existing traditional machine learning and converter-added graph neural network technologies that require manual design of time-frequency features and topological adjacency matrices, this embodiment uses an improved single-stage target detection backbone network and a multi-scale convolutional kernel group adapted to the spatiotemporal characteristics of harmonics to accurately capture the local fine-grained spatiotemporal features of harmonic signals. Combined with the window self-attention mechanism of a lightweight converter, it autonomously learns the global long-range spatiotemporal correlation of multi-node harmonic propagation in a data-driven manner, achieving end-to-end deep fusion of local and global features, and time-domain and spatial characteristics. This effectively solves the problems of fragmented spatiotemporal modeling, distortion of pre-existing feature extraction, and insufficient generalization ability caused by topological prior dependence in existing technologies. Even in the case of frequent changes in distribution network topology, Even under scenarios with dynamic fluctuations in harmonic source operating conditions, this embodiment maintains stable source tracing accuracy. Moreover, through a dual-branch joint decoding architecture for harmonic source localization and responsibility quantification, it addresses the core shortcomings of existing technologies, such as the imbalance between localization and quantification capabilities and insufficient decoupling capabilities in multi-harmonic source coupling scenarios. Compared to technologies that can only achieve coarse localization without responsibility quantification, or that localization and quantification are achieved independently in stages, this embodiment constructs a shared decoding layer based on the same spatiotemporal fusion features. Through parallel decoding and bidirectional joint constraints of the localization and quantification branches, the harmonic source emission characteristics output by the localization branch are used as physical constraints for calculating the contribution of the quantification branch. Simultaneously, the confidence of the localization branch is corrected in reverse using the contribution result of the quantification branch. This achieves mutual verification and collaborative optimization of the localization and quantification tasks, significantly improving the feature decoupling capability in scenarios with strong coupling of multiple harmonic sources. It can accurately distinguish the independent contributions of different harmonic sources, simultaneously achieving accurate localization of harmonic sources and fine quantification of responsibility proportions. The output results can directly support power quality responsibility assessment and precise harmonic pollution control.
[0055] Furthermore, this embodiment achieves synergistic optimization of model lightweighting and inference efficiency while ensuring the accuracy of source tracing. Compared with the requirement of high-density measurement of all nodes in traditional harmonic state estimation and other methods, this embodiment only requires measurement data from three to ten monitoring nodes to complete high-precision source tracing, which greatly reduces the deployment cost and operation and maintenance difficulty of the field monitoring device and has strong engineering practicality.
[0056] This invention provides a method for quantifying and tracing multiple harmonic sources in a distribution network. The method preprocesses collected power quality time-series data from multiple nodes in the distribution network to obtain standardized multi-node time-series data. This standardized multi-node time-series data is reconstructed into a two-dimensional spatiotemporal feature map, and harmonic spatiotemporal features are jointly extracted from the two-dimensional spatiotemporal feature map to obtain multi-scale local harmonic spatiotemporal features. Based on these multi-scale local harmonic spatiotemporal features, the harmonic wavelength-range spatiotemporal propagation correlation and coupling characteristics of multiple harmonic sources in the global spatiotemporal dimension are captured to obtain global harmonic spatiotemporal correlation features. The multi-scale local harmonic spatiotemporal features and the global harmonic spatiotemporal correlation features are deeply fused across levels to obtain multi-scale spatiotemporal fusion features. Based on these multi-scale spatiotemporal fusion features, initial harmonic source location decoding results and initial harmonic responsibility quantification results are synchronously generated through dual-branch shared feature joint decoding. The initial harmonic source location decoding results and the initial harmonic responsibility quantification results are then subjected to bidirectional joint constraint optimization to generate quantification results for harmonic pollution tracing in the distribution network. Compared with existing technologies, this method achieves end-to-end deep fusion of local fine-grained features and global propagation correlation of harmonics through a spatiotemporal correlation modeling architecture and a two-way joint constraint mechanism. It can achieve accurate spatial location and high-precision source tracing of harmonic sources under complex operating conditions such as frequent changes in distribution network topology and dynamic fluctuations in harmonic source conditions, reduce the false alarm rate of location and improve the accuracy of responsibility quantification in scenarios with strong coupling of multiple harmonic sources, and meet the engineering requirements of online real-time monitoring and closed-loop management of distribution networks.
[0057] It should be noted that the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0058] In one embodiment, such as Figure 3 As shown, this embodiment of the invention provides a multi-harmonic source tracing and quantification system for power distribution networks, the system comprising: The data acquisition module 101 is used to preprocess the collected power quality time series data of multiple nodes in the distribution network to obtain standardized multi-node time series data. The local analysis module 102 is used to reconstruct the standardized multi-node time series data into a two-dimensional spatiotemporal feature map, and to jointly extract harmonic spatiotemporal features from the two-dimensional spatiotemporal feature map to obtain multi-scale harmonic local spatiotemporal features. The global analysis module 103 is used to capture the harmonic wavelength spatiotemporal propagation correlation coupling characteristics of multiple harmonic sources in the global spatiotemporal dimension based on the local spatiotemporal characteristics of the multi-scale harmonics, and obtain the global spatiotemporal correlation characteristics of harmonics. The feature fusion module 104 is used to perform cross-level deep fusion of the multi-scale harmonic local spatiotemporal features and the harmonic global spatiotemporal correlation features to obtain multi-scale spatiotemporal fused features. The decoding and quantization module 105 is used to generate the initial harmonic source localization decoding result and the initial harmonic responsibility quantization result synchronously by jointly decoding the dual-branch shared features based on the multi-scale spatiotemporal fusion features. The constraint optimization module 106 is used to perform bidirectional joint constraint optimization on the initial harmonic source location decoding result and the initial harmonic responsibility quantification result to generate the power distribution network harmonic pollution source tracing quantification result.
[0059] For specific limitations regarding a multi-harmonic source tracing and quantification system for a distribution network, please refer to the above-described limitations regarding a multi-harmonic source tracing and quantification method for a distribution network, which will not be repeated here. Those skilled in the art will recognize that the various modules and steps described in conjunction with the embodiments disclosed in this application can be implemented in hardware, software, or a combination of both. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0060] This invention provides a multi-harmonic source tracing and quantification system for distribution networks. The system uses a data acquisition module to preprocess collected power quality time-series data from multiple nodes in the distribution network to obtain standardized multi-node time-series data. A local analysis module reconstructs the standardized multi-node time-series data into a two-dimensional spatiotemporal feature map and performs joint extraction of harmonic spatiotemporal features from the two-dimensional spatiotemporal feature map to obtain multi-scale harmonic local spatiotemporal features. A global analysis module captures the harmonic wavelength-range spatiotemporal propagation correlation and coupling characteristics of multiple harmonic sources in the global spatiotemporal dimension based on the multi-scale harmonic local spatiotemporal features to obtain global harmonic spatiotemporal correlation features. A feature fusion module performs cross-level deep fusion of the multi-scale harmonic local spatiotemporal features and the global harmonic spatiotemporal correlation features to obtain multi-scale spatiotemporal fusion features. A decoding and quantification module, based on the multi-scale spatiotemporal fusion features, synchronously generates initial harmonic source location decoding results and initial harmonic responsibility quantification results through dual-branch shared feature joint decoding. A constraint optimization module performs bidirectional joint constraint optimization on the initial harmonic source location decoding results and the initial harmonic responsibility quantification results to generate distribution network harmonic pollution source tracing and quantification results. Compared with existing technologies, this system achieves end-to-end deep fusion of local fine-grained characteristics and global propagation correlation of harmonics through a spatiotemporal correlation modeling architecture and a two-way joint constraint mechanism. Under complex operating conditions such as frequent changes in distribution network topology and dynamic fluctuations in harmonic source conditions, it can achieve accurate spatial location and high-precision source tracing of harmonic sources, reduce the false alarm rate of location, and improve the accuracy of responsibility quantification in scenarios with strong coupling of multiple harmonic sources, thus meeting the engineering requirements of online real-time monitoring and closed-loop management of distribution networks.
[0061] Figure 4This invention provides a computer device including a memory, a processor, and a transceiver, which are connected to each other via a bus. The memory is used to store a set of computer program instructions and data, and can transmit the stored data to the processor. The processor can execute the program instructions stored in the memory to perform the steps of the above method.
[0062] The memory may include volatile memory or non-volatile memory, or both; the processor may be a central processing unit, a microprocessor, an application-specific integrated circuit, a programmable logic device, or a combination thereof. By way of example, but not limitation, the programmable logic device described above may be a complex programmable logic device, a field-programmable gate array, a general-purpose array logic, or any combination thereof.
[0063] In addition, memory can be a physically independent unit or integrated with the processor.
[0064] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have the same component arrangement.
[0065] In one embodiment, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0066] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., SSD), etc.
[0067] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed, it can include the processes of the embodiments of the above methods.
[0068] The embodiments described above are merely preferred embodiments of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various improvements and substitutions without departing from the technical principles of this invention, and these improvements and substitutions should also be considered within the scope of protection of this application. Therefore, the scope of protection of this patent application should be determined by the scope of the claims.
Claims
1. A method for quantifying and tracing multiple harmonic sources in a power distribution network, characterized in that, Includes the following steps: The collected power quality time series data of multiple nodes in the distribution network are preprocessed to obtain standardized multi-node time series data; The standardized multi-node time series data is reconstructed into a two-dimensional spatiotemporal feature map, and the two-dimensional spatiotemporal feature map is subjected to joint extraction of harmonic spatiotemporal features to obtain multi-scale harmonic local spatiotemporal features. Based on the local spatiotemporal characteristics of the multi-scale harmonics, the spatiotemporal propagation correlation and coupling characteristics of the harmonic wavelength range of multiple harmonic sources in the global spatiotemporal dimension are captured, and the global spatiotemporal correlation characteristics of harmonics are obtained. The multi-scale harmonic local spatiotemporal features and the harmonic global spatiotemporal correlation features are deeply fused across levels to obtain multi-scale spatiotemporal fusion features. Based on the multi-scale spatiotemporal fusion features, the initial harmonic source localization decoding result and the initial harmonic responsibility quantization result are generated synchronously through joint decoding of dual-branch shared features. The initial harmonic source location decoding result and the initial harmonic responsibility quantification result are subjected to bidirectional joint constraint optimization to generate the power distribution network harmonic pollution source tracing quantification result.
2. The method for quantizing and tracing multiple harmonic sources in a distribution network as described in claim 1, characterized in that, The step of reconstructing the standardized multi-node time series data into a two-dimensional spatiotemporal feature map includes: The standardized multi-node temporal data is linearly transformed by a single-point convolutional layer to obtain the initial feature tensor; Spatiotemporal prior knowledge is injected into the initial feature tensor by two-dimensional position encoding to obtain a spatiotemporally encoded feature tensor; The spatiotemporal encoded feature tensor is reconstructed into a two-dimensional spatiotemporal feature map with a preset number of feature channels as the channel dimension.
3. The method for quantizing and tracing multiple harmonic sources in a distribution network as described in claim 1, characterized in that, The step of jointly extracting harmonic spatiotemporal features from the two-dimensional spatiotemporal feature map to obtain multi-scale harmonic local spatiotemporal features includes: The two-dimensional spatiotemporal feature map is subjected to multi-dimensional local feature extraction using a parallel multi-scale convolutional kernel group to obtain the initial local spatiotemporal features; By using a four-level downsampling hierarchy, the initial local spatiotemporal features are extracted and scaled stepwise to obtain multi-scale harmonic local spatiotemporal features. The parallel multi-scale convolution kernel group includes a single-row, three-column convolution kernel for capturing local temporal features of harmonic time dimension, a three-row, single-column convolution kernel for capturing local spatial features of observation node dimension, and a three-row, three-column convolution kernel for capturing local coupling features of harmonic spatiotemporal joint.
4. The method for quantizing and tracing multiple harmonic sources in a distribution network as described in claim 1, characterized in that, The step of capturing the harmonic wavelength range spatiotemporal propagation correlation coupling characteristics of multiple harmonic sources in the global spatiotemporal dimension based on the multi-scale harmonic local spatiotemporal characteristics to obtain the global spatiotemporal correlation characteristics of harmonics includes: A three-layer stacked lightweight converter encoder is constructed; each layer of the lightweight converter encoder includes a multi-head self-attention mechanism, a feedforward neural network, layer normalization, and residual connections; The local spatiotemporal features of the multi-scale harmonics are divided into multiple non-overlapping local windows to obtain a subset of local spatiotemporal features; Calculate the node impedance based on the target distribution network topology and the target distribution network line transformer impedance parameters, and construct a normalized electrical distance matrix between different observation nodes; Based on the pre-set attention weight coefficients and attention bias base values, the normalized electrical distance matrix is converted into an electrical distance bias matrix, and a causal mask matrix is constructed based on the harmonic propagation time-series causal characteristics of the local spatiotemporal feature subset. In each layer of the lightweight converter encoder, the local spatiotemporal feature subset is self-attention calculated using a multi-head self-attention mechanism based on the electrical distance bias matrix and the causal mask matrix to obtain the self-attention output features. The self-attention output features of each lightweight converter encoder are sequentially input into a feedforward neural network, layer normalization, and residual connection for nonlinear feature transformation and gradient propagation. Through the three-layer stacked lightweight converter encoder, the long-range time dependence and propagation coupling features of multiple observation nodes in the global spatiotemporal dimension are extracted layer by layer to obtain the global spatiotemporal correlation features of harmonics.
5. The method for quantizing and tracing multiple harmonic sources in a distribution network as described in claim 1, characterized in that, The step of performing cross-level deep fusion of the multi-scale harmonic local spatiotemporal features and the harmonic global spatiotemporal correlation features to obtain multi-scale spatiotemporal fused features includes: A bidirectional fusion architecture of a fusion feature pyramid network and a path aggregation network is constructed. The bidirectional fusion architecture is used to gradually fuse the global spatiotemporal correlation features of harmonics with the local spatiotemporal features of multi-scale harmonics through a top-down upsampling operation to obtain shallow fusion features. The shallow fusion features are gradually fused with the harmonic global spatiotemporal correlation features through a bottom-up downsampling operation to obtain global fusion features; By integrating the shallow fusion features and the global fusion features, a multi-scale spatiotemporal fusion feature is obtained.
6. The method for quantizing and tracing multiple harmonic sources in a distribution network as described in claim 1, characterized in that, The steps for synchronously generating the initial harmonic source localization decoding result and the initial harmonic responsibility quantization result based on the multi-scale spatiotemporal fusion features and through joint decoding of dual-branch shared features include: The multi-scale spatiotemporal fusion features are mapped to feature dimensionality reduction through convolutional layers and fully connected layers to generate node-level shared feature vectors. The node-level shared feature vectors are then input in parallel into the harmonic source localization branch and the harmonic responsibility quantization branch. In the harmonic source localization branch, a fully connected layer is used to perform harmonic source localization analysis on the node-level shared feature vector to obtain the initial harmonic source localization decoding result; the initial harmonic source localization decoding result includes the harmonic source confidence probability value, the harmonic source type, and the predicted value of the harmonic source emission characteristics; In the harmonic responsibility quantification branch, the absolute value of the harmonic contribution of each harmonic source to the single harmonic distortion is calculated based on the initial harmonic source localization decoding result and the node-level shared feature vector. The responsibility ratio of each harmonic source for single harmonic distortion is calculated based on the absolute value of the harmonic contribution, thus obtaining the single harmonic responsibility ratio. Based on the single harmonic responsibility ratio and the harmonic distortion rate of each harmonic voltage, calculate the comprehensive responsibility ratio of each harmonic source for the total harmonic distortion rate. By combining the absolute value of the harmonic contribution, the proportion of responsibility for a single harmonic, and the proportion of overall responsibility, the initial harmonic responsibility quantification result is obtained.
7. The method for quantifying and tracing multiple harmonic sources in a distribution network as described in claim 6, characterized in that, The step of performing bidirectional joint constraint optimization on the initial harmonic source location decoding result and the initial harmonic responsibility quantification result to generate the distribution network harmonic pollution source tracing quantification result includes: The theoretical contribution value of harmonic voltage generated by each harmonic source at the observation node is calculated based on the predicted value of the harmonic source emission characteristics, and the mean square error between the absolute value of the harmonic contribution and the theoretical contribution value of the harmonic voltage is calculated to obtain the physical constraint loss value of the harmonic source. The harmonic responsibility quantization branch is iteratively optimized using the physical constraint loss value of the harmonic source to obtain the harmonic responsibility quantization correction result. The observation nodes are screened based on the confidence probability value of the harmonic source and the preset confidence threshold to obtain a set of candidate harmonic source nodes; Based on the set of candidate harmonic source nodes, extract the comprehensive responsibility ratio of each candidate harmonic source node from the initial harmonic responsibility quantification results; The contribution weight of each harmonic source candidate node is obtained by normalizing the maximum value of the comprehensive responsibility ratio of the candidate nodes. The confidence probability value of the harmonic source is constrained and optimized using the contribution weight to obtain the optimized confidence value; The set of candidate harmonic sources is used to determine the actual harmonic source nodes based on the confidence optimization value, resulting in the set of harmonic source nodes optimized by bidirectional joint constraints. Extract the initial harmonic source location decoding results and the harmonic responsibility quantification correction results corresponding to the set of harmonic source nodes, and integrate them to generate the quantification results of harmonic pollution source tracing in the power distribution network.
8. A multi-harmonic source tracing and quantification system for power distribution networks, characterized in that, The system includes: The data acquisition module is used to preprocess the collected power quality time series data of multiple nodes in the distribution network to obtain standardized multi-node time series data; The local analysis module is used to reconstruct the standardized multi-node time series data into a two-dimensional spatiotemporal feature map, and to jointly extract harmonic spatiotemporal features from the two-dimensional spatiotemporal feature map to obtain multi-scale harmonic local spatiotemporal features. The global analysis module is used to capture the harmonic wavelength spatiotemporal propagation correlation and coupling characteristics of multiple harmonic sources in the global spatiotemporal dimension based on the local spatiotemporal characteristics of the multi-scale harmonics, and obtain the global spatiotemporal correlation characteristics of harmonics. The feature fusion module is used to perform cross-level deep fusion of the multi-scale harmonic local spatiotemporal features and the harmonic global spatiotemporal correlation features to obtain multi-scale spatiotemporal fused features. The decoding and quantization module is used to generate the initial harmonic source localization decoding result and the initial harmonic responsibility quantization result synchronously by jointly decoding the dual-branch shared features based on the multi-scale spatiotemporal fusion features. The constraint optimization module is used to perform bidirectional joint constraint optimization on the initial harmonic source location decoding result and the initial harmonic responsibility quantification result to generate the power distribution network harmonic pollution source tracing quantification result.
9. A computer device, characterized in that: The device includes a processor and a memory, the processor being connected to the memory for storing computer programs, and the processor for executing the computer programs stored in the memory to cause the computer device to perform the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Harmonic source positioning method based on time-space diagram attention convolutional network
CN116908619A
State estimation method based on adaptive space-time diagram neural network
CN120542977A
Multi-Scale Temporal Attention Processing System for Multimodal Deep Learning with Vector-Quantized Variational Autoencoder
US20250307927A1