Microgrid Intrinsic Resilience Control Methods, Devices, Electronic Equipment and Medium

By introducing a three-layer defense mechanism of a two-layer graph convolutional network and a biological immune system into the microgrid, a topology graph model is constructed and attack compensation is performed, which solves the problem of the microgrid's adaptability and stability under complex attack environments and realizes autonomous detection and isolation.

CN121923936BActive Publication Date: 2026-05-26WUHAN UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN UNIV
Filing Date
2026-03-23
Publication Date
2026-05-26

Smart Images

  • Figure CN121923936B_ABST
    Figure CN121923936B_ABST
Patent Text Reader

Abstract

This application discloses a method, device, electronic device, and medium for endogenous resilience control in microgrids, relating to the field of microgrid security technology. The method includes: achieving autonomous detection, isolation, and recovery from communication attacks through precise mapping of IGCC to an immune three-layer defense and topological adaptation of graph convolutional networks. This effectively addresses the challenges of malicious attacks on the communication layer and disruption of collaborative mechanisms, realizing deep integration and autonomous evolutionary defense between biological immune defense mechanisms and graph neural networks. This improves the adaptability and stability of the microgrid control system under complex attack environments, effectively solving the problems of slow response and lack of self-organization in traditional defense methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of microgrid security technology, and in particular to a microgrid intrinsic resilience control method, a microgrid intrinsic resilience control device, a computer-readable storage medium, and an electronic device. Background Technology

[0002] As a key support for future energy networks, DC microgrids, while enhancing system flexibility through coordinated control enabled by information and communication technologies, also introduce vulnerabilities. Current cyberattacks have evolved into more covert and complex patterns, such as combined spoofing and denial-of-service attacks, smart replay attacks based on Kalman filtering, and asymmetric delay attacks. These attacks manipulate the information layer to disrupt inter-node collaboration, triggering system-wide disasters at low cost.

[0003] Related defense research focuses on paths such as detection-switching, model elastic control, and state compensation, but generally suffers from limitations such as reliance on accurate models or fixed topologies, response lag, and difficulty in dealing with covert attacks and dynamic topology reconstruction. Its fundamental flaw lies in separating attack detection and control strategies, lacking self-organization and adaptive capabilities, and being unable to autonomously evolve defense strategies according to attack intensity and system state, resulting in limited defense effectiveness under rapidly changing attack modes. Summary of the Invention

[0004] This application aims to at least partially address one of the technical problems in related technologies. To this end, the first objective of this application is to propose a microgrid intrinsic resilience control method, which involves constructing a topology model of a communication network among multiple power generation units; calculating a comprehensive antigen index for each power generation unit based on the topology model and measurement data of each unit; identifying the abnormal power generation units affected by the attack and the corresponding attack type when the comprehensive antigen index deviates from a preset range, wherein multiple power generation units include the abnormal power generation units; inputting the measurement data of each power generation unit into a first graph convolutional layer to perform convolution operations to generate a first layer of hidden state features; performing attack compensation on the first layer of hidden state features based on the abnormal power generation units and the corresponding attack type to obtain compensated first layer of hidden state features; inputting the compensated first layer of hidden state features into a second graph convolutional layer to perform convolution operations to generate a second layer of hidden state features; mapping the second layer of hidden state features to the voltage correction amount of each power generation unit, and controlling the corresponding power generation unit according to the voltage correction amount of each unit. This application achieves autonomous detection, isolation, and recovery from communication attacks through precise mapping of IGCC (Intelligent Graph Convolutional Control System) with immune three-layer defense and topological adaptation of graph convolutional networks. It can effectively cope with the challenges of malicious attacks on the communication layer and disruption of cooperation mechanisms, realize the deep integration and autonomous evolutionary defense of biological immune defense mechanisms and graph neural networks, improve the adaptability and stability of microgrid control systems in complex attack environments, and effectively solve the problems of slow response and lack of self-organization in traditional defense methods.

[0005] The second objective of this application is to propose an intrinsic resilience control device for microgrids.

[0006] The third objective of this application is to provide a computer-readable storage medium.

[0007] The fourth objective of this application is to propose an electronic device.

[0008] To achieve the above objectives, the first aspect of this application proposes a microgrid intrinsic resilience control method, which involves constructing a topology model of a communication network among multiple power generation units; calculating a comprehensive antigen index for each power generation unit based on the topology model and measurement data of each power generation unit; identifying abnormal power generation units affected by attacks and their corresponding attack types when the comprehensive antigen index deviates from a preset range, wherein the multiple power generation units include abnormal power generation units; inputting the measurement data of each power generation unit into a first graph convolutional layer to perform convolution operations to generate a first layer of hidden state features; performing attack compensation on the first layer of hidden state features based on the abnormal power generation units and their corresponding attack types to obtain compensated first layer of hidden state features, and inputting the compensated first layer of hidden state features into a second graph convolutional layer to perform convolution operations to generate a second layer of hidden state features; mapping the second layer of hidden state features to the voltage correction amount of each power generation unit, and controlling the corresponding power generation unit according to the voltage correction amount of each power generation unit.

[0009] According to one embodiment of this application, a comprehensive antigen index for each power generation unit is calculated based on a topology model and measurement data of each power generation unit, including: calculating a temporal anomaly metric and a spatial anomaly metric for each power generation unit based on the topology model and measurement data of each power generation unit; and calculating a comprehensive antigen index for each power generation unit based on the temporal anomaly metric and the spatial anomaly metric.

[0010] According to one embodiment of this application, based on a topology graph model and measurement data of each power generation unit, the temporal anomaly metric and spatial anomaly metric of each power generation unit are calculated, including: determining the set of adjacent power generation units for each power generation unit based on the topology graph model; calculating the temporal anomaly metric of each power generation unit based on the current voltage measurement value of each power generation unit and the average voltage of the set of adjacent power generation units at the previous sampling time; and calculating the spatial anomaly metric of each power generation unit based on the current voltage measurement value of each power generation unit and the average current voltage of all power generation units.

[0011] According to one embodiment of this application, attack compensation is performed on the first-layer hidden state features based on the abnormal power generation unit and the corresponding attack type to obtain the compensated first-layer hidden state features. This includes: responding to an attack type of spoofing, using an adaptive threshold filtering algorithm to filter the measurement data features of the abnormal power generation unit in the first-layer hidden state features to obtain the compensated first-layer hidden state features; responding to an attack type of denial-of-service, determining the neighboring power generation units of the abnormal power generation unit based on a topology graph model, and determining the measurement data features of the neighboring power generation units and the abnormal measurement data features of the abnormal power generation unit based on the first-layer hidden state features; fusing the measurement data features of the neighboring power generation units with the abnormal measurement data features of the abnormal power generation unit to obtain the target measurement data features of the abnormal power generation unit; and using the target measurement data features to compensate the first-layer hidden state features to obtain the compensated first-layer hidden state features; responding to an attack type of delay, estimating the measurement data features of the abnormal power generation unit at the current time using a Kalman filter based on the measurement data features of the neighboring power generation units, and using the estimated measurement data features to compensate the first-layer hidden state features to obtain the compensated first-layer hidden state features.

[0012] According to one embodiment of this application, before performing attack compensation on the first-layer hidden state features based on the attack type of the abnormal power generation unit, the method further includes: constructing a Lyapunov energy function and determining an energy limit rule based on the Lyapunov energy function; calculating the norm of the first-layer hidden state features, and performing projection scaling processing on the first-layer hidden state features when the norm is greater than the energy limit rule.

[0013] According to one embodiment of this application, before mapping the second-layer hidden state features to the voltage correction amount of each power generation unit, the method further includes: determining the adjacency matrix and degree matrix according to the topological graph model; calculating the graph Laplacian matrix based on the adjacency matrix and degree matrix; determining the consistency convergence boundary based on the spectral characteristics of the graph Laplacian matrix; and scaling the second-layer hidden state features if the consistency error of the second-layer hidden state features exceeds the consistency convergence boundary.

[0014] According to one embodiment of this application, mapping the second-layer hidden state features to the voltage correction amount of each power generation unit includes: mapping the second-layer hidden state features to the first voltage correction amount of each power generation unit through a linear transformation layer; constructing a stability region of multi-scale Lyapunov constraints, and projecting the first voltage correction amount exceeding the Lyapunov energy function based on the stability region of multi-scale Lyapunov constraints to obtain the second voltage correction amount of each power generation unit; performing regularization processing on the second voltage correction amount, and injecting a preset damping coefficient into the regularized second voltage correction amount based on an immune damping mechanism to obtain the voltage correction amount of each power generation unit.

[0015] To achieve the above objectives, a second aspect of this application proposes a microgrid intrinsic resilience control device, comprising: a construction module for constructing a topology model of a communication network among multiple power generation units; a calculation module for calculating a comprehensive antigen index for each power generation unit based on the topology model and measurement data of each power generation unit; a determination module for determining abnormal power generation units affected by attacks and the corresponding attack types when the comprehensive antigen index deviates from a preset comprehensive antigen index range, wherein the multiple power generation units include abnormal power generation units; a first generation module for inputting the measurement data of each power generation unit into a first graph convolutional layer to perform convolution operations to generate a first layer of hidden state features; a compensation module for performing attack compensation on the first layer of hidden state features based on the abnormal power generation units and the corresponding attack types to obtain compensated first layer of hidden state features; a second generation module for inputting the compensated first layer of hidden state features into a second graph convolutional layer to perform convolution operations to generate a second layer of hidden state features; a mapping module for mapping the second layer of hidden state features to the voltage correction amount of each power generation unit; and a control module for controlling the corresponding power generation unit according to the voltage correction amount of each power generation unit.

[0016] To achieve the above objectives, a third aspect of this application provides a computer-readable storage medium storing a microgrid endogenous resilience control program thereon, which, when executed by a processor, implements the aforementioned microgrid endogenous resilience control method.

[0017] To achieve the above objectives, a fourth aspect of this application provides an electronic device, including a memory, a processor, and a microgrid endogenous resilience control program stored in the memory and capable of running on the processor. When the processor executes the microgrid endogenous resilience control program, it implements the aforementioned microgrid endogenous resilience control method.

[0018] According to the microgrid intrinsic resilience control method, device, electronic equipment, and medium of this application embodiment, a topology model of a communication network between multiple power generation units is constructed; based on the topology model and the measurement data of each power generation unit, a comprehensive antigen index of each power generation unit is calculated; when the comprehensive antigen index deviates from the preset comprehensive antigen index range, the abnormal power generation unit affected by the attack and the corresponding attack type are determined, wherein the multiple power generation units include the abnormal power generation unit; the measurement data of each power generation unit is input into a first graph convolutional layer to perform convolution operation to generate a first layer of hidden state features; attack compensation is performed on the first layer of hidden state features based on the abnormal power generation unit and the corresponding attack type to obtain a compensated first layer of hidden state features, and the compensated first layer of hidden state features is input into a second graph convolutional layer to perform convolution operation to generate a second layer of hidden state features; the second layer of hidden state features are mapped to the voltage correction amount of each power generation unit, and the corresponding power generation unit is controlled according to the voltage correction amount of each power generation unit. This application achieves autonomous detection, isolation, and recovery from communication attacks through precise mapping of IGCC to the three-layer immune defense and topological adaptation of graph convolutional networks. It can effectively cope with the challenges of malicious attacks on the communication layer and disruption of the cooperation mechanism, realize the deep integration and autonomous evolution of biological immune defense mechanisms and graph neural networks, improve the adaptability and stability of microgrid control systems in complex attack environments, and effectively solve the problems of slow response and lack of self-organization in traditional defense methods. Attached Figure Description

[0019] Figure 1 This is a schematic diagram illustrating the principle of mapping biological immune mechanisms to graph convolution according to some embodiments of this application;

[0020] Figure 2 The flowchart shows a microgrid intrinsic resilience control method according to some embodiments of this application;

[0021] Figure 3 This is a schematic diagram illustrating a communication attack mechanism according to some embodiments of this application;

[0022] Figure 4 This is a schematic diagram of the structure of a microgrid endogenous resilience control system according to some embodiments of this application;

[0023] Figure 5 This is a block diagram of a microgrid endogenous resilience control device according to some embodiments of this application;

[0024] Figure 6 This is a block diagram of an electronic device according to some embodiments of this application. Detailed Implementation

[0025] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0026] The following describes in detail, with reference to the accompanying drawings, the microgrid intrinsic resilience control method, apparatus, electronic equipment, and medium according to embodiments of this application.

[0027] DC (Direct Current) microgrids, as core infrastructure capable of operating in grid-connected or isolated modes, have become a key supporting technology for future energy networks. Microgrids rely on information and communication technologies to achieve coordinated control of multiple distributed power sources. This approach enhances system flexibility but also introduces certain vulnerabilities. Malicious attacks on the control system can lead to voltage instability, current oscillations, and even large-scale power outages. Therefore, ensuring the inherent resilience of microgrids under communication attack environments—that is, the ability of microgrids to autonomously detect, adjust, and maintain basic functions when attacked—has become a core scientific problem urgently needing to be solved in the field of energy system security.

[0028] Current cyberattacks against microgrids have evolved into more covert, complex, and destructive models. Attackers, through combined attacks of spoofed data injection and denial-of-service (DoS) attacks, can bypass defense mechanisms based on technical detection, disrupting data integrity and availability, and are extremely difficult to defend against due to their stealthy nature. Smart replay attacks, combining Kalman filters for state prediction, can inject historical steady-state data during the system's transient phase, maximizing control error while avoiding triggering anomaly detection thresholds. Furthermore, asymmetric delay attacks, by injecting sudden delays or accumulated jitter, disrupt the convergence conditions of consensus protocols, leading to voltage oscillations or even instability. A common characteristic of these attacks is that they target the control cooperation mechanism itself; they do not directly attack physical devices but rather manipulate the information layer to disrupt the coordination between nodes, thereby causing system-wide disasters at minimal cost.

[0029] Current research on defense against communication attacks mainly focuses on detection-switching strategies, enhanced model-based resilient control, and state compensation. Detection-switching methods employ attack detectors to switch to backup control modes upon detection of an attack. However, this reactive mechanism suffers from transient biases due to detection delays and is susceptible to detection failures against covert attacks such as spoofed data injection. Model-based resilient control mitigates the negative impact of communication attacks through robust state estimation and attack compensation mechanisms, but most methods still heavily rely on accurate microgrid dynamic models and prior knowledge of the communication topology. The effectiveness of resilient compensation significantly diminishes once model parameters mismatch or the topology is maliciously reconstructed. State compensation methods reconstruct the true operating state of the microgrid through attack anomaly identification and measurement signal correction, thus protecting against communication attacks that could tamper with measurement data. However, the effectiveness of this strategy is highly dependent on a fixed microgrid communication topology. Link reconstruction caused by topology attacks directly disrupts the topology constraints required for detection and compensation, leading to the paralysis of the entire mechanism. The drawback of the above method is that it separates attack detection from control strategies, resulting in lagging defense and an inability to cope with rapidly changing attack patterns. It also lacks a certain degree of self-organization and adaptability, and cannot automatically evolve defense strategies based on attack intensity and system status.

[0030] The biological immune system offers profound insights into addressing these challenges. The human immune system exhibits remarkable autonomous defense capabilities: innate immunity rapidly recognizes pathogen-related molecular patterns through pattern recognition receptors, initiating an immediate immune response; acquired immunity, through the learning and recognition of specific antigens by T cells and B cells, generates memory cells, enabling the body to respond more quickly and accurately to reinfection; immune regulation achieves coordination among immune cells through cytokine networks, preventing excessive immune responses or insufficient immunity. The core characteristics of the biological immune system—distributed collaboration, adaptive learning, and dynamic equilibrium—are highly compatible with the needs of distributed control in microgrids.

[0031] Meanwhile, breakthroughs in processing graph-structured data by GNNs (Graph Neural Networks) have provided new tools for microgrid control. GNNs propagate information between graph nodes through message passing mechanisms, adapting to the communication topology of microgrids. However, directly applying GNNs to control lacks theoretically guaranteed stability, and purely data-driven GNN models may fail under attack scenarios outside the training samples, or even produce unstable control outputs.

[0032] Based on this, this application adopts a two-layer graph convolutional network architecture, mapping the three-layer defense mechanism of the biological immune system to graph convolutional computation. The first graph convolutional layer implements innate immune function, identifying attacks and dynamically reconstructing the communication topology through spatiotemporal anomaly detection; the second graph convolutional layer implements acquired immune function, performing adaptive filtering and compensation for attacks; the output transformation layer integrates the immune memory mechanism to generate stable control output. Specifically, refer to... Figure 1 The mapping relationship between the biological immune system and the graph convolutional control system (IGCC) is illustrated by analogy, mapping the three-layer defense architecture of the biological immune system to the graph convolutional computational control system of a microgrid, thereby endowing the control system with autonomous defense capabilities similar to those of an organism. From the perspective of the biological immune system on the left, the first layer is innate immunity, which achieves rapid and non-specific defense through mechanisms such as pattern recognition receptors, cytokine networks, and T cell activation. It acts as the body's first line of defense, quickly recognizing common pathogen characteristics and initiating an immediate response. The second layer is acquired immunity, which is activated when innate immunity fails to clear pathogens through antibody-specific recognition and B / T cell clonal expansion, producing precise and specific defense against specific antigens. The third layer is immune memory, which relies on memory B / T cells and memory decay mechanisms to retain memory cells after infection is cleared, enabling the body to respond more quickly and accurately to re-invasion, while memory decay prevents the immune system from becoming overactive. Mapped to the graph convolutional control system (IGCC) on the right, the first convolutional layer implements innate immunity, rapidly identifying attacks through spatiotemporal anomaly detection, blocking attack paths through dynamic topology reconstruction and DoS path reconstruction, and achieving rapid response using immune activation functions and time delay compensation. The second convolutional layer implements acquired immunity, specifically handling different types of attacks through time delay compensation, FDI filtering, and DoS path reconstruction, and dynamically adjusting defense parameters according to attack intensity using antibody adaptive adjustment. The output transformation layer integrates an immune memory mechanism, recording historical attack characteristics through immune memory variables, ensuring the stability of control output through multi-scale projection, and preventing outdated strategies from affecting normal system operation through memory decay mechanisms. Through this precise mapping, the IGCC system can autonomously detect, isolate, and recover from communication attacks like a living organism, effectively solving the problems of slow response and lack of self-organization in traditional defense methods. It achieves autonomous detection, isolation, and recovery from communication attacks, effectively addressing the challenges of malicious attacks and disruption of cooperation mechanisms at the communication layer. This achieves deep integration and autonomous evolutionary defense between biological immune defense mechanisms and graph neural networks, improving the adaptability and stability of microgrid control systems in complex attack environments.

[0033] Figure 2 This is a flowchart of a microgrid intrinsic resilience control method according to some embodiments of this application. (Refer to...) Figure 2 The microgrid endogenous resilience control method in this application embodiment may include the following steps:

[0034] S110, construct a topology model of the communication network between multiple power generation units.

[0035] Specifically, a DC microgrid includes multiple distributed generation units (DGs). Each DG is connected to a common bus via line impedance and supplies power to local loads. The dynamic model of the i-th DG can be represented as:

[0036] ;

[0037] in, The time derivative of the DC bus voltage of the i-th DG; C i Indicates the first i The filter capacitor for each DG; Indicates the first i The inductor current of each DG; This represents the output load current of the i-th DG; This represents the inductor current of the i-th DG filter inductor; Indicates the first i Duty cycle of each DG; Indicates the first i The filter inductor of the DG; Indicates the first i The input voltage of each DG.

[0038] DC microgrids have two main control objectives: voltage regulation and power balancing. The droop control can be expressed as:

[0039] ;

[0040] in, This represents the droop control reference voltage of the i-th DG; Represents the time t. i The nominal voltage of each DG; No. i Virtual impedance of power distribution for each DG; Represents the time t. i The output current of each DG.

[0041] The communication network between multiple power generation units can be represented by a topology graph model (undirected graph). ,in ={1,2,…,N} is the set of power generation units. × Let be the set of edges, if the power generation unit i and power generation unit j If there is a communication link, then (i , j )∈ Specifically, first, define the node set. Each independent power generation unit (such as a photovoltaic inverter, wind turbine controller, or energy storage converter) is abstracted as a node in the graph, and a unique index 1, 2, ..., N is assigned to each node. Next, the edge set is defined. Through surveying or design, determine which power generation units are actually connected by communication lines (such as fiber optic cables, network cables) or have established wireless connections (such as 5G, WiFi). If there is a bidirectional communication link between unit i and unit j, then connect an undirected edge between node i and node j. i , j ) and classify it into the edge set Ultimately, it is the set of nodes. and edge set Undirected graph formed by the two This is the required communication network topology model.

[0042] S120 calculates the comprehensive antigen index for each power generation unit based on the topology model and the measurement data of each power generation unit.

[0043] Specifically, drawing inspiration from the recognition mechanisms of the biological immune system, this study analogizes the abnormal state of power generation units caused by external attacks as antigens, quantifying these antigenic characteristics by constructing anomaly indicators in both temporal and spatial dimensions. Specifically, firstly, measurement data from each power generation unit is collected based on a communication topology diagram; then, fluctuations in the historical data of each unit are analyzed in the temporal dimension to extract temporal anomaly indicators, and operational differences between adjacent units (i.e., node pairs with communication links) are compared in the spatial dimension to extract spatial anomaly indicators; finally, the temporal and spatial anomaly indicators of each unit are input into a pre-defined comprehensive antigen indicator calculation formula, outputting a comprehensive antigen indicator for preliminary judgment of whether the power generation unit exhibits anomalies. This process simulates the mechanism by which pattern recognition receptors trigger an immune response by recognizing pathogen-related molecular patterns.

[0044] S130, when the comprehensive antigen index deviates from the preset comprehensive antigen index range, the abnormal power generation units affected by the attack and the corresponding attack type are determined, wherein multiple power generation units include abnormal power generation units. The preset comprehensive antigen index range can be calibrated according to the actual situation, and no specific restrictions are imposed here.

[0045] Specifically, after determining the comprehensive antigen index of each power generation unit, the comprehensive antigen index of each power generation unit is compared with a preset comprehensive antigen index range to determine whether any power generation unit's comprehensive antigen index deviates from the preset range. If any power generation unit's comprehensive antigen index deviates from the preset range, the DC microgrid is determined to be under attack; if any power generation unit's comprehensive antigen index does not deviate from the preset range, the DC microgrid is determined not to be under attack. After determining that the DC microgrid has been attacked, the abnormal power generation units affected by the attack and the corresponding attack type are further identified.

[0046] For example, refer to Figure 3 Delay attacks inject asymmetric propagation delay, i.e., base delay, into communication data packets. τ b Superimposed Gaussian jitter, sudden delays are probabilistic P τ Triggered, the delay increases and continues for 25-40 cycles; the data received by the attacked node is... t - τ The timing of data changes, even down to the second, leads to state asynchrony, disrupting the synchronization and coordination mechanism between distributed generation units. Identifying affected abnormal units hinges on detecting timing inconsistencies and deviations in the consistency protocol. Specifically, in the distributed control architecture of a microgrid, each generation unit needs to periodically exchange state information to achieve voltage / frequency synchronization. When a time delay attack targets one or more units, the timing of its local controller receiving information from neighboring units will deviate abnormally, causing the control commands calculated by that unit based on outdated information to deviate from the global coordination trend. Therefore, detection can be achieved by deploying a timestamp verification mechanism and spatiotemporal correlation analysis. By comparing the expected communication timing with the actual arrival time, if the arrival time sequence of a unit's information flow shows statistical anomalies (such as sudden changes in the mean delay or a surge in variance), and its control output continuously deviates from the overall convergence direction, then it can be determined that the unit has suffered a time delay attack.

[0047] Continue to refer to Figure 3FDI (False Data Injection) attacks induce the system to make incorrect decisions by tampering with measurement data or control commands uploaded by power generation units. The key to identifying affected abnormal units lies in discovering the mismatch between physical dynamics and measurement data. Specifically, the operation of power generation units in a microgrid must conform to physical laws (such as power balance and voltage-current relationships). While attackers can forge data, it is difficult to simultaneously tamper with all relevant physical variables. Location can be determined through model-based residual detection and data-driven consistency verification. The real-time physical model of the power generation unit (such as state-space equations) can be used to predict its output. If a unit's reported power, voltage, and other data show a continuous and subtle deviation from its model predictions or indirect calculations from neighboring units, while the unit's local sensor calibration values ​​are normal, it may be a victim of an FDI attack.

[0048] Continue to refer to Figure 3 A Denial-of-Service (DoS) attack prevents power generation units from receiving commands or uploading data by blocking communication links or flooding control channels. The direct indicators of an affected unit are communication interruption and the disappearance of data flow. Specifically, in a microgrid's centralized or distributed control architecture, each power generation unit needs to maintain periodic heartbeat communication. When a unit uploads no data for several consecutive communication cycles, and its local backup controller does not trigger an offline mode switch, it can be determined that it has suffered a DoS attack. In other words, a denial-of-service attack can affect multiple power generation units.

[0049] S140, the measurement data of each power generation unit is input into the first graph convolutional layer to perform convolution operation to generate the first layer of hidden state features.

[0050] Specifically, the biological immune system uses cytokine networks to isolate infected cells and prevent the spread of pathogens. In graph convolution computation, immune isolation is achieved by dynamically adjusting the adjacency matrix weights to reduce the influence of attacked nodes in message transmission. Specifically, the adjacency matrix weights can be dynamically reconstructed based on the abnormal power generation unit and the corresponding attack type to obtain an immune-reconstructed adjacency matrix. For example, for denial-of-service attacks, if a unit's communication is completely interrupted, all the corresponding row and column elements in its original adjacency matrix are set to zero. At the same time, based on network redundancy analysis, backup communication links are re-established between the unit's neighboring nodes and other normal units, reconstructing a connected subgraph that can bypass the faulty node, ensuring that information can still be transmitted through a detour. For false data injection attacks, when it is confirmed that a unit's data has been maliciously tampered with but the communication link still exists, the weight allocation of the unit in the consensus algorithm is first frozen, and the weights of the corresponding edges in its adjacency matrix are dynamically reduced through a confidence assessment mechanism until they are gradually reduced to zero. At the same time, other nodes are guided to rebuild trusted connections based on physical coupling strength or historical credibility, achieving soft isolation at the data level and preventing false information from polluting the global state estimation. To address latency attacks, after identifying abnormal latency units, the system compares the latency stability indicators of each path, removes communication edges with latency exceeding the threshold, and allocates alternative communication paths with latency compensation capabilities to affected units based on a distributed prediction algorithm. This dynamically replaces latency-sensitive edges in the adjacency matrix, ensuring the real-time and synchronous nature of information interaction. The overall reconstruction process requires the embedding of a distributed consensus protocol to ensure that all normal units can synchronously obtain the reconstructed adjacency matrix during topology updates. Algebraic connectivity checks are used to ensure the convergence of the new topology, ultimately forming a dynamic adjacency matrix that isolates anomalies while maintaining consistency.

[0051] After obtaining the reconstructed adjacency matrix, the hyperparameters of the first graph convolutional layer are adjusted based on the reconstructed adjacency matrix. For example, the hyperparameters of the first graph convolutional layer can be determined by looking up a preset relationship mapping table between the adjacency matrix and the hyperparameters of the first graph convolutional layer. This preset relationship mapping table includes multiple adjacency matrices and the hyperparameters of the first graph convolutional layer corresponding to each adjacency matrix. The hyperparameters can be neighborhood order, hidden layer dimension, and number of layers, etc.

[0052] After adjusting the hyperparameters of the first graph convolutional layer based on the reconstructed adjacency matrix, the measurement data of each power generation unit is input into the first graph convolutional layer to perform convolution operations to generate the first layer of hidden state features:

[0053] ;

[0054] in, This represents the hidden state output of the first convolutional layer. This represents the normalized adjacency matrix after immune reconstruction; This represents the preprocessed feature matrix, which includes measurement data for each power generation unit. The measurement data can be voltage, current, or other measurements. This represents the weight matrix of the first convolutional layer; This represents the bias vector of the first convolutional layer.

[0055] S150, attack compensation is performed on the first layer hidden state features based on the abnormal power generation unit and the corresponding attack type to obtain the compensated first layer hidden state features, and the compensated first layer hidden state features are input into the second graph convolutional layer to perform convolution operation to generate the second layer hidden state features.

[0056] Specifically, the acquired immune system identifies pathogens through antibody specificity. In this application, it performs precise detection for specific attack types and performs attack compensation on the first-layer hidden state features based on the abnormal power generation units and the corresponding attack types to obtain compensated first-layer hidden state features. For example, in the case of a spoofing attack, the measurement data features of the abnormal power generation units in the first-layer hidden state features are filtered; in the case of a denial-of-service attack, the measurement data features of the abnormal power generation units in the first-layer hidden state features are fused; and in the case of a latency attack, the measurement data features of the abnormal power generation units in the first-layer hidden state features are estimated.

[0057] The compensated first-layer hidden state features are obtained, and then input into the second graph convolutional layer to perform convolution operations to generate the second-layer hidden state features.

[0058] ;

[0059] in, This represents the hidden state feature output of the convolutional layer in the second graph; This represents a pre-defined standard normalized adjacency matrix; This represents the features of the first hidden state after compensation; This represents the weight matrix of the convolutional layer in the second graph; This represents the bias vector of the convolutional layer in the second graph.

[0060] S160, the second-layer hidden state features are mapped to the voltage correction amount of each power generation unit, and the corresponding power generation unit is controlled according to the voltage correction amount of each power generation unit.

[0061] Specifically, the second hidden state feature is a deep feature representation of the global state of the microgrid (integrating measurement data from each unit, topological relationships, and attack compensation information). Through a fully connected mapping layer or linear output layer, the feature component corresponding to each generator unit in the state vector is decoded into a scalar value, which is the voltage correction amount required by the unit. Subsequently, this correction amount is superimposed on the voltage reference value of the local controller of the generator unit, and the output of its inverter or voltage regulator is adjusted in real time. Thus, even in the event of communication attacks or data anomalies, the units can still dynamically coordinate to maintain the voltage stability and power balance of the microgrid, realizing endogenous resilient voltage regulation based on deep state perception and dynamic compensation.

[0062] The overall control law is expressed as:

[0063] ;

[0064] in, This represents the control voltage of the i-th DG; Indicates the preset voltage reference value; Indicates the fusion coefficient; Indicates the voltage correction factor; This represents the voltage correction amount for the i-th DG; Indicates the first i The droop coefficient of each DG; This represents the output current of the i-th DG.

[0065] Thus, this application achieves autonomous detection, isolation, and recovery from communication attacks through precise mapping of IGCC to the three-layer immune defense and topological adaptation of graph convolutional networks. It can effectively address the challenges of malicious attacks on the communication layer and disruption of the cooperation mechanism, realize the deep integration and autonomous evolutionary defense of biological immune defense mechanisms and graph neural networks, improve the adaptability and stability of microgrid control systems in complex attack environments, and effectively solve the problems of slow response and lack of self-organization in traditional defense methods.

[0066] In some embodiments, based on the topology model and the measurement data of each power generation unit, a comprehensive antigenic index for each power generation unit is calculated, including: based on the topology model and the measurement data of each power generation unit, calculating the temporal anomaly measure and the spatial anomaly measure for each power generation unit; and based on the temporal anomaly measure and the spatial anomaly measure, calculating the comprehensive antigenic index for each power generation unit.

[0067] Specifically, the measurement data for each power generation unit may include the current voltage measurement value. First, based on the topology model, the adjacent power generation units of each power generation unit are determined, and then based on the data of each power generation unit... Its adjacent power generation unit The difference between the means was used to determine the time-dimensional anomaly index for each power generation unit; then, all power generation units were identified based on the topology graph model, and each power generation unit was analyzed separately based on its mean. With all power generation units The spatial dimension anomaly index of each power generation unit is determined by the difference between the mean values. Finally, the comprehensive antigen index of each power generation unit is calculated by weighted summation of the temporal dimension anomaly index and the corresponding spatial dimension anomaly index.

[0068] In some embodiments, based on the topology model and the measurement data of each power generation unit, the temporal anomaly metric and spatial anomaly metric of each power generation unit are calculated, including: determining the set of neighboring power generation units for each power generation unit based on the topology model; calculating the temporal anomaly metric of each power generation unit based on the current voltage measurement value of each power generation unit and the average voltage of the set of neighboring power generation units at the previous sampling time; and calculating the spatial anomaly metric of each power generation unit based on the current voltage measurement value of each power generation unit and the average current voltage of all power generation units.

[0069] For example, the time anomaly metric of a power generation unit can be calculated using the following formula:

[0070] ;

[0071] in, Indicates the first i Time anomaly measurement for each DG; Indicates the first i The current voltage measurement value of each DG; This represents the voltage time prediction value of the i-th DG, which is the average voltage of the set of adjacent generating units of the i-th DG at the previous sampling time.

[0072] The spatial anomaly metric of the power generation unit can be calculated using the following formula:

[0073] ;

[0074] ;

[0075] in, Indicates the first i Spatial anomaly measurement of a DG; Indicates the first i The current voltage measurement value of each DG; This represents the average current voltage of all power generation units; N represents the number of power generation units.

[0076] This application, by drawing inspiration from the recognition mechanisms of the biological immune system, analogizes anomalies in the state of power generation units caused by external attacks as antigens. Based on a topological graph model, it constructs anomaly indicators from both temporal and spatial dimensions, achieving deep perception and precise quantification of the operational status of power generation units. By integrating temporal and spatial anomaly measurements into a comprehensive antigen indicator, it effectively enhances the early identification capability of potential attacks or faults, significantly reducing the risk of false alarms and missed alarms caused by single-dimensional judgment. This process simulates the mechanism by which pattern recognition receptors in organisms trigger immune responses by recognizing pathogen-related molecular patterns, constructing a proactive, precise, and robust security perception defense for the power generation unit communication network, ensuring that the system maintains high reliability and stability even in complex environments.

[0077] In some embodiments, attack compensation is performed on the first layer hidden state features based on the abnormal power generation unit and the corresponding attack type to obtain the compensated first layer hidden state features, including: in response to the attack type being a false data injection attack, an adaptive threshold filtering algorithm is used to filter the measurement data features of the abnormal power generation unit in the first layer hidden state features to obtain the compensated first layer hidden state features.

[0078] Specifically, the first-layer hidden state features can be input into the following formula to filter the measurement data features of the abnormal power generation units in the first-layer hidden state features, thereby obtaining the compensated first-layer hidden state features:

[0079] ;

[0080] in, This indicates the FDI attack detection flag for the i-th DG node; This represents the first hidden state feature output by the first convolutional layer of the first graph; This indicates the preset FDI feature amplitude threshold; This represents the features of the first hidden state after compensation; This represents the mean of the DG node features.

[0081] In response to the attack type being denial-of-service attack, the neighboring power generation units of the abnormal power generation unit are determined based on the topology graph model. The measurement data features of the neighboring power generation units and the abnormal measurement data features of the abnormal power generation unit are determined based on the first-layer hidden state features. The measurement data features of the neighboring power generation units and the abnormal measurement data features of the abnormal power generation unit are fused to obtain the target measurement data features of the abnormal power generation unit. The first-layer hidden state features are then compensated using the target measurement data features to obtain the compensated first-layer hidden state features.

[0082] Specifically, DoS attacks disrupt communication links, leading to information isolation between nodes, manifested as an abnormally low correlation between a node's and its neighbors' characteristics. A link health metric is defined to quantify the consistency of characteristics between nodes and their neighbors.

[0083] ;

[0084] in, d represents the link health index of the i-th DG node; d represents the number of feature dimensions of the hidden state. Let represent the set of one-hop neighbors of the i-th DG node; j represents the index of the one-hop neighbor node. This represents the original hidden state feature of the first layer of the k-th dimension of the i-th DG node (the first layer hidden state feature without attack compensation). Let represent the original hidden state feature of the first layer in the k-th dimension of neighbor node j.

[0085] For detected DoS nodes, a two-hop neighbor reconstruction strategy is used to recover missing information. Traditional consensus protocols only utilize one-hop neighbors, resulting in information loss when direct neighbors are attacked and blocked. This application employs a two-hop mechanism, bypassing the blocked link through indirect neighbors, thereby constructing a redundant information path.

[0086] Specifically, the first-layer hidden state features can be input into the following formula to fuse the measurement data features of adjacent power generation units with the abnormal measurement data features of abnormal power generation units, thereby obtaining the target measurement data features of the abnormal power generation units. The first-layer hidden state features are then compensated using the target measurement data features to obtain the compensated first-layer hidden state features:

[0087] ;

[0088] in, This represents the first layer of hidden state features of the k-th dimension of the i-th DG node after DoS attack compensation; Let m represent the set of two-hop neighbors of the i-th DG node; m represents the index of the two-hop neighbor node. Indicates two-hop neighbor nodes l The original hidden state features of the first layer in the k-th dimension; l This represents the neighbor index of node j; express l It is a neighbor of m, but not i itself; This indicates the DoS attack detection flag for the i-th node; Let represent the original hidden state feature of the first layer in the k-th dimension of the i-th DG node.

[0089] Secondly, define DOS antibody strength to quantify the degree of immune system response to DOS attacks:

[0090] ;

[0091] in, This represents the DoS antibody strength of the i-th DG node; This represents the link health metric of the i-th DG node; This indicates the DoS attack detection flag for the i-th node; This indicates the threshold for detecting DoS attacks.

[0092] Finally, the antibody strength was determined. The weight matrix of the second graph convolutional layer is used to adaptively adjust the weight matrix to enhance the system's resistance to composite attacks.

[0093] ;

[0094] in, This represents the total antibody intensity of the i-th DG node; This represents the latency attack detection flag for the i-th DG node; This indicates the FDI attack detection flag for the i-th DG node; This represents the DoS antibody strength of the i-th DG node; This represents the weight values ​​in the k-th row of the weight matrix of the convolutional layer in the second graph; This represents the basic weight values ​​in the k-th row of the weight matrix of the convolutional layer in the second graph; The gain coefficient representing the weight adjustment; This represents the total number of DG nodes in the microgrid; Indicates an indicator function, when k = l When it is 1, k Represents the row index of the weight matrix, l Represents the column index of the weight matrix.

[0095] In response to the attack type of time delay attack, based on the measurement data characteristics of adjacent power generation units, the measurement data characteristics of the abnormal power generation unit at the current time are estimated by Kalman filter, and the measurement data characteristic estimation is used to compensate the first layer of hidden state characteristics to obtain the compensated first layer of hidden state characteristics.

[0096] Specifically, the first-layer hidden state features can be input into the following formula to estimate the measurement data features of the abnormal power generation unit at the current time based on the measurement data features of adjacent power generation units, using a Kalman filter. The estimated measurement data features are then used to compensate for the first-layer hidden state features to obtain the compensated first-layer hidden state features:

[0097] ;

[0098] in, This represents the feature estimate of the i-th DG node in the k-th dimension; This represents the original hidden state feature of the i-th DG node in the first layer of the k-th dimension; Let represent the set of one-hop neighbors of the i-th DG node; j represents the index of the one-hop neighbor node. This represents the features of the first hidden state after compensation; Indicates the compensation gain coefficient; This represents the latency attack detection flag for the i-th DG node; Var(k) represents the global variance of the k-th feature. Indicates the threshold for detecting latency attacks; Indicates the number of DGs; Let represent the global mean of the feature of the i-th node in the k-th dimension.

[0099] In some embodiments, before performing attack compensation on the first-layer hidden state features based on the attack type of the abnormal power generation unit, the method further includes: constructing a Lyapunov energy function and determining an energy limit rule based on the Lyapunov energy function; calculating the norm of the first-layer hidden state features, and performing projection scaling on the first-layer hidden state features if the norm is greater than the energy limit rule.

[0100] Specifically, to ensure that the output of the first layer does not compromise system stability, a Lyapunov energy constraint is introduced. The Lyapunov energy function is defined as follows:

[0101] ;

[0102] in, Represents the total Lyapunov energy function; Represents the consensus energy term; Indicates the energy coefficient; Represents the immune energy term; N represents the total number of DG nodes in the microgrid; This represents the current voltage measurement value of the i-th DG; This represents the global average voltage across all DG nodes; This represents the current output current measurement value of the i-th DG; This represents the global average current across all DG nodes; This represents the square of the immune activation value of the i-th DG; This represents the square of the immune memory value of the i-th DG.

[0103] definition h ij The elements of the graph convolutional hidden state feature matrix H, γ sHere, λmax is the stability constraint coefficient, and λmax is the largest eigenvalue of the graph Laplacian matrix. The norm of the first-layer hidden state features is then calculated. , Let i and j represent the features of the first hidden state, where i and j are the row and column indices in the feature matrix, respectively. If the energy limit is exceeded, then (Lyapunov bound) is applied. Then, the norm of the first-layer hidden state features is used to perform projection scaling on the first-layer hidden state features. Specifically, This ensures that the neural network output is always within the energy limit; if it does not exceed the energy limit (Lyapunov limit), then no projection scaling is required.

[0104] In some embodiments, before mapping the second-layer hidden state features to the voltage correction amount of each power generation unit, the method further includes: determining the adjacency matrix and degree matrix according to the topological graph model; calculating the graph Laplacian matrix based on the adjacency matrix and degree matrix; determining the consistency convergence boundary based on the spectral characteristics of the graph Laplacian matrix; and scaling the second-layer hidden state features if the consistency error of the second-layer hidden state features exceeds the consistency convergence boundary.

[0105] Specifically, based on the microgrid communication topology model, the first step is to construct an adjacency matrix describing node connections and a degree matrix reflecting the number of node connections. The adjacency matrix is ​​an N×N square matrix where each element represents the communication connection status between nodes: if a direct communication link exists between two nodes, the element is 1 (or assigned a corresponding weight value); otherwise, the element is 0. Typically, it is stipulated that a node does not have self-loops, i.e., the diagonal elements are 0. Based on this, the degree matrix is ​​defined as a diagonal matrix, where the diagonal elements d... ii It equals the sum of all elements in the i-th row of the adjacency matrix, representing the number of neighboring nodes directly connected to node i, reflecting the connectivity of that node in the communication network.

[0106] Based on the constructed adjacency matrix A and degree matrix D, the graph Laplacian matrix L can be further calculated, defined as L=DA. The Laplacian matrix is ​​a core tool in graph theory, integrating the connectivity structure and degree information of a graph. Its off-diagonal elements represent negative connections between nodes, while the diagonal elements reflect the degree of the nodes. For undirected graphs, the Laplacian matrix possesses symmetry and positive semidefiniteness, a mathematical property that makes it a crucial foundation for analyzing the dynamic characteristics of graph structures.

[0107] Furthermore, the spectral properties of the graph Laplace matrix can be used to determine the uniform convergence boundary of the microgrid system. The eigenvalues ​​of the Laplace matrix, arranged in ascending order, are as follows: The smallest eigenvalue The direction corresponding to where all eigenvectors are constant reflects the fundamental condition under which the network can reach consensus. The second smallest eigenvalue... Known as algebraic connectivity, it is a key indicator for measuring the connectivity of a graph: it is true if and only if the graph is connected. ,and The larger the value of algebraic connectivity, the stronger the network connectivity and the higher the efficiency of information propagation on the graph. In distributed consensus algorithms, algebraic connectivity... It directly determines the convergence rate of the system state; theoretically, the decay rate of the state deviation is related to... Proportional, that is The larger the value, the faster the nodes achieve voltage synchronization and power balance. Simultaneously, the maximum eigenvalue... It defines the upper bound of the system's energy, which affects the system's stability margin.

[0108] Based on these spectral properties, a theoretical boundary for consistent convergence can be established: the necessary and sufficient condition for achieving asymptotic consistency is that the communication topology graph is connected (i.e., In the event of a communication attack leading to topology reconfiguration, it is necessary to ensure that the reconfigured graph still satisfies the following conditions: This ensures that the consensus protocol can still converge; furthermore, the upper bound of the convergence error can be determined jointly by the eigenvalue distribution and the attack disturbance boundary. This theoretical boundary provides a mathematical basis for the immune reconstruction of microgrids under communication attacks. By dynamically adjusting the adjacency matrix to maintain sufficient algebraic connectivity, the system can isolate abnormal nodes while ensuring that the remaining nodes can still achieve consensus convergence, thereby realizing endogenous resilience control under attack environments.

[0109] Based on the graph Laplace spectrum theory, when the consistency error Ec does not exceed the consistency convergence boundary, there is no need to modify the second-layer hidden state features H. (2) Scaling is performed, and when the consistency error Ec exceeds the consistency convergence boundary, the second-layer hidden state features H need to be scaled. (2) Scaling:

[0110] ;

[0111] in, This represents the hidden state feature matrix of the convolutional layer in the second graph; This represents the second eigenvalue of the graph Laplacian matrix; Indicates the attenuation coefficient; Indicates consistency error; This represents a preset value to prevent the denominator from being zero. This represents the feature element of the i-th node in the k-th dimension of the second-layer hidden state feature matrix; Let N represent the global mean of the k-th dimension feature of the i-th node; N represents the total number of DG nodes in the microgrid.

[0112] In some embodiments, mapping the second-layer hidden state features to the voltage correction amount of each power generation unit includes: mapping the second-layer hidden state features to the first voltage correction amount of each power generation unit through a linear transformation layer; constructing a stability region of multi-scale Lyapunov constraints, and projecting the first voltage correction amount exceeding the Lyapunov energy function based on the stability region of multi-scale Lyapunov constraints to obtain the second voltage correction amount of each power generation unit; performing regularization processing on the second voltage correction amount, and injecting a preset damping coefficient into the regularized second voltage correction amount based on an immune damping mechanism to obtain the voltage correction amount of each power generation unit.

[0113] Specifically, the output layer maps the features of the second hidden state to the first voltage correction value:

[0114] ;

[0115] in, Indicates the first voltage correction amount; This represents the hidden state features of the convolutional layer in the second graph; This represents the output weight matrix.

[0116] Furthermore, construct multi-scale Lyapunov constraints:

[0117] ;

[0118] in, Represents the multi-scale Lyapunov stability region; Indicates the gain value; Indicates the upper limit of the amplitude; This represents the convergence rate parameter; This represents the second eigenvalue of the graph Laplacian matrix; This represents the largest eigenvalue of the graph Laplacian matrix.

[0119] like , Let the total Lyapunov energy function be denoted by the projection. This yields the second voltage correction for each power generation unit, ensuring that the energy output by the control is always within the Lyapunov energy function.

[0120] Secondly, the second voltage correction amount needs to be regularized to remove the common-mode component of the correction amount and avoid introducing a global voltage bias, thereby improving the output norm.

[0121] ;

[0122] in, This represents the norm of the second voltage correction for the i-th DG node after normalization. This represents the first voltage correction value for the i-th DG node; This represents the first voltage correction value for the j-th DG node; N represents the total number of DG nodes in the microgrid. This represents the voltage correction norm after removing the common-mode component; Represents the consensus constraint coefficient; This represents the second eigenvalue of the graph Laplacian matrix.

[0123] Finally, an immune damping mechanism is applied to retain some common-mode components to maintain the global voltage level, thereby obtaining the voltage correction value output by the graph neural network:

[0124] ;

[0125] in, This represents the final effective voltage correction value of the i-th DG node after immune damping adjustment. Indicates the modifier after immune damping adjustment; This represents the normalized second voltage correction value for the i-th DG node, where, using right Perform normalization; Indicates the preset damping coefficient; This represents the global common-mode component of the voltage correction.

[0126] As a concrete example, the intrinsic resilience control system of a microgrid, such as Figure 4 As shown, the physical layer contains four distributed generation units (DG1 to DG4), which are connected through a common bus and each supply power to the local load, forming the physical topology of the microgrid. The control layer (IGCC) receives state feedback from the physical layer, processes it through three layers of innate immunity, acquired immunity, and immune memory output, and generates control signals to be sent back to the physical layer.

[0127] The microgrid intrinsic resilience control method in this application embodiment may include the following steps:

[0128] First, a topological graph model of the communication network is constructed based on four nodes and their connecting lines, serving as the foundation for graph convolution computation. Second, in the innate immunity module, temporal and spatial anomaly metrics for each power generation unit are calculated through spatiotemporal anomaly detection. These metrics are then fused to form a comprehensive antigen index for identifying anomalous power generation units. Subsequently, the first-layer graph convolution, combined with dynamic topology reconstruction and an immune activation function, generates the first-layer hidden state features. Features exceeding the energy limit are then projected and scaled using Lyapunov energy constraints to output the immune-regulated hidden state.

[0129] In the acquired immunity module, specific compensation is performed based on the identified attack type. Specifically, for latency attacks, a Kalman filter is used to estimate the features of the measurement data at the current moment; for spoofing attacks, an adaptive threshold filtering algorithm is used; and for denial-of-service attacks, features from adjacent units and anomalous units are fused through path reconstruction. The compensated features are input into the second-layer graph convolution to generate the second-layer hidden state features. These features are then scaled based on the consistency convergence boundary determined by the spectral properties of the graph Laplacian matrix, and the feature-compensated hidden state is output.

[0130] Finally, in the output layer, the second-layer hidden state is subjected to multi-scale projection (mapping features into voltage correction values), centering regularization (removing common-mode components to avoid global bias), and immune damping processing (injecting preset damping coefficients to maintain global voltage levels) through an immune memory mechanism to generate the final voltage correction value and apply it to each power generation unit to achieve closed-loop control.

[0131] Thus, through this complete three-layer immune defense architecture, this application effectively solves the problems of slow response and lack of self-organization in traditional defense methods, and realizes the endogenous resilience control of microgrids in complex communication attack environments.

[0132] Corresponding to the above embodiments, this application also proposes a microgrid endogenous resilience control device.

[0133] Reference Figure 5 The microgrid endogenous resilience control device 200 includes: a construction module 210, a calculation module 220, a determination module 230, a first generation module 240, a compensation module 250, a second generation module 260, a mapping module 270, and a control module 280.

[0134] The system comprises the following modules: a construction module 210 constructs a topology model of a communication network among multiple power generation units; a calculation module 220 calculates the comprehensive antigen index of each power generation unit based on the topology model and measurement data of each unit; a determination module 230 identifies the abnormal power generation units affected by the attack and the corresponding attack type when the comprehensive antigen index deviates from a preset range, wherein multiple power generation units include the abnormal power generation units; a first generation module 240 inputs the measurement data of each power generation unit into a first graph convolutional layer to perform convolution operations to generate a first layer of hidden state features; a compensation module 250 performs attack compensation on the first layer of hidden state features based on the abnormal power generation units and the corresponding attack type to obtain compensated first layer of hidden state features; a second generation module 260 inputs the compensated first layer of hidden state features into a second graph convolutional layer to perform convolution operations to generate a second layer of hidden state features; a mapping module 270 maps the second layer of hidden state features to the voltage correction amount of each power generation unit; and a control module 280 controls the corresponding power generation unit according to the voltage correction amount of each unit.

[0135] According to one embodiment of this application, the calculation module 220 is specifically used to calculate the temporal anomaly metric and spatial anomaly metric of each power generation unit based on the topology graph model and the measurement data of each power generation unit; and to calculate the comprehensive antigen index of each power generation unit based on the temporal anomaly metric and spatial anomaly metric.

[0136] According to one embodiment of this application, the calculation module 220 is specifically used to: determine the set of adjacent power generation units for each power generation unit based on the topology graph model; calculate the time anomaly metric of each power generation unit based on the current voltage measurement value of each power generation unit and the average voltage of the set of adjacent power generation units at the previous sampling time; and calculate the spatial anomaly metric of each power generation unit based on the current voltage measurement value of each power generation unit and the average current voltage of all power generation units.

[0137] According to one embodiment of this application, the compensation module 250 is specifically configured to: respond to an attack type of false data injection attack, use an adaptive threshold filtering algorithm to filter the measurement data features of the abnormal power generation unit in the first layer hidden state features to obtain the compensated first layer hidden state features; respond to an attack type of denial-of-service attack, determine the neighboring power generation units of the abnormal power generation unit based on the topology graph model, and determine the measurement data features of the neighboring power generation units and the abnormal measurement data features of the abnormal power generation unit based on the first layer hidden state features, fuse the measurement data features of the neighboring power generation units and the abnormal measurement data features of the abnormal power generation unit to obtain the target measurement data features of the abnormal power generation unit, and use the target measurement data features to compensate the first layer hidden state features to obtain the compensated first layer hidden state features; respond to an attack type of delay attack, estimate the measurement data features of the abnormal power generation unit at the current time using a Kalman filter based on the measurement data features of the neighboring power generation units, and use the estimated measurement data features to compensate the first layer hidden state features to obtain the compensated first layer hidden state features.

[0138] According to one embodiment of this application, before performing attack compensation on the first layer hidden state features based on the attack type of the abnormal power generation unit, a Lyapunov energy function is constructed, and an energy limit rule is determined based on the Lyapunov energy function; the norm of the first layer hidden state features is calculated, and if the norm is greater than the energy limit rule, the first layer hidden state features are subjected to projection scaling processing.

[0139] According to one embodiment of this application, before mapping the second-layer hidden state features to the voltage correction amount of each power generation unit, the adjacency matrix and degree matrix are determined according to the topological graph model; based on the adjacency matrix and degree matrix, the graph Laplace matrix is ​​calculated; based on the spectral characteristics of the graph Laplace matrix, the consistency convergence boundary is determined, and if the consistency error of the second-layer hidden state features exceeds the consistency convergence boundary, the second-layer hidden state features are scaled.

[0140] According to one embodiment of this application, the mapping module 270 is specifically used to: map the second-layer hidden state features to the first voltage correction amount of each power generation unit through a linear transformation layer; construct a stability domain of multi-scale Lyapunov constraints, and project the first voltage correction amount exceeding the Lyapunov energy function based on the stability domain of multi-scale Lyapunov constraints to obtain the second voltage correction amount of each power generation unit; perform regularization processing on the second voltage correction amount, and inject a preset damping coefficient into the regularized second voltage correction amount based on an immune damping mechanism to obtain the voltage correction amount of each power generation unit.

[0141] It should be noted that the above explanation of the embodiments and beneficial effects of the microgrid endogenous resilience control method also applies to the microgrid endogenous resilience control device of the embodiments of this application. To avoid redundancy, it will not be elaborated in detail here.

[0142] Corresponding to the above embodiments, this application also proposes a computer-readable storage medium.

[0143] The computer-readable storage medium of this application stores a microgrid endogenous resilience control program thereon, which, when executed by a processor, implements the aforementioned microgrid endogenous resilience control method.

[0144] It should be noted that the above explanation of the embodiments and beneficial effects of the microgrid endogenous resilience control method also applies to the computer-readable storage medium of the embodiments of this application. To avoid redundancy, it will not be elaborated in detail here.

[0145] Corresponding to the above embodiments, this application also proposes an electronic device.

[0146] See Figure 6 As shown, the electronic device 300 of this application includes a memory 310, a processor 320, and a microgrid endogenous resilience control program stored in the memory 310 and capable of running on the processor 320. When the processor executes the microgrid endogenous resilience control program, it implements the aforementioned microgrid endogenous resilience control method.

[0147] It should be noted that the above explanation of the embodiments and beneficial effects of the microgrid endogenous resilience control method also applies to the electronic devices in the embodiments of this application. To avoid redundancy, they will not be elaborated in detail here.

[0148] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0149] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0150] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0151] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0152] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "joining," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise expressly limited. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0153] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A method for in-microgrid resilience control, characterized in that, include: Construct a topology model of the communication network between multiple power generation units; Based on the topology model and the measurement data of each power generation unit, the comprehensive antigen index of each power generation unit is calculated. In the event that the comprehensive antigen index deviates from the preset comprehensive antigen index range, the abnormal power generation unit affected by the attack and the corresponding attack type are determined, wherein the multiple power generation units include the abnormal power generation unit. The measurement data of each power generation unit is input into the first graph convolutional layer to perform convolution operations to generate the first layer of hidden state features; Based on the abnormal power generation unit and the corresponding attack type, the first layer of hidden state features are attacked and compensated to obtain the compensated first layer of hidden state features. The compensated first layer of hidden state features are then input into the second graph convolutional layer to perform convolution operations to generate the second layer of hidden state features. The second layer hidden state features are mapped to the voltage correction amount of each of the power generation units, and the corresponding power generation units are controlled according to the voltage correction amount of each of the power generation units. The step of calculating the comprehensive antigen index for each power generation unit based on the topology model and the measurement data of each power generation unit includes: Based on the topology model and the measurement data of each power generation unit, the time anomaly metric and spatial anomaly metric of each power generation unit are calculated. Based on the time anomaly metric and the spatial anomaly metric, a comprehensive antigen index for each power generation unit is calculated.

2. The method for in-microgrid endogenous resilience control according to claim 1, characterized in that, The calculation of temporal and spatial anomaly metrics for each power generation unit based on the topology model and measurement data of each power generation unit includes: The set of adjacent power generation units for each power generation unit is determined based on the topology graph model; Based on the current voltage measurement of each power generation unit and the average voltage of the adjacent power generation unit set at the previous sampling time, the time anomaly metric of each power generation unit is calculated. The spatial anomaly metric for each power generation unit is calculated based on the current voltage measurement of each power generation unit and the average current voltage of all power generation units.

3. The microgrid endogenous resilience control method according to claim 1, characterized in that, The attack compensation process for the first layer of hidden state features based on the abnormal power generation unit and the corresponding attack type, to obtain the compensated first layer of hidden state features, includes: In response to the attack type being a false data injection attack, an adaptive threshold filtering algorithm is used to filter the measurement data features of the abnormal power generation unit in the first layer of hidden state features to obtain the compensated first layer of hidden state features. In response to the attack type being a denial-of-service attack, the neighboring power generation units of the abnormal power generation unit are determined based on the topology graph model, and the measurement data features of the neighboring power generation units and the abnormal measurement data features of the abnormal power generation unit are determined based on the first layer hidden state features. The measurement data features of the neighboring power generation units and the abnormal measurement data features of the abnormal power generation unit are fused to obtain the target measurement data features of the abnormal power generation unit. The first layer hidden state features are then compensated using the target measurement data features to obtain the compensated first layer hidden state features. In response to the attack type being a time delay attack, based on the measurement data characteristics of the adjacent power generation units, the measurement data characteristics of the abnormal power generation unit at the current moment are estimated using a Kalman filter, and the first layer of hidden state characteristics are compensated using the estimated measurement data characteristics to obtain the compensated first layer of hidden state characteristics.

4. The microgrid endogenous resilience control method according to claim 1, characterized in that, Before performing attack compensation on the first layer of hidden state features based on the attack type of the abnormal power generation unit, the method further includes: Construct the Lyapunov energy function, and determine the energy limit based on the Lyapunov energy function; Calculate the norm of the first layer hidden state features. If the norm is greater than the energy limit, perform projection scaling on the first layer hidden state features.

5. The microgrid endogenous resilience control method according to claim 1, characterized in that, Before mapping the second-layer hidden state features to the voltage correction amount of each of the power generation units, the method further includes: The adjacency matrix and degree matrix are determined based on the aforementioned topological graph model; Calculate the graph Laplacian matrix based on the adjacency matrix and the degree matrix; Based on the spectral properties of the graph Laplacian matrix, a consistency convergence boundary is determined, and if the consistency error of the second-layer hidden state features exceeds the consistency convergence boundary, the second-layer hidden state features are scaled.

6. The microgrid endogenous resilience control method according to claim 1, characterized in that, The step of mapping the second-layer hidden state features to the voltage correction amount of each of the power generation units includes: The second layer of hidden state features is mapped to the first voltage correction amount of each of the power generation units through a linear transformation layer; A stability region of multi-scale Lyapunov constraints is constructed, and a first voltage correction amount exceeding the Lyapunov energy function is projected based on the stability region of the multi-scale Lyapunov constraints to obtain a second voltage correction amount for each power generation unit. The second voltage correction amount is regularized, and based on the immune damping mechanism, a preset damping coefficient is injected into the regularized second voltage correction amount to obtain the voltage correction amount of each power generation unit.

7. A microgrid intrinsic resilience control device, characterized in that, include: The building module is used to construct a topology model of the communication network between multiple power generation units; The calculation module is used to calculate the comprehensive antigen index of each power generation unit based on the topology model and the measurement data of each power generation unit. The calculation of the comprehensive antigen index of each power generation unit based on the topology model and the measurement data of each power generation unit includes: calculating the temporal anomaly measure and the spatial anomaly measure of each power generation unit based on the topology model and the measurement data of each power generation unit; and calculating the comprehensive antigen index of each power generation unit based on the temporal anomaly measure and the spatial anomaly measure. The determination module is used to determine the abnormal power generation unit affected by the attack and the corresponding attack type when the comprehensive antigen index deviates from the preset comprehensive antigen index range, wherein the multiple power generation units include the abnormal power generation unit. The first generation module is used to input the measurement data of each power generation unit into the first graph convolutional layer to perform convolution operations in order to generate the first layer of hidden state features; The compensation module is used to perform attack compensation on the first layer of hidden state features based on the abnormal power generation unit and the corresponding attack type, so as to obtain the compensated first layer of hidden state features. The second generation module is used to input the compensated first-layer hidden state features into the second graph convolutional layer to perform convolution operations, so as to generate the second-layer hidden state features. A mapping module is used to map the second-layer hidden state features to the voltage correction amount of each of the power generation units; The control module is used to control the corresponding power generation unit according to the voltage correction amount of each power generation unit.

8. A computer-readable storage medium, characterized in that, It stores a microgrid endogenous resilience control program, which, when executed by a processor, implements the microgrid endogenous resilience control method according to any one of claims 1-6.

9. An electronic device, characterized in that, The system includes a memory, a processor, and a microgrid endogenous resilience control program stored in the memory and capable of running on the processor. When the processor executes the microgrid endogenous resilience control program, it implements the microgrid endogenous resilience control method according to any one of claims 1-6.