A power system security domain boundary sample enhancement method based on transfer learning

By generating and validating security domain boundary samples under Nk fault scenarios in power systems using a transfer learning-based method, the problem of computational bottleneck and false samples is solved, enabling fast and reliable prediction of security domain boundary features and meeting the real-time security early warning requirements of the power grid.

CN123159458APending Publication Date: 2026-11-24GUANGXI POWER GRID CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610729904.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-26
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing technologies face challenges in assessing Nk fault scenarios in power systems, including computational exhaustion and poor generalization ability of purely data-driven models. Furthermore, the generated fake samples violate physical constraints, making it difficult to meet the timeliness requirements for real-time power grid security early warning.

Method used

A transfer learning-based approach is adopted. By acquiring target graph structure data, a pre-set transfer learning model is used to learn the mapping relationship between source fault states and safety domain boundary features, generating safety domain boundary candidate samples. The validity is then verified by combining physical operation constraint rules, and an enhanced boundary sample set is output.

Benefits of technology

It enables rapid prediction of the boundary characteristics of the target safety domain, follows the law of conservation of power grid energy, improves the generation efficiency and physical reliability of the boundary sample set, and provides reliable data support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123159458A_ABST
    Figure CN123159458A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on the security domain boundary sample enhancement method of transfer learning, including obtaining target graph structure data under target fault scene;The target graph structure data is input to preset transfer learning model, and the predicted target security domain boundary feature is output, wherein the preset transfer learning model is used to learn the mapping relationship between source fault state and security domain boundary feature;Security domain boundary candidate sample is generated based on the predicted target security domain boundary feature;Boundary validity check is carried out on the security domain boundary candidate sample based on preset physical operation constraint rule;In response to the security domain boundary candidate sample passes through the boundary validity check, output enhanced boundary sample set.Break through the power exhaustion bottleneck that traditional physical analysis method faces when evaluating massive N-k complex fault, can realize the rapid prediction of target security domain boundary feature.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of power system security, and in particular to a method for enhancing security domain boundary samples based on transfer learning. Background Technology

[0002] With the construction of new power systems and the widespread integration of high-proportion renewable energy sources and complex power electronic equipment, the power grid topology and operational boundaries are becoming increasingly complex and highly nonlinear. In actual operation, power systems inevitably face Nk faults where multiple components simultaneously fail, leading to drastic power flow shifts and even large-scale blackouts. Therefore, safety domain boundary assessment for Nk fault scenarios has become the core of power grid resilience analysis. Safety domain boundary samples are crucial data support for guiding the safe operation of the system. However, in Nk fault scenarios, the number of fault combinations increases exponentially with system size, easily leading to combination explosion. If traditional point-by-point simulation or complete analytical search methods are used to obtain massive critical boundary samples for Nk scenarios, the computation is time-consuming and faces severe computing power bottlenecks, making it difficult to meet the timeliness requirements of real-time or near-real-time online safety early warning for the power grid.

[0003] To overcome the computational limitations of traditional physical simulations, some solutions have attempted to introduce purely data-driven artificial intelligence algorithms to rapidly generate boundary samples. However, existing intelligent augmentation methods still have technical shortcomings. On the one hand, existing algorithms typically treat each fault scenario as an independent task for isolated training, failing to effectively mine and reuse the topological connections and power flow similarities between different fault scenarios. This results in weak model generalization ability and unnecessary computational redundancy. On the other hand, the simple data generation process lacks deep integration and strict constraints on the objective physical mechanisms of the power system. It is prone to generating false failure samples that are reasonable in pure mathematical space but completely violate the law of conservation of energy and physical extreme value constraints. This leads to low reliability of the final output boundary dataset, making it difficult to directly apply to industrial-grade online scheduling and control. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides a security domain boundary sample enhancement method based on transfer learning to solve the problems of computational exhaustion bottleneck faced by traditional physical analysis methods when evaluating massive complex faults, and the poor generalization ability and easy generation of false failure samples that violate physical constraints in existing pure AI data-driven models.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: Obtain target graph structure data under the target fault scenario; input the target graph structure data into a preset transfer learning model, and output predicted target security domain boundary features, wherein the preset transfer learning model is used to learn the mapping relationship between the source fault state and the security domain boundary features; generate security domain boundary candidate samples based on the predicted target security domain boundary features; perform boundary validity verification on the security domain boundary candidate samples based on preset physical operation constraint rules; in response to the security domain boundary candidate samples passing the boundary validity verification, output an enhanced boundary sample set.

[0007] As a preferred embodiment of the security domain boundary sample enhancement method based on transfer learning described in this invention, the training steps of the preset transfer learning model include: acquiring source graph structure data of the source fault scenario and the corresponding true values ​​of source security domain boundary features; combining the source graph structure data and the true values ​​of source security domain boundary features to construct a training sample sequence; constructing an initial graph attention network model; inputting the training sample sequence into the initial graph attention network model to obtain predicted source security domain boundary features; calculating the model evaluation error based on the predicted source security domain boundary features and the true values ​​of source security domain boundary features; updating the initial graph attention network model based on the model evaluation error to obtain the preset transfer learning model.

[0008] As a preferred embodiment of the security domain boundary sample enhancement method based on transfer learning described in this invention, the step of obtaining the source graph structure data of the source fault scenario and the corresponding true value of the source security domain boundary features includes: obtaining power flow operation data of the source fault scenario in normal and fault states; performing power flow sensitivity calculation and line thermal stability constraint calculation based on the power flow operation data to obtain the true source boundary normal vector and the true source boundary intercept of the source security domain boundary; and combining the true source boundary normal vector and the true source boundary intercept to obtain the true value of the source security domain boundary features.

[0009] As a preferred embodiment of the secure domain boundary sample augmentation method based on transfer learning described in this invention, the predicted source secure domain boundary features include the predicted source boundary normal vector and the predicted source boundary intercept; the calculation of the model evaluation error based on the predicted source secure domain boundary features and the true values ​​of the source secure domain boundary features includes: calculating the L2 norm squared difference between the predicted source boundary normal vector and the true source boundary normal vector; calculating the squared difference between the predicted source boundary intercept and the true source boundary intercept, and multiplying the squared difference by a preset weight coefficient for the boundary intercept error term; adding the L2 norm squared difference to the squared difference multiplied by the weight coefficient and summing the results to obtain the model training loss function as the model evaluation error.

[0010] As a preferred embodiment of the security domain boundary sample enhancement method based on transfer learning described in this invention, the target security domain boundary features include the predicted target boundary normal vector and the predicted target boundary intercept. The step of inputting the target graph structure data into a preset transfer learning model and outputting the predicted target security domain boundary features includes: determining the node adjacency set of each node in the target graph structure data based on the topological connection matrix in the target graph structure data; embedding the adjacency node features in the node adjacency set, multiplying the attention weights corresponding to the adjacency nodes with a trainable weight matrix, and summing the results; processing the summation result using a nonlinear activation function to obtain updated node features; aggregating the node features into overall features of the entire power grid fault scenario through multi-layer graph attention propagation and graph pooling operations to obtain a fault scenario graph embedding; and using the boundary feature prediction layer in the transfer learning model to output the predicted target boundary normal vector and the predicted target boundary intercept based on the fault scenario graph embedding.

[0011] As a preferred embodiment of the security domain boundary sample enhancement method based on transfer learning described in this invention, the step of generating security domain boundary candidate samples based on the predicted target security domain boundary features includes: selecting initial samples within the feasible operating domain; projecting the initial samples according to the predicted target security domain boundary features; and superimposing a random perturbation on the projection result to generate a candidate boundary sample set under the target fault scenario.

[0012] As a preferred embodiment of the security domain boundary sample enhancement method based on transfer learning described in this invention, the step of performing boundary validity verification on the security domain boundary candidate samples based on preset physical operation constraint rules includes: obtaining the set of state variables corresponding to the security domain boundary candidate samples; Perform variable range verification. If the generator active power output, load change range, and node voltage are all within the upper and lower limits of the allowable threshold, the variable range verification is deemed to have passed. Perform a power flow check. If the power flow convergence residual of the set of state variables is lower than a preset power flow threshold, the power flow check is deemed to have passed. Perform boundary neighborhood verification; if the absolute value of the safety margin function of the set of state variables is less than the boundary neighborhood determination threshold, the boundary neighborhood verification is deemed to have passed. In response to the fact that the candidate sample for the security domain boundary simultaneously passes the variable range verification, the power flow verification, and the boundary neighborhood verification, the candidate sample for the security domain boundary is regarded as an effective enhanced boundary sample.

[0013] This invention provides a system for enhancing security domain boundary samples based on transfer learning, comprising: a data acquisition module for acquiring target graph structure data under a target fault scenario, wherein the target graph structure data represents the power system topology and operating state characteristics under the target fault scenario; a feature prediction module for inputting the target graph structure data into a preset transfer learning model and outputting predicted target security domain boundary features, wherein the preset transfer learning model is used to learn the mapping relationship between source fault states and security domain boundary features; a sample generation module for generating security domain boundary candidate samples based on the predicted target security domain boundary features; a logic verification module for performing boundary validity verification on the security domain boundary candidate samples based on preset physical operation constraint rules; and a result output module for outputting an enhanced boundary sample set in response to the security domain boundary candidate samples passing the boundary validity verification.

[0014] This invention provides an electronic device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the security domain boundary sample augmentation method based on transfer learning.

[0015] The present invention provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the security domain boundary sample enhancement method based on transfer learning.

[0016] Compared with existing technologies, the beneficial effects of this invention are as follows: By introducing graph structure representation and a pre-defined transfer learning model, this invention mines and reuses topological correlation features between different fault scenarios, overcoming the computational exhaustion bottleneck faced by traditional physical analysis methods when evaluating massive Nk complex faults, and enabling rapid prediction of the boundary features of the target security domain. Simultaneously, this invention innovatively constructs a sample generation mechanism combining spatial projection and random perturbation, and follows the law of conservation of power grid energy in a multi-level physical rigidity check closed loop, eliminating the defect of pure data-driven models easily generating false failure samples, and enhancing the boundary sample set to have both generation efficiency and physical reliability. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1This is a flowchart of the overall process for the security domain boundary sample enhancement method based on transfer learning. Figure 2 is a flowchart of the transfer learning model training process for the security domain boundary sample enhancement method based on transfer learning. Figure 3 This is a diagram of the system architecture for power system security domain boundary sample enhancement based on transfer learning, as described in the aforementioned security domain boundary sample enhancement method. Detailed Implementation

[0019] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0020] Example 1, referring to Figure 1 As an embodiment of the present invention, a method for enhancing security domain boundary samples based on transfer learning is provided, comprising: S1: Obtain the target graph structure data under the target fault scenario; S2: Input the target graph structure data into the preset transfer learning model and output the predicted target security domain boundary features. The preset transfer learning model is used to learn the mapping relationship between the source fault state and the security domain boundary features. S3: Generate candidate samples for the security domain boundary based on the predicted target security domain boundary features; S4: Perform boundary validity verification on candidate samples of the security domain boundary based on preset physical operation constraint rules; S5: In response to the safety domain boundary candidate samples passing the boundary validity check, output an enhanced boundary sample set.

[0021] Existing technologies have limitations in obtaining safety domain boundary samples for complex faults (Nk): Traditional point-by-point simulation and traversal search result in an exponential increase in the number of fault combinations with the number of components, leading to long computation times and computational bottlenecks. Purely data-driven generative models suffer from poor generalization ability due to isolated training for each fault scenario, and neglect the constraints of objective physical mechanisms in the power system. Under complex topological fracture conditions, candidate samples generated by conventional models lacking physical conservation rules often violate the power grid energy conservation law and equipment extreme value constraints. These distorted samples, where mathematical predictions do not match actual physical states, are contradictory at the physical level and cannot be directly applied. Using these distorted samples for system resilience assessment and scheduling control can easily lead to misjudgments of operating conditions, affecting the safety and stability of the power grid.

[0022] To address the computational bottlenecks of existing boundary sample acquisition methods when dealing with Nk faults, and the weak generalization and susceptibility to generating false samples that violate physical constraints due to the lack of physical constraints in purely data-driven models, this embodiment addresses these issues. Through steps S1 to S5, the target graph structure data is input into a pre-defined transfer learning model to quickly output target prediction features. A validity verification mechanism based on physical operational constraints is introduced at the sample generation stage. This method uses objective physical conservation laws as constraints for sample output, eliminating distorted data generated by purely empirical fitting. It solves the problems of poor computational efficiency and mismatch between enhanced samples and actual physical states in existing methods, providing reliable data support for safe dispatching and resilience analysis of the power grid under Nk faults.

[0023] Example 2, refer to Figure 1-3 This is one embodiment of the present invention. Based on the above embodiment, a method for enhancing security domain boundary samples based on transfer learning is provided.

[0024] S1: Obtain the target graph structure data under the target fault scenario; Specifically, the system acquires the target fault scenario and extracts the power system topology and multi-dimensional operating state features under the target fault scenario. The multi-dimensional operating state features include system node features and system branch features. The system acquires the active power injection, reactive power injection, active power demand, reactive power demand, node voltage amplitude, node type, and load importance weight for each node, and combines these into a node feature vector. The system acquires the resistance, reactance, branch capacity limit, pre-fault branch power flow, pre-fault branch load rate, and branch state variables for each branch, and combines them into a branch feature vector. The branch state variable is used to explicitly identify whether the branch belongs to the faulty component that exits in the target fault scenario.

[0025] The system constructs a node feature matrix from the feature vectors of all nodes in the entire network, and constructs a topology connection and branch feature matrix from the feature vectors of all branches in the entire network and the remaining physical connections of the network after the faulty component is removed. The node feature matrix and the topology connection and branch feature matrix are then correlated and combined to construct the target graph structure data. The target graph structure data is represented in mathematical space as matrix pairs: In the formula, This refers to the target graph structure data under the target fault scenario. The node feature matrix under the target fault scenario. The topology connection and branch feature matrix is ​​given under the target fault scenario.

[0026] In this embodiment, the target fault scenario is defined as the N-2 fault scenario in a distribution network topology containing 14 nodes and 20 branches, where branches 4 and 7 are simultaneously disconnected. The system extracts multi-dimensional operating state features under the target fault scenario, specifically including: extracting the active power injection of node 2 (0MW), reactive power injection of node 2 (0MW), active power demand of node 2 (40MW), reactive power demand of node 2 (15MVar), node voltage amplitude (1.02pu), node type marked as load node, and load importance weight set to 1.0, and concatenating them into a seven-dimensional feature vector of node 2. For the 20 branches in the system, the system extracts the corresponding impedance parameters, capacity limits, and pre-fault power flow states respectively. For branches 4 and 7 in the disconnected state, the system assigns their corresponding branch state variables a value of 0; for the remaining 18 normally operating branches, the system assigns their corresponding branch state variables a value of 1. The system combines the feature vectors of the 14 nodes into a node feature matrix with a dimension of 14×7. The feature vectors of the 20 branches are combined with the network adjacency relationships to form a topological connectivity and branch feature matrix that includes the branch states. The target graph structure data is obtained by combining the two. .

[0027] S2: Input the target graph structure data into the preset transfer learning model and output the predicted target security domain boundary features. The preset transfer learning model is used to learn the mapping relationship between the source fault state and the security domain boundary features. Specifically, the system inputs the target graph structure data constructed in step S1 into the pre-trained transfer learning model. The pre-trained transfer learning model performs topological feature extraction, attention weight allocation, and high-dimensional space mapping operations on the input target graph structure data through its internal network layers, outputting predicted target safety domain boundary features. The target safety domain boundary features include the predicted target boundary normal vector and the predicted target boundary intercept. In a distribution network topology containing 14 nodes and 20 branches, the predicted target boundary normal vector is specifically represented as a feature vector with dimensions corresponding to the number of nodes, and its row vector value is... The fourteen-dimensional vector; the predicted target boundary intercept is specifically represented as a scalar characterizing the absolute physical position of the boundary hyperplane in the operating space, and its value is... The scalar of . The predicted target boundary normal vector and the predicted target boundary intercept are used together to characterize the critical hyperplane of the safe domain under the target failure scenario, and their geometric meaning satisfies the linear space equation: ,in These are system state variables.

[0028] The steps for setting up a preset transfer learning model include S2.1 to S2.4: S2.1 Obtain the source graph structure data of the source fault scenario and the corresponding true values ​​of the source security domain boundary features, and combine the source graph structure data and the true values ​​of the source security domain boundary features to construct a training sample sequence; For source fault scenarios, the system extracts the node set, branch set, node features, branch features, and fault state features. Simultaneously, the system acquires power flow data for source fault scenarios under both normal and fault states. Based on this data, it performs power flow sensitivity calculations and post-fault power flow redistribution calculations. Combining line thermal stability constraint calculations and node voltage constraint calculations, the system derives and solves for the true source boundary normal vector and true source boundary intercept when the system is in a critical collapse state under source fault scenarios. The system then correlates the true source boundary normal vector and true source boundary intercept, combining them to form the true value of the source safety domain boundary features.

[0029] S2.11 Acquires power flow operation data for source fault scenarios under both normal and fault states. Specifically, for a selected source fault scenario, the system acquires power flow operation data for both normal and fault states. The power flow operation data covers core state parameters characterizing the power grid energy distribution, including: node active power injection, node reactive power injection, node voltage amplitude, and branch power flow data for each line.

[0030] In this embodiment, the source fault scenario is defined as an N-1 fault scenario where only branch 3 is disconnected. The power flow operation data actually acquired by the system for the source fault scenario specifically includes: the active power injection at node 2 is 40MW, the reactive power injection at node 2 is 15MVar, the node voltage amplitude at node 2 is 1.02pu, and the active and reactive power flow transmission values ​​on the 20 branches in the system. The power flow operation data fully records the physical characteristics of the grid nodes and lines following Kirchhoff's laws and the law of conservation of energy under the source fault scenario.

[0031] S2.12 performs power flow sensitivity calculation and line thermal stability constraint calculation based on power flow operation data to obtain the true source boundary normal vector and the true source boundary intercept of the source safety domain boundary; Specifically, the system uses the acquired power flow data to calculate the changes in injected power at each node of the power grid. Changes in power flow in key cross-section branches Power flow sensitivity matrix Satisfying mathematical relations The system further incorporates the upper limit of the active power capacity for thermal stability of each power grid line. This transforms the complex nonlinear power flow equations into linearized operating constraint inequalities concerning node injected power. By algebraically analyzing the critical hyperplane of the operational constraint inequality, the true source boundary normal vector representing the tilt direction of the source security domain boundary space is extracted. And the true source boundary intercept characterizing the absolute displacement of the source security domain boundary space. .

[0032] In this embodiment, for a source fault scenario where only branch 3 is disconnected, the system incorporates power flow data from node 2, including an active power injection of 40MW, a reactive power injection of 15MVar, and a node voltage amplitude of 1.02pu, into the sensitivity analysis process. The system then combines this data with the upper limit of the active power capacity for line thermal stability of the affected branch to obtain the true source boundary normal vector of the source safety domain boundary. and the true source boundary intercept .

[0033] S2.13 combines the true source boundary normal vector with the true source boundary intercept to obtain the true value of the source safe domain boundary feature.

[0034] Specifically, the system extracts the true source boundary normal vector obtained in step S2.12. intercept with the true source boundary The system follows a preset feature concatenation dimension order, using the true source boundary normal vector as a multi-dimensional directional feature component and the true source boundary intercept as a one-dimensional positional feature component. It then concatenates and maps these two components along the feature dimension to obtain a complete true value matrix of the source safe domain boundary features. .

[0035] In this embodiment, the system uses the fourteen-dimensional true source boundary normal vector. Intercept of the true source boundary with a scalar value of 150.5 The components are spliced ​​and assembled to construct a complete 15-dimensional tensor label. The system uses this 15-dimensional tensor label as the ground truth value of the source security domain boundary features for the scenario with only branch 3 disconnection, and feeds it into the training sample sequence as the absolute true supervision benchmark for calculating the loss function in the subsequent model training stage.

[0036] S2.2 Construct the initial graph attention network model; Specifically, the system constructs an initial graph attention network model comprising a graph feature input layer, multi-layer graph attention feature aggregation layers, a global graph pooling layer, and a boundary feature prediction layer. The system allocates initial trainable network parameters to the initial graph attention network model. Trainable network parameters It should at least contain the linear transformation weight matrix of node features in each multi-layer graph attention feature aggregation layer. and attention allocation weight vector At this point, the initial graph attention network model is in a randomly initialized state without backpropagation optimization of the true values ​​of the source security domain boundary features, and is waiting to receive the training sample sequence constructed in step S2.1 to perform forward propagation feature extraction.

[0037] In this embodiment, for a distribution network topology containing 14 nodes and 20 branches, the system sets the core network hyperparameters of the initial graph attention network model as follows: The initial dimension of the node features received by the graph feature input layer is set to 2 dimensions, receiving the active and reactive power injection of the nodes; the multi-layer graph attention feature aggregation layer contains two network hidden layers, and the hidden feature dimension of each hidden layer is set to 64 dimensions, with four independent computation heads for multi-head attention mechanisms configured to enhance the stability of the power grid topology feature extraction; the output mapping feature dimension of the boundary feature prediction layer is set to 15 dimensions, precisely corresponding to the 14-dimensional predicted source boundary normal vector and the 1-dimensional predicted source boundary intercept. The system calls the preset Xavier uniform distribution function to apply the above-mentioned trainable network parameters... Perform random initialization assignment to complete the construction of the initial graph attention network model.

[0038] S2.3 Input the training sample sequence into the initial graph attention network model to obtain the predicted source security domain boundary features. Calculate the model evaluation error based on the predicted source security domain boundary features and the true values ​​of the source security domain boundary features. The predicted source security domain boundary features include the predicted source boundary normal vector and the predicted source boundary intercept. Specifically, the system inputs the training sample sequence constructed in step S2.1 into the initial graph attention network model initialized in step S2.2. The initial graph attention network model uses the trainable network parameters in the current state to perform forward propagation calculations on the input training sample sequence and outputs the predicted source-safe domain boundary features at the model's boundary feature prediction layer. The predicted source-safe domain boundary features include the predicted source boundary normal vector and the predicted source boundary intercept, which respectively represent the boundary space tilt direction and absolute boundary position deduced by the current network model in a non-fully converged state. Subsequently, the system synchronously extracts the ground truth values ​​of the source-safe domain boundary features used as supervision labels from the training sample sequence and triggers a calculation process to calculate the model evaluation error based on the predicted source-safe domain boundary features and the ground truth values ​​of the source-safe domain boundary features.

[0039] In this embodiment, the system inputs the graph structure data constructed for the scenario where only branch 3 is disconnected into the initial graph attention network model. After forward propagation mapping of the model, the network output layer predicts a feature vector with a dimension of fourteen. As the predicted source boundary normal vector, and output as a continuous scalar This is used as the predicted source boundary intercept. At this point, the system compares the predicted source safe region boundary features with the previously calculated 14-dimensional true source boundary normal vector, obtained precisely based on physical laws. And the true source boundary intercept with a value of 150.5. Perform joint calculations to determine spatial distance errors.

[0040] S2.31 Calculate the L2 norm squared difference between the predicted source boundary normal vector and the true source boundary normal vector; Specifically, the system extracts the predicted source boundary normal vectors with dimension D from the output of step S2.3. And the true source boundary normal vector of the same dimension obtained by analytical solution in step S2.12. The system performs element-wise subtraction on the two multidimensional vectors to obtain the direction residual vector, and then calculates the squared norm of this direction residual vector to obtain the squared norm difference. This calculation process satisfies the following spatial distance calculation formula: In the formula, Characterizing the hyperplane orientation error term, The predicted source boundary normal vector is obtained in the th... Component values ​​in each node dimension For the true source boundary normal vector in the th... The component values ​​in the node dimension, where D is the total number of nodes in the power system.

[0041] In this embodiment, the system extracts the 14-dimensional predicted source boundary normal vector from the model's forward output. And the fourteen-dimensional true source boundary normal vector derived from the physical benchmark. The system substitutes the two fourteen-dimensional vectors mentioned above into the spatial distance calculation formula, performs subtraction and summation of the squares of the corresponding node dimensions, and calculates sequentially. After summing the squared residuals across all 14 node dimensions, the system calculates a scalar value of 0.20 for the L2 norm squared difference. This scalar value of 0.20 is cached by the system and used as a directional constraint benchmark for subsequent joint calculations of the overall model evaluation error.

[0042] S2.32 Calculate the squared difference between the predicted source boundary intercept and the true source boundary intercept, and multiply the squared difference by the preset weighting coefficient of the boundary intercept error term; Specifically, the system extracts the predicted source boundary intercept, which represents the absolute displacement of the hyperplane, from the output of step S2.3. And the true source boundary intercept obtained by analytical solution in step S2.12. The system performs a subtraction and square operation on the two scalar values ​​to obtain the squared difference of the intercepts. Then, the system multiplies this squared difference of intercepts by a preset weighting coefficient for the boundary intercept error term. The weighted intercept position error term is obtained. This calculation process satisfies the following scalar operation formula: In the formula, Characterizing the weighted boundary intercept error term, To predict the source boundary intercept, For the true source boundary intercept, The weighting coefficients for the preset boundary intercept error term.

[0043] In this embodiment, the system extracts the predicted source boundary intercept, which has a value of 142.0 from the model's forward output. And the true source boundary intercept, derived from the physical benchmark, is 150.5. The system sets preset weighting coefficients for the boundary intercept error term. The value is 0.5. The system substitutes the above value into the scalar operation formula and calculates the intercept squared difference as... Subsequently, the system multiplies the squared intercept difference of 72.25 by a preset weighting coefficient of 0.5 for the boundary intercept error term, resulting in a weighted scalar value of 36.125. This scalar value of 36.125 is cached by the system and used as the absolute position error reference for joint summation with the direction error in step S2.31.

[0044] S2.33 adds the squared difference of the second norm to the squared difference multiplied by the weight coefficient and sums them to obtain the model training loss function as the model evaluation error.

[0045] Specifically, the system extracts the L2 norm squared difference of the hyperplane direction error term calculated in step S2.31, and the squared difference of the weighted boundary intercept error term calculated in step S2.32 after multiplying by the weighting coefficients. The system algebraically sums the L2 norm squared difference and the squared difference multiplied by the weighting coefficients to construct the complete model training loss function. The summation process satisfies the following mathematical joint evaluation formula: In the formula, This is the model training loss function, used to characterize the comprehensive multidimensional spatial distance deviation between the critical hyperplane predicted by the model in the current iteration and the real physical critical hyperplane. The system uses the calculated result of the model training loss function as the final model evaluation error, which is then used by the subsequent optimizer to update the network parameters.

[0046] In this embodiment, the system extracts the scalar value of 0.20 from the previously calculated L2 norm squared difference and the scalar value of 36.125 from the weighted intercept position error term. The system adds these two scalar values ​​to calculate the original comprehensive error value of 36.325. The system performs a preset global normalization mapping on the original comprehensive error value, resulting in a normalized final scalar value of 0.45. The system uses the mapped final scalar value of 0.45 as the model evaluation error for this training round and passes it to the gradient descent optimization algorithm in step S2.4, triggering the backpropagation update process of network parameters.

[0047] S2.4 Update the initial graph attention network model based on the model evaluation error to obtain the preset transfer learning model.

[0048] Specifically, the system uses the model evaluation error calculated in step S2.33 as the optimization objective for backpropagation, calls the preset gradient descent optimization algorithm, and calculates and updates the trainable network parameters in the initial graph attention network model along the gradient direction that reduces the model evaluation error. The updated formula is as follows ,in The learning rate is used. The system continuously iterates through the feature prediction and parameter update process. When the model evaluation error drops below the preset convergence threshold, or when the number of iterations reaches the preset maximum number of iterations, the model training is considered complete. The network model with the current parameters is then output as the preset transfer learning model for subsequent boundary feature prediction in complex target fault scenarios.

[0049] In this embodiment, the system sets a preset convergence threshold of 0.001. In the initial training epochs for the scenario where only branch 3 is disconnected, the system calculates an initial model evaluation error of 0.45. Based on this error value of 0.45, the system performs backpropagation through the Adam optimizer to fine-tune the network parameters of the initial graph attention network model. After 300 epochs of iterative training, the system calculates that the current model evaluation error has decreased to 0.0008. In response to the value 0.0008 being less than the preset convergence threshold of 0.001, the system stops network training, fixes all current network parameters, and outputs the preset transfer learning model that has been trained.

[0050] In this embodiment of the application, step S2 inputs the target graph structure data into a preset transfer learning model and outputs the predicted target safety domain boundary features, including the following steps A1-A5: the target safety domain boundary features include the predicted target boundary normal vector and the predicted target boundary intercept; A1 determines the set of node adjacencies for each node in the target graph structure data based on the topological connection matrix in the target graph structure data. Specifically, the system extracts the topology connectivity matrix from the target graph structure data constructed in step S1. For any node in a power system The system scans the topology connection matrix. In and nodes The corresponding row or column vector. The system extracts the non-zero matrix elements from the row or column vector and determines the associated nodes of the non-zero matrix elements as nodes. Adjacent nodes that have a direct physical connection. The system will... By summing up all adjacent nodes, a node is constructed. The set of adjacencies of nodes .

[0051] In this embodiment, for the N-2 target fault scenario where branch 4 and branch 7 are simultaneously disconnected, the system extracts a topology connection matrix with a dimension of 14×14. Under normal grid conditions, node 2 has physical transmission connections with nodes 1, 3, and 4. Since physical branch 4 connecting node 2 and node 4 is disconnected in the target fault scenario, the topology connection matrix... The matrix elements representing the connection between node 2 and node 4 are updated from 1 to 0. The system then updates the topology connection matrix accordingly. By analyzing the row vector distribution of node 2, it was determined that only the matrix elements corresponding to nodes 1 and 3 have a value of 1, thus establishing the adjacency set of node 2. It is a set of nodes that includes node 1 and node 3.

[0052] A2 embeds the features of neighboring nodes in the node adjacency set, the attention weights corresponding to the neighboring nodes, and multiplies and sums the trainable weight matrix; Specifically, for any central node in the power system The system traverses the node adjacency set determined in step A1. Each adjacent node in The system obtains adjacent nodes. Corresponding neighbor node feature embedding The system uses a pre-defined self-attention mechanism function to calculate the central node. With adjacent nodes Attention weights between Subsequently, the system embeds the features of adjacent nodes. Attention weight and the trainable weight matrix assigned during the network initialization phase. Perform a linear tensor multiplication operation. The system will then perform a node adjacency set operation. The central node is obtained by summing the tensor multiplication results of all adjacent nodes. The linear aggregation features. This calculation process satisfies the following local feature aggregation formula: In the formula, As the central node The linear aggregated features obtained after multiplication and summation operations As the central node With adjacent nodes Attention weights between them For trainable weight matrix, Adjacent nodes The feature embedding of adjacent nodes, As the central node The set of adjacent nodes.

[0053] In this embodiment, the system calculates the linear aggregation feature of node 2, which serves as the central node. Based on the analysis in step A1, the adjacency set of node 2 is... It includes nodes 1 and 3. The system calculates the attention weight of node 1 on node 2 using a self-attention mechanism function. The value is 0.6, which calculates the attention weight of node 3 to node 2. The value is 0.4, and the sum of their weights is 1, representing the physical distribution ratio of power flow transfer. The system extracts and embeds the features of the neighboring nodes of node 1. Feature embedding of adjacent nodes of node 3 The system uses attention weights with a value of 0.6 and a trainable weight matrix. With node feature embedding Multiply by the attention weight (value 0.4) and the trainable weight matrix. With node feature embedding The algebraic summation of the product results is actually performed as follows: Thus, the summation result corresponding to node 2 can be finally obtained. .

[0054] A3 uses a non-linear activation function to process the summation result and obtain the updated node features; Specifically, the system extracts the central node calculated in step A2. linear aggregation features As the summation result, the system will use linear aggregation features. The input is fed into a preset LeakyReLU nonlinear activation function for nonlinear mapping. After processing by the nonlinear activation function, the system will determine the center node. The topological features of the node and its adjacency set are subjected to nonlinear dimensionality reduction and feature excitation, and the final output is the central node. Corresponding updated node features The calculation process satisfies the following nonlinear activation formula: In the formula, As the central node The corresponding updated node features, For the preset nonlinear activation function, As the central node The corresponding summation result.

[0055] In this embodiment, the summation result of node 2 obtained in step A2 is combined with the network hyperparameters set in step S2.2. This is a 64-dimensional hidden feature vector, where the values ​​of the first four dimensions are: The system is set to use a default LeakyReLU function with a negative decay slope of 0.01. The system will sum the results. Substituting into the LeakyReLU function, a non-linear activation operation is performed along the feature dimension. For the summation result... For the positive eigencomponents 2.5 and 0.8, the LeakyReLU function retains their original values ​​in the output; for the summation result... The negative feature components -1.2 and -0.5 are calculated by the LeakyReLU function multiplying them by a negative decay slope of 0.01, yielding values ​​of -0.012 and -0.005. After this nonlinear processing, the system finally outputs the updated node features corresponding to node 2. The values ​​of its first four dimensions were updated to .

[0056] A4 uses multi-layer graph attention propagation and graph pooling operations to aggregate the features of each node into the overall features of the entire power grid fault scenario, thus obtaining the fault scenario graph embedding. Specifically, the system follows a preset number of network layers. Steps A1 to A3 are treated as a graph attention propagation layer and executed iteratively. The feature update operation is performed in the second iteration. In each iteration, the system uses the output features of the previous layer as the input features of the current layer, thereby achieving multi-layer graph attention propagation and outputting the final feature update of each node. Deep node features corresponding to the layer Subsequently, the system invokes a global average pooling operation to perform pooling on all data in the target graph structure. The system performs global spatial feature aggregation on the deep node features of each node. All deep node features are fused into a unified low-dimensional global vector to obtain the fault scene graph embedding. This graph pooling operation satisfies the following spatial aggregation formula: In the formula, Embed the fault scene diagram. This represents the total number of nodes contained in the target graph structure data. For nodes go through Deep node features output after attention propagation in multi-layer graphs.

[0057] In this embodiment, the system sets a preset number of network layers. After two layers of graph attention propagation, the system extracts deep node features from all 14 nodes, each with a 64-dimensional output. The system employs global average pooling, summing these 14 64-dimensional deep node features along their respective feature dimensions, and then dividing the sum by the total number of nodes, 14. The values ​​of nodes 1 through 14 in the first feature dimension are set sequentially as follows: The system calculates the average value of this dimension as follows: The system performs the above averaging operation on all 64 feature dimensions, ultimately outputting a single 64-dimensional global vector. This single 64-dimensional global vector is the fault scene graph embedding, which is input into the final prediction layer.

[0058] A5 utilizes the boundary feature prediction layer in the transfer learning model to embed the predicted target boundary normal vector and the predicted target boundary intercept based on the fault scene graph.

[0059] Specifically, the fault scenario diagram output in step A4 of the system is embedded. The system embeds fault scenario diagrams. The input is fed into the multilayer perceptron boundary feature prediction layer in the transfer learning model. The boundary feature prediction layer utilizes a pre-trained feature mapping weight matrix and bias vector trained on the source fault scene to embed the fault scene graph. Perform dimensionality reduction and linear projection operations to output a joint predicted feature vector. Subsequently, the system, according to the preset physical dimension segmentation rules, will jointly predict the feature vector. The system divides the target into multi-dimensional orientation components and one-dimensional position components along the feature dimension. The multi-dimensional orientation components are used as the predicted target boundary normal vector. The one-dimensional position component is used as the intercept of the predicted target boundary. The feature mapping and segmentation process satisfies the following mathematical formula: In the formula, For joint prediction of feature vectors, For the network mapping function of the boundary feature prediction layer, The feature mapping weight matrix, For bias vectors, For dimension splitting function, The predicted target boundary normal vector, This is the predicted target boundary intercept. In this embodiment, the system extracts the 64-dimensional global vector obtained in step A4. The system inputs this 64-dimensional global vector into the boundary feature prediction layer. The boundary feature prediction layer utilizes a feature mapping weight matrix with an internal dimension of 15×64. Multiply the 64-dimensional global vector by a tensor and then superimpose a bias vector of dimension 15. The mapping outputs a complete 15-dimensional joint prediction feature vector. The system segments the 15-dimensional joint prediction feature vector according to a physical segmentation rule where the first 14 dimensions are the normal vector and the last dimension is the intercept. The system extracts the values ​​from the first 14 dimensions and outputs a 14-dimensional feature vector. The system uses the predicted target boundary normal vector as input; it extracts the value of the 15th dimension and outputs a single scalar value. As the intercept of the predicted target boundary.

[0060] S3: Generate candidate samples for the security domain boundary based on the predicted features of the target security domain boundary; Specifically, the system extracts the predicted target safety domain boundary features output in step S2. The predicted target safety domain boundary features include the predicted target boundary normal vector. Intercept of the predicted target boundary The system uses the critical hyperplane formed by the predicted target boundary normal vector and the predicted target boundary intercept in mathematical space as the spatial optimization benchmark. The system obtains benchmark physical coordinates within the feasible domain of the power grid's safe operation and guides these benchmark physical coordinates to perform directional geometric mapping along the normal direction of the critical hyperplane. Subsequently, the system superimposes multidimensional spatial random perturbations near the mapped benchmark critical coordinates, thereby generating multiple candidate samples of the safe domain boundary distributed near the safe boundary of the target fault scenario in batches within a specific neighborhood of the critical hyperplane.

[0061] S3.1 Select initial samples within the feasible operating region; Specifically, the system acquires the operating state variable space of the power system under the target fault scenario. This space is formed by the combined enveloping conditions of safe operation constraints, such as the upper and lower limits of generator active power output and allowable deviations of node voltage. Within the safe operating feasible region where no limit-over-limit warnings are triggered, the system extracts the current actual steady-state operating point of the power grid, or generates a set of state variable coordinates within the safe range through uniform sampling, and uses these extracted or generated state variable coordinates as initial samples. .

[0062] In this embodiment, for a distribution network topology containing 14 nodes and 20 branches, the system obtains the physical constraint range of active power output for generator node 1 as 20MW to 150MW. Within this constraint range, the system selects a generator active power output value of 80MW as the safe operating coordinate point in steady state. The system establishes a high-dimensional state vector containing this 80MW feature component as the initial sample. The initial sample Located within the absolute safety domain of the power grid, it has sufficient safety margin to operate from the predicted critical hyperplane.

[0063] S3.2 Project the initial sample based on the predicted target safety domain boundary features; specifically, the system extracts the predicted target boundary normal vector output in step S2. Intercept of the predicted target boundary And extract the initial samples established in step S3.1. The system calculates the initial samples in a multidimensional operating state variable space. The vertical spatial projection vector to the critical hyperplane formed by the predicted target safety domain boundary features. The system superimposes the vertical spatial projection vector onto the initial sample. The projected reference sample that falls exactly on the critical hyperplane is obtained. The spatial projection process satisfies the following hyperplane orthogonal projection formula: In the formula, As a projection reference sample, As the initial sample, The predicted target boundary normal vector, To predict the target boundary intercept, This is the transpose of the target boundary normal vector. Let L be the squared L2 norm of the target boundary normal vector.

[0064] In this embodiment, the system uses the aforementioned fourteen-dimensional target boundary normal vector Intercept of the target boundary with a value of 135.0 Substituting into the hyperplane orthogonal projection formula, the system extracts initial samples with an active power output of 80MW for node 1 generator. The system obtains the vertical spatial projection vector through algebraic calculations, and analyzes the increment value of this vector in the feature dimension of node 1 as 20MW. The system superimposes this 20MW increment value onto the original 80MW value of the initial sample to calculate the projection reference sample. The reference coordinate point in dimension 1 is updated to 100MW. This 100MW projected reference sample lies on the predicted target critical hyperplane.

[0065] S3.3 adds a random perturbation to the projection result to generate a set of candidate boundary samples for the target fault scenario.

[0066] Specifically, the system sets a preset disturbance distribution model and determines the disturbance covariance matrix based on the operational tolerance limits of the power grid's physical equipment. Based on the preset disturbance distribution model, the system generates multiple independent random disturbance vectors in the multidimensional operating state variable space. Subsequently, the system extracts the projection reference samples calculated in step S3.2. Multiple independent random perturbation vectors Compared with the projection reference sample respectively Perform algebraic vector addition. The system establishes each new state coordinate obtained after superposition calculation as a candidate sample of the safe region boundary, and summarizes all generated new state coordinates to generate a sample containing... The set of candidate samples for the safety domain boundary of each sample. The perturbation superposition and sample generation process satisfy the following spatial sampling formula: In the formula, For the generated first One security domain boundary candidate sample As a projection reference sample, For the first A random perturbation vector, Generate the total number of candidate samples as preset. The vector representing the zero mean and the covariance matrix is The multivariate Gaussian distribution function.

[0067] In this embodiment, the system extracts a projected reference sample with an established active power output of 100MW for node 1 generator. The system sets the preset disturbance distribution model to a truncated Gaussian distribution, limiting the range of random disturbances to the active power output of node 1 to a physical safety margin of [-5MW, +5MW]. The system calls a pseudo-random generation algorithm to generate the first random disturbance component as +1.5MW. The system then superimposes this +1.5MW random disturbance component onto a 100MW reference point to calculate the first candidate sample. The specific coordinate value of node 1 is updated to 101.5MW. The system performs random perturbation superposition operation 1000 times in parallel computing mode to generate a batch of candidate boundary sample sets containing 1000 discrete physical state coordinates. The set contains coordinate points with output values ​​of 98.2MW, 103.1MW, and 100.8MW for node 1.

[0068] S4: Perform boundary validity verification on candidate samples of the security domain boundary based on preset physical operation constraint rules; Specifically, the system extracts the batch-generated candidate sample set for the safety domain boundary in step S3. For each candidate sample in the set, the system inputs the multi-dimensional operating state variables it represents into a preset physical operating constraint rule engine. The preset physical operating constraint rules cover power flow balance equality constraints characterizing Kirchhoff's laws of the power grid, as well as node voltage inequality constraints and line transmission capacity inequality constraints characterizing the physical limits of equipment. The system verifies whether the candidate samples for the safety domain boundary can simultaneously satisfy all the above equality and inequality constraints by executing a nonlinear power flow analytical calculation process. The system retains the candidate samples that pass the verification and removes the candidate samples that fail the verification, thereby achieving purification of the physical validity of the boundary samples.

[0069] In this embodiment, the system extracts a set of 1000 candidate samples for the safety domain boundary, each containing discrete physical state coordinates, and performs AC power flow constraint verification on each of these 1000 candidate samples. For the first candidate sample with a generator output of 101.5MW at node 1, the system substitutes it into the power flow equation for iterative solution. The calculation shows that the voltage of all nodes in the entire network remains within the safety constraint range of 0.95pu to 1.05pu, and there are no line overloads. The system determines that this 101.5MW candidate sample passes the verification and is entered into the valid database. For the 87th candidate sample with a generator output of 104.8MW at node 1, generated due to extreme random disturbances, the system finds through power flow calculation that it causes the node voltage amplitude of node 5 to drop to 0.88pu, breaking the 0.90pu physical safety baseline of the power grid. The system determines this sample to be an out-of-limit sample and removes it directly from the set. After physical rule screening, the system finally purifies and retains 850 critical boundary samples from the initial 1000 candidate samples.

[0070] S4.1 Obtain the set of state variables corresponding to the candidate samples of the security domain boundary; Specifically, the system iterates through each security domain boundary candidate sample in the candidate boundary sample set generated in step S3.3. The system performs decoupling extraction of feature dimensions for candidate samples at the safety domain boundary according to a preset system node feature dimension mapping dictionary. It then classifies and maps the high-dimensional feature components according to physical attributes, extracting a set of state variables containing various power steady-state operating parameters. The set of state variables covers the core input variables necessary for performing steady-state power flow calculations and equipment thermal stability verification across the entire network. Specifically, it includes: the active power output state variables of each generator node in the system, the active and reactive power injection state variables of each load node, and the generator terminal voltage amplitude setting variables of specific nodes.

[0071] In this embodiment, the system targets the first security domain boundary candidate sample. The system performs the reverse extraction of state variables. It then uses a mapping dictionary to reconstruct and combine this high-dimensional vector into a specific set of state variables. The system analyzed the set and found that it specifically includes: the active power output state variable of generator node 1 is 101.5MW generated by the previous disturbance; the load active power state variable of load node 2 remains at the original 40MW; the load reactive power state variable of load node 2 remains at 15MVar; and the generator terminal set voltage amplitude state variable of node 1 is 1.05pu. The above numerical combination constitutes the complete set of state variables corresponding to the first candidate sample.

[0072] S4.2 Perform variable range verification. If the generator active power output, load variation range, and node voltage are all within the allowable threshold limits, the variable range verification is deemed successful. Specifically, the system extracts the set of state variables parsed in step S4.1. The system calls the preset static security rule base to extract the upper and lower limits of the allowable thresholds corresponding to various physical parameters in the state variable set. The system then sets the state variable set... Substitute each physical component into the following set of static inequality constraint equations to perform boundary comparison verification: In the formula, For the first Generator nodes in the candidate samples The active power output state variable, and These are the lower and upper limits of its permissible active power output, respectively; and They are the load nodes. The active and reactive state variables, and their corresponding states. and The variables indicated by superscripts constitute the range of load variation; For nodes The node voltage state variables, and Its allowable voltage fluctuation range; These are the sets of generator nodes, load nodes, and voltage control nodes, respectively. When all the above inequality constraints are simultaneously satisfied, the system determines that the candidate sample passes the variable range check.

[0073] In this embodiment, the system considers the set of state variables corresponding to the first candidate sample of the security domain boundary. Perform variable range verification. The system sets the following allowable thresholds: the active power output limit of generator node 1 is 20MW to 150MW; the active load elasticity range of load node 2 is 30MW to 50MW; the reactive load elasticity range is 10MVar to 20MVar; and the node 1 terminal voltage setting range is 0.95pu to 1.10pu. The system will... The specific values ​​were compared: the active power output of node 1 (101.5MW) was determined to be within the range of 20MW to 150MW; the active load of node 2 (40MW) and reactive load (15MVar) were both within their respective load elasticity ranges; the set voltage of node 1 (1.05pu) was also within the limit of 0.95pu to 1.10pu. All core physical variables fell within the tolerance range of the hardware equipment, and the system determined that the first candidate sample of 101.5MW passed the variable range verification.

[0074] S4.3 Perform power flow verification. If the power flow convergence residual of the state variable set is lower than the preset power flow threshold, the power flow verification is deemed to have passed. Specifically, the system uses the set of state variables that passed the initial screening in the previous step. As the initial injection conditions, and combined with the network admittance matrix under the target fault scenario, a set of nonlinear power flow balance equations is constructed, including active power mismatch and reactive power mismatch. The system calls a nonlinear equation solving algorithm to perform iterative approximation solutions on the voltage magnitude and phase angle of all network nodes. In each iteration, the system calculates the current power flow convergence residual of all network nodes. This power flow verification process satisfies the following power flow convergence judgment formula: in: In the formula, and They are nodes The active power mismatch and reactive power mismatch To preset the power flow threshold, and Power is injected into the nodes to provide power to the set of state variables. and For the nodal voltage magnitude in the iterative solution, and Let be the real and imaginary parts of the nodal admittance matrix elements. This represents the node voltage phase angle difference. It occurs in response to the maximum absolute value during iterative calculations decreasing to a preset power flow threshold. The system then determines that the nonlinear equations have successfully converged and that the sample has passed the power flow verification.

[0075] In this embodiment, for the first candidate sample that passed the verification in step S4.2, the system extracts its set of state variables. The system sets a preset power flow threshold. for The system employs the Newton-Raphson method to initiate a nonlinear iterative solution. In the first iteration, the calculated power flow convergence residual is 0.25 pu; after four iterations, the system calculates that the maximum absolute value of the active power mismatch and reactive power mismatch across all nodes in the network has decreased to 0.00008 pu. This value of 0.00008 is lower than the preset threshold. The threshold is used to determine that the multidimensional nonlinear equations of the system's operating section have successfully converged, and the first candidate sample of the 101.5MW system has passed the power flow verification.

[0076] S4.4 Perform boundary neighborhood verification. If the absolute value of the safety margin function of the state variable set is less than the boundary neighborhood determination threshold, the boundary neighborhood verification is passed. Specifically, the system extracts the set of state variables that have completed power flow solution and converged in step S4.3. The system substitutes the complete physical characteristics into a pre-constructed safety margin function to perform analytical calculations. The safety margin function quantifies the shortest algebraic distance between the current power grid operating point and the most severe physical limit constraint. The system calculates the safety margin function value corresponding to the set of state variables and takes its absolute value. This verification process satisfies the following boundary approximation judgment formula: In the formula, For the safety margin function, For the first Each candidate sample corresponds to a set of state variables containing the full power flow steady-state characteristics. The calculated safety margin function value, This is a preset boundary neighborhood determination threshold, whose physical meaning is the effective spatial thickness defining the critical hyperplane. The calculated absolute value is strictly less than the boundary neighborhood determination threshold. The system determines that the sample is approaching the limit of collapse in physical operation, and the determination passes the boundary neighborhood check.

[0077] In this embodiment, the system extracts the power flow characteristics of the entire network after the convergence of the first candidate sample and substitutes them into the safety margin function. The safety margin function is configured to characterize the remaining active power transmission capacity of target branch 5. The system analytically calculates that, under an operating section with a generator output of 101.5MW, the actual active power flow of target branch 5 reaches 118.8MW, leaving only a capacity margin of 1.2MW from the branch's absolute thermal stability physical limit of 120.0MW. Therefore, the calculated safety margin function value is 1.2MW. The system sets a boundary neighborhood determination threshold. The scalar value is 2.0 MW. The system performs an absolute value inequality comparison on the above value: in response to the value If the value is less than the judgment threshold of 2.0, the system determines that the 101.5MW candidate sample is hovering on the edge of the thermodynamic collapse of the target branch 5 and determines that it passes the boundary neighborhood verification.

[0078] S4.5 responds to the candidate samples of the safe domain boundary by simultaneously verifying the variable range, power flow, and boundary neighborhood, and uses the candidate samples of the safe domain boundary as effective enhanced boundary samples.

[0079] Specifically, the system extracts candidate samples for each security domain boundary in steps S4.2 to S4.4. The system outputs independent decision flags. It performs a logical AND operation on the variable range verification flag (representing the initial hardware limit screening result), the power flow verification flag (representing the overall network energy conservation), and the boundary neighborhood verification flag (representing the extreme value proximity). This joint decision process satisfies the following Boolean algebraic logic: In the formula, For the first The final validity flag of each candidate sample. For logical AND operator, , and These represent the determination results of variable range verification, power flow verification, and boundary neighborhood verification, respectively. When all three flags are True, the system establishes the candidate sample for the security domain boundary as a valid enhanced boundary sample and adds it to the final security domain boundary enhanced sample set; when any one flag is False, the system directly removes the sample.

[0080] In this embodiment, for the first candidate sample, its variable range verification flag bit Its power flow verification flag bit Its boundary neighborhood check flag After executing the logic and making the judgment, the system confirmed that its three physical indicators met the requirements and included it in the database as a valid enhanced boundary sample. For candidate sample number 412, the first two verification flags were both True, but during the boundary neighborhood verification, its capacity margin at the boundary exceeded the limit was calculated to be 15.0MW, exceeding the 2.0MW judgment threshold. Its boundary neighborhood check flag After executing the logic and making the judgment, the system discards these as invalid samples. Through a physical filtering mechanism, the system ultimately extracts 685 effective augmentation boundary samples from the initial 1000 candidate samples.

[0081] S5: In response to the safety domain boundary candidate samples passing the boundary validity check, output an enhanced boundary sample set.

[0082] Specifically, the system summarizes all candidate samples for the safe domain boundary that have passed the flag determination in step S4. The system then aligns these discrete state coordinate samples that have passed the boundary validity check, performs high-dimensional tensor concatenation, and encapsulates them using standardized formats. The system then establishes the encapsulated high-dimensional tensor data structure as the enhanced boundary sample set. This data is then written to a readable storage medium or sent to the online security alert module via a standard communication protocol. The set-theoretic mathematical expression generated by this sample set satisfies: In the formula, The final output is the enhanced boundary sample set. For the generated first One security domain boundary candidate sample For the first Boundary validity flags for each sample. This represents the initial total number of candidate samples during the generation phase.

[0083] In this embodiment, the system extracts 685 valid samples that have passed triple physical quality checks. The system then concatenates these 685 independent state variable vectors along the power grid feature dimensions to construct a high-dimensional dense feature matrix of dimension 685×D, where D is the total number of dimensions of the entire network's state variables. Using this high-dimensional dense feature matrix as the data core, the system adds target fault scenario labels and associated normal vector labels, uniformly encapsulating them into the final enhanced boundary sample set. The system outputs this enhanced boundary sample set to the downstream database, filling the data gap in the safety domain under the N-2 fault scenario.

[0084] Example 3, based on the same inventive concept, provides a power system security domain boundary sample enhancement system based on transfer learning, applied to the power system security domain boundary sample enhancement method based on transfer learning in the above embodiments. The system includes: The data acquisition module is used to acquire target graph structure data under the target fault scenario, wherein the target graph structure data represents the power system topology and multi-dimensional operating state characteristics under the target fault scenario; the feature prediction module is used to input the target graph structure data into a preset transfer learning model and output the predicted target security domain boundary features, wherein the preset transfer learning model is used to learn the mapping relationship between the source fault state and the security domain boundary features. The sample generation module is used to generate candidate samples of the security domain boundary based on the predicted target security domain boundary features. The logic verification module is used to perform boundary validity verification on candidate samples of the security domain boundary based on preset physical operation constraint rules; the result output module is used to output an enhanced boundary sample set in response to the candidate samples of the security domain boundary passing the boundary validity verification.

[0085] This embodiment also provides an electronic device, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the power system security domain boundary sample enhancement method based on transfer learning as proposed in the above embodiment.

[0086] This embodiment also provides a computer-readable storage medium storing computer-executable instructions. When executed by a processor, these instructions implement the power system security domain boundary sample enhancement method based on transfer learning as proposed in the above embodiments. The computer-readable storage medium proposed in this embodiment and the method proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0087] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0088] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for enhancing boundary samples of the security domain in a power system based on transfer learning, characterized in that, include: Obtain the target graph structure data under the target fault scenario; The target graph structure data is input into a preset transfer learning model, and the predicted target security domain boundary features are output. The preset transfer learning model is used to learn the mapping relationship between the source fault state and the security domain boundary features. Based on the predicted target security domain boundary features, candidate security domain boundary samples are generated. The boundary validity of the candidate samples of the security domain boundary is verified based on the preset physical operation constraint rules. In response to the security domain boundary candidate samples passing the boundary validity check, an enhanced boundary sample set is output.

2. The method for enhancing boundary samples of power system security domain based on transfer learning according to claim 1, characterized in that, The training steps of the preset transfer learning model include: The source graph structure data of the source fault scenario and the corresponding true values ​​of the source security domain boundary features are obtained respectively. The source graph structure data and the true values ​​of the source security domain boundary features are combined to construct a training sample sequence. Construct an initial graph attention network model; The training sample sequence is input into the initial graph attention network model to obtain the predicted source security domain boundary features. The model evaluation error is calculated based on the predicted source security domain boundary features and the true values ​​of the source security domain boundary features. The initial graph attention network model is updated based on the model evaluation error to obtain the preset transfer learning model.

3. The method for enhancing boundary samples of power system security domain based on transfer learning according to claim 2, characterized in that, The step of acquiring source graph structure data of the source fault scenario and the corresponding true values ​​of source security domain boundary features, and combining the source graph structure data and the true values ​​of source security domain boundary features to construct a training sample sequence includes: Acquire power flow data of the source fault scenario under normal and fault conditions; Based on the power flow operation data, power flow sensitivity calculation and line thermal stability constraint calculation are performed to obtain the true source boundary normal vector and the true source boundary intercept of the source safety domain boundary. The true source boundary normal vector and the true source boundary intercept are combined to form the true value of the source security domain boundary feature.

4. The method for enhancing boundary samples of power system security domain based on transfer learning according to claim 3, characterized in that, The predicted source security domain boundary features include the predicted source boundary normal vector and the predicted source boundary intercept. The evaluation error of the model based on the predicted source security domain boundary features and the true values ​​of the source security domain boundary features includes: Calculate the L2-norm squared difference between the predicted source boundary normal vector and the actual source boundary normal vector; Calculate the squared difference between the predicted source boundary intercept and the actual source boundary intercept, and multiply the squared difference by a preset weighting coefficient for the boundary intercept error term; The model training loss function is obtained by summing the squared difference of the second norm with the squared difference multiplied by the weight coefficient, and then using the model evaluation error as the model training loss function.

5. The method for enhancing boundary samples of power system security domain based on transfer learning according to claim 1, characterized in that, The target security domain boundary features include the predicted target boundary normal vector and the predicted target boundary intercept; The step of inputting the target graph structure data into a preset transfer learning model and outputting the predicted target security domain boundary features includes: Based on the topological connection matrix in the target graph structure data, determine the node adjacency set of each node in the target graph structure data; The features of the neighboring nodes in the set of adjacent nodes, the attention weights corresponding to the neighboring nodes, and the trainable weight matrix are multiplied and summed. The summation result is processed using a nonlinear activation function to obtain the updated node features; By propagating through multi-layer graph attention and using graph pooling operations to aggregate the features of each node into the overall features of the entire power grid fault scenario, a fault scenario graph embedding is obtained. Using the boundary feature prediction layer in the transfer learning model, the predicted target boundary normal vector and the predicted target boundary intercept are output based on the fault scene graph embedding.

6. The method for enhancing boundary samples of power system security domain based on transfer learning according to claim 1, characterized in that, The step of generating candidate security domain boundaries based on the predicted target security domain boundary features includes: Select initial samples within the feasible operating region; The initial sample is projected based on the predicted target security domain boundary features; A random perturbation is superimposed on the projection result to generate a candidate boundary sample set for the target fault scenario.

7. The method for enhancing boundary samples of power system security domain based on transfer learning according to claim 1, characterized in that, The step of performing boundary validity verification on the candidate samples of the security domain boundary based on preset physical operation constraint rules includes: obtaining the set of state variables corresponding to the candidate samples of the security domain boundary; Perform variable range verification. If the generator active power output, load change range, and node voltage are all within the upper and lower limits of the allowable threshold, the variable range verification is deemed to have passed. Perform a power flow check. If the power flow convergence residual of the set of state variables is lower than a preset power flow threshold, the power flow check is deemed to have passed. Perform boundary neighborhood verification; if the absolute value of the safety margin function of the set of state variables is less than the boundary neighborhood determination threshold, the boundary neighborhood verification is deemed to have passed. In response to the fact that the candidate sample for the security domain boundary simultaneously passes the variable range verification, the power flow verification, and the boundary neighborhood verification, the candidate sample for the security domain boundary is regarded as an effective enhanced boundary sample.

8. A power system security domain boundary sample enhancement system based on transfer learning, employing the power system security domain boundary sample enhancement method based on transfer learning as described in any one of claims 1-7, characterized in that, include: The data acquisition module is used to acquire target graph structure data under the target fault scenario, wherein the target graph structure data represents the power system topology and operating status characteristics under the target fault scenario; The feature prediction module is used to input the target graph structure data into a preset transfer learning model and output the predicted target security domain boundary features, wherein the preset transfer learning model is used to learn the mapping relationship between the source fault state and the security domain boundary features. The sample generation module is used to generate candidate samples of the security domain boundary based on the predicted target security domain boundary features; The logic verification module is used to perform boundary validity verification on the candidate samples of the security domain boundary based on preset physical operation constraint rules; The result output module is used to output an enhanced boundary sample set in response to the security domain boundary candidate sample passing the boundary validity check.

9. An electronic device, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the power system security domain boundary sample enhancement method based on transfer learning as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the power system security domain boundary sample enhancement method based on transfer learning as described in any one of claims 1 to 7.