A method and system for generating power grid structure data samples

By setting power grid structure parameters and scenario constraints to generate candidate power grid structure diagrams, and by using cosine similarity adjustment and power system document retrieval to expand data, the problem of inaccurate power grid structure data samples in existing technologies is solved, generating high-quality data samples that conform to the target power grid scenario, thereby improving the training effect of power system research and artificial intelligence models.

CN123068894APending Publication Date: 2026-11-10POWER DISPATCHING CONTROL CENT OF GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611242989.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing technologies struggle to generate accurate power grid structure data samples that match the target power grid scenario, resulting in poor training performance of artificial intelligence models. Furthermore, traditional IEEE standard test systems have limited sample size and insufficient network structure complexity.

Method used

Candidate power grid structure diagrams are generated by setting power grid structure parameters and scenario constraints. Cosine similarity is used to adjust the graph structure feature vectors, and power system structure document retrieval extended data is combined to generate power grid structure data samples that conform to the target power grid scenario.

Benefits of technology

This ensures that the generated power grid structure data samples conform to the topology and attribute data of the target power grid scenario, thereby improving the accuracy and richness of the data samples and meeting the needs of power system research and artificial intelligence model learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123068894A_ABST
    Figure CN123068894A_ABST
Patent Text Reader

Abstract

This invention relates to the field of power system structure data generation technology, and in particular to a method and system for generating power grid structure data samples. The method sets power grid structure parameters and scenario constraints based on a target power grid scenario; generates candidate power grid structure diagrams and adjusts these diagrams using scenario constraints to obtain an initial power grid structure diagram; acquires the graph structure feature vector of the initial power grid structure diagram, analyzes the cosine similarity between the graph structure feature vector and the baseline structure feature vector, and determines if the cosine similarity exceeds a preset cosine similarity threshold; generates a structure data document based on the initial power grid structure diagram and the graph structure feature vector, and then generates a query text vector to retrieve extended data that meets the scenario constraints from the power system structure document; and combines the structure data document and the extended data to generate power grid structure data samples, thus generating more accurate and effective power grid structure data samples when relevant real power grid structure data is difficult to disclose.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system structure data generation technology, and in particular to a method and system for generating power grid structure data samples. Background Technology

[0002] In recent years, with the deepening research of artificial intelligence technology in the field of power grid simulation and analysis, and the increasing integration of new energy sources, expansion of power grid scale, and increased complexity of power grid structure, power system analysis increasingly relies on power grid structure data that can be used for model training, verification, and demonstration. However, real power grid structure data is confidential due to security, privacy, and critical infrastructure protection reasons, making it difficult to obtain directly and use for research. On the other hand, traditional IEEE standard test systems have limited sample size and insufficient network structure complexity, making it difficult to support artificial intelligence models in learning power grid topology relationships of different scales and granularities. In practical applications, the training of most artificial intelligence models requires massive samples, and to avoid overfitting and underfitting, there are also certain requirements for the distribution of samples. Furthermore, the required sample sets need to have different topological and structural characteristics for different target power grid scenarios.

[0003] To address these issues, existing technologies typically employ random generation to obtain power grid data training sample sets. However, the power grid structures generated by existing random generation methods are prone to inconsistencies with the target power grid scenario. They may introduce nodes or edges that should not exist in the target power grid scenario, or data that does not match the bus type, edge type, or legend rules of the target power grid scenario. Ultimately, this results in inaccurate power grid structure data samples, making it difficult to obtain effective samples that can be used for power system research and artificial intelligence model learning tasks. Summary of the Invention

[0004] This invention aims to provide a method and system for generating power grid structure data samples. When a user specifies a target power grid scenario, but relevant real power grid structure data is difficult to disclose, it generates effective power grid structure data samples that can be used for power system research and artificial intelligence model learning tasks, thereby improving the accuracy of power grid structure data samples.

[0005] To address the aforementioned technical problems, the first aspect of this invention provides a method for generating power grid structure data samples, comprising the following steps: Determine the target power grid scenario, and set power grid structure parameters and scenario constraints based on the target power grid scenario; A candidate power grid structure diagram is generated based on the power grid structure parameters, and then the candidate power grid structure diagram is constrained and adjusted by the scenario constraints to obtain an initial power grid structure diagram; Obtain the graph structure feature vector of the initial power grid structure diagram, and obtain the baseline structure feature vector of the target power grid scenario; Analyze the cosine similarity between the graph structure feature vector and the baseline structure feature vector. If the cosine similarity is less than a preset cosine similarity threshold, then re-obtain the initial power grid structure graph based on the power grid structure parameters and the scenario constraints until the cosine similarity of the initial power grid structure graph is greater than or equal to the preset cosine similarity threshold. When the cosine similarity is greater than or equal to a preset cosine similarity threshold, a structural data document is generated based on the initial power grid structure diagram and the graph structure feature vector. A query text vector is generated based on the structural data document, and then extended data that meets the scenario constraints is retrieved from the preset power system structure document through the query text vector. A power grid structure data sample is generated by combining the structure data document and the extended data.

[0006] The aforementioned method for generating power grid structure data samples uses power grid structure parameters as the target guide for data generation, generates candidate power grid structure diagrams, and uses scenario constraints as structural boundary conditions to constrain and adjust the candidate power grid structure diagrams to obtain an initial power grid structure diagram. This ensures that the generated initial power grid topology is reasonable and avoids randomly generating power grid structures that do not conform to the target power grid scenario. Then, cosine similarity analysis is performed between the graph structure feature vector of the initial power grid structure diagram and the baseline structure feature vector of the target power grid scenario. If the cosine similarity does not exceed a preset similarity threshold, the generated initial power grid structure diagram is discarded, and the above steps are repeated to generate a new initial power grid structure diagram. This process continues until the cosine similarity of the generated initial power grid structure diagram exceeds the preset similarity threshold, ensuring that the generated initial power grid structure diagram fits the baseline topology of the target power grid scenario and preventing the generation of invalid samples that differ too much from the target power grid scenario.

[0007] Finally, extended data that meets the scenario constraints is retrieved from the preset power system structure document, thereby introducing external power knowledge related to the initial power grid structure diagram and supplementing the content and knowledge details not covered in the structure data document. The power grid structure data sample is generated by combining the structure data document and the extended data, so that the final generated sample not only has a reasonable topology structure that conforms to the specified target power grid scenario, but also contains detailed attribute data corresponding to the topology structure, improving the data volume and data richness of the power grid structure data sample. Thus, while ensuring the accuracy of the generated power grid structure data sample, it meets the data sample requirements of power system research and artificial intelligence model learning tasks.

[0008] Further, the step of generating a candidate power grid structure diagram based on the power grid structure parameters, and then adjusting the candidate power grid structure diagram through the scenario constraints to obtain an initial power grid structure diagram, includes: Based on the power grid structure parameters, obtain the power grid type, the total number of subgrids, the total number of generating bus nodes, and the total number of load bus nodes; Random nodes and random edges are generated based on the power grid type, the total number of subnetworks, the total number of generating bus nodes, and the total number of load bus nodes. The topology is then constructed using the random nodes and random edges to generate the candidate power grid structure diagram. Based on the scenario constraints, obtain the power generation load bus ratio constraints and edge node ratio constraints; The nodes and edges in the candidate power grid structure diagram are adjusted to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint and the edge node ratio constraint, and that there is a connection path between any two nodes in the initial power grid structure diagram.

[0009] In this implementation, a candidate power grid structure graph with the basic scale of the target scenario is constructed using random nodes and random edges based on power grid structure parameters such as power grid type, total number of subgrids, and total number of generation and load bus nodes. Then, generation-load bus ratio constraints and edge node ratio constraints are introduced as scenario boundary conditions to supplement or delete edges in the candidate graph and adjust the nodes to ensure that the topology of the generated initial power grid structure graph conforms to the structural characteristics of the target power grid scenario and guarantees the global connectivity of the power grid topology, rather than simply generating a random graph that meets the requirements for the number of nodes and edges. This improves the accuracy of power grid structure data samples when real power grid structure data is difficult to disclose.

[0010] Further, adjusting the nodes and edges in the candidate power grid structure diagram to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint and the edge node ratio constraint, and ensures that there is a connection path between any two nodes in the initial power grid structure diagram, includes: Obtain the actual power grid topology data corresponding to the target power grid scenario; By superimposing bounded disturbances onto the actual power grid topology data, a desensitization constraint interval is obtained. The nodes and edges in the candidate power grid structure diagram are adjusted to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint, the edge node ratio constraint, and the desensitization constraint interval, and that there is a connection path between any two nodes in the initial power grid structure diagram.

[0011] It should be noted that in scenarios where real power grid statistics are accessible but the actual structure cannot be publicly disclosed, these statistics are confidential due to security, privacy, and critical infrastructure protection reasons, and therefore cannot be directly used for AI model learning tasks. To address this, this implementation overlays bounded perturbations onto the actual power grid topology data to construct a desensitized constraint interval. This interval reflects the data characteristics of the real power grid while avoiding direct exposure of the actual statistical data through the overlay of bounded perturbations. This approach, while protecting the privacy of the real power grid data, adds a desensitized constraint interval as a boundary for generating the initial power grid structure diagram. This ensures that the generated power grid structure sample does not deviate from the physical laws and structural characteristics of the real power grid, avoiding the inaccuracy of randomly generated data samples and improving the accuracy of the generated samples.

[0012] Further, obtaining the graph structure feature vector of the initial power grid structure graph and obtaining the baseline structure feature vector of the target power grid scenario includes: obtaining the total number of node pairs and the path length of each node pair in the initial power grid structure graph, and obtaining the average path length of the initial power grid structure graph based on the total number of node pairs and the path length of each node pair; Obtain the clustering coefficient of each node in the initial power grid structure diagram, and obtain the average clustering coefficient of the initial power grid structure diagram based on the clustering coefficient of each node; Obtain the degree of each node in the initial power grid structure diagram, and obtain the average node degree of the initial power grid structure diagram based on the degree of each node; The proximity centrality of each node in the initial power grid structure diagram is obtained, and the average proximity centrality of the initial power grid structure diagram is obtained based on the proximity centrality of each node. The average path length, average clustering coefficient, average node degree, and average proximity centrality of the initial power grid structure graph are concatenated to form the graph structure feature vector; Obtain the baseline power grid structure of the target power grid scenario, and then obtain the average path length, average clustering coefficient, average node degree, and average proximity centrality of the baseline power grid structure. The average path length, average clustering coefficient, average node degree, and average proximity centrality of the benchmark power grid structure are concatenated to form the feature vector of the benchmark structure.

[0013] In this implementation, average path length reflects global transmission efficiency, average clustering coefficient characterizes local clustering, average node degree reflects node connectivity activity, and average proximity centrality measures the importance of central nodes. By calculating the average path length, average clustering coefficient, average node degree, and average proximity centrality of the initial power grid structure diagram and the benchmark power grid structure respectively, and concatenating them into a graph structure feature vector, the characteristics of the power grid topology in both macroscopic structure and microscopic connection patterns can be reflected. This allows for the measurement of the difference between the initial power grid structure diagram and the benchmark topology through cosine similarity calculation, ensuring that the generated initial power grid structure diagram fits the benchmark topology of the target power grid scenario, preventing the generation of invalid samples that differ excessively from the target power grid scenario, and improving the accuracy of the generated samples.

[0014] Further, when the cosine similarity is greater than or equal to a preset cosine similarity threshold, a structural data document is generated based on the initial power grid structure diagram and the graph structure feature vector; a query text vector is generated based on the structural data document; and then, extended data satisfying the scenario constraints is retrieved from the preset power system structure document using the query text vector, including: Based on the initial power grid structure diagram and the graph structure feature vector, a basic data document and a structure description text are generated as the structure data document; The basic data document and the structure description text are used to construct a total query text, and then the total query text is decomposed into several sub-query texts according to the query type. Each subquery text is vectorized into a subquery vector, which is used as the query text vector; Several knowledge block texts are extracted from the power system structure document, and then each knowledge block text is vectorized into a knowledge block vector. For any subquery vector, the semantic similarity between the subquery vector and each knowledge block vector is obtained, and then the knowledge block vectors with semantic similarity exceeding a preset semantic similarity threshold are selected as the retrieval context set of the subquery vector. The extended data is generated based on the retrieval context set corresponding to each subquery vector.

[0015] In this implementation, a semantic retrieval mechanism transforms abstract topological features into computable textual semantics. This allows for the retrieval enhancement generation mechanism to obtain extended information such as equipment parameters and operating rules that match the current topology from power system structure documents. This supplements the missing physical attributes and business logic details in the power grid structure data, thereby improving the richness of the generated sample data.

[0016] Furthermore, after generating the power grid structure data sample by combining the structure data document and the extended data, the process further includes: Several power grid structure data samples are generated for the target power grid scenario; Based on the scenario constraints, obtain topological rule constraints, semantic rule constraints, and visualization rule constraints; The rule violation cost value of each power grid structure data sample is calculated based on the topological rule constraints, the semantic rule constraints, and the visualization rule constraints. The final sample is obtained by filtering the power grid structure data samples whose default cost corresponding to the rule is less than a preset cost threshold.

[0017] In this implementation, topology rules are used to constrain node connection relationships and subnet boundaries, semantic rules are used to constrain legend descriptions and bus role distinctions, and visualization rules are used to constrain critical line styles and image styles. After generating power grid structure data samples, topology rule constraints, semantic rule constraints, and visualization rule constraints are introduced for multi-dimensional rule verification, and the rule violation cost value of each sample is calculated. Samples with violation cost values ​​lower than a preset cost threshold are then selected as the final samples. This effectively eliminates inferior samples with electrical logic errors, attribute conflicts, or non-standard display, ensuring that the final output sample set meets the actual engineering standards and visualization requirements of the target power system research and artificial intelligence model learning tasks.

[0018] A second aspect of the present invention provides a power grid structure data sample generation system, comprising: The scene data acquisition module is used to determine the target power grid scene and set power grid structure parameters and scene constraints based on the target power grid scene; The power grid structure generation module is used to generate candidate power grid structure diagrams based on the power grid structure parameters, and then adjust the candidate power grid structure diagrams by means of the scenario constraints to obtain an initial power grid structure diagram; The power grid structure data analysis module is used to obtain the graph structure feature vector of the initial power grid structure diagram and the reference structure feature vector of the target power grid scenario, and then analyze the cosine similarity between the graph structure feature vector and the reference structure feature vector. If the cosine similarity is less than a preset cosine similarity threshold, the initial power grid structure diagram is re-obtained according to the power grid structure parameters and the scenario constraints until the cosine similarity of the initial power grid structure diagram is greater than or equal to the preset cosine similarity threshold. The data expansion module is used to generate a structural data document based on the initial power grid structure diagram and the graph structure feature vector when the cosine similarity is greater than or equal to a preset cosine similarity threshold, generate a query text vector based on the structural data document, and then retrieve expanded data that meets the scenario constraints in the preset power system structure document through the query text vector; The sample generation module is used to generate a power grid structure data sample by combining the structure data document and the extended data.

[0019] Further, the step of generating a candidate power grid structure diagram based on the power grid structure parameters, and then adjusting the candidate power grid structure diagram through the scenario constraints to obtain an initial power grid structure diagram, includes: Based on the power grid structure parameters, obtain the power grid type, the total number of subgrids, the total number of generating bus nodes, and the total number of load bus nodes; Random nodes and random edges are generated based on the power grid type, the total number of subnetworks, the total number of generating bus nodes, and the total number of load bus nodes. The topology is then constructed using the random nodes and random edges to generate the candidate power grid structure diagram. Based on the scenario constraints, obtain the power generation load bus ratio constraints and edge node ratio constraints; The nodes and edges in the candidate power grid structure diagram are adjusted to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint and the edge node ratio constraint, and that there is a connection path between any two nodes in the initial power grid structure diagram.

[0020] Further, adjusting the nodes and edges in the candidate power grid structure diagram to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint and the edge node ratio constraint, and ensures that there is a connection path between any two nodes in the initial power grid structure diagram, includes: Obtain the actual power grid topology data corresponding to the target power grid scenario; By superimposing bounded disturbances onto the actual power grid topology data, a desensitization constraint interval is obtained. The nodes and edges in the candidate power grid structure diagram are adjusted to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint, the edge node ratio constraint, and the desensitization constraint interval, and that there is a connection path between any two nodes in the initial power grid structure diagram.

[0021] Further, obtaining the graph structure feature vector of the initial power grid structure graph and obtaining the baseline structure feature vector of the target power grid scenario includes: obtaining the total number of node pairs and the path length of each node pair in the initial power grid structure graph, and obtaining the average path length of the initial power grid structure graph based on the total number of node pairs and the path length of each node pair; Obtain the clustering coefficient of each node in the initial power grid structure diagram, and obtain the average clustering coefficient of the initial power grid structure diagram based on the clustering coefficient of each node; Obtain the degree of each node in the initial power grid structure diagram, and obtain the average node degree of the initial power grid structure diagram based on the degree of each node; The proximity centrality of each node in the initial power grid structure diagram is obtained, and the average proximity centrality of the initial power grid structure diagram is obtained based on the proximity centrality of each node. The average path length, average clustering coefficient, average node degree, and average proximity centrality of the initial power grid structure graph are concatenated to form the graph structure feature vector; Obtain the baseline power grid structure of the target power grid scenario, and then obtain the average path length, average clustering coefficient, average node degree, and average proximity centrality of the baseline power grid structure. The average path length, average clustering coefficient, average node degree, and average proximity centrality of the benchmark power grid structure are concatenated to form the feature vector of the benchmark structure. Attached Figure Description

[0022] Figure 1 This is a flowchart illustrating a method for generating power grid structure data samples according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a power grid structure data sample generation system provided in an embodiment of the present invention. Detailed Implementation

[0023] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be noted that the following detailed descriptions are exemplary and intended to provide further detailed explanation of the invention. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used herein in the specification is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings are used to distinguish different objects, not to describe a particular order.

[0024] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0025] Before describing this application in detail with reference to the accompanying drawings and embodiments, the technical background of this application will first be explained.

[0026] This invention aims to provide a method and system for generating power grid structure data samples. When a user specifies a target power grid scenario, but relevant real power grid structure data is difficult to disclose, it generates effective power grid structure data samples that can be used for power system research and artificial intelligence model learning tasks, thereby improving the accuracy of power grid structure data samples.

[0027] Please refer to Figure 1 To address the aforementioned technical problems, the first aspect of this invention provides a method for generating power grid structure data samples, comprising the following steps: S1. Determine the target power grid scenario, and set power grid structure parameters and scenario constraints based on the target power grid scenario; S2. Generate a candidate power grid structure diagram based on the power grid structure parameters, and then adjust the candidate power grid structure diagram by means of the scenario constraints to obtain an initial power grid structure diagram; S3. Obtain the graph structure feature vector of the initial power grid structure diagram, and obtain the baseline structure feature vector of the target power grid scenario; S4. Analyze the cosine similarity between the graph structure feature vector and the reference structure feature vector. If the cosine similarity is less than a preset cosine similarity threshold, then re-obtain the initial power grid structure graph based on the power grid structure parameters and the scenario constraints until the cosine similarity of the initial power grid structure graph is greater than or equal to the preset cosine similarity threshold. S5. When the cosine similarity is greater than or equal to a preset cosine similarity threshold, a structural data document is generated based on the initial power grid structure diagram and the graph structure feature vector. A query text vector is generated based on the structural data document, and then extended data that meets the scenario constraints is retrieved in the preset power system structure document through the query text vector. S6. Generate a power grid structure data sample by combining the structure data document and the extended data.

[0028] The power system structure document is a pre-built external power knowledge base. Its sources may include internationally recognized IEEE standard test system database documents, professional literature documents in the power field, or power information knowledge base documents. It records different standard power grid topology data and extended data information such as equipment parameters and operating rules that match the relevant topology.

[0029] Specifically, the above-mentioned power grid structure data sample generation method receives power grid structure parameters input by the user, first generates an initial power grid structure diagram, and then adjusts the nodes and edges in the initial power grid structure diagram according to scenario constraints; subsequently, it calculates the graph structure feature vector of the initial power grid structure diagram and compares it with the baseline structure feature vector of the target power grid scenario. If the preset cosine similarity threshold is not met, it automatically returns to regenerate; if it is met, it outputs the edge index, node features, and structure data document, and performs fine-grained attribute expansion of bus nodes and lines through a retrieval enhancement generation mechanism; finally, it combines the structure data document and the expanded data to generate multi-style power grid structure data samples by a large language model, thereby automatically generating structurally accurate power grid structure data samples when real power grid topology data is difficult to disclose.

[0030] In one optional embodiment, the cosine similarity threshold can be preset to a fixed threshold; for target power grid scenarios with high network structure complexity, a higher cosine similarity threshold can be set. In another preferred embodiment, several candidate power grid structure diagrams can be pre-generated, and the cosine similarity between their graph structure feature vectors and the baseline structure feature vectors can be calculated to obtain a historical cosine similarity distribution set; then, a preset cosine similarity threshold is determined based on the historical cosine similarity distribution set. For example, for the target power grid scenario, M candidate power grid structure diagrams are generated, and the cosine similarity distribution between their graph structure feature vectors and the baseline structure feature vectors is calculated. The p-quantile of this distribution is taken as the preset cosine similarity threshold. For example, taking the 20th percentile can retain approximately 80% of the candidate samples for subsequent processes, thereby achieving a balance between the accuracy and the number of generated power grid structure data samples.

[0031] The aforementioned method for generating power grid structure data samples uses power grid structure parameters as the target guide for data generation, generates candidate power grid structure diagrams, and uses scenario constraints as structural boundary conditions to constrain and adjust the candidate power grid structure diagrams to obtain an initial power grid structure diagram. This ensures that the generated initial power grid topology is reasonable and avoids randomly generating power grid structures that do not conform to the target power grid scenario. Then, cosine similarity analysis is performed between the graph structure feature vector of the initial power grid structure diagram and the baseline structure feature vector of the target power grid scenario. If the cosine similarity does not exceed a preset similarity threshold, the generated initial power grid structure diagram is discarded, and the above steps are repeated to generate a new initial power grid structure diagram. This process continues until the cosine similarity of the generated initial power grid structure diagram exceeds the preset similarity threshold, ensuring that the generated initial power grid structure diagram fits the baseline topology of the target power grid scenario and preventing the generation of invalid samples that differ too much from the target power grid scenario.

[0032] Finally, extended data that meets the scenario constraints is retrieved from the preset power system structure document, thereby introducing external power knowledge related to the initial power grid structure diagram and supplementing the content and knowledge details not covered in the structure data document. The power grid structure data sample is generated by combining the structure data document and the extended data, so that the final generated sample not only has a reasonable topology structure that conforms to the specified target power grid scenario, but also contains detailed attribute data corresponding to the topology structure, improving the data volume and data richness of the power grid structure data sample. Thus, while ensuring the accuracy of the generated power grid structure data sample, it meets the data sample requirements of power system research and artificial intelligence model learning tasks.

[0033] Further, the step of generating a candidate power grid structure diagram based on the power grid structure parameters, and then adjusting the candidate power grid structure diagram through the scenario constraints to obtain an initial power grid structure diagram, includes: Based on the power grid structure parameters, obtain the power grid type, the total number of subgrids, the total number of generating bus nodes, and the total number of load bus nodes; Random nodes and random edges are generated based on the power grid type, the total number of subnetworks, the total number of generating bus nodes, and the total number of load bus nodes. The topology is then constructed using the random nodes and random edges to generate the candidate power grid structure diagram. Based on the scenario constraints, obtain the power generation load bus ratio constraints and edge node ratio constraints; The nodes and edges in the candidate power grid structure diagram are adjusted to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint and the edge node ratio constraint, and that there is a connection path between any two nodes in the initial power grid structure diagram.

[0034] In this implementation, a candidate power grid structure graph with the basic scale of the target scenario is constructed using random nodes and random edges based on power grid structure parameters such as power grid type, total number of subgrids, and total number of generation and load bus nodes. Then, generation-load bus ratio constraints and edge node ratio constraints are introduced as scenario boundary conditions to supplement or delete edges in the candidate graph and adjust the nodes to ensure that the topology of the generated initial power grid structure graph conforms to the structural characteristics of the target power grid scenario and guarantees the global connectivity of the power grid topology, rather than simply generating a random graph that meets the requirements for the number of nodes and edges. This improves the accuracy of power grid structure data samples when real power grid structure data is difficult to disclose.

[0035] In a preferred embodiment, the power grid structure parameters are obtained through user input and parameter preprocessing. For a target power grid scenario, the user inputs power grid generation parameters via a web interface or local program. These parameters include power grid type, total number of bus nodes, number of subnets, image style, random seed, similarity threshold, and maximum number of regenerations. The power grid type can be a distribution network, a combined transmission and distribution network, or a user-defined combination. The image style can be force-directed style, IEEE style, fine-grained bus style, or a combination thereof.

[0036] The system verifies the validity of the power grid generation parameters. In one specific embodiment, the total number of bus nodes ranges from 25 to 100, the number of subnets ranges from 3 to 9, the sum of the number of bus nodes in each subnet must equal the total number of bus nodes, and the number of bus nodes in each subnet must be greater than or equal to 2. If any validity constraint is not met, the user is required to re-enter the parameters, thereby ensuring that the subsequent topology generation process has an executable structural foundation.

[0037] Then, when generating the candidate power grid structure diagram, the power grid to be generated is defined as a graph composed of a set of bus nodes and a set of line edges. For a combined power grid composed of multiple sub-networks, the total set of bus nodes is equal to the union of the set of bus nodes of each sub-network, and the total set of line edges is equal to the union of the set of line edges of each sub-network. Each sub-network itself also constitutes a subgraph composed of the set of bus nodes and the set of line edges of that sub-network. Each bus node has attributes such as node number, sub-network number, bus type, capacity weight, and visualization label. Each line edge has attributes such as edge number, edge type, sub-network number, and line weight. The bus type includes at least generating bus nodes and load bus nodes, and the edge type includes at least three types of connection relationships: between generating bus nodes, between load bus nodes, and between generating bus nodes and load bus nodes. When constructing the candidate power grid structure diagram, firstly, the set of generating bus nodes and the set of load bus nodes in each subnet are allocated according to the ratio of the target generating bus nodes to the load bus nodes. Then, a connected spanning tree is generated for each subnet to ensure that any two bus nodes in the subnet are reachable. Finally, random edges are added within the range that satisfies the edge node ratio constraint, and the number ratio of the three types of edges is recorded.

[0038] Furthermore, after the candidate power grid structure diagram is generated, the power grid generation parameters, along with fields such as scenario description, privacy level, and audit strategy, are uniformly encapsulated into a standardized task description object, which serves as the verification object for subsequent topology generation, quality evaluation, retrieval enhancement, and visualization code generation. The unified structural constraint object is composed of a set of bus nodes, a set of line edges, a node feature table, an edge index table, a set of bus types, a set of edge types, subnetting, topology evaluation indicators, and visualization constraints. The visualization constraints at least include node color, edge style, legend rules, node numbering display rules, and image style. The unified structural constraint object serves as the common verification source for subsequent retrieval enhancement query generation, structure description generation, visualization code generation, and consistency verification.

[0039] Simultaneously, fields such as scenario type, required bus role, critical line, redundancy level, and output purpose are encapsulated into scenario constraint objects to drive subsequent scenario rule compilation. The scenario type may include renewable energy access, fault recovery, transmission and distribution coordination, teaching and training, model robustness evaluation, etc.; the required bus role may include roles such as relaxation bus node, generation bus node, load bus node, renewable energy bus node, tie bus node, and switch bus node. If it is only necessary to distinguish between generation bus node and load bus node, the extended role can be mapped to a sub-label of the basic bus type and saved as a role label field in the node features.

[0040] In a specific target power grid scenario embodiment, when adjusting the nodes and edges in the candidate power grid structure diagram to obtain the initial power grid structure diagram, the following power grid structure constraints are mainly applied as scenario constraints: First, the ratio of the number of generating bus nodes to the number of load bus nodes should be approximately equal to one to five, that is, the number of generating bus nodes in each subnet is about one-fifth of the number of load bus nodes; Second, each subnet should have at least one generating bus node to undertake the function of a slack node; Third, each subnet must remain connected, that is, there must be a reachable path between any two bus nodes in the subnet; Fourth, the ratio of the total number of edges to the total number of nodes should be within the edge-to-node ratio range of the corresponding target scenario.

[0041] In engineering implementation, a power generation / load ratio tolerance parameter and a side node ratio tolerance parameter can be set. It is required that the absolute difference between the actual ratio of the number of power generation bus nodes to the number of load bus nodes and the target value does not exceed the power generation / load ratio tolerance parameter, and the absolute difference between the actual side node ratio and the target value does not exceed the side node ratio tolerance parameter.

[0042] Furthermore, if the degree of a certain bus node does not meet the minimum degree required for that bus node type, the system selects a bus node from the candidate node set and adds a new edge connecting the bus node to the candidate power grid structure diagram, provided that no duplicate edges are formed, connectivity constraints are not violated, and edge-to-node ratio constraints are not violated. The candidate bus nodes are preferentially selected from bus nodes of different bus types in the same subnet that are not already connected to the current bus node. For generating bus nodes or relaxed bus nodes, their selection probability can be increased, so that the generated result conforms to the common sense of power grids that the average degree of generating bus nodes is higher than that of load bus nodes, thereby avoiding the generation of a power grid structure that does not conform to the distribution law of bus roles in the target power grid scenario.

[0043] Further, adjusting the nodes and edges in the candidate power grid structure diagram to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint and the edge node ratio constraint, and ensures that there is a connection path between any two nodes in the initial power grid structure diagram, includes: Obtain the actual power grid topology data corresponding to the target power grid scenario; By superimposing bounded disturbances onto the actual power grid topology data, a desensitization constraint interval is obtained. The nodes and edges in the candidate power grid structure diagram are adjusted to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint, the edge node ratio constraint, and the desensitization constraint interval, and that there is a connection path between any two nodes in the initial power grid structure diagram.

[0044] It should be noted that in scenarios where real power grid statistics are accessible but the actual structure cannot be publicly disclosed, these statistics are confidential due to security, privacy, and critical infrastructure protection reasons, and therefore cannot be directly used for AI model learning tasks. To address this, this implementation overlays bounded perturbations onto the actual power grid topology data to construct a desensitized constraint interval. This interval reflects the data characteristics of the real power grid while avoiding direct exposure of the actual statistical data through the overlay of bounded perturbations. This approach, while protecting the privacy of the real power grid data, adds a desensitized constraint interval as a boundary for generating the initial power grid structure diagram. This ensures that the generated power grid structure sample does not deviate from the physical laws and structural characteristics of the real power grid, avoiding the inaccuracy of randomly generated data samples and improving the accuracy of the generated samples.

[0045] Specifically, the anonymized constraint interval is obtained through a privacy statistical sketch construction and real feature transfer process based on actual power grid topology data. The constructed privacy statistical sketch does not save real node numbers, real line connections, real geographical coordinates, and real device names, but only saves the statistical characteristics, proportion ranges, and perturbed indicators after binning. The privacy statistical sketch is jointly composed of degree distribution histogram binning, bus type proportion range, edge type proportion range, shortest path length range, clustering coefficient range, and anonymized subnet size range.

[0046] For any real power grid statistic in the actual power grid topology data, the system superimposes a bounded disturbance generated by a uniform, Gaussian, or Laplace distribution on the original value, and then restricts the result to a reasonable engineering range through a truncation function to obtain a desensitized statistic. Subsequently, the topology generation target is no longer compared with a single benchmark power grid structure, but with the desensitized statistical range specified by the privacy statistical sketch. That is, any statistic of the synthetic power grid structure map must fall between the lower and upper limits of the desensitized statistical range, so that the desensitized statistical range becomes the legal boundary of the synthetic power grid statistical features.

[0047] Furthermore, when multiple statistics are involved in the constraints simultaneously, the system compares the actual value of each statistic with its upper and lower limits for desensitization, takes the portion exceeding the interval as the deviation amount, and sums the deviation amounts of all statistics to obtain the total interval deviation of the generated power grid structure diagram relative to the privacy statistical sketch. When the total interval deviation is equal to zero or less than the preset tolerance, it is considered that the synthesized power grid structure diagram inherits the statistical characteristics of the real power grid but does not expose the real connection relationship; otherwise, the system will readjust the generation strategy based on the deviation items until the total interval deviation falls within an acceptable range.

[0048] Further, obtaining the graph structure feature vector of the initial power grid structure graph and obtaining the baseline structure feature vector of the target power grid scenario includes: obtaining the total number of node pairs and the path length of each node pair in the initial power grid structure graph, and obtaining the average path length of the initial power grid structure graph based on the total number of node pairs and the path length of each node pair; Obtain the clustering coefficient of each node in the initial power grid structure diagram, and obtain the average clustering coefficient of the initial power grid structure diagram based on the clustering coefficient of each node; Obtain the degree of each node in the initial power grid structure diagram, and obtain the average node degree of the initial power grid structure diagram based on the degree of each node; The proximity centrality of each node in the initial power grid structure diagram is obtained, and the average proximity centrality of the initial power grid structure diagram is obtained based on the proximity centrality of each node. The average path length, average clustering coefficient, average node degree, and average proximity centrality of the initial power grid structure graph are concatenated to form the graph structure feature vector; Obtain the baseline power grid structure of the target power grid scenario, and then obtain the average path length, average clustering coefficient, average node degree, and average proximity centrality of the baseline power grid structure. The average path length, average clustering coefficient, average node degree, and average proximity centrality of the benchmark power grid structure are concatenated to form the feature vector of the benchmark structure.

[0049] In this implementation, average path length reflects global transmission efficiency, average clustering coefficient characterizes local clustering, average node degree reflects node connectivity activity, and average proximity centrality measures the importance of central nodes. By calculating the average path length, average clustering coefficient, average node degree, and average proximity centrality of the initial power grid structure diagram and the benchmark power grid structure respectively, and concatenating them into a graph structure feature vector, the characteristics of the power grid topology in both macroscopic structure and microscopic connection patterns can be reflected. This allows for the measurement of the difference between the initial power grid structure diagram and the benchmark topology through cosine similarity calculation, ensuring that the generated initial power grid structure diagram fits the benchmark topology of the target power grid scenario, preventing the generation of invalid samples that differ excessively from the target power grid scenario, and improving the accuracy of the generated samples.

[0050] Specifically, the cosine similarity between the graph structure feature vector and the baseline structure feature vector is determined as follows: the average shortest path length, average clustering coefficient, average node degree, and average proximity centrality of the baseline power grid structure are concatenated to form the baseline feature vector, and the corresponding indicators of the initial power grid structure graph are concatenated to form the generated feature vector. The cosine similarity is equal to the inner product of the baseline feature vector and the generated feature vector divided by the product of their respective moduli. When the cosine similarity is less than the preset cosine similarity threshold, it is determined to be a low-quality sample and regeneration is triggered. When the cosine similarity is greater than or equal to the preset cosine similarity threshold, the initial power grid structure graph is allowed to enter the structure data document generation and retrieval enhancement and expansion stage.

[0051] The average shortest path length is equal to the sum of the shortest path lengths between all different bus node pairs in the initial power grid structure diagram, divided by the total number of bus node pairs. The average clustering coefficient is equal to the sum of the clustering coefficients of all bus nodes, divided by the total number of bus nodes, where each clustering coefficient is twice the actual number of edges between the neighboring nodes of that bus node, divided by the maximum possible number of edges between the neighboring nodes of that bus node. The average node degree is equal to the sum of the degrees of all bus nodes, divided by the total number of bus nodes. The proximity centrality of a bus node is equal to the reciprocal of the sum of the shortest path lengths from that bus node to all other bus nodes, and the average proximity centrality of the entire power grid structure is the average of the proximity centralities of all bus nodes. When the degree of a bus node is less than two, the clustering coefficient of that bus node can be treated as zero or not included in the average.

[0052] Furthermore, the average shortest path length, average clustering coefficient, average node degree, and average proximity centrality of the benchmark power grid structure can be derived from publicly available power grid structure data, or from the anonymized statistical interval specified by a privacy statistical sketch obtained by superimposing bounded perturbations on the statistical characteristics of the real power grid. This approach preserves the statistical regularity of the real power grid while avoiding direct exposure of the real power grid topology.

[0053] In a preferred embodiment, the system outputs a failure reason vector when the cosine similarity does not meet the preset cosine similarity threshold, explaining the specific reasons why low-quality samples failed. The failure reason vector is composed of connectivity failure flags, bus ratio failure flags, node degree failure flags, similarity failure flags, rule failure flags, and privacy statistics interval failure flags. When a failure flag is 1, it indicates that the generated power grid structure diagram has failed the quality evaluation in that dimension. When a failure occurs consecutively, the system does not retry completely randomly, but adjusts the generation strategy based on the failure: if the bus ratio failure flag is 1, the generation / load bus node allocation is adjusted first; if the node degree failure flag is 1, the edge replacement candidate set is adjusted; if the rule failure flag is 1, the system returns to the rule conflict resolution step; if the privacy statistics interval failure flag is 1, the target statistics interval is resampled. Regenerating the initial power grid structure diagram based on the failure reason vector avoids aimless random regeneration and improves the accuracy of the regeneration results.

[0054] Further, when the cosine similarity is greater than or equal to a preset cosine similarity threshold, a structural data document is generated based on the initial power grid structure diagram and the graph structure feature vector; a query text vector is generated based on the structural data document; and then, extended data satisfying the scenario constraints is retrieved from the preset power system structure document using the query text vector, including: Based on the initial power grid structure diagram and the graph structure feature vector, a basic data document and a structure description text are generated as the structure data document; The basic data document and the structure description text are used to construct a total query text, and then the total query text is decomposed into several sub-query texts according to the query type. Each subquery text is vectorized into a subquery vector, which is used as the query text vector; Several knowledge block texts are extracted from the power system structure document, and then each knowledge block text is vectorized into a knowledge block vector. For any subquery vector, the semantic similarity between the subquery vector and each knowledge block vector is obtained, and then the knowledge block vectors with semantic similarity exceeding a preset semantic similarity threshold are selected as the retrieval context set of the subquery vector. The extended data is generated based on the retrieval context set corresponding to each subquery vector.

[0055] In this implementation, a semantic retrieval mechanism transforms abstract topological features into computable textual semantics. This allows for the retrieval enhancement generation mechanism to obtain extended information such as equipment parameters and operating rules that match the current topology from power system structure documents. This supplements the missing physical attributes and business logic details in the power grid structure data, thereby improving the richness of the generated sample data.

[0056] In one possible embodiment, for any subquery vector, the semantic similarity between the subquery vector and each knowledge block vector is sorted from high to low to form a semantic similarity sequence. Then, the k-th semantic similarity in the sequence is selected as the semantic similarity threshold. Finally, the knowledge block vectors corresponding to the first k semantic similarities in the sequence are used as the retrieval context set for the subquery vector. The value of k can be adjusted according to actual application requirements.

[0057] Specifically, after the cosine similarity meets the preset cosine similarity threshold, a basic data document and a structural description text are generated based on the initial power grid structure diagram and the graph structure feature vector. The basic data document includes an edge index table, a node feature table, structural description text, a prompt word record file, and a traceable record file. The fields of the edge index table include source node, target node, edge type, subnet number, and line weight. The fields of the node feature table include node number, bus type, subnet number, degree, capacity weight, and color label. The structural description text records the number of subnets, total number of bus nodes, total number of lines, bus ratio, edge type ratio, statistical evaluation indicators, and visualization style of the initial power grid structure diagram. The prompt word record file records prompt words used for large language model code generation and retrieval enhanced query decomposition. The traceable record file records traceability identifiers, random seeds, rule versions, retrieval evidence versions, code versions, audit results, and counterfactual associations.

[0058] In one specific embodiment, the structural description text is generated according to a fixed template, the template including: The power grid consists of K sub-networks, Nb bus nodes, and |E| lines; The ratio of power generation busbars is NG / Nb, and the ratio of load busbars is NL / Nb; The edge type ratio is GG:LL:GL; The average node degree is D, and the average clustering coefficient is Clu.

[0059] This templated structural description text will serve as input for subsequent search enhancement query construction.

[0060] Preferably, the step of constructing a total query text from the basic data document and the structural description text, and then decomposing the total query text into several sub-query texts according to the query type, includes: decomposing the total query text constructed from the basic data document and the structural description text into several sub-query texts respectively targeting power generation bus nodes, load bus nodes, transmission lines, distribution lines, and legend rules through a large language model proxy. The total query text includes at least structural fields such as bus type set, edge type set, subnet division, node degree statistics, required legend rules, and required visualization style, thereby binding the sub-query texts to a specific initial power grid structure diagram. For example, the sub-query text for power generation bus nodes must include the number of power generation bus nodes, the range of power generation bus node numbers, and legend colors in the current initial power grid structure diagram; the sub-query text for transmission lines must include the edge types, start and end node numbers, and line style requirements in the current initial power grid structure diagram.

[0061] Preferably, the step of extracting several knowledge block texts from the power system structure document and then vectorizing each knowledge block text into a knowledge block vector includes: dividing the power system structure document into several knowledge block texts, using an embedding model to vectorize each knowledge block text to obtain the knowledge block vector, and simultaneously vectorizing each subquery text to obtain the subquery vector; the semantic similarity is equal to the inner product of the subquery vector and the knowledge block vector divided by the product of their respective moduli, and the larger the semantic similarity value, the more semantically relevant the corresponding knowledge block text is to the subquery text; for each subquery vector, the knowledge block vectors are sorted according to the semantic similarity from largest to smallest, and the retrieval contexts corresponding to the top k knowledge block vectors are selected to form the retrieval context set, thereby providing input evidence based on an external power knowledge base for the subsequent large language model to generate data samples, so that the generated content can be based on the retrieved relevant document fragments rather than relying solely on the model's own parameterized knowledge, thereby reducing the risk of illusion in the generated results.

[0062] Preferably, generating the extended data based on the retrieval context set corresponding to each sub-query vector includes: the large language model generating extended data fragments of the corresponding sub-query text based on the retrieval context set, wherein the extended data fragments include bus type, color, line connection method, and legend rules; performing consistency verification after generation, wherein the consistency verification is used to check whether the bus type, line type, and legend items appearing in the extended data fragments are all within the range allowed by the unified structure constraint object. For example, if there is no energy storage bus node in the unified structure constraint object, then neither the extended data fragments nor subsequent data samples may introduce energy storage bus node legends; only extended data fragments that pass the consistency verification can enter the subsequent data sample generation module, thereby reducing the impact of model illusion on the final output results.

[0063] In one specific embodiment, the system establishes an evidence mapping object for each generated extended data fragment. This evidence mapping object comprises a description fragment identifier, a query identifier, a retrieval knowledge block identifier, evidence support, a generated code fragment identifier, and a visual element identifier. It binds the retrieval evidence, generated description fragments, generated code fragments, and final image elements in the retrieval enhancement generation process one-to-one, ensuring that any generated content can be traced back to a specific source of retrieval evidence. For any description fragment, the system vectorizes it using the embedding model and calculates its similarity with all knowledge block vectors, taking the maximum similarity as the evidence support of that description fragment. When the evidence support is less than a preset support threshold, the system marks the description fragment as low-evidence content and requires the large language model to regenerate it or downgrade it to a general description, reducing the risk of unfounded expansion by the large language model in the extended data and improving the accuracy of the extended data.

[0064] Furthermore, after generating the power grid structure data sample by combining the structure data document and the extended data, the process further includes: Several power grid structure data samples are generated for the target power grid scenario; Based on the scenario constraints, obtain topological rule constraints, semantic rule constraints, and visualization rule constraints; The rule violation cost value of each power grid structure data sample is calculated based on the topological rule constraints, the semantic rule constraints, and the visualization rule constraints. The final sample is obtained by filtering the power grid structure data samples whose default cost corresponding to the rule is less than a preset cost threshold.

[0065] In this implementation, topology rules are used to constrain node connection relationships and subnet boundaries, semantic rules are used to constrain legend descriptions and bus role distinctions, and visualization rules are used to constrain critical line styles and image styles. After generating power grid structure data samples, topology rule constraints, semantic rule constraints, and visualization rule constraints are introduced for multi-dimensional rule verification, and the rule violation cost value of each sample is calculated. Samples with violation cost values ​​lower than a preset cost threshold are then selected as the final samples. This effectively eliminates inferior samples with electrical logic errors, attribute conflicts, or non-standard display, ensuring that the final output sample set meets the actual engineering standards and visualization requirements of the target power system research and artificial intelligence model learning tasks.

[0066] Specifically, the scenario constraint object, the task description object, and the domain rule base are input into the rule compiler, which outputs a rule set consisting of four categories of rules: topology rules, semantic rules, visualization rules, and audit rules. The topology rules constrain node connection relationships and subnet boundaries; for example, new energy nodes should be connected to a specified voltage layer or subnet boundary. The semantic rules constrain legend descriptions and bus role differentiation; for example, legend descriptions must distinguish between traditional generators and new energy generators. The visualization rules constrain critical line styles and image styles; for example, critical tie lines should use bold dashed lines. The audit rules constrain counterfactual samples and invariant records; for example, counterfactual samples must indicate perturbation edges and invariants.

[0067] If multiple rules in the rule set conflict, the system resolves them according to priority, hard / soft constraint type, and penalty for violation. Let the satisfaction function of the r-th rule be sat. r (G) takes a value of 1 when the corresponding power grid structure data sample satisfies this rule, otherwise it takes a value of 0; a weight w is set for each rule. r Then the rule default cost Loss_rule(G) is equal to the sum of the products of the weights of each rule and the unmet indications.

[0068] In one possible embodiment, the rule-based default cost values ​​of all power grid structure data samples are sorted from low to high to form a rule-based default cost value sequence. The k-th rule-based default cost value in the sequence is then selected as the cost threshold. Finally, the power grid structure data samples corresponding to the first k rule-based default cost values ​​in the sequence are used as the final samples. The value of k can be adjusted according to actual application requirements.

[0069] In another possible embodiment, the system selects the power grid structure data sample that minimizes the violation cost of the rule from the power grid structure data sample set as the final sample. Furthermore, this optimal power grid structure diagram must simultaneously satisfy two mandatory conditions: connectivity is true and all hard constraint rules are true.

[0070] In a preferred embodiment, after generating a power grid structure data sample by combining the structure data document and the extended data, a counterfactual power grid sample is generated by applying a counterfactual sample generation constraint object to the power grid structure data sample. The counterfactual sample generation constraint object consists of a disturbance type, a disturbance budget, a set of invariant fields, a target label change, and whether auditing is required. The disturbance type may include deleting critical lines, adding tie lines, replacing bus roles, changing subnet boundaries, and increasing the proportion of new energy nodes; the disturbance budget controls the disturbance scale; the set of invariant fields specifies the total number of nodes, the number of subnets, the image style, or the range of bus proportions that must remain unchanged; and the target label change specifies the semantic label changes that the counterfactual sample should undergo relative to the original image.

[0071] Let the original power grid structure diagram corresponding to the power grid structure data sample be the original diagram, and the counterfactual power grid diagram corresponding to the counterfactual power grid sample be the counterfactual diagram. Then, the counterfactual power grid sample must simultaneously satisfy the following three constraints: First, the structural distance between the original diagram and the counterfactual diagram must be less than or equal to the disturbance budget, thereby limiting the scale of structural change of the counterfactual sample relative to the original diagram; Second, the invariant constraint must be true, meaning that the original diagram and the counterfactual diagram must maintain consistency in the fields specified by the invariant field set; Third, the target label change constraint must be equal to the target label change specified in the counterfactual sample generation constraint object, meaning that the counterfactual power grid sample must undergo a specified semantic label change relative to the original diagram. These three constraints together ensure that the counterfactual power grid sample is close to the original power grid structure data sample in topology but changes in semantic label, making it suitable for evaluating the performance of artificial intelligence models.

[0072] For example, in a fault recovery scenario, the system can delete a critical link to form a fault sample, requiring the counterfactual graph to remain connected or marked as an island in the structural description text. In a model evaluation scenario, the system can generate samples with slight topological changes but unchanged image style to detect whether the visual model truly understands the connectivity rather than just memorizing colors or layouts. The counterfactual power grid samples share the same traceable identifier prefix as the power grid structure data samples, and record perturbation edges, perturbation nodes, and invariants in a unified output packet, thereby supporting application scenarios such as counterfactual robustness evaluation of graph neural networks, fault recovery and transfer path teaching, and dispatcher training.

[0073] In a preferred embodiment, generating a power grid structure data sample by combining the structure data document and the extended data specifically includes: The structural data document and the extended data are input into a preset large language model, which generates a multi-style visualized power grid structure diagram based on the structural data document, the extended data, and the edge index table and node feature table therein. In a specific embodiment, the force-directed placement algorithm (Kamada-Kawai) is called on the initial power grid structure diagram to calculate the coordinate positions of each bus node on the two-dimensional plane. The force-directed placement algorithm minimizes the difference between the geometric distance between bus nodes and the shortest path length on the graph, so that the final bus node positions visually reflect the topological proximity relationships of the graph structure.

[0074] In the engineering graph link, the large language model can be required to output Python, Graphviz, or Mermaid code as a power grid structure data sample based on the edge index table, the node feature table, the structure description text, and the extended data. The generated code should include node numbers, bus type colors, edge type styles, legends, and titles. A consistency check is performed before executing the generated code. This consistency check includes: the node set referenced in the generated code must be completely consistent with the node set of the initial power grid structure graph; the edge set referenced in the generated code must be completely consistent with the edge set of the initial power grid structure graph; the legend in the generated code must cover all bus types and edge types appearing in the initial power grid structure graph; and the generated code must not contain node numbers not defined in the initial power grid structure graph.

[0075] If any condition in the consistency check is not met, the system will send an error message to the large language model to regenerate the code; if all conditions are met, the generated code will be executed and the image, code, prompt words, and data file will be output. The error message is an error report formed by extracting inconsistencies from the unified structure constraint object. The error report consists of a list of missing nodes, a list of redundant nodes, a list of missing edges, a list of redundant edges, a list of uncovered bus types, a list of uncovered edge types, and a list of undefined legend items. The large language model will correct the code according to the error report until all conditions of the consistency check are met.

[0076] In a preferred embodiment, not only is the textual consistency of the power grid structure data sample verified, but semantic auditing is also performed on the rendered image. Specifically, elements such as bus nodes, line edges, colors, and legends in the rendered power grid structure data sample image are extracted using image parsing models, optical character recognition, legend recognition, or rendering logs to form an image semantic reverse parsing result. The image semantic reverse parsing result is composed of the set of nodes, edge sets, legend items, color mappings, and label sets identified in the image, and serves as the basis for subsequent comparison with the unified structural constraint object.

[0077] Subsequently, the image semantic reverse parsing results are compared with the unified structural constraint object, wherein: the set of nodes identified in the image must be completely consistent with the set of bus nodes in the unified structural constraint object; the set of edges identified in the image must be completely consistent with the set of line edges in the unified structural constraint object; the legend in the image must cover all bus types and edge types specified in the unified structural constraint object; and the color mapping in the image must be consistent with the visualization constraints. If any of the above conditions are not met, or if there are occlusions, missing labels, unreadable issues due to overlapping edges, inconsistent colors with the legend, or missing evidence sources in the image, the system generates an audit report and re-renders the image to generate a power grid structure data sample.

[0078] The audit report consists of a list of missing image nodes, a list of missing image edges, a list of overlapping labels, a list of inconsistent colors, a list of low-readability areas, and a list of missing evidence items. Based on the audit report, the system automatically adjusts the layout, font size, edge curvature, legend position, or output resolution, and then re-renders the image to generate a power grid structure data sample.

[0079] In a preferred embodiment, a web interface is provided, through which the user selects the power grid type, power grid scale, number of subgrids, and image type to determine the target power grid scenario and generate a power grid structure data sample. The web interface includes a basic data area, an evaluation result area, a visualization area, a code editing area, and a log area. In the code editing area, the user can modify the generated code, the prompt words, or the task description object, triggering the system to re-execute the following processes: re-verify the consistency between the generated code and the basic data document, re-render the image based on the modified code or parameters, and repackage the updated code, image, prompt words, and data file into a unified output package.

[0080] In a preferred embodiment, a traceable identifier is generated for each power grid structure data sample, and the data, description, evidence, code, images, and audit results are encapsulated into a unified output package. The unified output package comprises the traceable identifier, the task description object, the scenario constraint object, the unified structural constraint object, the privacy statistics sketch identifier, the evidence mapping object, a code file set, an image file set, the error report, the audit report, and expert feedback. The unified output package unifies the generation parameters, structural data, retrieved evidence, generated code, generated images, error correction records, and audit results of the power grid structure data sample, facilitating subsequent power system research and artificial intelligence model training.

[0081] Furthermore, the traceable identifier is calculated using the task description object, the random seed, the rule set version, and the timestamp as inputs to a hash function, and is used to uniquely identify the power grid structure data sample. When the unified output package is used to train graph neural networks, visual question answering models, or teaching cases, users can use the traceable identifier to trace back the generation conditions, retrieve evidence, correct records, and audit results. When generating counterfactual power grid samples, the unified output package also records the original graph identifier, counterfactual graph identifier, disturbance type, disturbance budget, and invariants to support the traceability of counterfactual sample pairs.

[0082] In one specific embodiment, the Gemini Pro API is used as the large language model interface, LangChain is used to implement the large language model proxy, Chroma is used as the vector database in the retrieval enhancement generation, force-directed layout is used to generate the original power grid structure diagram, and the large language model generates Python drawing code or Mermaid code based on the connection relationships and bus type descriptions. The embodiment sets up the following three sets of test samples: Test-39: Nb=39, K=4; Test-64: Nb=64, K=4; Test-96: Nb=96, K=6; The first group of samples has a total of 39 bus nodes and 4 subnets; the second group of samples has a total of 64 bus nodes and 4 subnets; and the third group of samples has a total of 96 bus nodes and 6 subnets.

[0083] The proportions of busbar type and connection type are calculated as follows: G_ratio = NG / (NG + NL), where the proportion of generating bus nodes G_ratio is equal to the total number of generating bus nodes NG divided by the sum of the number of generating bus nodes NG and the number of load bus nodes NL. L_ratio = NL / (NG + NL), where L_ratio is the ratio of load bus nodes to the total number of load bus nodes in the network divided by the sum of the number of generating bus nodes NG and the number of load bus nodes NL. GG_ratio = N_GG / |E|, where GG_ratio is the ratio of the number of connecting edges between the generating bus nodes to the total number of connecting edges in the entire network, N_GG, divided by the total number of edges in the entire network, |E|. LL_ratio = N_LL / |E|, where LL_ratio is the ratio of the number of connections between load bus nodes to the total number of connections between load bus nodes, N_LL, divided by the total number of connections in the entire network, |E|. GL_ratio = N_GL / |E|, where GL_ratio is the ratio of the number of connection edges between the generating bus node and the load bus node, which is equal to the number of such connection edges N_GL divided by the total number of edges in the entire network |E|.

[0084] The above five proportional indicators are used to quantify the similarity between the power grid structure data sample and the real or public power grid in terms of bus role allocation and edge type distribution.

[0085] The average degree is calculated as follows: The average node degree of the entire network is equal to the sum of the degrees of all bus nodes divided by the total number of bus nodes in the entire network; The average degree of a power generation bus node is equal to the sum of the degrees of all bus nodes in the power generation bus node set divided by the number of power generation bus nodes. The average degree of a load bus node is equal to the sum of the degrees of all bus nodes in the load bus node set divided by the number of load bus nodes.

[0086] The above three indicators reflect the node connection density of the entire network, the power generation bus node subset, and the load bus node subset, respectively. They are used to compare with the corresponding statistics of the real or public power grid to verify whether the generated results conform to the common sense of power grid structure.

[0087] The experimental results of the example are as follows: Table 1 Experimental Results of Examples Experimental results from the above embodiments show that the power grid structure data samples generated by the present invention are comparable to real or public power grids (including IEEE-30, IEEE-57, IEEE-118, IEEE-300, NYISO-2935, ERCOT-5633, and WECC-16994, etc.) in terms of bus type ratio, connection type ratio, and node degree statistics. At the same time, since the system can output edge indexes, node features, structural descriptions, codes, and multi-style images, its generated results can be used in application scenarios such as topology statistics, image understanding, structural question answering, and graph neural network training.

[0088] In another specific embodiment, a power grid structure data sample for a high-penetration renewable energy access scenario is generated. The user inputs a scenario type of "high-penetration renewable energy access to the power grid," and the system compiles this scenario into the following rules: at least several renewable energy bus node sub-labels must be set; renewable energy nodes are preferentially located near designated subnet boundaries or load-concentrated subnets; the legend must distinguish between traditional generators, renewable energy generators, and load bus nodes; the extended data must explain the impact of renewable energy access on line connections and visualization colors. After generating the scenario constraint object and the rule set, the system first generates a unified structural constraint object that satisfies statistical constraints, then automatically constructs a retrieval enhancement query using the unified structural constraint object, and finally generates a structure diagram with a renewable energy legend and explanatory text. If image auditing finds that the renewable energy bus node color is inconsistent with the legend, an audit report is generated and the data sample is regenerated.

[0089] In another specific embodiment, the system generates counterfactual sample pairs for robustness evaluation of the neural network model. The original sample corresponds to the original power grid structure data sample, while the counterfactual sample corresponds to the counterfactual graph. Both maintain the same number of nodes, subnets, image style, and generation / load ratio range, except for deleting one critical tie line and adding one backup line. The perturbation edges and newly added edges are recorded in the counterfactual log file, clearly indicating the counterfactual changes. This allows for the construction of visually similar but topologically different sample pairs, used to evaluate whether the artificial intelligence model truly recognizes power grid connection relationships.

[0090] Please refer to Figure 2 A second aspect of the present invention provides a power grid structure data sample generation system, comprising: The scene data acquisition module 100 is used to determine the target power grid scene and set power grid structure parameters and scene constraints based on the target power grid scene. The power grid structure generation module 200 is used to generate a candidate power grid structure diagram based on the power grid structure parameters, and then adjust the candidate power grid structure diagram by means of the scenario constraints to obtain an initial power grid structure diagram; The power grid structure data analysis module 300 is used to obtain the graph structure feature vector of the initial power grid structure diagram and the reference structure feature vector of the target power grid scenario, and then analyze the cosine similarity between the graph structure feature vector and the reference structure feature vector. If the cosine similarity is less than a preset cosine similarity threshold, the initial power grid structure diagram is re-obtained according to the power grid structure parameters and the scenario constraints until the cosine similarity of the initial power grid structure diagram is greater than or equal to the preset cosine similarity threshold. The data expansion module 400 is used to generate a structural data document based on the initial power grid structure diagram and the graph structure feature vector when the cosine similarity is greater than or equal to a preset cosine similarity threshold, generate a query text vector based on the structural data document, and then retrieve the expanded data that meets the scenario constraints in the preset power system structure document through the query text vector; The sample generation module 500 is used to generate a power grid structure data sample by combining the structure data document and the extended data.

[0091] Further, the step of generating a candidate power grid structure diagram based on the power grid structure parameters, and then adjusting the candidate power grid structure diagram through the scenario constraints to obtain an initial power grid structure diagram, includes: Based on the power grid structure parameters, obtain the power grid type, the total number of subgrids, the total number of generating bus nodes, and the total number of load bus nodes; Random nodes and random edges are generated based on the power grid type, the total number of subnetworks, the total number of generating bus nodes, and the total number of load bus nodes. The topology is then constructed using the random nodes and random edges to generate the candidate power grid structure diagram. Based on the scenario constraints, obtain the power generation load bus ratio constraints and edge node ratio constraints; The nodes and edges in the candidate power grid structure diagram are adjusted to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint and the edge node ratio constraint, and that there is a connection path between any two nodes in the initial power grid structure diagram.

[0092] Further, adjusting the nodes and edges in the candidate power grid structure diagram to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint and the edge node ratio constraint, and ensures that there is a connection path between any two nodes in the initial power grid structure diagram, includes: Obtain the actual power grid topology data corresponding to the target power grid scenario; By superimposing bounded disturbances onto the actual power grid topology data, a desensitization constraint interval is obtained. The nodes and edges in the candidate power grid structure diagram are adjusted to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint, the edge node ratio constraint, and the desensitization constraint interval, and that there is a connection path between any two nodes in the initial power grid structure diagram.

[0093] Further, obtaining the graph structure feature vector of the initial power grid structure graph and obtaining the baseline structure feature vector of the target power grid scenario includes: obtaining the total number of node pairs and the path length of each node pair in the initial power grid structure graph, and obtaining the average path length of the initial power grid structure graph based on the total number of node pairs and the path length of each node pair; Obtain the clustering coefficient of each node in the initial power grid structure diagram, and obtain the average clustering coefficient of the initial power grid structure diagram based on the clustering coefficient of each node; Obtain the degree of each node in the initial power grid structure diagram, and obtain the average node degree of the initial power grid structure diagram based on the degree of each node; The proximity centrality of each node in the initial power grid structure diagram is obtained, and the average proximity centrality of the initial power grid structure diagram is obtained based on the proximity centrality of each node. The average path length, average clustering coefficient, average node degree, and average proximity centrality of the initial power grid structure graph are concatenated to form the graph structure feature vector; Obtain the baseline power grid structure of the target power grid scenario, and then obtain the average path length, average clustering coefficient, average node degree, and average proximity centrality of the baseline power grid structure. The average path length, average clustering coefficient, average node degree, and average proximity centrality of the benchmark power grid structure are concatenated to form the feature vector of the benchmark structure.

[0094] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0095] The term "embodiment" as used herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described; however, any combination of these technical features that does not contradict each other should be considered within the scope of this specification.

[0096] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various improvements and substitutions without departing from the concept of this application, and these improvements and substitutions should also be considered within the scope of protection of this invention. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims

1. A method for generating power grid structure data samples, characterized in that, include: Determine the target power grid scenario, and set power grid structure parameters and scenario constraints based on the target power grid scenario; A candidate power grid structure diagram is generated based on the power grid structure parameters, and then the candidate power grid structure diagram is constrained and adjusted by the scenario constraints to obtain an initial power grid structure diagram; Obtain the graph structure feature vector of the initial power grid structure diagram, and obtain the baseline structure feature vector of the target power grid scenario; Analyze the cosine similarity between the graph structure feature vector and the baseline structure feature vector. If the cosine similarity is less than a preset cosine similarity threshold, then re-obtain the initial power grid structure graph based on the power grid structure parameters and the scenario constraints until the cosine similarity of the initial power grid structure graph is greater than or equal to the preset cosine similarity threshold. When the cosine similarity is greater than or equal to a preset cosine similarity threshold, a structural data document is generated based on the initial power grid structure diagram and the graph structure feature vector. A query text vector is generated based on the structural data document, and then extended data that meets the scenario constraints is retrieved from the preset power system structure document through the query text vector. A power grid structure data sample is generated by combining the structure data document and the extended data.

2. The method for generating power grid structure data samples according to claim 1, characterized in that, The step of generating a candidate power grid structure diagram based on the power grid structure parameters, and then adjusting the candidate power grid structure diagram through the scenario constraints to obtain an initial power grid structure diagram, includes: Based on the power grid structure parameters, obtain the power grid type, the total number of subgrids, the total number of generating bus nodes, and the total number of load bus nodes; Random nodes and random edges are generated based on the power grid type, the total number of subnetworks, the total number of generating bus nodes, and the total number of load bus nodes. The topology is then constructed using the random nodes and random edges to generate the candidate power grid structure diagram. Based on the scenario constraints, obtain the power generation load bus ratio constraints and edge node ratio constraints; The nodes and edges in the candidate power grid structure diagram are adjusted to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint and the edge node ratio constraint, and that there is a connection path between any two nodes in the initial power grid structure diagram.

3. The method for generating power grid structure data samples according to claim 2, characterized in that, The process of adjusting the nodes and edges in the candidate power grid structure diagram to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint and the edge node ratio constraint, and ensures that there is a connection path between any two nodes in the initial power grid structure diagram, includes: Obtain the actual power grid topology data corresponding to the target power grid scenario; By superimposing bounded disturbances onto the actual power grid topology data, a desensitization constraint interval is obtained. The nodes and edges in the candidate power grid structure diagram are adjusted to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint, the edge node ratio constraint, and the desensitization constraint interval, and that there is a connection path between any two nodes in the initial power grid structure diagram.

4. The method for generating power grid structure data samples according to claim 1, characterized in that, The step of obtaining the graph structure feature vector of the initial power grid structure diagram and obtaining the baseline structure feature vector of the target power grid scenario includes: obtaining the total number of node pairs and the path length of each node pair in the initial power grid structure diagram, and obtaining the average path length of the initial power grid structure diagram based on the total number of node pairs and the path length of each node pair; Obtain the clustering coefficient of each node in the initial power grid structure diagram, and obtain the average clustering coefficient of the initial power grid structure diagram based on the clustering coefficient of each node; Obtain the degree of each node in the initial power grid structure diagram, and obtain the average node degree of the initial power grid structure diagram based on the degree of each node; The proximity centrality of each node in the initial power grid structure diagram is obtained, and the average proximity centrality of the initial power grid structure diagram is obtained based on the proximity centrality of each node. The average path length, average clustering coefficient, average node degree, and average proximity centrality of the initial power grid structure graph are concatenated to form the graph structure feature vector; Obtain the baseline power grid structure of the target power grid scenario, and then obtain the average path length, average clustering coefficient, average node degree, and average proximity centrality of the baseline power grid structure. The average path length, average clustering coefficient, average node degree, and average proximity centrality of the benchmark power grid structure are concatenated to form the feature vector of the benchmark structure.

5. The method for generating power grid structure data samples according to claim 1, characterized in that, When the cosine similarity is greater than or equal to a preset cosine similarity threshold, a structural data document is generated based on the initial power grid structure diagram and the graph structure feature vector. A query text vector is then generated based on the structural data document, and extended data satisfying the scenario constraints is retrieved from the preset power system structure document using the query text vector. This includes: Based on the initial power grid structure diagram and the graph structure feature vector, a basic data document and a structure description text are generated as the structure data document; The basic data document and the structure description text are used to construct a total query text, and then the total query text is decomposed into several sub-query texts according to the query type. Each subquery text is vectorized into a subquery vector, which is used as the query text vector; Several knowledge block texts are extracted from the power system structure document, and then each knowledge block text is vectorized into a knowledge block vector. For any subquery vector, the semantic similarity between the subquery vector and each knowledge block vector is obtained, and then the knowledge block vectors with semantic similarity exceeding a preset semantic similarity threshold are selected as the retrieval context set of the subquery vector. The extended data is generated based on the retrieval context set corresponding to each subquery vector.

6. The method for generating power grid structure data samples according to claim 1, characterized in that, After generating the power grid structure data sample by combining the structure data document and the extended data, the method further includes: Several power grid structure data samples are generated for the target power grid scenario; Based on the scenario constraints, obtain topological rule constraints, semantic rule constraints, and visualization rule constraints; The rule violation cost value of each power grid structure data sample is calculated based on the topological rule constraints, the semantic rule constraints, and the visualization rule constraints. The final sample is obtained by filtering the power grid structure data samples whose default cost corresponding to the rule is less than a preset cost threshold.

7. A power grid structure data sample generation system, characterized in that, include: The scene data acquisition module is used to determine the target power grid scene and set power grid structure parameters and scene constraints based on the target power grid scene; The power grid structure generation module is used to generate candidate power grid structure diagrams based on the power grid structure parameters, and then adjust the candidate power grid structure diagrams by means of the scenario constraints to obtain an initial power grid structure diagram; The power grid structure data analysis module is used to obtain the graph structure feature vector of the initial power grid structure diagram and the reference structure feature vector of the target power grid scenario, and then analyze the cosine similarity between the graph structure feature vector and the reference structure feature vector. If the cosine similarity is less than a preset cosine similarity threshold, the initial power grid structure diagram is re-obtained according to the power grid structure parameters and the scenario constraints until the cosine similarity of the initial power grid structure diagram is greater than or equal to the preset cosine similarity threshold. The data expansion module is used to generate a structural data document based on the initial power grid structure diagram and the graph structure feature vector when the cosine similarity is greater than or equal to a preset cosine similarity threshold, generate a query text vector based on the structural data document, and then retrieve expanded data that meets the scenario constraints in the preset power system structure document through the query text vector; The sample generation module is used to generate a power grid structure data sample by combining the structure data document and the extended data.

8. A power grid structure data sample generation system according to claim 7, characterized in that, The step of generating a candidate power grid structure diagram based on the power grid structure parameters, and then adjusting the candidate power grid structure diagram through the scenario constraints to obtain an initial power grid structure diagram, includes: Based on the power grid structure parameters, obtain the power grid type, the total number of subgrids, the total number of generating bus nodes, and the total number of load bus nodes; Random nodes and random edges are generated based on the power grid type, the total number of subnetworks, the total number of generating bus nodes, and the total number of load bus nodes. The topology is then constructed using the random nodes and random edges to generate the candidate power grid structure diagram. Based on the scenario constraints, obtain the power generation load bus ratio constraints and edge node ratio constraints; The nodes and edges in the candidate power grid structure diagram are adjusted to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint and the edge node ratio constraint, and that there is a connection path between any two nodes in the initial power grid structure diagram.

9. A power grid structure data sample generation system according to claim 8, characterized in that, The process of adjusting the nodes and edges in the candidate power grid structure diagram to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint and the edge node ratio constraint, and ensures that there is a connection path between any two nodes in the initial power grid structure diagram, includes: Obtain the actual power grid topology data corresponding to the target power grid scenario; By superimposing bounded disturbances onto the actual power grid topology data, a desensitization constraint interval is obtained. The nodes and edges in the candidate power grid structure diagram are adjusted to obtain the initial power grid structure diagram, so that the initial power grid structure diagram satisfies the generation load bus ratio constraint, the edge node ratio constraint, and the desensitization constraint interval, and that there is a connection path between any two nodes in the initial power grid structure diagram.

10. A power grid structure data sample generation system according to claim 7, characterized in that, The step of obtaining the graph structure feature vector of the initial power grid structure diagram and obtaining the baseline structure feature vector of the target power grid scenario includes: obtaining the total number of node pairs and the path length of each node pair in the initial power grid structure diagram, and obtaining the average path length of the initial power grid structure diagram based on the total number of node pairs and the path length of each node pair; Obtain the clustering coefficient of each node in the initial power grid structure diagram, and obtain the average clustering coefficient of the initial power grid structure diagram based on the clustering coefficient of each node; Obtain the degree of each node in the initial power grid structure diagram, and obtain the average node degree of the initial power grid structure diagram based on the degree of each node; The proximity centrality of each node in the initial power grid structure diagram is obtained, and the average proximity centrality of the initial power grid structure diagram is obtained based on the proximity centrality of each node. The average path length, average clustering coefficient, average node degree, and average proximity centrality of the initial power grid structure graph are concatenated to form the graph structure feature vector; Obtain the baseline power grid structure of the target power grid scenario, and then obtain the average path length, average clustering coefficient, average node degree, and average proximity centrality of the baseline power grid structure. The average path length, average clustering coefficient, average node degree, and average proximity centrality of the benchmark power grid structure are concatenated to form the feature vector of the benchmark structure.