Harmonic positioning method and device, computer equipment, readable storage medium and program product
By generating and extracting the harmonic characteristic matrix, grid adjacency matrix and adaptive adjacency matrix in the power grid, the problem of difficulty in fast and precise positioning of harmonic sources in complex power grids in the prior art is solved, and the precise positioning of harmonic sources in the power grid is achieved, and the power quality of the power grid is improved.
Patent Information
- Application Number
- CN202510193364.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-06-06
AI Technical Summary
The prior art is difficult to quickly and accurately locate harmonic sources in complex power grid topology, resulting in power quality problems that seriously affect the safe operation of the power system.
By obtaining the to-process harmonic data of the target power grid, a harmonic feature matrix, a grid adjacency matrix and an adaptive adjacency matrix are generated, and feature extraction and identification are performed to accurately locate the existence of harmonic nodes in the power grid.
It realizes rapid and precise positioning of harmonic sources in the power grid, improves the positioning accuracy of harmonic sources in the power grid, and effectively solves the power quality problem.
Smart Images

Figure CN120102974A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a harmonic positioning method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] In recent years, with the rapid access of distributed renewable energy, power electronic equipment, such as inverters and energy storage equipment, has been widely used in power systems. While these devices improve system stability and reliability, they also bring harmonic pollution problems. Power electronic equipment will produce non-sinusoidal waveforms, resulting in an increase in harmonics, which in turn causes power quality problems, including equipment overheating, signal interference, voltage fluctuations, etc., which seriously affect the safe operation of the power system.
[0003] In the related technology, there are some power quality detection devices that can realize basic harmonic analysis and data monitoring functions, but these devices usually have slow processing speeds and cannot quickly and accurately locate harmonic sources in complex power grid topologies. Summary of the invention
[0004] Based on this, it is necessary to provide a harmonic positioning method, device, computer equipment, computer-readable storage medium and computer program product that can accurately locate harmonic nodes in the target power grid in response to the above technical problems.
[0005] In a first aspect, the present application provides a harmonic positioning method, comprising:
[0006] Obtaining the harmonic data to be processed of the target power grid;
[0007] Generating a harmonic characteristic matrix, a power grid adjacency matrix and an adaptive adjacency matrix according to the harmonic data to be processed;
[0008] Performing feature extraction on the harmonic feature matrix, the power grid adjacency matrix, and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid;
[0009] The harmonic state of each node in the target power grid is identified to obtain a harmonic identification result; the harmonic identification result is used to locate the node where the harmonic exists.
[0010] In one embodiment, the process of generating the power grid adjacency matrix includes:
[0011] Calculating the topological distance between each of the nodes;
[0012] Performing Gaussian kernel function calculation on each of the topological distances to obtain each similarity between the nodes;
[0013] Each of the similarities is compared with a preset threshold to obtain the power grid adjacency matrix.
[0014] In one embodiment, the process of generating the adaptive adjacency matrix includes:
[0015] Setting a corresponding initialization vector for each of the nodes;
[0016] Performing dot product calculation on each of the initialization vectors to obtain each correlation between the nodes;
[0017] The adaptive adjacency matrix is obtained according to each of the correlations.
[0018] In one embodiment, the extracting features of the harmonic feature matrix, the power grid adjacency matrix, and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid includes:
[0019] The harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix are subjected to feature extraction through a first preset number of spatiotemporal convolution blocks to obtain the harmonic state of each node in the target power grid.
[0020] In one embodiment, each of the spatiotemporal convolution blocks includes a second preset number of temporal convolution layers and a third preset number of graph convolution layers; the first preset number of spatiotemporal convolution blocks are used to extract features from the harmonic feature matrix, the power grid adjacency matrix, and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid, including:
[0021] Inputting the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix into the first spatiotemporal convolution block, the first spatiotemporal convolution block extracts features from the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain a reference harmonic state, and inputting the reference harmonic state into the next spatiotemporal convolution block until the harmonic state is obtained;
[0022] Among them, each of the temporal convolution layers in each of the spatiotemporal convolution blocks sequentially extracts time features from the harmonic feature matrix to obtain a first feature; and each of the graph convolution layers sequentially extracts spatial features from the power grid adjacency matrix and the adaptive adjacency matrix based on the first feature to obtain the reference harmonic state.
[0023] In one embodiment, the feature extraction of the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid is obtained by a pre-trained harmonic feature extraction model; the training process of the harmonic feature extraction model includes:
[0024] Acquire a harmonic training sample; the harmonic training sample carries a harmonic source label;
[0025] Inputting the harmonic training samples into the initial model for training to obtain a predicted harmonic state;
[0026] Obtaining a target loss function based on the predicted harmonic state and the harmonic source label, and adjusting the parameters of the initial model according to the target loss function until the training is completed to obtain the harmonic feature extraction model;
[0027] The obtaining a target loss function based on the predicted harmonic state and the harmonic source label includes:
[0028] Setting a loss ratio according to the number of different categories in the harmonic training sample;
[0029] Based on the difference between the predicted harmonic state and the harmonic source label, obtaining an initial loss function;
[0030] The target loss function is obtained according to the loss ratio and the initial loss function.
[0031] In a second aspect, the present application also provides a harmonic positioning device, comprising:
[0032] An acquisition module, used for acquiring the harmonic data to be processed of the target power grid;
[0033] A data processing module, used for generating a harmonic characteristic matrix, a power grid adjacency matrix and an adaptive adjacency matrix according to the harmonic data to be processed;
[0034] A feature extraction module, used to extract features from the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid;
[0035] The identification module is used to identify the harmonic status of each node in the target power grid to obtain a harmonic identification result; the harmonic identification result is used to locate the node where the harmonic exists.
[0036] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in any one of the above embodiments when executing the computer program.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method in any one of the above embodiments are implemented.
[0038] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the method in any one of the above embodiments when executed by a processor.
[0039] The above-mentioned harmonic positioning method, device, computer equipment, computer-readable storage medium and computer program product generate a harmonic feature matrix, a power grid adjacency matrix and an adaptive adjacency matrix from the harmonic data to be processed, and then extract features from the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix, which can effectively capture the temporal and spatial characteristics between nodes in the power grid, and finally identify the harmonic state of each node in the target power grid, thereby improving the positioning accuracy of the harmonic source in the power grid. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 A schematic diagram of a flow chart of a harmonic positioning method in one embodiment;
[0042] Figure 2 is a flowchart of a training process of a random forest classifier in one embodiment;
[0043] Figure 3 Schematic diagram of the structure of a spatial convolution block in one embodiment;
[0044] Figure 4 is a schematic structural diagram of a harmonic characteristic model in an embodiment;
[0045] Figure 5 A flowchart of the steps of training a harmonic feature extraction model in one embodiment;
[0046] Figure 6 It is a structural block diagram of a harmonic positioning device in one embodiment;
[0047] Figure 7 It is a structural block diagram of a harmonic positioning device in yet another embodiment;
[0048] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0050] In one embodiment, Figure 1 As shown, a harmonic positioning method is provided. This embodiment takes the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0051] Step 102: Obtain the harmonic data to be processed of the target power grid.
[0052] The target power grid refers to a system network in a store that needs to be analyzed or tested, which includes multiple nodes, such as a power station, a substation, a load point, and a test point.
[0053] The harmonic data to be processed refers to the harmonic current and voltage signals collected from the target power grid, including analog voltage input, analog current input and digital sampling interface. The data acquisition module obtains the current and voltage information of each node in the power grid in real time by connecting to the monitoring equipment of the power grid to form the harmonic data to be processed.
[0054] Step 104: Generate a harmonic feature matrix, a power grid adjacency matrix, and an adaptive adjacency matrix according to the harmonic data to be processed.
[0055] Among them, the harmonic feature matrix is a matrix that represents the harmonic data (such as current, voltage, etc.) of each node in the power grid; the power grid adjacency matrix is a graph structure matrix that describes the connection relationship between nodes in the power grid, that is, whether there is a connection between every two nodes in the power grid and the strength of the connection; the adaptive adjacency matrix is an adjacency matrix that is automatically adjusted according to the dynamic characteristics or status of the node. It reflects the time-varying connection relationship between nodes in the power grid.
[0056] The harmonic feature matrix contains the harmonic data of each node in the power grid at different time steps. These data can help the model identify the time-series change patterns of the nodes (such as periodic changes in current and voltage, harmonic fluctuations, etc.), which is the basis for predicting and analyzing the state of the power grid.
[0057] The grid adjacency matrix defines the physical connection relationship between nodes. The interaction between grid nodes (such as substations, load points, etc.) is represented by the adjacency matrix, reflecting the propagation path of current and voltage.
[0058] The adaptive adjacency matrix adjusts the connection weights between nodes according to the dynamic characteristics of the nodes (such as current, voltage, etc.), which can reflect the time-varying characteristics of the power grid in real time. This dynamic adjustment can better capture changes in the state of the power grid.
[0059] Optionally, the collected harmonic current and harmonic voltage data are linearly normalized to determine the total number of nodes N and the number of monitoring points M in the power grid, and identify pre-estimation nodes, and set the harmonic current and harmonic voltage states of the pre-estimation nodes to zero. Construct the feature matrix X, where , the dimension of Xi is N2, T represents the number of observed time points, and the feature quantity of the estimated node in the feature matrix X is zero, so it is a sparse matrix with many zeros.
[0060] Optionally, a grid adjacency matrix of the power grid may be constructed based on the physical layout and connection relationships of the power grid, such as transmission lines between substations.
[0061] Optionally, an adaptive adjacency matrix can be constructed by calculating the similarity or dynamic features between nodes, which can be adjusted as the grid status changes and capture time-varying spatial dependencies.
[0062] Step 106 , extracting features from the harmonic feature matrix, the power grid adjacency matrix, and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid.
[0063] Optionally, the harmonic feature matrix X is a matrix containing harmonic data of each node of the power grid at different time steps. This matrix may contain the harmonic information of the current, voltage, etc. of the node that varies with time, so the time series features can be extracted from the harmonic feature matrix. Exemplarily, the time series features can be obtained by performing time convolution on the features of each node.
[0064] Optionally, since the power grid adjacency matrix and the adaptive adjacency matrix respectively represent the connection relationship between nodes in the power grid and the dynamic characteristics of the nodes, the spatial characteristics can be extracted based on the power grid adjacency matrix and the adaptive adjacency matrix.
[0065] Optionally, the time series characteristics and the space characteristics may be simultaneously used as the harmonic state of each node.
[0066] Optionally, the time series features and the space features may be concatenated to form a harmonic state.
[0067] Step 108, identifying the harmonic state of each node in the target power grid to obtain a harmonic identification result; the harmonic identification result is used to locate the node with harmonics.
[0068] Optionally, the harmonic state may be identified through a classification model to determine a harmonic identification result.
[0069] Optionally, the harmonic state can be identified by a pre-trained random forest classifier.
[0070] Exemplarily, Random Forest is an integrated learning method that can effectively process high-dimensional data and prevent overfitting by constructing multiple decision trees and combining their output results for classification or regression. Decision trees are the basic building blocks of random forests. Decision trees perform classification or regression by continuously splitting data features until the maximum depth or other stopping conditions are reached. This application adopts the Bagging integration method to generate multiple subsets by random sampling in the training set and train a decision tree on each subset. The final output is the average or majority vote result of all decision tree outputs. Use the training set data to build a random forest classifier, and set the number of random forest hyperparameters (n_estimators), maximum depth (max_depth), minimum number of sample splits (min_samples_split), etc. to initialize the model.
[0071] Among them, the training process of the random forest classifier is as follows Figure 2 As shown, including:
[0072] Step 202: Perform multiple random sampling with replacement on the training set to generate multiple subsets (Bagging).
[0073] Step 204: train a decision tree on each subset. During the training process, when each node is split, some features are randomly selected for splitting.
[0074] Step 206, repeat step 204 until all decision trees are trained.
[0075] Step 208, use cross-validation technology to evaluate the performance of the model to prevent overfitting.
[0076] Step 210: Use the trained random forest classifier to classify and predict all nodes in the network to determine whether each node is a harmonic source.
[0077] In the above harmonic positioning method, a harmonic feature matrix, a power grid adjacency matrix and an adaptive adjacency matrix are generated from the harmonic data to be processed, and then feature extraction is performed on the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix, which can effectively capture the spatiotemporal characteristics between nodes in the power grid. Finally, the harmonic state of each node in the target power grid is identified, thereby improving the positioning accuracy of the harmonic source in the power grid.
[0078] Furthermore, in one embodiment, the generation process of the above-mentioned power grid adjacency matrix includes: calculating the topological distance between each node; performing Gaussian kernel function calculation on each topological distance to obtain each similarity between each node; comparing each similarity with a preset threshold to obtain the power grid adjacency matrix.
[0079] Among them, the topological distance is usually calculated based on the connection relationship between power grid nodes, reflecting the distance between nodes in the power grid diagram.
[0080] For example, the distance from node vi to node vj can be expressed as .
[0081] After calculating the topological distance of each pair of nodes, the next step is to calculate the similarity between nodes using the Gaussian kernel function. The Gaussian kernel function is a common nonlinear function used to calculate the similarity between nodes, which can measure their similarity based on the distance between them.
[0082] The form of the Gaussian kernel function is shown in formula (1):
[0083] Formula (1)
[0084] in, Represents node v i With v j The similarity between them can reflect the strength of the physical connection between nodes. is the standard deviation of the distance, and k is a preset threshold.
[0085] After calculating the similarities between the nodes, each similarity is compared with a preset threshold. If the similarity is less than the preset threshold, the similarity is set to 0.
[0086] For example, the specific process is shown in formula (2):
[0087] Formula (2)
[0088] Through the above steps, the similarities between each node are calculated in turn, and then combined with formula (2), the power grid adjacency matrix can be obtained.
[0089] Furthermore, in one embodiment, the process of generating the above-mentioned adaptive adjacency matrix includes: setting a corresponding initialization vector for each node; performing dot product calculation on each initialization vector to obtain each correlation between each node; and obtaining an adaptive adjacency matrix based on each correlation.
[0090] Optionally, for each node v i Randomly initialize an embedding vector E A , , where c represents the dimension of node embedding, and each row of EA represents the embedding feature of a specific node. Therefore, by multiplying EAT, the spatial correlation between each pair of nodes can be inferred, as shown in formula (3):
[0091] Formula (3)
[0092] Among them, ReLU() and SoftMax() are used to eliminate weak connections and normalize the adaptive matrix respectively.
[0093] Thus, in this embodiment, the adaptive adjacency matrix can be calculated to dynamically capture the mutual influence between nodes in the power grid over time, and can be used for information propagation and feature updating in models such as graph neural networks (GNNs).
[0094] Furthermore, in one embodiment, the above-mentioned feature extraction of the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid includes: through a first preset number of spatiotemporal convolution blocks, feature extraction of the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid.
[0095] Among them, feature extraction is performed on the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix, and the harmonic state of each node in the target power grid is obtained through a pre-trained harmonic feature extraction model.
[0096] In this embodiment, the pre-trained harmonic feature extraction model includes a first preset number of spatiotemporal convolution blocks, and the first preset number is pre-set.
[0097] Furthermore, in one embodiment, the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix are input into the first spatiotemporal convolution block, the first spatiotemporal convolution block performs feature extraction on the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain a reference harmonic state, and the reference harmonic state is input into the next spatiotemporal convolution block until the harmonic state is obtained.
[0098] First, the harmonic feature matrix, the power grid adjacency matrix, and the adaptive adjacency matrix are input into the first spatiotemporal convolution block, which extracts features from the harmonic feature matrix, the power grid adjacency matrix, and the adaptive adjacency matrix to obtain a reference harmonic state. The reference harmonic state is input into the second spatiotemporal convolution block to obtain the reference harmonic state corresponding to the second spatiotemporal convolution block, until the final harmonic state is obtained through the last spatiotemporal convolution block.
[0099] Further, in one embodiment, each spatiotemporal convolution block includes a second preset number of sequential convolution layers and a third preset number of graph convolution layers. Each sequential convolution layer in each spatiotemporal convolution block sequentially extracts temporal features from the harmonic feature matrix to obtain a first feature; each graph convolution layer sequentially extracts spatial features from the power grid adjacency matrix and the adaptive adjacency matrix based on the first feature to obtain a reference harmonic state.
[0100] In this embodiment, firstly, the time feature extraction of the harmonic feature matrix is performed in sequence through the temporal convolution layers in each spatiotemporal convolution block to obtain the first feature. Then, the first feature, the power grid adjacency matrix and the adaptive adjacency matrix are input into the graph convolution layer connected to the last temporal convolution layer, and multiple graph convolution layers are sequentially used to extract spatial features to obtain the reference harmonic state.
[0101] Exemplary, combined Figure 3 , Figure 3 FIG. 1 is a schematic diagram of a structure of a spatial convolution block in an embodiment. In the figure, the second preset number is 2, and the third preset number is 3. In this embodiment, the temporal convolution layer is a gated temporal convolution layer.
[0102] The harmonic feature matrix, power grid adjacency matrix and adaptive adjacency matrix are input into the spatiotemporal convolution block. The two gated temporal convolution layers in the spatiotemporal convolution block extract temporal features in turn, and then the graph convolution layer extracts spatial features to obtain the reference harmonic state. The reference harmonic state is then input into the next spatial convolution block.
[0103] One point that needs to be explained is that the number of temporal convolution layers and graph convolution layers in each spatial convolution block can be the same or different, depending on the specific situation.
[0104] Furthermore, in one embodiment, the temporal convolutional layer can be a TCN (Temporal Convolutional Network) network. The TCN network uses dilated causal convolution and increases the convolution kernel size to capture a wider receptive field, and uses a gating mechanism to efficiently control the information flow between temporal convolutional network layers. At time step t, the dilated causal convolution of the input one-dimensional sequence data x is shown in formula (4).
[0105] Formula (4)
[0106] In the above formula, f represents the convolution kernel, * represents the convolution operation, d is the dilation factor, K is the convolution kernel size, and t is the time step, which can be used to determine the receptive field size of the stacked dilated convolution;
[0107] The proposed gated TCN is expressed as shown in formula (5)
[0108] Formula (5)
[0109] In the formula, represents element-wise product, , , b and c are the parameters of the neural network to be learned, the gating mechanism Control is achieved through nonlinear The activation function is passed to the next layer, l is the current network layer, l+1 represents the next layer of the network, and X is the input feature of the neural network.
[0110] Furthermore, in one embodiment, the temporal convolutional layer may be a GCN (Graph Convolutional Network) network.
[0111] Harmonic sources in power grids often affect adjacent nodes, resulting in spatial aggregation of harmonic data. Therefore, it is necessary to further characterize the spatial dependence of harmonic states based on graph node propagation. GCN based on spectral graph theory can be used to extract topological features of graph networks and process graph structured data in deep learning. Based on the predefined adjacency matrix and feature matrix, filters are constructed in the Fourier domain of the GCN model, and the filters are applied to the graph to learn node features. By aggregating and updating node neighborhood information, the spatial features of graph nodes can be effectively extracted. The weighted combination of infinite random walks can be used to express the stationary distribution in the diffusion process. Therefore, in actual operation, the diffusion process of graph signals is modeled using a weighted combination of a finite number of steps, as shown in formula (6).
[0112] Formula (6)
[0113] Where W is the constructed weighted adjacency matrix, the weight associated with the edge usually represents the similarity between the two connected nodes, represents a diagonal matrix, r is the power of the matrix, ij represents the edge connecting the two nodes, and is the parameter of the network. Since the harmonic influence between nodes decreases with the increase of distance, this application uses a Gaussian kernel function based on a distance threshold to construct the adjacency matrix. The weighted adjacency matrix is fixed and regarded as prior knowledge, which cannot fully represent the overall spatial correlation between nodes at a specific spatial and temporal scale. In order to obtain the hidden spatial dependency, an adaptive adjacency matrix Aadp is further proposed, and the parameters are learned end-to-end through stochastic gradient descent without any prior knowledge. The weighted adjacency matrix and the adaptive adjacency matrix of the regional topological structure constitute the two components of the spatial convolution layer. The former captures the r-order spatial correlation through the r-order diffusion convolution process, and the latter is regarded as the transfer matrix of the hidden diffusion process to capture the hidden spatial dependency in the topology. Therefore, the graph convolution layer shown in formula (7) is obtained.
[0114] Formula (7)
[0115] In the formula, and is the parameter matrix to be trained.
[0116] Exemplary, combined Figure 4 As shown, Figure 4 The figure is a schematic diagram of the structure of the harmonic feature model in one embodiment. In this embodiment, it is composed of two spatiotemporal convolution blocks, each of which contains two gated sequential convolution layers and one graph convolution layer, which are respectively used to extract the dynamic time characteristics and spatial characteristics of the power grid harmonics. The input of the harmonic feature model is the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix. The middle part is two spatiotemporal convolution blocks for extracting the spatiotemporal characteristics of the power grid harmonics, and the output is the estimated value of the harmonic state of the whole network.
[0117] In other embodiments, the gated temporal convolution layer performs temporal feature extraction on the harmonic feature matrix, the power grid adjacency matrix, and the adaptive adjacency matrix to obtain a first feature, and then inputs the first feature into a graph convolution layer, and performs spatial feature extraction on the first feature through the graph convolution layer.
[0118] In one embodiment, feature extraction is performed on a harmonic feature matrix, a power grid adjacency matrix, and an adaptive adjacency matrix, and the harmonic state of each node in the target power grid is obtained by a pre-trained harmonic feature extraction model; the training process of the harmonic feature extraction model includes: obtaining harmonic training samples; the harmonic training samples carry harmonic source labels; inputting the harmonic training samples into the initial model for training to obtain a predicted harmonic state; obtaining a target loss function based on the predicted harmonic state and the harmonic source label, and adjusting the parameters of the initial model according to the target loss function until the training is completed to obtain a harmonic feature extraction model; obtaining a target loss function based on the predicted harmonic state and the harmonic source label, including: setting a loss ratio according to the number of different categories in the harmonic training samples; obtaining an initial loss function based on the difference between the predicted harmonic state and the harmonic source label; and obtaining a target loss function according to the loss ratio and the initial loss function.
[0119] Optionally, after obtaining the harmonic training samples, the harmonic states of all nodes are converted into a true value matrix Y as the true harmonic state label, and the harmonic source label is annotated for each node for training and verifying the model.
[0120] Among them, the structure of the initial model includes a first number of spatiotemporal convolution blocks, each spatiotemporal convolution block includes a second preset number of temporal convolution layers and a third preset number of graph convolution layers.
[0121] Among them, the harmonic training sample is the data used to train the model, and the harmonic source label refers to the label information of each node, which is used to identify whether the node is a harmonic source during training.
[0122] The harmonic training samples are input into the initial model for training. The model predicts the harmonic state of each node based on the input harmonic data. The predicted harmonic state includes whether the node is a harmonic source and its harmonic characteristics. Then, based on the difference between the predicted harmonic state and the true harmonic source label, the target loss function is calculated. Through back propagation, the model parameters are adjusted according to the target loss function. After multiple iterative optimizations, a trained harmonic feature extraction model is finally obtained, which can accurately predict the harmonic state of each node in the power grid.
[0123] Furthermore, in this embodiment, the target loss function is obtained based on the predicted harmonic state and the harmonic source label, including: setting the loss ratio according to the number of different categories in the harmonic training samples; obtaining the initial loss function based on the difference between the predicted harmonic state and the harmonic source label; and obtaining the target loss function based on the loss ratio and the initial loss function.
[0124] According to the number of nodes of different categories in the harmonic training samples, the corresponding loss ratio is set to ensure that the model pays more attention to the minority category. Then, based on the difference between the predicted harmonic state and the actual harmonic source label, the initial loss function is calculated, which includes classification loss and regression loss. Then, the loss ratio is combined with the initial loss function to obtain the target loss function, and the model parameters are adjusted by minimizing the loss function during the training process until the training is completed, and finally a feature extraction model that can accurately predict the harmonic state of each node in the power grid is obtained.
[0125] In yet another exemplary embodiment, the weighted loss function is as shown in formula (8).
[0126] Formula (8)
[0127] Where N is the number of nodes, T is the length of the model prediction sequence, is the predicted value, is the true value, α is the weight, and is defined as in formula (9).
[0128] Formula (9)
[0129] in, is a predefined coefficient. When is small, the misprediction cost of non-zero valued graph nodes will be much larger than the misprediction cost of zero-valued graph nodes.,Therefore, the spatiotemporal convolutional network model will pay more attention to the spatiotemporal,units with non-zero harmonic states during the back-propagation,process.
[0130] In one embodiment, in combination Figure 5 As shown, Figure 5The figure is a flowchart of the steps of training a harmonic feature extraction model in one embodiment.
[0131] Step S502, randomly initializing the parameters of the spatiotemporal convolutional network (TGCN) model, including the weights and biases of the convolutional layer and the graph convolutional layer;
[0132] Step S504, forward propagation is performed, the feature matrix X, the weighted adjacency matrix W and the adaptive adjacency matrix Aadp are input into the spatiotemporal convolutional network model, and the spatiotemporal features are extracted through TCN and GCN to calculate the predicted harmonic state at each node;
[0133] Step S506, calculate the weighted loss function, calculate the gradient through the back propagation algorithm, update the model parameters, use the Adam optimizer to update the model parameters, and reduce the weighted loss function value;
[0134] Step S508, repeating steps S504 and S506 until the loss function converges or reaches a preset number of training rounds;
[0135] Step S510, after the training is completed, the prediction performance of the model is evaluated using the validation set, and the model parameters are adjusted to optimize the training effect.
[0136] In an exemplary embodiment, a harmonic positioning device is provided, such as Figure 6 shown. Figure 6 It includes a data acquisition module, a central processing unit, a data storage module, a harmonic feature extraction module, a harmonic source positioning module and a communication module.
[0137] The data acquisition module is responsible for collecting harmonic current and voltage signals from the grid nodes, including analog voltage input, analog current input and digital sampling interface. The module obtains the current and voltage information of each node in the grid in real time by connecting to the monitoring equipment of the grid to form harmonic data. The specific structure is as follows:
[0138] Analog voltage input: supports multi-channel voltage signal input, can collect voltage fluctuations at different nodes, and provide voltage harmonic data.
[0139] Analog current input: supports multi-channel current signal input and collects harmonic current characteristics of different nodes in the power grid.
[0140] Digital sampling interface: Built-in high-precision ADC (analog-to-digital converter) digitizes analog signals at a high sampling rate to ensure that the acquisition accuracy of harmonic signals meets the detection requirements. This module provides reliable data input for subsequent data processing modules.
[0141] The central processing unit is the core control module of the device, which uses a high-performance, low-power dual-core CPU to execute various data processing tasks of the device. It is mainly responsible for running data intelligence algorithms, coordinating the operation of various modules, and realizing real-time positioning of harmonic sources. The specific structure includes:
[0142] Data processing: The CPU receives data from the acquisition module and performs real-time analysis through the embedded intelligent algorithm.
[0143] Task scheduling: coordinate the operations of the data storage module, feature extraction module and positioning module to ensure the real-time response capability of the device.
[0144] Algorithm execution: Run the harmonic feature extraction and positioning algorithm, including feature extraction of spatiotemporal convolutional networks and classification calculation of random forests, to meet the requirements of efficient and accurate positioning of harmonic sources.
[0145] The data storage module is equipped with a 128GB large-capacity storage space to store the collected harmonic signals and processed characteristic data, supporting long-term monitoring needs. Detailed functions include:
[0146] Data storage: used to preserve original collected data and processing results for a long time, facilitating subsequent analysis and historical data backtracking.
[0147] Data export: Supports data export via USB interface and 4G module, which is convenient for users to conduct external data analysis.
[0148] Data management: Supports partition storage and automatic data overwriting functions to ensure efficient data management during long-term use.
[0149] Among them, the harmonic feature extraction module is the data analysis core of the device, which is embedded with a feature extractor based on an improved spatiotemporal convolutional network. This module includes multiple spatiotemporal convolution blocks, which are used to extract temporal and spatial features from the collected harmonic signals. The specific functions are as follows:
[0150] Spatiotemporal convolution block: Contains gated temporal convolution layers and dilated causal convolutions, which are used to extract the dynamic time characteristics of harmonic current and voltage, respectively. This module can capture the harmonic changes at different nodes in the power grid.
[0151] Graph convolution layer: Combines the weighted adjacency matrix and the adaptive adjacency matrix to capture the spatial dependencies between power grid nodes, extract hidden correlations in power grid topology information, and ensure the accuracy of feature extraction.
[0152] Feature matrix generation: The extracted time features and spatial features are summarized to generate a feature matrix to provide input for the harmonic source location module.
[0153] The communication module supports 4G, Wi-Fi and Ethernet communications, providing remote monitoring and data synchronization functions for the device. Its main functions include:
[0154] Multiple communication interfaces: supports 4G network, Wi-Fi and Ethernet connections to meet the communication needs of different scenarios.
[0155] Remote monitoring and management: By connecting to a tablet or PC, real-time data synchronization and remote monitoring are achieved. Users can view information such as harmonic source location and harmonic change trend through the application.
[0156] Alarm and notification: When harmonics exceed the limit or abnormal conditions are detected, the communication module can send information to the user end for real-time alarm, so that users can handle it in time.
[0157] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0158] Based on the same inventive concept, the embodiment of the present application also provides a harmonic positioning device for implementing the harmonic positioning method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more harmonic positioning device embodiments provided below can refer to the limitations on the harmonic positioning method above, and will not be repeated here.
[0159] In an exemplary embodiment, Figure 7 As shown, a harmonic positioning device is provided, including: an acquisition module 710, a data processing module 720, a feature extraction module 730 and an identification module 740, wherein:
[0160] The acquisition module is used to acquire the harmonic data to be processed of the target power grid.
[0161] The data processing module is used to generate a harmonic characteristic matrix, a power grid adjacency matrix and an adaptive adjacency matrix according to the harmonic data to be processed.
[0162] The feature extraction module is used to extract features from the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain the harmonic status of each node in the target power grid.
[0163] The identification module is used to identify the harmonic status of each node in the target power grid and obtain harmonic identification results; the harmonic identification results are used to locate the nodes with harmonics.
[0164] In one embodiment, the data processing module includes:
[0165] The distance calculation unit is used to calculate the topological distance between nodes.
[0166] The similarity calculation unit is used to perform Gaussian kernel function calculation on each topological distance to obtain each similarity between each node.
[0167] The comparison unit is used to compare each similarity with a preset threshold value to obtain a power grid adjacency matrix.
[0168] In one embodiment, the data processing module further includes:
[0169] The initialization unit is used to set a corresponding initialization vector for each node.
[0170] The dot product calculation unit is used to perform dot product calculation on each initialization vector to obtain each correlation between each node.
[0171] The matrix generating unit is used to obtain an adaptive adjacency matrix according to each correlation.
[0172] In one embodiment, the feature extraction module includes:
[0173] The spatiotemporal extraction unit is used to extract features from the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix through a first preset number of spatiotemporal convolution blocks to obtain the harmonic state of each node in the target power grid.
[0174] In one embodiment, the spatiotemporal convolution block includes a second preset number of temporal convolution layers and a third preset number of graph convolution layers; and the spatiotemporal extraction unit includes:
[0175] The distribution extraction subunit is used to input the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix into the first spatiotemporal convolution block, and the first spatiotemporal convolution block extracts features from the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain a reference harmonic state, and inputs the reference harmonic state into the next spatiotemporal convolution block until the harmonic state is obtained; wherein each sequential convolution layer in each spatiotemporal convolution block extracts time features from the harmonic feature matrix in turn to obtain a first feature; and each graph convolution layer extracts spatial features from the power grid adjacency matrix and the adaptive adjacency matrix in turn based on the first feature to obtain a reference harmonic state.
[0176] In one embodiment, the above device further includes a model training module, and the model training module includes:
[0177] The sample acquisition unit is used to acquire harmonic training samples; the harmonic training samples carry harmonic source labels.
[0178] The prediction unit is used to input the harmonic training samples into the initial model for training to obtain the predicted harmonic state.
[0179] The training unit is used to obtain a target loss function based on the predicted harmonic state and the harmonic source label, and adjust the parameters of the initial model according to the target loss function until the training is completed to obtain a harmonic feature extraction model.
[0180] In one embodiment, the training unit further includes:
[0181] The ratio calculation subunit is used to set the loss ratio according to the number of different categories in the harmonic training samples.
[0182] The loss calculation subunit is used to obtain an initial loss function based on the difference between the predicted harmonic state and the harmonic source label.
[0183] The target loss subunit is used to obtain the target loss function according to the loss ratio and the initial loss function.
[0184] Each module in the above harmonic positioning device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0185] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store harmonic data to be processed. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a harmonic positioning method is implemented.
[0186] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0187] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: obtaining the harmonic data to be processed of the target power grid; generating a harmonic feature matrix, a power grid adjacency matrix, and an adaptive adjacency matrix according to the harmonic data to be processed; performing feature extraction on the harmonic feature matrix, the power grid adjacency matrix, and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid; identifying the harmonic state of each node in the target power grid to obtain a harmonic identification result; and the harmonic identification result is used to locate the node where the harmonic exists.
[0188] In one embodiment, when the processor executes the computer program, the following steps are also implemented: calculating the topological distance between each node; performing Gaussian kernel function calculation on each topological distance to obtain each similarity between each node; comparing each similarity with a preset threshold to obtain a power grid adjacency matrix.
[0189] In one embodiment, when the processor executes the computer program, the following steps are also implemented: setting a corresponding initialization vector for each node; performing dot product calculations on each initialization vector to obtain each correlation between each node; and obtaining an adaptive adjacency matrix based on each correlation.
[0190] In one embodiment, when the processor executes the computer program, the following steps are also implemented: through a first preset number of spatiotemporal convolution blocks, feature extraction is performed on the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid.
[0191] In one embodiment, when the processor executes the computer program, the following steps are also implemented: the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix are input into the first spatiotemporal convolution block, the first spatiotemporal convolution block performs feature extraction on the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain a reference harmonic state, and the reference harmonic state is input into the next spatiotemporal convolution block until the harmonic state is obtained; wherein each temporal convolution layer in each spatiotemporal convolution block sequentially extracts time features from the harmonic feature matrix to obtain a first feature; and each graph convolution layer sequentially extracts spatial features from the power grid adjacency matrix and the adaptive adjacency matrix based on the first feature to obtain a reference harmonic state.
[0192] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining harmonic training samples; the harmonic training samples carry harmonic source labels; inputting the harmonic training samples into the initial model for training to obtain a predicted harmonic state; obtaining a target loss function based on the predicted harmonic state and the harmonic source label, and adjusting the parameters of the initial model according to the target loss function until the training is completed to obtain a harmonic feature extraction model; obtaining a target loss function based on the predicted harmonic state and the harmonic source label, including: setting a loss ratio according to the number of different categories in the harmonic training samples; obtaining an initial loss function based on the difference between the predicted harmonic state and the harmonic source label; obtaining a target loss function based on the loss ratio and the initial loss function.
[0193] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining the harmonic data to be processed of the target power grid; generating a harmonic feature matrix, a power grid adjacency matrix and an adaptive adjacency matrix according to the harmonic data to be processed; performing feature extraction on the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid; identifying the harmonic state of each node in the target power grid to obtain a harmonic identification result; the harmonic identification result is used to locate the node where the harmonic exists.
[0194] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: calculating the topological distance between each node; performing Gaussian kernel function calculation on each topological distance to obtain each similarity between each node; comparing each similarity with a preset threshold to obtain a power grid adjacency matrix.
[0195] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: setting a corresponding initialization vector for each node; performing dot product calculations on each initialization vector to obtain each correlation between each node; and obtaining an adaptive adjacency matrix based on each correlation.
[0196] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: through a first preset number of spatiotemporal convolution blocks, feature extraction is performed on the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain the harmonic status of each node in the target power grid.
[0197] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix are input into the first spatiotemporal convolution block, the first spatiotemporal convolution block performs feature extraction on the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain a reference harmonic state, and the reference harmonic state is input into the next spatiotemporal convolution block until the harmonic state is obtained; wherein each sequential convolution layer in each spatiotemporal convolution block sequentially extracts time features from the harmonic feature matrix to obtain a first feature; and each graph convolution layer sequentially extracts spatial features from the power grid adjacency matrix and the adaptive adjacency matrix based on the first feature to obtain a reference harmonic state.
[0198] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining harmonic training samples; the harmonic training samples carry harmonic source labels; inputting the harmonic training samples into the initial model for training to obtain predicted harmonic states; obtaining a target loss function based on the predicted harmonic states and the harmonic source labels, and adjusting the parameters of the initial model according to the target loss function until the training is completed to obtain a harmonic feature extraction model; obtaining a target loss function based on the predicted harmonic states and the harmonic source labels, including: setting a loss ratio according to the number of different categories in the harmonic training samples; obtaining an initial loss function based on the difference between the predicted harmonic states and the harmonic source labels; obtaining a target loss function based on the loss ratio and the initial loss function.
[0199] In one embodiment, a computer program product is provided, comprising a computer program, which implements the following steps when executed by a processor: obtaining harmonic data to be processed of a target power grid; generating a harmonic feature matrix, a power grid adjacency matrix, and an adaptive adjacency matrix based on the harmonic data to be processed; performing feature extraction on the harmonic feature matrix, the power grid adjacency matrix, and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid; identifying the harmonic state of each node in the target power grid to obtain a harmonic identification result; and the harmonic identification result is used to locate nodes where harmonics exist.
[0200] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: calculating the topological distance between each node; performing Gaussian kernel function calculation on each topological distance to obtain each similarity between each node; comparing each similarity with a preset threshold to obtain a power grid adjacency matrix.
[0201] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: setting a corresponding initialization vector for each node; performing dot product calculations on each initialization vector to obtain each correlation between each node; and obtaining an adaptive adjacency matrix based on each correlation.
[0202] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: through a first preset number of spatiotemporal convolution blocks, feature extraction is performed on the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain the harmonic status of each node in the target power grid.
[0203] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix are input into the first spatiotemporal convolution block, the first spatiotemporal convolution block performs feature extraction on the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain a reference harmonic state, and the reference harmonic state is input into the next spatiotemporal convolution block until the harmonic state is obtained; wherein each sequential convolution layer in each spatiotemporal convolution block sequentially extracts time features from the harmonic feature matrix to obtain a first feature; and each graph convolution layer sequentially extracts spatial features from the power grid adjacency matrix and the adaptive adjacency matrix based on the first feature to obtain a reference harmonic state.
[0204] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining harmonic training samples; the harmonic training samples carry harmonic source labels; inputting the harmonic training samples into the initial model for training to obtain predicted harmonic states; obtaining a target loss function based on the predicted harmonic states and the harmonic source labels, and adjusting the parameters of the initial model according to the target loss function until the training is completed to obtain a harmonic feature extraction model; obtaining a target loss function based on the predicted harmonic states and the harmonic source labels, including: setting a loss ratio according to the number of different categories in the harmonic training samples; obtaining an initial loss function based on the difference between the predicted harmonic states and the harmonic source labels; obtaining a target loss function based on the loss ratio and the initial loss function.
[0205] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0206] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0207] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A harmonic positioning method, characterized in that: The method comprises: Obtaining the harmonic data to be processed of the target power grid; Generate a harmonic feature matrix, a power grid adjacency matrix and an adaptive adjacency matrix according to the harmonic data to be processed; Performing feature extraction on the harmonic feature matrix, the power grid adjacency matrix, and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid; The harmonic state of each node in the target power grid is identified to obtain a harmonic identification result; the harmonic identification result is used to locate the node where the harmonic exists.
2. The method according to claim 1, characterized in that The generation process of the power grid adjacency matrix includes: Calculating the topological distance between each of the nodes; Performing Gaussian kernel function calculation on each of the topological distances to obtain each similarity between the nodes; Each of the similarities is compared with a preset threshold to obtain the power grid adjacency matrix.
3. The method according to claim 1, characterized in that The process of generating the adaptive adjacency matrix includes: Setting a corresponding initialization vector for each of the nodes; Performing dot product calculation on each of the initialization vectors to obtain each correlation between the nodes; The adaptive adjacency matrix is obtained according to each of the correlations.
4. The method according to claim 1, characterized in that: The extracting features of the harmonic feature matrix, the power grid adjacency matrix, and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid includes: The harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix are subjected to feature extraction through a first preset number of spatiotemporal convolution blocks to obtain the harmonic state of each node in the target power grid.
5. The method according to claim 4, characterized in that Each of the spatiotemporal convolution blocks includes a second preset number of temporal convolution layers and a third preset number of graph convolution layers; the first preset number of spatiotemporal convolution blocks are used to extract features from the harmonic feature matrix, the power grid adjacency matrix, and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid, including: Inputting the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix into the first spatiotemporal convolution block, the first spatiotemporal convolution block extracts features from the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain a reference harmonic state, and inputting the reference harmonic state into the next spatiotemporal convolution block until the harmonic state is obtained; Among them, each of the temporal convolution layers in each of the spatiotemporal convolution blocks sequentially extracts time features from the harmonic feature matrix to obtain a first feature; and each of the graph convolution layers sequentially extracts spatial features from the power grid adjacency matrix and the adaptive adjacency matrix based on the first feature to obtain the reference harmonic state.
6. The method according to claim 1, characterized in that The feature extraction of the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid is obtained by a pre-trained harmonic feature extraction model; the training process of the harmonic feature extraction model includes: Acquire a harmonic training sample; the harmonic training sample carries a harmonic source label; Inputting the harmonic training samples into the initial model for training to obtain a predicted harmonic state; Obtaining a target loss function based on the predicted harmonic state and the harmonic source label, and adjusting the parameters of the initial model according to the target loss function until the training is completed to obtain the harmonic feature extraction model; The obtaining a target loss function based on the predicted harmonic state and the harmonic source label includes: Setting a loss ratio according to the number of different categories in the harmonic training sample; Based on the difference between the predicted harmonic state and the harmonic source label, obtaining an initial loss function; The target loss function is obtained according to the loss ratio and the initial loss function.
7. A harmonic positioning device, characterized in that: The device comprises: An acquisition module, used for acquiring the harmonic data to be processed of the target power grid; A data processing module, used for generating a harmonic characteristic matrix, a power grid adjacency matrix and an adaptive adjacency matrix according to the harmonic data to be processed; A feature extraction module, used for extracting features from the harmonic feature matrix, the power grid adjacency matrix and the adaptive adjacency matrix to obtain the harmonic state of each node in the target power grid; The identification module is used to identify the harmonic status of each node in the target power grid to obtain a harmonic identification result; the harmonic identification result is used to locate the node where the harmonic exists.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Power distribution network fault positioning method combined with multi-terminal traveling wave sampling and terminal
CN121454233A