Micro-grid operation safety assessment method, device and computer equipment

By combining Gaussian Copula and digital twin models, the problem of the difficulty in reflecting dynamic characteristics in the safety assessment of microgrid operation is solved, and the reliability and accuracy of microgrid under different operating conditions are assessed.

CN122264530APending Publication Date: 2026-06-23CEEC JIANGSU ELECTRIC POWER DESIGN INST CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CEEC JIANGSU ELECTRIC POWER DESIGN INST CO LTD
Filing Date
2026-03-18
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing microgrid operation safety assessment methods are mostly based on static analysis or single-condition analysis, which makes it difficult to fully reflect the dynamic operation characteristics of microgrids under different operating conditions, thus reducing the reliability of safety assessment results.

Method used

The joint prior distribution of the microgrid scenario variable set is determined by Gaussian Copula, risk prediction is performed using a pre-trained risk predictor, a high-risk scenario set is generated, and a digital twin model is used to simulate the high-risk scenario to determine the system risk entropy and generate a safety assessment report.

Benefits of technology

It improves the reliability and accuracy of microgrid operation safety assessment results, can quantify risk levels under different operating conditions, and achieve a comprehensive assessment of microgrid safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122264530A_ABST
    Figure CN122264530A_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, and computer equipment for assessing the operational safety of a microgrid. The method includes: determining the joint prior distribution of the scenario variable set corresponding to the microgrid using Gaussian Copula, and determining the risk index corresponding to each operational scenario based on a pre-trained risk predictor; constructing a sampling probability density function based on the joint prior distribution and the risk index corresponding to each operational scenario, and generating a set of high-risk scenarios for the microgrid based on the sampling probability density function; simulating each high-risk scenario in the high-risk scenario set using a digital twin model of the microgrid to obtain test data sets for each high-risk scenario; determining the system risk entropy corresponding to each high-risk scenario based on the test data sets for each high-risk scenario, and determining the corresponding safety assessment report for the microgrid based on the system risk entropy corresponding to each high-risk scenario. This method can improve the reliability of the microgrid operational safety assessment results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of microgrid technology, and in particular to a method, apparatus and computer equipment for assessing the operational safety of a microgrid. Background Technology

[0002] In recent years, with the rapid development of renewable energy technologies and the popularization of the Industrial Internet, industrial microgrids have been widely used in the fields of energy production, distribution and consumption. By integrating distributed generation, energy storage units and advanced power electronic equipment, they have achieved high-efficiency and low-carbon energy management. In order to ensure the efficient and stable operation of microgrids, the safety assessment technology of microgrids has received increasing attention.

[0003] Existing microgrid operation safety assessment methods are mostly based on static analysis or single-condition analysis. They usually rely on human experience to set fixed operating scenarios and make fixed threshold judgments on key operating data to complete the safety assessment. This makes it difficult to fully reflect the dynamic operating characteristics of microgrids under different operating conditions and reduces the reliability of microgrid safety assessment results. Summary of the Invention

[0004] Therefore, it is necessary to provide a microgrid operation safety assessment method, apparatus, and computer equipment that can improve the reliability of microgrid operation safety assessment results in response to the above-mentioned technical problems.

[0005] Firstly, this application provides a method for assessing the operational safety of microgrids, including:

[0006] The joint prior distribution of the scenario variable set corresponding to the microgrid is determined by Gaussian Copula, and risk prediction is performed on multiple operating scenarios based on a pre-trained risk predictor to obtain the risk index corresponding to each operating scenario; each operating scenario consists of specific values ​​corresponding to a set of scenario variables.

[0007] Based on the joint prior distribution and the risk index corresponding to each operating scenario, a sampling probability density function is constructed, and a set of high-risk scenarios for the microgrid is generated based on the sampling probability density function.

[0008] A pre-built digital twin model of the microgrid is used to simulate various high-risk scenarios in the high-risk scenario set, and test data sets for each high-risk scenario are obtained; the digital twin model is generated based on the pre-collected real-time operation data of the microgrid.

[0009] Based on the test data sets of each high-risk scenario, the system risk entropy corresponding to each high-risk scenario is determined, and the corresponding safety assessment report for the microgrid is determined based on the system risk entropy corresponding to each high-risk scenario.

[0010] In one embodiment, the joint prior distribution of the scenario variable set corresponding to the microgrid is determined using Gaussian Copula, including:

[0011] Determine the set of scene variables The continuous and discrete variables in the model correspond to the empirical marginal distribution and probability distribution, respectively; the scenario variable set includes photovoltaic output disturbance, total load disturbance, battery state of charge, unique thermal coding of fault location, and other variables in the microgrid. Fault status and ambient temperature;

[0012] Based on scenario variable set The rank correlation coefficients between variables in each scenario are used to determine the elements of the correlation matrix between variables in each scenario, and the correlation matrix is ​​obtained based on the elements of the correlation matrix between variables in each scenario. The formula for calculating the rank correlation coefficient is: , Represents the set of scene variables The first in The first scenario variable and the first Rank correlation coefficients among scenario variables The process of calculating the Pearson correlation coefficient, which includes ranking and rank calculation, is described below. and They represent the first The first scenario variable and the first There are several scene variables; the formula for calculating the elements of the correlation matrix is ​​as follows: , Represents the set of scene variables The first in The first scenario variable and the first Correlation matrix elements between scene variables;

[0013] According to the relevant matrix Define the prior Gaussian Copula as The scene variable set is determined based on the prior Gaussian Copula. The corresponding joint prior distribution is ,in, This represents the prior Gaussian Copula density function value. Indicates the first The cumulative distribution function value of each scene variable under a uniform distribution. Represents the set of scene variables The total number of scene variables in the middle. This represents the inverse mapping of the standard normal distribution of the scene variables. Represents the set of scene variables The Middle The empirical marginal distribution or probability distribution corresponding to each scenario variable.

[0014] In one embodiment, the scene variable set is determined. The empirical marginal distributions and probability distributions corresponding to the continuous and discrete variables in the data include:

[0015] Using historical data from microgrids as samples, the kernel density estimation method was employed to calculate the scenario variable set. The empirical marginal distribution of continuous variables in the model is: ,in, Represents the set of scene variables The first in A continuous variable, Indicates the first Empirical marginal distribution of a continuous variable This indicates the total number of samples. Indicates the kernel width. Represents the standard Gaussian kernel function. Indicates the first The nth continuous variable Sample;

[0016] For the scene variable set The discrete variables in the model are processed using empirical frequency methods to obtain the probability distribution of the discrete variables. , Represents the set of scene variables The Middle A discrete variable, Indicates the first The probability distribution of discrete variables. Indicates the first The discrete variable appears in all running scenarios. Number of times for each type.

[0017] In one embodiment, a sampling probability density function is constructed based on the joint prior distribution and the risk index corresponding to each operating scenario, including:

[0018] Risk indices based on multiple operational scenarios and scene variable set Corresponding joint prior distribution The sampling probability density function is constructed as follows: ,in, The expected value of the risk index representing multiple operating scenarios is calculated using the following formula: , The total number of running scenarios, For the first Risk index for each operational scenario;

[0019] Based on the sampling probability density function, multiple operating scenarios are sampled to obtain the high-risk scenario set of the microgrid. , For the first A high-risk scenario, This indicates the total number of high-risk scenarios.

[0020] In one embodiment, based on the test data sets of each high-risk scenario, the system risk entropy corresponding to each high-risk scenario is determined, including:

[0021] Based on test data sets from various high-risk scenarios, the safety parameters of the microgrid are determined. These safety parameters include node voltage amplitude, voltage deviation, current, microgrid system frequency, frequency fluctuation, active power, reactive power, and state of charge of energy storage devices.

[0022] Based on the preset safety standards, determine the time limit for each safety parameter to exceed the limit during the simulation process of each high-risk scenario;

[0023] For each high-risk scenario, based on the time each safety parameter exceeds its limit during the simulation process of that high-risk scenario and the total simulation time of that high-risk scenario, the system risk entropy corresponding to that high-risk scenario is determined as follows: ,in, This represents the total number of safety parameters. Indicates the first The time limit for exceeding a safety parameter during the simulation process in this high-risk scenario. This indicates the total simulation time for this high-risk scenario. Indicates the first Each security parameter has a severity weight.

[0024] In one embodiment, a safety assessment report for the microgrid is determined based on the system risk entropy corresponding to each high-risk scenario, including:

[0025] The total system risk entropy and the statistical results of system risk entropy are determined based on the system risk entropy corresponding to each high-risk scenario.

[0026] The contribution of each safety parameter to the total system risk entropy is determined, and key safety parameters are obtained based on the contribution of each safety parameter to the total system risk entropy; the formula for calculating the contribution of each safety parameter to the total system risk entropy is as follows: , For the first The contribution of each security parameter to the total risk entropy of the system. Indicates the first The security parameter is in the first The time limit exceeding the limit during the simulation process of a high-risk scenario. Indicates the first Total simulation time for each high-risk scenario Indicates the first System risk entropy in a high-risk scenario;

[0027] Based on key safety parameters, a profile of the weak links in the microgrid is generated, and a list of risk-contributing devices is obtained based on the profile of the weak links.

[0028] Based on the statistical results of system risk entropy, the profile of weak links, and the list of risk-contributing devices, a comprehensive assessment report of the microgrid is generated.

[0029] In one embodiment, the process of generating a digital twin model includes:

[0030] The real-time operation data of the microgrid is collected through the SCADA system and synchronous phasor measurement unit; the real-time operation data of the microgrid includes the real-time operation data of multiple components;

[0031] The real-time operation data of the microgrid is preprocessed based on the isolated forest anomaly detection algorithm and the data alignment algorithm to obtain the preprocessed real-time operation data;

[0032] Based on the physical parameters of the microgrid components, the corresponding differential-algebraic equation model of the microgrid is constructed as follows: ,in, For state variables, For algebraic variables, Indicates control input, Indicates time, Represents the function of a differential equation. The algebraic equation function is represented by the state variable, algebraic variable, and control input, which respectively represent the dynamic state, network constraints, and control commands of the microgrid.

[0033] The preprocessed real-time operating data is input into the differential algebraic equation model, and the parameters of the differential algebraic equation model are calibrated in real time using Kalman filtering to generate a digital twin model of the microgrid.

[0034] In one embodiment, the method further includes:

[0035] Based on the historical operation data of the microgrid, the scenario variable set is extracted to train the pre-acquired initial risk predictor, thus obtaining the training scenario variable set;

[0036] Input the training scenario variable set into the initial risk predictor to obtain the corresponding training prediction output;

[0037] Based on the training prediction output and the real risk labels corresponding to the training scenario variable set, the Adam optimization algorithm is used to iteratively update the parameters of the initial risk predictor to obtain the trained risk predictor.

[0038] Secondly, this application also provides a microgrid operation safety assessment device, comprising:

[0039] The determination module is used to determine the joint prior distribution of the scenario variable set corresponding to the microgrid through Gaussian Copula, and to perform risk prediction on multiple operating scenarios based on a pre-trained risk predictor to obtain the risk index corresponding to each operating scenario; each operating scenario consists of specific values ​​corresponding to a set of scenario variable sets.

[0040] The generation module is used to construct a sampling probability density function based on the joint prior distribution and the risk index corresponding to each operating scenario, and to generate a set of high-risk scenarios for the microgrid based on the sampling probability density function.

[0041] The simulation module is used to simulate various high-risk scenarios in the high-risk scenario set using a pre-built digital twin model of the microgrid, and obtain test data sets for each high-risk scenario; the digital twin model is generated based on the pre-collected real-time operating data of the microgrid.

[0042] The evaluation module is used to determine the system risk entropy corresponding to each high-risk scenario based on the test data sets of each high-risk scenario, and to determine the corresponding safety assessment report for the microgrid based on the system risk entropy corresponding to each high-risk scenario.

[0043] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0044] The joint prior distribution of the scenario variable set corresponding to the microgrid is determined by Gaussian Copula, and risk prediction is performed on multiple operating scenarios based on a pre-trained risk predictor to obtain the risk index corresponding to each operating scenario; each operating scenario consists of specific values ​​corresponding to a set of scenario variables.

[0045] Based on the joint prior distribution and the risk index corresponding to each operating scenario, a sampling probability density function is constructed, and a set of high-risk scenarios for the microgrid is generated based on the sampling probability density function.

[0046] A pre-built digital twin model of the microgrid is used to simulate various high-risk scenarios in the high-risk scenario set, and test data sets for each high-risk scenario are obtained; the digital twin model is generated based on the pre-collected real-time operation data of the microgrid.

[0047] Based on the test data sets of each high-risk scenario, the system risk entropy corresponding to each high-risk scenario is determined, and the corresponding safety assessment report for the microgrid is determined based on the system risk entropy corresponding to each high-risk scenario.

[0048] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0049] The joint prior distribution of the scenario variable set corresponding to the microgrid is determined by Gaussian Copula, and risk prediction is performed on multiple operating scenarios based on a pre-trained risk predictor to obtain the risk index corresponding to each operating scenario; each operating scenario consists of specific values ​​corresponding to a set of scenario variables.

[0050] Based on the joint prior distribution and the risk index corresponding to each operating scenario, a sampling probability density function is constructed, and a set of high-risk scenarios for the microgrid is generated based on the sampling probability density function.

[0051] A pre-built digital twin model of the microgrid is used to simulate various high-risk scenarios in the high-risk scenario set, and test data sets for each high-risk scenario are obtained; the digital twin model is generated based on the pre-collected real-time operation data of the microgrid.

[0052] Based on the test data sets of each high-risk scenario, the system risk entropy corresponding to each high-risk scenario is determined, and the corresponding safety assessment report for the microgrid is determined based on the system risk entropy corresponding to each high-risk scenario.

[0053] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0054] The joint prior distribution of the scenario variable set corresponding to the microgrid is determined by Gaussian Copula, and risk prediction is performed on multiple operating scenarios based on a pre-trained risk predictor to obtain the risk index corresponding to each operating scenario; each operating scenario consists of specific values ​​corresponding to a set of scenario variables.

[0055] Based on the joint prior distribution and the risk index corresponding to each operating scenario, a sampling probability density function is constructed, and a set of high-risk scenarios for the microgrid is generated based on the sampling probability density function.

[0056] A pre-built digital twin model of the microgrid is used to simulate various high-risk scenarios in the high-risk scenario set, and test data sets for each high-risk scenario are obtained; the digital twin model is generated based on the pre-collected real-time operation data of the microgrid.

[0057] Based on the test data sets of each high-risk scenario, the system risk entropy corresponding to each high-risk scenario is determined, and the corresponding safety assessment report for the microgrid is determined based on the system risk entropy corresponding to each high-risk scenario.

[0058] Compared with existing technologies, the beneficial effects achieved by this invention are as follows: The scenario variable set defined in this invention includes multiple scenario variables, and each operating scenario is composed of specific values ​​corresponding to a set of scenario variables, which can characterize multiple operating conditions of the microgrid; by determining the joint prior distribution of the scenario variable set corresponding to the microgrid through Gaussian Copula, the nonlinear dependency relationship between multiple scenario variables in the scenario variable set is captured; by using a pre-trained risk predictor, the potential risk index of each operating scenario is determined, which enables the sampled high-risk scenario set to be closer to the real operating state of the industrial microgrid, effectively avoiding the generation of unrealistic scenarios caused by independent assumptions in existing technologies, thereby improving the reliability and accuracy of the microgrid operation safety assessment results. By employing a pre-built digital twin model of the microgrid, simulations are performed on various high-risk scenarios, resulting in test data sets for each scenario. This allows for the generation of a test dataset for each high-risk scenario, providing ample data support for subsequent safety assessment reports and ensuring reliable testing and analysis of the microgrid under different operating conditions. Based on the test data sets for each high-risk scenario, the system risk entropy corresponding to each scenario is determined. The system risk entropy quantifies the risk level of the microgrid under different operating conditions, thereby enabling a comprehensive assessment of the microgrid's safety. Attached Figure Description

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

[0060] Figure 1 This is a flowchart illustrating a microgrid operation safety assessment method in one embodiment;

[0061] Figure 2 This is a schematic diagram of the process for obtaining a high-risk scenario set in one embodiment;

[0062] Figure 3 This is a structural block diagram of a microgrid operation safety assessment device in one embodiment. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0064] In one exemplary embodiment, such as Figure 1As shown, a method for assessing the operational safety of a microgrid is provided, which includes the following steps 102 to 108.

[0065] Step 102: Determine the joint prior distribution of the scenario variable set corresponding to the microgrid through Gaussian Copula, and perform risk prediction on multiple operating scenarios based on the pre-trained risk predictor to obtain the risk index corresponding to each operating scenario; each operating scenario consists of specific values ​​corresponding to a set of scenario variable sets.

[0066] Optionally, Gaussian Copula is used to describe the correlations between the scenario variables. The scenario variable set is used to characterize the operating conditions of the industrial microgrid, and the scenario variable set is... ,in, This represents the disturbance in photovoltaic output, defined as the change relative to the average photovoltaic output value. This represents the total load disturbance, defined as the change relative to the average total load. Indicates the state of charge of the battery. One-hot encoding indicating the location of the fault. This represents the N-1 fault state in a microgrid. The ambient temperature is represented; the operating scenario refers to the combination of operating states consisting of the specific values ​​of multiple scenario variables used to characterize the operating conditions of the industrial microgrid.

[0067] Step 104: Based on the joint prior distribution and the risk index corresponding to each operating scenario, construct the sampling probability density function, and generate a set of high-risk scenarios for the microgrid based on the sampling probability density function.

[0068] For example, based on the joint prior distribution of the scenario variable set and the risk index corresponding to each operating scenario, a risk-weighted algorithm is used to construct a sampling probability density function. This sampling probability density function is then used to perform importance sampling on multiple operating scenarios, resulting in a set of high-risk scenarios that conform to the prior distribution. This achieves intelligent focusing on the generation of high-risk scenarios and concentrates simulation resources on them, reducing invalid simulations compared to traditional methods. Consequently, it enables a comprehensive evaluation of microgrids under different operating conditions while significantly shortening the evaluation cycle.

[0069] Step 106: Using a pre-built digital twin model of the microgrid, simulations are performed on each high-risk scenario in the high-risk scenario set to obtain test data sets for each high-risk scenario; the digital twin model is generated based on the pre-collected real-time operation data of the microgrid.

[0070] Optionally, based on a pre-built digital twin model of the industrial microgrid, the digital twin model is initialized using the scenario variable set for each high-risk scenario; that is, the digital twin model is used to simulate each high-risk scenario. During the simulation of each high-risk scenario, the simulation time range and time step are set. Furthermore, in the computing cluster, the simulation task of each high-risk scenario can be treated as an independent task and allocated to different computing nodes, enabling multiple high-risk scenarios to be simulated in parallel.

[0071] During the simulation of various high-risk scenarios, the Runge-Kutta method was used to numerically solve the model dynamics, obtaining simulation data, which was then uploaded to the database. After completing the simulation of each high-risk scenario, test data sets for each high-risk scenario were obtained based on the simulation data.

[0072] In this embodiment, simulations of various high-risk scenarios are performed based on digital twin models. Each high-risk scenario simulation task is treated as an independent task and allocated to different computing nodes in the computing cluster. This significantly improves the simulation efficiency of the high-risk scenario set and solves the problems of long simulation time and high resource consumption in existing technologies. The simulation data from each high-risk scenario yields test data sets, providing sufficient data support for subsequent safety assessments and ensuring comprehensive testing and analysis of the microgrid under different operating conditions.

[0073] Step 108: Based on the test data sets of each high-risk scenario, determine the system risk entropy corresponding to each high-risk scenario, and determine the corresponding safety assessment report for the microgrid based on the system risk entropy corresponding to each high-risk scenario.

[0074] Based on test data sets from various high-risk scenarios, the safety parameters of the microgrid are determined, and the contribution of each safety parameter to the total system risk entropy is also determined. The total system risk entropy is determined by the system risk entropy corresponding to each high-risk scenario. Based on the contribution of each safety parameter to the total system risk entropy and the system risk entropy corresponding to each high-risk scenario, a safety assessment report for the microgrid is generated.

[0075] The scenario variable set defined in this invention includes multiple scenario variables. Each operating scenario is composed of specific values ​​corresponding to a set of scenario variables, which can characterize various operating conditions of the microgrid. By determining the joint prior distribution of the scenario variable set corresponding to the microgrid through Gaussian Copula, the nonlinear dependencies between multiple scenario variables in the scenario variable set are captured. Through a pre-trained risk predictor, the potential risk index of each operating scenario is determined, making the sampled high-risk scenario set closer to the actual operating state of the industrial microgrid. This effectively avoids the generation of unrealistic scenarios caused by independent assumptions in existing technologies, thereby improving the reliability and accuracy of the microgrid operation safety assessment results. Using a pre-constructed digital twin model of the microgrid, simulations are performed on each high-risk scenario in the high-risk scenario set, obtaining test data sets for each high-risk scenario. This generates a test dataset for each high-risk scenario, further providing sufficient data support for subsequent safety assessment reports and ensuring reliable testing and analysis of the microgrid under different operating conditions. Based on the test data sets of each high-risk scenario, the system risk entropy corresponding to each high-risk scenario is determined. The system risk entropy can quantify the risk level of the microgrid under different operating conditions, thereby achieving a comprehensive assessment of microgrid safety.

[0076] In an exemplary embodiment, the generation process of the digital twin model includes: collecting real-time operating data of the microgrid through the microgrid's SCADA system and synchronous phasor measurement unit; the real-time operating data of the microgrid includes real-time operating data of multiple components; preprocessing the real-time operating data of the microgrid based on the isolated forest anomaly detection algorithm and the data alignment algorithm to obtain preprocessed real-time operating data; and constructing a differential-algebraic equation model corresponding to the microgrid based on the physical parameters of the microgrid components. ,in, For state variables, For algebraic variables, Indicates control input, Indicates time, Represents the function of a differential equation. The algebraic equation function is represented by the state variables, algebraic variables, and control inputs, which represent the dynamic state, network constraints, and control commands of the microgrid, respectively. The preprocessed real-time operating data is input into the differential algebraic equation model, and the parameters of the differential algebraic equation model are calibrated in real time using Kalman filtering to generate a digital twin model of the microgrid.

[0077] The real-time operational data of multiple components of the industrial microgrid, including distributed generation (DG), energy storage batteries, industrial loads, and circuit networks, is collected through the SCADA system and synchronous phasor measurement unit. For example, real-time data for DG includes active and reactive power outputs from photovoltaic inverters and wind turbines, DC-side voltage, and internal controller status. Real-time data for energy storage batteries includes charging power, discharging power, terminal voltage, current, state of charge, temperature, and health status. Real-time data for industrial loads includes active power, reactive power, characteristic harmonic content, and start-stop transients. Real-time data for circuit networks includes voltage, frequency, branch power flow, and switch status at key nodes. Based on the isolated forest anomaly detection algorithm and data alignment algorithm, asynchronous and missing data in the real-time operational data of the microgrid are processed to obtain preprocessed real-time operational data.

[0078] In the simulation software, based on a pre-acquired electrical single-line diagram of the microgrid, the various components of the microgrid are connected, specifically, distributed power sources, energy storage batteries, industrial loads, and circuit network components. Then, based on the physical parameters of the microgrid components, a differential-algebraic equation model corresponding to the microgrid is constructed. ,in, For state variables, For algebraic variables, Indicates control input, Indicates time, Represents the function of a differential equation. The algebraic equation function is represented. Furthermore, Kalman filtering is used to input the preprocessed real-time operating data into the differential-algebraic equation model to calibrate the parameters of the model, generating a digital twin model of the microgrid.

[0079] In this embodiment, multi-source real-time operating data of the microgrid is collected through a SCADA system and a synchronous phasor measurement unit. The real-time operating data is preprocessed based on the isolated forest anomaly detection algorithm and the data alignment algorithm. Subsequently, a differential algebraic equation model is constructed in simulation software, and Kalman filtering is applied to calibrate the parameters of the differential algebraic equation model in real time, generating a high-fidelity digital twin model of the microgrid. This digital twin model can reflect the operating status of the microgrid in real time and accurately, providing a virtual environment highly consistent with the microgrid for the simulation of subsequent operating scenarios of the present invention, thereby ensuring the reliability and accuracy of the microgrid operation safety assessment.

[0080] In an exemplary embodiment, determining the joint prior distribution of the scenario variable set corresponding to the microgrid using Gaussian Copula includes: determining the scenario variable set. The continuous and discrete variables in the model correspond to the empirical marginal distribution and probability distribution, respectively; the scenario variable set includes photovoltaic output disturbance, total load disturbance, battery state of charge, unique thermal coding of fault location, and other variables in the microgrid. Fault status and ambient temperature; based on scenario variable set The rank correlation coefficients between variables in each scenario are used to determine the elements of the correlation matrix between variables in each scenario, and the correlation matrix is ​​obtained based on the elements of the correlation matrix between variables in each scenario. The formula for calculating the rank correlation coefficient is: , Represents the set of scene variables The first in The first scenario variable and the first Rank correlation coefficients among scenario variables The process of calculating the Pearson correlation coefficient, which includes ranking and rank calculation, is described below. and They represent the first The first scenario variable and the first There are several scene variables; the formula for calculating the elements of the correlation matrix is ​​as follows: , Represents the set of scene variables The first in The first scenario variable and the first The correlation matrix elements between the scene variables; based on the correlation matrix Define the prior Gaussian Copula as The scene variable set is determined based on the prior Gaussian Copula. The corresponding joint prior distribution is ,in, This represents the prior Gaussian Copula density function value. Indicates the first The cumulative distribution function value of each scene variable under a uniform distribution. Represents the set of scene variables The total number of scene variables in the middle. This represents the inverse mapping of the standard normal distribution of the scene variables. Represents the set of scene variables The Middle The empirical marginal distribution or probability distribution corresponding to each scenario variable.

[0081] Among them, the scene variable set is determined. The empirical marginal distributions and probability distributions corresponding to the continuous and discrete variables in the model are respectively included: using historical data of the microgrid as samples, and calculating the scenario variable set using the kernel density estimation method. The empirical marginal distribution of continuous variables in the model is: ,in, Represents the set of scene variables The first in A continuous variable, Indicates the first Empirical marginal distribution of a continuous variable This indicates the total number of samples. Indicates the kernel width. Represents the standard Gaussian kernel function. Indicates the first The nth continuous variable Sample; for the set of scene variables The discrete variables in the model are processed using empirical frequency methods to obtain the probability distribution of the discrete variables. , Represents the set of scene variables The Middle A discrete variable, Indicates the first The probability distribution of discrete variables. Indicates the first The discrete variable appears in all running scenarios. Number of times for each type.

[0082] For example, photovoltaic output disturbance, total load disturbance, battery state of charge, fault location, fault state, and ambient temperature are defined as scenario variables. , represented as ,in, This represents the disturbance in photovoltaic output, defined as the change relative to the average photovoltaic output value. This represents the total load disturbance, defined as the change relative to the average total load. Indicates the state of charge of the battery. One-hot encoding indicating the location of the fault. This represents the N-1 fault state in a microgrid. The ambient temperature is represented; the operating scenario refers to the combination of operating states consisting of the specific values ​​of multiple scenario variables used to characterize the operating conditions of the industrial microgrid.

[0083] Using historical data of the microgrid to be evaluated, or historical data of a microgrid of the same type as the microgrid to be evaluated, as samples, the scenario variable set was analyzed. The empirical marginal distribution of the continuous variables in the model is obtained by kernel density estimation:

[0084]

[0085] In the formula, Represents the set of scene variables The first in A continuous variable, Indicates the first Empirical marginal distribution of a continuous variable This indicates the total number of samples. This represents the core width, which is determined using the Silverman bandwidth selection rule. Represents the standard Gaussian kernel function. Indicates the first The nth continuous variable Sample.

[0086] For the scene variable set The discrete variables in the model are processed using empirical frequency methods to obtain the probability distribution of the discrete variables as follows:

[0087]

[0088] In the formula, Represents the set of scene variables The Middle A discrete variable, Indicates the first The probability distribution of discrete variables. Indicates the first The discrete variable appears in all running scenarios. Number of times for each type.

[0089] Calculate the scene variable set using the Gaussian Copula method. The rank correlation coefficients between the scene variables are calculated and mapped to Gaussian correlation to obtain the elements of the correlation matrix between the scene variables. The rank correlation coefficients between the scene variables refer to the Spearman rank correlation coefficients, which are calculated using the following formula: The formula for calculating the elements of the correlation matrix between variables in each scenario is as follows: ,in, Represents the set of scene variables The first in The first scenario variable and the first Spearman rank correlation coefficients among the scenario variables and They represent the first The first scenario variable and the first A scenario variable, Represents the set of scene variables The first in The first scenario variable and the first The correlation matrix elements between the scene variables.

[0090] in, The process of calculating the Pearson correlation coefficient, which includes ranking and rank calculation, is described below. The following can be expanded upon;

[0091] Sort and rank by: sorting the scene variables respectively and The N historical observations are sorted by numerical value to obtain their respective ranks, where the rank represents the sequence number of each value in its respective sample;

[0092] Calculate the Pearson correlation coefficient: Calculate the Pearson correlation coefficient between these two sets of ranks, which is also known as the Spearman rank correlation coefficient. The expression is:

[0093]

[0094] In the formula, Representing scene variables The i-th observation in the scene variable The rank of all corresponding observations, Representing scene variables The average of all ranks, Representing scene variables The i-th observation in the scene variable The rank of all corresponding observations, Representing scene variables The average of all ranks, where N represents the total number of observed samples.

[0095] Set of scene variables The empirical marginal and probability distributions corresponding to the continuous and discrete variables are transformed into uniform distributions, respectively. Based on the correlation matrix, the prior Gaussian Copula is defined as:

[0096]

[0097] In the formula, For the prior Gaussian Copula, This represents the prior Gaussian Copula density function value. The correlation matrix is ​​obtained based on the correlation matrix elements between variables in each scenario. Indicates the first The cumulative distribution function value of each scene variable under a uniform distribution. Represents the set of scene variables The total number of scene variables in the middle. This represents the inverse mapping of the standard normal distribution of the scene variables. Furthermore, the set of scene variables is determined based on the prior Gaussian Copula. The corresponding joint prior distribution is:

[0098]

[0099] In the formula, For the joint prior distribution corresponding to the set of scenario variables, Represents the set of scene variables The Middle The empirical marginal distribution or probability distribution corresponding to each scenario variable.

[0100] In this embodiment, the defined scenario variable set includes scenario variables such as photovoltaic output disturbance, load disturbance, battery state of charge, and fault location, which can characterize various operating conditions of the microgrid. By determining the joint prior distribution of the scenario variable set corresponding to the microgrid through Gaussian Copula, the nonlinear dependencies between multiple scenario variables in the scenario variable set (such as the correlation between photovoltaic output disturbance and load) are captured. This makes the high-risk scenario set generated by subsequent sampling closer to the real operating state of the industrial microgrid, thereby improving the reliability and accuracy of the microgrid operation safety assessment results.

[0101] In an exemplary embodiment, a sampling probability density function is constructed based on the joint prior distribution and the risk index corresponding to each operating scenario, including: based on the risk index corresponding to multiple operating scenarios. and scene variable set Corresponding joint prior distribution The sampling probability density function is constructed as follows: ,in, The expected value of the risk index representing multiple operating scenarios is calculated using the following formula: , The total number of running scenarios, For the first Risk indices for each operating scenario; based on the sampling probability density function, multiple operating scenarios are sampled to obtain a set of high-risk scenarios for the microgrid. , For the first A high-risk scenario, This indicates the total number of high-risk scenarios.

[0102] Specifically, based on the historical operation data of the microgrid, a set of scenario variables is extracted to train the pre-acquired initial risk predictor, resulting in a training scenario variable set. The training scenario variable set is then input into the initial risk predictor to obtain the corresponding training prediction output. Based on the training prediction output and the real risk labels corresponding to the training scenario variable set, the Adam optimization algorithm is used to iteratively update the parameters of the initial risk predictor, resulting in a trained risk predictor.

[0103] Optionally, a loss function is determined based on the training prediction output and the true risk labels corresponding to the training scenario variable set. The Adam optimization algorithm is then used to perform gradient descent optimization on the initial risk predictor to iteratively update its parameters, resulting in a trained risk predictor. Multiple operating scenarios are then input into the trained risk predictor to obtain risk indices corresponding to each scenario. .

[0104] Risk indices based on multiple operational scenarios and scene variable set Corresponding joint prior distribution The sampling probability density function is constructed as follows:

[0105]

[0106] in, The expected value of the risk index representing multiple operating scenarios is calculated using the following formula: , The total number of running scenarios, For the first Risk index for each operating scenario.

[0107] Importance sampling is performed on multiple operating scenarios based on the sampling probability density function to obtain a set of high-risk scenarios for the microgrid that conform to the prior distribution. It is represented as:

[0108]

[0109] In the formula, For the first A high-risk scenario, This represents the total number of high-risk scenarios. Optionally, a diagram illustrating the process of obtaining the high-risk scenario set is shown below. Figure 2 As shown.

[0110] In this embodiment, the risk index corresponding to each operating scenario is output based on the trained risk predictor, and based on the scenario variable set. The corresponding joint prior distribution and risk indices for multiple operational scenarios A sampling probability density function is constructed to generate a high-risk scenario set through importance sampling. Gaussian Copula is used to capture the nonlinear dependencies between scenario variables through a correlation matrix, while a risk predictor forecasts the risk index for each operating scenario. This allows the abstracted high-risk scenario set to more closely resemble the actual operating conditions of the microgrid, thereby improving the reliability and accuracy of microgrid safety assessment. Furthermore, the sampling probability density function, through risk weighting, can favor high-risk scenarios, thus concentrating simulation resources on high-risk scenarios and improving the efficiency of microgrid safety assessment.

[0111] In an exemplary embodiment, based on test data sets for each high-risk scenario, the system risk entropy corresponding to each high-risk scenario is determined, including: determining the safety parameters of the microgrid based on the test data sets for each high-risk scenario; the safety parameters include node voltage amplitude, voltage deviation, current, microgrid system frequency, frequency fluctuation, active power, reactive power, and state of charge of energy storage devices; determining the over-limit time of each safety parameter in the simulation process of each high-risk scenario according to preset safety standards; for each high-risk scenario, based on the over-limit time of each safety parameter in the simulation process of that high-risk scenario and the total simulation time of that high-risk scenario, determining the system risk entropy corresponding to that high-risk scenario. ,in, This represents the total number of safety parameters. Indicates the first The time limit for exceeding a safety parameter during the simulation process in this high-risk scenario. This indicates the total simulation time for this high-risk scenario. Indicates the first Each security parameter has a severity weight.

[0112] Optionally, based on the test data sets for each high-risk scenario, the safety parameters of the microgrid are determined. These safety parameters include node voltage amplitude, voltage deviation, current, microgrid system frequency, frequency fluctuation, active power, reactive power, and state of charge of energy storage devices. For each high-risk scenario, according to preset safety standards, the over-limit time of each safety parameter during the simulation process of that high-risk scenario is determined. Based on the over-limit time of each safety parameter during the simulation process of that high-risk scenario and the total simulation time of that high-risk scenario, the system risk entropy corresponding to that high-risk scenario is determined as follows:

[0113]

[0114] in, This represents the system risk entropy corresponding to this high-risk scenario. This represents the total number of safety parameters. Indicates the first The time limit for exceeding a safety parameter during the simulation process in this high-risk scenario. This indicates the total simulation time for this high-risk scenario. Indicates the first The severity weight of the first security parameter, the The severity weight of each security parameter is preset based on its impact on system security.

[0115] In the previous exemplary embodiment, the safety assessment report for the microgrid is determined based on the system risk entropy corresponding to each high-risk scenario, including: determining the total system risk entropy and statistical results of the system risk entropy based on the system risk entropy corresponding to each high-risk scenario; determining the contribution of each safety parameter to the total system risk entropy, and obtaining key safety parameters based on the contribution of each safety parameter to the total system risk entropy; wherein, the formula for calculating the contribution of each safety parameter to the total system risk entropy is as follows: , For the first The contribution of each security parameter to the total risk entropy of the system. Indicates the first The security parameter is in the first The time limit exceeding the limit during the simulation process of a high-risk scenario. Indicates the first Total simulation time for each high-risk scenario Indicates the first The system risk entropy of a high-risk scenario is calculated; a vulnerability profile of the microgrid is generated based on key safety parameters, and a list of risk-contributing devices is obtained based on the vulnerability profile; a comprehensive assessment report of the microgrid is generated based on the system risk entropy statistics, vulnerability profiles, and risk-contributing device list.

[0116] The total system risk entropy is determined based on the system risk entropy corresponding to all high-risk scenarios. Furthermore, during the simulation of all high-risk scenarios, the contribution of each safety parameter to the total system risk entropy is determined as follows:

[0117]

[0118] in, For the first The contribution of each security parameter to the total risk entropy of the system. Indicates the first The security parameter is in the first The time limit exceeding the limit during the simulation process of a high-risk scenario. Indicates the first Total simulation time for each high-risk scenario Indicates the first The system risk entropy of a high-risk scenario is further determined. The contribution of all safety parameters to the total system risk entropy is then identified. The top 10 safety parameters with the highest contribution to the total system risk entropy are selected as key safety parameters. These key safety parameters are then mapped back to the physical devices of the microgrid. The location of weak points and their contribution to the total system risk entropy are visualized on the microgrid's single-line diagram using a heatmap. Color intensity reflects the level of contribution to the total system risk entropy, generating a profile of the corresponding weak points in the microgrid.

[0119] Based on the vulnerability profile, the physical devices and locations that contribute the most to the total system risk entropy are listed, resulting in a risk-contributing device list. Furthermore, the system risk entropy corresponding to all high-risk scenarios is statistically analyzed to determine the maximum, average, and quantile values ​​of the system risk entropy for each high-risk scenario, thus obtaining the system risk entropy statistical results.

[0120] Based on the statistical results of system risk entropy, the profile of weak links, and the list of risk-contributing devices, a comprehensive assessment report of the microgrid is generated.

[0121] In this embodiment, by introducing the information theory indicator of system risk entropy, the risk level of the microgrid under different operating conditions can be quantified, the contribution of all safety parameters to the total system risk entropy can be determined, key safety parameters can be screened, and then the weakest link in the microgrid with the largest contribution to the total system risk entropy can be identified. This weak link profile is visualized through a heatmap. The heatmap intuitively displays the contribution to the total system risk entropy through color depth. This weak link profile can intuitively and accurately present the most risky physical equipment and areas in the microgrid, enabling decision-makers to clearly identify key parts that may affect the stability and security of the microgrid, thus achieving the quantification and source tracing of microgrid risks. This invention can significantly improve the efficiency of safety identification during microgrid operation. When the microgrid faces sudden failures or environmental changes, it can quickly identify high-risk areas and take emergency measures, thereby improving the emergency response capability and overall stability of the microgrid.

[0122] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0123] Based on the same inventive concept, this application also provides a microgrid operation safety assessment device for implementing the microgrid operation safety assessment method described above. The solution provided by this device is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more embodiments of the microgrid operation safety assessment device provided below can be found in the limitations of the microgrid operation safety assessment method described above, and will not be repeated here.

[0124] In one exemplary embodiment, such as Figure 3 As shown, a microgrid operation safety assessment device is provided, comprising: a determination module 302, a generation module 304, a simulation module 306, and an assessment module 308, wherein:

[0125] The determination module 302 is used to determine the joint prior distribution of the scenario variable set corresponding to the microgrid through Gaussian Copula, and to perform risk prediction on multiple operating scenarios based on a pre-trained risk predictor to obtain the risk index corresponding to each operating scenario; each operating scenario consists of specific values ​​corresponding to a set of scenario variable sets.

[0126] The generation module 304 is used to construct a sampling probability density function based on the joint prior distribution and the risk index corresponding to each operating scenario, and to generate a set of high-risk scenarios for the microgrid based on the sampling probability density function.

[0127] The simulation module 306 is used to simulate various high-risk scenarios in the high-risk scenario set using a pre-built digital twin model of the microgrid, and obtain test data sets for each high-risk scenario; the digital twin model is generated based on the pre-collected real-time operating data of the microgrid.

[0128] The evaluation module 308 is used to determine the system risk entropy corresponding to each high-risk scenario based on the test data set of each high-risk scenario, and to determine the safety assessment report corresponding to the microgrid based on the system risk entropy corresponding to each high-risk scenario.

[0129] In one exemplary embodiment, the determining module 302 is further configured to determine the scene variable set. The continuous and discrete variables in the model correspond to the empirical marginal distribution and probability distribution, respectively; the scenario variable set includes photovoltaic output disturbance, total load disturbance, battery state of charge, unique thermal coding of fault location, and other variables in the microgrid. Fault status and ambient temperature; based on scenario variable set The rank correlation coefficients between variables in each scenario are used to determine the elements of the correlation matrix between variables in each scenario, and the correlation matrix is ​​obtained based on the elements of the correlation matrix between variables in each scenario. The formula for calculating the rank correlation coefficient is: , Represents the set of scene variables The first in The first scenario variable and the first Rank correlation coefficients among scenario variables The process of calculating the Pearson correlation coefficient, which includes ranking and rank calculation, is described below. and They represent the first The first scenario variable and the first There are several scene variables; the formula for calculating the elements of the correlation matrix is ​​as follows: , Represents the set of scene variables The first in The first scenario variable and the first The correlation matrix elements between the scene variables; based on the correlation matrix Define the prior Gaussian Copula as The scene variable set is determined based on the prior Gaussian Copula. The corresponding joint prior distribution is ,in, This represents the prior Gaussian Copula density function value. Indicates the first The cumulative distribution function value of each scene variable under a uniform distribution. Represents the set of scene variables The total number of scene variables in the middle. This represents the inverse mapping of the standard normal distribution of the scene variables. Represents the set of scene variables The Middle The empirical marginal distribution or probability distribution corresponding to each scenario variable.

[0130] In an exemplary embodiment, the determination module 302 is further configured to use historical data of the microgrid as samples and employ kernel density estimation to calculate the scenario variable set. The empirical marginal distribution of continuous variables in the model is: ,in, Represents the set of scene variables The first in A continuous variable, Indicates the first Empirical marginal distribution of a continuous variable This indicates the total number of samples. Indicates the kernel width. Represents the standard Gaussian kernel function. Indicates the first The nth continuous variable Sample; for the set of scene variables The discrete variables in the model are processed using empirical frequency methods to obtain the probability distribution of the discrete variables. , Represents the set of scene variables The Middle A discrete variable, Indicates the first The probability distribution of discrete variables. Indicates the first The discrete variable appears in all running scenarios. Number of times for each type.

[0131] In an exemplary embodiment, the generation module 304 is further configured to generate risk indices based on multiple operating scenarios. and scene variable set Corresponding joint prior distribution The sampling probability density function is constructed as follows: ,in, The expected value of the risk index representing multiple operating scenarios is calculated using the following formula: , The total number of running scenarios, For the first Risk indices for each operating scenario; based on the sampling probability density function, multiple operating scenarios are sampled to obtain a set of high-risk scenarios for the microgrid. , For the first A high-risk scenario, This indicates the total number of high-risk scenarios.

[0132] In an exemplary embodiment, the evaluation module 308 is further configured to determine the safety parameters of the microgrid based on test data sets for each high-risk scenario; the safety parameters include node voltage amplitude, voltage deviation, current, microgrid system frequency, frequency fluctuation, active power, reactive power, and energy storage device state of charge; determine the over-limit time of each safety parameter in the simulation process of each high-risk scenario according to preset safety standards; and for each high-risk scenario, determine the system risk entropy corresponding to that high-risk scenario based on the over-limit time of each safety parameter in the simulation process of that high-risk scenario and the total simulation time of that high-risk scenario. ,in, This represents the total number of safety parameters. Indicates the first The time limit for exceeding a safety parameter during the simulation process in this high-risk scenario. This indicates the total simulation time for this high-risk scenario. Indicates the first Each security parameter has a severity weight.

[0133] In an exemplary embodiment, the evaluation module 308 is further configured to determine the total system risk entropy and the statistical results of system risk entropy based on the system risk entropy corresponding to each high-risk scenario; determine the contribution of each safety parameter to the total system risk entropy, and obtain key safety parameters based on the contribution of each safety parameter to the total system risk entropy; wherein, the calculation formula for the contribution of each safety parameter to the total system risk entropy is as follows: , For the first The contribution of each security parameter to the total risk entropy of the system. Indicates the first The security parameter is in the first The time limit exceeding the limit during the simulation process of a high-risk scenario. Indicates the first Total simulation time for each high-risk scenario Indicates the first The system risk entropy of a high-risk scenario is calculated; a vulnerability profile of the microgrid is generated based on key safety parameters, and a list of risk-contributing devices is obtained based on the vulnerability profile; a comprehensive assessment report of the microgrid is generated based on the system risk entropy statistics, vulnerability profiles, and risk-contributing device list.

[0134] In one exemplary embodiment, the microgrid operation safety assessment device further includes:

[0135] The module is used to collect real-time operating data of the microgrid through its SCADA system and synchronous phasor measurement unit. This real-time operating data includes data from multiple components. The module preprocesses the real-time operating data using an isolated forest anomaly detection algorithm and a data alignment algorithm to obtain preprocessed real-time operating data. Finally, a differential-algebraic equation model of the microgrid is constructed based on the physical parameters of its components. ,in, For state variables, For algebraic variables, Indicates control input, Indicates time, Represents the function of a differential equation. The algebraic equation function is represented by the state variables, algebraic variables, and control inputs, which represent the dynamic state, network constraints, and control commands of the microgrid, respectively. The preprocessed real-time operating data is input into the differential algebraic equation model, and the parameters of the differential algebraic equation model are calibrated in real time using Kalman filtering to generate a digital twin model of the microgrid.

[0136] In one exemplary embodiment, the microgrid operation safety assessment device further includes:

[0137] The training module is used to extract the scenario variable set for training the pre-acquired initial risk predictor based on the historical operation data of the microgrid, and obtain the training scenario variable set; input the training scenario variable set into the initial risk predictor to obtain the corresponding training prediction output; based on the training prediction output and the real risk labels corresponding to the training scenario variable set, the Adam optimization algorithm is used to iteratively update the parameters of the initial risk predictor to obtain the trained risk predictor.

[0138] Each module in the aforementioned microgrid operation safety assessment device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0139] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0140] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0141] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0142] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0143] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0144] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0145] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for assessing the operational safety of a microgrid, characterized in that, The method includes: The joint prior distribution of the scenario variable set corresponding to the microgrid is determined by Gaussian Copula, and risk prediction is performed on multiple operating scenarios based on a pre-trained risk predictor to obtain the risk index corresponding to each operating scenario; each operating scenario is composed of specific values ​​corresponding to a set of scenario variable sets. Based on the joint prior distribution and the risk index corresponding to each operating scenario, a sampling probability density function is constructed, and a set of high-risk scenarios for the microgrid is generated based on the sampling probability density function. Using a pre-constructed digital twin model of the microgrid, simulations are performed on each high-risk scenario in the high-risk scenario set to obtain test data sets for each high-risk scenario; the digital twin model is generated based on pre-collected real-time operating data of the microgrid. Based on the test data sets of each high-risk scenario, the system risk entropy corresponding to each high-risk scenario is determined, and the corresponding safety assessment report for the microgrid is determined based on the system risk entropy corresponding to each high-risk scenario.

2. The method according to claim 1, characterized in that, The determination of the joint prior distribution of the scenario variable set corresponding to the microgrid through Gaussian Copula includes: Determine the set of scene variables The continuous and discrete variables in the model correspond to the empirical marginal distribution and probability distribution, respectively; the scenario variable set includes photovoltaic output disturbance, total load disturbance, battery state of charge, unique thermal coding of fault location, and other variables in the microgrid. Fault status and ambient temperature; Based on scenario variable set The rank correlation coefficients between variables in each scenario are used to determine the elements of the correlation matrix between variables in each scenario, and the correlation matrix is ​​obtained based on the elements of the correlation matrix between variables in each scenario. The formula for calculating the rank correlation coefficient is as follows: , Represents the set of scene variables The first in The first scenario variable and the first Rank correlation coefficients among scenario variables The process of calculating the Pearson correlation coefficient, which includes ranking and rank calculation, is described below. and They represent the first The first scenario variable and the first There are several scene variables; the formula for calculating the elements of the correlation matrix is ​​as follows: , Represents the set of scene variables The first in The first scenario variable and the first Correlation matrix elements between scene variables; According to the relevant matrix Define the prior Gaussian Copula as The scene variable set is determined based on the prior Gaussian Copula. The corresponding joint prior distribution is ,in, This represents the prior Gaussian Copula density function value. Indicates the first The cumulative distribution function value of each scene variable under a uniform distribution. Represents the set of scene variables The total number of scene variables in the middle. This represents the inverse mapping of the standard normal distribution of the scene variables. Represents the set of scene variables The Middle The empirical marginal distribution or probability distribution corresponding to each scenario variable.

3. The method according to claim 2, characterized in that, The determination of the scenario variable set The empirical marginal distributions and probability distributions corresponding to the continuous and discrete variables in the data include: Using historical data from the microgrid as a sample, the kernel density estimation method was employed to calculate the scenario variable set. The empirical marginal distribution of continuous variables in the model is: ,in, Represents the set of scene variables The first in A continuous variable, Indicates the first Empirical marginal distribution of a continuous variable This represents the total number of samples. Indicates the kernel width. Represents the standard Gaussian kernel function. Indicates the first The nth continuous variable Sample; For the scene variable set The discrete variables in the data are processed using empirical frequency methods to obtain the probability distribution of the discrete variables. , Represents the set of scene variables The Middle A discrete variable, Indicates the first The probability distribution of discrete variables. Indicates the first The discrete variable appears in all running scenarios. Number of times for each type.

4. The method according to claim 1, characterized in that, The step of constructing a sampling probability density function based on the joint prior distribution and the risk index corresponding to each operating scenario includes: Risk indices based on multiple operational scenarios and scene variable set Corresponding joint prior distribution The sampling probability density function is constructed as follows: ,in, The expected value of the risk index representing multiple operating scenarios is calculated using the following formula: , The total number of running scenarios, For the first Risk index for each operational scenario; Based on the aforementioned sampling probability density function, multiple operating scenarios are sampled to obtain the high-risk scenario set of the microgrid. , For the first A high-risk scenario, This indicates the total number of high-risk scenarios.

5. The method according to claim 1, characterized in that, The system risk entropy corresponding to each high-risk scenario is determined based on the test data sets for each high-risk scenario, including: Based on the test data sets of each of the aforementioned high-risk scenarios, the safety parameters of the microgrid are determined; the safety parameters include node voltage amplitude, voltage deviation, current, microgrid system frequency, frequency fluctuation, active power, reactive power, and energy storage device state of charge; Based on the preset safety standards, determine the time limit for each safety parameter to exceed the limit during the simulation process of each high-risk scenario; For each high-risk scenario, based on the time each safety parameter exceeds its limit during the simulation process of that high-risk scenario and the total simulation time of that high-risk scenario, the system risk entropy corresponding to that high-risk scenario is determined as follows: ,in, This represents the total number of safety parameters. Indicates the first The time limit for exceeding a safety parameter during the simulation process in this high-risk scenario. This indicates the total simulation time for this high-risk scenario. Indicates the first Each security parameter has a severity weight.

6. The method according to claim 5, characterized in that, The safety assessment report for the microgrid, determined based on the system risk entropy corresponding to each high-risk scenario, includes: The total system risk entropy and the statistical results of system risk entropy are determined based on the system risk entropy corresponding to each high-risk scenario. The contribution of each safety parameter to the total risk entropy of the system is determined, and key safety parameters are obtained based on the contribution of each safety parameter to the total risk entropy of the system; wherein, the formula for calculating the contribution of each safety parameter to the total risk entropy of the system is as follows: , For the first The contribution of each security parameter to the total risk entropy of the system. Indicates the first The security parameter is in the first The time limit exceeding the limit during the simulation process of a high-risk scenario. Indicates the first Total simulation time for each high-risk scenario Indicates the first System risk entropy in a high-risk scenario; Based on the key safety parameters, a vulnerability profile of the microgrid is generated, and a list of risk-contributing devices is obtained based on the vulnerability profile. Based on the statistical results of the system risk entropy, the profile of weak links, and the list of risk-contributing devices, a comprehensive assessment report of the microgrid is generated.

7. The method according to claim 1, characterized in that, The process of generating the digital twin model includes: The real-time operation data of the microgrid is collected through the SCADA system and synchronous phasor measurement unit of the microgrid; the real-time operation data of the microgrid includes the real-time operation data of multiple components; The real-time operation data of the microgrid is preprocessed based on the isolated forest anomaly detection algorithm and the data alignment algorithm to obtain the preprocessed real-time operation data; Based on the physical parameters of the components of the microgrid, the differential-algebraic equation model corresponding to the microgrid is constructed as follows: ,in, For state variables, For algebraic variables, Indicates control input, Indicates time, Represents the function of a differential equation. The algebraic equation function is represented by the state variable, algebraic variable and control input, which respectively represent the dynamic state, network constraints and control commands of the microgrid; The preprocessed real-time operating data is input into the differential algebraic equation model, and the parameters of the differential algebraic equation model are calibrated in real time using Kalman filtering to generate a digital twin model corresponding to the microgrid.

8. The method according to claim 1, characterized in that, The method further includes: Based on the historical operating data of the microgrid, the set of scenario variables for training the pre-acquired initial risk predictor is extracted to obtain the training scenario variable set; The training scenario variable set is input into the initial risk predictor to obtain the corresponding training prediction output; Based on the training prediction output and the real risk labels corresponding to the training scenario variable set, the Adam optimization algorithm is used to iteratively update the parameters of the initial risk predictor to obtain the trained risk predictor.

9. A microgrid operation safety assessment device, characterized in that, The device includes: The determination module is used to determine the joint prior distribution of the scenario variable set corresponding to the microgrid through Gaussian Copula, and to perform risk prediction on multiple operating scenarios based on a pre-trained risk predictor to obtain the risk index corresponding to each operating scenario; each operating scenario is composed of specific values ​​corresponding to a set of scenario variable sets; The generation module is used to construct a sampling probability density function based on the joint prior distribution and the risk index corresponding to each operating scenario, and to generate a set of high-risk scenarios for the microgrid based on the sampling probability density function. The simulation module is used to simulate each high-risk scenario in the high-risk scenario set using a pre-built digital twin model of the microgrid, and obtain test data sets for each high-risk scenario; the digital twin model is generated based on the pre-collected real-time operating data of the microgrid. The evaluation module is used to determine the system risk entropy corresponding to each high-risk scenario based on the test data sets of each high-risk scenario, and to determine the corresponding safety assessment report for the microgrid based on the system risk entropy corresponding to each high-risk scenario.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.