Power grid structure data generation method and device, terminal equipment and storage medium
By automatically generating grid structure data, the problem of difficulty in obtaining real grid structure data is solved, and the effective generation and use of grid structure data is realized.
Patent Information
- Application Number
- CN202411646154.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-11
AI Technical Summary
The prior art is difficult to obtain real grid structure data, resulting in a lack of available grid structure data.
By obtaining the network quantity requirements and the node quantity requirements of each network, the grid structure data is automatically generated. The specific steps include generating the network, allocating the number of nodes, generating nodes and edges according to preset constraints, and finally obtaining grid structure data.
Automatically generate grid structure data, filling the data gap caused by difficulty in obtaining real grid structure data.
Smart Images

Figure CN119602228A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electric power automation technology, and in particular to a method, device, terminal equipment and storage medium for generating power grid structure data. Background Art
[0002] The analysis of grid structure data is of great significance for understanding the composition and potential connection rules of the entire network, and lays the foundation for further grid research such as power flow analysis. Due to the privacy and security issues of grid data, it is very difficult to obtain public real grid structure data. However, a large amount of grid structure data is needed in the field of grid structure data analysis. Therefore, a method that can automatically generate grid structure data is urgently needed to fill the data gap caused by the difficulty in obtaining real grid structure data. Summary of the invention
[0003] The present invention provides a method, an apparatus, a terminal device and a storage medium for generating power grid structure data, so as to solve the technical problem that the difficulty in acquiring real power grid structure data leads to the lack of available power grid structure data.
[0004] In order to solve the above technical problems, an embodiment of the present invention provides a method for generating power grid structure data, comprising:
[0005] Obtain the required number of networks and the required number of nodes for each network;
[0006] According to the network quantity requirement, generate a corresponding number of networks, and assign one node quantity requirement to each network;
[0007] generating nodes for each network according to the node quantity requirement of each network, the preset sliding bus quantity constraint and the preset generator-load ratio constraint;
[0008] Generate edges for each network according to the preset edge-node ratio constraints;
[0009] The power grid structure data is obtained based on all the networks.
[0010] As a preferred solution, before obtaining the network quantity requirement and the node quantity requirement of each network input by the user, the following is further included:
[0011] Obtaining a power grid type requirement input by a user; wherein the power grid type requirement includes: "only including distribution network" or "including transmission network and distribution network";
[0012] If the grid type requirement is "distribution network only", the network quantity requirement is set to 1, and the node quantity requirement input by the user is obtained;
[0013] If the power grid type requirement is "including transmission network and distribution network", the network quantity requirement input by the user is obtained, and the node quantity requirement for each network input by the user is obtained;
[0014] After allocating the node quantity requirement to each network, the method further includes:
[0015] If the grid type requirement is "distribution network only", the network type of the network is set to distribution network;
[0016] If the grid type requirement is "including transmission grid and distribution grid", the network type of each network is randomly set to transmission grid or distribution grid.
[0017] As a preferred solution, the generator-load ratio constraint includes:
[0018] The ratio between the number of generator nodes and the number of load nodes in each network in the power grid structure data satisfies a preset first ratio threshold range;
[0019] The sliding bus quantity constraint includes:
[0020] The number of sliding bus nodes of each network in the power grid structure data meets a preset sliding bus number threshold range;
[0021] The edge-node ratio constraint includes:
[0022] The ratio between the number of edges and the number of nodes of each network in the power grid structure data satisfies a preset second ratio threshold range.
[0023] As a preferred solution, the number of nodes is required to be a numerical range;
[0024] The generating of nodes for each network according to the node quantity requirement of each network, the preset sliding bus quantity constraint and the preset generator-load ratio constraint comprises:
[0025] For each of the networks, randomly select a value from the node quantity requirement of the network, and generate a corresponding number of nodes for the network;
[0026] Randomly select a value from the sliding bus number threshold range, and set the types of the corresponding number of nodes in the network as sliding bus nodes;
[0027] The type of a node in the network that has not been set is set as a relaxed bus node, and the types of other nodes that have not been set are randomly set as generator nodes or load nodes;
[0028] Repeating the node type adjustment operation until the network satisfies the generator-load ratio constraint;
[0029] The node type adjustment operation includes:
[0030] Calculating a first quantity ratio of generator nodes to load nodes in the network;
[0031] When the first quantity ratio is less than the minimum value of the first ratio threshold range, randomly selecting a number of load nodes, and resetting the selected load nodes to generator nodes;
[0032] When the first quantity ratio is greater than the maximum value of the first ratio threshold range, a number of generator nodes are randomly selected, and the selected generator nodes are reset as load nodes.
[0033] As a preferred solution, generating edges for each network according to a preset edge-node ratio constraint includes:
[0034] For each of the networks, generating a random number of edges for the network so that all nodes in the network are interconnected;
[0035] Repeating the edge quantity adjustment operation until the network satisfies the edge-node ratio constraint;
[0036] The edge quantity adjustment operation includes:
[0037] Calculating a second ratio of the number of edges to nodes within the network;
[0038] When the second quantity ratio is less than the minimum value of the second ratio threshold range, continue to randomly generate a number of edges;
[0039] When the second quantity ratio is greater than the maximum value of the second ratio threshold range, a number of edges are randomly selected; for each selected edge, it is determined whether there is any other path except the edge between the two nodes connected by the edge; if so, the edge is deleted; if not, the edge is retained.
[0040] As a preferred solution, the step of obtaining the grid structure data based on all the networks includes:
[0041] If the power grid type is "including transmission network and distribution network", one of the networks is randomly selected as the main network, and the remaining networks are used as subnets; each of the subnets is connected to the main network; all the connected networks are used as the power grid structure data;
[0042] If the power grid type is "only distribution network", the network is used as the power grid structure data.
[0043] As a preferred solution, the step of connecting each of the subnets to the main network includes:
[0044] Numbering all the subnets to obtain a subnet number for each subnet;
[0045] Numbering all load nodes in the main network to obtain a load node number of each load node in the main network;
[0046] For each subnet, a node is randomly selected from the subnet, and the selected node is connected to a load node in the main network whose load node number is equal to the subnet number of the subnet.
[0047] Based on the above embodiment, another embodiment of the present invention provides a power grid structure data generating device, including: a data acquisition module and a power grid structure data generating module;
[0048] The data acquisition module is used to obtain the network quantity requirement and the node quantity requirement of each network;
[0049] The grid structure data generation module is used to generate a corresponding number of networks according to the network quantity requirement, and allocate a node quantity requirement to each network; generate nodes for each network according to the node quantity requirement of each network, a preset sliding bus quantity constraint and a preset generator-load ratio constraint; generate edges for each network according to the preset edge-node ratio constraint; and obtain the grid structure data based on all the networks.
[0050] Based on the above embodiments, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the grid structure data generation method described in the above invention embodiments is implemented.
[0051] Based on the above embodiments, another embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the power grid structure data generation method described in the above invention embodiment.
[0052] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0053] The present invention obtains the network quantity requirement and the node quantity requirement of each network; generates a corresponding number of networks according to the network quantity requirement, and allocates a node quantity requirement to each network; generates nodes for each network according to the node quantity requirement of each network, a preset sliding bus quantity constraint and a preset generator-load ratio constraint; generates edges for each network according to the preset edge-node ratio constraint; and obtains power grid structure data according to all networks. The present invention provides a method for automatically generating power grid structure data, which automatically generates a corresponding number of networks and a corresponding number of nodes that meet the constraints according to the obtained network quantity requirement and node quantity requirement, and generates edges that meet the constraints for the network to obtain power grid structure data. The present invention can automatically generate power grid structure data, filling the data gap caused by the difficulty in obtaining real power grid structure data. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is a flowchart of a method for generating power grid structure data provided by an embodiment of the present invention;
[0055] Figure 2 It is a structural schematic diagram of a power grid structure data generating device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] 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 only 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.
[0057] Embodiment 1
[0058] Please refer to Figure 1 , is a flow chart of a method for generating power grid structure data provided by an embodiment of the present invention, comprising:
[0059] S1. Obtain the required number of networks and the required number of nodes for each network.
[0060] It should be noted that the network quantity requirement is used to limit the number of networks in the power grid structure data to be generated. Each network has its own node quantity requirement, which is used to limit the number of nodes to be generated in the network.
[0061] Existing grid generation methods are often limited by fixed rules or preset models, and the generation process lacks flexibility, making it difficult to meet diverse grid planning needs. The present invention provides a highly flexible generation mechanism, which only requires determining these two numerical requirements to randomly generate grid structure data that meets the requirements.
[0062] In a preferred embodiment, before obtaining the network quantity requirement and the node quantity requirement of each network input by the user, the method further includes:
[0063] Obtaining a power grid type requirement input by a user; wherein the power grid type requirement includes: "only including distribution network" or "including transmission network and distribution network";
[0064] If the grid type requirement is "distribution network only", the network quantity requirement is set to 1, and the node quantity requirement input by the user is obtained;
[0065] If the grid type requirement is "including transmission network and distribution network", the network quantity requirement input by the user is obtained, and the node quantity requirement for each network input by the user is obtained.
[0066] In this embodiment, the user can customize the scale and structure of the generated network and choose to generate network structure data of "only distribution network" or "including transmission network and distribution network". If the user selects "only distribution network", the network quantity requirement is automatically set to 1, and then the node quantity requirement entered by the user is further obtained. The node quantity requirement is for one network. If the user selects "including transmission network and distribution network", the user needs to further enter the network quantity requirement. If the user enters n, the network structure data with n networks will be generated. For these n networks, the user needs to further enter the node quantity requirement for each network.
[0067] S2. Generate a corresponding number of networks according to the network quantity requirement, and allocate one node quantity requirement to each network.
[0068] In step S2, a corresponding number of networks are generated according to the network quantity requirement. The network at this time is an initial network, that is, a network in which the network type is not set and no nodes are generated. Then, according to the node quantity requirement input by the user for each network, the node quantity requirement is configured to each network, so that each network has its own node quantity requirement.
[0069] In a preferred embodiment, after allocating a node quantity requirement to each network, the method further includes:
[0070] If the grid type requirement is "distribution network only", the network type of the network is set to distribution network;
[0071] If the grid type requirement is "including transmission grid and distribution grid", the network type of each network is randomly set to transmission grid or distribution grid.
[0072] In this embodiment, after the node quantity requirement is assigned to each network, or before the node quantity requirement is assigned to each network, the network type is set for each network according to the power grid type requirement input by the user. Specifically, if the power grid type requirement is limited to only the distribution network, there is only one network in the generated power grid structure data, and the network type of the network is set to the distribution network. If the power grid type requirement is set to include both the transmission network and the distribution network, there should be more than one network in the generated network structure, and the network types of these networks are randomly set to the transmission network or the distribution network.
[0073] In a preferred embodiment, the generator-load ratio constraint includes:
[0074] The ratio between the number of generator nodes and the number of load nodes in each network in the power grid structure data satisfies a preset first ratio threshold range;
[0075] The sliding bus quantity constraint includes:
[0076] The number of sliding bus nodes of each network in the power grid structure data meets a preset sliding bus number threshold range;
[0077] The edge-node ratio constraint includes:
[0078] The ratio between the number of edges and the number of nodes of each network in the power grid structure data satisfies a preset second ratio threshold range.
[0079] It should be noted that the present invention predefines some constraints to ensure the quality of the power grid topology. These constraints follow the key statistical characteristics of the actual power grid, such as the ratio of generators to loads in the power grid, the sliding bus requirements, and the connection relationship between nodes and edges, so that the randomly generated nodes and edge loads have the topological characteristics of the actual power grid.
[0080] The generator-load ratio constraint is used to constrain the ratio of the number of generator nodes to load nodes in the network. Generally, the first ratio threshold range is set to Among them, x1 and x2 are the preset range fluctuation values. In other words, the ratio of the number of generator nodes to the number of load nodes is limited to about.
[0081] The sliding bus number constraint is used to constrain the number of sliding bus nodes in the network. Generally, the sliding bus number range is set to [1, y], where y is the preset maximum number of sliding buses. In other words, there must be at least one sliding bus node in the network.
[0082] The edge-node ratio constraint is used for the ratio of the number of edges to nodes in the network. Generally, the second ratio threshold range is set to [1.22-z1, 1.22+z2], where z1 and z2 are preset range fluctuation values. In other words, the ratio of the number of edges to nodes is limited to about 1.22.
[0083] S3. Generate nodes for each network according to the node quantity requirement of each network, the preset sliding bus quantity constraint and the preset generator-load ratio constraint.
[0084] In a preferred embodiment, the number of nodes is required to be a numerical range;
[0085] The generating of nodes for each network according to the node quantity requirement of each network, the preset sliding bus quantity constraint and the preset generator-load ratio constraint comprises:
[0086] For each of the networks, randomly select a value from the node quantity requirement of the network, and generate a corresponding number of nodes for the network;
[0087] Randomly select a value from the sliding bus number threshold range, and set the types of the corresponding number of nodes in the network as sliding bus nodes;
[0088] The type of a node in the network that has not been set is set as a relaxed bus node, and the types of other nodes that have not been set are randomly set as generator nodes or load nodes;
[0089] Repeating the node type adjustment operation until the network satisfies the generator-load ratio constraint;
[0090] The node type adjustment operation includes:
[0091] Calculating a first quantity ratio of generator nodes to load nodes in the network;
[0092] When the first quantity ratio is less than the minimum value of the first ratio threshold range, randomly selecting a number of load nodes, and resetting the selected load nodes to generator nodes;
[0093] When the first quantity ratio is greater than the maximum value of the first ratio threshold range, a number of generator nodes are randomly selected, and the selected generator nodes are reset as load nodes.
[0094] It should be noted that the number of nodes is required to be a numerical range, including 4 different levels: 1 to 25, 26 to 50, 51 to 75, or 76 to 100.
[0095] When setting the node type, the relevant data of the node type will be randomly generated, such as the rated power of the generator node. These relevant data are all based on the actual power grid data, and the pre-set conditions must be met during random generation.
[0096] In this embodiment, for each network, a value is randomly selected from the required gear of the number of nodes of the network, and a corresponding number of nodes are generated for the network. The nodes generated at this time are initial nodes, that is, nodes whose node types are not set. A value is randomly selected from the sliding bus number threshold range, and the corresponding number of nodes in the network are set as sliding bus nodes. Then, a node is randomly selected from the nodes whose types are not set in the network, and its node type is set to a relaxed bus node, and the remaining nodes whose types are not set are randomly set to generator nodes or load nodes. Finally, the node type adjustment operation is repeated so that the network satisfies the generator-load ratio constraint. The node type adjustment operation first calculates the ratio of the number of generator nodes to the number of load nodes as the first quantity ratio. Then, the relationship between the first quantity and the first ratio threshold range is determined. If the first quantity ratio is less than the minimum value of the first ratio threshold range, it means that the number of generator nodes is too small and the number of load nodes is too large, so several load nodes are randomly selected, and the node type of the selected load nodes is reset to the generator node; if the first quantity ratio is greater than the maximum value of the first ratio threshold range, it means that the number of generator nodes is too large and the number of load nodes is too small, so several generator nodes are randomly selected, and the node type of the selected generator nodes is reset to the load node.
[0097] S4. Generate edges for each network according to a preset edge-node ratio constraint.
[0098] In a preferred embodiment, generating edges for each network according to a preset edge-node ratio constraint includes:
[0099] For each of the networks, generating a random number of edges for the network so that all nodes in the network are interconnected;
[0100] Repeating the edge quantity adjustment operation until the network satisfies the edge-node ratio constraint;
[0101] The edge quantity adjustment operation includes:
[0102] Calculating a second ratio of the number of edges to nodes within the network;
[0103] When the second quantity ratio is less than the minimum value of the second ratio threshold range, continue to randomly generate a number of edges;
[0104] When the second quantity ratio is greater than the maximum value of the second ratio threshold range, a number of edges are randomly selected; for each selected edge, it is determined whether there is any other path except the edge between the two nodes connected by the edge; if so, the edge is deleted; if not, the edge is retained.
[0105] In this embodiment, for each network, a random number of edges are first generated to ensure the connectivity of all nodes in the network, so that in the generated power grid structure data, each node must be connected to each other through a transmission line. Then, the edge quantity adjustment operation is repeated to make the network meet the edge-node ratio constraint. The edge quantity adjustment operation first calculates the ratio of the number of edges to the number of nodes as the second quantity ratio. Then, the relationship between the second quantity ratio and the second ratio threshold range is determined. If the second quantity ratio is less than the minimum value of the second ratio threshold range, it means that the number of edges is too small and the number of nodes is too large, so a number of edges are continuously randomly generated. If the second quantity ratio is greater than the maximum value of the second ratio threshold range, it means that the number of edges is too large and the number of nodes is too small, so a number of edges are randomly selected, and it is planned to delete the selected edges, and further determine whether there are other paths between the two nodes connected by each selected edge. If so, the edge is deleted, and if not, the edge is retained.
[0106] It should be noted that when randomly generating edges, the preset node degree verification standard can be referred to, and the nodes whose finite-dimensional node degrees do not meet the standard are used to generate edges.
[0107] S5. Obtain the power grid structure data based on all the networks.
[0108] In a preferred embodiment, obtaining the grid structure data according to all the networks includes:
[0109] If the power grid type is "including transmission network and distribution network", one of the networks is randomly selected as the main network, and the remaining networks are used as subnets; each of the subnets is connected to the main network; all the connected networks are used as the power grid structure data;
[0110] If the power grid type is "only distribution network", the network is used as the power grid structure data.
[0111] In this embodiment, when the power grid type is "including transmission network and distribution network", it is necessary to randomly select one network from all networks as the main network, and the remaining networks as subnets. The subnets are connected to the main network, and all connected networks are output as power grid structure data.
[0112] When the power grid type is "distribution network only", there is only one network, and this network can be output as the power grid structure data.
[0113] In a preferred embodiment, connecting each of the subnets to the main network includes:
[0114] Numbering all the subnets to obtain a subnet number for each subnet;
[0115] Numbering all load nodes in the main network to obtain a load node number of each load node in the main network;
[0116] For each subnet, a node is randomly selected from the subnet, and the selected node is connected to a load node in the main network whose load node number is equal to the subnet number of the subnet.
[0117] In this embodiment, each subnet is connected to a corresponding load node in the main network.
[0118] It should also be noted that the present invention provides a method for generating power grid structure data. On this basis, the present invention can further generate a textual description for the generated power grid structure data, which is used to describe the power grid type, the number of networks, the number of nodes in each network, the number of edges in each network, and the connection relationship between nodes of the power grid structure data.
[0119] For example, construct a function in the code to automatically generate a grid variable description:
[0120] First, the function determines the type of grid. If it is a certain type of grid (such as a transmission grid), a description will be generated to explain how many nodes the grid contains and what the node number range is. If it is another type of grid (such as a distribution grid), the description will be different. For example, for a transmission grid, the description will mention "transmission grid" and will list the total number of nodes and the range of node numbers in detail; for a distribution grid, the description will mention "distributiongrid" and include the index of the distribution grid and related node information, but for both types of networks, basic information about the number of nodes and the range of node numbers is also included.
[0121] Next, the function will traverse the relevant information of the node. Each node will be classified according to its type, and for each node, a corresponding description will be generated to indicate which type the node belongs to.
[0122] Finally, the function processes the connections between nodes. For each pair of connections, a description is generated to show that a node is connected to another node. The whole process gradually accumulates these descriptions and finally outputs a complete grid description, including node information and connection relationships.
[0123] Embodiment 2
[0124] Please refer to Figure 2, is a schematic diagram of the structure of a power grid structure data generating device provided by an embodiment of the present invention, comprising: a data acquisition module and a power grid structure data generating module;
[0125] The data acquisition module is used to obtain the network quantity requirement and the node quantity requirement of each network;
[0126] The power grid structure data generation module is used to randomly generate corresponding power grid structure data according to the network quantity requirement, the node quantity requirement of each network, and the preset generator-load ratio constraint and edge-node ratio constraint.
[0127] Embodiment 3
[0128] Accordingly, an embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements the power grid structure data generation method described in the above-mentioned embodiment of the invention.
[0129] Embodiment 4
[0130] Accordingly, an embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the power grid structure data generation method described in the above-mentioned embodiment of the invention.
[0131] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0132] Those skilled in the art can clearly understand that for the sake of convenience and brevity, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0133] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0134] 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 gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the device, and various interfaces and lines are used to connect various parts of the entire device.
[0135] The memory can be used to store the computer program, and the processor realizes various functions of the device by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0136] The storage medium is a storage medium, and the computer program is stored in the storage medium. When the computer program is executed by the processor, the steps of each method embodiment described above can be implemented. 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, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), 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.
[0137] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for generating power grid structure data, characterized in that: include: Obtain the required number of networks and the required number of nodes for each network; According to the network quantity requirement, generate a corresponding number of networks, and assign one node quantity requirement to each network; generating nodes for each network according to the node quantity requirement of each network, the preset sliding bus quantity constraint and the preset generator-load ratio constraint; Generate edges for each network according to the preset edge-node ratio constraints; The power grid structure data is obtained based on all the networks.
2. The method for generating power grid structure data according to claim 1, characterized in that: Before obtaining the network quantity requirement and node quantity requirement for each network input by the user, it also includes: Obtaining the power grid type requirement input by the user; wherein the power grid type requirement includes: "only including distribution network" or "including transmission network and distribution network"; If the grid type requirement is "distribution network only", the network quantity requirement is set to 1, and the node quantity requirement input by the user is obtained; If the grid type requirement is "including transmission network and distribution network", the network quantity requirement input by the user is obtained, and the node quantity requirement for each network input by the user is obtained; After allocating the node quantity requirement to each network, the method further includes: If the grid type requirement is "distribution network only", the network type of the network is set to distribution network; If the grid type requirement is "including transmission network and distribution network", the network type of each network is randomly set to transmission network or distribution network.
3. The method for generating power grid structure data according to claim 1, characterized in that: The generator-load ratio constraint includes: The ratio between the number of generator nodes and the number of load nodes in each network in the power grid structure data satisfies a preset first ratio threshold range; The sliding bus quantity constraint includes: The number of sliding bus nodes of each network in the power grid structure data meets a preset sliding bus number threshold range; The edge-node ratio constraint includes: The ratio between the number of edges and the number of nodes of each network in the power grid structure data satisfies a preset second ratio threshold range.
4. The method for generating power grid structure data according to claim 3, characterized in that: The number of nodes is required to be a numerical range; The generating of nodes for each network according to the node quantity requirement of each network, the preset sliding bus quantity constraint and the preset generator-load ratio constraint comprises: For each of the networks, randomly select a value from the node quantity requirement of the network, and generate a corresponding number of nodes for the network; Randomly select a value from the sliding bus number threshold range, and set the types of the corresponding number of nodes in the network as sliding bus nodes; The type of a node in the network that has not been set is set as a relaxed bus node, and the types of other nodes that have not been set are randomly set as generator nodes or load nodes; Repeating the node type adjustment operation until the network satisfies the generator-load ratio constraint; The node type adjustment operation includes: Calculating a first quantity ratio of generator nodes to load nodes in the network; When the first quantity ratio is less than the minimum value of the first ratio threshold range, randomly selecting a number of load nodes, and resetting the selected load nodes to generator nodes; When the first quantity ratio is greater than the maximum value of the first ratio threshold range, a number of generator nodes are randomly selected, and the selected generator nodes are reset as load nodes.
5. The method for generating power grid structure data according to claim 3, characterized in that: The generating edges for each network according to the preset edge-node ratio constraint includes: For each of the networks, generating a random number of edges for the network so that all nodes in the network are interconnected; Repeating the edge quantity adjustment operation until the network satisfies the edge-node ratio constraint; The edge quantity adjustment operation includes: Calculating a second ratio of the number of edges to nodes within the network; When the second quantity ratio is less than the minimum value of the second ratio threshold range, continue to randomly generate a number of edges; When the second quantity ratio is greater than the maximum value of the second ratio threshold range, a number of edges are randomly selected; for each selected edge, it is determined whether there is any other path except the edge between the two nodes connected by the edge; if so, the edge is deleted; if not, the edge is retained.
6. The method for generating power grid structure data according to claim 2, characterized in that: The step of obtaining the grid structure data according to all the networks includes: If the power grid type is "including transmission network and distribution network", one of the networks is randomly selected as the main network, and the remaining networks are used as subnets; each of the subnets is connected to the main network; all the connected networks are used as the power grid structure data; If the power grid type is "only distribution network", the network is used as the power grid structure data.
7. The method for generating power grid structure data according to claim 6, characterized in that: The step of connecting each of the subnets to the main network includes: Numbering all the subnets to obtain a subnet number for each subnet; Numbering all load nodes in the main network to obtain a load node number of each load node in the main network; For each subnet, a node is randomly selected from the subnet, and the selected node is connected to a load node in the main network whose load node number is equal to the subnet number of the subnet.
8. A power grid structure data generating device, characterized in that: include: Data acquisition module and power grid structure data generation module; The data acquisition module is used to obtain the network quantity requirement and the node quantity requirement of each network; The grid structure data generation module is used to generate a corresponding number of networks according to the network quantity requirement, and allocate a node quantity requirement to each network; generate nodes for each network according to the node quantity requirement of each network, a preset sliding bus quantity constraint and a preset generator-load ratio constraint; generate edges for each network according to the preset edge-node ratio constraint; and obtain the grid structure data based on all the networks.
9. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for generating power grid structure data as claimed in any one of claims 1 to 7 is implemented.
10. A storage medium, characterized in that: The storage medium includes a stored computer program, wherein when the computer program is executed, the device where the storage medium is located is controlled to execute the method for generating power grid structure data according to any one of claims 1 to 7.