Energy management method and system for smart power grid

By building a power data prediction model and virtual impedance factors, the power distribution plan of the power grid is optimized, which solves the stability problem caused by the fluctuation of renewable energy output in the traditional power grid management system, realizes the efficient operation of the power grid and improves the user's electricity experience.

CN120675053APending Publication Date: 2025-09-19HUBEI BOJIN ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510789826.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Traditional grid management systems have difficulty accurately predicting and responding to fluctuations in renewable energy output, leading to grid stability issues, increasing operating costs, and affecting the safety and reliability of the power system.

Method used

By acquiring historical power data of energy storage devices involved in the power grid, a power data prediction model is constructed. Combining the dynamic Bayesian network algorithm and the power grid topology, a virtual impedance factor and voltage sensitivity matrix are constructed to optimize the power distribution plan.

Benefits of technology

It has achieved accurate prediction of the future power demand of the power grid, improved the stability and energy utilization efficiency of the power grid, reduced power outages and voltage fluctuations, and improved users' electricity experience and transparency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120675053A_ABST
    Figure CN120675053A_ABST
Patent Text Reader

Abstract

The invention discloses an energy management method and system for a smart power grid, and relates to the field of power grid energy management, and the method comprises the steps: obtaining the historical power data of a power grid; extracting time sequence features of the historical power data to obtain a comprehensive feature matrix, and constructing a power data prediction model according to the comprehensive feature matrix; acquiring temperature characteristic data and real-time power data of the power grid in real time; inputting the real-time power data into the power data prediction model, and outputting power prediction data through the power data prediction model; determining a virtual impedance factor of the power grid based on the temperature characteristic data; constructing a node admittance matrix in combination with the real-time power data and the power grid node set, introducing a virtual impedance factor into the node admittance matrix, and constructing a voltage sensitivity matrix by using a preset power flow equation; and executing preset power distribution logic in combination with the voltage sensitivity matrix and the power prediction data, and determining a power distribution scheme of the power grid. The operation stability of the power system can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power grid energy management, and more particularly to an energy management method and system for a smart grid. Background Art

[0002] With the continuous growth of global energy demand and the rapid development of renewable energy, smart grids have become a key development direction for modern power systems. By integrating advanced information technology, communication technology, and control technology, smart grids enable intelligent, automated, and efficient operation of power systems, ensuring their safe, stable, and efficient operation.

[0003] In traditional power grid management systems, grid energy allocation is often based on fixed rules and policies. However, with the large-scale integration of renewable energy and energy storage devices, their intermittent and uncertain nature presents new challenges for energy management systems. Traditional approaches based on fixed rules and policies often struggle to accurately predict and respond to fluctuations in renewable energy output. This results in insufficient utilization during peak renewable energy output and the need to rely on traditional energy sources to supplement output during low output periods. For example, when wind speeds suddenly increase, wind power output may far exceed forecasts, causing grid voltage increases and frequency fluctuations, potentially leading to grid stability issues. When wind speeds decrease or stop, wind power output may far fall below forecasts, resulting in insufficient grid power supply and the need to activate other power sources for supplemental support, impacting grid stability. The grid's poor adaptability to renewable energy and energy storage devices not only increases power system operating costs but also affects system stability. Summary of the Invention

[0004] The embodiments of the present application provide an energy management method and system for a smart grid, which are used to improve the stability of power system operation.

[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions: In a first aspect, an energy management method for a smart grid is provided, which is applied to a grid management system for regulating a grid, wherein the grid is connected to an energy storage device, and the method comprises the following steps: Obtain historical power data of energy storage devices inserted into the power grid; Extract the time series features of historical power data to obtain a comprehensive feature matrix, and build a power data prediction model based on the comprehensive feature matrix; Real-time acquisition of temperature characteristic data of the power grid and real-time power data of energy storage devices inserted into the power grid; Inputting real-time power data into the power data prediction model, and outputting power prediction data through the power data prediction model; Determine the virtual impedance factor of the power grid based on temperature characteristic data and using a dynamic Bayesian network algorithm; The node admittance matrix is ​​constructed by combining real-time power data and the set of grid nodes in the grid topology. A virtual impedance factor is introduced into the node admittance matrix and a voltage sensitivity matrix is ​​constructed using a preset power flow equation. Combined with the voltage sensitivity matrix and power forecast data, the preset power distribution logic is executed to determine the power distribution plan of the power grid.

[0006] In a possible implementation of the first aspect, the historical power data includes first historical power data before the energy storage device is connected and second historical power data after the energy storage device is connected. Extracting time series features of the historical power data to obtain a comprehensive feature matrix, and constructing a power data prediction model based on the comprehensive feature matrix includes: Extracting time series features of the first historical power data and the second historical power data under a standard state to obtain a first reference sequence and a second reference sequence; The first reference sequence and the second reference sequence are cross-modally aligned using a preset dynamic coupling model to obtain a comprehensive feature matrix; Combine historical power data and comprehensive feature matrix to train the preset long short-term memory network prediction model to obtain the power data prediction model; Among them, the long short-term memory network prediction model includes an input layer, an LSTM processing layer and an output layer. The input layer is used to receive historical power data and a comprehensive feature matrix. The LSTM processing layer is used to determine the time series dependency and dynamic characteristics of the data in the comprehensive feature matrix. The output layer is used to output power prediction data.

[0007] In a possible implementation of the first aspect, extracting time series features of the first historical power data and the second historical power data under a standard state to obtain the first reference sequence and the second reference sequence includes: Extracting grid parameter sequence data of the first historical power data under each standard operating condition, wherein each grid parameter sequence data includes a timestamp and corresponding grid parameter data; The dynamic time warping algorithm is used to calculate the similarity of any two power grid parameter sequence data; Traversing each grid parameter sequence data, and taking the grid parameter sequence data with a similarity greater than a preset similarity threshold as a first reference sequence; Performing empirical mode decomposition on the second historical power data to extract multiple intrinsic mode functions; Among multiple intrinsic mode functions, the first three order intrinsic mode functions are selected for reconstruction to obtain the typical output curve of the power grid connected to the energy storage device in history; A second reference sequence is generated according to a typical output curve of the power grid and a charge-discharge balance mode corresponding to the energy storage device.

[0008] In a possible implementation of the first aspect, the temperature characteristic data includes ambient temperature data and an impedance parameter corresponding to the ambient temperature data, and determining the virtual impedance factor of the power grid based on the temperature characteristic data and using a dynamic Bayesian network algorithm includes: Combining ambient temperature data and impedance parameters and using dynamic Bayesian network algorithm to build a dynamic network topology model; Inputting the ambient temperature data into the dynamic network topology model, and determining the corrected line impedance parameters through the dynamic network topology model; The virtual impedance factor of the power grid is calculated using the modified line impedance parameters and the preset compensation term calculation formula.

[0009] In a possible implementation of the first aspect, the preset power flow equation includes a DC power flow equation and an AC power flow equation, the real-time power data includes first power data before the energy storage device is connected and second power data after the energy storage device is connected, combining the real-time power data and a set of grid nodes in the grid topology to construct a node admittance matrix, introducing a virtual impedance factor into the node admittance matrix and constructing a voltage sensitivity matrix using the preset power flow equation includes: Dividing the topology of the power grid into a first topology substructure without access to the energy storage device and a second topology substructure with access to the energy storage device according to the involvement of the energy storage device; Creating an initialization admittance matrix according to a first grid node of a first topology substructure; Traversing each first power grid node, and calculating the self-admittance of each first power grid node according to the admittance data in the first power data; Traversing each first power grid node, and calculating the mutual admittance of each first power grid node respectively according to the admittance data in the first power data; Filling the self-admittance and mutual-admittance of each first grid node into the initialization admittance matrix in node order to obtain a first node admittance matrix; Solve the first inverse matrix of the first node admittance matrix using a matrix inversion algorithm; Calculate a first voltage sensitivity matrix using a first inverse matrix and a DC power flow equation; Based on the second grid node in the second topology substructure, a second node admittance matrix is ​​constructed in combination with the initialized admittance matrix and the admittance data in the second power data; A virtual impedance factor is introduced into the second node admittance matrix, and the second voltage sensitivity matrix is ​​calculated using the AC power flow equation.

[0010] In a possible implementation of the first aspect, a virtual impedance factor is introduced into the second node admittance matrix, and an AC power flow equation is used to calculate a second voltage sensitivity matrix, including: Using the preset connection method, the second node admittance matrix is ​​corrected by the virtual impedance factor to obtain the target node admittance matrix; The AC power flow equation is corrected using the target node admittance matrix to obtain the corrected AC power flow equation; At the reference operating point, the modified AC power flow equation is Taylor expanded to obtain the modified DC power flow equation; Calculating the inverse matrix of the target node admittance matrix using the target node admittance matrix to obtain a corrected second inverse matrix; The coefficient matrix in the modified DC power flow equation is multiplied by the corrected second inverse matrix to obtain a second voltage sensitivity matrix.

[0011] In a possible implementation of the first aspect, executing a preset power distribution logic in combination with the voltage sensitivity matrix and the power forecast data to determine a power distribution plan for the power grid includes: Determine the voltage sensitive nodes in the topology of the power grid through the voltage sensitivity matrix; For any voltage-sensitive node, judging whether the power fluctuation range of the voltage-sensitive node exceeds a preset power fluctuation range based on the power prediction data, the first power data, and the second power data; The preset power distribution logic is executed for voltage-sensitive nodes that exceed the preset power fluctuation range to determine the power distribution plan of the power grid.

[0012] In a possible implementation of the first aspect, the method further includes: A non-standard state detection layer is added to the LSTM processing layer of the power data prediction model; A channel attention module is introduced into the LSTM processing layer of the power data prediction model, and adaptive weights are assigned to each node in the LSTM processing layer to determine the attention coefficient. Normalize the attention coefficient and use the preset weighting formula to calculate the weighted aggregated time feature; Extracting non-standard state data of the first historical power data and the second historical power data in a significantly non-standard state using a non-standard state detection layer; According to the weighted aggregated time characteristics and non-standard state data, a preset training strategy is selected and the power data prediction model is trained to obtain a significant non-standard state prediction model; Inputting the first power data and the second power data into a significant non-standard state prediction model, and outputting significant non-standard state prediction data; The power distribution plan is optimized through the significant non-standard state prediction data to determine the optimized power distribution plan.

[0013] In a second aspect, the present application provides a machine-readable storage medium having stored thereon instructions for enabling a machine to execute the above-mentioned energy management method for a smart grid.

[0014] In a third aspect, the present application provides an electronic device, comprising: a memory configured to store instructions; and The processor is configured to call instructions from the memory and implement the above-mentioned energy management method for the smart grid when executing the instructions.

[0015] The above technical solution, by acquiring historical power data from energy storage devices connected to the grid and building a power data prediction model, enables accurate prediction of future power demand. This helps the grid management system make proactive scheduling decisions and optimize power resource allocation, thereby improving energy efficiency. Real-time temperature characteristic data of the grid and real-time power data from energy storage devices connected to the grid, combined with a dynamic Bayesian network algorithm to determine the grid's virtual impedance factor, helps more accurately assess the grid's operating status, enabling rapid responses to grid faults or anomalies and enhancing grid stability. Subsequently, a node admittance matrix is ​​constructed by combining real-time power data with the grid node set in the grid topology, and the virtual impedance factor is introduced to construct a voltage sensitivity matrix. This helps more accurately understand the impact of voltage changes at each node in the grid on power distribution, thereby optimizing power distribution plans and ensuring efficient power delivery to all users. Accurate power forecasting and optimized power allocation can reduce power outages and voltage fluctuations, improving the user experience. Furthermore, users can use the energy management system to monitor their power usage in real time and create personalized power plans, improving transparency and convenience. At the same time, through predictive maintenance and other means, potential failures of power grid equipment can be discovered and handled in a timely manner, avoiding power outages and maintenance costs caused by equipment failures.

[0016] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A schematic diagram of a process flow of an energy management method for a smart grid provided in an embodiment of the present application; Figure 2 A schematic diagram of the structure of an energy management method for a smart grid provided in an embodiment of the present application. DETAILED DESCRIPTION

[0018] To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0019] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back, etc.), such directional indications are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0020] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0021] Figure 1 The following schematically shows a flow chart of an energy management method for a smart grid according to an embodiment of the present application. Figure 1 As shown, an embodiment of the present application provides an energy management method for a smart grid, which is applied to a grid management system for regulating a grid, wherein the grid is connected to an energy storage device. The method may include the following steps.

[0022] S110, obtaining historical power data of the energy storage device connected to the power grid; S120, extracting time series features of historical power data to obtain a comprehensive feature matrix, and constructing a power data prediction model based on the comprehensive feature matrix; S130, acquiring temperature characteristic data of the power grid and real-time power data of the energy storage device when it is connected to the power grid in real time; S140, inputting real-time power data into a power data prediction model, and outputting power prediction data through the power data prediction model; S150, determining a virtual impedance factor of the power grid based on the temperature characteristic data and using a dynamic Bayesian network algorithm; S160, constructing a node admittance matrix by combining the real-time power data and a set of grid nodes in the grid topology, introducing a virtual impedance factor into the node admittance matrix, and constructing a voltage sensitivity matrix by using a preset power flow equation; S170 , executing a preset power distribution logic in combination with the voltage sensitivity matrix and the power forecast data to determine a power distribution plan for the power grid.

[0023] Obtain historical power data of the energy storage device when it is involved in the power grid. In this embodiment, the historical power data of the energy storage device when it is involved in the power grid refers to the first historical power data when the energy storage device is not connected to the power grid and the second historical power data when the energy storage device is connected to the power grid. The first historical power data refers to the power data generated by the operation of the power grid itself when the energy storage device is not connected to the power grid. It may include the load changes, power generation, power transmission losses, voltage fluctuations, etc. of the power grid, reflecting the natural operating state of the power grid without the support of the energy storage device. The second historical power data refers to the power data generated by the joint operation of the power grid and the energy storage device after the energy storage device is connected to the power grid. In addition to the operating data of the power grid itself, it also includes the charging and discharging data of the energy storage device, the power exchange data between the energy storage device and the power grid, etc., reflecting the regulatory effect of the energy storage device on the operation of the power grid. To obtain the historical power data of the energy storage device involved in the power grid, you can obtain it through a professional data platform or the official website.

[0024] After obtaining historical power data from the period when energy storage devices were connected to the power grid, the time series features of the historical power data are extracted to obtain a comprehensive feature matrix. A power data prediction model is then constructed based on the comprehensive feature matrix. In this embodiment, the comprehensive feature matrix is ​​constructed by extracting features from a first set of historical power data without the energy storage device connected and a second set of historical power data with the energy storage device connected. First, the historical power data is preprocessed. Subsequently, the historical power data is decomposed into components such as trend, seasonality, and residuals to reveal inherent patterns in the data. Statistics such as the mean, variance, and autocorrelation coefficient of the historical power data are calculated. Local features such as the maximum, minimum, and average values ​​within the window are then extracted using a sliding window to obtain the time series features of the historical power data. Next, features that are significant for power forecasting are selected from the extracted time series features to construct a comprehensive feature matrix. This can be achieved through methods such as correlation analysis and feature importance assessment. First, correlation analysis is performed on the time series features of the historical power data using methods such as the Pearson correlation coefficient and the Spearman correlation coefficient to measure the strength and direction of the linear relationship between two variables. In power forecasting, feature importance can be assessed by calculating the correlation coefficient between time series features and the target variable (such as future power demand). Next, based on the results of the correlation analysis, features with significant impact on power forecasting are selected. In some cases, a single feature may not be sufficient to capture complex patterns in the data. In this case, multiple features can be combined to form new features. For example, the ratio, difference, or product between two or more features can be calculated to capture their interactions. To ensure that different features have equal weight in model training, the features need to be normalized or standardized. The selected and processed features are arranged in a specific order to form a comprehensive feature matrix. After obtaining the comprehensive feature matrix, a power data forecasting model is constructed based on the comprehensive feature matrix. Based on the characteristics of the power data and the forecasting requirements, an appropriate forecasting model should be selected, such as a linear regression model or a support vector machine (SVM). The historical power data set is divided into a training set and a test set. The model is trained using the training set, the test set, and the comprehensive feature matrix to obtain the power data forecasting model.

[0025] Real-time acquisition of temperature characteristic data of the power grid and real-time power data of the energy storage device connected to the power grid. In this embodiment, the temperature characteristic data refers to the ambient temperature data and the impedance parameter corresponding to the ambient temperature data. The real-time power data of the energy storage device connected to the power grid refers to first power data before the energy storage device is connected and second power data after the energy storage device is connected. The first power data refers to the real-time power parameters (such as voltage, current, and power) of the power grid before the energy storage device is connected; the second power data refers to the real-time power parameters of the power grid after the energy storage device is connected. The temperature characteristic data and real-time power data can be obtained from the temperature data and impedance data collected in real time by the power grid management system.

[0026] After obtaining temperature characteristic data and real-time power data, the real-time power data is input into the power data prediction model, which then outputs power forecast data. Specifically, an appropriate prediction model is selected based on the prediction requirements and data characteristics, such as a time series analysis model, a machine learning model, or a deep learning model. The selected model is then trained using historical power data, and model parameters are adjusted to optimize prediction performance. During the training process, methods such as cross-validation and grid search can be used to find the optimal combination of model parameters. Based on the input data, the model generates power forecast results, such as load and power generation forecasts for a specific period of time. The forecast results can be output as numerical values ​​or displayed in visual charts, allowing managers to more intuitively understand power system operating trends. Power forecast data can be used for power system scheduling, energy management, and demand response. For example, load forecasts can be used to adjust power generation plans to ensure power supply and demand balance, while power generation forecasts can be used to optimize energy storage device charging and discharging strategies to improve energy efficiency.

[0027] The virtual impedance factor of the power grid is determined based on temperature characteristic data using a dynamic Bayesian network algorithm. In this embodiment, the virtual impedance factor refers to a parameter used to simulate or characterize actual impedance characteristic changes in the power grid. It is an equivalent or virtual value derived through data analysis and model inference. It can reflect the dynamic changes in the impedance characteristics of the power grid under different temperature conditions and is of great significance for stable operation, fault analysis, and optimized control of the power grid. Specifically, the impedance (such as resistance and inductance) of power grid equipment varies with temperature. Temperature sensors collect ambient temperature or equipment temperature data at key power grid nodes (such as transformers and transmission lines) to establish a correlation between temperature and impedance. Temperature data is fundamental for analyzing dynamic impedance changes. For example, high temperatures can increase conductor resistance, affecting the power transmission efficiency of the power grid. The dynamic Bayesian network algorithm is a probabilistic graphical model for processing time series data that combines the static structure and time-dynamic characteristics of Bayesian networks. First, temperature characteristic data (such as temperature and humidity) and corresponding line impedance data are collected during power grid operation. Based on this collected data, a DBN model is constructed. In this model, environmental factors such as temperature are used as observed variables, and line impedance or the virtual impedance factor is used as a latent variable. The DBN model is trained using historical data to learn the dependencies and conditional probability distribution between nodes. The model is updated using real-time data to predict the virtual impedance factor at future times.

[0028] The node admittance matrix is ​​constructed by combining real-time power data and the set of grid nodes in the grid topology. A virtual impedance factor is introduced into the node admittance matrix and a voltage sensitivity matrix is ​​constructed using the preset power flow equation. The node admittance matrix Y describes the electrical connection relationship between each node in the power network. Its elements Y ij Represents the admittance between node i and node j. To construct the node admittance matrix, first, assign a unique number to each node (such as 1, 2, 3, ...), determine which nodes have direct connections, and record the line parameters. Next, calculate the self-admittance and mutual admittance. The self-admittance is the self-admittance Y of node i. iiis the sum of the admittances of all branches connected to node i. ‌ Mutual admittance is the mutual admittance between nodes i and j. Yij is the negative value of the branch admittance between nodes i and j; if there is no direct connection, it is 0. The node admittance matrix is ​​constructed based on the mutual admittance and self-admittance. Secondly, after obtaining the node admittance matrix, a virtual impedance factor is introduced into the node admittance matrix and the voltage sensitivity matrix is ​​constructed using the preset power flow equation. The role of the virtual impedance is to simulate the impact of distributed power sources, flexible loads or control devices on the power grid, or to optimize the impedance characteristics of the power grid. That is, the admittance value of the virtual impedance is superimposed on the diagonal elements of the node admittance matrix. The modified admittance value will change the coefficient of the power flow equation. By solving the modified power flow equation, the changes in state variables such as voltage and phase angle are analyzed. The Jacobian matrix is ​​calculated through the modified power flow equation, and the inverse matrix of the Jacobian matrix is ​​calculated to obtain the voltage sensitivity matrix.

[0029] The preset power distribution logic is executed in combination with the voltage sensitivity matrix and the power forecast data to determine the power distribution plan of the power grid. In this embodiment, the preset power distribution logic can be determined according to the actual situation. The voltage sensitivity matrix can be used to determine the existence of voltage-sensitive nodes in the power grid, and the preset power distribution logic can be executed on the voltage-sensitive nodes to determine the power distribution plan of the power grid.

[0030] Figure 2 A schematic diagram of a method for energy management in a smart grid according to an embodiment of the present application is provided. Figure 2 As shown, first, a power data prediction model and a significant non-standard state prediction model are constructed using first and second historical power data. The power data prediction model then outputs power standard prediction data, while the significant non-standard state prediction model outputs significant non-standard state prediction data. A voltage sensitivity matrix is ​​constructed using the first and second power data, and a virtual impedance factor is introduced to correct the voltage sensitivity matrix in real time, resulting in a corrected voltage sensitivity matrix. The corrected voltage sensitivity matrix and the power standard prediction data are combined to execute power distribution logic and generate a power distribution plan. The significant non-standard state prediction data is then used to optimize the power distribution plan, resulting in a final power distribution plan.

[0031] The above technical solution, by acquiring historical power data from energy storage devices connected to the grid and building a power data prediction model, enables accurate prediction of future power demand. This helps the grid management system make proactive scheduling decisions and optimize power resource allocation, thereby improving energy efficiency. Real-time temperature characteristic data of the grid and real-time power data from energy storage devices connected to the grid, combined with a dynamic Bayesian network algorithm to determine the grid's virtual impedance factor, helps more accurately assess the grid's operating status, enabling rapid responses to grid faults or anomalies and enhancing grid stability. Subsequently, a node admittance matrix is ​​constructed by combining real-time power data with the grid node set in the grid topology, and the virtual impedance factor is introduced to construct a voltage sensitivity matrix. This helps more accurately understand the impact of voltage changes at each node in the grid on power distribution, thereby optimizing power distribution plans and ensuring efficient power delivery to all users. Accurate power forecasting and optimized power allocation can reduce power outages and voltage fluctuations, improving the user experience. Furthermore, users can use the energy management system to monitor their power usage in real time and create personalized power plans, improving transparency and convenience. At the same time, through predictive maintenance and other means, potential failures of power grid equipment can be discovered and handled in a timely manner, avoiding power outages and maintenance costs caused by equipment failures.

[0032] In one implementation of this embodiment, the historical power data includes first historical power data before the energy storage device is connected and second historical power data after the energy storage device is connected. Extracting time series features of the historical power data to obtain a comprehensive feature matrix, and constructing a power data prediction model based on the comprehensive feature matrix includes: S210, extracting time series features of the first historical power data and the second historical power data under a standard state to obtain a first reference sequence and a second reference sequence; S220, performing cross-modal alignment on the first reference sequence and the second reference sequence using a preset dynamic coupling model to obtain a comprehensive feature matrix; S230, combining historical power data and the comprehensive feature matrix to train a preset long short-term memory network prediction model to obtain a power data prediction model; Extract the time series features of the first historical power data and the second historical power data under standard conditions to obtain a first reference sequence and a second reference sequence. In this embodiment, the first reference sequence refers to a reference sequence generated after extracting the time series features based on the first historical power data (power data without connecting to the energy storage device) under standard conditions; the second reference sequence refers to a reference sequence generated after extracting the time series features based on the second historical power data (power data without connecting to the energy storage device) under standard conditions. The extracted time series features include periodic features, trend features, etc., such as extracting daily load peaks, valleys, and averages, analyzing the differences between weekdays and weekends, and identifying summer and winter load characteristics. Specifically, the similarity of the first historical power data can be calculated through a dynamic time warping algorithm, and the grid parameter sequence data with a similarity less than a preset threshold is used as the first reference sequence; perform empirical mode decomposition on the second historical power data, and extract multiple intrinsic mode functions, reconstruct the typical power output curve of the power grid based on the intrinsic mode functions, and determine the second reference sequence through the typical power output curve of the power grid and the charge and discharge balance mode corresponding to the energy storage device; After obtaining the first and second reference sequences, they are cross-modally aligned using a preset dynamic coupling model to obtain a comprehensive feature matrix. In this embodiment, the first and second reference sequences typically have different modal characteristics (e.g., time scales). Cross-modal alignment using the preset dynamic coupling model can fuse the features of multi-source data to generate a comprehensive feature matrix, providing a unified data foundation for power grid analysis, prediction, and optimization. Specifically, the first and second reference sequences can be input into the preset dynamic coupling model, and the preset dynamic coupling model is used to concatenate or weightedly fuse the first and second reference sequences to obtain the comprehensive feature matrix.

[0033] Next, a preset long-short-term memory (LSTM) network prediction model is trained in conjunction with the historical power data and the comprehensive feature matrix to obtain a power data prediction model. In this embodiment, the LSTM network prediction model includes an input layer, an LSTM processing layer, and an output layer. The input layer is used to receive the historical power data and the comprehensive feature matrix; the LSTM processing layer is used to determine the time series dependencies and dynamic features of the data in the comprehensive feature matrix; and the output layer is used to output power prediction data. By training the LSTM network prediction model in conjunction with the historical power data and the comprehensive feature matrix, the temporal characteristics of the power data and the correlation between multiple sources of information can be effectively captured, thereby improving prediction accuracy and robustness. Specifically, historical power data (such as load data) and the comprehensive feature matrix can be input into the preset LSTM network prediction model, and the preset LSTM network prediction model is trained. The comprehensive feature matrix is ​​generated by fusing multiple sources of information through a dynamic coupling model to obtain the power data prediction model. The power data prediction model can be used to predict power data for future periods.

[0034] By extracting time series features and cross-modal alignment from the first historical power data without energy storage devices and the second historical power data with energy storage devices, and combining them with the comprehensive feature matrix to train the LSTM prediction model, the prediction accuracy can be effectively improved, the model robustness can be enhanced, and energy storage optimization scheduling can be supported. It also provides data support for energy storage charging and discharging strategies, thereby improving the flexibility of the power grid.

[0035] In one implementation of this embodiment, extracting the time series features of the first historical power data and the second historical power data under the standard state to obtain the first reference sequence and the second reference sequence includes: S310: Extracting grid parameter sequence data of the first historical power data under each standard operating condition, wherein each grid parameter sequence data includes a timestamp and corresponding grid parameter data; S320, calculating the similarity of any two power grid parameter sequence data using a dynamic time warping algorithm; S330, traversing each grid parameter sequence data, and taking the grid parameter sequence data with a similarity greater than a preset similarity threshold as a first reference sequence; S340, performing empirical mode decomposition on the second historical power data to extract multiple intrinsic mode functions; S350, selecting the first three order intrinsic mode functions from the plurality of intrinsic mode functions for reconstruction to obtain a typical output curve of the power grid connected to the energy storage device in history; S360: Generate a second reference sequence based on a typical power grid output curve and a charge-discharge balance mode corresponding to the energy storage device.

[0036] Extract the grid parameter sequence data of the first historical power data under each standard working condition, wherein each grid parameter sequence data includes a timestamp and the corresponding grid parameter data. In this embodiment, the grid parameter sequence data under standard working conditions refers to the time series record of key parameters in the power grid under specific operating conditions (such as normal load, peak load, valley load, etc.) including timestamp and grid parameter data. First, preprocess the first historical power data. Then, identify and classify the working conditions, and label each data according to external data (such as weather forecast, load curve characteristics). For example, if the load in a certain period exceeds 120% of the daily average load, it is marked as "peak load". Next, use a clustering algorithm (such as K-Means) or a rule engine to divide the historical data into different working condition categories. According to the working condition label, filter out the data under each working condition, and arrange the data in chronological order for each working condition to generate a grid parameter sequence: After obtaining the grid parameter sequence data, the dynamic time warping algorithm is used to calculate the similarity between any two grid parameter sequence data. Dynamic time warping is an algorithm used to calculate the similarity between two time series. It is particularly suitable for situations where the time series have different lengths or there is a time offset. The core is to find the optimal matching path between the two sequences through dynamic programming to minimize the matching cost. In other words, the similarity between any two grid parameter sequence data is calculated using the dynamic time warping algorithm. In power systems, the time alignment and similarity calculation of grid parameter sequences (such as load, voltage, frequency, etc.) are crucial for tasks such as load forecasting, anomaly detection, and energy storage scheduling. The dynamic time warping algorithm is an effective elastic time alignment method that can handle nonlinear distortions of sequences on the time axis and is suitable for calculating the similarity between any two grid parameter sequences.

[0037] Subsequently, each grid parameter sequence data is traversed, and grid parameter sequence data with a similarity greater than a preset similarity threshold is selected as the first reference sequence. In this embodiment, the preset similarity threshold can be determined based on actual conditions. That is, each grid parameter sequence data is traversed, and sequences with a similarity greater than the preset similarity threshold are selected as the first reference sequence set. Calculating the similarity between grid parameter sequences using a dynamic time warping algorithm and selecting sequences with a similarity greater than the preset threshold as the first reference sequence is a key step in building a prediction model and implementing data-driven decision-making.

[0038] The second historical power data is subjected to empirical mode decomposition to extract multiple intrinsic mode functions. Empirical mode decomposition is an adaptive signal processing method that can decompose nonlinear and non-stationary signals into a set of intrinsic mode functions. The intrinsic mode function is each component obtained by empirical mode decomposition, which represents the fluctuation characteristics of the signal at different time scales. Subsequently, the power data (such as load curves, voltage fluctuations, frequency changes, etc.) when the energy storage device is not connected is extracted to obtain fluctuation patterns of different time scales, such as short-term fluctuation patterns (such as minute-level load changes) and long-term trend patterns (such as daily load peak changes). By performing empirical mode decomposition on the second historical power data and extracting multiple intrinsic mode functions, the fluctuation patterns of different time scales can be revealed, and the characteristics of the power data can be accurately characterized, making the power fluctuation characteristics of the second historical power data clearer, which helps to improve the accuracy of load forecasting.

[0039] Next, among multiple intrinsic modal functions, the first three order intrinsic modal functions are selected for reconstruction to obtain the typical output curve of the power grid connected to the energy storage device in history. The main reason for selecting the first three order intrinsic modal functions in this embodiment is that the first three order intrinsic modal functions usually contain the main fluctuation characteristics of the signal. Among them, the first order intrinsic modal function mainly reflects short-term rapid fluctuations, which has an important impact on the rapid response of the energy storage device; the second order intrinsic modal function mainly reflects medium-term fluctuations, which affects the short-term scheduling strategy of the energy storage device; the third order intrinsic modal function mainly represents long-term laws, guiding the capacity configuration and long-term scheduling of the energy storage device. By selecting the first three order intrinsic modal functions for reconstruction, the main features of the second historical power data can be retained, and noise and minor components can be removed. The first three order intrinsic modal functions are added together to obtain the typical output curve of the power grid connected to the energy storage device in history. The formula for adding the first three order intrinsic modal functions is as follows:

[0040] in, Represents the typical output curve of the power grid, represents the first-order intrinsic mode function, represents the second-order intrinsic mode function, represents the third-order intrinsic mode function; By summing and reconstructing the first three intrinsic mode functions, we can obtain a typical output curve that captures the main fluctuation characteristics of the power grid output. This helps the model more accurately capture the laws of load variation and improves prediction accuracy. Furthermore, by using this reconstructed typical output curve as input to the prediction model, we can reduce prediction errors caused by noise and minor components.

[0041] After obtaining the typical grid output curve, a second reference sequence is generated based on the typical grid output curve and the corresponding charge-discharge balance pattern of the energy storage device. In this embodiment, the typical grid output curve reflects the grid's power generation or load levels at different time periods, such as periodic power generation or load levels. The charge-discharge balance pattern of the energy storage device refers to the energy storage system dynamically adjusting its charge and discharge strategy based on grid demand or electricity price signals to balance supply and demand or reduce costs. The second reference sequence is a new sequence generated based on the grid output curve and energy storage behavior, reflecting the regulatory effect of energy storage on the grid or optimizing the target. This can be achieved by analyzing the typical grid output curve, extracting periodic features (such as daily load curves), and identifying fluctuation intervals (such as peak and valley periods). Subsequently, the charge and discharge logic is set based on the energy storage target (such as peak shaving and valley filling, arbitrage). For example, if the grid output exceeds a preset threshold, the energy storage device charges; otherwise, it discharges. If the electricity price is less than the preset threshold, the energy storage device charges; otherwise, it discharges. Based on the energy storage target, the grid output curve is adjusted to generate a smoothed or optimized reference sequence. For example, the data and time of the grid output are determined using the typical grid output curve, as shown in the following table:

[0042] The energy storage charging and discharging rules are as follows: when the grid output is greater than 300MW, the energy storage is charged (absorbing excess energy); when the grid output is less than 200MW, the energy storage is discharged (supplementing the shortage).

[0043] Then, a second reference sequence is generated based on the typical power output curve of the power grid and the charge-discharge balance mode corresponding to the energy storage device. Assuming the energy storage capacity is 100MW and the charge-discharge rate is 50MW / h, the second reference sequence is calculated as shown in the following table:

[0044] The generated second reference sequence is [150, 200, 300, 350, 150], reflecting the regulatory role of energy storage on grid output. This second reference sequence reflects the grid's load demands at different times, guiding the energy storage device to discharge during peak load periods and charge during off-peak load periods, thus achieving spatiotemporal energy transfer. For example, during peak demand periods, the energy storage device releases energy to provide additional power to the grid; during off-peak demand periods, the energy storage device charges to store excess energy. Through a rational charge and discharge schedule, overcharging or discharging of the energy storage device is avoided, extending its service life. This also ensures that the energy storage device can maximize its effectiveness at critical moments, improving overall utilization.

[0045] In this embodiment, the first data characteristic directly represents the original operating state of the power grid (such as time series of current, voltage, and frequency), and the complete time series fluctuation characteristics must be retained to reflect the dynamic response of the power grid. The second data characteristic includes the charging and discharging behavior of the energy storage device, whose output curve has the characteristics of low-frequency periodicity and high-frequency pulse superposition. After EMD decomposition, the reconstruction of the first three-order IMF can remove noise and retain the main charging and discharging patterns, avoiding confusion with high-frequency transient fluctuations in the power grid. The DTW algorithm is suitable for calculating the local time warp similarity of sequences of equal length, but it is not sensitive enough to the nonlinear and non-stationary characteristics of the energy storage device output curve (such as charging and discharging mutation points). EMD decomposition can decompose complex signals into IMFs of different frequency components, and can specifically extract the dominant modes of the energy storage device (usually low-order IMFs contain the main energy), avoiding dimensionality mismatch with the DTW calculation of the power grid parameter sequence. Driven by the differences in data characteristics and the requirements of algorithm adaptability, the first historical power data and the second historical power data are separately extracted to form the first reference sequence and the second reference sequence, which can simplify feature engineering. Moreover, for different reference sequences, a method that is more suitable for their feature extraction can be adopted, thereby avoiding the problem of feature redundancy or feature loss that may occur when performing complex feature engineering on mixed data, simplifying the feature engineering process and improving model accuracy.

[0046] By leveraging techniques such as dynamic time warping and empirical mode decomposition to mine the temporal characteristics and inherent patterns of historical power data, data features can be precisely extracted, helping to improve load forecasting accuracy. Decomposing the secondary historical power data into multiple intrinsic mode functions (IMFs) and selecting the first three IMFs to reconstruct a typical power grid output curve reveals trends, periodicity, and noise components in the data, providing a clearer perspective for subsequent analysis, helping to mine the data's inherent characteristics and enhance model robustness. Combining the typical power grid output curve with the energy storage charge-discharge balance pattern to determine a second reference sequence accurately reflects the actual operating characteristics of the power grid (such as load fluctuations and renewable energy output). By also factoring in the energy storage system's regulation strategies (such as peak shaving and arbitrage), the generated sequence meets actual requirements, demonstrating improved scientific accuracy in the forecasting model's decision-making.

[0047] In one implementation of this embodiment, the temperature characteristic data includes ambient temperature data and an impedance parameter corresponding to the ambient temperature data. Determining the virtual impedance factor of the power grid based on the temperature characteristic data and using a dynamic Bayesian network algorithm includes: S410, combining ambient temperature data and impedance parameters and using a dynamic Bayesian network algorithm to construct a dynamic network topology model; S420, inputting the ambient temperature data into the dynamic network topology model, and determining the corrected line impedance parameters through the dynamic network topology model; S430: Calculate the virtual impedance factor of the power grid using the modified line impedance parameter and a preset compensation term calculation formula.

[0048] A dynamic network topology model is constructed using a dynamic Bayesian network algorithm, combining ambient temperature data and impedance parameters. In this embodiment, the temperature characteristic data includes ambient temperature data and the impedance parameters corresponding to the ambient temperature data. The ambient temperature data represents the ambient temperature measurements of the target area or device at different time points; the impedance parameters corresponding to the ambient temperature data represent the impedance parameter changes caused by ambient temperature changes at the same time point. A dynamic Bayesian network is an extension of the Bayesian network, primarily used to describe random processes in time series data. Useful features, such as temperature trends and impedance fluctuation ranges, can be extracted from the ambient temperature data and impedance parameters and used as inputs for observation nodes. Subsequently, based on actual needs, state nodes (e.g., normal operation, fault, etc.) and observation nodes (e.g., ambient temperature, impedance parameters, etc.) of the dynamic Bayesian network model are defined. A dynamic network topology model is constructed based on these state nodes (e.g., normal operation, fault, etc.) and observation nodes (e.g., ambient temperature, impedance parameters, etc.). Next, the real-time collected ambient temperature and impedance parameters are input into the dynamic network topology model. Based on the real-time data, the conditional probability distribution within the model is dynamically updated to reflect the current state of the system or device. The dynamic network topology model is used to perform state inference based on real-time data to determine the current state of the system or device. Based on the state inference results, a network topology model of the system or device is dynamically generated to reflect its current connection relationship and state distribution.

[0049] Subsequently, the ambient temperature data is input into the dynamic network topology model, and the corrected line impedance parameters are determined by the dynamic network topology model. The real-time ambient temperature data can be input into the trained dynamic network topology model. The dynamic network topology model calculates the corrected impedance parameters based on the current temperature and historical impedance parameters, and outputs the corrected impedance values ​​(such as corrected resistance and corrected reactance).

[0050] The virtual impedance factor of the power grid is calculated using the corrected line impedance parameters and a preset compensation term calculation formula. The virtual impedance factor is a parameter used to quantify the virtual impedance and determines the degree of impact of the virtual impedance on the power grid's operating performance. The preset compensation term calculation formula can be designed based on the power grid's control objectives (such as power sharing, circulating current suppression, etc.) and line impedance characteristics. In this embodiment, the preset compensation term calculation formula can be: Virtual impedance factor = k × reference impedance / corrected line impedance The corrected line impedance is the actual line impedance value obtained through real-time measurement and correction; the base impedance is a preset reference impedance value; and k represents the compensation factor, which is used to adjust the virtual impedance factor and can be adjusted based on the grid's control objectives and line characteristics. For example, if the base impedance is 100Ω and the corrected line impedance is 120Ω, the compensation factor is 0.5. Substituting the base impedance, corrected line impedance, and compensation into the preset compensation calculation formula, the virtual impedance factor = 0.5 × 1.2 = 0.6. Therefore, the virtual impedance factor is 0.6.

[0051] Determining the virtual impedance factor of the power grid by using temperature characteristic data and a dynamic Bayesian network algorithm can not only more accurately reflect the actual operating status of the power grid, but also enable more precise prediction and control of the power grid, and adjust the virtual impedance factor in advance to cope with impending ambient temperature changes.

[0052] In one implementation of this embodiment, the preset power flow equation includes a DC power flow equation and an AC power flow equation, the real-time power data includes first power data before the energy storage device is connected and second power data after the energy storage device is connected, combining the real-time power data and a set of grid nodes in the grid topology to construct a node admittance matrix, introducing a virtual impedance factor into the node admittance matrix and constructing a voltage sensitivity matrix using the preset power flow equation includes: S510: Divide the topology of the power grid into a first topology substructure without access to the energy storage device and a second topology substructure with access to the energy storage device according to the access status of the energy storage device; S520: Create an initialization admittance matrix according to the first power grid node of the first topology substructure; S530, traversing each first power grid node, and calculating the self-admittance of each first power grid node according to the admittance data in the first power data; S540, traverse each first power grid node, and calculate the mutual admittance of each first power grid node according to the admittance data in the first power data; S550, filling the self-admittance and mutual-admittance of each first power grid node into the initialization admittance matrix in node order to obtain a first node admittance matrix; S560, using a matrix inversion algorithm to solve a first inverse matrix of the first node admittance matrix; S570, calculating a first voltage sensitivity matrix using a first inverse matrix and a DC power flow equation; S580: Based on the second grid node in the second topology substructure, a second node admittance matrix is ​​constructed in combination with the initialized admittance matrix and the admittance data in the second power data; S590 , introducing a virtual impedance factor into the second node admittance matrix, and calculating a second voltage sensitivity matrix using an AC power flow equation.

[0053] Based on the presence of energy storage devices, the power grid topology is divided into a first sub-topology without energy storage devices and a second sub-topology with energy storage devices. In this embodiment, the first sub-topology refers to the topology without energy storage devices, while the second sub-topology refers to the topology with energy storage devices. Nodes in a power grid can be divided into two categories: nodes with energy storage devices and nodes without them. Based on node type, the power grid can be divided into two sub-structures. For example, assume a power grid consists of three nodes (A, B, and C) and two lines (AB and BC). If an energy storage device is connected to node B, the first sub-topology only includes lines AB and BC, ignoring the energy storage device. The second sub-topology includes lines AB, BC, and the connection between the energy storage device and node B. Dividing the power grid topology into the first sub-topology without energy storage devices and the second sub-topology with energy storage devices based on the presence of energy storage devices helps to better understand the operational characteristics and stability of the power grid. In practical applications, the topology can be reasonably selected according to the actual needs and operating characteristics of the power grid, and appropriate energy storage devices can be connected to improve the operating efficiency and stability of the power grid.

[0054] To create an initial admittance matrix based on the first grid node in the first topological substructure, first determine the number of nodes in the grid and the connectivity between them. This includes power nodes, load nodes, and possible connection nodes. The connectivity between nodes includes which nodes are directly connected, as well as the electrical parameters of the connecting lines (such as impedance and admittance). Secondly, determine the dimensions of the admittance matrix. The admittance matrix is ​​a square matrix whose dimensions equal the number of nodes in the grid. For a grid with n nodes, the admittance matrix Y is an n×n matrix. All elements of the admittance matrix Y are set to 0 to obtain the initial admittance matrix.

[0055] After obtaining the initialized admittance matrix, traverse each first grid node and calculate the self-admittance of each first grid node according to the admittance data in the first power data. In the power system, the admittance matrix is ​​an important tool for describing the electrical connection relationship between each node in the power grid. The elements in the admittance matrix include self-admittance and mutual admittance. Self-admittance represents the connection strength between the node and itself, while mutual admittance represents the connection strength between nodes. The admittance data in the first power data contains the branch admittance value between each pair of directly connected nodes, for example, node i, node j, admittance Y ij , indicating that the admittance of the branch between node i and node j is Y ijEach first grid node can be traversed, and for each node i, all branches directly connected to node i (i.e., branches containing node i in the node pair) can be found in the admittance data, and the self-admittance of the first grid node can be calculated based on the admittance data connected to node i. For example, suppose node 1 is connected to nodes 2 and 3, and the branch admittances are y 12 =0.1S and y 13 =0.2S, then the self-admittance of node 1 is Y 11 =y 12 +y 13 =0.1+0.2=0.3S.

[0056] Next, traverse each first grid node and calculate the mutual admittance of each first grid node according to the admittance data in the first power data. Mutual admittance refers to the admittance value between node i and node j, which reflects the direct electrical coupling relationship between node i and node j. Each branch has its admittance Y branch If a branch connects node i and node j, the mutual admittance is Y ij =Y ji =-Y branch For example, suppose node 1 is connected to node 2 and node 3. For the branch admittance y between node 1 and node 2, 12 =0.1S, then the mutual admittance between node 1 and node 2 is Y 12 =-y 12 =-0.1S.

[0057] The self-admittance and mutual-admittance of each first grid node are filled into the initialization admittance matrix in node order to obtain the first node admittance matrix. First, for each node i, its self-admittance Y is calculated. ii , and fill it into the diagonal position Y[i,i] of the admittance matrix. For each pair of directly connected nodes i and j, calculate their mutual admittance Y ij , and fill it into the non-diagonal positions Y[i, j] and Y[j, i] of the admittance matrix. Secondly, since the admittance matrix is ​​symmetric, Y ij =Y ji The admittance matrix obtained through the above filling process is the first node admittance matrix. The first node admittance matrix contains the electrical coupling information between all nodes in the power grid and is the basis for power system analysis. The first node admittance matrix is ​​as follows:

[0058] Where Y represents the first node admittance matrix, Y 11 represents the self-admittance of node 1, Y 12 represents the mutual admittance between node 1 and node 2, and so on, Y nn represents the self-admittance of node n, Yn2 represents the mutual admittance between node n and node 2.

[0059] Subsequently, a matrix inversion algorithm is used to obtain the first inverse matrix of the first nodal admittance matrix. In this embodiment, the matrix inversion algorithm can be the Gauss-Jordan elimination method. The Gauss-Jordan elimination method converts a matrix into an identity matrix through row transformations and then performs the same transformations on the identity matrix to obtain the inverse matrix. That is, the Gauss-Jordan elimination method is used to obtain the inverse matrix of the first nodal admittance matrix, thereby obtaining the first inverse matrix.

[0060] After obtaining the first inverse matrix, the first voltage sensitivity matrix is ​​calculated using the first inverse matrix and the DC power flow equation. The voltage sensitivity matrix is ​​used to describe the response of the node voltage to changes in the node injection power. First, the voltage vector is calculated using the first inverse matrix. In the DC power flow equation, the node injection power P and the node voltage phase angle θ satisfy a linear relationship, as shown below:

[0061] Where B is the matrix consisting of the imaginary part of the node admittance matrix, and θ represents the voltage phase angle vector.

[0062] The inverse matrix Y of the admittance matrix Y -1 It is called the first inverse matrix. In DC power flow calculations, the admittance matrix Y = jB, where Y represents the admittance matrix, B is the matrix consisting of the imaginary part of the node admittance matrix, and j is the imaginary unit used to represent the imaginary part of the admittance matrix, reflecting the influence of the reactance in the network.

[0063] Therefore, Y -1 =-jB -1 By solving the DC power flow equation, the voltage phase angle vector θ can be obtained:

[0064] Where θ represents the voltage phase angle vector, B is the matrix consisting of the imaginary part of the node admittance matrix, P represents the node injection power, Y represents the admittance matrix, and j represents the imaginary unit.

[0065] Assuming that the voltage amplitude |V| is constant, the voltage vector V can be expressed as:

[0066] Where V represents the voltage vector, j represents the imaginary unit, θ represents the voltage phase angle vector, and e is the base of the natural logarithm, which is used to convert the phase angle θ into a complex form to facilitate complex number operations and analysis.

[0067] After obtaining the voltage vector, the voltage vector V is differentiated with respect to the injected power P to obtain:

[0068] From the equation P=Bθ, the derivative of the voltage phase angle vector θ with respect to power P can be obtained:

[0069] Therefore, substituting the derivative of the voltage phase angle vector θ with respect to the power P into the formula for the derivative of the voltage vector V with respect to the injected power P, we obtain:

[0070] Then, substitute B -1 =-jY -1 ,get

[0071] Since the first voltage sensitivity matrix S V is the sensitivity of the voltage amplitude to the injected power, while the voltage amplitude |V| is constant, so:

[0072] in, is the conjugate of the voltage vector V. Since the voltage amplitude |V| is constant, then:

[0073] Among them, S V is the first voltage sensitivity matrix, which is used to quantify the impact of node injection power changes on node voltage amplitude; V is a voltage vector, which may be a complex number or complex vector, representing the voltage amplitude and phase of the node; Y -1 It is the inverse matrix of the admittance matrix and describes the electrical characteristics of the network; is the conjugate complex number or conjugate transpose of V, which is used to maintain conservation of power or energy in complex number operations; |V| is the modulus (or norm) of the voltage vector V, which indicates the magnitude of the voltage; the function of the "Re" symbol is to extract the real part of the complex number, that is, Re(z)=a.

[0074] Substituting the above actual power system parameters (such as the specific voltage vector V, admittance matrix Y, etc.) into the above formula for calculation, a first voltage sensitivity matrix is ​​obtained.

[0075] After obtaining the first voltage sensitivity matrix, a second node admittance matrix is ​​constructed based on the second grid node in the second topology substructure and in combination with the initialized admittance matrix and the admittance data in the second power data. First, the admittance data of the second topology substructure is extracted, the self-admittance and mutual admittance of the second grid node are calculated, and the self-admittance and mutual admittance of each second grid node are sequentially filled into the second initialized admittance matrix in node order to obtain the second node admittance matrix.

[0076] Subsequently, a virtual impedance factor is introduced into the second-node admittance matrix, and the second voltage sensitivity matrix is ​​calculated using the AC power flow equation. The second-node admittance matrix is ​​a matrix used to describe the electrical connection relationship of the second grid node in the second topology substructure; the AC power flow equation is a set of nonlinear equations used to describe the relationship between voltage, current, and power in the grid, and is used for power flow calculation; the second voltage sensitivity matrix is ​​a matrix used to reflect the sensitivity of the node voltage to injected power or parameter changes. In other words, a virtual impedance factor is introduced into the second-node admittance matrix, the admittance matrix is ​​modified, and the impact of additional impedance or control strategy is simulated. The voltage sensitivity matrix is ​​calculated using the AC power flow equation to obtain the sensitivity of the voltage to injected power or parameter changes, thereby determining the voltage-sensitive nodes in the second grid node, and taking effective measures for the voltage-sensitive nodes in the second grid node to ensure the stable operation of the grid.

[0077] By differentiating energy storage access situations, introducing virtual impedance factors, and combining DC and AC power flow equations, a voltage sensitivity matrix is ​​constructed. This can effectively improve analysis accuracy, enhance model flexibility, support optimized decision-making, enhance computational efficiency, and adapt to complex power grids, providing a powerful tool for the planning, operation, and control of modern power systems.

[0078] In one implementation of this embodiment, a virtual impedance factor is introduced into the second node admittance matrix, and the second voltage sensitivity matrix is ​​calculated using the AC power flow equation, including: S610: Using a preset connection method, modify the second node admittance matrix by a virtual impedance factor to obtain a target node admittance matrix; S620, using the target node admittance matrix to correct the AC power flow equation to obtain a corrected AC power flow equation; S630, performing Taylor expansion on the corrected AC power flow equation at the reference operating point to obtain a corrected DC power flow equation; S640, calculating the inverse matrix of the target node admittance matrix using the target node admittance matrix to obtain a corrected second inverse matrix; S650: Multiply the coefficient matrix in the modified DC power flow equation by the corrected second inverse matrix to obtain a second voltage sensitivity matrix.

[0079] Using a preset connection method, the second node admittance matrix is ​​modified by a virtual impedance factor to obtain the target node admittance matrix. The preset connection method can be determined according to the actual situation. The preset connection method refers to the electrical connection rules between nodes in the power grid, including line parameters (such as resistance, reactance) and topology. The virtual impedance factor is an additional impedance value used to simulate additional losses, control strategy effects, or uncertainty factors in the power grid. It can be expressed in the form of a complex impedance: Z virtual =R virtual +X virtual Among them, R virtual is the virtual resistance, X virtual is the virtual reactance, Z virtual Represents the virtual impedance factor.

[0080] To correct the self-admittance and mutual admittance, first, the self-admittance Y of each node is ii (2) , minus the inverse of the virtual impedance, as follows:

[0081] in, represents the corrected self-admittance, Yii (2) represents the node's self-admittance, Z virtual Represents the virtual impedance factor.

[0082] Secondly, the mutual admittance is corrected, and the mutual admittance Y of each pair of nodes is ij (2) , adjust the virtual impedance distribution method (e.g., uniform distribution or proportional distribution) according to the connection method, as shown below:

[0083] in, represents the corrected mutual admittance, Y ij (2) is the mutual admittance of the nodes, It is expressed as the change in mutual admittance caused by virtual impedance.

[0084] By correcting the self-admittance and mutual-admittance, the corrected target node admittance matrix is ​​obtained.

[0085] Next, the AC power flow equation is modified using the target node admittance matrix to obtain the modified AC power flow equation. The AC power flow equation is the basic equation that describes the steady-state operation of the power grid. It solves the voltage amplitude and phase angle of each node based on the node admittance matrix. When the grid structure or parameters change (such as by introducing a virtual impedance factor to modify the node admittance matrix), the AC power flow equation needs to be modified accordingly to ensure the accuracy and adaptability of the calculation. The AC power flow equation includes the active power equation and the reactive power equation. The polar coordinate form of the AC power flow equation is as follows: Active power equation:

[0086] Reactive power equation:

[0087] in, and are the voltage amplitudes at nodes i and j, respectively, is the voltage phase angle difference between nodes i and j, and are the mutual conductance and mutual susceptance between nodes i and j, respectively.

[0088] Substitute the target node admittance matrix into the AC power flow equation, replace the original admittance matrix, and obtain the revised equation. Modify the polar coordinate form and replace G in the original equation. ij and B ij Replace with Y ij The real and imaginary parts of . The modified AC power flow equation is as follows: The corrected active power equation is:

[0089] The modified reactive power equation is:

[0090] in, and are the voltage amplitudes at nodes i and j, respectively, is the voltage phase angle difference between nodes i and j, Re(Y ij ) means taking Y ij The real part of Im(Y ij ) means taking Y ij The imaginary part of .

[0091] After obtaining the revised AC power flow equation, Taylor expansion is performed on the revised AC power flow equation at the reference operating point to obtain the revised DC power flow equation. In this embodiment, the selection of the reference operating point can be determined based on actual conditions. To derive the DC power flow equation from the AC power flow equation, Taylor expansion is typically performed on the AC power flow equation near a certain reference operating point (i.e., a known operating state of the system), ignoring higher-order terms. Specifically, the node voltage amplitude and phase angle of the power system during steady-state operation are selected as the reference operating point. The target node admittance matrix is ​​substituted into the AC power flow equation, replacing the original admittance matrix, to obtain the revised AC power flow equation. Taylor expansion is performed on the voltage phase angle in the revised AC power flow equation, ignoring higher-order terms. The expanded equation is then reorganized to obtain the revised DC power flow equation.

[0092] Subsequently, the target node admittance matrix is ​​used to calculate the inverse matrix of the target node admittance matrix to obtain the corrected second inverse matrix. In this embodiment, the target node admittance matrix refers to the matrix obtained by correcting the second node admittance matrix using the virtual impedance factor. The inverse matrix of the target node admittance matrix can be calculated using mathematical methods (such as Gaussian elimination method, LU decomposition, etc.) to obtain the corrected second inverse matrix. In this embodiment, the corrected second inverse matrix refers to the inverse matrix of the target node admittance matrix.

[0093] Finally, the coefficient matrix in the revised DC power flow equation is multiplied by the corrected second inverse matrix to obtain the second voltage sensitivity matrix. The corrected second inverse matrix is ​​the matrix obtained by correcting the target node admittance matrix and then calculating its inverse matrix. The inverse matrix of the target node admittance matrix is ​​called the node impedance matrix, which describes the electrical distance between nodes in the power system. The correction process may involve some correction or adjustment of the target node admittance matrix to reflect the changes in the electrical connection relationship between nodes in the power system. The general form of the revised DC power flow equation is: P=V 2 Bθ Where P is the active power vector, which represents the active power injection of each node in the power system; V is the voltage amplitude, assuming that the voltage amplitude of all nodes is equal and constant; B is the susceptance matrix, which is composed of the imaginary part of the node admittance matrix and describes the susceptance relationship between nodes in the power system; θ is the voltage phase angle vector, which represents the voltage phase angle of each node in the power system. In the modified DC power flow equation, the coefficient matrix describes the relationship between active power and voltage phase angle. For the equation P=V 2 Bθ, the coefficient matrix is ​​formed by substituting multiple different power parameter data into V 2 In B, the matrix is ​​calculated. Then, the coefficient matrix V in the modified DC power flow equation is 2 B is multiplied by the corrected second inverse matrix to obtain a second voltage sensitivity matrix.

[0094] By introducing the virtual impedance factor, the node admittance matrix is ​​corrected, and the DC power flow equation and sensitivity matrix are calculated using the corrected admittance matrix, which can more accurately reflect the electrical characteristics and operating conditions of the system, help identify the key nodes and weak links in the power system, and provide a more scientific basis for the operation and control strategies of the power system.

[0095] In one implementation of this embodiment, a preset power distribution logic is executed in combination with the voltage sensitivity matrix and the power forecast data to determine a power distribution plan for the power grid, including: S710, determining voltage sensitive nodes in the topology of the power grid using a voltage sensitivity matrix; S720: For any voltage-sensitive node, determine whether the power fluctuation range of the voltage-sensitive node exceeds a preset power fluctuation range based on the power prediction data, the first power data, and the second power data; S730: Execute a preset power distribution logic for voltage-sensitive nodes that exceed a preset power fluctuation range to determine a power distribution plan for the power grid.

[0096] The voltage sensitivity matrix is ​​used to identify voltage-sensitive nodes in the power grid topology. In a power system, the voltage sensitivity matrix reflects the degree to which changes in node active power affect node voltage. The voltage sensitivity matrix can be used to identify nodes in the power grid topology that are most sensitive to voltage changes, known as voltage-sensitive nodes. Voltage-sensitive nodes experience large voltage fluctuations when power changes, potentially impacting system stability and power quality. An appropriate sensitivity threshold is set based on the actual power system conditions and analysis requirements. All nodes are ranked according to their voltage sensitivity index. When a grid node's voltage sensitivity exceeds this threshold, it is considered a voltage-sensitive node. Nodes with higher sensitivity indexes are selected as voltage-sensitive nodes. Voltage-sensitive nodes are nodes that experience large voltage fluctuations when power changes.

[0097] Next, for any voltage-sensitive node, based on the power forecast data, the first power data, and the second power data, a determination is made as to whether the power fluctuation range of the voltage-sensitive node exceeds a preset power fluctuation range. The power forecast data and the first power data can be used to calculate the power fluctuation range of the voltage-sensitive node over a future period of time. The fluctuation range can be measured using indicators such as the difference between the maximum and minimum values, the standard deviation, and the fluctuation rate. Assume that the power forecast data indicates that the power forecast value of a voltage-sensitive node for the next 24 hours is Ppredicted = [P1, P2, …, P24], where Ppredicted = [P1, P2, …, P24]; and the first power data indicates that the power of the node in real-time operation is Prealtime = [Prealtime1, Prealtime2, …, Prealtimet]. The fluctuation range is calculated by subtracting Prealtime from Ppredicted to obtain the power fluctuation range, and then a determination is made as to whether the power fluctuation range exceeds the power fluctuation range.

[0098] For voltage-sensitive nodes that exceed a preset power fluctuation range, a preset power allocation logic is executed to determine the power distribution plan for the power grid. In this embodiment, the preset power allocation logic can be customized based on actual conditions. Specifically, voltage-sensitive nodes in the power grid are identified using a voltage sensitivity matrix, and power fluctuations at these nodes are monitored to determine whether they exceed the preset power fluctuation range. Subsequently, the reasons for exceeding the preset power fluctuation range are analyzed, such as sudden load changes, generator output adjustments, and line faults, to determine the specific factors that caused the power fluctuations to exceed the preset power fluctuation range. Based on the specific factors causing the voltage-sensitive nodes to exceed the preset power fluctuation range, the preset power allocation logic is executed. For example, the preset power allocation logic can be a typical allocation logic that prioritizes power supply to critical loads based on load importance or prioritizes dispatching lower-cost generators based on power generation costs. In other words, based on the preset logic, the appropriate allocation strategy is determined to adjust generator output, increasing or decreasing generated power.

[0099] The voltage sensitivity matrix accurately identifies voltage-sensitive nodes in the power grid topology, allowing early identification and attention to these nodes, helping to take targeted measures to prevent voltage collapse or instability. Based on power forecast data, first power data, and second power data, it determines in real time whether the power fluctuation range of voltage-sensitive nodes exceeds a preset range. If it is found to be out of range, the preset power distribution logic is immediately executed to adjust the power distribution of the power grid to ensure that the voltage and frequency remain stable within the allowable range. Optimized power distribution based on forecast data can more accurately determine the current power grid status and make more reasonable distribution decisions, significantly improving the stability of the power grid, optimizing power distribution, enhancing the adaptability of the power grid, improving economic benefits, and ensuring the power supply of critical loads.

[0100] In one implementation of this embodiment, the method further includes: S810. Add a non-standard state detection layer to the LSTM processing layer of the power data prediction model. S820. Introduce a channel attention module into the LSTM processing layer of the power data prediction model, assign an adaptive weight to each node in the LSTM processing layer, and determine an attention coefficient. S830: normalize the attention coefficient and calculate the weighted aggregated time feature using a preset weighting formula; S840, extracting non-standard state data of the first historical power data and the second historical power data in a significantly non-standard state using a non-standard state detection layer; S850: Select a preset training strategy based on the weighted aggregated time characteristics and the non-standard state data, and train the power data prediction model to obtain a significant non-standard state prediction model; S860: Input the first power data and the second power data into a significant non-standard state prediction model, and output significant non-standard state prediction data; S870. Optimize the power distribution plan using the significant non-standard state prediction data to determine an optimized power distribution plan.

[0101] An abnormal state detection layer is added to the LSTM processing layer of the power data prediction model. LSTM (Long Short-Term Memory) is a commonly used deep learning model for processing time series data such as power load and power generation. However, power data often contains outliers or abnormal states (such as sudden load changes caused by equipment failures or emergencies), which can interfere with the model's predictive performance. Therefore, the addition of an abnormal state detection layer to the LSTM processing layer aims to identify and process these abnormal data in real time, improving the model's robustness and prediction accuracy. Abnormal states can be defined using statistical methods. Statistics such as the mean and variance of the input data are calculated, and thresholds are set to determine whether they are abnormal. For example, if the load data at a certain moment exceeds three standard deviations of the historical mean, it is considered abnormal. The abnormal state detection layer and the LSTM processing layer can be connected in a series structure. The input data is first processed by the LSTM layer to extract features before being input to the abnormal state detection layer. The detection layer determines whether there is an anomaly based on the LSTM output.

[0102] Next, a channel attention module is introduced into the LSTM processing layer of the power data prediction model. Each node in the LSTM processing layer is assigned an adaptive weight to determine the attention coefficient. The attention coefficient represents the contribution of each time step to the final output. The channel attention module is an attention mechanism used in convolutional neural networks, but it can also be integrated into LSTMs. Its core concept is to assign different attention weights to different channels (or features). Assigning adaptive weights to each node in the LSTM processing layer means that the model can dynamically adjust the influence of its neighboring nodes on the prediction results based on the current node's context. The channel attention module can be used to aggregate global information, calculate the importance weight of each feature (channel), and assign adaptive weights to each node based on the importance weights, thereby calculating the attention coefficient.

[0103] The attention coefficient is normalized, and a preset weighting formula is used to calculate the weighted aggregated time features. First, the attention coefficient is normalized, and software such as Softmax can be used. Second, based on the attention coefficient, the features of different time steps are weighted and summed to obtain the aggregated context vector, highlighting the information of the key time steps. The attention coefficient can be used to perform a weighted summation on the hidden state of the LSTM. The preset weighting formula can be determined according to the actual situation. In this embodiment, the preset weighting formula can be a linear weighted summation. That is, based on the normalization coefficient, the time step features are weighted and summed to obtain the weighted aggregated time features.

[0104] The non-standard state detection layer is used to extract non-standard state data when the first and second historical power data are in significant non-standard states. The non-standard state detection layer is used to identify and extract significant non-standard state features in the data. In other words, the non-standard state detection layer extracts historical data when the first and second historical power data are in significant non-standard states, such as power data from equipment failures, load anomalies caused by extreme weather, and so on.

[0105] After obtaining the weighted aggregated time features, a preset training strategy is selected based on the weighted aggregated time features and non-standard state data, and the power data prediction model is trained to obtain a significant non-standard state prediction model. In this embodiment, non-standard state data refers to data that deviates from normal operating conditions in the power system, such as equipment failures, load anomalies caused by extreme weather, etc. This can be achieved through an attention mechanism, which weights and sums the features of different time steps to obtain a context vector, highlighting the information of key time steps. For example, in power load forecasting, the model may pay more attention to the time points of load peaks or abnormal fluctuations. To effectively train the significant non-standard state prediction model, it is necessary to combine the characteristics of the weighted aggregated time features and non-standard state data and select an appropriate training strategy to train the initial prediction model. In this embodiment, the appropriate training strategy can be determined based on the actual situation. The initial prediction model can be a neural network model. The neural network model is trained using the weighted aggregated time features and non-standard state data to obtain a significant non-standard state prediction model.

[0106] Subsequently, the first and second power data are fed into a significantly non-standard state prediction model, which outputs significantly non-standard state prediction data. The "significantly non-standard state prediction model" aims to identify and predict states in the power data that significantly deviate from normal patterns (such as equipment failures, load anomalies, extreme events, etc.). By feeding the first and second power data into the model, a prediction result for significantly non-standard states can be output. In other words, by feeding the first and second power data into the trained model, the significantly non-standard state prediction model will output significantly non-standard state prediction data.

[0107] The power distribution plan is optimized using significant non-standard condition prediction data to determine the optimized power distribution plan. Specifically, the significant non-standard condition prediction data can be used to determine the load forecast for the power system in the future time period. For example, if a generator set experiences equipment aging or failure due to long-term use, resulting in abnormal load, the significant non-standard condition prediction data can be used to predict which generator sets will experience abnormal loads in the future time period. If the load of generator sets in a certain area is predicted to increase by more than 20% during peak hours, the power supply to that area can be increased in advance or backup generators can be activated. For example, if a load surge is predicted for an industrial park, power from surrounding power plants can be dispatched in advance to increase the main grid supply. Backup generators can also be activated in areas with abnormal loads to share the main grid pressure. For example, if a hospital experiences abnormal load due to equipment failure, the hospital's backup generators can be immediately activated to ensure power supply to critical loads. Power supply continuity is ensured by shifting the load in the faulty area to other power supply units. In the power system, significant non-standard conditions (such as equipment aging and failure) can cause abnormal loads, thereby affecting power supply reliability. Based on these predicted non-standard conditions, the power distribution plan can be adjusted in advance to ensure stable system operation.

[0108] By introducing a non-standard state detection layer and a channel attention module into the power data prediction model and performing a series of processing, the accuracy of load forecasting can be significantly improved, the model's ability to process complex data can be enhanced, the optimization effect of the power distribution plan can be improved, the training efficiency and performance of the model can be improved, the robustness and reliability of the system can be enhanced, decision-making and emergency management can be supported, and the safe and stable operation of the power system can be guaranteed, power supply reliability can be improved, and economic losses can be reduced, which has significant social and economic benefits.

[0109] The present application provides a machine-readable storage medium having instructions stored thereon, the instructions being used to enable a machine to execute the above-mentioned energy management method for a smart grid.

[0110] The present application provides an electronic device, including: a memory configured to store instructions; and The processor is configured to call instructions from the memory and implement the above-mentioned energy management method for the smart grid when executing the instructions.

[0111] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Thus, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

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

[0113] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

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

[0115] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0116] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0117] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can be implemented using any method or technology for information storage. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change RAM (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.

[0118] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0119] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included within the scope of the claims of the present application.

Claims

1. An energy management method for a smart grid, characterized in that: A power grid management system for regulating a power grid, wherein the power grid is connected to an energy storage device, comprises the following steps: Obtain historical power data of energy storage devices inserted into the power grid; Extract the time series features of historical power data to obtain a comprehensive feature matrix, and build a power data prediction model based on the comprehensive feature matrix; Real-time acquisition of temperature characteristic data of the power grid and real-time power data of energy storage devices inserted into the power grid; Inputting real-time power data into the power data prediction model, and outputting power prediction data through the power data prediction model; Determine the virtual impedance factor of the power grid based on temperature characteristic data and using a dynamic Bayesian network algorithm; The node admittance matrix is ​​constructed by combining real-time power data and the set of grid nodes in the grid topology. A virtual impedance factor is introduced into the node admittance matrix and a voltage sensitivity matrix is ​​constructed using a preset power flow equation. Combined with the voltage sensitivity matrix and power forecast data, the preset power distribution logic is executed to determine the power distribution plan of the power grid.

2. The method according to claim 1, characterized in that The historical power data includes first historical power data before the energy storage device is connected and second historical power data after the energy storage device is connected. Time series features of the historical power data are extracted to obtain a comprehensive feature matrix. A power data prediction model is constructed based on the comprehensive feature matrix, including: Extracting time series features of the first historical power data and the second historical power data under a standard state to obtain a first reference sequence and a second reference sequence; The first reference sequence and the second reference sequence are cross-modally aligned using a preset dynamic coupling model to obtain a comprehensive feature matrix; Combine historical power data and comprehensive feature matrix to train the preset long short-term memory network prediction model to obtain the power data prediction model; Among them, the long short-term memory network prediction model includes an input layer, an LSTM processing layer and an output layer. The input layer is used to receive historical power data and a comprehensive feature matrix. The LSTM processing layer is used to determine the time series dependency and dynamic characteristics of the data in the comprehensive feature matrix. The output layer is used to output power prediction data.

3. The method according to claim 2, characterized in that Extracting time series features of the first historical power data and the second historical power data under a standard state to obtain the first reference sequence and the second reference sequence includes: Extracting grid parameter sequence data of the first historical power data under each standard operating condition, wherein each grid parameter sequence data includes a timestamp and corresponding grid parameter data; The dynamic time warping algorithm is used to calculate the similarity of any two power grid parameter sequence data; Traversing each grid parameter sequence data, and taking the grid parameter sequence data with a similarity greater than a preset similarity threshold as a first reference sequence; Performing empirical mode decomposition on the second historical power data to extract multiple intrinsic mode functions; Among multiple intrinsic mode functions, the first three order intrinsic mode functions are selected for reconstruction to obtain the typical output curve of the power grid connected to the energy storage device in history; A second reference sequence is generated according to a typical output curve of the power grid and a charge-discharge balance mode corresponding to the energy storage device.

4. The method according to claim 1, wherein The temperature characteristic data includes ambient temperature data and impedance parameters corresponding to the ambient temperature data. The virtual impedance factor of the power grid determined based on the temperature characteristic data and using the dynamic Bayesian network algorithm includes: Combining ambient temperature data and impedance parameters and using dynamic Bayesian network algorithm to build a dynamic network topology model; Inputting the ambient temperature data into the dynamic network topology model, and determining the corrected line impedance parameters through the dynamic network topology model; The virtual impedance factor of the power grid is calculated using the modified line impedance parameters and the preset compensation term calculation formula.

5. The method according to claim 1, wherein The preset power flow equations include a DC power flow equation and an AC power flow equation. The real-time power data includes first power data before the energy storage device is connected and second power data after the energy storage device is connected. The node admittance matrix is ​​constructed by combining the real-time power data and the set of grid nodes in the grid topology. A virtual impedance factor is introduced into the node admittance matrix and a voltage sensitivity matrix is ​​constructed using the preset power flow equations. The following steps are included: Dividing the topology of the power grid into a first topology substructure without access to the energy storage device and a second topology substructure with access to the energy storage device according to the involvement of the energy storage device; Creating an initialization admittance matrix according to a first grid node of a first topology substructure; Traversing each first power grid node, and calculating the self-admittance of each first power grid node according to the admittance data in the first power data; Traversing each first power grid node, and calculating the mutual admittance of each first power grid node respectively according to the admittance data in the first power data; Filling the self-admittance and mutual-admittance of each first grid node into the initialization admittance matrix in node order to obtain a first node admittance matrix; Solve the first inverse matrix of the first node admittance matrix using a matrix inversion algorithm; Calculate a first voltage sensitivity matrix using a first inverse matrix and a DC power flow equation; Based on the second grid node in the second topology substructure, a second node admittance matrix is ​​constructed in combination with the initialized admittance matrix and the admittance data in the second power data; A virtual impedance factor is introduced into the second node admittance matrix, and the second voltage sensitivity matrix is ​​calculated using the AC power flow equation.

6. The method according to claim 5, characterized in that A virtual impedance factor is introduced into the second node admittance matrix, and the second voltage sensitivity matrix is ​​calculated using the AC power flow equation, including: Using the preset connection method, the second node admittance matrix is ​​corrected by the virtual impedance factor to obtain the target node admittance matrix; The AC power flow equation is corrected using the target node admittance matrix to obtain the corrected AC power flow equation; At the reference operating point, the modified AC power flow equation is Taylor expanded to obtain the modified DC power flow equation; Calculating the inverse matrix of the target node admittance matrix using the target node admittance matrix to obtain a corrected second inverse matrix; The coefficient matrix in the modified DC power flow equation is multiplied by the corrected second inverse matrix to obtain a second voltage sensitivity matrix.

7. The method according to claim 1, characterized in that Combine the voltage sensitivity matrix and power forecast data to execute the preset power distribution logic and determine the power distribution plan for the power grid, including: Determine the voltage sensitive nodes in the topology of the power grid through the voltage sensitivity matrix; For any voltage-sensitive node, judging whether the power fluctuation range of the voltage-sensitive node exceeds a preset power fluctuation range based on the power prediction data, the first power data, and the second power data; The preset power distribution logic is executed for voltage-sensitive nodes that exceed the preset power fluctuation range to determine the power distribution plan of the power grid.

8. The method according to claim 2, characterized in that The method further includes: A non-standard state detection layer is added to the LSTM processing layer of the power data prediction model; A channel attention module is introduced into the LSTM processing layer of the power data prediction model, and adaptive weights are assigned to each node in the LSTM processing layer to determine the attention coefficient. Normalize the attention coefficient and use the preset weighting formula to calculate the weighted aggregated time feature; Extracting non-standard state data of the first historical power data and the second historical power data in a significantly non-standard state using a non-standard state detection layer; According to the weighted aggregated time characteristics and non-standard state data, a preset training strategy is selected and the power data prediction model is trained to obtain a significant non-standard state prediction model; Inputting the first power data and the second power data into a significant non-standard state prediction model, and outputting significant non-standard state prediction data; The power distribution plan is optimized through the significant non-standard state prediction data to determine the optimized power distribution plan.

9. A machine-readable storage medium, characterized in that The machine-readable storage medium stores instructions, which are used to enable a machine to execute the energy management method for a smart grid according to any one of claims 1 to 8.

10. An electronic device, characterized in that: include: a memory configured to store instructions; as well as A processor is configured to call the instructions from the memory and implement the energy management method for a smart grid according to any one of claims 1 to 8 when executing the instructions.