A wind power data anomaly detection method and system based on federated learning mechanism

Through the federated learning mechanism, the neighbor selection mechanism for guiding nodes and reinforcement learning is generated, which solves the problem of Non-IID and neighbor information missing in distributed wind power data, and realizes high-precision wind power data anomaly detection, which improves the generalization ability and detection effect of the model.

CN118468186BActive Publication Date: 2025-08-08YANGZHOU POWER SUPPLY BRANCH OF STATE GRID JIANGSU ELECTRIC POWER CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410659597.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2025-08-08
Estimated Expiration
2044-05-27

AI Technical Summary

Technical Problem

In distributed stored wind power data, the Non-IID problem and the lack of neighbor information cause the performance of the graph neural network model to degrade when detecting wind power abnormalities, making it difficult to effectively generalize and detect abnormal data.

Method used

The federated learning mechanism is adopted to generate guidance nodes through federated multi-scale graph comparison learning, combining the neighbor selection mechanism of reinforcement learning and the value-oriented information transmission model, enhance neighbor information transmission, and use multi-layer perceptrons to perform classifier prediction to realize high-value information aggregation and anomaly detection across clients.

Benefits of technology

On the premise of ensuring data privacy and security, the accuracy of abnormal detection of wind power data is improved, the Non-IID problem and the lack of neighbor information are alleviated, and the abnormal detection effect in the federated learning environment is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118468186B_ABST
    Figure CN118468186B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of anomaly detection, and provides a method and system for detecting anomalies in wind power data based on a federated learning mechanism. The method comprises: generating a guide node based on a federated multi-scale graph contrast learning feature generation model; selecting a set of neighbor nodes to be aggregated; obtaining a high-value information relationship subgraph of a target node; utilizing a GNN based on a message passing mechanism to aggregate information of neighbor nodes under each relationship in the high-value information relationship subgraph; using a multi-layer perceptron as a classifier to predict the anomaly of data after completing the aggregation of neighbor information locally; calculating the classification loss, and forming a local model through loss training; iterating the global model using a weighted average of the local model to obtain a federated wind power data anomaly detection model, and performing real-time detection on wind power data distributedly stored in various locations. The present invention solves the problem of missing neighbor information while alleviating the Non-IID problem, thereby improving detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of anomaly detection, and in particular to a method and system for detecting anomaly in wind power data based on a federated learning mechanism in a distributed storage environment. Background Art

[0002] Wind power generation, one of the most mature renewable energy development and utilization technologies, has experienced rapid growth in recent years. Monitoring stations located in or around wind farms monitor and collect various operational data related to wind farms in real time. Sensors distributed across these monitoring stations continuously collect and record operational data from wind turbines and wind farms to ensure efficient and stable energy distribution. Each sensor continuously records a large amount of data, and these widely distributed sensors often have clear spatial locations, such as geographic coordinates. Therefore, the univariate time series data recorded by all sensors is combined into space-time graph data. Space-time graphs are a special type of graph-structured data. Compared to traditional graph data, space-time graphs integrate information from both time and space dimensions, better reflecting the temporal characteristics of entities and the spatial relationships between them. By modeling and analyzing space-time graphs, the complex dependencies between different time series variables can be fully explored, providing powerful support for planning and decision-making in the wind power sector.

[0003] GNNs (graph neural networks) are a method for deep learning on graph data and play a key role in graph representation learning. By inputting node features and graph structure information, GNNs leverage their unique network structure to process and analyze graph data. They gradually learn a representation for each node by repeatedly aggregating feature information from neighboring nodes. When processing spatiotemporal graphs, GNNs can incorporate time series data as node features, allowing the model to capture dynamic relationships and patterns that change over time. This incorporation of the temporal dimension enables GNNs to not only understand spatial structure but also understand and predict trends and behaviors that evolve over time. However, conventional GNN models encounter various difficulties when processing distributed spatiotemporal graph data, particularly privacy and security issues.

[0004] Driven by the need to protect data privacy for all parties, we are considering introducing federated learning mechanisms into GNN research to address distributed graph data storage. Federated learning enables collaborative model training across multiple clients while fully protecting local client data. The entire training process can be divided into three steps. First, the central server sends the initial model parameters for the current round to the end devices. The received end devices then use their local datasets to perform gradient updates on the model parameters. Finally, each device uploads the updated model parameters to the central server for aggregation and generation of the updated global model. Federated learning ensures that data does not leave the local server; only the model parameters are transmitted over the network link, thus ensuring data security.

[0005] The rapid growth of wind power scale and installed capacity has generated a vast amount of operational data from wind turbines and wind farms. This rich data and spatial relationships constitute spatiotemporal graph data. However, due to factors such as adverse weather conditions or software glitches, this recorded data may intermittently contain errors or be lost, resulting in hidden anomalies in the spatiotemporal wind power data. This can affect dispatchers' assessment of wind power operational status and the effectiveness of grid analysis applications. Therefore, it is necessary to detect anomalies in individual wind power data. However, this spatiotemporal wind power data is dispersed across multiple monitoring stations, known as distributed storage. Due to privacy and security concerns, wind power data from different monitoring stations cannot be directly shared, making traditional centralized anomaly detection difficult. When using graph neural networks to perform anomaly detection on distributed wind turbine data, two major issues arise: the non-IID (not identically and independently distributed) problem of wind power data and the lack of neighbor information within the wind power spatiotemporal wind power graph. These issues severely impair the performance of graph neural network models for anomaly detection.

[0006] The Non-IID problem with wind power data manifests itself as follows: when wind power data is distributed and stored across multiple clients (monitoring stations), the data distribution may be different across each client, i.e., the wind power data within each client exhibits statistical heterogeneity. If a GNN-based anomaly detection model is trained independently on each client, its local optimization objectives may differ, causing a deviation from the global objective when jointly training the model across clients. Ultimately, a simple aggregation of wind power anomaly detection models fails to generalize well to the local wind power data across all clients.

[0007] The problem of missing neighbor information within wind power spatiotemporal graph data manifests itself in the following ways: Because data samples in spatiotemporal graphs are interconnected and interrelated, a time series data point at a given moment may be associated with multiple time series data points, which may be scattered across different monitoring stations. These associations carry important information about the node's neighborhood and cannot be directly obtained due to data security concerns. When a local GNN model aggregates neighbor information within the local spatiotemporal graph, the missing connections due to the isolation of the spatiotemporal graph data cannot be transmitted through the message passing mechanism. Central nodes are unable to obtain information from the global data through the complete neighborhood. Furthermore, the size and characteristics of local data are limited, which undoubtedly has a negative impact on the performance of GNN-based anomaly detection models. Summary of the Invention

[0008] The present invention aims to solve at least one of the technical problems existing in the prior art.

[0009] The technical solution of the present invention is: a method for detecting anomalies in wind power data based on a federated learning mechanism, comprising:

[0010] Each client uses locally stored wind power data to generate a guide node based on a federated multi-scale graph contrast learning feature generation model;

[0011] Use the enhanced features of the guide node to perform a neighbor selection mechanism based on reinforcement learning to select the set of neighbor nodes to be aggregated;

[0012] Based on the set of neighbor nodes, a value-oriented information transfer federated learning model is used to extract high-value information across clients to enhance local data and obtain a high-value information relationship subgraph of the target node;

[0013] Use GNN based on message passing mechanism to aggregate the information of neighbor nodes under each relationship in the high-value information relationship subgraph;

[0014] After completing the local aggregation of neighbor information, a multi-layer perceptron is used as a classifier to predict the abnormality of the data;

[0015] Calculate the classification loss and form a local model through loss training;

[0016] The global model is iterated by weighted averaging of local models to obtain a federal wind power data anomaly detection model, which performs real-time detection on wind power data distributedly stored in various locations.

[0017] The generation process of the bootstrap node includes:

[0018] A federated multi-scale graph contrastive learning feature generation model is established, and the optimizer is used to train the federated multi-scale graph contrastive learning feature generation model to obtain the final guiding node.

[0019] The process of establishing the federated multi-scale graph contrastive learning feature generation model is as follows:

[0020] Build a multi-relationship graph using the original wind power data stored locally on the client;

[0021] Input each single relationship graph of the multi-relation graph into the local GNN to obtain the guiding node features corresponding to each node;

[0022] Each client performs contrastive learning on the features of the guide nodes in the local graph at global and local scales, and obtains the contrastive learning loss of each node at global and local scales.

[0023] Add the contrastive learning loss of the global scale and the local scale to get the local contrastive learning loss;

[0024] Each client forms a local multi-scale graph contrast learning feature generation model through local contrast loss training;

[0025] Using prototypes instead of models to participate in federated training when transmitting information between clients and between clients and between clients and servers;

[0026] Calculate the local prototype of each client and send it to the server for aggregation;

[0027] The server collects the local prototypes of all clients under each relationship and calculates the global prototype;

[0028] The server sends all local prototypes to each client;

[0029] The multi-scale graph contrastive learning feature generation model in each client learns and updates from the global prototype and the local prototypes from other clients to form a federated multi-scale graph contrastive learning feature generation model.

[0030] Perform global comparative learning on the guide node features, including comparing each guide node feature of each node with all other nodes in the corresponding relationship, narrowing the similarity of guide node features of the same category and reducing the similarity of guide node features of different categories;

[0031] The category is the label of the node, indicating the status of the wind turbine.

[0032] The local scale contrastive learning of the guide node features is performed, including comparing each guide node feature of each node with the aggregated information of the neighbor nodes of the node under the corresponding relationship.

[0033] The neighbor selection mechanism based on reinforcement learning includes:

[0034] Train the node value evaluator model locally;

[0035] Use the node value evaluator model to evaluate the value of the node;

[0036] Based on the value of the node, a multi-agent reinforcement learning-based algorithm is used to make fine-grained individual judgments on the aggregation of all neighboring nodes.

[0037] The value-oriented information transfer federated learning model includes:

[0038] In a federated environment, a global loss for information prediction is added to optimize the local multi-scale graph contrastive learning feature generation model on each client, enabling the local multi-scale graph contrastive learning feature generation model to perceive information from other clients, add high-value information to the relationship subgraph based on the global data distribution, and realize information transmission between clients while ensuring data security.

[0039] The generation process of the high-value information relationship subgraph includes:

[0040] Based on the set of neighbor nodes, the representation of the guiding node is obtained using the value-oriented information transfer federated learning model;

[0041] After adding random Gaussian noise to the representation of the guide node, the high-value node features are predicted using the high-value information prediction model;

[0042] The edge information and feature information of high-value nodes are added to the original relationship subgraph of the target node to form a high-value information relationship subgraph as the input graph data of the first layer of the GNN network.

[0043] The value of a neighbor node information of the target node is the deviation between the target node label prediction value and the correct label after the guide node of the node aggregates the guide node information of the neighbor node;

[0044] If the predicted probability after aggregating this neighbor information shifts towards the correct label of the target node, the agent is rewarded, otherwise it is punished; the agent is the neighbor node of the target node that is currently judged to be selected or abandoned.

[0045] After multiple rounds of local model training on each client, its model parameters are uploaded to the central server;

[0046] After receiving the model parameters from all clients, the central server uses the number of client nodes as the weight to perform weighted average aggregation on all local models to obtain the global model parameters;

[0047] The central server then sends the global model parameters to all clients, and each client uses the locally stored wind power data to perform the next round of model updates;

[0048] Repeat the above steps, and the client and server will collaboratively train the federated wind power data anomaly detection model under the premise of privacy protection for wind power data anomaly detection.

[0049] A wind power data anomaly detection system based on a federated learning mechanism includes:

[0050] A generation module is used for each client to use the locally stored wind power data to generate a guide node based on the federated multi-scale graph comparative learning feature generation model;

[0051] A selection module is used to use the enhanced features of the guide node to perform a neighbor selection mechanism based on reinforcement learning to select a set of neighbor nodes to be aggregated;

[0052] The extraction module is used to extract high-value information across clients based on the set of neighbor nodes and use the value-oriented information transfer federated learning model to obtain the high-value information relationship subgraph of the target node;

[0053] Aggregation module, which is used to aggregate the information of neighbor nodes under each relationship in the high-value information relationship subgraph using GNN based on message passing mechanism;

[0054] The prediction module is used to predict the abnormality of the data using a multi-layer perceptron as a classifier after locally aggregating neighbor information;

[0055] The calculation module is used to calculate the classification loss and form a local model through loss training;

[0056] The detection module is used to iterate the global model using the weighted average of local models to obtain a federal wind power data anomaly detection model, and perform real-time detection on wind power data distributed and stored in various locations.

[0057] In this work, we first proposed a federated multi-scale graph comparative learning feature generation model, enabling the model to securely share knowledge from client-side local and global data in a federated environment, alleviating the Non-IID problem of wind power data. We then designed a value-oriented information transfer federated learning model to address the impact of wind power graph data isolation on GNN message passing. This model provides high-value neighbor information to nodes while ensuring data security, enhancing the wind power anomaly data detection model. This model not only alleviates the Non-IID problem of data but also solves the problem of missing neighbor information, optimizing the effectiveness of wind power anomaly data detection in a federated learning environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is a principle block diagram of the present invention;

[0059] Figure 2 This is the execution flow chart of the server in the federal wind power data anomaly detection model;

[0060] Figure 3 The execution flow chart of the client in the federal wind power data anomaly detection model;

[0061] Figure 4 Flow chart of the method of the present invention. DETAILED DESCRIPTION

[0062] The technical solutions provided by the present invention will be described in detail below with reference to specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.

[0063] like Figure 4 As shown, the present invention provides a wind power data anomaly detection method based on a federated learning mechanism in a distributed storage environment, comprising:

[0064] Each client uses locally stored wind power data to generate a guide node based on a federated multi-scale graph contrast learning feature generation model;

[0065] Use the enhanced features of the guide node to perform a neighbor selection mechanism based on reinforcement learning to select the set of neighbor nodes to be aggregated;

[0066] Based on the set of neighbor nodes, a value-oriented information transfer federated learning model is used to extract high-value information across clients to enhance local data and obtain a high-value information relationship subgraph of the target node;

[0067] Use GNN based on message passing mechanism to aggregate the information of neighbor nodes under each relationship in the high-value information relationship subgraph;

[0068] After completing the local aggregation of neighbor information, a multi-layer perceptron is used as a classifier to predict the abnormality of the data;

[0069] Calculate the classification loss and form a local model through loss training;

[0070] The global model is iterated by weighted averaging of local models to obtain a federal wind power data anomaly detection model, which performs real-time detection on wind power data distributedly stored in various locations.

[0071] The present invention mainly comprises:

[0072] Part I: A federated multi-scale graph contrastive learning feature generation model is proposed. For each client's wind turbine graph data, a guide node is generated based on a graph contrastive learning approach. This contrastive learning method captures the pattern distribution of neighborhood subgraph data under different labels and produces a more differentiated feature distribution. Furthermore, features for the guide node are generated in the neighborhood subgraphs of each target node, obtaining more discriminative features that reveal abnormalities at the neighborhood level. A new contrastive loss is introduced to optimize the model for federated environments, enabling knowledge sharing between clients while ensuring data privacy and security, and generating guide nodes with similar feature distributions. To obtain more relevant information and semantic knowledge about relational subgraphs with the same label, this paper considers transmitting prototypes based on guide nodes between the server and clients. The independent contrastive learning model in each client can learn from the local prototypes returned by other clients while adapting to the local data distribution. The global prototype provides an opportunity to learn from the global distribution. After receiving all prototypes from the server, each client's local multi-scale graph contrastive learning feature generation model must effectively acquire information from both local and global prototypes to maximize the representational power of the local multi-scale graph contrastive learning feature generation model. The present invention designs a loss function for prototypes, which is divided into two parts: local and global. The global prototype loss is to make the guide nodes generated by the local multi-scale graph contrast learning feature generation model closer to the global center of the corresponding class, that is, the attributes generated by the relationship subgraphs with the same target node label in each client are closer.

[0073] Part II: A value-oriented information transfer federated learning model is proposed. While fully considering data privacy and security, the model guides nodes to clearly enhance the direction of information and provides high-value neighbor information for target nodes based on global data distribution, generating more expressive representation vectors to help detect target nodes. The prediction of high-value node information consists of two modules. The first is the GNN-based encoder INFO e The parameters are In the first layer of the anomaly detection model, a neighbor selection mechanism based on reinforcement learning is used to complete the The selection, and based on the selected node Get the vector representation of the guide node The second module is the high-value information prediction module INFO p The parameters are Through a multi-layer perceptron based on the guidance node vector representation Predict the features of high-value information. At the same time, add a Gaussian noise generator with a distribution of N(0,1) Generate d z dimensional noise vector, represented by the guide node with different noise vectors added The features of the predicted number of high-value information K. The high-value information prediction module adds high-value neighbor information to the relationship subgraph under each relationship of the target node, but if only the local loss is used For learning, the data distribution is limited to a single client and cross-client information cannot be obtained. In order to make the value information prediction model on each client be able to provide data from other clients, Consider adding the global loss of information prediction to optimize the model.

[0074] Part III: Propose a federated wind power data anomaly detection model. In the federated learning scenario, for client D i The target node in Under the relationship r, we first obtain the guiding node features through the multi-scale graph contrast learning feature generation model Then, in the first layer of the GNN network, the neighbor node set to be aggregated is selected based on the neighbor selection mechanism based on reinforcement learning. Since the target node cannot obtain the complete graph data, it is necessary to use the value-oriented information transfer federated learning model to enhance the local data and Leveraging encoders in message passing models Get the representation of the boot node Towards After adding random Gaussian noise to the high-value information prediction model generate And use the high-value information source predictor output j to select the prediction model generate Add high-value information as nodes to the relationship subgraph In the graph data as the input of the first layer of the GNN network, high-value information will be used to learn a better vector representation of the target node. The target node on each client obtains a high-value information relationship subgraph After that, the GNN model is trained locally, and the global model is iterated using the weighted average of the local model. i After a certain number of rounds of GNN model training, the GNN model parameters Upload to server server After receiving the model parameters of all clients, the global model parameters are obtained through aggregation. The global model parameters are sent to all clients, and the clients use local data to perform the next round of model updates. Repeating the above steps, the client and server can collaboratively train the global GNN model while ensuring data privacy and security.

[0075] Specifically, the main steps of the present invention are as follows:

[0076] Step 1: Federated multi-scale graph contrast learning feature generation model, as shown in Algorithm 1 in Table 1. The specific steps are:

[0077] Step 1-1: Construct multi-relationship graph data for the original wind power data in each client to obtain a multi-relationship graph in Represents a node set, where the node is a wind turbine. For each node Both have a d-dimensional feature and tags (Indicates whether the fan is normal or abnormal). represents the number of relationship types between nodes, and ε represents a set of A graph is a collection of edges with different relationship types. All nodes have multiple relationships, meaning there are multiple edges of different types, each representing an edge. If an edge has only one type, meaning only one relationship, then it is a single-relationship graph. Therefore, it can also be considered a multi-relationship graph, consisting of multiple single-relationship graphs. Two nodes in The relationship can be edge connected.

[0078] Step 1-2: Define the neighborhood subgraph structure Where v represents the target wind turbine node for model detection, Indicates the specific relationship type. Represents the first-order neighbor nodes of the target node v under the relationship r. is the v and The set of edges between . Indicates the use of the generated guide node, which is v and The embodiment of the relationship r between them, y is the label of the target node v. Input to GNN to get the embedding of the guide node express:

[0079]

[0080] in Represents the feature vector output by the l-1th layer, AGGREGATE aggregates the features of v's neighbor nodes, and UPDATE updates the vector representation of node v through the aggregated information. and The node features of the input Initialization. Then the attribute generation module obtains the features of the guide node through an MLP (multi-layer perceptron) It can be regarded as the target wind turbine node v in the neighborhood subgraph The embodiment of the behavioral pattern is defined as follows:

[0081]

[0082] Each single-relationship graph that makes up the multi-relationship graph is input into the GNN to obtain the representation of each wind turbine node after aggregating the feature information of neighboring nodes. The number of such representations is the number of single-relationship graphs that make up the multi-relationship graph. This representation can be called the guiding node feature corresponding to each node.

[0083] Steps 1-3: Perform global-scale contrastive learning on the guide node features. Specifically, each guide node feature of each node is compared with all other nodes in the corresponding relationship. This approach increases the similarity of guide node features within the same category and decreases the similarity of guide node features within different categories. The category here refers to the node label, i.e., the status of the wind turbine (abnormal or normal). This yields a global-scale contrastive learning loss for each node.

[0084] Next, construct the positive and negative examples for global scale contrastive learning:

[0085]

[0086] yes The average raw features of nodes with the same label in , which are expressed as follows:

[0087]

[0088] Based on the above, contrastive learning under different relations uses different contrast samples. It can be seen that the positive samples for contrastive learning of guiding node attributes under relation r are It is expressed as follows:

[0089]

[0090] Where α is a weight factor. Similar to the positive sample definition process, in a batch of training, the average value of the guide node attributes generated by the neighborhood subgraph with different labels from node v under the relation r is set to The average raw features of nodes with different labels are set as They are represented as:

[0091]

[0092]

[0093] Based on the above, negative samples for guiding contrastive learning of node attributes under relation r Defined as:

[0094]

[0095] The goal is to increase the generation properties With positive samples The similarity between them, while increasing the generation attribute Between negative samples The difference between , here we can use the bilinear layer (Bilinear Layer) to calculate the similarity:

[0096]

[0097]

[0098] in are the parameters of the learnable bilinear layer.

[0099] After obtaining the similarity scores of positive and negative samples, in order to achieve the maximum similarity and difference between the attributes generated according to the target node label, the optimization target of contrastive learning is set to 1 for the similarity with the positive sample, and 0 for the similarity with the negative sample. cont The definition is as follows:

[0100] s cont =[1,…,1(n),0,…,0(n)]

[0101] s cont Contains 2n elements. The similarity score of the concatenated positive and negative samples is:

[0102]

[0103] The binary cross entropy loss, which is widely used in binary classification problems, is used as the loss function at this scale. This function aims to reduce the similarity with negative samples while maximizing the similarity with positive samples, as shown below:

[0104]

[0105] This results in a global scale contrastive learning loss;

[0106] Steps 1-4: Perform local-scale contrastive learning on the guide node features. Specifically, each guide node feature of each node is compared with the aggregated information of the node's neighbor nodes under the corresponding relationship. Considering that in actual application scenarios, abnormal data is less than normal data, the similarity between the guide node feature of each abnormal node and the aggregated information of the node's neighbor nodes under the corresponding relationship can be reduced. Conversely, the similarity between the guide node feature of each normal node and the aggregated information of the node's neighbor nodes under the corresponding relationship can be increased. In this way, the local-scale contrastive learning loss of each node can be obtained.

[0107] In the neighborhood subgraph The target node is masked and the initial features of the guide nodes are assigned to zero vectors: The subgraph obtained by the above method is exist Previous Generation Neighborhood characteristics It is expressed as follows.

[0108]

[0109] Computing in a learnable way and local environment The similarity is calculated as follows:

[0110]

[0111] When v is a normal wind turbine node, the contrastive learning optimization target is set to 1 (consistent with the environment), and when v is an abnormal wind turbine node, the contrastive learning optimization target is set to 0 (large difference). It can be seen that the optimization target is consistent with the target node label y v On the contrary. Optimization objectives patch The definition is as follows:

[0112]

[0113] The loss is also calculated using binary cross entropy. The loss function is as follows:

[0114]

[0115] Steps 1-5: Add the global contrastive learning loss and the local contrastive learning loss, and use the added contrastive loss to train the local multi-scale graph contrastive learning feature generation model.

[0116] Steps 1-6: Considering that the optimization objectives of the local multi-scale graph contrastive learning feature generation model trained independently on each client may be different, resulting in the generation of guide nodes with different feature distributions on different clients for relational subgraphs with the same label, if not corrected, the subsequent GNN model needs to learn different local objectives on each client, and deviate from the global objective during the process of local training and global aggregation of federated learning. Therefore, the local multi-scale graph contrastive learning feature generation model of each client should generate guide nodes with similar feature distributions on relational subgraphs with the same label, which will also alleviate the statistical heterogeneity of the data input to the GNN model, thereby helping the entire federated learning task solve the Non-IID problem. Consider adding a new contrast loss in a federated environment to form a federated multi-scale graph contrastive learning feature generation model, which can achieve knowledge sharing between clients while ensuring data privacy and security, and generate guide nodes with similar feature distributions, as follows:

[0117] In order to obtain more relevant information and semantic knowledge of relational subgraphs with the same label, it is considered to perform prototype transmission based on guide nodes between the server and the client. After receiving all prototypes from the server, in order to maximize the representation ability of the local GNN model, the present invention designs a loss function for the prototype, which is divided into two parts: local and global. The global prototype loss is to make the guide nodes generated by the federated multi-scale graph contrast learning feature generation model closer to the global center of the corresponding class, that is, the attributes generated by the relational subgraphs with the same target node label in each client are closer. The generation model on each client will learn abnormal and benign class information from other clients. The global prototype loss under the relationship r is defined as:

[0118]

[0119] Among them, sim is the similarity calculation network of the context-level global comparison scale, and its parameters are τ is a parameter used to adjust the tolerance of feature differences. In addition to the global prototype loss, in order to learn the consistency between local prototypes of different clients and achieve knowledge sharing between more clients, the local loss under the relationship r is defined as:

[0120]

[0121] and Make the boot node It is closer to the prototype of the same-label class and farther away from the prototype of the different-label class. The global prototype and local prototype integrate relevant information of the class at different granularities, providing guidance for optimizing the client's local generated model from multiple perspectives. The federated learning loss function for the i-th client under relation r is defined as follows, where α is the weight factor:

[0122]

[0123] Algorithm 1: Federated Multi-Scale Graph Comparative Learning Feature Generation Model

[0124]

[0125] Table 1

[0126] Step 2: Implement a neighbor selection mechanism based on reinforcement learning, which includes the following steps:

[0127] Step 2-1: The neighbor node set of the target node v under the relationship r Make a binary judgment on whether to aggregate. In the detection of the target node v, the present invention sets n agents to be responsible for For each neighbor node in , in each layer l∈L of GNN, it is determined whether to aggregate the information of neighbor node u and obtain the retained neighbor node set.

[0128] Given the following MDP process definition:

[0129] State Space

[0130] Since the goal is to select neighbor nodes based on the guide node, using the state subgraph The state s observed by a single agent. The subgraph only contains the target node v and the guide node t r , neighbor node u.

[0131] Action Space

[0132] The reinforcement learning policy network needs to judge whether to select a node, so the action space is defined as In state When a=1, it means selecting the node to aggregate information and adding node u to the set a=0 means abandoning the neighbor node.

[0133] Reward Function

[0134] The value of neighbor node u can be obtained through the state subgraph g state Calculation. The value of neighbor node u can be expressed as Use Value Evaluator and some GNN models are calculated and their parameters will continue to change during the entire training process. Therefore, it can be expected that with the iteration of training round e, The range of will also change. In order to calculate the reward more fairly and efficiently, the reward function is defined as:

[0135]

[0136] is the average value of all neighbor nodes under relation r in the previous training round. As the model training progresses Will gradually increase. When , it means that the execution of the action is encouraged, and the parameters of the policy network will move in the direction of increasing the probability of the action. On the contrary, the size of the reward determines the extent of policy network optimization. ∈ is the tolerance. After training for more rounds, It may reach a higher value, then if the value of the neighbor node But this does not mean that the node should be abandoned, because It also has a high value, indicating that node u is still valuable, so tolerance ∈ is used to provide a positive reward for this action.

[0137] Step 2-2: Training Node Value Evaluator Its input is the concatenation of the features of each target node, the features of the guide node (using the guide node generated in step 1) and a neighbor node of the target node. During training, the corresponding label is the label of the target node (normal or abnormal). In this way, a node value evaluator can be trained. Model;

[0138] Step 2-3: The value of a target node's neighbor node information is defined as the deviation between the target node's predicted label and the correct label after the node's guide node aggregates the neighbor node's guide node information. If the predicted probability after aggregating this neighbor information deviates toward the target node's correct label, the agent is rewarded; otherwise, it is penalized. The agent is the target node's neighbor node that is currently being selected or discarded.

[0139] Use the node value evaluator trained in step 2-2 Model evaluation obtains the value of the node;

[0140] Step 2-4: Use the multi-agent reinforcement learning algorithm to make fine-grained individual judgments on the aggregation of all neighbor nodes. Use the policy network to select actions and make fine-grained selections on the neighbors of each node to obtain the selected neighbor node set. The policy network is trained using the policy gradient algorithm using the node value given by the value evaluator, and the value evaluator is trained using the loss of the value evaluator.

[0141] Step 3: Implement the value-oriented information transfer federated learning model, as shown in Algorithm 2 in Table 2. The specific process is as follows:

[0142] Step 3-1: Each client has a local subgraph For the target node There is a relation subgraph under relation r For neighbor nodes, get their value set The Top-K algorithm is used to select the K nodes with the highest value. The value of K is given by The specific number of nodes in the middle is determined by the set of K neighbor nodes with the highest value. based on Simulate the generation process of high-value information.

[0143] Step 3-2: The prediction of high-value node information includes two modules. The first is the GNN-based encoder INFO e The parameters are The neighbor selection model for node representation enhancement is used in the first layer network of the wind power data anomaly detection model to complete the After the selection, based on the selected node Get the vector representation of the guide node The formula is as follows:

[0144]

[0145] in The bootstrap node obtained for the encoder Vector representation of and By the boot node and neighbor nodes The second module is the high-value information prediction module INFO p The parameters are Through a multi-layer perceptron based on the guidance node vector representation Predict the features of high-value information. At the same time, add a Gaussian noise generator with a distribution of N(0,1) Generate d z dimensional noise vector, represented by the guide node with different noise vectors added The features of the predicted number of high-value information is K, which is expressed as follows:

[0146]

[0147] Obtain high-value information for prediction for each relationship subgraph According to the set of high-value neighbor nodes on the relationship subgraph The real features of the nodes in the information prediction model can be calculated as follows:

[0148]

[0149] Step 3-3: Add high-value neighbor information to the relationship subgraph under each relationship of the target node through the high-value information prediction module. However, if only local loss is used For learning, the data distribution is limited to a single client and cross-client information cannot be obtained. In order to make the value information prediction model on each client be able to provide data from other clients, Consider adding the global loss of information prediction to optimize the model, as shown below:

[0150]

[0151] in The target node v p The set of high-value neighbors of is the node closest to the generated information in the high-value neighbor set of other clients except i. In order to calculate under the condition of data privacy and security Client D j Calculate and return the loss to D i In the whole calculation process, only and D j Calculate the loss through the server Transmitted between various clients, for client D i , after receiving the client D j The returned loss is then used to optimize the local model under relation r in the following way:

[0152]

[0153] Step 3-4: During the training process, the high-value information prediction module INFO on each client p Will be uploaded to the server The server will set all client prediction modules Sent to each client. At the same time, the server Although all prediction module parameters will be obtained, no parameter aggregation will be performed. i After receiving the prediction module from all clients Then, set up a high-value information source prediction model The result is that the client number is j, then the local encoder With client j's predictor Splicing, the encoder Output relation node representation As a predictor input and re-predict the amount of high-value information Q Add relationship subgraph middle.

[0154]

[0155]

[0156]

[0157] Table 2

[0158] Step 4: Implement the federal wind power data anomaly detection model. The overall framework is as follows: Figure 1 The specific steps are as follows:

[0159] Step 4-1: In the federated learning scenario, for client D i The target node in Under the relationship r, the guiding node features are first obtained through the federated multi-scale graph contrast learning feature generation model Then, in the first layer of the GNN network, the neighbor node set to be aggregated is selected according to the neighbor selection mechanism based on reinforcement learning based on the guide node. Since the target node cannot obtain the complete graph data, it is necessary to use the value-oriented information transfer federated learning model to enhance the local data and Leveraging encoders in message passing models Get the representation of the boot node Towards After adding random Gaussian noise to the high-value information prediction model generate And use the high-value information source predictor output j to select the prediction model generate

[0160] The high-value information prediction model is part of the value-oriented information transfer federated learning model, that is, it predicts cross-client neighbor node information that has high value (positive impact) for the target node, and then passes the high-value information as a node to the relationship subgraph containing the target node through the value-oriented information transfer federated learning model.

[0161] Add high-value information as nodes to the relationship subgraph Among them As nodes p1,…,p K The characteristics of p1,…,p2, As node p K+1 ,…,p K+Q The characteristics of , let the set of high-value nodes be The relation subgraph after adding high-value information is expressed as The neighbor node set Edge Set High-value nodes have been added With the boot node The edges between high-value information subgraphs As the input graph data of the first layer of the GNN network, high-value information will be used to learn a better vector representation of the target node. The specific formula is as follows:

[0162]

[0163] Step 4-2: Obtain high-value information relationship subgraph at the target node on each client Then train the GNN model locally and iterate the global model using the weighted average of the local model on the global client. i After a certain number of rounds of GNN model training, the GNN model parameters Upload to server server After receiving the model parameters of all clients, the global model parameters are obtained through aggregation as follows:

[0164]

[0165] Where e represents the current training round, is the global GNN model parameter at round e, which is obtained by taking the number of client nodes as the weight and performing weighted average on all client models. Will The data is sent to all clients, and the clients use local data to perform the next round of model updates. Repeating the above steps, the client and server can collaboratively train the global GNN model while ensuring data privacy and security.

[0166] like Figure 2As shown in the figure, the execution process of the server in the federated wind power data anomaly detection model is as follows: Taking the global model aggregation in each round as an example, the server first initializes the model parameters and sends them to each client, and sets the training round E of federated learning. Each client determines the number of batches B based on the size of the local data set and the batch size, and determines R based on the number of relations contained in the data. In each batch, in order to calculate the loss of the federated multi-scale graph contrastive learning feature generation model and the loss of the value-oriented information transfer federated learning model, the client needs to upload the contrastive learning prototype, high-value information, and predictor INFO to the server after each relationship calculation is completed. p Parameters. The server sends high-value information to each client to calculate the global loss. After collecting the global loss, it returns all processed information to the client. Because communication between the server and the client is independent, a communication thread pool design is adopted to improve communication efficiency. After the server starts, each client object is assigned a thread. Each thread is responsible for communicating with a single client and waits for the client to return the result after making a remote call. Federated learning uses synchronous training. At each step, the server must receive the return results from all clients before proceeding to the next training step.

[0167] like Figure 3 As shown in the figure, the client execution process of the federated wind power data anomaly detection model is as follows: Taking global model aggregation as an example, once a guide node is generated, the federated multi-scale graph contrast learning feature generation model uploads the prototype information to the server and obtains the global prototype information to calculate the loss. After neighbor selection is completed, the value-oriented information transfer federated learning model uses the guide node features and the neighbor selection mechanism to predict high-value information. It simultaneously uploads high-value information and local predictors, and receives global losses and predictor parameters from other clients to predict information from high-value information sources. After calculating the classification loss to complete local model training, the required remote call results are packaged, serialized using ProtoBuf, and uploaded to the server via the gRPC framework. The client then receives the global model parameters sent by the server for a new round of local training.

[0168] The present invention provides a wind power data anomaly detection system based on a federated learning mechanism, comprising:

[0169] A generation module is used for each client to use the locally stored wind power data to generate a guide node based on the federated multi-scale graph comparative learning feature generation model;

[0170] A selection module is used to use the enhanced features of the guide node to perform a neighbor selection mechanism based on reinforcement learning to select a set of neighbor nodes to be aggregated;

[0171] The extraction module is used to extract high-value information across clients based on the set of neighbor nodes and use the value-oriented information transfer federated learning model to obtain the high-value information relationship subgraph of the target node;

[0172] Aggregation module, which is used to aggregate the information of neighbor nodes under each relationship in the high-value information relationship subgraph using GNN based on message passing mechanism;

[0173] The prediction module is used to predict the abnormality of the data using a multi-layer perceptron as a classifier after locally aggregating neighbor information;

[0174] The calculation module is used to calculate the classification loss and form a local model through loss training;

[0175] The detection module is used to iterate the global model using the weighted average of local models to obtain a federal wind power data anomaly detection model, and perform real-time detection on wind power data distributed and stored in various locations.

[0176] The present invention optimizes the expansion of the wind power data anomaly detection model in a distributed storage environment under the federated learning mechanism, alleviates the Non-IID problem while solving the neighbor information missing problem, and improves the accuracy of wind power data anomaly detection.

[0177] The technical means disclosed in the solutions of the present invention are not limited to those disclosed in the above-mentioned embodiments, but also include technical solutions composed of any combination of the above-mentioned technical features. It should be noted that those skilled in the art may make various improvements and modifications without departing from the principles of the present invention, and such improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A wind power data anomaly detection method based on a federated learning mechanism, characterized by: include: Each client uses locally stored wind power data to generate a guide node based on a federated multi-scale graph contrast learning feature generation model; Use the enhanced features of the guide node to perform a neighbor selection mechanism based on reinforcement learning to select the set of neighbor nodes to be aggregated; Based on the neighbor node set, the value-oriented information transfer federated learning model is used to extract high-value information across clients and obtain the high-value information relationship subgraph of the target node; Use the node value evaluator to evaluate the value of the node, use the Top-K algorithm to select the K nodes with the highest value, and obtain high-value information based on the nodes; Use GNN based on message passing mechanism to aggregate the information of neighbor nodes under each relationship in the high-value information relationship subgraph; After completing the local aggregation of neighbor information, a multi-layer perceptron is used as a classifier to predict the abnormality of the data; Calculate the classification loss and form a local model through loss training; The global model is iterated using the weighted average of local models to obtain a federal wind power data anomaly detection model, which performs real-time detection on distributed wind power data stored in various locations. The value-oriented information transfer federated learning model includes: In a federated environment, a global loss for information prediction is added to optimize the local multi-scale graph contrastive learning feature generation model on each client, enabling the local multi-scale graph contrastive learning feature generation model to perceive information from other clients, add high-value information to the relationship subgraph based on the global data distribution, and realize information transmission between clients while ensuring data security.

2. The method for detecting anomalies in wind power data based on a federated learning mechanism according to claim 1, characterized in that: The generation process of the bootstrap node includes: A federated multi-scale graph contrastive learning feature generation model is established, and the optimizer is used to train the federated multi-scale graph contrastive learning feature generation model to obtain the final guiding node.

3. The method for detecting anomalies in wind power data based on a federated learning mechanism according to claim 2, characterized in that: The process of establishing the federated multi-scale graph contrastive learning feature generation model is as follows: Build a multi-relationship graph using the original wind power data stored locally on the client; Input each single relationship graph of the multi-relation graph into the local GNN to obtain the guiding node features corresponding to each node; Each client performs contrastive learning on the features of the guide nodes in the local graph at global and local scales, and obtains the contrastive learning loss of each node at global and local scales. Add the contrastive learning loss of the global scale and the local scale to get the local contrastive learning loss; Each client forms a local multi-scale graph contrast learning feature generation model through local contrast loss training; Using prototypes instead of models to participate in federated training when transmitting information between clients and between clients and between clients and servers; Calculate the local prototype of each client and send it to the server for aggregation; The server collects the local prototypes of all clients under each relationship and calculates the global prototype; The server sends all local prototypes to each client; The multi-scale graph contrastive learning feature generation model in each client learns and updates from the global prototype and the local prototypes from other clients to form a federated multi-scale graph contrastive learning feature generation model.

4. The method for detecting anomalies in wind power data based on a federated learning mechanism according to claim 3, characterized in that: Perform global comparative learning on the guide node features, including comparing each guide node feature of each node with all other nodes in the corresponding relationship, narrowing the similarity of guide node features of the same category and reducing the similarity of guide node features of different categories; The category is the label of the node, indicating the status of the wind turbine.

5. The method for detecting anomalies in wind power data based on a federated learning mechanism according to claim 3, characterized in that: The local scale contrastive learning of the guide node features is performed, including comparing each guide node feature of each node with the aggregated information of the neighbor nodes of the node under the corresponding relationship.

6. The method for detecting anomalies in wind power data based on a federated learning mechanism according to claim 1, characterized in that: The neighbor selection mechanism based on reinforcement learning includes: Train the node value evaluator model locally; Use the node value evaluator model to evaluate the value of the node; Based on the value of the node, a multi-agent reinforcement learning-based algorithm is used to make fine-grained individual judgments on the aggregation of all neighboring nodes.

7. The method for detecting anomalies in wind power data based on a federated learning mechanism according to claim 1, characterized in that: The generation process of the high-value information relationship subgraph includes: Based on the set of neighbor nodes, the representation of the guiding node is obtained using the value-oriented information transfer federated learning model; After adding random Gaussian noise to the representation of the guide node, the high-value node features are predicted using the high-value information prediction model; The edge information and feature information of high-value nodes are added to the original relationship subgraph of the target node to form a high-value information relationship subgraph as the input graph data of the first layer of the GNN network.

8. The method for detecting anomalies in wind power data based on a federated learning mechanism according to claim 7, characterized in that: The value of a neighbor node information of the target node is the deviation between the target node label prediction value and the correct label after the guide node of the node aggregates the guide node information of the neighbor node; If the predicted probability after aggregating this neighbor information shifts towards the correct label of the target node, the agent is rewarded, otherwise it is punished; the agent is the neighbor node of the target node that is currently judged to be selected or abandoned.

9. The method for detecting anomalies in wind power data based on a federated learning mechanism according to claim 1, characterized in that: The iterative update process of the federal wind power data anomaly detection model is as follows: After multiple rounds of local model training on each client, its model parameters are uploaded to the central server; After receiving the model parameters from all clients, the central server uses the number of client nodes as the weight to perform weighted average aggregation on all local models to obtain the global model parameters; The central server then sends the global model parameters to all clients, and each client uses the locally stored wind power data to perform the next round of model updates; Repeat the above steps, and the client and server will collaboratively train the federated wind power data anomaly detection model under the premise of privacy protection for wind power data anomaly detection.

10. A wind power data anomaly detection system based on a federated learning mechanism, characterized by: include: A generation module is used for each client to use the locally stored wind power data to generate a guide node based on the federated multi-scale graph comparative learning feature generation model; A selection module is used to use the enhanced features of the guide node to perform a neighbor selection mechanism based on reinforcement learning to select a set of neighbor nodes to be aggregated; The extraction module is used to extract high-value information across clients based on the set of neighbor nodes and use the value-oriented information transfer federated learning model to obtain the high-value information relationship subgraph of the target node; Use the node value evaluator to evaluate the value of the node, use the Top-K algorithm to select the K nodes with the highest value, and obtain high-value information based on the nodes; Aggregation module, which is used to aggregate the information of neighbor nodes under each relationship in the high-value information relationship subgraph using GNN based on message passing mechanism; The prediction module is used to predict the abnormality of the data using a multi-layer perceptron as a classifier after locally aggregating neighbor information; The calculation module is used to calculate the classification loss and form a local model through loss training; The detection module is used to iterate the global model using the weighted average of local models to obtain a federal wind power data anomaly detection model, and perform real-time detection on wind power data stored in distributed locations; The value-oriented information transfer federated learning model includes: In a federated environment, a global loss for information prediction is added to optimize the local multi-scale graph contrastive learning feature generation model on each client, enabling the local multi-scale graph contrastive learning feature generation model to perceive information from other clients, add high-value information to the relationship subgraph based on the global data distribution, and realize information transmission between clients while ensuring data security.

Citation Information

Patent Citations

  • Federal learning method based on graph neural network and bidirectional deep knowledge distillation

    CN117829320A

  • Longitudinal federal learning method and system based on graph neural network

    CN118036651A