Power safety determination method and device, storage medium and electronic equipment

By constructing a simulated power grid model and introducing a credibility index based on neighborhood distribution characteristics, the problems of sample scarcity and misleading judgment results in power safety discrimination methods are solved, thereby improving the accuracy and reliability of power grid safety discrimination.

CN123160302APending Publication Date: 2026-11-24HUAIROU LABORATORY SCIENCE & TECHNOLOGY ACHIEVEMENTS TRANSFORMATION CENTER HUAIROU DISTRICT BEIJING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611093810.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing power safety assessment methods rely on limited sample data, which cannot adapt to the unevenness of power grid operation status and the difference between old and new operating conditions. This leads to misleading assessment results for power grid safety control and affects the stable operation of the system.

Method used

By constructing a simulated power grid model to generate a power system sample set, and combining it with fault time-domain simulation to label the safety categories, the coverage of the sample set is expanded. Furthermore, a credibility index based on neighborhood distribution characteristics is introduced to form a dual-output discrimination result, including an initial discrimination result and a credibility index.

Benefits of technology

This improves the reference value and reliability of power safety judgment results, reduces single-point misjudgments, and ensures the accuracy and reliability of power grid safety decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160302A_ABST
    Figure CN123160302A_ABST
Patent Text Reader

Abstract

This application discloses a power safety discrimination method, apparatus, storage medium, and electronic device. The method includes: acquiring a sample of operating conditions to be discriminated against; using a power safety discrimination model to discriminate the safety category of the sample of operating conditions to be discriminated against, obtaining an initial discrimination result; determining the neighborhood range of the sample of operating conditions to be discriminated against based on a power system sample set, wherein the neighborhood range indicates the range of samples that meet preset electrical difference conditions with the sample of operating conditions to be discriminated against, and the electrical difference indicates the difference in electrical operating characteristics between the sample of operating conditions to be discriminated against and the samples in the neighborhood; determining a reliability index of the sample of operating conditions to be discriminated against based on the operating condition attribute information of each sample in the neighborhood range and the sample of operating conditions to be discriminated against, wherein the operating condition attribute information is used to measure the similarity of the operating conditions between each sample in the neighborhood and the sample of operating conditions to be discriminated against; and using the reliability index and the initial discrimination result as the final discrimination result of the sample of operating conditions to be discriminated against.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power grid technology, and in particular to a power safety discrimination method, device, storage medium and electronic equipment. Background Technology

[0002] The safe and stable operation of the power system is directly related to social production, residential electricity consumption, and the overall energy supply guarantee. As a key link in power grid security control, power safety assessment must possess sufficient accuracy and reliability. Existing power safety assessment methods rely on limited sample data for model training. However, in actual power grid operation scenarios, the sample distribution is uneven, with limited sample numbers corresponding to some operating conditions, and new operating conditions and fault conditions are difficult to cover entirely by existing samples. Under these circumstances, the classification rules formed by the model based on existing samples cannot adapt to all power grid operating states, easily leading to judgment results that do not conform to the characteristics of actual operating conditions. Once the judgment results are biased, they will directly mislead power grid security control strategies and dispatch operations, thereby affecting the stable operation of the entire power system. Summary of the Invention

[0003] In view of the above problems, this application provides a power safety discrimination method, device, storage medium and electronic device.

[0004] To solve the above-mentioned technical problems, this application proposes the following solution:

[0005] Firstly, this application provides a power safety discrimination method, the method comprising: acquiring a sample of operating conditions to be discriminated against; performing a safety category discrimination on the sample of operating conditions to be discriminated against using a power safety discrimination model to obtain an initial discrimination result; determining the neighborhood range of the sample of operating conditions to be discriminated against based on a power system sample set, wherein the neighborhood range is used to indicate the sample range consisting of samples that meet preset electrical difference conditions with the sample of operating conditions to be discriminated against, and the electrical difference is used to indicate the difference in electrical operating characteristics between the sample of operating conditions to be discriminated against and the neighborhood samples; determining a reliability index of the sample of operating conditions to be discriminated against based on the operating condition attribute information of each neighborhood sample and the sample of operating conditions to be discriminated against within the neighborhood range, wherein the operating condition attribute information is used to measure the similarity of the operating conditions between each neighborhood sample and the sample of operating conditions to be discriminated against; and using the reliability index and the initial discrimination result as the final discrimination result of the sample of operating conditions to be discriminated against.

[0006] This application introduces a credibility index based on neighborhood distribution characteristics on top of the initial discrimination results of the model, forming a dual output method of category determination and credibility evaluation. This allows for the direct reflection of the reliability of the discrimination conclusion while providing a safety category determination, thus overcoming the shortcomings of traditional discrimination methods that only output a single conclusion and cannot reflect the credibility of the conclusion, effectively improving the reference value and reliability of power safety discrimination results.

[0007] In conjunction with the first aspect, in one possible implementation, based on the electrical differences between the operating condition sample to be judged and each operating condition sample in the power system sample set, a neighborhood radius that satisfies the preset sample quantity constraint is determined. Based on the neighborhood radius, the neighborhood range of the operating condition sample to be judged is determined, and all operating condition samples within the neighborhood range are determined as neighborhood samples of the operating condition sample to be judged.

[0008] This application adjusts the neighborhood size based on the sample distribution, which can prevent the neighborhood from being too small and lacking reference data, and also avoid including samples with poor correlation, ensuring that the neighborhood screening results are consistent with the actual operating conditions of the power grid.

[0009] In conjunction with the first aspect, in one possible implementation, the class matching degree of the initial discrimination result within the neighborhood range is determined based on the distribution of the security category label corresponding to the initial discrimination result within the neighborhood range.

[0010] This application leverages the statistical category proportions of surrounding labeled samples and compares them with the characteristics of continuous changes in power grid operating conditions to intuitively demonstrate whether the model's judgment matches the local operating condition patterns, thereby reducing the potential risks caused by single-point misjudgments.

[0011] In conjunction with the first aspect, in one possible implementation, the relative aggregation degree of the sample to be judged is determined based on the degree of aggregation of electrical characteristics between the sample to be judged and each sample in the neighborhood.

[0012] This application distinguishes the regions where working conditions are located based on the density of samples, and quickly identifies boundary working conditions where samples are scarce, thereby measuring the strength of support of existing data for the current judgment conclusion.

[0013] In conjunction with the first aspect, in one possible implementation, a lower limit constraint is applied to the degree of electrical feature aggregation between the sample of the operating condition to be judged and each neighboring sample based on the neighborhood radius, thereby obtaining the constrained degree of electrical feature aggregation between the sample of the operating condition to be judged and each neighboring sample; the local aggregation degree of the sample of the operating condition to be judged is determined based on the number of samples within the neighborhood and the statistical value of the constrained degree of electrical feature aggregation between the sample of the operating condition to be judged and all neighboring samples; the average value of the local aggregation degree of each neighboring sample within the neighborhood is determined as the overall aggregation degree of the neighborhood; and the relative aggregation degree of the sample of the operating condition to be judged is determined based on the ratio of the local aggregation degree to the overall aggregation degree.

[0014] This application imposes a lower limit constraint on the degree of clustering of electrical features by using the neighborhood radius, and then calculates the local degree of clustering by combining the sample size and the statistical value of the difference after constraint, and compares it with the overall degree of clustering in the neighborhood. This can truly reflect the density state of the working condition to be judged in the feature space, effectively eliminate the interference of redundant nearby points on the density calculation, and ensure that the relative degree of clustering can accurately reflect the data support strength of the working condition.

[0015] In conjunction with the first aspect, in one possible implementation, when the relative aggregation degree is greater than or equal to the effective aggregation threshold, the relative aggregation degree is corrected to a preset value.

[0016] This application sets an effective clustering threshold to uniformly correct the relative clustering degree that reaches a reasonable density level. This avoids the credibility evaluation being artificially high due to excessive density of local samples, standardizes the range of index values, and ensures that the credibility evaluation maintains a uniform standard across different working conditions.

[0017] In conjunction with the first aspect, one possible implementation involves establishing a simulated power grid model based on the power grid topology and electrical operating parameters. Within this model, the generator output power and load power consumption are set according to a preset power range, creating various different power grid operating states. Steady-state operating data corresponding to each power grid operating state is acquired, and the operating state features from this data are extracted as operating condition sample features. A fault set is defined, and faults from this set are applied to the power grid under each operating state. Time-domain simulation is used to determine whether the power grid can maintain stable operation after the faults are applied. Based on the simulation results, safety category labels are assigned to the operating condition sample features, forming a power system sample set.

[0018] This application generates multiple operating states through a simulated power grid model and completes safety category labeling by combining fault time-domain simulation. It can systematically construct a comprehensive and standardized power system sample set, solving the problems of scarce measured samples, incomplete scenarios, and inaccurate labeling.

[0019] In conjunction with the first aspect, in one possible implementation, the characteristic change trend of the power system sample set is determined based on the distribution pattern and sample density of the power system sample set; in the region outside the boundary where the sample of the operating condition to be judged is located, multiple supplementary operating condition samples are generated according to the characteristic change trend of the power system sample set; fault simulation and stability judgment are performed on each supplementary operating condition sample, and a safety category label is marked for the supplementary operating condition sample; the labeled supplementary operating condition samples are merged with the power system sample set to form an expanded power system sample set.

[0020] Based on the distribution pattern of the sample set itself, this application generates supplementary working condition samples by expanding outward along the boundary and completing the annotation and sample merging. This can effectively expand the working condition coverage of the sample set, fill the sample gaps in the boundary and extended areas, and enable the working conditions to be judged that exceed the original coverage to also obtain effective similar sample support.

[0021] In conjunction with the first aspect, in one possible implementation, the local anomaly factor corresponding to each operating condition sample is calculated based on the relative clustering degree of each operating condition sample in the power system sample set; operating condition samples with local anomaly factors greater than a preset anomaly threshold are identified as suspected mislabeled samples; the suspected mislabeled samples are classified into safety categories using a power safety discrimination model to obtain the corrected safety category label for the suspected mislabeled samples, and the confidence index of the suspected mislabeled samples is determined; if the confidence index is greater than a confidence threshold, the corrected safety category label is used as the final safety category label for the suspected mislabeled samples.

[0022] This application calculates local anomaly factors based on relative clustering to identify suspected mislabeled samples, and then completes label correction through model re-judgment and credibility verification. It can automatically correct labeling bias in the sample set, improve the overall data quality of the sample set, avoid abnormal samples interfering with model training and index calculation, and ensure the accuracy and reliability of the entire process of power safety judgment from the source.

[0023] Secondly, this application provides a power safety discrimination device, which includes:

[0024] The initial discrimination module is used to acquire samples of operating conditions to be discriminated against, and to perform safety category discrimination on the samples of operating conditions to be discriminated against using the power safety discrimination model to obtain the initial discrimination result.

[0025] The reliable discrimination module is used to determine the neighborhood range of the operating condition sample to be judged based on the power system sample set. The neighborhood range indicates the sample range formed by samples that meet the preset electrical difference conditions with the operating condition sample to be judged. The electrical difference indicates the difference in electrical operating characteristics between the operating condition sample to be judged and the neighborhood samples. Based on the operating condition attribute information of each neighborhood sample and the operating condition sample to be judged within the neighborhood range, the reliability index of the operating condition sample to be judged is determined. The operating condition attribute information is used to measure the similarity of the operating conditions between each neighborhood sample and the operating condition sample to be judged.

[0026] The final discrimination module is used to take the confidence index and the initial discrimination result as the final discrimination result of the sample of the working condition to be discriminated.

[0027] To achieve the above objectives, according to a third aspect of this application, a storage medium is provided, the storage medium including a stored program, wherein, when the program is running, the device where the storage medium is located is controlled to execute the power safety discrimination method of the first aspect.

[0028] To achieve the above objectives, according to a fourth aspect of this application, an electronic device is provided, the device including at least one processor, and at least one memory and bus connected to the processor; wherein the processor and memory communicate with each other through the bus; the processor is used to call program instructions in the memory to execute the power safety discrimination method of the first aspect.

[0029] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0030] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0031] Figure 1 A flowchart illustrating a power safety discrimination method provided in an embodiment of this application is shown;

[0032] Figure 2 A flowchart illustrating a credibility index determination process provided in an embodiment of this application is shown.

[0033] Figure 3 This illustration shows a schematic diagram of the physical meaning interpretation of a credibility index provided in an embodiment of this application;

[0034] Figure 4 A flowchart illustrating a relative aggregation degree calculation process provided in an embodiment of this application is shown;

[0035] Figure 5 This paper shows a schematic diagram of the structure of a power safety discrimination device provided in an embodiment of this application;

[0036] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation

[0037] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the present application to those skilled in the art.

[0038] In the embodiments of this application, the terms "first," "second," etc., do not have a logical or temporal dependency, nor do they limit the quantity or execution order. It should also be understood that although the following description uses the terms "first," "second," etc., to describe various elements, these elements should not be limited by the terms. These terms are merely used to distinguish one element from another.

[0039] In this application, the term "at least one" means one or more, and the term "multiple" means two or more.

[0040] It should also be understood that the term “if” can be interpreted as “when” or “upon”, or “in response to determination” or “in response to detection”. Similarly, depending on the context, the phrase “if determination…” or “if detection [the stated condition or event]” can be interpreted as “when determination…” or “in response to determination…” or “when detection [the stated condition or event]” or “in response to detection [the stated condition or event]”.

[0041] The safe and stable operation of the power system is directly related to social production, residential electricity consumption, and the overall energy supply guarantee. As a key link in power grid security control, power safety assessment must possess sufficient accuracy and reliability. Existing power safety assessment methods typically only output a safe or unsafe result. This is because the effectiveness of existing methods depends on the uniformity of the training sample distribution, the accuracy of the labeling, and the coverage of operating conditions. When the sample distribution is sparse and uneven, the labeling is biased, or the operating conditions to be assessed exceed the coverage of existing samples, the assessments made by the model based on limited, abnormal, or incomplete data are prone to inconsistency with the actual operating characteristics of the power grid, leading to assessment bias and failing to provide reliable support for power system safety decisions.

[0042] Based on this, this application provides a power safety assessment method. The power safety assessment method will be described in detail below with reference to the accompanying drawings. Figure 1 This is a flowchart illustrating a power safety assessment method provided in this application. It specifically includes the following steps:

[0043] Step 110: Obtain the sample of the operating condition to be judged, and use the power safety discrimination model to judge the safety category of the sample of the operating condition to be judged to obtain the initial discrimination result.

[0044] Before formally conducting power safety assessment, two preliminary foundational tasks need to be completed: sample construction and model training. This involves constructing a power system sample set and training a power safety assessment model based on this sample set. In this application, the power system sample set refers to a collection of various power grid operating condition samples generated from a simulated power grid model and labeled with safety category tags. The power safety assessment model refers to a classification model trained based on the power system sample set, used to output safety category assessment results according to the characteristics of power grid operating conditions.

[0045] Since power systems typically operate in a safe and stable state, dispatching and operation processes actively avoid faults and critical stability boundaries. Therefore, fault conditions and critical stability conditions are extremely rare during normal power grid operation, making it difficult to collect sufficient samples covering various operating modes and fault scenarios through field measurements. Furthermore, real-world operational data is susceptible to measurement errors, data noise, and transmission interference, compromising sample quality and label accuracy. To address this, this application constructs a power system sample set using a simulated power grid model, as detailed below.

[0046] First, a simulated power grid model is established based on the power grid topology and electrical operating parameters. Specifically, the grid structure, transmission line parameters, transformer parameters, generator parameters, and load parameters of the target power grid are used to build models of each electrical component in the power system simulation platform. The wiring configuration between each component is completed according to the connection relationship of the actual power grid, so that the topology, component parameters, and operating characteristics of the simulated power grid are consistent with those of the actual power grid.

[0047] Next, in the simulated power grid model, the generator output power and load power consumption are set according to preset power ranges, forming various different power grid operating states. Specifically, the power adjustment range is determined in advance based on the actual operating range of the power grid. For each generator model in the simulated power grid model, within the range defined by the rated output of the generator model, the active power output setting value and reactive power output setting value of the generator model are modified in a fixed step size to complete the adjustment of the generator model's output power. For each load model in the simulated power grid model, within the typical power load fluctuation range, the active power setting value and reactive power setting value of the load model are modified in the same way to complete the adjustment of the load model's power consumption. During the adjustment process, the overall balance between generator power and load power is maintained. The parameter settings for different output combinations and different load levels are completed group by group. Each group of parameter settings corresponds to an independent power grid operating state, ultimately resulting in a power grid operating state covering multiple scenarios such as light load, normal, and heavy load.

[0048] Then, steady-state operating data corresponding to each power grid operating state is obtained, and operating state features in the steady-state operating data are extracted as operating condition sample features. This application obtains steady-state operating data for each generated power grid operating state by performing power flow calculations. Here, power flow calculation refers to the steady-state calculation process of solving the voltage of each node and the power distribution of each branch under given power grid structure and component parameters, which can reflect the power transmission and voltage distribution of the power grid under fault-free and disturbance-free conditions. The steady-state operating data of this application includes the injected power of each node, the voltage amplitude of each node, the voltage phase angle, the active power flow of each line, the reactive power flow, the actual output power of each generator model, and the actual absorbed power of each load model. In the actual power grid dispatching process, dispatchers mainly change the power grid operating state by adjusting the output of each generator unit. The node injected power can directly reflect the power supply and reception status of generators and loads at the power grid nodes. Therefore, when constructing sample features, node injected power needs to be included as a necessary feature. After obtaining the steady-state operating data, electrical parameters that can characterize the power grid operating state are selected from it, and the selected electrical parameters are determined as operating condition sample features.

[0049] To accurately assess the stability of various power grid operating states under fault disturbances, this application establishes a fault set. Faults from this set are applied to the power grid under each operating state, and time-domain simulation is used to determine whether the power grid can maintain stable operation after the faults are applied. This application pre-constructs a fault set based on the control requirements for safe power grid operation. The fault set includes three-phase short-circuit faults, two-phase short-circuit faults, single-phase grounding faults, and line disconnection faults for lines of different voltage levels and at different bus locations. Each fault type is configured according to preset fault occurrence locations and fault clearing times. For each generated power grid operating state, various faults from the fault set are sequentially applied to the corresponding bus or line locations in the simulated power grid model. The time-domain simulation program is then started to simulate the entire dynamic process of fault occurrence, fault persistence, and fault clearing.

[0050] During the simulation, the relative power angles between generator rotors, the voltage amplitudes at key nodes, and the overall system frequency are monitored in real time. If the relative power angles of the generators remain bounded and do not diverge continuously, the voltages at key nodes recover to their allowable operating range after a fault, and the system frequency returns to a stable range near the rated frequency after a fault, then the power grid is considered to be able to maintain stable operation after a fault. If the relative power angles of the generators continue to diverge, the voltages at key nodes continue to drop, or the system frequency exceeds the allowable fluctuation range, then the power grid is considered to be unable to maintain stable operation after a fault.

[0051] Based on the simulation results, safety category labels are assigned to the features of the operating condition samples to form a power system sample set. Operating condition samples that can maintain stable operation after a fault are labeled as safe, while those that cannot maintain stable operation after a fault are labeled as unsafe. All operating condition samples with completed feature extraction and safety category labeling are then compiled and organized to obtain the power system sample set.

[0052] Finally, the completed power system sample set is used to train the power safety discrimination model. Operating condition samples from the power system sample set are used as input data, and the safety category labels corresponding to the operating condition samples are used as the output. The model used in this application can be a neural network, support vector machine, or other model with classification and discrimination capabilities. Taking a neural network as an example, the operating condition samples are input into the neural network structure, and training is performed according to a preset number of iterations and learning rate. The weights and bias parameters inside the network are continuously updated to reduce the deviation between the network output and the safety category label. Based on the above training method, a power safety discrimination model with the ability to discriminate power grid safety status is finally obtained.

[0053] After obtaining the power safety discrimination model, the safety category of the operating condition sample to be judged can be determined using the power safety discrimination model. The operating condition sample to be judged referred to in this application is the actual power grid operating condition data to be assessed for safety status. The composition of the operating condition sample to be judged is consistent with the operating condition samples in the power system sample set. When obtaining the operating condition sample to be judged, steady-state electrical data under the current operating state of the actual power grid is collected. The steady-state electrical data includes the voltage amplitude of each node, voltage phase angle, active power flow, reactive power flow, generator output power, and load absorption power of each line. According to the same feature selection rules used when constructing the power system sample set, the corresponding electrical parameters are extracted from the collected steady-state electrical data, and the data is organized to obtain the operating condition sample to be judged with a unified format and consistent dimensions.

[0054] The processed samples of operating conditions to be judged are input into the trained power safety discrimination model. The model classifies and judges the safety status of the samples according to its learned classification rules, and outputs the corresponding initial discrimination results. Taking a neural network model as an example, the input layer of the model receives the samples of operating conditions to be judged, and after weighted operations and nonlinear transformations in the hidden layer, the output layer outputs the corresponding safety status classification results. The safety status output by the power safety discrimination model includes multiple safety categories such as dynamic safety, static safety, and safety that ensures stability under small disturbances.

[0055] Step 120: Determine the neighborhood range of the operating condition sample to be judged based on the power system sample set, and determine the credibility index of the operating condition sample to be judged based on the operating condition attribute information of each neighborhood sample and the operating condition sample to be judged within the neighborhood range.

[0056] In actual power grid operation, the initial judgment results provided by the model alone are insufficient for direct safety decision-making. The operating states of a power system are continuous and interconnected; similar operating conditions typically exhibit consistent safety and stability. A single classification result output by the model only provides a classification conclusion and cannot reflect the position of the current operating condition to be judged within the overall sample, nor can it indicate whether this result is supported by similar surrounding conditions. When the operating condition to be judged is in a sparse or boundary region of the sample, the model's judgment is prone to bias, which cannot be detected from the result itself. Therefore, this application quantifies the reliability of the initial judgment results by calculating a reliability index, making the judgment conclusions more consistent with the physical laws of actual power grid operation and providing dispatchers with more sufficient basis for judgment.

[0057] This application calculates the reliability index based on the actual distribution of power system samples and the electrical correlation between operating conditions. First, based on differences in electrical parameters, neighboring samples similar to the operating condition to be judged are found in the sample set, forming an effective reference range. Then, two aspects are analyzed: first, whether the majority of samples within the neighboring range belong to the same category as the initial judgment result, thus determining whether the result possesses local consistency; second, the magnitude of the electrical differences between the judged operating condition and the neighboring samples, thus determining the degree of similarity between operating conditions and the density of sample distribution. Combining these two aspects of information ultimately forms a reliability index that objectively reflects the reliability of the initial judgment result. The specific implementation process is as follows.

[0058] Step 210: Based on the electrical differences between the operating condition sample to be judged and each operating condition sample in the power system sample set, determine the neighborhood radius that satisfies the preset sample quantity constraint, determine the neighborhood range of the operating condition sample to be judged based on the neighborhood radius, and determine all operating condition samples within the neighborhood range as neighborhood samples of the operating condition sample to be judged.

[0059] First, the feature dimensions of the sample of the operating condition to be judged and all operating condition samples in the power system sample set are unified to ensure that the two use the same electrical features for calculation. The electrical features used in this application include node injected active power, node injected reactive power, node voltage amplitude, node voltage phase angle, line active power flow, and line reactive power flow, ensuring that all samples are in the same feature space, providing a unified basis for subsequent electrical difference calculation, and avoiding deviations in similarity measurement results due to inconsistent feature dimensions.

[0060] Secondly, to achieve accurate screening of neighboring samples, this application quantifies the comprehensive electrical similarity (i.e., electrical difference) between the sample of the operating condition to be judged and each operating condition sample in the power system sample set. This numerical method reflects the degree of proximity in operating state between the sample of the operating condition to be judged and each operating condition sample in the sample set. Operating condition samples with closer operating states have more similar electrical characteristic distributions and exhibit higher consistency in post-fault safety and stability characteristics. In this application's implementation, Euclidean distance is used to calculate electrical difference. In the space composed of multi-dimensional electrical characteristics, Euclidean distance can directly reflect the overall proximity between two sets of operating conditions without requiring any prior assumptions about the sample distribution, thus adapting to the complex sample distribution and diverse scenarios of the power system. The calculation formula for electrical difference in this application is given below. in, Let i be the i-th dimension feature value of the sample of working conditions to be judged. Let be the i-th dimension feature value of a certain operating condition sample in the power system sample set, and m be the total dimension of the selected electrical features. The smaller the electrical difference value, the closer the electrical characteristics of the operating condition sample to be judged are to the corresponding operating condition sample, and the more suitable the operating condition sample is to be included in the neighborhood range as a reference sample.

[0061] Based on this, to clearly define the neighborhood boundary under a unified standard and ensure a stable statistical basis for subsequent reliability calculations, this application standardizes the definition of the neighborhood range of the sample to be judged based on the calculated electrical differences. To ensure a reasonable neighborhood range and consistent electrical similarity among internal samples, this application introduces the concepts of k-order neighborhood and k-order nearest neighbor distance. The sample to be judged, X... p k-order neighborhood The sample X of the working condition to be judged p A continuous region defined in the electrical characteristic space, centered on a given point, is used to accommodate historical operating condition samples with electrical characteristics similar to the sample to be judged. The k-th order nearest neighbor distance is used. The radius corresponding to this neighborhood is determined based on the aforementioned electrical differences and must satisfy the following constraints to ensure clear neighborhood boundaries and reasonable sample selection: In the formula, "st" indicates that the following conditions are met, and "#{}" indicates the number of working condition samples that meet the corresponding conditions. This constraint limits the neighborhood radius in two ways. The first constraint This represents the number of operating condition samples whose electrical difference from the sample to be judged is no greater than the neighborhood radius, and must be no less than k. Its purpose is to ensure that the neighborhood contains at least k samples similar to the operating condition to be judged, avoiding an insufficient number of reference samples due to a small neighborhood, and ensuring sufficient data support for subsequent reliability calculations. (Second constraint) denoted by , represents the number of operating condition samples whose electrical difference from the sample to be judged is strictly less than the neighborhood radius, with a maximum of k-1 such samples. Its function is to ensure that the neighborhood radius falls precisely at the position of the electrical difference corresponding to the k-th nearest neighbor sample, preventing the radius from arbitrarily expanding to include samples with low electrical similarity, and ensuring that all samples included in the neighborhood have sufficient reference value. By simultaneously satisfying the above two constraints, the neighborhood radius and neighborhood range can be uniquely determined, ensuring both a sufficient number of samples within the neighborhood and high electrical similarity among all samples to the operating condition to be judged, making the neighborhood delineation result objective, stable, and repeatable.

[0062] Subsequently, all operating condition samples in the power system sample set are sorted in ascending order of their electrical differences from the sample to be judged, resulting in an increasing distance sequence. Following the selection rules corresponding to the aforementioned constraints, the electrical difference value corresponding to the k-th sample after sorting is determined as the neighborhood radius; this radius is the k-th nearest neighbor distance that satisfies the constraints. This ensures that the similarity of samples within the neighborhood is consistent, enabling effective screening of samples with similar working conditions.

[0063] Then, a continuous region is defined within the electrical feature space, centered on the sample of the operating condition to be judged and bounded by the neighborhood radius. This region is the neighborhood range of the sample of the operating condition to be judged, corresponding to the aforementioned k-order neighborhood. The process iterates through all operating condition samples in the power system sample set, and includes all operating condition samples with electrical differences less than or equal to the neighborhood radius into the neighborhood range, forming a neighborhood sample set. All operating condition samples within this sample set are the neighborhood samples of the operating condition sample to be judged.

[0064] This step determines the neighborhood radius and range based on electrical differences and constraints, adaptively matching the uneven distribution characteristics of the power system sample set. In densely populated regions, the neighborhood radius automatically shrinks, forming a high-density, high-precision neighborhood, improving the accuracy of similarity screening. In sparsely populated regions, the neighborhood radius automatically expands, ensuring that the neighborhood always contains a sufficient number of valid reference samples, improving computational stability.

[0065] Step 220: Determine the class matching degree of the initial discrimination result in the neighborhood range based on the distribution of the security category labels corresponding to the initial discrimination result in the neighborhood range.

[0066] Since operating conditions with similar electrical characteristics in power systems typically exhibit consistent safety and stability characteristics, the initial discrimination result of the sample to be discriminated should be consistent with the safety category labels of most similar samples in the neighborhood. To quantify the degree of agreement between the initial discrimination result and the category labels of samples in the neighborhood, and to objectively reflect the reliability of the current discrimination result in locally similar operating conditions, this step calculates the category matching degree of the initial discrimination result within the neighborhood. The category matching degree is an important component of the reliability index and can provide direct evidence for reliability evaluation from the perspective of category consistency.

[0067] In practice, firstly, all neighborhood samples within the neighborhood range determined in step 210 are traversed, and the pre-labeled security category label for each neighborhood sample is extracted. For example, the security categories in this application include two types: secure and unsecured. Subsequently, based on the classification labels of the neighborhood samples, the category matching degree corresponding to the initial discrimination result is calculated using the following formula: In the formula, This indicates a sample set whose sample label is of class j, corresponding to the safe or unsafe class in the power system safety category. Representing the neighborhood The sample set belonging to class j. The neighborhood range of the sample to be judged, as determined in step 210. This indicates the number of neighboring samples that belong to the same security category as the initial judgment result. This represents the total number of samples within the neighborhood. It's important to note that due to the neighborhood... It contains at least k sample points, that is... Therefore, the denominator in the formula cannot be directly replaced by the preset value k; it must be based on the total number of samples in the actual neighborhood. The physical meaning of this category matching degree is: the proportion of samples in the neighborhood of the sample to be judged that belong to the same category (safe / unsafe) as the initial judgment result. The higher the proportion, the higher the support of the initial judgment result in locally similar working conditions, and the higher the confidence of the model in judging that the working condition belongs to the corresponding category. To ensure the standardization and uniformity of the category matching degree calculation results, its value range is limited to [0, 100%]. When all neighborhood samples within the neighborhood belong to the same safety category as the initial judgment result, the category matching degree is 100%, indicating that the initial judgment result is completely consistent within the neighborhood, possessing the highest local consistency. When no neighborhood sample within the neighborhood belongs to the same safety category as the initial judgment result, the category matching degree is 0, indicating that the initial judgment result is completely isolated within the neighborhood, lacking local consistency. When only a portion of the neighborhood samples match the initial discrimination result, the category matching degree is the corresponding proportion, which intuitively reflects the degree of support of the initial discrimination result in locally similar working conditions.

[0068] Furthermore, considering the physical laws governing actual power system operation, the category matching degree calculated in this application is not merely a mathematical statistical value, but rather an engineering indicator that highly aligns with the safety and stability characteristics of the power grid. In actual power grids, changes in operating conditions are continuous and smooth; operating states with similar electrical parameters typically exhibit consistent safety performance when encountering the same fault. When most neighboring samples of the operating condition to be judged belong to the same safety category, it indicates that the overall operating state within that region is at a similar level of stability, and the operating condition to be judged naturally has a very high probability of belonging to the same category.

[0069] like Figure 3 As shown, the engineering significance of the reliability index can be further explained by combining it with the basic physical laws of power system operation. Figure 3 Sample X of the working condition to be determined p The dashed circle delineates the neighborhood around the center. Multiple sample points X with similar electrical characteristics are distributed within the neighborhood. q1 X q2 To facilitate understanding, let's first explain the physical concepts involved: The operating state of a power system can be mapped to a high-dimensional feature space through electrical parameters. All state points that can maintain stable operation together constitute a continuous "safety region." The boundary of the safety region is the dividing line between stable and unstable operating states. The normal vector K of the safety region boundary is perpendicular to this boundary, pointing from the safe region to the unsafe region. Moving along this direction, the stability of the system will gradually decrease. Stability margin. It is an indicator that measures how close the system's current operating state is to the boundary of the security domain. This indicates that the state is within the safe domain and the system is stable. The larger the value, the farther it is from the boundary, and the stronger the stability; conversely, the smaller the value, the closer it is to an unstable state. (See diagram.) X represents the sample of the working condition to be judged. p stability margin Represents neighborhood sample X q1 stability margin Represents neighborhood sample X q2 The stability margin. Based on the continuous nature of the safety region, when the system's operating state changes along the direction perpendicular to the safety region boundary normal vector K, the change trend of the stability margin is also continuous and gradual, without abrupt changes. Therefore, when sample points X on both sides of the perpendicular direction within the neighborhood K... q1 and X q2 All satisfy the stability margin being greater than zero (i.e.) and When X is located between the two, the sample to be judged is X. p It will also necessarily satisfy It can be directly determined to be in a safe state.

[0070] Therefore, the category matching degree determined in this application not only reflects the degree of clustering of sample categories within the neighborhood from a data perspective, but also reflects the overall safety level of the local area where the operating condition to be judged is located from a physical perspective. This is equivalent to using the stable performance of known surrounding operating conditions to corroborate the rationality of the current judgment result. In this way, the category matching degree organically combines mathematical statistics with the physical characteristics of the power system, making credibility evaluation no longer a simple numerical calculation, but a reasonable verification method with clear engineering significance and conforming to the actual operating rules of the power grid. This effectively avoids isolated misjudgments caused by limitations in sample distribution and generalization ability of intelligent models, improving the reliability and interpretability of safety judgment results.

[0071] Step 230: Determine the relative clustering degree of the working condition sample to be judged based on the degree of clustering of electrical characteristics between the sample to be judged and each neighboring sample within the neighborhood range.

[0072] Category matching degree can only reflect the local consistency of the initial discrimination results from the perspective of safety category distribution, and cannot reflect the density of the distribution of the samples of the operating conditions to be discriminated in the electrical feature space. However, in the actual operation scenario of the power system, the denser the sample distribution, the more continuous the changes in operating conditions and the more sufficient the reference basis, and the higher the reliability of the discrimination result. The sparser the sample distribution, the more discrete the changes in operating conditions and the weaker the reference basis, and the lower the reliability of the discrimination result. Therefore, this application further introduces relative clustering degree to quantify the density of the samples of the operating conditions to be discriminated in the neighborhood, providing support for the reliability evaluation from the perspective of sample spatial distribution.

[0073] The relative clustering degree is obtained through layer-by-layer calculation. First, the clustering degree of electrical features is constrained to eliminate the interference of excessively small differences in the calculation results, ensuring the stability and reliability of the local clustering degree calculation. Then, based on the constrained clustering degree of electrical features, the local clustering degree of the sample under test is obtained. Finally, the local clustering degree is compared with the overall clustering degree of other samples in the neighborhood to obtain the relative clustering degree that objectively reflects the density of the sample distribution. The specific implementation steps are as follows:

[0074] Step 410: Based on the neighborhood radius, impose a lower limit constraint on the degree of electrical feature aggregation between the sample of the working condition to be judged and each neighboring sample, and obtain the constrained degree of electrical feature aggregation between the sample of the working condition to be judged and each neighboring sample.

[0075] When calculating the local clustering degree of the samples of the operating condition to be judged, directly using the original electrical feature clustering degree will encounter two types of problems. On the one hand, in the historical samples generated by simulation, there may be some operating condition samples whose electrical parameters highly overlap with those of the samples of the operating condition to be judged, with almost no difference. These samples are essentially repetitive or highly redundant data, not independent operating conditions in the power grid, but only approximate samples generated by small fluctuations in power parameters during the simulation, and have limited reference value. On the other hand, these samples with extremely small differences will significantly lower the overall average distance, causing the clustering degree calculation results to be misled by individual nearby points, mistakenly believing that the samples around the sample of the operating condition to be judged are densely distributed, thus overestimating the reliability of the judgment result, failing to truly reflect the actual distribution state of the operating condition in the feature space, and ultimately causing the reliability index to lose its objective evaluation significance. To avoid the above problems and ensure that the clustering degree calculation results can truly reflect the actual distribution of the samples, while eliminating the interference of redundant samples and abnormal nearby points on the density feature calculation, this step uses the neighborhood radius determined in step 210 as the benchmark to perform a unified lower limit constraint on the electrical feature clustering degree between the sample to be judged and each neighboring sample.

[0076] In practice, the original electrical feature aggregation degree and the size of the neighborhood radius are compared between the sample of the operating condition to be judged and any sample in the neighborhood. The degree of electrical feature aggregation after constraints is determined as follows: In the formula, Sample X of the working condition to be judged p With neighborhood sample X o The degree of electrical feature aggregation after constraints between them The neighborhood radius determined in step 210 is the k-th nearest neighbor distance of the sample to be judged. Sample X of the working condition to be judged p With neighborhood sample X o The degree of aggregation of the original electrical characteristics between them The calculation is performed to obtain the maximum value. The execution logic of this formula is as follows: when the original electrical characteristics are concentrated... smaller than the neighborhood radius If the neighboring sample is too close to the sample of the operating condition to be judged, their electrical characteristics are highly similar, and they belong to redundant samples within a local range. Their contribution to characterizing the overall distribution density is extremely low. In this case, the neighborhood radius is used. Instead of the original difference value, a uniform lower limit is set for the near-point distance to prevent it from excessively lowering the overall average level and causing artificially high density. When the original electrical characteristics are clustered... Greater than or equal to the neighborhood radius If the distance between the neighboring samples and the samples of the operating condition to be judged is moderate, it can objectively reflect the true electrical distribution relationship between the samples and effectively reflect the density characteristics of the operating conditions in the local area. In this case, the original electrical feature aggregation value is directly retained. This is to reflect its true impact on the calculation of the degree of clustering.

[0077] The constrained electrical feature clustering degree obtained through the above method not only preserves the real influence of distant samples on the local distribution and ensures that the relative distance between operating conditions is not destroyed, but also eliminates the interference of redundant samples that are too close and abnormally close points on the clustering degree calculation, avoiding the problems of inflated density and distorted distribution. It can accurately reflect the actual density and distribution pattern of the operating condition samples to be judged in the electrical feature space.

[0078] Step 420: Determine the local clustering degree of the samples to be judged based on the number of samples in the neighborhood and the statistical value of the degree of clustering of electrical features after constraints between the sample to be judged and all neighborhood samples.

[0079] The distance between two samples only reflects the electrical proximity between the sample of the operating condition to be judged and a certain neighboring sample, and cannot fully reflect the overall distribution of the area where the sample of the operating condition to be judged is located. The distribution of operating condition samples in a local area is often uneven, with some samples being close and others being far apart. Relying on individual distance values ​​alone cannot characterize the degree of dispersion of this distribution, nor can it reflect the influence of the number of samples on the distribution density, let alone comprehensively reflect the overall distribution characteristics of all samples in that local area. Only by incorporating the constrained electrical feature clustering degree of all samples in the neighborhood into a unified calculation, and by using a comprehensive index that simultaneously reflects the number of samples and the overall electrical distance, can the local density of the sample of the operating condition to be judged in the electrical feature space be fully characterized. The higher the local clustering degree, the denser and more continuous the distribution of operating condition samples around the sample of the operating condition to be judged, and the more sufficient the support for subsequent credibility evaluation. The lower the local clustering degree, the sparser the distribution of surrounding samples, the more discrete the operating condition changes, and the higher the uncertainty of the credibility evaluation.

[0080] In specific implementation, firstly, the degree of clustering of constrained electrical features between the sample of the working condition to be judged obtained in step 410 and all samples in the neighborhood is summed to obtain a statistical value of the degree of clustering of constrained electrical features. Then, this value is combined with the total number of samples in the neighborhood, i.e.: In the formula, Sample X of the working condition to be judged p The degree of local aggregation, For the neighborhood The total number of neighborhood samples within. Sample X of the working condition to be judged pThe statistical value of the degree of clustering of electrical features after constraints with all neighboring samples within the neighborhood. This refers to the degree of clustering of constrained electrical features between the sample of the working condition to be judged and its neighboring samples, obtained in step 410. The degree of local clustering is essentially the reciprocal of the average constraint distance within the neighborhood. A smaller statistical value indicates that the overall electrical distance between the sample of the working condition to be judged and its surrounding samples is closer, the working condition distribution is denser, and the value of the local clustering is higher. Conversely, a larger statistical value indicates that the overall electrical distance is farther, the working condition distribution is sparser, and the value of the local clustering is lower. By incorporating the number of samples into the calculation, this indicator can simultaneously reflect the richness and compactness of the samples within the neighborhood, avoiding the bias caused by relying solely on the average distance.

[0081] From the perspective of actual power system operation characteristics, the degree of local clustering is highly correlated with the continuity and stability of power grid operating conditions. In a real power grid, changes in operating conditions are continuous and smooth. Regions with dense sample distribution correspond to areas where electrical parameters such as generator output, load level, node voltage, and line power flow change gradually, indicating that the operating mode in that range is mature, the transition of operating conditions is natural, and there are sufficient similar samples. The safety judgment results obtained based on such regions have sufficient historical data support and are more reliable. Conversely, regions with sparse sample distribution usually correspond to special scenarios such as heavy load, light load, and boundary operation of the power grid. The operating conditions change drastically, the data samples are limited, and there is insufficient similar reference, making the safety judgment results more prone to fluctuations and deviations. Therefore, the degree of local clustering calculated in this step is a key indicator reflecting the continuity, data support sufficiency, and reliability of reference in the operating range where the operating condition to be judged is located.

[0082] Step 430: Determine the average local clustering degree of each neighborhood sample within the neighborhood range as the overall clustering degree of the neighborhood range.

[0083] Using the same calculation rules and constraints as in step 420, for each neighborhood sample within the neighborhood range, the constrained electrical feature clustering degree is calculated, centered on that sample and constrained by the same neighborhood radius. Combining the number of samples within the neighborhood range with the statistical value of the constrained electrical feature clustering degree, the local clustering degree of that neighborhood sample is obtained. The local clustering degrees of all neighborhood samples within the neighborhood range are summed and divided by the total number of neighborhood samples to obtain the arithmetic mean of the local clustering degrees of all neighborhood samples. This average value is used as the overall clustering degree of the neighborhood range. The overall clustering degree determined in this way can objectively reflect the average density level of sample distribution within the entire neighborhood area, avoiding the influence of abnormal fluctuations in a single local clustering degree on the judgment of relative relationships.

[0084] Step 440: Determine the relative degree of clustering of the samples under the to be judged based on the ratio of the local degree of clustering to the overall degree of clustering.

[0085] Relying solely on the local clustering degree of the sample under test cannot comprehensively and objectively reflect its true distribution position in the feature space. Local clustering degree only reflects the sample density around itself, failing to provide a horizontal comparison with the density of other samples in the neighborhood. It's difficult to distinguish whether the sample is in an overall uniformly dense region, an overall sparse region, or an isolated location with local anomalies. In actual power system operation scenarios, the distribution density of operating condition samples exhibits overall coherence and correlation. Only through relative comparison can the relative position and clustering characteristics of the sample under test within the overall neighborhood structure be accurately determined. This avoids misjudgments due to locally high or low values, making density-related evaluation more aligned with the physical laws of continuous and overall coordinated changes in power grid operating conditions. Therefore, this step introduces relative clustering degree. By comparing the local clustering degree of the sample under test with the overall clustering degree of all neighboring samples, a quantitative index reflecting the relative density level is obtained.

[0086] The ratio of the local clustering degree to the overall clustering degree of the samples under the different operating conditions is calculated. , Sample X of the working condition to be judged p The relative degree of aggregation To determine the degree of local clustering in the samples of the working conditions to be judged, For any neighborhood sample X within the neighborhood... o The corresponding degree of local aggregation, This represents the total number of neighborhood samples within the neighborhood range. The relative clustering degree is the sum of the local clustering degrees of all neighboring samples within the neighborhood. Essentially, it's the ratio of the local clustering degree of the sample to be judged to the average local clustering degree of all neighboring samples within the neighborhood, reflecting the density of the sample relative to its surroundings. When the relative clustering degree is close to 1, it indicates that the local clustering degree of the sample to be judged is basically consistent with the overall neighborhood level, indicating a uniform and continuous sample distribution. When the relative clustering degree is greater than 1, it indicates that the sample to be judged is located in a more densely populated area than its surroundings, belonging to a region with sufficient data support and abundant reference data. When the relative clustering degree is less than 1, it indicates that the sample to be judged is significantly sparser than its surroundings, belonging to isolated points or marginal points, with weak data support.

[0087] Further analysis, combined with the operating characteristics of the power system, reveals that relative clustering directly reflects the operating location and data support strength of the condition to be judged within the actual power grid. Within the normal operating range of the power grid, there are many similar operating modes and a sufficient number of samples, resulting in a relatively uniform overall clustering degree in the neighborhood. The relative clustering degree typically remains within a reasonable range of around 1, indicating that the operating condition is in a stable, continuous, and reliable operating range, and the safety judgment result is highly reliable. However, under special scenarios such as heavy grid load, extreme faults, boundary operations, and sudden mode changes, the number of samples is small and their distribution is scattered, resulting in a lower overall clustering degree in the neighborhood. The relative clustering degree of the samples for the operating condition to be judged will also be significantly less than 1, indicating a lack of sufficient similar samples to support the condition, and the safety judgment result has high uncertainty. By using relative comparison, the actual operating environment of the operating condition can be effectively distinguished, avoiding evaluation bias caused by relying solely on absolute clustering degree, and making density judgment more consistent with the global distribution pattern of the power system.

[0088] It should be noted that in actual power system operating data, some routine operating conditions may exhibit a large number of highly similar or even duplicated samples in local areas due to simulation generation or historical sampling. This results in a relative clustering degree of the samples for the operating condition to be judged being much higher than the average level of the neighborhood. Such excessively high clustering values ​​do not reflect differences in the physical safety level of the operating condition; they are merely statistical results caused by abnormal data distribution. Without correction, excessively high clustering will overemphasize the credibility of the operating condition in subsequent credibility index calculations, leading to overly optimistic safety judgments and even masking potential misjudgment risks inherent in the model itself. Furthermore, the uncorrected relative clustering value range is not fixed and may exceed 1. Directly using this value for credibility calculations will result in results exceeding a reasonable range, hindering subsequent unified evaluation and comparison.

[0089] To avoid the aforementioned problems and ensure that the relative clustering degree plays a reasonable regulatory role in credibility evaluation, this application sets an effective clustering threshold as a threshold for judging whether the clustering degree is within a reasonable range. When the calculated relative clustering degree is greater than or equal to this threshold, it indicates that the sample density in the region where the sample of the working condition to be judged is located has reached an acceptable stable level. Further increases in the value will no longer provide more effective credibility information. At this point, it is corrected to a preset value to unify the evaluation criteria and avoid artificially inflated credibility. The specific correction method is as follows: In the formula, The corrected relative clustering degree is shown below. In this embodiment, the effective clustering threshold is 0.8. When the original relative clustering degree is greater than or equal to 0.8, it indicates that the density of sample points near the operating condition is within an acceptable range, and it is corrected to the preset value of 1. When the original relative clustering degree is less than 0.8, it indicates that the density of sample points near the operating condition is too low, and the original calculation result is directly retained. Through this correction method, all operating conditions at an acceptable density level can be unified to the preset value of 1, eliminating the problem of inflated credibility caused by abnormal data distribution, making the credibility comparison between different operating conditions fairer and more stable. On the other hand, controlling the range of the corrected relative clustering degree within the [0,1] interval, which is consistent with the range of subsequent credibility index calculations, ensures that the final credibility index is within a reasonable range, avoids outliers exceeding the range, and provides a comparable quantitative basis for the power system safety judgment results.

[0090] As shown above, the category matching degree, from the perspective of safety category consistency, reflects the degree of support of the initial discrimination result in similar operating conditions in the neighborhood. The relative clustering degree, from the perspective of sample distribution density, reflects the sufficiency of data support and the continuity of operating conditions in the area where the sample of the operating condition to be discriminated is located. Both provide quantitative basis for the reliability of the initial discrimination result from the two dimensions of category matching degree and distribution rationality, respectively. Based on the accuracy and computational efficiency requirements of actual power safety discrimination scenarios, this application provides three independent implementation methods, allowing for flexible selection of combinations of category matching degree and relative clustering degree to adapt to the safety discrimination needs under different operating scenarios.

[0091] In the first implementation, the credibility index is determined solely based on the category matching degree. This method is suitable for power safety discrimination scenarios that emphasize the consistency of safety categories and have high computational efficiency requirements. Specifically, the category matching degree calculated in step 220 is directly used as the credibility index for the sample of the operating condition to be judged. The category matching degree directly reflects the proportion of samples of the same type as the initial discrimination result within the neighborhood. A higher proportion indicates that the initial discrimination result is more consistent with the safety characteristics of the surrounding operating conditions, conforming to the physical law of continuous change in the dynamic security domain of the power system. This simplifies the calculation process of the credibility index and reduces computational overhead in online applications while ensuring the objectivity of the evaluation. For example, this implementation is suitable for the online safety verification system of a provincial power grid control center. This system needs to complete a full-network power flow scan and safety assessment every few minutes, processing hundreds of operating condition points simultaneously, with extremely high requirements for computational latency and throughput. It can also be used for batch evaluation of the operating status of distributed photovoltaic clusters in distribution network areas. In such scenarios, the operating condition samples change gradually and are evenly distributed. The consistency of safety categories itself has high reference value, and a credibility conclusion can be quickly given using only the category matching degree, without the need for additional density calculation overhead.

[0092] In the second implementation, the reliability index is determined solely based on the relative clustering degree. This approach is suitable for power safety judgment scenarios that emphasize the rationality of sample distribution and focus on the sparsity and isolation of operating conditions. Specifically, the relative clustering degree calculated and corrected in step 430 is directly used as the reliability index for the operating condition sample to be judged. The relative clustering degree directly reflects whether the operating condition to be judged is in a reliable region with dense samples and sufficient data support, or in a boundary region with sparse samples and insufficient reference data. In power systems, dense sample regions correspond to smooth operating condition changes and mature operating modes, resulting in more reliable judgment results. Sparse sample regions often correspond to scenarios such as heavy loads, boundaries, and sudden changes in operating modes, leading to higher uncertainty in judgment. Therefore, directly using the relative clustering degree can effectively identify weakly supported operating conditions and reduce the risk of misjudgment in safety judgment. This implementation method can be used in boundary condition analysis scenarios in power grid operation mode research, such as the assessment of the ultimate transmission capacity of UHVDC feeds into the receiving-end power grid and the verification of extreme operation modes of power systems with a high proportion of renewable energy. In such scenarios, the operating condition to be identified is itself in the marginal region of the sample distribution, similar operating condition data is scarce, and the reference value of the consistency of safety categories is limited. However, the relative clustering degree can directly reflect the data support strength of the operating condition, providing a basis for risk warning. It can also be used for extreme disturbance operating conditions in post-fault transient stability assessment. Such operating conditions account for a very low proportion in historical samples and are typical isolated points. Their low reliability characteristics can be quickly identified simply by the relative clustering degree, avoiding misjudgment.

[0093] In the third implementation, the reliability index is determined jointly based on the category matching degree and the relative clustering degree. This method is suitable for high-reliability power safety discrimination scenarios that require high discrimination accuracy and need to balance category consistency and distribution rationality. Specifically, the category matching degree and the modified relative clustering degree are integrated, i.e. By combining the advantages of both types of indicators, a more comprehensive and stable credibility index is obtained. Category matching degree ensures local consistency of the initial judgment results in terms of safety category. Relative clustering degree ensures that the operating conditions to be judged have sufficient data support and continuous operating condition changes. The combination of the two provides dual protection for consistency screening and rationality verification. When the category matching degree or relative clustering degree is low, the credibility index will decrease accordingly, avoiding distortion of the credibility evaluation due to the failure of a single indicator. This method fully combines the physical characteristics of the dynamic security domain of the power system and the spatial distribution law of the sample, making the credibility index more accurate. This implementation method can be used in offline safety and stability analysis scenarios of large interconnected power grids, such as annual operation mode verification and large power grid cascading fault risk assessment. In such scenarios, the accuracy and interpretability of the judgment results are extremely high, requiring simultaneous verification of the category consistency and data support strength of the operating conditions. It can also be used for medium- and long-term safety assessments after the grid connection of new energy sources. In such scenarios, some operating conditions are in transitional areas with sparse sample distribution, and relying solely on a single indicator is prone to misjudgment. Joint evaluation can simultaneously verify the category consistency and distribution rationality, providing more comprehensive support for operational decisions.

[0094] Through the above three implementation methods, this application can flexibly adapt to the power safety discrimination requirements of different accuracies, different efficiencies, and different scenarios, ensuring both the adaptability of the reliability index calculation and that all implementation methods conform to the actual operation law of the power grid.

[0095] Step 130: Use the credibility index and the initial discrimination result as the final discrimination result for the sample of working conditions to be discriminated.

[0096] After calculating the initial discrimination result and the reliability index, the two are combined and output to form the final discrimination result for the sample of operating conditions to be judged. The initial discrimination result clarifies the safety category of the operating condition, directly answering whether the current operating state is safe, and providing a clear classification conclusion for power grid dispatching and operation control. The reliability index quantifies the reliability of this classification conclusion, verifying whether the initial discrimination result has sufficient reference basis and data support from the dual perspectives of category consistency and sample distribution rationality, reflecting the distribution status and local consistency level of the current operating condition in the feature space. Incorporating both into the final discrimination result simultaneously provides decision-makers with the reliability of the judgment result while giving a safety category determination, making up for the shortcomings of traditional intelligent discrimination that only outputs classification conclusions and lacks reliability explanations.

[0097] In practical power system applications, the final discrimination result can be directly used for safety verification, risk warning, and operation mode optimization. When the credibility index is higher than the set threshold, the initial discrimination result has high reference value and can be directly used as the basis for dispatching decisions. When the credibility index is lower than the threshold, it indicates that the current operating condition is in a sparse sample region or an inconsistent neighboring category state, and the initial discrimination result has uncertainty, requiring further verification through time-domain simulation and other methods. In this way, the final discrimination result simultaneously includes the classification conclusion and the credibility level.

[0098] In practical engineering applications, situations may arise where the electrical operating state corresponding to the sample of the operating condition to be judged is outside the feature coverage of the power system sample set. The electrical parameter combinations and operating modes of such operating conditions differ significantly from the existing data in the sample set, making it difficult to select similar samples with reference value within the neighborhood. This results in a lack of effective data support for calculating the category matching degree and relative clustering degree, and the credibility index cannot accurately reflect the true reliability of the initial judgment result. To address the problem of decreased judgment reliability caused by insufficient sample set coverage, this application, in addition to completing the basic judgment process, further expands and optimizes the power system sample set. Through boundary extension and sample supplementation, it improves the ability to adapt to the judgment of unknown and boundary operating conditions. The specific implementation method is as follows:

[0099] In one implementation, when the operating condition sample to be judged is outside the coverage area of ​​the power system sample set, after constructing the power system sample set, the characteristic change trend of the power system sample set is determined based on the distribution pattern and sample density of the power system sample set; in the region outside the boundary where the operating condition sample to be judged is located, multiple supplementary operating condition samples are generated according to the characteristic change trend of the power system sample set; fault simulation and stability judgment are performed on each supplementary operating condition sample, and a safety category label is marked for the supplementary operating condition sample; the labeled supplementary operating condition samples are merged with the power system sample set to form an expanded power system sample set.

[0100] Specifically, to further improve the applicability of the power safety discrimination method in complex scenarios and avoid insufficient discrimination reliability due to the operating conditions to be discriminated exceeding the coverage of the original samples, this application, after constructing the basic power system sample set, continues to expand and improve the coverage of the sample set. The entire expansion process relies on the distribution pattern of the sample set itself. While ensuring that the newly added operating conditions conform to the physical laws of power grid operation, it fills in the sample gaps in the boundary and extension regions, thereby providing more sufficient data support for subsequent neighborhood construction, category matching degree calculation, and relative clustering degree calculation.

[0101] Before expansion begins, it is essential to accurately grasp the overall variation patterns of the original power system sample set. This is the foundation for the reasonable generation of all subsequent supplementary samples. Specifically, based on the operating state characteristics of each operating condition sample in the power system sample set, determine the magnitude and direction of characteristic changes between adjacent operating condition samples; based on the magnitude and direction of characteristic changes, determine the overall characteristic variation pattern of the power system sample set in the feature space; and based on the overall characteristic variation pattern, determine the characteristic variation trend of the power system sample set boundary along the outward expansion direction.

[0102] In the implementation process, the analysis first focuses on all operating condition samples in the power system sample set. The common operating state characteristics included in each sample are extracted, such as node injected active power, node injected reactive power, node voltage amplitude, line active power flow, line reactive power flow, total generator output power, and total load active power—parameters that comprehensively characterize the power grid's operating state. To accurately grasp the continuous changing relationships between samples, the samples are sorted according to their electrical similarity or similarity in operating mode. Each group of adjacent operating condition samples is then selected, and the numerical difference between them on the same feature dimension is calculated. The absolute value of this numerical difference represents the characteristic change amplitude of the adjacent operating condition samples on the current feature dimension. The sign of the numerical difference indicates the direction of feature change: a positive sign indicates an upward trend, and a negative sign indicates a downward trend. By performing the above calculation on all adjacent samples, the characteristic change amplitude and direction at all local locations in the sample set can be obtained. For example, the total active power of the load in a certain adjacent working condition sample is 1000MW and 1050MW respectively, with a characteristic change amplitude of 50MW and an increasing characteristic change direction; the corresponding critical node voltage amplitude changes from 1.02pu to 1.01pu, with a characteristic change amplitude of 0.01pu and a decreasing characteristic change direction. From this, the characteristic cooperative change relationship of local location can be obtained.

[0103] After acquiring the characteristic change amplitude and direction of all adjacent operating condition samples, all local change relationships are summarized. Abnormal abrupt changes caused by simulation fluctuations and sampling errors are removed, and the most frequent and stable change relationships are retained to form the overall characteristic variation law of the power system sample set in the feature space. This overall characteristic variation law is not an independent change of a single feature, but a stable relationship of mutual constraints and coordinated changes among multiple operating state features. It reflects the fixed matching relationship between parameters such as load level rise and fall, generator output adjustment, voltage level fluctuation, and power flow distribution changes, fully conforming to the physical operating laws of power system power balance, voltage stability, and power flow constraints. This law covers the entire sample set and reflects the continuous change logic from light load to heavy load and from normal operation to near-limit operation.

[0104] After determining the overall characteristic variation law, the boundary position of the power system sample set in the multi-dimensional feature space is further located. The boundary position is composed of the maximum and minimum value samples of each operating state feature. Taking the operating condition samples at the boundary as the benchmark, and combining the feature change amplitude and direction contained in the overall characteristic variation law, the coordinated change relationship between each feature remains unchanged. Along the direction of outward extension of the sample set coverage, the uniform change amplitude and direction continue, thereby determining the feature change trend of the power system sample set boundary along the outward expansion direction. This trend is completely consistent with the overall variation law within the sample set, and there will be no parameter abrupt changes, logical contradictions, or violations of the power grid operating characteristics. This ensures that the supplementary operating condition samples generated subsequently along this outward expansion trend have engineering rationality, electrical continuity, and operational feasibility.

[0105] After determining the characteristic variation trend of the power system sample set boundary along the outward expansion direction, supplementary operating condition samples are generated in an orderly manner according to this trend in the region outside the boundary where the operating condition sample to be judged is located. Specifically, during generation, the boundary sample of the original sample set in the feature space is first located, and this boundary sample is used as the starting point sample for outward expansion. The current values ​​of each operating state feature in this starting point sample are read, including key features such as node injected active power, node injected reactive power, node voltage amplitude, line active power flow, total generator active power output, and total system load power. Subsequently, according to the determined characteristic variation trend along the outward expansion direction, while maintaining the fixed change ratio and constraint relationship between each feature, the feature values ​​of the starting point sample are updated synchronously using the feature change amplitude between adjacent samples as the single-step adjustment amount. For example, if the overall trend is that for every 50MW increase in total system load, total generator output increases by 50MW simultaneously, and the voltage amplitude at critical nodes decreases by 0.01pu simultaneously, then when generating the first supplementary sample, the load value of the boundary sample is increased by 50MW, the generator output increases by 50MW simultaneously, the node voltage amplitude decreases by 0.01pu, and other relevant characteristics are adjusted synchronously according to predetermined constraints, resulting in the first set of expanded supplementary samples. Based on this, the newly generated supplementary samples are used as new benchmarks, and the above synchronous adjustment steps are repeated, ensuring that the magnitude and direction of change in each adjustment are completely consistent with the constraint relationship, thus generating the second, third, and even more supplementary operating condition samples in sequence, until the boundary outer region where the operating condition sample to be judged is located is covered.

[0106] After generating supplementary operating condition samples, fault simulation and stability assessment are performed on each set of supplementary operating condition samples one by one, and safety category labels are assigned to the supplementary samples according to the same standard as the original samples. In specific implementation, the simulated power grid model, fault set configuration, and stability judgment criteria used to construct the original power system sample set are adopted. The fault set includes typical power grid faults such as three-phase short circuit, single-phase grounding, and line disconnection. For the operating state corresponding to each supplementary operating condition sample, various faults in the fault set are applied sequentially. The dynamic process of fault occurrence, fault persistence, and fault clearing is fully reproduced through time-domain simulation. During the simulation, stability indicators such as generator rotor relative power angle, key node voltage amplitude, and system frequency are continuously monitored. If all indicators remain within the allowable range, the generator power angle does not diverge, the node voltage can be effectively recovered, and the system frequency is maintained within the rated fluctuation range, then the supplementary operating condition sample is determined to be in the safe category. If there is a situation where the power angle continues to diverge, the voltage drops severely, or the system frequency exceeds the limit, indicating unstable operation, then it is determined to be in the unsafe category. This process completes the safety category labeling of all supplementary operating condition samples.

[0107] Finally, all supplementary operating condition samples that have completed fault simulation and identification and are labeled with safety categories are integrated with the original power system sample set. The data format, feature dimensions, and labeling system of the samples are unified, duplicate samples are removed, and the data structure is standardized to form an expanded power system sample set. Through this process, the sample gaps in the boundary regions and extension intervals of the original sample set are effectively filled. Even if the operating condition sample to be identified is outside the original coverage area, sufficient and effective similar samples can be screened within the neighborhood.

[0108] In the actual construction and expansion of the sample set, due to factors such as the convergence of time-domain simulation, the ambiguity of fault discrimination boundaries, and fluctuations in parameter sampling, the safety category labels of some operating condition samples may exhibit labeling deviations. These abnormally labeled samples directly affect the training effect of the power safety discrimination model and lead to calculation deviations in key indicators such as neighborhood category matching degree and relative clustering degree, thereby reducing the reliability indicators and the accuracy of the final discrimination results. To further improve the overall quality of the power system sample set and eliminate the adverse effects of incorrectly labeled samples, this application further introduces an abnormal sample detection and label correction mechanism. Based on the relative clustering degree, it achieves automatic identification, verification, and correction of incorrectly labeled samples, ensuring the reliability of sample data and the stability of the discrimination process from the source. The specific implementation method is as follows.

[0109] In one implementation, after constructing a power system sample set, the local anomaly factor corresponding to each operating condition sample is calculated based on the relative aggregation degree of each operating condition sample in the power system sample set; operating condition samples with local anomaly factors greater than a preset anomaly threshold are identified as suspected mislabeled samples; the suspected mislabeled samples are classified into safety categories using a power safety discrimination model to obtain corrected safety category labels for the suspected mislabeled samples, and the confidence index of the suspected mislabeled samples is determined; if the confidence index is greater than a confidence threshold, the corrected safety category label is used as the final safety category label for the suspected mislabeled samples.

[0110] Specifically, this application proposes a quantitative indicator called the local anomaly factor, which reflects the degree of distribution deviation and label anomaly risk of a certain operating condition sample in a multi-dimensional electrical feature space compared to its surrounding neighboring samples. Its value is determined by the relative clustering degree of the current operating condition sample itself. In the specific calculation of the local anomaly factor, it is first necessary to iterate through all operating condition samples in the power system sample set. For each operating condition sample for which the local anomaly factor needs to be calculated, there is no need to re-perform complex feature extraction and calculation; instead, the relative clustering degree value, which has been determined and preserved in the previous steps, is directly retrieved. Based on this, according to the negative correlation mapping rule defined in this application, the retrieved relative clustering degree is numerically transformed to obtain the local anomaly factor corresponding to the current operating condition sample. The logic of the negative correlation mapping rule in this application is that the higher the relative clustering degree of a sample, the smaller its corresponding local anomaly factor value; the lower the relative clustering degree of a sample, the larger its corresponding local anomaly factor value, showing a negative correlation between the two.

[0111] Specifically, when calculating the local anomaly factor, the relative clustering degree of all working condition samples is first normalized, adjusting its value range to a uniform range of 0-1 (i.e., the normalized relative clustering degree value ∈ [0,1]). This step aims to eliminate numerical differences in the relative clustering degree between different samples, ensuring the uniformity and comparability of subsequent calculations. Subsequently, according to the negative correlation mapping rule defined in this application, the local anomaly factor is calculated using the formula "local anomaly factor = 1 - normalized relative clustering degree". For example, if the relative clustering degree of a certain working condition sample is high, and its value after normalization is 0.9 (close to 1), then according to the above mapping rule, the local anomaly factor of this sample = 1 - 0.9 = 0.1. The small value indicates that the sample is densely distributed, highly consistent with surrounding samples, and belongs to normal samples with no risk of label anomalies. If the relative clustering of another working condition sample is low, and the normalized value is 0.1 (close to 0), then its local anomaly factor = 1 - 0.1 = 0.9, which is a large value. This indicates that the sample is sparsely distributed and differs greatly from the surrounding samples, indicating a high risk of label anomalies, which requires further verification.

[0112] After obtaining the local anomaly factors of all operating condition samples in the sample set, a preset anomaly threshold is set based on the overall distribution of the sample set, the number of samples, and the actual engineering requirements. This threshold serves as a quantitative critical value for determining whether a sample has an abnormal label. The local anomaly factor of each operating condition sample is compared with the preset anomaly threshold one by one. When the local anomaly factor of a sample is greater than the preset anomaly threshold, it indicates that the sample significantly deviates from the overall distribution pattern in the electrical feature space, conflicts with other samples with similar electrical features in the neighborhood in terms of safety category labeling, cannot be explained by normal operating rules, and has a high probability of labeling error. In this case, the sample is explicitly identified as a suspected mislabeled sample.

[0113] After identifying a suspected mislabeled sample, its original label is no longer used. Instead, a power safety discrimination model trained on high-quality samples is employed to re-classify the sample's safety category, and the model's output is used as the corrected safety category label. Simultaneously, following the complete process described above, the sample undergoes a re-execution of steps such as neighborhood delineation, category matching degree calculation, and relative clustering degree calculation. This process ultimately yields a credibility index corresponding to the corrected label, which objectively reflects the reliability, data support strength, and overall rationality of the correction result.

[0114] After obtaining the confidence index, it is compared with a pre-set confidence threshold. When the confidence index is greater than the confidence threshold, it indicates that the corrected safety category label has sufficient data support, high consistency, and strong rationality, and can truly reflect the actual safety status of the working condition sample. In this case, the corrected safety category label is used as the final safety category label for the suspected mislabeled sample, completing the automatic correction of the abnormal sample. If the confidence index is less than or equal to the confidence threshold, it indicates that the sample is highly abnormal and the reliability of the correction result is insufficient. In this case, automatic label replacement is not performed; the sample is simply marked as awaiting manual review to avoid blindly correcting and introducing new labeling errors, further ensuring the overall quality of the sample set.

[0115] Through the entire process of anomaly identification, model re-judgment, credibility verification, and label correction based on the custom local anomaly factor of this application, it is possible to automatically, accurately, and reproducibly locate, verify, and correct erroneously labeled samples in the sample set without relying on extensive manual verification or introducing external subjective judgment. This improves the labeling accuracy, data integrity, and overall reliability of the power system sample set from the source, providing high-quality data support for power safety discrimination model training, neighborhood analysis, credibility calculation, and final discrimination result output.

[0116] To further improve the accuracy and applicability of the power safety discrimination method and ensure the rigor and reliability of the discrimination results, this application optimizes and upgrades the discrimination model based on the corrected sample data. The specific process is as follows: The power safety discrimination model is retrained based on the corrected power system sample set to obtain an updated power safety discrimination model; the sample of the operating condition to be discriminated is subjected to secondary discrimination based on the updated power safety discrimination model to obtain the secondary discrimination result, and the corresponding credibility index is determined; the secondary discrimination result is compared with the initial discrimination result to determine the degree of consistency of the discrimination results; based on the degree of consistency of the discrimination results and the credibility index corresponding to the secondary discrimination, the final safety discrimination conclusion of the sample of the operating condition to be discriminated is determined.

[0117] First, the power safety discrimination model was retrained based on the corrected power system sample set (with complete label calibration and no labeling bias). The corrected sample set contains complete operating condition information, standardized labeling, and accurate distribution data, providing high-quality data support for model training and avoiding training bias caused by the original sample bias. During training, the corrected sample set was used as the sole training data source, without introducing any external irrelevant data, ensuring that the trained power safety discrimination model remained consistent with the previous technical logic. The focus was on optimizing the model's recognition accuracy and label matching degree for operating condition samples. Finally, the model was retrained to obtain the updated power safety discrimination model (i.e., the updated power safety discrimination model). Compared to the initial model, this model has advantages in the discrimination of boundary conditions and sparse samples, and can adapt to more complex operating scenarios.

[0118] Secondly, for the samples of operating conditions to be judged (including samples in boundary regions and sparsely distributed regions), a secondary judgment is performed using the updated power safety judgment model. Specifically, all characteristic parameters of the samples of operating conditions to be judged (including node power, voltage level, power flow distribution, etc.) are input into the updated model, which automatically completes feature matching and risk assessment, outputs the secondary judgment result, and simultaneously calculates the reliability index of the secondary judgment. The obtained secondary judgment result is then comprehensively compared with the result obtained from the initial judgment, and the consistency between the two results is checked one by one to determine the differences and similarities between them, thereby determining the degree of consistency of the judgment results.

[0119] Finally, the final safety judgment conclusion for the sample under test is determined by combining the consistency of the judgment results and the reliability index corresponding to the secondary judgment. Specifically, if the secondary judgment result is consistent with the initial judgment result and the reliability index meets the preset standard, the consistent result is taken as the final safety judgment conclusion. If the secondary judgment result differs from the initial judgment result, and the reliability index of the secondary judgment meets the preset requirements, the secondary judgment result is taken as the final conclusion. If the reliability index of the secondary judgment does not meet the preset standard and the accuracy of the judgment result cannot be clearly determined, the sample is marked as a sample to be reviewed, and further confirmation is carried out through manual verification to ensure the accuracy and reliability of the final safety judgment conclusion, providing strong data support and judgment basis for the safe operation of the power grid.

[0120] It is understood that, in order to achieve the functions in the above embodiments, the computer device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and method steps described in conjunction with the embodiments disclosed in this application, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.

[0121] Furthermore, as a response to the above Figure 1 The implementation of the method embodiment shown in this application provides a power safety discrimination device. The embodiment of this device corresponds to the foregoing method embodiments. For ease of reading, this embodiment will not repeat the details of the foregoing method embodiments one by one, but it should be clear that the device in this embodiment can correspondingly implement all the contents of the foregoing method embodiments. Specifically, as shown... Figure 5 As shown, the power safety discrimination device 500 includes:

[0122] The initial discrimination module 510 is used to acquire samples of operating conditions to be discriminated, and to perform safety category discrimination on the samples of operating conditions to be discriminated using the power safety discrimination model to obtain the initial discrimination result.

[0123] The reliable discrimination module 520 is used to determine the neighborhood range of the operating condition sample to be judged based on the power system sample set. The neighborhood range is used to indicate the sample range formed by samples that meet the preset electrical difference conditions with the operating condition sample to be judged. The electrical difference is used to indicate the difference in electrical operating characteristics between the operating condition sample to be judged and the neighborhood samples. Based on the operating condition attribute information of each neighborhood sample and the operating condition sample to be judged within the neighborhood range, the reliability index of the operating condition sample to be judged is determined. The operating condition attribute information is used to measure the similarity of the operating conditions between each neighborhood sample and the operating condition sample to be judged.

[0124] The final discrimination module 530 is used to use the confidence index and the initial discrimination result as the final discrimination result of the working condition sample to be discriminated.

[0125] Furthermore, such as Figure 5 As shown, the reliable discrimination module 520 is specifically used to determine the neighborhood radius that satisfies the preset sample number constraint based on the electrical differences between the operating condition sample to be discriminated and each operating condition sample in the power system sample set, determine the neighborhood range of the operating condition sample to be discriminated based on the neighborhood radius, and determine all operating condition samples within the neighborhood range as neighborhood samples of the operating condition sample to be discriminated.

[0126] Furthermore, such as Figure 5 As shown, the trusted discrimination module 520 is specifically used to determine the class matching degree of the initial discrimination result in the neighborhood range based on the distribution of the security category label corresponding to the initial discrimination result in the neighborhood range.

[0127] Furthermore, such as Figure 5 As shown, the reliable discrimination module 520 is specifically used to determine the relative aggregation degree of the working condition sample to be judged based on the degree of aggregation of electrical features between the working condition sample to be judged and each neighboring sample within the neighborhood range.

[0128] Furthermore, such as Figure 5 As shown, the reliable discrimination module 520 is specifically used to impose a lower limit constraint on the degree of electrical feature aggregation between the sample to be discriminated and each neighboring sample based on the neighborhood radius, thereby obtaining the constrained degree of electrical feature aggregation between the sample to be discriminated and each neighboring sample; to determine the local aggregation degree of the sample to be discriminated based on the number of samples within the neighborhood and the statistical value of the constrained degree of electrical feature aggregation between the sample to be discriminated and all neighboring samples; to determine the average value of the local aggregation degree of each neighboring sample within the neighborhood as the overall aggregation degree of the neighborhood; and to determine the relative aggregation degree of the sample to be discriminated based on the ratio of the local aggregation degree to the overall aggregation degree.

[0129] Furthermore, such as Figure 5 As shown, the credible discrimination module 520 is also used to correct the relative aggregation degree to a preset value when the relative aggregation degree is greater than or equal to the effective aggregation threshold.

[0130] Furthermore, such as Figure 5As shown, the power safety discrimination device 500 also includes a sample construction module 540, which is used to establish a simulated power grid model based on the power grid topology and electrical operating parameters. In the simulated power grid model, the output power of the generator and the power consumption of the load are set according to a preset power range to form a variety of different power grid operating states. Steady-state operating data corresponding to each power grid operating state are obtained, and the operating state features in the steady-state operating data are extracted as operating condition sample features. A fault set is set, and faults in the fault set are applied to the power grid under each power grid operating state. The time-domain simulation is used to determine whether the power grid can maintain stable operation after the faults are applied. Based on the simulation results, safety category labels are marked for the operating condition sample features to form a power system sample set.

[0131] Furthermore, such as Figure 5 As shown, the sample construction module 540 is also used to determine the characteristic change trend of the power system sample set based on the distribution pattern and sample density of the power system sample set; generate multiple supplementary operating condition samples in the outer region of the boundary where the operating condition sample to be judged is located, according to the characteristic change trend of the power system sample set; perform fault simulation and stability judgment on each supplementary operating condition sample, and label the supplementary operating condition sample with a safety category label; merge the labeled supplementary operating condition samples with the power system sample set to form an expanded power system sample set.

[0132] Furthermore, such as Figure 5 As shown, the sample construction module 540 is also used to calculate the local anomaly factor corresponding to each operating condition sample based on the relative aggregation degree of each operating condition sample in the power system sample set; to determine the operating condition sample whose local anomaly factor is greater than the preset anomaly threshold as a suspected mislabeled sample; to perform safety category discrimination on the suspected mislabeled sample through the power safety discrimination model, to obtain the corrected safety category label of the suspected mislabeled sample, and to determine the confidence index of the suspected mislabeled sample; if the confidence index is greater than the confidence threshold, the corrected safety category label is used as the final safety category label of the suspected mislabeled sample.

[0133] Optionally, the power safety determination device may be an electronic device with data processing capabilities, or a functional module within the electronic device, without limitation.

[0134] For example, the electronic device can be a server, which can be a single server or a server cluster consisting of multiple servers. As another example, the electronic device can be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, and other terminal devices. As yet another example, the electronic device can also be a recording device, video surveillance equipment, etc. This application does not impose any special limitations on the specific form of the electronic device.

[0135] The following example uses an electronic device as an example of a power safety discrimination device. Figure 6 As shown, Figure 6 The hardware structure of an electronic device 600 provided in this application.

[0136] like Figure 6 As shown, the electronic device 600 includes a processor 610, a communication line 620, and a communication interface 630.

[0137] Optionally, the electronic device 600 may also include a memory 640. The processor 610, memory 640, and communication interface 630 can be connected via a communication line 620.

[0138] The processor 610 can be a central processing unit (CPU), a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. The processor 610 can also be any other device with processing capabilities, such as a circuit, device, or software module, without limitation.

[0139] In one example, processor 610 may include one or more CPUs, for example Figure 6 CPU0 and CPU1 in the CPU.

[0140] As an optional implementation, the electronic device 600 may include multiple processors, for example, in addition to processor 610, it may also include processor 670. A communication line 620 is used to transmit information between the components included in the electronic device 600.

[0141] Communication interface 630 is used for communicating with other devices or other communication networks. This other communication network can be Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc. Communication interface 630 can be a module, circuit, transceiver, or any device capable of enabling communication.

[0142] The memory 640 is used to store instructions. These instructions can be computer programs.

[0143] The memory 640 can be a read-only memory (ROM) or other type of static storage device capable of storing static information and / or instructions; it can also be a random access memory (RAM) or other type of dynamic storage device capable of storing information and / or instructions; it can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), disk storage media, or other magnetic storage devices, etc., without limitation.

[0144] It should be noted that the memory 640 can exist independently of the processor 610, or it can be integrated with the processor 610. The memory 640 can be used to store instructions, program code, or some data, etc. The memory 640 can be located inside or outside the electronic device 600, without restriction.

[0145] The processor 610 is configured to execute instructions stored in the memory 640 to implement the communication method provided in the following embodiments of this application. For example, when the electronic device 600 is a terminal or a chip in a terminal, the processor 610 can execute instructions stored in the memory 640 to implement the steps performed by the transmitting end in the following embodiments of this application.

[0146] As an optional implementation, the electronic device 600 also includes an output device 650 and an input device 660. The output device 650 can be a display screen, speaker, or other device capable of outputting data from the electronic device 600 to the user. The input device 660 can be a keyboard, mouse, microphone, joystick, or other device capable of inputting data into the electronic device 600.

[0147] It should be pointed out that, Figure 6 The structure shown does not constitute a limitation on the electronic device, except... Figure 6 In addition to the components shown, the electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0148] The power safety discrimination device and application scenarios described in this application are intended to more clearly illustrate the technical solutions of this application and do not constitute a limitation on the technical solutions provided in this application. As those skilled in the art will know, with the evolution of power safety discrimination devices and the emergence of new business scenarios, the technical solutions provided in this application are also applicable to similar technical problems.

[0149] This application provides a storage medium storing a program that, when executed by a processor, implements the power safety discrimination method.

[0150] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0151] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0152] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A power safety determination method, characterized by, The method includes: Obtain a sample of operating conditions to be judged, and use a power safety discrimination model to judge the safety category of the sample of operating conditions to be judged to obtain an initial discrimination result; The neighborhood range of the operating condition sample to be judged is determined based on the power system sample set. The neighborhood range is used to indicate the sample range formed by samples that meet the preset electrical difference conditions with the operating condition sample to be judged. The electrical difference is used to indicate the difference in electrical operating characteristics between the operating condition sample to be judged and the neighborhood samples. Based on the operating condition attribute information of each neighboring sample and the operating condition sample to be judged within the neighborhood range, a reliability index for the operating condition sample to be judged is determined. The operating condition attribute information is used to measure the similarity between the operating conditions of each neighboring sample and the operating condition sample to be judged. The credibility index and the initial discrimination result are used as the final discrimination result of the sample of working conditions to be discriminated.

2. The method of claim 1, wherein, Determining the neighborhood range of the operating condition sample to be judged based on the power system sample set includes: Based on the electrical differences between the sample of the operating condition to be judged and each sample of the operating condition in the power system sample set, the neighborhood radius that satisfies the preset sample number constraint is determined. The neighborhood range of the working condition sample to be judged is determined based on the neighborhood radius, and all working condition samples within the neighborhood range are determined as neighborhood samples of the working condition sample to be judged.

3. The method of claim 2, wherein, Based on the operating condition attribute information of each neighboring sample and the operating condition sample to be judged within the aforementioned neighborhood range, a reliability index for the operating condition sample to be judged is determined, including: Based on the distribution of the security category labels corresponding to the initial discrimination result within the neighborhood range, the category matching degree of the initial discrimination result within the neighborhood range is determined.

4. The method of claim 2, wherein, Based on the working condition attribute information of each neighboring sample and the working condition sample to be judged within the aforementioned neighborhood range, the reliability index of the working condition sample to be judged is determined, further including: The relative aggregation degree of the operating condition sample to be judged is determined based on the degree of aggregation of electrical characteristics between the sample to be judged and each neighboring sample within the neighborhood range.

5. The method of claim 4, wherein, The relative clustering degree of the operating condition sample to be judged is determined based on the degree of clustering of electrical characteristics between the sample to be judged and each sample in the neighborhood range, including: The electrical feature space distance between the sample to be judged and each neighboring sample is constrained by a lower limit based on the neighborhood radius, thus obtaining the constrained electrical feature space distance between the sample to be judged and each neighboring sample. The degree of local clustering of the samples to be judged is determined based on the number of samples within the neighborhood and the statistical value of the constrained electrical characteristic space distance between the sample to be judged and all neighborhood samples. The average local clustering degree of each neighborhood sample within the neighborhood range is determined as the overall clustering degree of the neighborhood range; The relative degree of aggregation of the samples under the to be judged is determined based on the ratio of the local aggregation degree to the overall aggregation degree.

6. The method of claim 4, wherein, The method further includes: When the relative aggregation degree is greater than or equal to the effective aggregation threshold, the relative aggregation degree is corrected to a preset value.

7. The method according to claims 1-6, characterized by, The method further includes: A simulation power grid model is established based on the power grid topology and electrical operating parameters; In the simulated power grid model, the output power of the generator and the power consumption of the load are set according to a preset power range to form a variety of different power grid operating states; Obtain steady-state operation data corresponding to each power grid operation state, and extract the operation state features from the steady-state operation data as operating condition sample features; A fault set is defined, and faults from the fault set are applied to the power grid under each power grid operating state. Time-domain simulation is used to determine whether the power grid can maintain stable operation after the faults are applied. Based on the simulation results, safety category labels are labeled for the features of the operating condition samples to form a power system sample set.

8. The method of claim 1, wherein, When the sample of the operating condition to be determined is outside the coverage of the power system sample set, after constructing the power system sample set, the method further includes: Based on the distribution pattern and sample density of the power system sample set, the characteristic change trend of the power system sample set is determined; In the region outside the boundary where the sample of the operating condition to be judged is located, multiple supplementary operating condition samples are generated according to the characteristic change trend of the power system sample set. For each supplementary operating condition sample, fault simulation and stability judgment are performed, and a safety category label is marked for the supplementary operating condition sample; The annotated supplementary operating condition samples are merged with the power system sample set to form an expanded power system sample set.

9. The method according to claim 1, characterized in that, After constructing the power system sample set, the method further includes: The local anomaly factor corresponding to each operating condition sample is calculated based on the relative clustering degree of each operating condition sample in the power system sample set; Working condition samples with local anomaly factors exceeding a preset anomaly threshold are identified as suspected mislabeled samples. The power safety discrimination model is used to classify the suspected mislabeled samples into safety categories, and the corrected safety category labels of the suspected mislabeled samples are obtained. The credibility index of the suspected mislabeled samples is then determined. If the confidence index is greater than the confidence threshold, the corrected security category label will be used as the final security category label for the suspected mislabeled sample.

10. A power safety discrimination device, characterized in that, The device includes: The initial discrimination module is used to acquire samples of operating conditions to be discriminated against, and to perform safety category discrimination on the samples of operating conditions to be discriminated against using the power safety discrimination model to obtain the initial discrimination result; A reliable discrimination module is used to determine the neighborhood range of the operating condition sample to be judged based on a power system sample set. The neighborhood range indicates the sample range formed by samples that meet preset electrical difference conditions with the operating condition sample to be judged. The electrical difference indicates the difference in electrical operating characteristics between the operating condition sample to be judged and the neighborhood samples. Based on the operating condition attribute information of each neighborhood sample and the operating condition sample to be judged within the neighborhood range, a reliability index of the operating condition sample to be judged is determined. The operating condition attribute information is used to measure the similarity of the operating conditions between each neighborhood sample and the operating condition sample to be judged. The final discrimination module is used to take the credibility index and the initial discrimination result as the final discrimination result of the sample of working conditions to be discriminated.

11. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program is executed, it controls the device where the storage medium is located to perform the power safety discrimination method as described in any one of claims 1-9.

12. An electronic device, characterized in that, The device includes at least one processor, at least one memory connected to the processor, and a bus; wherein the processor and the memory communicate with each other through the bus; the processor is used to call program instructions in the memory to execute the power safety discrimination method as described in any one of claims 1-9.