Power flow generation and analysis method and device based on power system pre-trained large model

Through the trend generation and analysis method based on the power system pre-trained large model, the massive scenarios and massive computing challenges of trend generation and analysis in the new power system are solved, and efficient and reliable trend calculation and analysis are achieved, supporting system planning and safety assessment.

CN118693804BActive Publication Date: 2025-03-21ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410762759.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2025-03-21
Estimated Expiration
2044-06-13

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively solve the challenges of massive scenarios and massive calculations for trend generation and analysis in new power systems, and customized machine learning models have problems such as insufficient generalization ability, long training time, and poor robustness.

Method used

The current generation and analysis method based on the power system pre-trained large model is adopted to construct a pre-trained large model including feature dimensionality-up-encoder-decoder-feature dimensionality reduction. Through the current law, the current information of the power system is mapped into a high-dimensional representation of topologically decoupled nodes in high-dimensional space, and is applied to the downstream tasks of future state current generation and analysis.

Benefits of technology

It realizes efficient flow calculation and analysis of the new power system, enhances the training efficiency and adaptability of the model, improves the solution efficiency and reliability of related scientific computing problems, and supports system planning, operation control and safety assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118693804B_ABST
    Figure CN118693804B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for power system pre-trained large model-based power flow generation and analysis, and constructs a power system pre-trained large model including feature dimension increase-encoder-decoder-feature dimension reduction; through the power flow law, the power system power flow information is mapped into a high-dimensional representation of nodes with topological decoupling in a high-dimensional space, and applied to the downstream tasks of future state power flow generation and analysis. It realizes the scalability of downstream tasks from planning to operation scope, such as AC power flow calculation, optimal power flow calculation, static safety analysis, dynamic safety analysis, etc., has the advantage of adapting to different operation topologies and systems of different scales, provides a new type of power system analysis method with high efficiency and high reliability, and strongly supports system planning, operation control and safety assessment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of power system analysis, and in particular relates to a power flow generation and analysis method and device based on a pre-trained large model of a power system. Background Art

[0002] The power system is the most complex man-made system and the core of the optimal allocation and efficient utilization of energy resources. Power system analysis is the basis for power system planning and operation. The evolution of new power systems is accompanied by profound changes in structural characteristics and operating characteristics: the volatility of new energy sources leads to the de-typical operation mode, and the large-scale power electronic equipment connected to the grid leads to complex and changeable dominant stability risks. The traditional simulation analysis system based on typical operation modes and the power system analysis methods driven by mechanism models and numerical algorithms are difficult to cope with the challenges of massive scenarios and massive calculations of new power systems.

[0003] Machine learning has the potential to efficiently handle massive scenario analysis and computing tasks for new power systems, but existing customized machine learning models have shortcomings such as insufficient generalization, long training time, and poor robustness. Pre-trained large models have the ability to deeply understand the deep knowledge hidden in the data, and can be transferred to specific downstream tasks through fine-tuning or even achieve zero-sample transfer. It is an advanced and effective machine learning paradigm.

[0004] How to build a large power system analysis model that can adapt to different downstream application scenarios such as power flow analysis, static safety analysis, dynamic safety analysis, etc., enhance the training efficiency and adaptability of the model, and improve the efficiency and reliability of solving related scientific computing problems in power system planning and operation, is a technical problem that needs to be solved urgently in building a new power system. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method and device for power flow generation and analysis based on a pre-trained large model of the power system in view of the deficiencies in the above-mentioned prior art, so as to solve the technical problem that future power flow generation and analysis cannot be realized at present.

[0006] The present invention adopts the following technical solutions:

[0007] The power flow generation and analysis method based on the pre-trained large model of the power system includes the following steps:

[0008] Construct a large pre-trained model of the power system including feature dimension upgrading-encoder-decoder-feature dimension reduction;

[0009] Through the power flow law, the power system power flow information is mapped into a topologically decoupled high-dimensional representation of nodes in a high-dimensional space, which is applied to downstream tasks of future power flow generation and analysis.

[0010] Preferably, the complete power flow X is subjected to a mask operation, and then input into the power system power flow high-dimensional representation generation module together with the mask matrix M and the adjacency matrix A to obtain the node high-dimensional representation, and then the node high-dimensional representation is input into the power system power flow high-dimensional representation decoding module to obtain the voltage and power information, and the power flow recovery value is predicted.

[0011] More preferably, after obtaining the masked power flow, the power flow transformation is performed to obtain the real part of the voltage e of each node. i and the imaginary part f i ;After the power flow changes, the four characteristics of each node become P, Q, e, and f;

[0012] For PQ nodes, in the power flow calculation mask mode, the mask matrix corresponds to [1, 1, 0, 0]. In the reactive configuration mask mode, the mask matrix of nodes with capacitors and reactors corresponds to [1, 0, 0, 0].

[0013] For the PV node, the corresponding behavior of the mask matrix in the two mask modes of the real part is [1, 0, 0, 0];

[0014] For balanced nodes, the corresponding behavior of the mask matrix in the two mask modes is [0, 0, 1, 1];

[0015] Masked node features The mask matrix is ​​processed through a dimensionality-enhancing network, i.e., the dimensionality-enhancing of the power flow features and the dimensionality-enhancing of the mask matrix are superimposed and used as the output.

[0016] For the lth graph learning unit, given the features of each node in the input node feature matrix Determine the operation mechanism of the neighborhood attention module, given the input node feature matrix H (l) , determine the operation mechanism of the global attention module and the residual connection operation mechanism, and form the layer-normalized input H′ after input superposition (l) ;

[0017] The output node of the encoder is represented in high dimension as H en .

[0018] More preferably, for voltage information, the forward transmission process is as follows:

[0019] Define the channel matrix C corresponding to the real part e and imaginary part f of the voltage e , C f , define the channel operation as follows:

[0020]

[0021] Thus, the encoder output is transformed into a channel feature matrix H v , σ GELU is the GELU activation function;

[0022] H vd Transpose the first and second dimension features of v , each node corresponds to two channel vectors h′ e,i , h′ f,i ;

[0023] Define the dimension reduction transformation vector w of the two channels e 、w f , then the prediction results of the real and imaginary parts of the voltage at the i-th node are They are:

[0024]

[0025] Convert the real and imaginary parts of voltage back to voltage amplitude Phase Angle

[0026]

[0027] For power information, the forward transmission process is as follows:

[0028] Let S i Represents the power phasor of node i. The power of node i and the voltage of each node obey the power flow equation:

[0029]

[0030] Among them, V i represents the voltage phasor at node i, Y ij represents the mutual admittance of nodes i and j;

[0031] The node power feature extraction is expressed as follows:

[0032] h s,i =h de,i W1∑ j a ij h de,j W2

[0033] Among them, h d,i H de The i-th row vector of , W1, W2 are two different characteristic transformation matrices, which are used to construct the characteristics of the voltage phasor and its conjugate value, including the node power phasor characteristics h s,i H s represents the node power characteristic matrix;

[0034] After obtaining the power characteristic matrix, define the channel matrix C corresponding to active power P and reactive power Q P , C Q , and the dimension reduction transformation vector w P、w Q , and obtain the active and reactive power prediction results of each node and The prediction results constitute the power flow recovery value X r .

[0035] Preferably, the loss function of the power system pre-trained large model is specifically:

[0036]

[0037] in, is the total loss value of the tth training cycle, μ U (t) and μ S (t) are the loss values ​​of the tth round and The weight coefficients are initial values ​​μ0 and 1-μ0.

[0038] Preferably, the initial value of the power flow X0, the power flow calculation mask matrix M0, and the adjacency matrix A are used as input to finally obtain the power flow solution estimate X e ;

[0039] Select the estimated value of the power flow solution X e The voltage solution estimate X in v , together with the initial value of the flow X0, constitutes the initial value of the numerical solution, and together with the node admittance matrix Y, serves as the input of the mainstream numerical solution algorithm, and finally obtains the accurate value of the flow solution X s .

[0040] More preferably, the estimated value of each node voltage solution is taken from the power flow estimate, and X v =X e,(:,3:4) , combining X0 and X v The initial value of the numerical solution is as follows:

[0041]

[0042] After numerical solution, the exact value of the power flow solution X is obtained. s .

[0043] In a second aspect, an embodiment of the present invention provides a power flow generation and analysis system based on a pre-trained large model of a power system, including:

[0044] Building a module to build a large pre-trained model of the power system including feature dimension upgrade-encoder-decoder-feature dimension reduction;

[0045] The output module maps the power system power flow information into a topologically decoupled high-dimensional representation of nodes in a high-dimensional space through power flow laws, which is applied to downstream tasks of future power flow generation and analysis.

[0046] In a third aspect, a computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for power flow generation and analysis based on a pre-trained large model of a power system when executing the computer program.

[0047] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned power flow generation and analysis method based on a pre-trained large model of the power system.

[0048] Compared with the prior art, the present invention has at least the following beneficial effects:

[0049] The power flow generation and analysis method based on the pre-trained large model of the power system adopts a pre-trained large model that contains the basic physical laws of the power system to achieve scalability for downstream tasks from planning to operation, such as AC power flow calculation, optimal power flow calculation, static safety analysis, and dynamic safety analysis. It has the advantage of adapting to different operating topologies and systems of different scales, and provides a new type of high-efficiency and high-reliability power system analysis method, which strongly supports system planning, operation control and safety assessment.

[0050] Furthermore, the complete input power flow is destroyed through masking operation, and the power system power flow high-dimensional representation generation module performs feature encoding and the power system power flow high-dimensional representation decoding module performs feature decoding to restore the complete power flow, thereby encouraging the model to capture the power flow laws of the power system.

[0051] Furthermore, the high-dimensional representation module of the power system flow is refined in the design of the encoder's graph representation unit. By superimposing the neighborhood attention and global attention operation mechanisms, the model is promoted to capture the neighborhood topological characteristics and global feature correlations, thereby constructing a topologically decoupled node representation in the high-dimensional space.

[0052] Furthermore, the power system power flow high-dimensional representation decoding module decodes the node representation in the high-dimensional space into a power flow recovery value with physical meaning in the low-dimensional space through the graph representation unit and dimensionality reduction link of the decoder.

[0053] Furthermore, by establishing a loss function that is guided by the physical knowledge of the power system and is a mixture of supervision and unsupervised learning, the weight of the loss term is adaptively adjusted during the training process, taking into account both the convergence efficiency of large model training and the exploration of the inherent laws of the power system.

[0054] Furthermore, the large model with tidal current laws can be applied to two downstream tasks, tidal current calculation and tidal current convergence adjustment, without fine-tuning. Through good generalization performance, it can complete the convergence adjustment of non-convergent samples, thus overcoming the key difficulties in tidal current generation and analysis.

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

[0056] In summary, the power system pre-trained large model of the present invention has the advantages of adapting to different operating topologies and systems of different scales, providing a new type of power system analysis method with high efficiency and high reliability, and effectively supporting system planning, operation control and safety assessment.

[0057] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 The overall architecture of the masked pre-trained large model and the downstream task application process;

[0059] Figure 2 The structure of the graph representation unit;

[0060] Figure 3 It is the IEEE39-node system benchmark topology;

[0061] Figure 4 is the learning rate change curve;

[0062] Figure 5 is the loss weight coefficient change curve;

[0063] Figure 6 is the supervised loss change curve;

[0064] Figure 7 is the unsupervised loss change curve;

[0065] Figure 8 A schematic diagram of a computer device provided by an embodiment of the present invention;

[0066] Fig. 9 The block diagram of a chip provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0067] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0068] In the description of the present invention, it should be understood that the terms “include” and “comprises” indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.

[0069] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0070] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects are in an "or" relationship.

[0071] It should be understood that, although the terms first, second, third, etc. may be used to describe preset ranges, etc. in the embodiments of the present invention, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from each other. 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.

[0072] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0073] The present invention provides a power flow generation and analysis method based on a pre-trained large model of an electric power system, constructs a pre-trained large model architecture of "feature dimension upgrading-encoder-decoder-feature dimension reduction", and maps the power system power flow information into a high-dimensional representation of nodes with topological decoupling in a high-dimensional space through the learned power flow law; in terms of the design details of the pre-trained large model, firstly, a refined design is performed on the graph representation unit of the encoder, and the model is promoted to capture the neighborhood topological characteristics and global feature correlations through the superposition of the neighborhood attention and global attention operation mechanisms, thereby supporting the "feature dimension upgrading-encoder" structure to construct a topologically decoupled node representation in a high-dimensional space; secondly, according to the physical characteristics of the power system power flow, a power system is proposed A dedicated multi-class mask operation mode adopts a differentiated mask operation mechanism during training and testing, and proposes a mask matrix form suitable for power flow characteristics and dimensional characterization, so that the large model can effectively capture the correlation between nodes and node electrical quantities in the power system; thirdly, a loss function guided by physical knowledge of the power system, and a mixed supervision and unsupervised loss function is established, and the weight of the loss term is adaptively adjusted during the training process, taking into account the convergence efficiency of the large model training and the exploration of the internal laws of the power system; fourthly, the large model that has learned the power flow law can be applied to the two downstream tasks of power flow calculation and power flow convergence adjustment without fine-tuning, and the convergence adjustment of non-convergent samples is completed through good generalization ability, which overcomes the key difficulties in power flow generation. The method proposed in the present invention can design a pre-trained large model containing the power system power flow law, and achieve strong scalability in various downstream tasks by constructing a topologically decoupled node representation, and naturally has the advantages of facing different system scales and network topologies, providing a new type of power system analysis method with high efficiency and high reliability, and strongly supporting system planning, operation control and safety assessment.

[0074] See also Figure 1 The present invention provides a power flow generation and analysis method based on a large pre-trained model of a power system, comprising the following steps:

[0075] S1. Build a large pre-trained model of the power system;

[0076] For an N-node power system, the power system pre-trained large model is used to complete the power flow Mask Matrix and the adjacency matrix As input; after the complete power flow is masked, it enters the power system power flow high-dimensional representation generation module together with the mask matrix and the adjacency matrix to obtain the topologically decoupled node high-dimensional representation; after passing through the power system power flow high-dimensional representation decoding module, the representation is converted into the power flow recovery value

[0077] Among them, the adjacency matrix A is used to describe the topological structure of the power system.

[0078] Power System Pre-trained Large Model

[0079] 1) Input design

[0080] The complete power flow X includes the active power P of each node i , reactive power Q i , voltage amplitude V i , voltage phase angle θ i , such as:

[0081]

[0082] According to the node admittance matrix Y of the power system, the adjacency matrix A is constructed, and its element a ij It is expressed as follows:

[0083]

[0084] Among them, |y ij | represents the modulus value of the corresponding element of the node admittance matrix.

[0085] The setting of the mask matrix M is related to the power flow mask position after the mask operation, and its elements are only 0 and 1. Element 1 indicates that the corresponding value of the position is the real value, and 0 indicates that it is a mask value.

[0086] 2) Mask operation

[0087] The power system includes three types of nodes: PQ nodes, PV nodes and balance nodes. Combined with the actual application scenarios of the power system, three mask operation modes are formed:

[0088] a. Transparent transmission mode. All nodes are not masked.

[0089] b. Power flow calculation mask mode. Combine the power flow matrix of formula (1) and mask V and θ of PQ nodes, Q and θ of PV nodes, and P and Q of balance nodes.

[0090] c. Reactive configuration mask mode: Mask the Q, V, and θ of the PQ nodes with capacitors and reactors, and the mask format of the remaining nodes is consistent with the power flow calculation mode.

[0091] For the input complete power flow, the above modes all follow the unified mask mathematical expression, that is, P, Q, θ of the mask position are set to 0, and V is set to 1.

[0092] During the training process, any sample is randomly selected from any of the above mask modes for calculation. During the test process, the power flow calculation mask mode is used.

[0093] 3) Generation of high-dimensional representation of power system flow

[0094] The power system power flow high-dimensional representation generation module includes power flow representation, dimension-enhancing network and encoder.

[0095] After obtaining the masked power flow, the power flow transformation is performed according to the following formula: i and the imaginary part f i .

[0096] e i +jf i =V i cosθ i +jV i sinθ i (3)

[0097] After the power flow transformation, the four features of each node become P, Q, e, and f. The mask matrix M is used to mark the mask positions of these features:

[0098] a. For PQ nodes, in the power flow calculation mask mode, the mask matrix corresponds to [1, 1, 0, 0]. In the reactive configuration mask mode, the mask matrix of nodes with capacitors and reactors corresponds to [1, 0, 0, 0].

[0099] b. For the PV node, although only V is masked, the corresponding behavior of the mask matrix in the two masking modes after the operation of formula (2) is [1, 0, 0, 0];

[0100] c. For balanced nodes, the corresponding behavior of the mask matrix in the two mask modes is [0, 0, 1, 1].

[0101] It should be noted that in transparent transmission mode, all elements of the mask matrix are 1.

[0102] Masked node features The mask matrix needs to go through the dimension-upgrading network, that is, the dimension-upgrading of the power flow features and the dimension-upgrading of the mask matrix, and then the superposition is used as the output:

[0103] X in =X M W X +MW M (4)

[0104] in, are the transformation matrices for dimensionality upgrading of trend features and mask matrix respectively, and E is the dimension of the upgraded representation. Represents the node feature matrix after masking in high-dimensional space.

[0105] Based on the output matrix of the dimension-raising network, the encoder uses a stack of graph representation units for feature extraction. The structure of the graph representation unit is as follows: Figure 2 shown.

[0106] The innovation of the graph representation unit is mainly concentrated in the core design part. For the lth graph learning unit, given the feature of each node in the input node feature matrix The operation mechanism of the neighborhood attention module is as follows:

[0107]

[0108] in, is the neighborhood of the ith node, including all neighboring nodes directly connected to the node (including the node itself), K is the number of attention heads, is the transformation matrix of the kth attention head, is the attention coefficient between the kth head and the i-th and j-th nodes, calculated by the following formula:

[0109]

[0110] in, is the self-attention learnable parameter of the k-th head, σ leaky is the leaky ReLu activation function. Given input x, output y, σ leaky The function looks like:

[0111]

[0112] Given the input node feature matrix H (l) , the operation mechanism of the global attention module is as follows:

[0113]

[0114] in, is the transformation matrix, d is H (l) The dimensions of the transformed matrix.

[0115] The residual connection operation mechanism is as follows:

[0116]

[0117] in, is the transformation matrix.

[0118] After the above three parts of input are superimposed, the layer normalized input H′ is formed (l) :

[0119]

[0120] Layer normalization, feedforward network and activation function are all used in existing technologies. (l) , output y (l) , the feedforward network is expressed as follows:

[0121]

[0122] Among them, σ GELU is the GELU activation function.

[0123] Finally, the output node of the encoder is represented in high dimension as H en .

[0124] 4) High-dimensional representation and decoding of power system flow

[0125] The power system power flow high-dimensional representation decoding module includes a decoder, power feature extraction, channel amplification network and power flow feature dimensionality reduction; the graph representation unit of the decoder is consistent with that of the encoder and will not be repeated here. Its output is recorded as The voltage and power information are obtained through different forward transmission branches.

[0126] For voltage information, the forward transmission process is as follows:

[0127] a. Define the channel matrix corresponding to the real part e and imaginary part f of the voltage Define the channel operation as follows:

[0128]

[0129] Thus, the encoder output is transformed into a channel feature matrix σ GELU is the GELU activation function.

[0130] b. H vd Transpose the first and second dimension features of Each node corresponds to two channel vectors

[0131] c. Define the dimension reduction transformation vector of the two channels The predicted results of the real and imaginary parts of the voltage at the ith node are They are:

[0132]

[0133]

[0134] d. According to the following formula, convert the real and imaginary parts of the voltage back to the voltage amplitude Phase Angle

[0135]

[0136]

[0137] For power information, the forward transmission process is as follows:

[0138] a. Let S i Represents the power phasor of node i. The power of node i and the voltage of each node obey the power flow equation:

[0139]

[0140] Among them, V i =e i +jf i represents the voltage phasor at node i (superscript * indicates conjugate), Y ij represents the mutual admittance of nodes i and j.

[0141] Considering the voltage transfer process, H de Mapped into the real and imaginary parts of voltage, it can be approximately considered that H de is a high-dimensional representation of the voltage phasor. Following formula (17), the node power feature extraction is expressed as follows:

[0142] h s,i =h de,i W1∑ j a ij h de,j W2 (18)

[0143] Among them, h d,i H de The i-th row vector of are two different characteristic transformation matrices, which are used to construct the characteristics of the voltage phasor and its conjugate value, including the node power phasor characteristics h s,i Including Represents the node power characteristic matrix.

[0144] b. After obtaining the power characteristic matrix, define the channel matrix corresponding to active power P and reactive power Q And the dimension reduction transformation vector Similar to equations (12) to (14), the prediction results of active and reactive power of each node are obtained: and

[0145] The above prediction results constitute the power flow recovery value

[0146] 5) Loss Function

[0147] Loss Function Defines the optimization objectives of the pre-trained model, including supervised loss terms and the unsupervised loss term Among them, there is supervised loss It is the superposition of node power flow characteristics and branch active power recovery loss:

[0148]

[0149] Among them, B represents the number of samples in the training set. represents the node power flow characteristics and branch active power recovery loss of the bth sample, ε N , ε P is the weight coefficient of the two losses.

[0150] Used to monitor the recovery of the complete flow of the node, such as:

[0151]

[0152] Among them, X b(i,j) , X r,b(i,j) Represents the element in the i-th row and j-th column of the input complete power flow and output power flow recovery value of the b-th sample. b(i,j) =0,M b(i,j) =1 defines the positions of masked and non-masked elements respectively, and n represents the number of elements at the corresponding positions. ε0 and ε1 are weights, and setting ε0>ε1 makes the model pay more attention to the recovery of masked variables.

[0153] On this basis By promoting the recovery of branch active power, the model's ability to fit the node voltage phase angle is further improved, as shown in the following figure:

[0154]

[0155] The subscript "b" indicates the variable belonging to the bth sample. L,b is the number of branches. P L,bl The predicted value and actual value of the active power of the lth branch are respectively obtained by calculating the branch power flow equation. In the branch power flow equation, G bl , B bl are the conductance and susceptance of the lth branch respectively. Let the nodes at both ends be numbered i and j, then the relationship between them and the node admittance matrix elements satisfies y bij =G bl +jB bl .

[0156] Unsupervised loss term According to the definition of Kirchhoff's current law, the power imbalance of each node is counted:

[0157]

[0158] Among them, T b (i) and F b (i) represents the set of branches where power flows into and out of node i, Represents the reactive power prediction value of branch l.

[0159] Considering It is used to improve the numerical fitting ability of the model. The purpose is to improve the model's ability to explore the inherent laws of tidal distribution. Therefore, at the beginning of training, Smaller and larger weights encourage the model to form the ability to explore physical laws. During the training process, gradually reduce The weight of The weight of , thus encouraging the model to capture the numerical regularity of historical scenes. Finally, the weights of the two are stabilized within a certain range.

[0160]

[0161] in, is the total loss value of the tth training cycle, μ U (t) and μ S (t) are the loss values ​​of the tth round and The initial values ​​of the two are set to μ0 and 1-μ0.

[0162] During the training process, the weight μ U (t) gradually decays to μ T , and the weight μ S (t) gradually rises to 1-μ T , the two satisfy the following relationship:

[0163]

[0164] S2. Future state trend generation downstream tasks.

[0165] It includes two downstream tasks: power flow calculation and power flow convergence adjustment.

[0166] S201, flow calculation based on initial flow value Power flow calculation mask matrix The adjacency matrix A is input, and the estimated value of the power flow solution is finally obtained

[0167] Among them, the initial value of the power flow X0 needs to be processed by the power flow calculation mask operation, and the other steps are consistent with the pre-trained large model of the power system.

[0168] The initial value of the power flow X0 is as follows:

[0169]

[0170] In the mask operation part, the power flow calculation mask mode is uniformly set to obtain the power flow calculation mask matrix M0. The power system high-dimensional representation generation and power system high-dimensional representation decoding modules are consistent with the pre-trained model and will not be repeated. Finally, the power flow calculation gives the power flow estimation value X e , there is X e,(i,:) =[P e,i ,Q e,i ,V e,i ,θ e,i ].

[0171] It should be pointed out that the downstream task links no longer require training, that is, there is no need for the modeling process of equations (19) to (25).

[0172] S202, power flow convergence adjustment selects the voltage solution estimate in the power flow solution estimate Together with the initial value of the power flow X0, it forms the initial value of the numerical solution and the node admittance matrix Together as the input of mainstream numerical solution algorithms (such as Newton-Raphson method), the accurate value of the power flow solution is finally obtained.

[0173] Take the estimated value of each node voltage solution from the power flow estimate, and we have X v =X e,(:,3:4) .

[0174] according to Figure 1 The format combines X0 and X v The initial value of the numerical solution is as follows:

[0175]

[0176] After numerical solution, the exact value of the power flow solution X is obtained. s .

[0177] In another embodiment of the present invention, a power flow generation and analysis system based on a pre-trained large model of an electric power system is provided. The system can be used to implement the above-mentioned power flow generation and analysis method based on a pre-trained large model of an electric power system. Specifically, the power flow generation and analysis system based on a pre-trained large model of an electric power system includes a construction module and an output module.

[0178] Among them, the construction module constructs a large pre-trained model of the power system including feature dimension upgrading-encoder-decoder-feature dimension reduction;

[0179] The output module maps the power system power flow information into a topologically decoupled high-dimensional representation of nodes in a high-dimensional space through power flow laws, which is applied to downstream tasks of future power flow generation and analysis.

[0180] In another embodiment of the present invention, a terminal device is provided, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of the power flow generation and analysis method based on the pre-trained large model of the power system, including:

[0181] Construct a large pre-trained model of the power system that includes feature dimensionality upgrade-encoder-decoder-feature dimensionality reduction; through the power flow law, map the power system power flow information into a topologically decoupled high-dimensional representation of nodes in a high-dimensional space, which is applied to downstream tasks of future power flow generation and analysis.

[0182] In another embodiment of the present invention, the present invention further provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a terminal device for storing programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and the extended storage medium supported by the terminal device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory.

[0183] The processor may load and execute one or more instructions stored in a computer-readable storage medium to implement the corresponding steps of the power flow generation and analysis method based on the pre-trained large model of the power system in the above embodiment; the processor may load and execute the following steps:

[0184] Construct a large pre-trained model of the power system that includes feature dimensionality upgrade-encoder-decoder-feature dimensionality reduction; through the power flow law, map the power system power flow information into a topologically decoupled high-dimensional representation of nodes in a high-dimensional space, which is applied to downstream tasks of future power flow generation and analysis.

[0185] See also Figure 8 , the terminal device is a computer device, and the computer device 60 of this embodiment includes: a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When the computer program 63 is executed by the processor 61, the method for calculating the composition of fluid in the reservoir transformation wellbore in the embodiment is realized. To avoid repetition, it is not described one by one here. Alternatively, when the computer program 63 is executed by the processor 61, the functions of each model / unit in the calculation system for the composition of fluid in the reservoir transformation wellbore in the embodiment are realized. To avoid repetition, it is not described one by one here.

[0186] The computer device 60 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will appreciate that Figure 8 This is only an example of the computer device 60 and does not constitute a limitation of the computer device 60. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.

[0187] The processor 61 may be a central processing unit (CPU), or other general-purpose processors, central processing units, graphics processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, data processing logic based on quantum computing, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

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

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

[0190] Any reference to memory, database or other media used in the embodiments provided in the present application may include at least one of non-volatile and volatile memory. Non-volatile memory may 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 may include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0191] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.

[0192] See also Fig. 9, the terminal device is a chip, and the chip 600 of this embodiment includes a processor 622, which may be one or more, and a memory 632 for storing a computer program executable by the processor 622. The computer program stored in the memory 632 may include one or more modules, each corresponding to a set of instructions. In addition, the processor 622 may be configured to execute the computer program to execute the above-mentioned generalizable monocular absolute depth map estimation method.

[0193] In addition, the chip 600 may further include a power supply component 626 and a communication component 650, wherein the power supply component 626 may be configured to perform power management of the chip 600, and the communication component 650 may be configured to implement communication, for example, wired or wireless communication, of the chip 600. In addition, the chip 600 may further include an input / output interface 658. The chip 600 may operate based on an operating system stored in the memory 632.

[0194] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention described and shown in the drawings here can usually be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0195] The pre-trained large model construction method and device disclosed in the present invention are applicable to an actual large power grid with thousands of nodes. To simplify the description, this embodiment takes the IEEE 39-node system as an example to illustrate the implementation process of the method.

[0196] Test system sample generation

[0197] See also Figure 3 , the initial values ​​of the benchmark power flow are shown in Table 1. The data set generation rules are as follows:

[0198] (1) 600 load scenarios and 598 different topologies (baseline topology, any one line disconnected topology, any two lines disconnected topology) are selected for sample generation. By combining load scenarios and topologies in pairs, 358,800 power flow scenarios can be obtained.

[0199] (2) In each power flow scenario, the load level is randomly adjusted within the range of 100% to 200%, and the installed capacity of the generator is proportionally expanded. The generator output is distributed within the output upper limit of each generator to balance the system power.

[0200] (3) Use the Newton-Raphson method to calculate the power flow of the above scenarios, put the non-convergent scenarios into the non-convergent sample set, and put the convergent scenarios into the convergent sample set.

[0201] According to the above steps, a total of 288,161 converged samples and 70,639 non-convergent samples were generated. 250,000 samples were selected from the converged sample set as the training set, and the remaining 38,161 samples were used as the test set. All 70,639 non-convergent samples were used as the downstream task power flow convergence adjustment test set.

[0202] Table 1 IEEE39 bus system benchmark power flow initial value information

[0203]

[0204]

[0205] Implementation process of the power system pre-trained large model

[0206] 1) Parameter settings

[0207] Table 2 Model parameter settings

[0208]

[0209]

[0210] 2) Input design

[0211] Tables 3, 4 and 5 give the complete power flow X, node admittance matrix Y and adjacency matrix A of a single sample.

[0212] Table 2 Sample complete flow

[0213] Bus P / MW Q / Mvar V / pu θ / ° 1 0 0 1.039748 -0.0217 2 0 0 0.946699 32.8948 3 -391.1 -2.9 0.915004 22.3443 4 -618.6 -227.6 0.894997 15.5225 5 0 0 0.904649 14.8538 6 0 0 0.909062 15.7167 7 -285.8 -102.7 0.895688 11.6409 8 -631.3 -212.8 0.895781 10.4907 9 0 0 0.981996 3.8437 10 0 0 0.935381 19.2585 11 0 0 0.924307 18.0833 12 -11.6 -119.6 0.901807 18.3 13 0 0 0.926825 18.7305 14 0 0 0.913114 17.5373 15 -399.4 -191 0.910274 18.2475 16 -382 -374.5 0.931572 20.9848 17 0 0 0.928394 20.4647 18 -195.7 -37.2 0.920978 20.5134 19 0 0 1.039958 25.7205 20 -777.4 -117.7 0.990221 25.4266 21 -314.2 -131.8 0.931726 24.5685 22 0 0 0.958759 30.9549 23 -323.2 -110.4 0.956035 32.2441 24 -415.3 124 0.938794 21.242 25 -277.2 -58.4 0.948476 34.0086 26 -189.7 -23.2 0.954453 21.71 27 -347.7 -93.4 0.933446 19.3846 28 -218.6 -29.3 0.992586 18.8067 29 -359.9 -34.2 1.005085 19.84 30 865.9 358.4 0.976 42.9071 31 688.4 244.4 0.955 27.1511 32 632.9 506.9 0.969 27.8522 33 492.1 544.4 1.047 29.4429 34 750.2 295 1.031 32.9445 35 508.2 255.3 0.97 35.549 36 1035 429.4 1.035 48.6436 37 1084 328.1 0.974 50.0805 38 445.3 162.9 1.007 23.7983 39 -262.5 73.8 1.03 0

[0214] Table 3 Node admittance matrix (sparse matrix format)

[0215]

[0216]

[0217] Table 4 Sample adjacency matrix (sparse matrix format)

[0218]

[0219]

[0220] The mask matrix M changes as the mask pattern changes:

[0221] a. When the mask mode is transparent mode, the mask matrix M is as follows:

[0222] Table 5 Transparent mode mask matrix

[0223]

[0224]

[0225] b. When the mask mode is the power flow calculation mode, the mask matrix M is as follows:

[0226] Table 7 Power flow calculation model mask matrix

[0227]

[0228]

[0229] c. When the mask mode is the reactive configuration mode, the mask matrix M is as follows:

[0230] Table 8 Reactive configuration mode mask matrix

[0231]

[0232]

[0233] 3) Generation of high-dimensional representation of power system flow

[0234] After masking, the masked node features are preprocessed to make different types of features have similar scales. The node active and node reactive power are divided by 100, and the voltage amplitude and phase angle are multiplied by 10 after being converted into the real and imaginary parts of the voltage.

[0235] Taking the power flow calculation mask mode as an example, after power flow representation and mask operation, the mask feature matrix X M As shown in the following table:

[0236] Table 9 Mask feature matrix

[0237]

[0238]

[0239] After the dimensionality-enhanced network processing, the encoder input X in for:

[0240] Table 10 Encoder input (first 10 columns)

[0241]

[0242]

[0243] After being processed by the encoder, the obtained topologically decoupled node high-dimensional representation H en As shown in the following table:

[0244] Table 11 High-dimensional representation of topologically decoupled nodes (first 10 columns)

[0245] Bus Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 Column 7 Column 8 Column 9 Column 10 1 -0.0854 -0.1642 -0.0785 -0.1696 -0.1383 -0.1597 -0.1524 -0.1398 -0.1494 0.0314 2 -0.1334 -0.1656 -0.0454 -0.1698 -0.1568 -0.1573 -0.1267 -0.1692 0.0248 -0.0493 3 -0.1656 -0.1543 -0.1254 0.1539 0.0584 0.0243 -0.0840 -0.1635 -0.0868 0.0193 4 -0.0344 -0.1700 0.0813 1.0839 -0.1466 -0.1684 -0.0471 -0.1683 -0.1698 -0.1352 5 -0.0205 -0.1691 -0.1695 -0.0886 -0.1579 -0.1687 0.1565 -0.1116 -0.1588 0.3438 6 -0.0815 -0.0189 -0.1553 -0.1670 -0.1587 -0.1700 -0.0638 -0.1405 -0.0787 -0.0646 7 -0.0673 0.3115 0.0088 -0.1458 0.0801 -0.1699 -0.1315 -0.1036 0.0375 0.2270 8 0.0540 -0.1179 -0.0951 -0.1655 -0.0826 -0.0917 -0.0746 -0.1694 0.0782 -0.0923 9 -0.0601 -0.1542 -0.0268 0.5215 -0.1690 -0.1674 -0.1632 -0.1578 -0.1545 -0.0719 10 -0.0208 0.2085 -0.1160 -0.1580 -0.1623 -0.1670 -0.1622 -0.1521 0.0894 -0.1342 11 -0.0573 -0.1681 -0.1670 -0.1120 -0.1690 -0.0489 0.0371 -0.1658 -0.0437 0.0135 12 -0.0894 -0.1452 0.0308 -0.1687 -0.1222 0.5793 0.9945 0.0113 -0.0048 -0.1177 13 -0.0383 -0.0894 -0.0095 -0.0866 -0.1580 -0.1271 -0.1440 -0.0446 0.4410 0.0450 14 -0.0763 -0.0112 -0.1691 -0.1060 -0.1323 -0.0277 0.0039 -0.0635 -0.1645 0.0279 15 -0.1663 -0.0316 0.1674 -0.1117 -0.1143 -0.1034 -0.1376 -0.1320 0.2658 -0.1647 16 -0.1219 -0.1018 -0.1653 -0.0773 -0.0991 -0.1621 -0.0877 -0.0985 -0.1671 -0.1631 17 -0.0180 -0.0919 -0.1299 -0.0338 0.1201 -0.0289 0.0648 -0.1426 0.0540 -0.1657 18 -0.1068 -0.1376 0.1196 -0.1467 -0.1644 -0.0742 -0.0840 -0.1503 0.5635 -0.0930 19 -0.1613 0.0858 0.3164 -0.0421 -0.0906 -0.1582 -0.0531 -0.1697 -0.0468 0.1963 20 -0.1679 0.2139 0.0605 -0.1559 -0.1699 -0.1081 -0.1245 -0.1548 -0.1140 0.0787 21 -0.0671 -0.0753 -0.0404 -0.0035 -0.1673 -0.1206 0.0319 -0.1666 0.1542 -0.0981 22 -0.1267 0.1493 -0.1128 -0.0517 -0.0877 -0.1518 0.1613 -0.0801 -0.1260 0.1345 23 -0.1690 -0.0084 -0.0439 -0.1648 -0.1688 -0.1385 0.1893 -0.1699 0.0620 0.2274 24 -0.1331 0.6318 -0.1556 -0.0540 -0.1384 -0.1220 -0.0531 -0.1415 0.0181 0.0022 25 -0.1214 -0.1642 -0.1471 -0.1550 -0.1565 -0.1616 -0.1580 -0.1674 -0.0052 -0.1660 26 -0.0604 -0.1689 -0.1515 -0.1665 -0.1698 -0.1048 -0.1599 -0.1676 -0.0365 -0.1424 27 -0.1651 -0.1652 0.0396 0.0195 -0.0860 0.1937 -0.1526 -0.1699 0.7349 -0.1675 28 0.0550 -0.1639 0.4582 -0.1408 -0.1315 -0.0461 -0.0265 -0.1582 -0.1640 0.1076 29 -0.1571 -0.1107 -0.1696 -0.1616 -0.1350 -0.1621 -0.1067 -0.1693 -0.1535 -0.1427 30 -0.1672 -0.1550 -0.0385 -0.1551 -0.1267 -0.1482 -0.1451 -0.1516 -0.1414 0.2328 31 -0.1013 0.1647 -0.1169 -0.1433 -0.1051 -0.1699 -0.1272 -0.1276 -0.1557 -0.0729 32 0.0385 -0.1591 -0.0598 -0.1690 -0.1186 -0.1185 -0.0952 0.0395 -0.1322 0.0021 33 -0.1103 -0.0643 0.1827 0.0019 -0.0704 -0.1696 -0.1694 -0.1681 -0.1378 -0.0792 34 -0.0911 -0.0327 0.0450 -0.0425 -0.0906 -0.0975 -0.0069 -0.1612 -0.0840 0.0094 35 -0.1601 -0.1690 0.1610 -0.0530 -0.1109 -0.1169 -0.0730 -0.1671 -0.1383 -0.0400 36 -0.1306 0.0410 -0.0351 -0.1623 -0.1075 -0.1219 -0.0737 -0.1497 -0.1567 -0.0097 37 -0.1629 -0.1215 -0.0073 -0.1043 -0.1224 -0.1340 0.0863 0.0939 -0.1371 -0.1174 38 -0.1623 -0.1399 -0.0823 -0.0359 -0.0475 -0.1619 -0.1392 -0.1690 -0.1521 0.0191 39 0.2733 -0.1362 -0.1424 -0.1018 -0.0944 -0.1693 -0.1556 -0.1692 -0.1700 -0.0052

[0246] 4) Power system flow high-dimensional representation decoding takes high-dimensional representation as input, and the decoder outputs H de As shown in the following table:

[0247] Table 12 Decoder output (first 10 columns)

[0248]

[0249]

[0250] Therefore, after the dimensionality reduction operation based on voltage and power, the power flow recovery value X r as follows:

[0251] Table 13 Power flow recovery value

[0252]

[0253]

[0254] Comparing the power flow recovery values ​​in Table 13 with the true power flow solutions in Table 3, it can be found that the model can restore each power flow feature well.

[0255] 5) Model training and testing

[0256] The maximum learning rate of the model training is set to 0.006. In the first 5 rounds of training, the learning rate is gradually increased to the maximum value using the linear warm-up method, and then the cosine annealing learning rate adjustment method is used for a total of 315 rounds of training. The learning rate change curve during all 320 rounds of training is as follows Figure 4 shown.

[0257] Set the initial value of the unsupervised loss term weight μ0=0.8 and the final value μ T =0.2. The weights of other parameters are: ε0=3, ε1=0.5, ε N =1,ε P =5. The supervised and unsupervised loss weight change curves, supervised loss change curves, and unsupervised loss change curves during training are shown in Figure 2. Figure 5 , Figure 6and Figure 7 shown.

[0258] After the training, the absolute error and relative error of the model's prediction results for various tidal characteristics are shown in Tables 14 and 15.

[0259] Table 14 Absolute error of model prediction results

[0260]

[0261] Table 15 Relative error of model prediction results

[0262] feature P / % Q / % V / % θ / % Relative error 1.13 1.87 0.15 1.82

[0263] It can be seen from the data in the table that the absolute error of the model's prediction of each tidal feature is at a small level, and the relative error of all feature prediction results is less than 2%, which proves that the model has excellent tidal feature extraction and mask position tidal feature recovery capabilities.

[0264] Downstream task application process

[0265] In order to demonstrate the application process of downstream tasks, a non-convergent sample is used as an analysis case. The initial value setting rule for the numerical solution of this sample is: V and θ of the PQ node are uniformly set to 1 and 0, and θ of the PV node is uniformly set to 0.

[0266] Table 16 and Table 17 give the representation of the power flow initial value X0 and the power flow calculation mask matrix M0 of the sample.

[0267] Table 16 Sample benchmark power flow initial value information

[0268]

[0269]

[0270] Table 17 Power flow calculation model mask matrix

[0271]

[0272]

[0273] Calculate the voltage solution estimate X v After that, the initial value of the numerical solution is formed with X0 as follows:

[0274] Table 18 Sample benchmark power flow initial value information

[0275] Bus P / MW Q / Mvar V / pu θ / ° 1 0 0 1.0282062 0.2426256 2 0 0 0.73295856 64.89303 3 -453.5 -3.38 0.76904905 47.63303 4 -643.1 -236.6 0.7993307 34.053337 5 0 0 0.8216707 32.535393 6 0 0 0.83188385 33.809135 7 -289 -103.8 0.80783623 27.543755 8 -661.5 -223 0.807173 25.478792 9 0 0 0.9133536 8.823745 10 0 0 0.87481576 37.51049 11 0 0 0.857669 36.295876 12 -11.37 -117.7 0.83211 36.342598 13 0 0 0.86235183 36.68873 14 0 0 0.8405805 34.701916 15 -424.5 -202.9 0.85907465 31.38125 16 -425.6 -417.3 0.88869816 32.834858 17 0 0 0.7883031 46.967823 18 -205.5 -39.01 0.78781015 46.22287 19 0 0 1.0194619 35.6572 20 -710.1 -107.5 0.978889 30.052193 21 -361.7 -151.8 0.8998469 36.05778 22 0 0 0.94464016 42.64925 23 -340.2 -116.3 0.94124675 44.162273 24 -430.4 128 0.8984558 32.940166 25 -292 -61.52 0.81639403 63.73838 26 -186.9 -22.85 0.8589568 54.002293 27 -368.7 -99.07 0.81274074 48.410072 28 -239.8 -32.13 0.9370341 58.395397 29 -379.7 -36.03 0.9708307 61.6945 30 1530 0 0.976 88.52849 31 1019.92 0 0.955 52.398296 32 678.6 0 0.969 47.443523 33 970.9 0 1.047 43.365406 34 30.73 0 1.031 30.083488 35 482.8 0 0.970 46.99131 36 1057 0 1.035 60.900753 37 454.4 0 0.974 74.53517 38 989.5 0 1.007 71.61861 39 0 0 1.030 0

[0276] Based on this, the Newton-Raphson method converges after 5 iterations, and the exact value of the power flow solution X is obtained. sfor:

[0277] Table 20 Sample power flow accurate solution

[0278]

[0279]

[0280] It can be seen that the present invention can adjust non-convergent samples to convergent samples through the pre-training model without fine-tuning training, thereby playing an important supporting role in the generation and analysis of new power system trends, verifying the effectiveness of the method of the present invention.

[0281] In summary, the present invention provides a method and device for power flow generation and analysis based on a large pre-trained model of a power system, which has the advantages of adapting to different operating topologies and systems of different scales, provides a new type of power system analysis method with high efficiency and high reliability, and strongly supports system planning, operation control and safety assessment.

[0282] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by 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 embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0283] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

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

[0285] In the embodiments provided by the present 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 only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0287] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0288] If the integrated module / unit is implemented in the form of 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, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased 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 electric carrier signals and telecommunication signals.

[0289] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0290] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0291] The above contents are only for explaining the technical idea of ​​the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.

Claims

1. A power flow generation and analysis method based on a large pre-trained model of a power system, characterized in that: The following steps are involved: Construct a large pre-trained power system model that includes feature dimension upgrade-encoder-decoder-feature dimension reduction. The large pre-trained power system model is based on the complete power flow. Mask Matrix and the adjacency matrix is the input; The complete power flow X is masked, and then input into the power system power flow high-dimensional representation generation module with the mask matrix M and the adjacency matrix A to obtain the node high-dimensional representation. The node high-dimensional representation is then input into the power system power flow high-dimensional representation decoding module to obtain the voltage and power information, and the power flow recovery value is predicted. For voltage information, the forward transmission process is as follows: Define the channel matrix C corresponding to the real part e and imaginary part f of the voltage e , C f , H de For the decoder output, define the channel operation as follows: Thus, the encoder output is transformed into a channel feature matrix H v , σ GELU is the GELU activation function; H vd Transpose the first dimension feature and the second dimension feature of v ′, each node corresponds to two channel vectors h′ e,i , h′ f,i ; Define the dimension reduction transformation vector w of the two channels e 、w f , then the prediction results of the real and imaginary parts of the voltage at the i-th node are They are: Convert the real and imaginary parts of voltage back to voltage amplitude Phase Angle For power information, the forward transmission process is as follows: Let S i Represents the power phasor of node i. The power of node i and the voltage of each node obey the power flow equation: Among them, V i represents the voltage phasor at node i, Y ij represents the mutual admittance of nodes i and j; The node power feature extraction is expressed as follows: h s,i =h de,i W1∑ j or ij h de,j W2 Among them, h d,i H de The i-th row vector of , W1, W2 are two different characteristic transformation matrices, which are used to construct the characteristics of the voltage phasor and its conjugate value, including the node power phasor characteristics h s,i H s represents the node power characteristic matrix; After obtaining the power characteristic matrix, define the channel matrix C corresponding to active power P and reactive power Q P , C Q , and the dimension reduction transformation vector w P 、w Q , and obtain the active and reactive power prediction results of each node and The prediction results constitute the power flow recovery value X r ; Through the power flow law, the power system power flow information is mapped into a topologically decoupled high-dimensional representation of nodes in a high-dimensional space, which is applied to downstream tasks of future power flow generation and analysis.

2. The power flow generation and analysis method based on the power system pre-trained large model according to claim 1 is characterized in that: After obtaining the masked power flow, the power flow transformation is performed to obtain the real part of the voltage at each node. i and the imaginary part f i ;After the power flow changes, the four characteristics of each node become P, Q, e, and f; For PQ nodes, in the power flow calculation mask mode, the mask matrix corresponds to [1, 1, 0, 0]. In the reactive configuration mask mode, the mask matrix of nodes with capacitors and reactors corresponds to [1, 0, 0, 0]. For the PV node, the corresponding behavior of the mask matrix in the two mask modes of the real part is [1, 0, 0, 0]; For balanced nodes, the corresponding behavior of the mask matrix in the two mask modes is [0, 0, 1, 1]; Masked node features The mask matrix is ​​processed through a dimensionality-enhancing network, i.e., the dimensionality-enhancing of the power flow features and the dimensionality-enhancing of the mask matrix are superimposed and used as the output. For the lth graph learning unit, given the features of each node in the input node feature matrix Determine the operation mechanism of the neighborhood attention module, given the input node feature matrix H (l) , determine the operation mechanism of the global attention module and the residual connection operation mechanism, and form the layer-normalized input H′ after input superposition (l) ; The output node of the encoder is represented in high dimension as H en .

3. The power flow generation and analysis method based on the power system pre-trained large model according to claim 1 is characterized in that: The loss function of the power system pre-trained large model is specifically: in, is the total loss value of the tth training cycle, μ U (t) and μ S (t) are the unsupervised loss values ​​of the tth round And supervised loss value The weight coefficients are μ0 and 1-μ0.

4. The power flow generation and analysis method based on the power system pre-trained large model according to claim 1 is characterized in that: Taking the initial value of the power flow X0, the power flow calculation mask matrix M0, and the adjacency matrix A as input, the power flow solution estimate X is finally obtained. e ; Select the estimated value of the power flow solution X e The voltage solution estimate X in v , together with the initial value of the flow X0, constitutes the initial value of the numerical solution, and together with the node admittance matrix Y, serves as the input of the mainstream numerical solution algorithm, and finally obtains the accurate value of the flow solution X s .

5. The power flow generation and analysis method based on the power system pre-trained large model according to claim 4 is characterized in that: Take the estimated value of each node voltage solution from the power flow estimate, and we have X v =X e,(:,3:4) , which refers to the matrix X e 3 to 4 columns of the new matrix, combining X0 and X v The initial value of the numerical solution is as follows: After numerical solution, the exact value of the power flow solution X is obtained. s .

6. A power flow generation and analysis system based on a large pre-trained model of the power system, characterized in that: include: Building modules, building a large pre-trained model of the power system including feature dimension upgrade-encoder-decoder-feature dimension reduction. The large pre-trained model of the power system is based on the complete flow Mask Matrix and the adjacency matrix is the input; The complete power flow X is masked, and then input into the power system power flow high-dimensional representation generation module with the mask matrix M and the adjacency matrix A to obtain the node high-dimensional representation. The node high-dimensional representation is then input into the power system power flow high-dimensional representation decoding module to obtain voltage information and power information, and the power flow recovery value is predicted. For voltage information, the forward transmission process is as follows: Define the channel matrix C corresponding to the real part e and imaginary part f of the voltage e , C f , H de For the decoder output, define the channel operation as follows: Thus, the encoder output is transformed into a channel feature matrix H v , σ GELU is the GELU activation function; H vd Transpose the first dimension feature and the second dimension feature of v ′, each node corresponds to two channel vectors h e ' ,i , h′ f,i ; Define the dimension reduction transformation vector w of the two channels e 、w f , then the prediction results of the real and imaginary parts of the voltage at the i-th node are They are: Convert the real and imaginary parts of voltage back to voltage amplitude Phase Angle For power information, the forward transmission process is as follows: Let S i Represents the power phasor of node i. The power of node i and the voltage of each node obey the power flow equation: Among them, V i represents the voltage phasor at node i, Y ij represents the mutual admittance of nodes i and j; The node power feature extraction is expressed as follows: h s,i =h de,i W1∑ j or ij h de,j W2 Among them, h d,i H de The i-th row vector of , W1, W2 are two different characteristic transformation matrices, which are used to construct the characteristics of the voltage phasor and its conjugate value, including the node power phasor characteristics h s,i H s represents the node power characteristic matrix; After obtaining the power characteristic matrix, define the channel matrix C corresponding to active power P and reactive power Q P , C Q , and the dimension reduction transformation vector w P 、w Q , and obtain the active and reactive power prediction results of each node and The prediction results constitute the power flow recovery value X r ; The output module maps the power system power flow information into a topologically decoupled high-dimensional representation of nodes in a high-dimensional space through power flow laws, which is applied to downstream tasks of future power flow generation and analysis.

7. The power flow generation and analysis system based on the power system pre-trained large model according to claim 6 is characterized in that: In the construction module, after obtaining the mask power flow, the power flow transformation is performed to obtain the real part of the voltage at each node. i and the imaginary part f i ;After the power flow changes, the four characteristics of each node become P, Q, e, and f; For PQ nodes, in the power flow calculation mask mode, the mask matrix corresponds to [1, 1, 0, 0]. In the reactive configuration mask mode, the mask matrix of nodes with capacitors and reactors corresponds to [1, 0, 0, 0]. For the PV node, the corresponding behavior of the mask matrix in the two mask modes of the real part is [1, 0, 0, 0]; For balanced nodes, the corresponding behavior of the mask matrix in the two mask modes is [0, 0, 1, 1]; Masked node features The mask matrix is ​​processed through a dimensionality-enhancing network, i.e., the dimensionality-enhancing of the power flow features and the dimensionality-enhancing of the mask matrix are superimposed and used as the output. For the lth graph learning unit, given the features of each node in the input node feature matrix Determine the operation mechanism of the neighborhood attention module, given the input node feature matrix H (l) , determine the operation mechanism of the global attention module and the residual connection operation mechanism, and form the layer-normalized input H′ after input superposition (l) ; The output node of the encoder is represented in high dimension as H en .

8. The power flow generation and analysis system based on the power system pre-trained large model according to claim 7 is characterized in that: The loss function of the power system pre-trained large model is specifically: in, is the total loss value of the tth training cycle, μ U (t) and μ S (t) are the unsupervised loss values ​​of the tth round And supervised loss value The weight coefficients are μ0 and 1-μ0.

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

10. 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, and the one or more programs include steps for executing the method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method, device and equipment for predicting static security risk of power grid and storage medium

    CN116756540A