Construction method and device of power grid harmonic source positioning model and computer equipment
By constructing a grid harmonic source positioning model, integrating the grid node feature matrix and knowledge graph, and using neural network training, the problem of low accuracy of traditional harmonic source positioning methods is solved, and efficient positioning of harmonic sources is achieved.
Patent Information
- Application Number
- CN202510392810.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-08-01
AI Technical Summary
The traditional harmonic source positioning method has low positioning accuracy and cannot effectively solve the problems of equipment heating, insulation aging and communication interference caused by harmonics in the power grid.
Build a grid harmonic source positioning model, and by obtaining the grid historical harmonic data and harmonic source labels, fuse the node feature matrix, grid adjacency matrix and knowledge graph, use spatiotemporal convolution and graph convolution layers to extract features, train neural network models, and improve positioning accuracy.
The model's adaptability to different grid environments and operating states is enhanced, the accuracy of harmonic source positioning is improved, and the harmonic characteristics of the power grid and its related external factors are comprehensively considered.
Smart Images

Figure CN120409545A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of harmonic source location, and particularly to a method, device, and computer device for constructing a power grid harmonic source location model. Background Art
[0002] The extensive use of power electronic devices has introduced a large number of harmonics into the power grid. Harmonics can cause a series of problems such as equipment overheating, insulation aging, maloperation of relay protection, and interference to communication systems, seriously threatening the safe and stable operation of the power system. Therefore, accurate harmonic source location is crucial for harmonic control and the safe operation of the power grid.
[0003] In traditional technologies, machine learning and deep learning technologies are used to automatically extract features from large-scale data for harmonic source location.
[0004] However, traditional harmonic source location methods have the problem of relatively low location accuracy. Summary of the Invention
[0005] Based on this, in view of the above technical problems, it is necessary to provide a method, device, and computer device for constructing a power grid harmonic source location model that can improve the location accuracy.
[0006] In a first aspect, the present application provides a method for constructing a power grid harmonic source location model, including:
[0007] Obtain historical power grid harmonic data and power grid harmonic source labels, and determine harmonic feature information according to the historical power grid harmonic data; the harmonic feature information includes a power grid node feature matrix, a power grid adjacency matrix, and a power grid knowledge graph;
[0008] Fuse the node feature matrix and the power grid knowledge graph to obtain a fused feature;
[0009] Train an initial neural network model according to the fused feature, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source location model; the power grid harmonic source location model is used to predict whether each node in the power grid is a harmonic source.
[0010] In one embodiment, the training of the initial neural network model according to the fused feature, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source location model includes:
[0011] Input the fused feature and the power grid adjacency matrix into the initial neural network model, and extract spatio-temporal features through a spatio-temporal convolutional layer and a graph convolutional layer to obtain an initial harmonic source location result; the initial harmonic source location result includes an initial predicted harmonic source;
[0012] Determine the loss of the initial neural network model according to the initial harmonic source positioning result and the power grid harmonic source label;
[0013] Determine whether the training completion condition is satisfied according to the loss or the number of training times;
[0014] If not, optimize the parameters of the initial neural network model according to the loss and a preset optimizer, and return to execute the step of inputting the fusion feature and the power grid adjacency matrix into the initial neural network model; if satisfied, determine the initial neural network model as the power grid harmonic source positioning model.
[0015] In one embodiment, the power grid knowledge graph includes static factors and dynamic factors, and the fusing the node feature matrix and the power grid knowledge graph to obtain a fusion feature includes:
[0016] Fuse the static factors and the node feature matrix to determine a static fusion feature;
[0017] Fuse the dynamic factors and the node feature matrix to determine a dynamic fusion feature;
[0018] Concatenate the static fusion feature and the dynamic fusion feature to obtain the fusion feature.
[0019] In one embodiment, the power grid historical harmonic data includes harmonic voltage, harmonic current, connection relationships of each power grid node, and attribute information of each power grid node; the determining harmonic feature information according to the power grid historical harmonic data includes:
[0020] Determine the power grid node feature matrix according to the harmonic voltage and the harmonic current;
[0021] Determine the power grid adjacency matrix according to the connection relationships of each power grid node;
[0022] Determine the power grid knowledge graph according to the connection relationships of each power grid node and the attribute information of each power grid node.
[0023] In one embodiment, the method further includes:
[0024] Determine a loss function with the goal of minimizing the error between the predicted harmonic source and the actual harmonic source;
[0025] The training the initial neural network model according to the fusion feature, the power grid adjacency matrix and the power grid harmonic source label to obtain a power grid harmonic source positioning model includes:
[0026] Training the initial neural network model according to the fusion feature, the power grid adjacency matrix, the power grid harmonic source label, and the loss function to obtain the power grid harmonic source localization model.
[0027] In one embodiment, the method further includes:
[0028] Obtaining the harmonic data to be predicted of the power grid;
[0029] Determining the fusion feature to be predicted according to the harmonic data to be predicted;
[0030] Inputting the fusion feature to be predicted into the power grid harmonic source localization model to obtain the prediction results for each node in the power grid; the prediction results indicate whether each of the nodes is a harmonic source.
[0031] In a second aspect, the present application further provides a device for constructing a power grid harmonic source localization model, including:
[0032] A first acquisition module, configured to acquire the historical harmonic data of the power grid and the power grid harmonic source label, and determine the harmonic feature information according to the historical harmonic data of the power grid; the harmonic feature information includes the power grid node feature matrix, the power grid adjacency matrix, and the power grid knowledge graph;
[0033] A fusion module, configured to fuse the node feature matrix and the power grid knowledge graph to obtain a fusion feature;
[0034] A training module, configured to train an initial neural network model according to the fusion feature, the power grid adjacency matrix, and the power grid harmonic source label to obtain a power grid harmonic source localization model.
[0035] In a third aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0036] Acquiring the historical harmonic data of the power grid and the power grid harmonic source label, and determining the harmonic feature information according to the historical harmonic data of the power grid; the harmonic feature information includes the power grid node feature matrix, the power grid adjacency matrix, and the power grid knowledge graph;
[0037] Fusing the node feature matrix and the power grid knowledge graph to obtain a fusion feature;
[0038] Training an initial neural network model according to the fusion feature, the power grid adjacency matrix, and the power grid harmonic source label to obtain a power grid harmonic source localization model; the power grid harmonic source localization model is used to predict whether each node in the power grid is a harmonic source.
[0039] Fourthly, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0040] Obtain historical power grid harmonic data and power grid harmonic source labels, and determine harmonic feature information according to the historical power grid harmonic data; the harmonic feature information includes a power grid node feature matrix, a power grid adjacency matrix, and a power grid knowledge graph;
[0041] Fuse the node feature matrix and the power grid knowledge graph to obtain a fused feature;
[0042] Train an initial neural network model according to the fused feature, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source localization model; the power grid harmonic source localization model is used to predict whether each node in the power grid is a harmonic source.
[0043] Fifthly, the present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0044] Obtain historical power grid harmonic data and power grid harmonic source labels, and determine harmonic feature information according to the historical power grid harmonic data; the harmonic feature information includes a power grid node feature matrix, a power grid adjacency matrix, and a power grid knowledge graph;
[0045] Fuse the node feature matrix and the power grid knowledge graph to obtain a fused feature;
[0046] Train an initial neural network model according to the fused feature, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source localization model; the power grid harmonic source localization model is used to predict whether each node in the power grid is a harmonic source.
[0047] The above method, device, and computer equipment for constructing a power grid harmonic source localization model obtain historical power grid harmonic data and power grid harmonic source labels, and determine harmonic feature information based on the historical power grid harmonic data; the harmonic feature information includes a power grid node feature matrix, a power grid adjacency matrix, and a power grid knowledge graph; the node feature matrix and the power grid knowledge graph are fused to obtain a fused feature; the initial neural network model is trained according to the fused feature, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source localization model; the power grid harmonic source localization model is used to predict whether each node in the power grid is a harmonic source. The above power grid harmonic source localization model predicts harmonic sources based on the harmonic feature information and knowledge graph information of power grid nodes, comprehensively considering the power grid harmonic features and their related external factors, thereby improving the accuracy of harmonic source localization. Moreover, the power grid knowledge graph information is fused with the node feature matrix, enabling the model to not only rely on historical harmonic data during training but also make full use of the power grid's structural information and external factors, enhancing the model's adaptability to different power grid environments and operating states and further improving the accuracy of harmonic source localization. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0049] Figure 1 It is an application environment diagram of the method for constructing a power grid harmonic source localization model in an embodiment;
[0050] Figure 2 It is a flowchart of the method for constructing a power grid harmonic source localization model in an embodiment;
[0051] Figure 3 It is a flowchart of the method for constructing a power grid harmonic source localization model in another embodiment;
[0052] Figure 4 It is a flowchart of the method for constructing a power grid harmonic source localization model in another embodiment;
[0053] Figure 5 It is a flowchart of the method for constructing a power grid harmonic source localization model in another embodiment;
[0054] Figure 6 It is a flowchart of the method for constructing a power grid harmonic source localization model in another embodiment;
[0055] Figure 7Schematic flowchart of a method for constructing a power grid harmonic source localization model in another embodiment;
[0056] Figure 8 Schematic flowchart of a method for constructing a power grid harmonic source localization model in another embodiment;
[0057] Figure 9 Block diagram of the structure of a device for constructing a power grid harmonic source localization model in one embodiment. Detailed implementation manners
[0058] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to 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.
[0059] The method for constructing a power grid harmonic source localization model provided by the embodiments of the present application can be applied to an application environment as Figure 1 shown. Among them, the computer device can be a server, and its internal structure diagram can be shown in Figure Y. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, 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. Among them, 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 the data for constructing the power grid harmonic source localization model. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it realizes a method for constructing a power grid harmonic source localization model.
[0060] Those skilled in the art can understand that Figure 1 the structure shown in is only a block diagram of some structures 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 some components, or have different component arrangements.
[0061] In one embodiment, as Figure 2 shown, a method for constructing a power grid harmonic source localization model is provided. Taking the application of this method to the Figure 1 server in as an example, it includes:
[0062] S201, obtain the historical harmonic data of the power grid and the power grid harmonic source labels, and determine the harmonic feature information according to the historical harmonic data of the power grid; the harmonic feature information includes the power grid node feature matrix, the power grid adjacency matrix, and the power grid knowledge graph.
[0063] Among them, the historical harmonic data of the power grid includes the historical harmonic current data, historical harmonic voltage data of multiple power grid nodes in the power grid, and the time stamps corresponding to the above data.
[0064] In the embodiments of the present application, harmonic monitoring devices are pre-installed in the power grid, and the historical harmonic current data, historical harmonic voltage data of multiple power grid nodes, and the time stamps corresponding to the above data can be obtained through the harmonic monitoring devices. Further, each power grid node can be labeled according to the historical harmonic data of the power grid or expert experience to obtain the power grid harmonic source labels; alternatively, the power grid harmonic source labels can be obtained from a preset database or a third-party device.
[0065] In the embodiments of the present application, feature extraction is performed on the historical harmonic data of the power grid to obtain the connection relationship between each power grid node and the harmonic characteristics of each power grid node itself, so as to determine the harmonic feature information according to the connection relationship between each power grid node and the harmonic characteristics of each power grid node itself.
[0066] Optionally, the power grid knowledge graph can be represented in the form of multiple triples. The multiple triples can include relationship triples, attribute triples, and relationships between attributes. Among them, the relationship triples represent the physical connection relationship between power grid nodes; the attribute triples represent the corresponding relationship between power grid nodes and their attributes. For example: (node A, device type, photovoltaic inverter), (node B, load type, industrial load), (node A, operating state, start); the relationship between attributes represents the co-occurrence relationship between different attributes.
[0067] Optionally, the operating state of each node, the type, quantity of equipment installed at each node, and the rated power, operating efficiency, harmonic generation characteristics, etc. of the equipment can be determined according to the historical harmonic data of the power grid, and the load type of each power grid node and the type, capacity, and operating state of the transformer can be determined according to the historical harmonic data of the power grid; among them, the device type can include, for example, photovoltaic inverters, wind power equipment, energy storage systems, etc., and the load type can include industrial loads, commercial loads, residential loads, etc.
[0068] Optionally, after obtaining the historical harmonic data of the power grid, the historical harmonic data of the power grid can be cleaned to process missing values and outliers, so as to ensure the accuracy of the data. At the same time, linear normalization processing is performed on the harmonic current and harmonic voltage data to normalize all data to the interval [0,1] to obtain the processed historical harmonic data of the power grid, and then the harmonic feature information is determined according to the processed historical harmonic data of the power grid.
[0069] S202. Integrate the node feature matrix and the power grid knowledge graph to obtain the integrated features.
[0070] In the embodiment of the present application, the node feature matrix and the power grid knowledge graph are input into a preset knowledge fusion unit (Knowledge Fusion Cell, KF-Cell), and the output is the power grid harmonic feature integrated with external knowledge at time t. .
[0071] S203. Train the initial neural network model according to the integrated features, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source localization model; the power grid harmonic source localization model is used to predict whether each node in the power grid is a harmonic source.
[0072] In the embodiment of the present application, a loss function of the initial neural network model is constructed, and thus the initial neural network model is trained according to the integrated features, the power grid adjacency matrix, the power grid harmonic source labels, and the loss function to obtain a power grid harmonic source localization model. Optionally, the integrated features, the power grid adjacency matrix, and the power grid harmonic source labels can be input into the initial neural network model to obtain an initial loss, and the parameters in the initial neural network model are optimized according to the initial loss, and iterative training is performed multiple times to obtain a power grid harmonic source localization model.
[0073] In the above method for constructing a power grid harmonic source localization model, historical power grid harmonic data and power grid harmonic source labels are obtained, and harmonic feature information is determined according to the historical power grid harmonic data; the harmonic feature information includes a power grid node feature matrix, a power grid adjacency matrix, and a power grid knowledge graph; the node feature matrix and the power grid knowledge graph are integrated to obtain integrated features; the initial neural network model is trained according to the integrated features, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source localization model; the power grid harmonic source localization model is used to predict whether each node in the power grid is a harmonic source. The above power grid harmonic source localization model predicts the harmonic source according to the harmonic feature information and knowledge graph information of the power grid nodes, comprehensively considering the power grid harmonic features and their related external factors, thereby improving the accuracy of harmonic source localization, and integrating the power grid knowledge graph information with the node feature matrix, so that the model not only depends on historical harmonic data during the training process, but also can make full use of the structure information and external factors of the power grid, enhancing the adaptability of the model to different power grid environments and operating states, and further improving the accuracy of harmonic source localization.
[0074] In one embodiment, an implementation manner of the above S203 is provided, as Figure 3 shown, the above "Train the initial neural network model according to the integrated features, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source localization model" includes:
[0075] S301. Input the fused features and the power grid adjacency matrix into the initial neural network model, extract spatio-temporal features through the spatio-temporal convolutional layer and the graph convolutional layer, and obtain the initial harmonic source localization result; the initial harmonic source localization result includes the initial predicted harmonic source.
[0076] In the embodiment of the present application, the initial neural network model can be as shown in Equation 1:
[0077] (Equation 1)
[0078] Where, A is the power grid adjacency matrix, is the fused feature, is the power grid adjacency matrix with self-loops, is the degree matrix, is the weight matrix of the convolutional layer, is the activation function, is the output of the non-linear combination of node features in the l-th layer. Further, a recurrent neural network is used to capture the time dependence. Specifically, a gated recurrent unit (GRU) is selected to capture the time dependence and update the node features at time t, as shown in Equations 2 - 5:
[0079] (Equation 2)
[0080] (Equation 3)
[0081] (Equation 4)
[0082] (Equation 5)
[0083] The update gate controls the proportion of the previous hidden state and the current candidate hidden state in the current hidden state. The reset gate controls the influence degree of the hidden state at the previous time step on the current candidate hidden state. is the candidate hidden state, which is the new information at the current time step. After being adjusted by the reset gate, it combines the current input and the hidden state at the previous time step after being reset to generate a new candidate hidden state. 、 and represent the weight matrices of the update gate, the reset gate, and the candidate hidden state. represents the hidden state at the previous time step. represents the node feature matrix at the current time step. 、 and represent the biases of the three gates. is the activation function, e represents the Hadamard product (element-wise product), and GC(·) is the graph convolutional network. Finally, the hidden state output by the GRU is input into the fully connected layer to obtain the final harmonic state estimation result , represents the fully connected layer of the model.
[0084] S302. Determine the loss of the initial neural network model according to the initial harmonic source localization result and the power grid harmonic source label.
[0085] Optionally, in the embodiments of the present application, with the goal of minimizing the error between the predicted harmonic source and the true harmonic source, a loss function is determined, and thus the initial neural network model is trained according to the fusion feature, the power grid adjacency matrix, the power grid harmonic source label, and the loss function to obtain a power grid harmonic source localization model, where the loss function can be as shown in Equation 6:
[0086] (Equation 6)
[0087] where Y is the true harmonic source position, is the harmonic localization result predicted by the model, is the weight hyperparameter of the regularization term, is the regularization term, which is used to prevent the model from overfitting.
[0088] In the embodiments of the present application, determine the prediction error of each power grid node at each time step , determine the regularization term and weight it, and add the prediction error and the regularization term to obtain the total loss.
[0089] In the embodiments of the present application, determine the true harmonic source position corresponding to the initial harmonic source localization result according to the power grid harmonic source label, and thus substitute the true harmonic source position and the initial harmonic localization result into the loss function to determine the loss of the initial neural network model.
[0090] S303. Determine whether the training completion condition is satisfied according to the loss or the number of training times.
[0091] In the embodiments of the present application, when the loss is less than the preset loss threshold or the number of training times is greater than the preset number, it is determined that the training of the initial neural network model has satisfied the training completion condition.
[0092] S304. If not satisfied, optimize the parameters of the initial neural network model according to the loss and the preset optimizer, and return to execute the step of inputting the fusion feature and the power grid adjacency matrix into the initial neural network model; if satisfied, determine the initial neural network model as the power grid harmonic source localization model.
[0093] In the embodiments of the present application, the preset optimizer can be the Adam optimizer. When the training completion condition is not met, the gradient of the loss with respect to the model parameters is calculated using the backpropagation algorithm, and the Adam optimizer is used to update the model parameters to obtain the updated initial neural network model, and the step of inputting the fusion feature and the power grid adjacency matrix into the initial neural network model is returned. In the embodiments of the present application, when the training completion condition is met, the current initial neural network model is determined as the power grid harmonic source location model.
[0094] In the above application embodiments, the initial neural network model is iteratively trained until the trained power grid harmonic source location model is obtained, which improves the prediction accuracy of the power grid harmonic source location model.
[0095] In one embodiment, an implementation manner of the above S202 is provided. The power grid knowledge graph includes static factors and dynamic factors, such as Figure 4 shown, the above "fusing the node feature matrix and the power grid knowledge graph to obtain a fusion feature" includes:
[0096] S401, fusing the static factors and the node feature matrix to determine the static fusion feature.
[0097] S402, fusing the dynamic factors and the node feature matrix to determine the dynamic fusion feature.
[0098] S403, concatenating the static fusion feature and the dynamic fusion feature to obtain the fusion feature.
[0099] In the embodiments of the present application, the node feature matrix and the power grid knowledge graph can be input into the fusion model to obtain the fusion feature. Specifically, the static factors and the node feature matrix are input into the fusion model for fusion to determine the static fusion feature; the dynamic factors and the node feature matrix are input into the fusion model for fusion to determine the dynamic fusion feature; the fusion model concatenates the static fusion feature and the dynamic fusion feature to obtain the fusion feature.
[0100] Optionally, the fusion model and the above initial neural network model can form a knowledge-driven spatio-temporal graph convolutional KST-GCN network model, as Figure 5 shown, the KST-GCN network model can not only capture the knowledge structure and semantic relationship between the power grid node information and attributes, but also capture the spatio-temporal features of the power system.
[0101] Optionally, the fusion model can be a KF-Cell, and the schematic structural diagram of the KF-Cell can be as Figure 6 shown. The input layer of the fusion model includes the node feature matrix X t and the power grid knowledge graph X E, the output is the power grid harmonic characteristics fused with the time moment t , due to the diversity of external factors, the external factors are divided into static factors and dynamic factors. For example, static factors can include equipment type, load type, etc., and dynamic factors can include equipment operating status, etc. Among them, the fusion process of static external factors and dynamic external factors can be shown in Equations 7 - 9:
[0102] (Equation 7)
[0103] (Equation 8)
[0104] (Equation 9)
[0105] Among them, e s and e d represent the static external factor and the dynamic external factor in XE respectively, ws and wd represent the weight matrix, b s and b d represent the bias, ReLU(·) is the activation function, and the fused output X s of the static external factor and the fused output X d of the dynamic external factor are concatenated to form the updated node feature matrix .
[0106] In the above application embodiment, the static factor and the node feature matrix are respectively fused to determine the static fusion feature, and the dynamic factor and the node feature matrix are fused to determine the dynamic fusion feature, so that the obtained fusion feature combines the static factor and the dynamic factor, making the fusion feature more matched with the power grid state.
[0107] In one embodiment, an implementation manner of the above S201 is provided. The power grid historical harmonic data includes harmonic voltage, harmonic current, connection relationships of each power grid node, and attribute information of each power grid node; as Figure 7 shown, the above "determining harmonic feature information according to the power grid historical harmonic data" includes:
[0108] S501, determining the power grid node feature matrix according to the harmonic voltage and the harmonic current.
[0109] In the embodiment of the present application, for a power grid system with N nodes, its power grid feature matrix , where and represent the harmonic voltage and the harmonic current respectively, the dimension of the power grid feature matrix is N×2, and if the harmonic data of a certain node at time t is lost, it is set to zero.
[0110] S502. Determine the power grid adjacency matrix according to the connection relationships of each power grid node.
[0111] In the embodiment of the present application, the adjacency matrix A of the power grid represents the connection relationships of the power grid nodes, with a dimension of N×N and consisting of binary 0-1 variables. 0 represents that two nodes are not connected, and 1 represents that they are connected.
[0112] S503. Determine the power grid knowledge graph according to the connection relationships of each power grid node and the attribute information of each power grid node.
[0113] Among them, by integrating data from various sources while retaining the original information. It can be defined as a knowledge network composed of multiple triples (head, relation, tail), containing semantic information and network structure. Both the head and tail in the triple are entities, and the relation is the semantic relationship between the entities. The knowledge graph can represent heterogeneous nodes and multiple relationship information.
[0114] In the embodiment of the present application, the power grid nodes are represented as entities, the relationships are represented as edges, and then the knowledge graph is converted into a low-dimensional vector representation using the knowledge graph embedding algorithm. The low-dimensional vector can be used as an input to be embedded into the spatio-temporal graph convolutional network. In the embodiment of the present application, a knowledge graph embedding learning method based on entity-attribute-relation (EAR) is adopted. By learning the embedding representations of entities, relationships, and attributes in the knowledge graph, the complex correlation relationships between various nodes in the power grid can be better captured. In the embodiment of the present application, nodes, attributes, and the relationships between them can be represented in the form of triples: , EAR aims to learn the embedding representations of entities, relationships, and attributes, denoted as X E , and the objective function is defined to be optimized by maximizing the joint probability of relation triples and attribute triples given the embedding vector X E , and can be as shown in Equation 10:
[0115] (Equation 10)
[0116] In the embodiment of the present application, feature extraction is performed on the easily obtained historical harmonic data of the power grid to obtain harmonic feature information, improving the reliability of the harmonic feature information and optimizing the embedding representation of the knowledge graph, enabling it to more accurately reflect the spatio-temporal dependence and the influence of external factors in the power grid.
[0117] In the embodiment of the present application, as Figure 8 shown, the above method for constructing the power grid harmonic source localization model further includes:
[0118] S204. Obtain the harmonic data to be predicted for the power grid.
[0119] S205. Determine the fusion features to be predicted according to the harmonic data to be predicted.
[0120] S206. Input the fusion feature to be predicted into the power grid harmonic source location model to obtain the prediction results for each node in the power grid; the prediction results indicate whether each node is a harmonic source.
[0121] In the embodiments of the present application, the harmonic data to be predicted in the power grid may include harmonic voltage, harmonic current, connection relationships of each power grid node, and attribute information of each power grid node. Feature extraction is performed on the harmonic data to be predicted to obtain the harmonic feature information corresponding to the harmonic data to be predicted. The harmonic feature information corresponding to the harmonic data to be predicted includes the power grid node feature matrix corresponding to the harmonic data to be predicted, the power grid adjacency matrix, and the power grid knowledge graph. Further, the power grid node feature matrix corresponding to the harmonic data to be predicted and the power grid knowledge graph are fused to obtain the fusion feature to be predicted. Finally, the fusion feature to be predicted and the power grid adjacency matrix are input into the power grid harmonic source location model to obtain the prediction results for each node in the power grid, so as to predict whether each node is a harmonic source.
[0122] In the above embodiments of the application, the power grid harmonic source location model and the harmonic data to be predicted are used to predict each node in the power grid to determine whether each node is a harmonic source, improving the accuracy of the prediction results.
[0123] In one embodiment, a method for constructing a complete power grid harmonic source location model is provided, including:
[0124] S1. Obtain the historical harmonic data of the power grid and the power grid harmonic source labels.
[0125] S2. Determine the power grid node feature matrix according to the harmonic voltage and the harmonic current.
[0126] S3. Determine the power grid adjacency matrix according to the connection relationships of each power grid node.
[0127] S4. Determine the power grid knowledge graph according to the connection relationships of each power grid node and the attribute information of each power grid node.
[0128] S5. Fuse the static factors and the node feature matrix to determine the static fusion feature.
[0129] S6. Fuse the dynamic factors and the node feature matrix to determine the dynamic fusion feature.
[0130] S7. Concatenate the static fusion feature and the dynamic fusion feature to obtain the fusion feature.
[0131] S8. Determine the loss function with the goal of minimizing the error between the predicted harmonic source and the actual harmonic source.
[0132] S9. Input the fused features and the power grid adjacency matrix into the initial neural network model, extract spatio-temporal features through spatio-temporal convolutional layers and graph convolutional layers, and obtain the initial harmonic source localization result; the initial harmonic source localization result includes the initial predicted harmonic sources.
[0133] S10. Determine the loss of the initial neural network model according to the initial harmonic source localization result, the power grid harmonic source labels, and the loss function.
[0134] S11. Determine whether the training completion condition is satisfied according to the loss or the number of training times.
[0135] S12. If not, optimize the parameters of the initial neural network model according to the loss and a preset optimizer, and return to execute the step of inputting the fused features and the power grid adjacency matrix into the initial neural network model; if satisfied, determine the initial neural network model as the power grid harmonic source localization model; the power grid harmonic source localization model is used to predict whether each node in the power grid is a harmonic source.
[0136] S13. Obtain the harmonic data to be predicted of the power grid.
[0137] S14. Determine the fused features to be predicted according to the harmonic data to be predicted.
[0138] S15. Input the fused features to be predicted into the power grid harmonic source localization model, and obtain the prediction results for each node in the power grid; the prediction results indicate whether each node is a harmonic source.
[0139] In the above method for constructing a power grid harmonic source localization model, obtain the historical harmonic data of the power grid and the power grid harmonic source labels, and determine the harmonic feature information according to the historical harmonic data of the power grid; the harmonic feature information includes the power grid node feature matrix, the power grid adjacency matrix, and the power grid knowledge graph; fuse the node feature matrix and the power grid knowledge graph to obtain the fused features; train the initial neural network model according to the fused features, the power grid adjacency matrix, and the power grid harmonic source labels to obtain the power grid harmonic source localization model; the power grid harmonic source localization model is used to predict whether each node in the power grid is a harmonic source. The above power grid harmonic source localization model predicts the harmonic sources according to the harmonic feature information and knowledge graph information of the power grid nodes, comprehensively considers the harmonic characteristics of the power grid and its related external factors, thereby improving the accuracy of harmonic source localization, and fusing the power grid knowledge graph information with the node feature matrix, so that the model not only depends on historical harmonic data during the training process, but also can make full use of the structural information and external factors of the power grid, enhancing the adaptability of the model to different power grid environments and operating states, and further improving the accuracy of harmonic source localization.
[0140] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0141] Based on the same inventive concept, an embodiment of the present application also provides a device for constructing a power grid harmonic source localization model for implementing the method for constructing the power grid harmonic source localization model involved above. The implementation solutions provided by this device for solving problems are similar to the implementation solutions recorded in the above method. Therefore, the specific limitations in one or more embodiments of the device for constructing the power grid harmonic source localization model provided below can refer to the limitations on the method for constructing the power grid harmonic source localization model in the above text, and will not be repeated here.
[0142] In one embodiment, as Figure 9 shown, a device for constructing a power grid harmonic source localization model is provided, including: a first acquisition module 10, a fusion module 11, and a training module 12, where:
[0143] The first acquisition module 10 is used to acquire historical power grid harmonic data and power grid harmonic source labels, and determine harmonic feature information according to the historical power grid harmonic data; the harmonic feature information includes a power grid node feature matrix, a power grid adjacency matrix, and a power grid knowledge graph.
[0144] The fusion module 11 is used to fuse the node feature matrix and the power grid knowledge graph to obtain a fusion feature.
[0145] The training module 12 is used to train an initial neural network model according to the fusion feature, the power grid adjacency matrix, and the power grid harmonic source label to obtain a power grid harmonic source localization model.
[0146] In one embodiment, the above training module 12 includes: an input unit, a first determination unit, a second determination unit, and an optimization unit, where:
[0147] The input unit is used to input the fusion feature and the power grid adjacency matrix into the initial neural network model, extract spatio-temporal features through a spatio-temporal convolutional layer and a graph convolutional layer, and obtain an initial harmonic source localization result; the initial harmonic source localization result includes an initial predicted harmonic source;
[0148] A first determination unit, configured to determine the loss of the initial neural network model according to the initial harmonic source positioning result and the power grid harmonic source label.
[0149] A second determination unit, configured to determine whether the training completion condition is satisfied according to the loss or the number of training times.
[0150] An optimization unit, configured to, when the training completion condition is not satisfied, optimize the parameters of the initial neural network model according to the loss and a preset optimizer, and return to execute the step of inputting the fusion feature and the power grid adjacency matrix into the initial neural network model; and is further configured to, when the training condition is satisfied, determine the initial neural network model as the power grid harmonic source positioning model.
[0151] In one embodiment, the above-mentioned fusion module 11 includes: a first fusion unit, a second fusion unit, and a splicing unit, where:
[0152] The first fusion unit is configured to fuse the static factor and the node feature matrix to determine the static fusion feature.
[0153] The second fusion unit is configured to fuse the dynamic factor and the node feature matrix to determine the dynamic fusion feature.
[0154] The splicing unit is configured to splice the static fusion feature and the dynamic fusion feature to obtain the fusion feature.
[0155] In one embodiment, the above-mentioned first acquisition module 10 includes: a first determination unit, a second determination unit, and a third determination unit, including:
[0156] The first determination unit is configured to determine the power grid node feature matrix according to the harmonic voltage and the harmonic current.
[0157] The second determination unit is configured to determine the power grid adjacency matrix according to the connection relationship of each power grid node.
[0158] The third determination unit is configured to determine the power grid knowledge graph according to the connection relationship of each power grid node and the attribute information of each power grid node.
[0159] In one embodiment, the above-mentioned device for constructing the power grid harmonic source positioning model further includes:
[0160] A first determination module, configured to determine the loss function with the goal of minimizing the error between the predicted harmonic source and the actual harmonic source.
[0161] The training module is specifically configured to train the initial neural network model according to the fusion feature, the power grid adjacency matrix, the power grid harmonic source label, and the loss function to obtain the power grid harmonic source positioning model.
[0162] In one embodiment, the apparatus for constructing the power grid harmonic source localization model further includes: a second acquisition module, a second determination module, and a prediction module, where:
[0163] The second acquisition module is configured to acquire the harmonic data to be predicted of the power grid.
[0164] The second determination module is configured to determine the fusion feature to be predicted according to the harmonic data to be predicted.
[0165] The prediction module is configured to input the fusion feature to be predicted into the power grid harmonic source localization model to obtain the prediction results for each node in the power grid; the prediction results indicate whether each node is a harmonic source.
[0166] Each module in the apparatus for constructing the power grid harmonic source localization model can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
[0167] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0168] Acquire the historical harmonic data of the power grid and the power grid harmonic source labels, and determine the harmonic feature information according to the historical harmonic data of the power grid; the harmonic feature information includes the power grid node feature matrix, the power grid adjacency matrix, and the power grid knowledge graph;
[0169] Fuse the node feature matrix and the power grid knowledge graph to obtain the fusion feature;
[0170] Train the initial neural network model according to the fusion feature, the power grid adjacency matrix, and the power grid harmonic source labels to obtain the power grid harmonic source localization model; the power grid harmonic source localization model is used to predict whether each node in the power grid is a harmonic source.
[0171] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0172] Input the fusion feature and the power grid adjacency matrix into the initial neural network model, extract the spatio-temporal features through the spatio-temporal convolutional layer and the graph convolutional layer to obtain the initial harmonic source localization result; the initial harmonic source localization result includes the initial predicted harmonic sources;
[0173] Determine the loss of the initial neural network model according to the initial harmonic source localization result and the power grid harmonic source labels;
[0174] Determine whether the training completion condition is satisfied according to the loss or the number of training times;
[0175] If not satisfied, optimize the parameters of the initial neural network model according to the loss and a preset optimizer, and return to execute the step of inputting the fusion feature and the power grid adjacency matrix into the initial neural network model; if satisfied, determine the initial neural network model as the power grid harmonic source localization model.
[0176] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0177] Fuse the static factors and the node feature matrix to determine the static fusion feature;
[0178] Fuse the dynamic factors and the node feature matrix to determine the dynamic fusion feature;
[0179] Concatenate the static fusion feature and the dynamic fusion feature to obtain the fusion feature.
[0180] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0181] Determine the power grid node feature matrix according to the harmonic voltage and the harmonic current;
[0182] Determine the power grid adjacency matrix according to the connection relationship of each power grid node;
[0183] Determine the power grid knowledge graph according to the connection relationship of each power grid node and the attribute information of each power grid node.
[0184] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0185] Determine the loss function with the goal of minimizing the error between the predicted harmonic source and the actual harmonic source;
[0186] Train the initial neural network model according to the fusion feature, the power grid adjacency matrix and the power grid harmonic source label to obtain the power grid harmonic source localization model, including:
[0187] Train the initial neural network model according to the fusion feature, the power grid adjacency matrix, the power grid harmonic source label and the loss function to obtain the power grid harmonic source localization model.
[0188] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0189] Obtain the harmonic data to be predicted of the power grid;
[0190] Determine the fusion feature to be predicted according to the harmonic data to be predicted;
[0191] Input the fusion feature to be predicted into the power grid harmonic source localization model to obtain the prediction results for each node in the power grid; the prediction results indicate whether each node is a harmonic source.
[0192] 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:
[0193] Obtain historical power grid harmonic data and power grid harmonic source labels, and determine harmonic feature information according to the historical power grid harmonic data; the harmonic feature information includes a power grid node feature matrix, a power grid adjacency matrix, and a power grid knowledge graph;
[0194] Fuse the node feature matrix and the power grid knowledge graph to obtain a fused feature;
[0195] Train an initial neural network model according to the fused feature, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source localization model; the power grid harmonic source localization model is used to predict whether each node in the power grid is a harmonic source.
[0196] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0197] Input the fused feature and the power grid adjacency matrix into the initial neural network model, extract spatio-temporal features through a spatio-temporal convolutional layer and a graph convolutional layer to obtain an initial harmonic source localization result; the initial harmonic source localization result includes initial predicted harmonic sources;
[0198] Determine the loss of the initial neural network model according to the initial harmonic source localization result and the power grid harmonic source labels;
[0199] Determine whether the training completion condition is satisfied according to the loss or the number of training times;
[0200] If not, optimize the parameters of the initial neural network model according to the loss and a preset optimizer, and return to execute the step of inputting the fused feature and the power grid adjacency matrix into the initial neural network model; if satisfied, determine the initial neural network model as the power grid harmonic source localization model.
[0201] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0202] Fuse static factors and the node feature matrix to determine static fused features;
[0203] Fuse dynamic factors and the node feature matrix to determine dynamic fused features;
[0204] Concatenate the static fused features and the dynamic fused features to obtain a fused feature.
[0205] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0206] Determine the power grid node feature matrix based on harmonic voltage and harmonic current;
[0207] Determine the power grid adjacency matrix according to the connection relationships of each power grid node;
[0208] Determine the power grid knowledge graph according to the connection relationships of each power grid node and the attribute information of each power grid node.
[0209] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0210] Determine a loss function with the goal of minimizing the error between the predicted harmonic source and the actual harmonic source;
[0211] Train an initial neural network model according to the fusion features, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source localization model, including:
[0212] Train the initial neural network model according to the fusion features, the power grid adjacency matrix, the power grid harmonic source labels, and the loss function to obtain a power grid harmonic source localization model.
[0213] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0214] Obtain the harmonic data to be predicted of the power grid;
[0215] Determine the fusion features to be predicted according to the harmonic data to be predicted;
[0216] Input the fusion features to be predicted into the power grid harmonic source localization model to obtain prediction results for each node in the power grid; the prediction results indicate whether each node is a harmonic source.
[0217] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0218] Obtain the historical harmonic data of the power grid and the power grid harmonic source labels, and determine the harmonic feature information according to the historical harmonic data of the power grid; the harmonic feature information includes the power grid node feature matrix, the power grid adjacency matrix, and the power grid knowledge graph;
[0219] Fuse the node feature matrix and the power grid knowledge graph to obtain fusion features;
[0220] Train an initial neural network model according to the fusion features, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source localization model; the power grid harmonic source localization model is used to predict whether each node in the power grid is a harmonic source.
[0221] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0222] Input the fused features and the power grid adjacency matrix into the initial neural network model, extract spatio-temporal features through spatio-temporal convolutional layers and graph convolutional layers, and obtain the initial harmonic source localization result; the initial harmonic source localization result includes the initial predicted harmonic source.
[0223] Determine the loss of the initial neural network model according to the initial harmonic source localization result and the power grid harmonic source label.
[0224] Determine whether the training completion condition is satisfied according to the loss or the number of training times.
[0225] If not, optimize the parameters of the initial neural network model according to the loss and a preset optimizer, and return to execute the step of inputting the fused features and the power grid adjacency matrix into the initial neural network model; if satisfied, determine the initial neural network model as the power grid harmonic source localization model.
[0226] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0227] Fuse the static factors and the node feature matrix to determine the static fused features.
[0228] Fuse the dynamic factors and the node feature matrix to determine the dynamic fused features.
[0229] Concatenate the static fused features and the dynamic fused features to obtain the fused features.
[0230] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0231] Determine the power grid node feature matrix according to the harmonic voltage and the harmonic current.
[0232] Determine the power grid adjacency matrix according to the connection relationships of the power grid nodes.
[0233] Determine the power grid knowledge graph according to the connection relationships of the power grid nodes and the attribute information of the power grid nodes.
[0234] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0235] With the goal of minimizing the error between the predicted harmonic source and the actual harmonic source, determine the loss function.
[0236] Train the initial neural network model according to the fused features, the power grid adjacency matrix and the power grid harmonic source label to obtain the power grid harmonic source localization model, including:
[0237] Train the initial neural network model according to the fused features, the power grid adjacency matrix, the power grid harmonic source label and the loss function to obtain the power grid harmonic source localization model.
[0238] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0239] Obtain the harmonic data to be predicted of the power grid;
[0240] Determine the fusion features to be predicted according to the harmonic data to be predicted;
[0241] Input the fusion features to be predicted into the power grid harmonic source location model to obtain the prediction results for each node in the power grid; the prediction results indicate whether each node is a harmonic source.
[0242] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. 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 methods. Among them, any reference to a 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), magnetoresistive 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. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.
[0243] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, 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, it should be considered as the scope recorded in the present application.
[0244] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation to the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A method for constructing a power grid harmonic source location model, characterized in that, The method includes: Obtaining historical harmonic data of the power grid and power grid harmonic source labels, and determining harmonic feature information according to the historical harmonic data of the power grid; the harmonic feature information includes a power grid node feature matrix, a power grid adjacency matrix, and a power grid knowledge graph; Fusing the node feature matrix and the power grid knowledge graph to obtain a fused feature; Training an initial neural network model according to the fused feature, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source localization model; the power grid harmonic source localization model is used to predict whether each node in the power grid is a harmonic source.
2. The method according to claim 1, wherein The training of the initial neural network model according to the fused feature, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source localization model includes: Inputting the fused feature and the power grid adjacency matrix into the initial neural network model, and extracting spatio-temporal features through a spatio-temporal convolutional layer and a graph convolutional layer to obtain an initial harmonic source localization result; the initial harmonic source localization result includes an initial predicted harmonic source; Determining the loss of the initial neural network model according to the initial harmonic source localization result and the power grid harmonic source labels; Determining whether the training completion condition is satisfied according to the loss or the number of training times; If not, optimizing the parameters of the initial neural network model according to the loss and a preset optimizer, and returning to execute the step of inputting the fused feature and the power grid adjacency matrix into the initial neural network model; if satisfied, determining the initial neural network model as the power grid harmonic source localization model.
3. The method according to claim 1, characterized in that, The power grid knowledge graph includes static factors and dynamic factors, and the fusing of the node feature matrix and the power grid knowledge graph to obtain a fused feature includes: Fusing the static factors and the node feature matrix to determine a static fused feature; Fusing the dynamic factors and the node feature matrix to determine a dynamic fused feature; Concatenating the static fused feature and the dynamic fused feature to obtain the fused feature.
4. The method according to claim 1, characterized in that, The historical harmonic data of the power grid includes harmonic voltage, harmonic current, connection relationships of each power grid node, and attribute information of each power grid node; The determining of the harmonic feature information according to the historical harmonic data of the power grid includes: Determining the power grid node feature matrix according to the harmonic voltage and the harmonic current; Determining the power grid adjacency matrix according to the connection relationships of each power grid node; Determining a power grid knowledge graph according to the connection relationships of each power grid node and the attribute information of each power grid node.
5. The method according to any one of claims 1-4, characterized in that The method further includes: Determining a loss function with the goal of minimizing the error between the predicted harmonic source and the actual harmonic source; The training of the initial neural network model according to the fused feature, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source localization model includes: Training the initial neural network model according to the fused feature, the power grid adjacency matrix, the power grid harmonic source labels, and the loss function to obtain the power grid harmonic source localization model.
6. The method according to any one of claims 1-4, characterized in that, The method further includes: Obtaining the harmonic data to be predicted of the power grid; Determine the to-be-predicted fusion feature according to the to-be-predicted harmonic data; Input the to-be-predicted fusion feature into the power grid harmonic source location model to obtain the prediction results for each node in the power grid; the prediction results indicate whether each of the nodes is a harmonic source.
7. An apparatus for constructing a power grid harmonic source localization model, characterized in that, The device includes: A first acquisition module, configured to acquire power grid historical harmonic data and power grid harmonic source labels, and determine harmonic feature information according to the power grid historical harmonic data; the harmonic feature information includes a power grid node feature matrix, a power grid adjacency matrix, and a power grid knowledge graph; A fusion module, configured to fuse the node feature matrix and the power grid knowledge graph to obtain a fusion feature; A training module, configured to train an initial neural network model according to the fusion feature, the power grid adjacency matrix, and the power grid harmonic source labels to obtain a power grid harmonic source location model.
8. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, 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 the 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 the processor, the steps of the method according to any one of claims 1 to 6 are implemented.