Power grid similar operation section sample set construction method and system

By using graph neural networks and temporal coding techniques, a sample set of similar operating sections of the power grid is constructed, which solves the problem of poor spatiotemporal consistency of sample sets in power grid control in existing technologies. This enables efficient and automated sample set construction, improving the data utilization efficiency and accuracy of power grid dispatching and control.

CN121301918APending Publication Date: 2026-01-09CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511333616.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2026-01-09

Smart Images

  • Figure CN121301918A_ABST
    Figure CN121301918A_ABST
Patent Text Reader

Abstract

The invention discloses a power grid similar operation section sample set construction method and system, and belongs to the technical field of power system dispatching control. The method comprises the following steps: defining initial electrical characteristics of a power grid operation section; constructing a feature extraction network containing a graph neural network, a fusion layer and a time sequence coding layer; realizing spatial-temporal feature decoupling by adopting a double-task joint training strategy of time sequence contrast learning and node masking reconstruction; preprocessing the historical section and constructing a feature library; matching the first K similar sections through similarity retrieval, and constructing a tagged sample set; the system comprises corresponding function modules. According to the method, through deep fusion of graph structure learning and time sequence modeling, the problems of high feature dimension, poor time sequence consistency, dependence on artificial experience and the like in the prior art are solved, automatic and high-precision construction of the power grid historical operation section sample set is realized, and reliable data support can be provided for power grid safety analysis and scheduling decision making.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power system dispatch and control technology, specifically relating to a method and system for constructing a sample set of similar operating sections of a power grid. Background Technology

[0002] Currently, significant research achievements have been made in the field of mining similar historical operating sections of power grids. Research on power grid operating section similarity matching based on an improved K-means algorithm uses a decision tree model to select statistical quantities of electrical characteristics such as generator output and node load as section features, and then uses the improved K-means algorithm to match similar historical operating sections for the current system section. Research on power grid operating section similarity matching based on stacked autoencoders constructs a historical sample set based on the power grid operating section similarity matching research method, and then uses the stacked autoencoder algorithm for deep learning to achieve operating section classification. A power grid operating trend estimation algorithm and its application based on neural networks searches for similar sections in historical power flow sections based on planned data such as generation plans, load forecasts, and maintenance forecasts. An automatic power flow data integration and adjustment method for verifying the safety and stability of scheduling plans obtains operating sections for historically similar days based on similar days.

[0003] Existing technologies first employ graph representation learning algorithms to perform deep unsupervised learning of the power grid topology and its attribute information, extracting attribute vectors representing the spatial characteristics of operating sections. Then, a sliding time window algorithm is used to divide the spatial feature vectors corresponding to historical operating sections into multiple windows according to different time periods. Finally, the similarity between corresponding samples in different windows is calculated from both micro and macro perspectives to obtain a set of continuous sections most similar to the sections in the current time period. Existing technologies extract global features, resulting in high dimensionality and high time complexity. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method and system for constructing a sample set of similar operating sections of a power grid, which addresses the shortcomings of the prior art. This method solves the technical problem that existing power grid control tasks rely on historical similar operating condition data and cannot automatically construct a similar sample set with spatiotemporal consistency.

[0005] The present invention adopts the following technical solution: A method for constructing a sample set of similar operating sections of a power grid includes the following steps: Define the initial electrical characteristics of the power grid operation section, including the voltage amplitude, voltage phase angle, generator active power, generator reactive power, load active power, and load reactive power of each node, the line active power flow and line reactive power flow of adjacent edges, and the voltage amplitude, voltage phase angle, generator active power, generator reactive power, load active power, and load reactive power of adjacent nodes. A feature extraction network structure was constructed, including a graph neural network layer, a fusion layer, and a temporal coding layer, to extract the spatiotemporal features of the power grid operation section; The feature extraction network is trained using a dual-task joint training strategy of temporal contrastive learning and node masking reconstruction to achieve spatiotemporal feature decoupling; Preprocess historical operational cross-section data and extract feature vectors to construct a cross-section feature vector library; Input the cross section to be searched, generate its feature vector, and search the top K similar cross sections in the feature vector library based on similarity. A new sample set is created, and the cross-sectional samples corresponding to the first K similar segments retrieved are tagged with the name of the new sample set, thus completing the construction of the power grid similar operation cross-sectional sample set.

[0006] Preferably, the graph neural network layer is a two-layer graph attention network GATv2, each layer contains a dynamic multi-head attention mechanism, and gradient vanishing is avoided through residual connections.

[0007] Preferably, the first layer of GATv2 has an input dimension of d, an output dimension of 128, and 4 attention heads; the second layer of GATv2 has an input dimension of 128, an output dimension of 128, and 4 attention heads, and shares parameters with the first layer.

[0008] Preferably, the fusion layer employs a gated attention pooling mechanism to dynamically calculate the importance weights of each node and generate a global graph-level representation.

[0009] Preferably, the temporal coding layer is a 4-layer stacked bidirectional GRU, the hidden layer dimension is 128, and the output is a 256-dimensional concatenated vector of the forward and reverse hidden states.

[0010] Preferably, in the time-series contrastive learning task, positive sample pairs are adjacent windows with 50% overlap, and negative sample pairs include cross-sequence random sampling and difficult-to-negative samples in the same sequence. The difficult-to-negative samples are cross-sectional segments with similar loading patterns but different topologies.

[0011] Preferably, the loss function for time-series contrastive learning for:

[0012] in, The number of samples in a training batch. The similarity between the current cross-section and the target cross-section. The similarity between the current cross-section and other samples in the training batch. For the original feature distribution, For temperature coefficient, These are the weighting coefficients. As expected, This represents the similarity between positive and negative sample pairs.

[0013] Preferably, in the node masking reconstruction task, 40% of node features are randomly masked, the masking probability of key nodes is reduced to 20%, and the loss function includes feature reconstruction loss and topology reconstruction loss.

[0014] Preferably, the loss function for node masking reconstruction for:

[0015] in, Let be the set of hidden nodes, and α be the topology reconstruction weight. Let i be a linear parameter and i be a node. For mask features, Original features The mean square error of the global features.

[0016] Preferably, the joint training adopts a dynamic weight adjustment strategy, updating the task weights every 1000 steps, and using the PCGrad algorithm to project conflicting gradients.

[0017] Preferably, the projected contradictory gradient of the PCGrad algorithm is as follows:

[0018] in, Let be the loss weight coefficient for the i-th sample, and t be the t-th iteration. The loss for the i-th sample, The loss for the j-th sample, This is the temperature coefficient.

[0019] Secondly, embodiments of the present invention provide a system for constructing a sample set of similar operating sections of a power grid, comprising: The feature module defines the initial electrical characteristics of the power grid operation section, including the voltage amplitude, voltage phase angle, generator active power, generator reactive power, load active power, and load reactive power of each node, the line active power flow and line reactive power flow of adjacent edges, and the voltage amplitude, voltage phase angle, generator active power, generator reactive power, load active power, and load reactive power of adjacent nodes. The module is built to construct a feature extraction network structure, including a graph neural network layer, a fusion layer, and a temporal coding layer, for extracting the spatiotemporal features of the power grid operation section; The training module employs a dual-task joint training strategy of temporal contrastive learning and node masking reconstruction to train the feature extraction network, thereby achieving spatiotemporal feature decoupling. The preprocessing module preprocesses historical operational cross-section data and extracts feature vectors to build a cross-section feature vector library. The output module takes the cross section to be searched as input, generates its feature vector, and retrieves the top K similar cross sections in the feature vector library based on similarity; it creates a new sample set, labels the cross section samples corresponding to the top K similar segments with the name of the new sample set, and completes the construction of the power grid similar operation cross section sample set.

[0020] Thirdly, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method for constructing a sample set of similar operating sections of a power grid.

[0021] Fourthly, embodiments of the present invention provide a computer-readable storage medium including a computer program, which, when executed by a processor, implements the steps of the above-described method for constructing a set of similar operating sections of a power grid.

[0022] Fifthly, a chip includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method for constructing a sample set of similar operating sections of a power grid.

[0023] In a sixth aspect, embodiments of the present invention provide an electronic device, including a computer program, which, when executed by the electronic device, implements the steps of the above-described method for constructing a sample set of similar operating sections of a power grid.

[0024] Compared with the prior art, the present invention has at least the following beneficial effects: A method for constructing a sample set of similar operating sections of a power grid is proposed. This method systematically defines the initial electrical characteristics of the power grid operating sections and constructs a deep learning network with spatiotemporal feature extraction capabilities, achieving automated extraction from raw data to high-order features. Through a dual-task joint training strategy, spatiotemporal features are effectively decoupled, improving the discriminative ability of feature representations. Finally, by constructing a sample set through similarity retrieval and labeling, an efficient, automated, and consistent sample set of historical operating sections of the power grid is constructed, significantly improving the utilization efficiency of historical operating condition data in power grid dispatching and control.

[0025] Furthermore, GATv2 is used as the graph neural network layer, which possesses a dynamic multi-head attention mechanism, enabling it to better capture the complex dependencies between power grid nodes. The introduction of residual connections effectively alleviates the gradient vanishing problem in deep network training, improving the network's stability and feature representation capabilities.

[0026] Furthermore, by clearly defining the input and output dimensions and the number of attention heads in the two layers of GATv2 and achieving parameter sharing, the effectiveness of feature deepening is ensured, the model complexity is controlled, and the computational efficiency and generalization ability are improved.

[0027] Furthermore, the gated attention pooling mechanism can dynamically evaluate the importance of each node, highlight the role of key nodes, and thus generate more representative global graph-level features, improving the accuracy of subsequent temporal modeling.

[0028] Furthermore, a four-layer stacked bidirectional GRU is used to capture the temporal evolution of the power grid. The bidirectional structure fully integrates information from previous and subsequent times, and the 256-dimensional spliced ​​output provides rich temporal feature representations, which is beneficial for subsequent similarity matching.

[0029] Furthermore, by designing positive sample pairs with overlapping windows and a hard negative sample strategy, the model's ability to distinguish between temporal consistency and topological differences was enhanced, thus improving the effectiveness of contrastive learning.

[0030] Furthermore, a KL divergence term is introduced into the loss function, which, combined with distribution histogram information, enhances the robustness of similarity measurement from a statistical perspective, thereby further improving the model's ability to represent complex operating states.

[0031] Furthermore, the node masking reconstruction task forces the model to learn more robust feature representations by combining random masking with critical node protection, while enhancing the understanding of the power grid structure through topology reconstruction.

[0032] Furthermore, the masking reconstruction loss function considers both feature reconstruction and topology reconstruction, and balances their contributions by adjusting the weights, so that the model maintains sensitivity to data distribution and structural consistency during the feature extraction process.

[0033] Furthermore, the dynamic weight adjustment strategy combined with the PCGrad algorithm effectively alleviates gradient conflict issues in multi-task training, improving model convergence speed and training stability.

[0034] Furthermore, the gradient update direction is further optimized through the PCGrad algorithm to avoid mutual interference between tasks, ensure the effectiveness of dual-task collaborative training, and improve the discriminative power of the final features.

[0035] It is understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.

[0036] In summary, this invention achieves efficient extraction and decoupling of spatiotemporal features of power grid operation sections by integrating graph neural networks, temporal modeling, and multi-task learning. It possesses the capability to construct sample sets with automation, high precision, and high consistency, significantly improving the utilization rate of historical power grid data and the ability to support scheduling decisions.

[0037] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0038] Figure 1 This is a flowchart illustrating the process of this invention; Figure 2 A diagram of a multi-task collaboration framework; Figure 3 A schematic diagram of a computer device provided in an embodiment of the present invention; Figure 4 This is a block diagram of a chip provided according to an embodiment of the present invention.

[0039] Among them, 60. Computer equipment; 61. Processor; 62. Memory; 63. Computer program; 600. Electronic device; 610. Processing unit; 620. Storage unit; 6201. Random access memory unit; 6202. Cache memory unit; 6203. Read-only memory unit; 6204. Program / utility; 6205. Program module; 630. Bus; 640. Display unit; 650. Input / output interface; 660. Network adapter; 700. External device. Detailed Implementation

[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0041] In the description of this invention, it should be understood that the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0042] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0043] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this invention generally indicates that the preceding and following objects have an "or" relationship.

[0044] It should be understood that although terms such as first, second, third, etc., may be used in the embodiments of the present invention to describe the preset range, these preset ranges should not be limited to these terms. These terms are only used to distinguish the preset ranges from one another. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.

[0045] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."

[0046] The accompanying drawings illustrate various structural schematic diagrams according to embodiments disclosed in this invention. These drawings are not to scale, and some details have been enlarged for clarity, and some details may have been omitted. The shapes of the various regions and layers shown in the drawings, as well as their relative sizes and positional relationships, are merely exemplary and may deviate from reality due to manufacturing tolerances or technical limitations. Furthermore, those skilled in the art can design regions / layers with different shapes, sizes, and relative positions as needed.

[0047] This invention provides a method for constructing a sample set of similar operating sections of a power grid. It employs a two-layer GATv2 graph attention network to directly aggregate information based on the physical connections of the power grid, accurately capturing complex spatial relationships between nodes. Combining gated attention pooling and a bidirectional GRU, it simultaneously extracts key spatial features and dynamic temporal evolution patterns, achieving true spatiotemporal feature fusion. A dual-task collaborative training framework is designed, ensuring temporal consistency through temporal comparison learning, enhancing model robustness and topology awareness through node masking reconstruction, and resolving multi-task conflicts through dynamic weight adjustment and PCGrad gradient projection, thus decoupling and enhancing spatiotemporal features and fundamentally improving the discriminative power of feature representation. The method achieves an end-to-end fully automated process from feature definition, network training, feature library construction to similarity retrieval. The constructed sample set exhibits higher spatiotemporal consistency and accuracy, providing a more reliable data foundation for subsequent power grid analysis.

[0048] Please see Figure 1 The present invention provides a method for constructing a sample set of similar operating sections of a power grid, comprising the following steps: S1. Define the initial characteristics of the cross-section; Each node has six attributes: voltage amplitude, voltage phase angle, generator active power, generator reactive power, load active power, and load reactive power. Adjacent edges have two attributes: line active power flow and line reactive power flow (if a node has Y adjacent edges, the maximum value of the attributes of the Y lines is taken). Adjacent nodes also have six attributes: voltage amplitude, voltage phase angle, generator active power, generator reactive power, load active power, and load reactive power (if a node has Y adjacent nodes, the maximum value of each attribute of the Y nodes is taken). Each node is represented as a 14-dimensional column vector.

[0049] S2. Construct the feature extraction network structure, which consists of three parts; The first part is the GNN layer, which is a two-layer graph attention network (GATv2, Graph Attention Network v2) structure, with each layer containing a dynamic multi-head attention mechanism.

[0050] The input is the power grid cross-sectional feature matrix. , where N is the number of nodes and d is the feature dimension of each node.

[0051] The first layer of GATv2 has an input dimension of d, an output dimension of 128 for each node, and 4 attention heads. The adjacency matrix constraint only allows information to be passed between devices that are physically connected.

[0052] The second layer of GATv2 has an input dimension of 128 and an output dimension of 128. The dimensions remain unchanged to achieve feature enhancement. The number of attention heads is 4, and the parameters are shared with the first layer.

[0053] The residual connection adds the output of the first layer to the output of the second layer, thus avoiding gradient vanishing.

[0054] The second part is the fusion layer, which uses gated attention pooling to dynamically calculate the importance weight of each node in the power grid through a learnable attention mechanism, and generates a global graph-level representation. For the node features output by the GNN layer, the importance weight of each node is calculated.

[0055] The third part is a bidirectional GRU, used to capture the temporal evolution of the power grid's dynamic topology. The input is a sequence of graph-level vectors within a sliding window.

[0056] The network structure is a 4-layer stacked bidirectional GRU, with each layer including a forward GRU and a backward GRU. The hidden layer has a dimension of 128. The final output is a 256-dimensional concatenated vector of the bidirectional hidden states.

[0057] S3. Feature extraction network training: A dual-task joint training strategy of temporal contrastive learning and node masking reconstruction is adopted, and spatiotemporal feature decoupling is achieved through dynamic weight allocation.

[0058] Please see Figure 2 The following is a diagram of a multi-task collaboration framework: The first task is time-series comparative learning. Sample construction: Positive sample pairs: adjacent windows with 50% overlap (e.g., frames [1-5] and [3-7]). Negative sample pairs: random sampling across sequences (80%).

[0059] Difficult-to-load samples in the same sequence (20%): Select segments with similar load patterns but different topologies.

[0060] The loss function is:

[0061]

[0062] Where P is the voltage / current distribution histogram.

[0063] Online hard negative sample mining selects the top 10% of false negative samples with the highest similarity in each batch.

[0064] The second task is node masking reconstruction. Randomly occlude 40% of node features (following a Bernoulli distribution), reducing the occlusion probability of key nodes to 20%, with the loss function being...

[0065] in, Let be the set of hidden nodes, α = 0.5, and be the topology reconstruction weight.

[0066] Joint training mechanism: Gradient optimization scheme: Dynamic weight adjustment: Updated every 1000 steps.

[0067] The PCGrad algorithm is used to project contradictory gradients.

[0068]

[0069] S4. Cross-sectional feature extraction; The first part is data preprocessing.

[0070] Input: SCADA data of the power grid + topology connection relationship Formatting: Each cross-sectional sample → (fixed node set V, dynamic adjacency matrix) Node features ) The second part is offline database creation.

[0071] Encoding and storage: Each cross-section generates a 256-dimensional vector z.i Store in the index library S5. Historical similar data retrieval; Input a cross-section file with search capabilities, and generate z-coordinates. q Calculate the cosine similarity and retrieve the top K similar segments from the database.

[0072] S6. Sample Set Construction. Create a new sample set and label the retrieved cross-sectional samples with the corresponding sample set name.

[0073] In another embodiment of the present invention, a system for constructing a sample set of similar operating sections of a power grid is provided. This system can be used to implement the above-mentioned method for constructing a sample set of similar operating sections of a power grid. Specifically, the system for constructing a sample set of similar operating sections of a power grid includes a feature module, a construction module, a training module, a preprocessing module, and an output module.

[0074] Among them, the feature module defines the initial electrical characteristics of the power grid operation section, including the voltage amplitude, voltage phase angle, generator active power, generator reactive power, load active power, and load reactive power of each node, the line active power flow and line reactive power flow of adjacent edges, and the voltage amplitude, voltage phase angle, generator active power, generator reactive power, load active power, and load reactive power of adjacent nodes. The module is built to construct a feature extraction network structure, including a graph neural network layer, a fusion layer, and a temporal coding layer, for extracting the spatiotemporal features of the power grid operation section; The training module employs a dual-task joint training strategy of temporal contrastive learning and node masking reconstruction to train the feature extraction network, thereby achieving spatiotemporal feature decoupling. The preprocessing module preprocesses historical operational cross-section data and extracts feature vectors to build a cross-section feature vector library. The output module takes the cross section to be searched as input, generates its feature vector, and retrieves the top K similar cross sections in the feature vector library based on similarity; it creates a new sample set, labels the cross section samples corresponding to the top K similar segments with the name of the new sample set, and completes the construction of the power grid similar operation cross section sample set.

[0075] This invention provides a terminal device comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, graphics processing units (GPUs), tensor processing units (TPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve corresponding method flows or corresponding functions. The processor described in this embodiment can be used in the operation of a method for constructing a sample set of similar operating sections of a power grid, including: The initial electrical characteristics of the power grid operation section are defined, including the voltage amplitude, voltage phase angle, active power generation of generating units, reactive power generation of generating units, active power generation of loads, and reactive power generation of loads at each node; the active power flow and reactive power flow of adjacent edges; and the voltage amplitude, voltage phase angle, active power generation of generating units, reactive power generation of generating units, active power generation of loads, and reactive power generation of loads at adjacent nodes. A feature extraction network structure is constructed, including a graph neural network layer, a fusion layer, and a temporal coding layer, to extract the spatiotemporal features of the power grid operation section. The feature extraction network is trained using a dual-task joint training strategy of temporal contrastive learning and node masking reconstruction to achieve spatiotemporal feature decoupling. Historical operation section data is preprocessed and feature vectors are extracted to construct a section feature vector library. The section to be retrieved is input, and its feature vector is generated. The top K similar sections in the feature vector library are retrieved based on similarity. A new sample set is created, and the section samples corresponding to the top K similar segments are tagged with the name of the new sample set, thus completing the construction of the power grid similar operation section sample set.

[0076] Please see Figure 3The terminal device is a computer device. In this embodiment, the computer device 60 includes a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When executed by the processor 61, the computer program 63 implements the method for estimating the concentration of radioactive iodine species in the containment structure after an accident, as described in this embodiment. To avoid repetition, these details are not elaborated here. Alternatively, when executed by the processor 61, the computer program 63 implements the functions of each model / unit in the power grid similar operating section sample set construction system of this embodiment. To avoid repetition, these details are not elaborated here.

[0077] Computer device 60 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. Computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will understand that... Figure 3 This is merely an example of computer device 60 and does not constitute a limitation on computer device 60. It may include more or fewer components than shown, or combine certain components, or different components. For example, computer device may also include input / output devices, network access devices, buses, etc.

[0078] The processor 61 may be a Central Processing Unit (CPU), or other general-purpose processors, graphics processing units (GPUs), tensor processing units (TPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0079] The memory 62 can be an internal storage unit of the computer device 60, such as a hard disk or RAM of the computer device 60. The memory 62 can also be an external storage device of the computer device 60, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device 60.

[0080] Furthermore, the memory 62 may include both internal storage units of the computer device 60 and external storage devices. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 can also be used to temporarily store data that has been output or will be output.

[0081] Please see Figure 4 The terminal device is an electronic device 600, which is manifested in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including storage unit 620 and processing unit 610), a display unit 640, etc.

[0082] The storage unit stores program code, which can be executed by the processing unit 610 to perform the steps described in the method section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 610 can perform actions such as... Figure 1 The steps are shown in the figure.

[0083] Storage unit 620 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 6201 and / or cache memory 6202, and may further include a read-only memory (ROM) 6203.

[0084] Storage unit 620 may also include a program / utility 6204 having a set (at least one) program module 6205, such program module 6205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0085] Bus 630 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the multiple bus structures.

[0086] Electronic device 600 can also communicate with one or more external devices 700 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 600, and / or with any device that enables electronic device 600 to communicate with one or more other computing devices (e.g., router, modem). This communication can be performed via input / output interface 650. Furthermore, electronic device 600 can also communicate with one or more networks (e.g., local area network, wide area network, and / or public network, such as the Internet) via network adapter 660. Network adapter 660 can communicate with other modules of electronic device 600 via bus 630. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.

[0087] Example 4 This invention also provides a storage medium, specifically a computer-readable storage medium, which is a memory device in a terminal device for storing programs and data. It is understood that the computer-readable storage medium here can include both built-in storage media in the terminal device and extended storage media supported by the terminal device; it can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor, which can be one or more computer programs (including program code). More specific examples of the computer-readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical fiber, portable compact disk read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.

[0088] Computer-readable storage media also include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium can also be any readable medium other than a readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, radio frequency, etc., or any suitable combination thereof.

[0089] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0090] One or more instructions stored in a computer-readable storage medium can be loaded and executed by a processor to implement the corresponding steps of the method for constructing a sample set of similar operating sections of the power grid in the above embodiments; one or more instructions in the computer-readable storage medium are loaded and executed by the processor in the following steps: The initial electrical characteristics of the power grid operation section are defined, including the voltage amplitude, voltage phase angle, active power generation of generating units, reactive power generation of generating units, active power generation of loads, and reactive power generation of loads at each node; the active power flow and reactive power flow of adjacent edges; and the voltage amplitude, voltage phase angle, active power generation of generating units, reactive power generation of generating units, active power generation of loads, and reactive power generation of loads at adjacent nodes. A feature extraction network structure is constructed, including a graph neural network layer, a fusion layer, and a temporal coding layer, to extract the spatiotemporal features of the power grid operation section. The feature extraction network is trained using a dual-task joint training strategy of temporal contrastive learning and node masking reconstruction to achieve spatiotemporal feature decoupling. Historical operation section data is preprocessed and feature vectors are extracted to construct a section feature vector library. The section to be retrieved is input, and its feature vector is generated. The top K similar sections in the feature vector library are retrieved based on similarity. A new sample set is created, and the section samples corresponding to the top K similar segments are tagged with the name of the new sample set, thus completing the construction of the power grid similar operation section sample set.

[0091] 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.

[0092] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0093] (a) Simulation Experiment Data Using the full-year operation data of a provincial power grid in 2023 as the experimental subject, including SCADA data from 1200 nodes and 3000 lines (sampling interval of 5 minutes, totaling approximately 1.05 million cross-sectional data points), this invention is compared with existing methods based on K-means and stacked autoencoders: Sample set construction efficiency: The offline library construction of this invention takes 8.2 hours and the retrieval of the cross section to be retrieved takes 0.3 seconds; the library construction of the K-means method takes 15.6 hours and the retrieval takes 1.8 seconds; the library construction of the stacked autoencoder takes 12.3 hours and the retrieval takes 1.2 seconds. The efficiency of this invention is significantly improved.

[0094] Similar sample accuracy: Based on 100 manually labeled similar cross sections, the retrieval accuracy of this invention is 92.3%, the K-means accuracy is 75.6%, and the stacked autoencoder accuracy is 81.2%. This invention has significant advantages in spatiotemporal consistency and feature matching degree.

[0095] Network training stability: During the training process of this invention, the loss function converged in 3200 iterations, K-means converged in 5800 iterations, and the stacked autoencoder converged in 4500 iterations. The dynamic weights and PCGrad algorithm of this invention improve the convergence efficiency.

[0096] Specific application examples A power grid company applied this invention to the task of identifying weak links in the power grid. Based on a constructed similar sample set, the company analyzed the power grid operation status during three peak load periods in January 2025. By searching similar historical sections, three lines prone to overload were quickly located (which perfectly matched the overloaded lines found in actual operation). Based on the prevention and control measures in the historical samples, targeted control schemes were formulated, reducing the risk of line overload by 78% and shortening the control response time to one-third of the original. This verifies the practicality and reliability of this invention in actual power grid control.

[0097] The power grid control system stores a large amount of valuable system operation data accumulated over many years. Among this, operational segment data represents the overall operating status of the power grid at a specific historical moment, including operational data such as power flow, voltage, load, power generation, and equipment status, as well as corresponding maintenance information, including operating mode arrangements, risk analysis, and emergency response plans. Constructing a similar set of historical segment samples can provide a crucial information foundation for identifying weak links, analyzing interlocking faults and optimizing prevention and control measures, and for power grid planning and simulation, which is of profound significance for ensuring the safe operation of the system. The widespread application of this invention will bring significant benefits to power grid operation and the implementation of the electricity market.

[0098] In summary, the present invention provides a method and system for constructing a sample set of similar operating sections of a power grid. Through precise initial feature selection, a multi-module collaborative network structure, and a scientific dual-task joint training strategy, it achieves automated construction of a sample set of similar operating sections of a power grid. This solves the problems of poor spatiotemporal consistency, low efficiency, and insufficient accuracy in existing technologies, improves the quality and construction efficiency of the sample set, and provides reliable data support for power grid regulation.

[0099] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0100] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0101] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0102] In the embodiments provided by this invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0103] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0104] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0105] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random-access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0106] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0107] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0108] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0109] The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.

Claims

1. A method for constructing a sample set of similar operating sections of a power grid, characterized in that, Includes the following steps: Define the initial electrical characteristics of the power grid operation section, including the voltage amplitude, voltage phase angle, generator active power, generator reactive power, load active power, and load reactive power of each node, the line active power flow and line reactive power flow of adjacent edges, and the voltage amplitude, voltage phase angle, generator active power, generator reactive power, load active power, and load reactive power of adjacent nodes. A feature extraction network structure was constructed, including a graph neural network layer, a fusion layer, and a temporal coding layer, to extract the spatiotemporal features of the power grid operation section; The feature extraction network is trained using a dual-task joint training strategy of temporal contrastive learning and node masking reconstruction to achieve spatiotemporal feature decoupling; Historical operational cross-section data are preprocessed and feature vectors are extracted to construct a cross-section feature vector library; Input the cross section to be searched, generate its feature vector, and search the top K similar cross sections in the feature vector library based on similarity. A new sample set is created, and the cross-sectional samples corresponding to the first K similar segments retrieved are tagged with the name of the new sample set, thus completing the construction of the power grid similar operation cross-sectional sample set.

2. The method for constructing a sample set of similar operating sections of a power grid according to claim 1, characterized in that, The graph neural network layer is a two-layer graph attention network GATv2, with each layer containing a dynamic multi-head attention mechanism and gradient vanishing through residual connections.

3. The method for constructing a sample set of similar operating sections of a power grid according to claim 2, characterized in that, The first layer of GATv2 has an input dimension of d, an output dimension of 128, and 4 attention heads; the second layer of GATv2 has an input dimension of 128, an output dimension of 128, and 4 attention heads, and shares parameters with the first layer.

4. The method for constructing a sample set of similar operating sections of a power grid according to claim 1, characterized in that, The fusion layer employs a gated attention pooling mechanism to dynamically calculate the importance weights of each node and generate a global graph-level representation.

5. The method for constructing a sample set of similar operating sections of a power grid according to claim 1, characterized in that, The temporal coding layer is a 4-layer stacked bidirectional GRU, the hidden layer dimension is 128, and the output is a 256-dimensional concatenated vector of the forward and reverse hidden states.

6. The method for constructing a sample set of similar operating sections of a power grid according to claim 1, characterized in that, In the time-series contrastive learning task, positive sample pairs are adjacent windows with 50% overlap, and negative sample pairs include cross-series random sampling and difficult negative samples in the same sequence. Difficult negative samples are cross-sectional segments with similar load patterns but different topologies.

7. The method for constructing a sample set of similar operating sections of a power grid according to claim 6, characterized in that, Loss function for time-series contrastive learning for: in, The number of samples in a training batch. The similarity between the current cross-section and the target cross-section. The similarity between the current cross-section and other samples in the training batch. For the original feature distribution, For temperature coefficient, These are the weighting coefficients. For the expectation, This represents the similarity between positive and negative sample pairs.

8. The method for constructing a sample set of similar operating sections of a power grid according to claim 1, characterized in that, In the node masking reconstruction task, 40% of node features are randomly masked, and the masking probability of key nodes is reduced to 20%. The loss function includes feature reconstruction loss and topology reconstruction loss.

9. The method for constructing a sample set of similar operating sections of a power grid according to claim 8, characterized in that, Loss function for node masking reconstruction for: in, Let be the set of hidden nodes, and α be the topology reconstruction weight. Let i be a linear parameter and i be a node. For mask features, Original features The mean square error of the global features.

10. The method for constructing a sample set of similar operating sections of a power grid according to claim 1, characterized in that, The joint training employs a dynamic weight adjustment strategy, updating the task weights every 1000 steps, and uses the PCGrad algorithm to project conflicting gradients.

11. The method for constructing a sample set of similar operating sections of a power grid according to claim 11, characterized in that, The contradictory gradients projected by the PCGrad algorithm are as follows: in, Let be the loss weight coefficient for the i-th sample, and t be the t-th iteration. The loss for the i-th sample, The loss for the j-th sample, This is the temperature coefficient.

12. A system for constructing a sample set of similar operating sections of a power grid, characterized in that, include: The feature module defines the initial electrical characteristics of the power grid operation section, including the voltage amplitude, voltage phase angle, generator active power, generator reactive power, load active power, and load reactive power of each node, the line active power flow and line reactive power flow of adjacent edges, and the voltage amplitude, voltage phase angle, generator active power, generator reactive power, load active power, and load reactive power of adjacent nodes. The module is built to construct a feature extraction network structure, including a graph neural network layer, a fusion layer, and a temporal coding layer, for extracting the spatiotemporal features of the power grid operation section; The training module employs a dual-task joint training strategy of temporal contrastive learning and node masking reconstruction to train the feature extraction network, thereby achieving spatiotemporal feature decoupling. The preprocessing module preprocesses historical operational cross-section data and extracts feature vectors to build a cross-section feature vector library. The output module takes the cross section to be searched as input, generates its feature vector, and retrieves the top K similar cross sections in the feature vector library based on similarity; it creates a new sample set, labels the cross section samples corresponding to the top K similar segments with the name of the new sample set, and completes the construction of the power grid similar operation cross section sample set.

13. A computer-readable storage medium for storing one or more programs, characterized in that, The one or more programs include instructions that, when executed by a computing device, cause the computing device to perform the method of any one of claims 1 to 11.

14. A computing device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including steps for performing the method of any one of claims 1 to 11.

Citation Information

Patent Citations

  • Method and device for determining time section of power system and electronic equipment

    CN110135511A

  • Power grid operation state prediction method and system

    CN114336792A

  • Medium voltage distribution network pseudo measurement generation method and device based on space-time diagram neural network

    CN117892611A

  • Electric power system state estimation method based on graph contrast learning

    CN119475263A

  • Node selection method and system under inter-province transaction agent mode, and storage medium

    WO2021227373A1