Power grid optimization method and device based on level set function

By using variational autoencoder dimensionality reduction and level set function optimization, the shortcomings of traditional power grid optimization methods in high-dimensional data processing and dynamic optimization are addressed, thereby improving the efficiency and stability of power grid transmission and enhancing load balancing.

CN120933936APending Publication Date: 2025-11-11HUANGHUA POWER SUPPLY COMPANY OF STATE GRID QINGHAI ELECTRIC POWER +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511114791.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-11
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Traditional power grid optimization methods struggle to effectively handle high-dimensional, nonlinear power grid topology data, fail to extract the potential characteristics of the power grid topology, lack adaptive mechanisms, and struggle to balance power loss and load balance under dynamic load conditions.

Method used

A variational autoencoder is used to reduce the dimensionality of the power grid topology data to generate a low-dimensional potential space representation. Combined with physical constraint parameters such as voltage deviation, power factor and line load capacity, an initial level set function is constructed. The potential characteristics and dynamic constraints are analyzed by a decoder, and the parameters of the level set function are optimized to generate an improved power grid layout.

Benefits of technology

It significantly improves the efficiency and stability of power grid transmission, reduces power loss, and enhances load balancing, making it suitable for complex power grid scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120933936A_ABST
    Figure CN120933936A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a power grid optimization method and device based on a level set function, and the method comprises the steps: collecting the topological data of a power grid, and constructing a power grid topological data set containing multi-dimensional features according to the topological data; according to the power grid topological data set, constructing physical constraint parameters representing power grid electric energy transmission efficiency and stability; performing dimensionality reduction coding on the power grid topology through a variational auto-encoder to generate a low-dimensional potential space representation, and constructing an initial level set function based on the low-dimensional potential space representation by using the physical constraint parameter; analyzing the initial level set function by using a variational auto-encoder decoder module, and determining potential features and dynamic constraint conditions of the power grid topology; and optimizing parameters of the level set function according to the potential features and the dynamic constraint conditions, and generating improved power grid layout data based on the optimized level set function. The power transmission efficiency and stability of the power grid are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power system optimization technology, and in particular to a power grid optimization method and apparatus based on level set functions. Background Technology

[0002] With the rapid growth of electricity demand and the widespread integration of renewable energy, modern power grids face complex challenges such as load fluctuations, line overloads, and power losses. Traditional power grid optimization methods, typically based on linear programming or heuristic algorithms, struggle to effectively handle high-dimensional, nonlinear power grid topology data and exhibit limited optimization performance under dynamic load conditions. In recent years, machine learning techniques have shown potential in data dimensionality reduction and feature extraction. However, level set functions, as a mathematical tool for describing topology, have the following shortcomings when applied to power grid topology optimization: they cannot effectively extract the latent features of the power grid topology, resulting in a lack of global applicability in optimization schemes; the embedding methods of physical constraint parameters (such as voltage distribution and load capacity) are limited and difficult to adapt to dynamic power grid environments; and the optimization process lacks adaptive mechanisms, making it difficult to balance power losses and load balance.

[0003] Therefore, there is an urgent need for a new method that can comprehensively utilize variational autoencoders and level set functions, combined with physical constraint parameters, to achieve power grid topology optimization. Summary of the Invention

[0004] This application provides a power grid optimization method based on level set functions, which improves optimization efficiency and ensures that the optimization scheme meets the power grid stability requirements.

[0005] This application provides the following solution:

[0006] According to a first aspect, a power grid optimization method based on level set functions is provided. The method includes: collecting power grid topology data, including node distribution, line impedance, load dynamics, and power flow data; constructing a power grid topology dataset containing multi-dimensional features based on the topology data; constructing physical constraint parameters characterizing the power grid's power transmission efficiency and stability based on the power grid topology dataset, including voltage distribution, power factor, and line load capacity; performing dimensionality reduction encoding on the power grid topology using a variational autoencoder to generate a low-dimensional latent space representation, and constructing an initial level set function based on the low-dimensional latent space representation using the physical constraint parameters, the initial level set function characterizing the connectivity and power transmission characteristics of the power grid topology; analyzing the initial level set function using a variational autoencoder decoder module to determine the potential features and dynamic constraints of the power grid topology; optimizing the parameters of the level set function based on the potential features and dynamic constraints, and generating improved power grid layout data based on the optimized level set function.

[0007] According to one achievable method in this application embodiment, constructing physical constraint parameters characterizing the power transmission efficiency and stability of the power grid based on the power grid topology dataset includes: obtaining actual voltage, active power, reactive power, and real-time power flow from the power grid topology dataset; analyzing the voltage distribution of each node, wherein the voltage distribution is represented by voltage deviation, and the voltage deviation is the relative error between the actual voltage and the rated voltage; determining the power factor, wherein the power factor is determined based on the ratio of active power to apparent power, and the apparent power is calculated based on the reactive power; and evaluating the line load capacity, wherein the line load capacity is determined based on the ratio of the real-time power flow of the line to its maximum carrying capacity.

[0008] According to one achievable method in this application embodiment, the step of dimensionality reduction encoding of the power grid topology using a variational autoencoder to generate a low-dimensional latent space representation, and constructing an initial level set function based on the low-dimensional latent space representation using the physical constraint parameters, includes: using the encoder module of the variational autoencoder to map the power grid topology dataset to the latent space to generate a low-dimensional latent vector, wherein the dimension of the low-dimensional latent vector is determined according to the complexity and feature distribution of the power grid topology dataset and is smaller than the dimension of the original dataset; and constructing an initial level set function by embedding the physical constraint parameters, wherein the initial level set function characterizes the connectivity and power transmission characteristics of the power grid topology in a continuous geometric form.

[0009] According to one achievable method in an embodiment of this application, constructing an initial level set function by embedding the physical constraint parameters includes: mapping the low-dimensional potential vector to a two-dimensional grid, the resolution of which is determined based on the number of grid nodes and spatial distribution density; interpolating the low-dimensional potential vector using the central difference formula to generate a continuous level set function; and ensuring that the level set function satisfies the stability constraint based on the voltage distribution by embedding the voltage distribution and the line load capacity as boundary conditions.

[0010] According to one achievable method in an embodiment of this application, ensuring that the horizontal set function satisfies the stability constraint based on voltage distribution by embedding the voltage distribution and the line load capacity as boundary conditions includes: setting voltage distribution constraint values ​​and load capacity constraint values ​​on the boundary of the two-dimensional grid, wherein the voltage distribution constraint value is the average value of the relative error between the actual voltage and the rated voltage, and the load capacity constraint value is a preset threshold value, wherein the preset threshold value is used to limit the ratio of real-time power flow to maximum carrying capacity; and using the finite difference numerical integration method, iteratively adjusting the boundary point values ​​of the horizontal set function as boundary conditions to satisfy the stability constraint.

[0011] According to one achievable method in this embodiment, the analysis of the initial level set function using a variational autoencoder decoder module to determine the potential characteristics and dynamic constraints of the power grid topology includes: reconstructing the feature representation of the power grid topology based on the level set function using the variational autoencoder decoder module, extracting potential features, including node connectivity weights and line power flow distribution; determining dynamic constraints based on the physical constraint parameters, including load fluctuation range and power loss threshold; wherein, by analyzing voltage distribution and power factor, calculating the standard deviation of the load power of each node within a time window determined according to the power grid dynamic cycle, determining the load fluctuation range; and calculating the weighted sum of Joule losses of the lines based on the line load capacity and the power flow data in the power grid topology dataset, determining the power loss threshold.

[0012] According to one achievable method in an embodiment of this application, optimizing the parameters of the level set function based on the latent features and dynamic constraints includes: employing a constraint-based gradient optimization method, combining the latent features and dynamic constraints, to adjust the parameters of the level set function to minimize power loss and improve load balance, wherein the load balance is measured by the standard deviation of the load power of each node; wherein the optimization process uses an adaptive step size adjustment mechanism to dynamically determine the gradient descent step size based on the real-time deviation of the voltage distribution and the rate of change of the load fluctuation range.

[0013] According to a second aspect, a power grid optimization device based on level set functions is provided. The device includes: a power grid data acquisition unit configured to acquire power grid topology data, including node distribution, line impedance, load dynamics, and power flow data, and construct a power grid topology dataset containing multi-dimensional features based on the topology data; a physical constraint parameter construction unit configured to construct physical constraint parameters characterizing the power grid's power transmission efficiency and stability based on the power grid topology dataset, including voltage distribution, power factor, and line load capacity; and a level set function generation unit configured to generate the function through variational autoencoder. The system performs dimensionality reduction encoding on the power grid topology to generate a low-dimensional latent space representation. Using the physical constraint parameters, it constructs an initial level set function based on this low-dimensional latent space representation. This initial level set function characterizes the connectivity and power transmission characteristics of the power grid topology. A level set function decoding unit is configured to analyze the initial level set function using a variational autoencoder decoder module to determine the latent characteristics and dynamic constraints of the power grid topology. An optimized data generation unit is configured to optimize the parameters of the level set function based on the latent characteristics and dynamic constraints, and generate improved power grid layout data based on the optimized level set function.

[0014] According to a third aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any one of the first aspects above.

[0015] According to a fourth aspect, an electronic device is provided, comprising: one or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method described in any one of the first aspects.

[0016] According to the specific embodiments provided in this application, the following technical effects are disclosed:

[0017] This application collects multidimensional power grid data and constructs a topology dataset. It then uses a variational autoencoder for dimensionality reduction encoding to generate a low-dimensional latent space representation. Combining physical constraint parameters such as voltage deviation, power factor, and line load capacity, it constructs an initial level set function characterizing power grid connectivity and power transmission characteristics. By analyzing latent features and dynamic constraints using a decoder, a constraint-based optimization method is employed to adjust the level set function parameters, generating an improved power grid layout. This method significantly improves power transmission efficiency and stability, reduces power loss, and enhances load balancing. It effectively addresses the shortcomings of traditional methods in high-dimensional data processing and dynamic optimization, and is suitable for complex power grid scenarios.

[0018] Of course, any product implementing this application does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a system architecture diagram applicable to the embodiments of this application;

[0021] Figure 2 A flowchart illustrating the power grid optimization method based on level set functions provided in this application embodiment;

[0022] Figure 3 A structural block diagram of a power grid optimization device based on level set functions provided in this application embodiment;

[0023] Figure 4 A schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0025] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0026] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

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

[0028] Currently, several technologies exist, primarily including power dispatch based on linear programming, heuristic algorithms, and machine learning methods. Linear programming reduces losses by optimizing power allocation, but it is poorly adapted to nonlinear load fluctuations. Heuristic algorithms can handle complex power grids, but their convergence speed is slow and they are prone to getting trapped in local optima. Machine learning methods optimize load allocation through data-driven approaches, but they suffer from insufficient feature extraction in high-dimensional topology data processing and lack deep embedding of physical constraints. These technologies generally suffer from slow response to dynamic loads, low optimization efficiency, and an inability to effectively balance power losses and load balance, making it difficult to meet the demands of modern power grids with renewable energy integration and severe load fluctuations. A more efficient global optimization solution is urgently needed.

[0029] In view of this, this application provides a new approach. To facilitate understanding of this application, the system architecture on which this application is based will first be described. Figure 1 An exemplary system architecture that can be applied to embodiments of this application is shown, such as Figure 1As shown, the system architecture may include: user equipment and a grid optimization device based on a level set function located on the server side.

[0030] Users can input topology data through user equipment, which then sends it to a grid optimization device on the server side. The grid optimization device can use the method provided in the embodiments of this application to obtain improved grid layout data. The server can then send the improved grid layout data to the user terminal, which can then use the improved grid layout data for grid optimization.

[0031] User devices can include, but are not limited to, smart mobile terminals, smart home devices, wearable devices, and PCs (Personal Computers). Smart mobile devices can include mobile phones, tablets, laptops, PDAs (Personal Digital Assistants), and connected cars. Smart home devices can include smart TVs, smart refrigerators, and so on. Wearable devices can include smartwatches, smart glasses, virtual reality devices, augmented reality devices, and mixed reality devices.

[0032] Power grid optimization devices can be configured as standalone servers, server clusters, or cloud servers. Cloud servers, also known as cloud computing servers or cloud hosts, are a hosting product within the cloud computing service system, designed to address the management difficulties and weak service scalability inherent in traditional physical hosts and Virtual Private Servers (VPS) services. Besides... Figure 1 In addition to the architecture shown, the power grid optimization device can also be installed on a computer terminal with strong computing power.

[0033] It should be understood that Figure 1 The user equipment and grid optimization devices shown are merely illustrative. Any number of user equipment and grid optimization devices can be included depending on implementation needs.

[0034] Figure 2 This is a flowchart of a power grid optimization method based on level set functions provided in an embodiment of this application. This method can be... Figure 1 The grid optimization device based on the level set function in the system shown is executed. For example... Figure 2 As shown, the method may include the following steps:

[0035] Step 201: Collect the topology data of the power grid, which includes node distribution, line impedance, load dynamics and power flow data. Construct a power grid topology dataset containing multi-dimensional features based on the topology data.

[0036] Step 202: Based on the power grid topology dataset, construct physical constraint parameters that characterize the power grid's power transmission efficiency and stability. The physical constraint parameters include voltage distribution, power factor, and line load capacity.

[0037] Step 203: Dimensionally reduce the grid topology by using a variational autoencoder to generate a low-dimensional latent space representation, and construct an initial level set function based on the low-dimensional latent space representation using the physical constraint parameters. The initial level set function characterizes the connectivity and power transmission characteristics of the grid topology.

[0038] Step 204: Analyze the level set function using the variational autoencoder decoder module to determine the potential characteristics and dynamic constraints of the power grid topology.

[0039] Step 205: Optimize the parameters of the level set function based on the potential features and dynamic constraints, and generate improved power grid layout data based on the optimized level set function.

[0040] As can be seen from the above process, this application collects multidimensional power grid data and constructs a topology dataset. It then uses a variational autoencoder for dimensionality reduction encoding to generate a low-dimensional latent space representation. Combining physical constraint parameters such as voltage deviation, power factor, and line load capacity, it constructs an initial level set function characterizing power grid connectivity and power transmission characteristics. By analyzing latent features and dynamic constraints using a decoder, a constraint-based optimization method is employed to adjust the level set function parameters, generating an improved power grid layout. This method significantly improves the efficiency and stability of power grid power transmission, reduces power loss, and enhances load balancing. It effectively addresses the shortcomings of traditional methods in high-dimensional data processing and dynamic optimization, and is suitable for complex power grid scenarios.

[0041] First, the above step 201, namely "collecting topology data of the power grid, the topology data including node distribution, line impedance, load dynamics and power flow data, and constructing a power grid topology dataset containing multi-dimensional features based on the topology data", will be described in detail with reference to the embodiments.

[0042] Collecting topology data of the power grid aims to obtain comprehensive information describing the grid's structure and operating status. Topology data includes node distribution, line impedance, load dynamics, and power flow data, which together constitute the physical and dynamic characteristics of the power grid.

[0043] Node distribution refers to the spatial location or topological connection relationship of each node in a power grid, such as the geographical coordinates of substations, power plants, or load points and their connection methods. This information provides the basis for the power grid's topology and is usually collected through geographic information systems or power grid monitoring systems.

[0044] Line impedance reflects the electrical characteristics of transmission lines in a power grid, mainly including resistance and reactance. Resistance affects Joule losses in power transmission, while reactance is related to the voltage stability and reactive power flow of the power grid. Line impedance data is usually obtained through line design parameters or real-time measurements, providing electrical constraints for subsequent optimization.

[0045] Load dynamics describes the changes in load power at each node in the power grid over time, including fluctuations in active and reactive power. This data reflects the real-time operating status of the power grid and can be collected through smart meters or SCADA systems for analyzing load balance and fluctuation range.

[0046] Power flow data represents the power flow in various lines of a power grid, including the magnitude and direction of the power flow. This data is directly related to the transmission efficiency of the power grid and the load capacity of the lines, and is usually obtained through power flow calculation or real-time monitoring.

[0047] After collecting the aforementioned data, it is integrated into a power grid topology dataset containing multidimensional features. This dataset is organized in matrix or tensor form, where each row may represent a node or line, and each column corresponds to a feature, such as voltage, power, or impedance values. The process of constructing the power grid topology dataset involves not only data collection and integration but also ensuring data integrity and consistency. For example, outliers are removed through data cleaning, or the dimensions of different features are standardized. The final dataset is high-dimensional, typically containing hundreds to thousands of features, reflecting the complex topology and operational characteristics of the power grid, laying the foundation for dimensionality reduction analysis using variational autoencoders and the construction of level set functions.

[0048] Specifically, the geographical coordinates or topological connections of each node are encoded as feature vectors. For example, a power grid with 100 nodes can be represented as a 100×2 matrix (each row containing latitude and longitude), or the connections between nodes can be represented by an adjacency matrix. The resistance and reactance of each line are used as features. For example, 150 lines can form a 150×2 matrix, with each row containing resistance and reactance values. The statistical characteristics (such as mean, standard deviation, and maximum value) of the load power (active and reactive) of each node within a specific time window (e.g., 1 hour) are extracted as feature vectors. For example, the load data of 100 nodes can form a 100×4 matrix (each row containing the mean active power, mean reactive power, standard deviation of active power, and standard deviation of reactive power). The magnitude and direction of the power flow of each line are encoded as features. For example, the power flow data of 150 lines can form a 150×1 vector.

[0049] Using the above method, various data types are transformed into feature subsets, which are then concatenated into a comprehensive feature matrix. Assuming node features are 100×6 (including coordinates and load features) and line features are 150×3 (including impedance and power flow), they can be concatenated into a 250×9 matrix, or formed into a higher-dimensional feature set through other organizational methods. The integrated features need to be organized into a power grid topology dataset containing multi-dimensional features, typically stored in matrix or tensor form. A common organizational method is to construct a two-dimensional matrix, where rows represent elements of the power grid (nodes or lines) and columns represent feature types.

[0050] The following describes in detail step 202, namely, "constructing physical constraint parameters characterizing the power transmission efficiency and stability of the power grid based on the power grid topology dataset, wherein the physical constraint parameters include voltage distribution, power factor and line load capacity", with reference to the embodiments.

[0051] Based on the power grid topology dataset, physical constraint parameters characterizing the power grid's energy transmission efficiency and stability are constructed. Key physical quantities are extracted from multidimensional data to provide constraints for subsequent optimization. These physical constraint parameters are quantitative indicators calculated based on the power grid topology dataset and are used to describe the power grid's energy transmission efficiency and stability. These physical constraint parameters include voltage distribution, power factor, and line load capacity, which characterize the power grid's operating state from three aspects: voltage stability, power utilization efficiency, and line carrying capacity, respectively.

[0052] Voltage distribution reflects the voltage deviation at each node and is a key indicator for assessing grid stability; it is usually expressed as the relative error between the actual voltage and the rated voltage. Power factor measures the ratio of active power to apparent power, reflecting the effective utilization of electrical energy and directly affecting transmission efficiency. Line load capacity represents the ratio of real-time power flow to the maximum carrying capacity of each line, used to assess whether a line is approaching overload. These parameters collectively constitute the physical boundary of grid operation, providing clear constraints for the optimization process.

[0053] Constructing physical constraint parameters requires extracting and calculating relevant data from the power grid topology dataset. First, for voltage distribution, the relative error is calculated by obtaining the actual and rated voltage values ​​of each node. The voltage deviation is calculated as the difference between the actual and rated voltages divided by the rated voltage, usually expressed as a percentage. Second, the power factor is calculated based on the active and reactive power data of each node or line. Active and reactive power are extracted from the topology dataset, and apparent power is calculated by the vector sum of active and reactive power. The power factor is the active power divided by the apparent power. Finally, calculating the line load capacity requires obtaining the real-time power flow and maximum carrying capacity of each line. Real-time power flow is obtained through power flow analysis or monitoring equipment, and the maximum carrying capacity is determined based on line material, design specifications, or thermal stability limits. The load capacity is the ratio of these two values.

[0054] The following describes in detail step 203, namely, "dimension reduction encoding of the power grid topology by variational autoencoder to generate a low-dimensional latent space representation, and constructing an initial level set function based on the low-dimensional latent space representation using the physical constraint parameters, wherein the initial level set function characterizes the connectivity and power transmission characteristics of the power grid topology", with reference to the embodiments.

[0055] Power grid topology datasets are high-dimensional, containing various features such as node distribution, line impedance, load dynamics, and power flow, with dimensions potentially reaching hundreds or thousands. Directly processing high-dimensional data is computationally complex and inefficient. This application employs a variational autoencoder (VAE) to reduce the dimensionality of power grid topology datasets. A VAE is a generative model that maps high-dimensional input data to a low-dimensional latent space through an encoder module, generating low-dimensional latent vectors. The encoder consists of a multi-layer neural network, and its training objective is to minimize reconstruction error and KL divergence, ensuring that the latent vectors retain the main information of the original data while also possessing probabilistic distribution characteristics. For example, a power grid topology dataset containing 1000-dimensional features can be compressed into a 100-dimensional latent vector. The dimensionality is determined based on data complexity and feature distribution, and is typically much smaller than the original dimensionality. This dimensionality reduction process reduces computational complexity while extracting the core features of the power grid topology, providing an efficient data representation for subsequent analysis.

[0056] Low-dimensional latent space representations are the outputs of variational autoencoders, typically existing as vectors or matrices with dimensionality far lower than the original dataset. Each dimension in the latent space can be viewed as an abstract expression of a power grid topology feature, such as the connection strength between nodes, power flow distribution, or load fluctuation patterns. Although these features have reduced dimensionality, they can still capture the global topological characteristics and local operating states of the power grid through probabilistic modeling by variational autoencoders. The key advantages of latent space representations lie in their continuity and operability, enabling the analysis and processing of complex power grid topology data in a low-dimensional space. Furthermore, the probabilistic distribution characteristics of the latent space (such as a Gaussian distribution) ensure the robustness of the data, facilitating the generation of stable geometric representations when constructing level set functions.

[0057] As an feasible approach, dimensionality reduction encoding of the power grid topology using a variational autoencoder generates a low-dimensional latent space representation. Constructing an initial level set function based on this low-dimensional latent space representation using the physical constraint parameters involves: mapping the power grid topology dataset to the latent space using the encoder module of the variational autoencoder to generate a low-dimensional latent vector. The dimension of the low-dimensional latent vector is determined based on the complexity and feature distribution of the power grid topology dataset and is smaller than the dimension of the original dataset. An initial level set function is constructed by embedding the physical constraint parameters. This initial level set function characterizes the connectivity and power transmission characteristics of the power grid topology in a continuous geometric form.

[0058] The choice of dimension for low-dimensional latent vectors must ensure that the latent vectors can capture key features of the power grid topology (such as connectivity and power flow distribution), while avoiding excessively high dimensionality leading to computational complexity or excessively low dimensionality leading to information loss. When determining the dimension, it should be dynamically adjusted based on the complexity and feature distribution of the power grid topology dataset, rather than a fixed value, to adapt to power grids of different sizes and characteristics. For example, if load dynamics and power flow data are highly correlated, redundant features can be removed by dimensionality reduction, thus lowering the dimensionality; if the correlation between features is low, a higher dimension is needed to retain independent information. High-complexity datasets (such as large power grids containing multiple dynamic load patterns) typically require higher latent dimensions, while lower dimensions can be chosen when the feature distribution is relatively uniform or highly redundant. In practice, data analysis techniques (such as principal component analysis or feature correlation matrices) can be used to evaluate complexity and feature distribution to guide dimensionality selection.

[0059] Specifically, for example, assuming each node contains 6 features (latitude and longitude, mean active power, mean reactive power, standard deviation of active power, and standard deviation of reactive power), and each line contains 3 features (resistance, reactance, and power flow), then the feature matrix dimension of 100 nodes and 150 lines is 250 × 9 = 2250 dimensions.

[0060] The complexity metrics of the power grid are calculated, including the number of nodes, lines, and features. The redundancy of feature distribution is assessed by calculating the correlation matrix between features. For example, if the correlation coefficient between active and reactive power is higher than 0.8, redundancy can be considered, making dimensionality reduction suitable.

[0061] Principal Component Analysis (PCA) can be used to perform initial dimensionality reduction on the dataset and calculate the cumulative variance contribution rate. For example, if the first 50 principal components explain 95% of the variance, the potential vector dimension can be initially estimated to be 50. Alternatively, by tentatively training a variational autoencoder, the reconstruction error and KL divergence under different dimensions (such as 50, 100, and 200) can be tested, and the dimension with lower error and stable distribution can be selected.

[0062] A variational autoencoder is constructed, consisting of a 3-layer fully connected neural network (2250-dimensional input layer, 512-dimensional hidden layer, and output layer with latent dimensions, e.g., 100-dimensional). The training objective is to minimize the loss function.

[0063] Loss=Reconstruction+β·KL (1)

[0064] Here, Reconstruction is the reconstruction loss, which measures the difference between the decoded data and the original data; KL is the divergence, which ensures that the distribution of the latent vectors is close to the standard normal distribution; β is a hyperparameter used to balance the contributions of reconstruction loss and KL divergence to the total loss.

[0065] The effectiveness of the latent vectors was evaluated based on the training results. If the reconstruction error was high (e.g., mean squared error > 0.1), the dimension was increased to 150 and retraining was performed; if the error was low but the model was overfitted (high KL divergence), the dimension was reduced to 50. Ultimately, a dimension of 100 was chosen to ensure that the reconstruction error was less than 0.05 and the cumulative variance contribution rate was greater than 90%.

[0066] After generating low-dimensional potential vectors, an initial level set function is constructed based on these vectors using physical constraint parameters such as voltage deviation, power factor, and line load capacity. Embedding these parameters involves incorporating the physical constraints as boundary conditions or weights into the mathematical transformation of the potential vectors. For example, voltage deviation can be used to limit the range of function values ​​generated after the potential vector mapping, ensuring that it meets stability requirements; line load capacity can be used as a weighting factor, influencing the spatial distribution characteristics of the potential vectors. Embedding physical constraint parameters ensures that the subsequently constructed level set function not only reflects the geometric characteristics of the topology but also conforms to the actual operational constraints of the power grid, thereby improving the physical feasibility of the optimization scheme.

[0067] As an implementable approach, constructing an initial level set function by embedding the physical constraint parameters includes: mapping the low-dimensional potential vector to a two-dimensional grid, the resolution of which is determined based on the number of grid nodes and spatial distribution density; interpolating the low-dimensional potential vector using the central difference formula to generate a continuous level set function; and ensuring that the level set function satisfies the stability constraints based on the voltage distribution by embedding the voltage distribution and the line load capacity as boundary conditions.

[0068] A two-dimensional grid is a regular, discretized space, typically represented as a rectangular region composed of grid points, such as a 50×50 grid. The mapping process assigns each dimension of the latent vector to the grid points through mathematical transformations (such as linear mappings or neural networks), forming a two-dimensional scalar field. For example, assuming a latent vector is 100-dimensional, it can be projected onto the point values ​​of the two-dimensional grid through fully connected layers or convolutional operations, forming an initial function distribution. This mapping transforms abstract latent features into a spatialized representation, laying the foundation for the subsequent construction of level set functions.

[0069] The resolution of a 2D grid, i.e., the number of grid points, directly affects the accuracy and computational complexity of the level set function. Resolution is determined based on the number of nodes in the power grid and their spatial distribution density. The number of nodes reflects the scale of the power grid; for example, a power grid with 100 nodes requires a higher resolution to capture the topological details between nodes. Spatial distribution density describes how densely the nodes are distributed in geographic space; for example, urban power grids have dense nodes and require a higher resolution (e.g., 100×100), while rural power grids have sparse nodes and can have a lower resolution (e.g., 50×50). When determining the resolution, empirical formulas can be used, such as the grid side length being proportional to the square root of the number of nodes, or it can be dynamically adjusted through data analysis (e.g., the variance of node coordinates). A reasonable resolution ensures that the grid can adequately represent the topology of the power grid while avoiding excessive computational burden caused by excessively high resolution.

[0070] On a two-dimensional grid, the mapping result of the latent vector is usually discrete grid point values, while the level set function requires a continuous functional form. Therefore, the central difference formula is used to interpolate the grid point values ​​to generate a continuous level set function. The central difference formula is a numerical method that estimates the continuous variation of the function between grid points by calculating the difference between adjacent grid points. For example, for grid point (x... i ,y j The value of u(x) i ,y j The central difference formula can be used to calculate the gradient or second derivative of a function, thereby constructing a smooth function surface. The interpolated level set function φ(x,y) is defined as a continuous scalar field, where φ(x,y)=0 represents the boundary of the power grid topology (such as line or node boundaries), φ(x,y)>0 represents a connected region, and φ(x,y)<0 represents a disconnected region. The central difference formula is chosen because it is simple, applicable to regular grids, and can effectively smooth the discrete representation of the potential vector, generating a continuous function suitable for optimization.

[0071] To ensure that the level set function meets the actual operating requirements of the power grid, physical constraint parameters such as voltage distribution and line load capacity need to be embedded in the function construction process. Voltage distribution is represented by voltage deviation (the relative error between the actual voltage and the rated voltage), reflecting the stability of the power grid; line load capacity is represented by the ratio of real-time power flow to maximum carrying capacity, reflecting the safety of the line. The embedding process incorporates these parameters as boundary conditions or weighting factors into the level set function. For example, voltage deviation can be used to limit the function value at grid boundary points, ensuring that the function value in high deviation regions is constrained; line load capacity can be used as a weight to adjust the gradient of the function in high-load line regions, making it reflect the power flow characteristics. The embedding method can be achieved by adding constraint terms in the interpolation calculation, such as introducing a penalty term in the central difference formula, to ensure that the function value meets the physical constraints. This embedding ensures that the level set function not only represents the topology but also conforms to the physical operating characteristics of the power grid.

[0072] Level set functions ensure that voltage distribution-based stability constraints are met by embedding voltage distribution and line load capacity as boundary conditions. Specifically, voltage deviation is used to set the function values ​​at grid boundary points, for example, requiring the function values ​​to tend towards specific values ​​in regions where voltage deviation exceeds 5% to limit the expansion of unstable regions. Line load capacity serves as a constraint, ensuring that the function values ​​reflect safe operation limits in high-load line regions; for example, when the load capacity is close to 1, the function gradient is adjusted to avoid overload. By introducing these boundary conditions during interpolation calculations and function construction, level set functions can reflect the stability requirements of the power grid, such as keeping voltage deviation within an acceptable range (typically ±5%), thereby ensuring the stability of the optimized power grid layout in actual operation.

[0073] Preferably, ensuring that the horizontal set function satisfies the stability constraint based on voltage distribution by embedding voltage distribution and line load capacity as boundary conditions includes: setting voltage distribution constraint values ​​and load capacity constraint values ​​on the boundary of a two-dimensional grid, where the voltage distribution constraint value is the average of the relative errors between the actual voltage and the rated voltage, and the load capacity constraint value is a preset threshold value used to limit the ratio of real-time power flow to maximum carrying capacity; and using the finite difference numerical integration method, iteratively adjusting the boundary point values ​​of the horizontal set function as boundary conditions to satisfy the stability constraint.

[0074] The voltage distribution constraint value is defined as the average of the relative errors between the actual voltage and the rated voltage. The formula for calculating the relative error is:

[0075]

[0076] Among them, V actual V is the actual voltage. nom The voltage is the rated voltage. The average of the relative errors of all nodes is used to obtain the voltage distribution constraint value, for example, 5%, which reflects the overall voltage stability requirements of the power grid.

[0077] The load capacity constraint is defined as a preset threshold value used to limit the ratio of real-time power flow to maximum carrying capacity. Real-time power flow is obtained through power flow analysis, while maximum carrying capacity is determined based on line materials and design specifications, such as 1000MW. The preset threshold is typically set as the upper limit for safe operation, for example, 0.9, meaning the power flow must not exceed 90% of the maximum carrying capacity. These two constraints together ensure that the value of the level set function at the boundary points reflects the stability and security of the power grid.

[0078] To embed voltage distribution constraints and load capacity constraints into the level set function, a finite difference numerical integration method is used to process the function values ​​on a two-dimensional grid. The finite difference method approximates the continuous variation of the level set function by discretizing the function values ​​and their derivatives at grid points. Specifically, the grid is divided into a regular lattice, for example, 50×50, and the function value φ(x) at each point... i ,y j The calculation is performed using the difference relationship between adjacent points. Finite difference numerical integration iteratively updates the function values ​​at grid points to satisfy boundary conditions and internal constraints. For example, an explicit difference scheme can be used to calculate φ(x). i ,y j The temporal evolution or spatial gradient of the function ensures that the function values ​​at boundary points conform to voltage distribution and load capacity constraints. The advantage of the finite difference method lies in its high computational efficiency, suitability for handling continuous functions on regular meshes, and ability to flexibly embed physical constraints.

[0079] In finite difference numerical integration, voltage distribution constraints and load capacity constraints serve as boundary conditions. Embedding is achieved by iteratively adjusting the boundary point values ​​of the level set function. The iterative process is typically based on gradient descent or similar optimization algorithms, aiming to minimize the deviation between the boundary point function value and the constraint value. For example, if the voltage deviation constraint value at a certain boundary point is 5%, while the deviation corresponding to the current function value is 7%, then by adjusting φ(x)... i ,y j To reduce bias, load capacity constraints (e.g., 0.9) ensure that the function behavior in high-load regions reflects safe operating limits by restricting the function gradient or value at boundary points. Iterative adjustments are typically performed in multiple rounds (e.g., 100 times), updating the calculation results based on finite differences each time, until the function value converges to satisfy all constraints. Convergence can be criterion such as the mean square error of the boundary point values ​​being less than a certain threshold, for example, 0.01.

[0080] The following describes in detail step 204, namely, "using the variational autoencoder decoder module to analyze the initial level set function and determine the potential characteristics and dynamic constraints of the power grid topology," with reference to an embodiment.

[0081] A variational autoencoder consists of an encoder and a decoder module. The encoder compresses a high-dimensional power grid topology dataset into low-dimensional latent vectors, while the decoder maps these latent vectors back to the original data space or relevant representation. In this application, the decoder module is used to analyze the initial level set function. The decoder transforms the geometric information of the level set function into an interpretable feature representation through inverse mapping. The decoder typically consists of a multi-layer neural network, capable of capturing nonlinear relationships within the level set function and extracting hidden topological characteristics, providing data support for subsequent optimization. The decoder module analyzes the level set function by taking the function value or its derived features (such as gradients and curvature) as input, processing them through a neural network to generate feature representations related to the power grid topology. The goal of the analysis is to recover the topological information of the power grid from the geometric form of the level set function, such as the connectivity between nodes or the distribution pattern of power flow. By learning the mapping relationship between the level set function and the original power grid topology dataset, the decoder can identify the implicit structural characteristics in the function, such as the layout of trunk lines or the distribution of high-load areas. This analysis process not only verifies the effectiveness of the level set function but also provides a foundation for extracting latent features.

[0082] Through analysis by the decoder module, latent features of the power grid topology are extracted from the level set function. These latent features are an abstract representation of the power grid topology, including node connectivity weights and line power flow distribution. They represent a refined representation of the topology, preserving key structural and functional information while removing redundant data. The extraction process leverages the nonlinear modeling capabilities of a variational autoencoder to capture implicit patterns in complex power grids, providing a data-driven basis for optimizing power grid layout. In addition to latent features, the decoder module also determines the dynamic constraints of the power grid based on the level set function and physical constraint parameters.

[0083] As an implementable approach, this application utilizes a variational autoencoder decoder module to analyze the initial level set function and determine the potential characteristics and dynamic constraints of the power grid topology. This includes: reconstructing the feature representation of the power grid topology based on the level set function using the variational autoencoder decoder module; extracting potential features, including node connectivity weights and line power flow distribution; determining dynamic constraints based on the physical constraint parameters, including load fluctuation range and power loss threshold; wherein, by analyzing voltage distribution and power factor, calculating the standard deviation of the load power of each node within a time window determined according to the power grid dynamic cycle, and determining the load fluctuation range; and calculating the weighted sum of Joule losses of the lines based on the line load capacity and the power flow data in the power grid topology dataset, and determining the power loss threshold.

[0084] The feature representations reconstructed from the level set functions are refined expressions of the power grid topology data, containing compressed forms of information such as node distribution, line impedance, load dynamics, and power flow. For example, a feature representation might be a matrix where each row corresponds to a node or line, and each column corresponds to a feature, such as node connectivity weights or power flow values. The process of generating feature representations relies on the nonlinear modeling capabilities of the decoder, enabling the extraction of key patterns from the geometry of the level set functions, such as concentrated power flow regions in trunk lines or strong connectivity regions between nodes.

[0085] Node connectivity weights reflect the strength of topological connections between nodes, and can be represented, for example, by an adjacency matrix or a weighted graph. Direct node connections have higher weights, while indirect connections have lower weights. Line power flow distributions describe the power transmission characteristics of each line, such as the magnitude and direction of the power flow, and can be quantized by the feature vector output by the decoder.

[0086] Dynamic constraints, including load fluctuation range and power loss threshold, reflect the dynamic characteristics and physical limitations of the power grid during operation. Load fluctuation range is calculated by analyzing voltage distribution and power factor to determine the standard deviation of load power at each node within a specific time window, such as the power fluctuation amplitude within one hour, thus describing the dynamic changes in load. Power loss threshold is calculated based on line load capacity and power flow data, using a weighted sum of Joule losses for each line as the upper limit of power grid operation losses. The decoder quantifies these dynamic constraints by processing power flow distribution and voltage information in the level set function and combining them with physical constraint parameters. These conditions set dynamic boundaries for the optimization process, ensuring that the optimization results adapt to the real-time operational needs of the power grid.

[0087] The following describes in detail step 205, namely, "optimizing the parameters of the horizontal set function based on potential features and dynamic constraints, and generating improved power grid layout data based on the optimized horizontal set function," with reference to an embodiment.

[0088] A level set function is a continuous function defined on a two-dimensional grid. Its parameters include function values ​​at grid points or the function's gradient, and it characterizes the topological connectivity and power transmission characteristics of a power grid. Optimizing the level set function parameters involves adjusting the function's geometry to achieve optimal performance for its corresponding power grid layout. Specific optimization objectives include minimizing power loss and improving load balancing. The optimization process must be guided by latent characteristics and satisfy dynamic constraints, such as load fluctuations not exceeding predetermined thresholds and power losses below set upper limits.

[0089] As an implementable method, optimizing the parameters of the level set function based on the latent features and dynamic constraints includes: employing a constraint-based gradient optimization method, combining the latent features and dynamic constraints, to adjust the parameters of the level set function to minimize power loss and improve load balance, wherein the load balance is measured by the standard deviation of the load power of each node; wherein the optimization process uses an adaptive step size adjustment mechanism to dynamically determine the gradient descent step size based on the real-time deviation of the voltage distribution and the rate of change of the load fluctuation range.

[0090] The purpose of optimizing the level set function parameters is to generate an improved power grid layout to achieve two main objectives: minimizing power losses and improving load balancing. Power losses mainly originate from Joule losses in the lines, defined as... Where I j R is the line current. j For line resistance, reduce total loss ∑L by optimizing power flow distribution. j Load balance is measured by the standard deviation of the load power at each node, σ(P) load The smaller the value, the more uniform the load distribution and the more stable the power grid operation. The optimization objective can be formalized as an objective function:

[0091] Objective=∑L j +λσ(P load (3)

[0092] Where λ is the weighting coefficient, balancing losses and uniformity. The parameters of the level set function φ(x,y) (function values ​​at grid points) are adjusted to change its geometry, thereby optimizing the topology and power flow distribution of the power grid.

[0093] The optimization process employs a constraint-based gradient optimization method, minimizing the objective function by iteratively updating the grid point values ​​of the level set function. The gradient optimization method calculates the gradient direction based on the partial derivative of the objective function with respect to φ(x,y), for example, by estimating it numerically. Each iteration updates the function value in the opposite direction of the gradient, with the step size determining the magnitude of the update. Constraints include load fluctuation range and power loss threshold, embedded in the optimization process through Lagrange multipliers or penalty terms. For example, if the load fluctuation range exceeds the threshold, the optimization adds a penalty term, restricting the direction of function adjustment. Constraint-based optimization ensures that the updated level set function not only reduces the objective function value but also meets the physical operation requirements of the power grid, such as voltage stability or line safety.

[0094] Potential features and dynamic constraints work together in optimization. Node connectivity weights reflect the strength of topological connections between nodes, for example, represented by a weighted graph. Directly connected nodes have higher weights, guiding optimization to prioritize adjusting the function values ​​of critical nodes to enhance grid robustness. Line power flow distribution describes the power transmission characteristics of each line, such as areas of concentrated power flow. Optimization redistributes power flow by adjusting function values ​​to reduce losses on high-load lines. Load fluctuation range is calculated using the standard deviation of load power at each node within a specific time window (e.g., 1 hour), limiting the optimized load variation range, for example, to no more than a preset threshold. Power loss thresholds are based on the weighted sum of line Joule losses, limiting total losses, for example, to no more than 10% of the design specifications. These features and constraints are embedded in the objective function's constraint terms or weights to ensure that the optimization results meet actual operational requirements.

[0095] The gradient descent step size during the optimization process is dynamically determined through an adaptive step size adjustment mechanism, calculated based on the real-time deviation of the voltage distribution and the rate of change of the load fluctuation range. The real-time deviation of the voltage distribution is defined as the relative error between the actual voltage and the rated voltage at each node, reflecting the stability of the power grid. The rate of change of the load fluctuation range is calculated using the derivative of the standard deviation within the time window, reflecting the dynamic rate of change of the load. The adaptive step size mechanism adjusts the step size based on a weighted sum of these two factors, for example:

[0096]

[0097] Where α is the base step size, ω1 and ω2 are weighting coefficients, and |δV| is the average voltage deviation. This represents the load fluctuation rate. If the voltage deviation or load fluctuation rate is large, the step size is decreased to avoid over-adjustment; if both are small, the step size is increased to accelerate convergence. This mechanism improves the stability and efficiency of optimization, adapting to the dynamic operating environment of the power grid.

[0098] Generating improved power grid layout data involves transforming the optimized level set function into specific topology configurations and operating parameters. The specific implementation includes the following steps: First, analyze the zero level set of the optimized level set function to extract geometric information representing the power grid topology boundaries, such as line paths or node connection regions. The shape of the zero level set defines the new topology structure, for example, by merging certain lines or adjusting the connection methods between nodes. Second, using inverse mapping or decoding techniques, convert the geometric information of the level set function into power grid topology data, such as an adjacency matrix or weighted graph, representing the connection relationships and weights between nodes. Next, calculate the improved power flow distribution based on function values ​​and gradients, for example, by deriving the power flow allocation of each line through the size and location of the positive value region of the function. Finally, integrate this information into power grid layout data, including node coordinates, line connections, power flow allocation, and load configuration, forming a structured dataset that can be directly applied to power grid planning or operation, such as a node and line parameter table stored in JSON or CSV format.

[0099] The method described in this application can be applied to various scenarios. First, in smart grids, this method can optimize dynamic load distribution by adjusting the topology and power flow in real time, reducing power loss, improving load balance, and adapting to the volatility of renewable energy. Second, in large-scale regional power grid planning, it can be used to design efficient topology layouts, improving transmission efficiency and stability while reducing construction and operating costs by optimizing node connectivity and line configuration. Furthermore, in grid fault recovery scenarios, this method can quickly generate improved layout data, reconfigure lines and power flows, and restore power supply while ensuring voltage stability and load balance, thus enhancing grid resilience. These scenarios all benefit from the method's dimensionality reduction processing of high-dimensional data, embedding of physical constraints, and adaptive optimization capabilities, significantly improving grid operating efficiency and reliability.

[0100] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0101] According to another embodiment, a power grid optimization device based on a level set function is provided. Figure 3 A schematic block diagram of a power grid optimization device based on a level set function according to one embodiment is shown. Figure 3 As shown, the device 300 includes:

[0102] The power grid data acquisition unit 301 is configured to collect the topology data of the power grid, which includes node distribution, line impedance, load dynamics and power flow data, and to construct a power grid topology dataset containing multi-dimensional features based on the topology data.

[0103] The physical constraint parameter construction unit 302 is configured to construct physical constraint parameters characterizing the power transmission efficiency and stability of the power grid based on the power grid topology dataset. The physical constraint parameters include voltage distribution, power factor, and line load capacity.

[0104] The horizontal set function generation unit 303 is configured to perform dimensionality reduction encoding on the power grid topology through a variational autoencoder to generate a low-dimensional latent space representation, and to construct an initial horizontal set function based on the low-dimensional latent space representation using the physical constraint parameters. The initial horizontal set function characterizes the connectivity and power transmission characteristics of the power grid topology.

[0105] The level set function decoding unit 304 is configured to analyze the initial level set function using the variational autoencoder decoder module to determine the potential characteristics and dynamic constraints of the power grid topology.

[0106] The optimized data generation unit 305 is configured to optimize the parameters of the level set function according to the potential features and dynamic constraints, and generate improved power grid layout data based on the optimized level set function.

[0107] As an implementable approach, the physical constraint parameter construction unit 302, when constructing physical constraint parameters characterizing the power transmission efficiency and stability of the power grid based on the power grid topology dataset, can be configured to: obtain actual voltage, active power, reactive power, and real-time power flow from the power grid topology dataset; analyze the voltage distribution of each node, the voltage distribution being represented by voltage deviation, the voltage deviation being the relative error between the actual voltage and the rated voltage; determine the power factor, the power factor being determined based on the ratio of active power to apparent power, the apparent power being calculated based on the reactive power; and evaluate the line load capacity, the line load capacity being determined based on the ratio of the line's real-time power flow to its maximum carrying capacity.

[0108] As an implementable approach, the level set function generation unit 303, when performing dimensionality reduction encoding on the power grid topology using a variational autoencoder to generate a low-dimensional latent space representation, and constructing an initial level set function based on the low-dimensional latent space representation using the physical constraint parameters, can be configured as follows: The encoder module of the variational autoencoder maps the power grid topology dataset to the latent space, generating a low-dimensional latent vector. The dimension of the low-dimensional latent vector is determined according to the complexity and feature distribution of the power grid topology dataset and is smaller than the dimension of the original dataset. An initial level set function is constructed by embedding the physical constraint parameters. This initial level set function characterizes the connectivity and power transmission characteristics of the power grid topology in a continuous geometric form.

[0109] As an implementable approach, the level set function generation unit 303, when constructing an initial level set function by embedding the physical constraint parameters, can be configured to: map the low-dimensional potential vector to a two-dimensional grid, the resolution of which is determined based on the number of grid nodes and spatial distribution density; interpolate the low-dimensional potential vector using the central difference formula to generate a continuous level set function; and ensure that the level set function satisfies the stability constraints based on the voltage distribution by embedding the voltage distribution and the line load capacity as boundary conditions.

[0110] As an implementable approach, the horizontal set function generation unit 303, when ensuring that the horizontal set function satisfies the stability constraints based on voltage distribution by embedding the voltage distribution and the line load capacity as boundary conditions, can be configured as follows: On the boundary of the two-dimensional grid, voltage distribution constraint values ​​and load capacity constraint values ​​are set, where the voltage distribution constraint value is the average of the relative errors between the actual voltage and the rated voltage, and the load capacity constraint value is a preset threshold value used to limit the ratio of real-time power flow to the maximum carrying capacity; the boundary point values ​​of the horizontal set function are iteratively adjusted using the finite difference numerical integration method, with the voltage deviation constraint value and the load capacity constraint value as boundary conditions, to satisfy the stability constraints.

[0111] As an implementable approach, the level set function decoding unit 304, when analyzing the initial level set function using the variational autoencoder decoder module to determine the potential characteristics and dynamic constraints of the power grid topology, can be configured to: reconstruct the feature representation of the power grid topology based on the level set function using the variational autoencoder decoder module, extract potential features including node connectivity weights and line power flow distribution; determine dynamic constraints based on the physical constraint parameters, including load fluctuation range and power loss threshold; wherein, by analyzing voltage distribution and power factor, the standard deviation of the load power of each node within a time window determined according to the power grid dynamic cycle is calculated to determine the load fluctuation range; and based on the line load capacity and combined with the power flow data in the power grid topology dataset, calculate the weighted sum of Joule losses of the lines to determine the power loss threshold.

[0112] As an implementable approach, the optimization data generation unit 305, when optimizing the parameters of the level set function based on the latent features and dynamic constraints, can be configured to: employ a constraint-based gradient optimization method, combining the latent features and dynamic constraints, to adjust the parameters of the level set function to minimize power loss and improve load balance, wherein the load balance is measured by the standard deviation of the load power of each node; wherein the optimization process uses an adaptive step size adjustment mechanism to dynamically determine the gradient descent step size based on the real-time deviation of the voltage distribution and the rate of change of the load fluctuation range.

[0113] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0114] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0115] In addition, embodiments of this application also provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method described in any of the foregoing method embodiments.

[0116] And an electronic device comprising: one or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method described in any of the foregoing method embodiments.

[0117] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the foregoing method embodiments.

[0118] in, Figure 4 An exemplary architecture of an electronic device is shown, which may include a processor 410, a video display adapter 411, a disk drive 412, an input / output interface 413, a network interface 414, and a memory 420. The processor 410, video display adapter 411, disk drive 412, input / output interface 413, network interface 414, and memory 420 can communicate with each other via a communication bus 430.

[0119] The processor 410 can be implemented using a general-purpose CPU, microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits to execute relevant programs in order to implement the technical solution provided in this application.

[0120] The memory 420 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 420 can store the operating system 421 for controlling the operation of the electronic device 400, and the basic input / output system (BIOS) 422 for controlling the low-level operations of the electronic device 400. Additionally, it can store a web browser 423, a data storage management system 424, and a power grid optimization device 425 based on level set functions, etc. The aforementioned power grid optimization device 425 based on level set functions can be the application program that specifically implements the aforementioned steps in this embodiment. In summary, when the technical solution provided in this application is implemented through software or firmware, the relevant program code is stored in the memory 420 and is called and executed by the processor 410.

[0121] Input / output interface 413 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.

[0122] Network interface 414 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0123] Bus 430 includes a pathway for transmitting information between various components of the device, such as processor 410, video display adapter 411, disk drive 412, input / output interface 413, network interface 414, and memory 420.

[0124] It should be noted that although the above-described device only shows the processor 410, video display adapter 411, disk drive 412, input / output interface 413, network interface 414, memory 420, bus 430, etc., in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the solution of this application, and does not necessarily include all the components shown in the figures.

[0125] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer program product. This computer program product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0126] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A power grid optimization method based on level set functions, characterized in that, The method includes: Collect topology data of the power grid, including node distribution, line impedance, load dynamics and power flow data, and construct a power grid topology dataset containing multi-dimensional features based on the topology data; Based on the power grid topology dataset, physical constraint parameters characterizing the power grid's power transmission efficiency and stability are constructed. These physical constraint parameters include voltage distribution, power factor, and line load capacity. The power grid topology is dimensionality-reduced by a variational autoencoder to generate a low-dimensional latent space representation. Using the physical constraint parameters, an initial level set function is constructed based on the low-dimensional latent space representation. The initial level set function characterizes the connectivity and power transmission characteristics of the power grid topology. The initial level set function is analyzed using a variational autoencoder decoder module to determine the potential characteristics and dynamic constraints of the power grid topology. Based on the potential characteristics and dynamic constraints, the parameters of the level set function are optimized, and improved power grid layout data is generated based on the optimized level set function.

2. The power grid optimization method based on level set functions according to claim 1, characterized in that, The physical constraint parameters characterizing the power transmission efficiency and stability of the power grid based on the power grid topology dataset include: Obtain actual voltage, active power, reactive power, and real-time power flow from the aforementioned power grid topology dataset; Analyze the voltage distribution at each node, where the voltage distribution is represented by the voltage deviation, which is the relative error between the actual voltage and the rated voltage; A power factor is determined based on the ratio of active power to apparent power, wherein the apparent power is calculated based on the reactive power. Assess the line load capacity, which is determined based on the ratio of the line's real-time power flow to its maximum carrying capacity.

3. The power grid optimization method based on level set functions according to claim 1, characterized in that, The step of performing dimensionality reduction encoding on the power grid topology using a variational autoencoder to generate a low-dimensional latent space representation, and then constructing an initial level set function based on the low-dimensional latent space representation using the physical constraint parameters, includes: The encoder module of the variational autoencoder is used to map the power grid topology dataset to the latent space to generate a low-dimensional latent vector. The dimension of the low-dimensional latent vector is determined according to the complexity and feature distribution of the power grid topology dataset and is smaller than the dimension of the original dataset. By embedding the physical constraint parameters, an initial level set function is constructed, which characterizes the connectivity and power transmission characteristics of the power grid topology in a continuous geometric form.

4. The power grid optimization method based on level set functions according to claim 3, characterized in that, The construction of the initial level set function by embedding the physical constraint parameters includes: The low-dimensional potential vector is mapped to a two-dimensional grid, the resolution of which is determined based on the number of power grid nodes and the spatial distribution density. The low-dimensional potential vector is interpolated using the central difference formula to generate a continuous level set function. By embedding the voltage distribution and the line load capacity as boundary conditions, the level set function is ensured to meet the stability constraints based on the voltage distribution.

5. The power grid optimization method based on level set functions according to claim 4, characterized in that, By embedding the voltage distribution and the line load capacity as boundary conditions, the stability constraints based on the voltage distribution of the level set function are ensured to be met, including: On the boundary of the two-dimensional grid, voltage distribution constraint values ​​and load capacity constraint values ​​are set. The voltage distribution constraint value is the average value of the relative error between the actual voltage and the rated voltage, and the load capacity constraint value is a preset threshold value. The preset threshold value is used to limit the ratio of real-time power flow to maximum carrying capacity. By using the finite difference numerical integration method, the voltage deviation constraint value and the load capacity constraint value are used as boundary conditions to iteratively adjust the boundary point values ​​of the level set function in order to satisfy the stability constraints.

6. The power grid optimization method based on level set functions according to claim 1, characterized in that, The step of using a variational autoencoder decoder module to analyze the initial level set function and determine the potential characteristics and dynamic constraints of the power grid topology includes: The variational autoencoder decoder module reconstructs the feature representation of the power grid topology based on the level set function and extracts latent features, including node connectivity weights and line power flow distribution. Based on the physical constraint parameters, dynamic constraint conditions are determined, including load fluctuation range and power loss threshold; wherein... By analyzing voltage distribution and power factor, the standard deviation of load power at each node within a time window determined according to the dynamic cycle of the power grid is calculated, and the load fluctuation range is determined. Based on the line load capacity and combined with the power flow data in the power grid topology dataset, the weighted sum of Joule losses of the line is calculated to determine the power loss threshold.

7. The power grid optimization method based on level set functions according to claim 1, characterized in that, The optimization of the parameters of the level set function based on the latent features and dynamic constraints includes: A constraint-based gradient optimization method is adopted, which combines the latent features and the dynamic constraints, to adjust the parameters of the level set function in order to minimize power loss and improve load balance. The load balance is measured by the standard deviation of the load power of each node. The optimization process uses an adaptive step size adjustment mechanism to dynamically determine the gradient descent step size based on the real-time deviation of the voltage distribution and the rate of change of the load fluctuation range.

8. A power grid optimization device based on level set functions, characterized in that, The device includes: The power grid data acquisition unit is configured to collect topology data of the power grid, including node distribution, line impedance, load dynamics and power flow data, and to construct a power grid topology dataset containing multi-dimensional features based on the topology data. The physical constraint parameter construction unit is configured to construct physical constraint parameters characterizing the power transmission efficiency and stability of the power grid based on the power grid topology dataset. The physical constraint parameters include voltage distribution, power factor, and line load capacity. The horizontal set function generation unit is configured to perform dimensionality reduction encoding on the power grid topology through a variational autoencoder to generate a low-dimensional latent space representation, and to construct an initial horizontal set function based on the low-dimensional latent space representation using the physical constraint parameters. The initial horizontal set function characterizes the connectivity and power transmission characteristics of the power grid topology. The level set function decoding unit is configured to analyze the initial level set function using the variational autoencoder decoder module to determine the potential characteristics and dynamic constraints of the power grid topology. The optimized data generation unit is configured to optimize the parameters of the level set function based on the potential features and dynamic constraints, and generate improved power grid layout data based on the optimized level set function.

9. An electronic device, characterized in that, include: One or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 7.