Electric power safety risk assessment method and device, electronic equipment and storage medium

By employing multi-dimensional data collection and feature selection methods, combined with a random forest model, the problems of incomplete coverage of risk sources and feature redundancy in the power system have been solved, thereby improving the accuracy and reliability of power security risk assessment and providing an intelligent early warning mechanism.

CN121479545APending Publication Date: 2026-02-06GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511571086.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

In existing power systems, the incomplete coverage of risk sources and the redundancy of characteristics lead to low reliability and accuracy of safety risk assessment results, and traditional methods are difficult to meet the requirements of high security and high reliability.

Method used

By acquiring multi-dimensional risk assessment data of the power system, including power load data, equipment operating status data, environmental operation data, and historical fault data, the information gain value and correlation coefficient between data features and target variables are calculated. Useful data features are screened out, and a random forest model is used for risk assessment to eliminate redundant features, thereby improving feature quality and model input efficiency.

Benefits of technology

It achieves full-dimensional coverage of power system risk sources, improves the accuracy and reliability of safety risk assessment, provides an intelligent early warning mechanism, and enhances operation and maintenance flexibility and traceability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121479545A_ABST
    Figure CN121479545A_ABST
Patent Text Reader

Abstract

The invention discloses an electric power safety risk assessment method and device, electronic equipment and a storage medium, and belongs to the technical field of electric power risk assessment, and the method comprises the steps: obtaining risk assessment data of an electric power system; wherein the risk assessment data comprises power load data, equipment operation state data, environment operation data and historical fault data; the data features with the information gain values larger than a preset information gain threshold value are screened out to serve as initial target data features; removing the initial target data features of which the pai rwi se correlation coefficients are greater than a preset correlation coefficient threshold to obtain corresponding target data features; and inputting the target data features into a preset electric power security risk assessment model, so that the electric power security risk assessment model matches a corresponding risk level according to the target data features and outputs the risk level, and therefore, through implementation of the method and the device, the problems of one-sided risk source coverage and feature redundancy in the prior art can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power risk assessment technology, and in particular to a power safety risk assessment method, apparatus, electronic device, and storage medium. Background Technology

[0002] In existing power systems, the assessment and management of safety risks has always been a complex and challenging problem. As power systems upgrade towards greater complexity and intelligence, traditional risk assessment methods (relying on expert experience and static data) are no longer sufficient to meet the demands for high security and reliability. While existing machine learning-based prediction technologies are being gradually applied, they still have the following significant limitations, resulting in lower reliability and accuracy of safety risk assessment results:

[0003] 1. Limited coverage of risk sources: Existing technologies often evaluate risks based on a single risk dimension (such as new energy access), and the data is limited to a certain type of operating parameter. The risk source data coverage is limited, which makes it impossible to identify common risks such as equipment degradation and operational misjudgment. 2. Static and redundant feature processing: Existing technologies often select features through static statistical coefficients (such as single correlation coefficients) without removing highly redundant features, resulting in poor model generalization ability. Summary of the Invention

[0004] This invention provides a method, apparatus, electronic device, and storage medium for power safety risk assessment, which can solve the problems of incomplete risk source coverage and feature redundancy in the prior art, resulting in low reliability and accuracy of safety risk assessment results.

[0005] To address the aforementioned technical problems, embodiments of the present invention provide a method for assessing power safety risks, comprising:

[0006] Obtain risk assessment data for the power system; wherein, the risk assessment data includes: power load data, equipment operating status data, environmental operation data, and historical fault data;

[0007] Based on the risk assessment data, the corresponding data features are calculated, and the information gain value between each data feature and the preset target variable is calculated. Data features with information gain values ​​greater than the preset information gain threshold are selected as initial target data features. The target variable is: whether a power failure occurs.

[0008] Calculate the pairwise correlation coefficient between each of the initial target data features, and remove the initial target data features whose pairwise correlation coefficient is greater than a preset correlation coefficient threshold to obtain the corresponding target data features;

[0009] The target data features are input into a preset power safety risk assessment model, so that the power safety risk assessment model calculates the risk probability value of the power system being in a risky state based on the target data features, and then matches the corresponding risk level based on the risk probability value and outputs it.

[0010] As a preferred embodiment, the step of calculating the information gain value between each data feature and a preset target variable, and selecting data features with an information gain value greater than a preset information gain threshold as initial target data features, includes:

[0011] Calculate the information gain value between each data feature and the preset target variable, and count the number of data features whose information gain value is greater than the preset information gain threshold. If the number of data features is not greater than the preset number threshold, then all data features whose information gain value is greater than the information gain threshold are taken as the initial target data features. If the number of data features is greater than the number threshold, then select the same number of data features as the number threshold in descending order of information gain value as the initial target data features.

[0012] Calculate the Pearson correlation coefficient between the initial target data features and the target variable, and remove data features whose absolute value of the Pearson correlation coefficient is less than a preset Pearson correlation coefficient threshold.

[0013] As a preferred embodiment, the power security risk assessment model includes: a random forest model;

[0014] The generation of the power security risk assessment model includes:

[0015] Obtain historical risk assessment data for the power system;

[0016] The model parameters of a pre-defined random forest model are initialized; wherein the model parameters include: number of trees, maximum depth, and minimum number of sample splits;

[0017] The historical risk assessment data is divided into training, validation, and test sets in corresponding proportions. The random forest model with initialized model parameters is trained based on the training set, and the hyperparameters of the random forest model are tuned based on the validation set during the training process to obtain the corresponding power safety risk assessment model.

[0018] As a preferred option, after obtaining the corresponding power security risk assessment model, the following is also included:

[0019] The accuracy, recall, and F1 score of the power safety risk assessment model are calculated based on the test set, and then the model performance of the power safety risk assessment model is evaluated based on the accuracy, recall, and F1 score.

[0020] Based on the above embodiments, another embodiment of the present invention provides a power safety risk assessment device, including: a risk assessment data acquisition module, an initial target data feature screening module, a target data feature screening module, and a power safety risk assessment module;

[0021] The risk assessment data acquisition module is used to acquire risk assessment data of the power system; wherein, the risk assessment data includes: power load data, equipment operating status data, environmental operation data, and historical fault data;

[0022] The initial target data feature filtering module is used to calculate the corresponding data features based on the risk assessment data, and to calculate the information gain value between each data feature and the preset target variable, and to filter out data features with an information gain value greater than the preset information gain threshold as initial target data features; wherein, the target variable is: whether a power failure has occurred;

[0023] The target data feature filtering module is used to calculate the pairwise correlation coefficient between each of the initial target data features, remove the initial target data features whose pairwise correlation coefficient is greater than a preset correlation coefficient threshold, and obtain the corresponding target data features.

[0024] The power safety risk assessment module is used to input the target data features into a preset power safety risk assessment model, so that the power safety risk assessment model calculates the risk probability value of the power system being in a risky state based on the target data features, and then matches the corresponding risk level according to the risk probability value and outputs it.

[0025] As a preferred embodiment, the step of calculating the information gain value between each data feature and a preset target variable, and selecting data features with an information gain value greater than a preset information gain threshold as initial target data features, includes:

[0026] Calculate the information gain value between each data feature and the preset target variable, and count the number of data features whose information gain value is greater than the preset information gain threshold. If the number of data features is not greater than the preset number threshold, then all data features whose information gain value is greater than the information gain threshold are taken as the initial target data features. If the number of data features is greater than the number threshold, then select the same number of data features as the number threshold in descending order of information gain value as the initial target data features.

[0027] Calculate the Pearson correlation coefficient between the initial target data features and the target variable, and remove data features whose absolute value of the Pearson correlation coefficient is less than a preset Pearson correlation coefficient threshold.

[0028] As a preferred embodiment, the power security risk assessment model includes: a random forest model;

[0029] The generation of the power security risk assessment model includes:

[0030] Obtain historical risk assessment data for the power system;

[0031] The model parameters of a pre-defined random forest model are initialized; wherein the model parameters include: number of trees, maximum depth, and minimum number of sample splits;

[0032] The historical risk assessment data is divided into training, validation, and test sets in corresponding proportions. The random forest model with initialized model parameters is trained based on the training set, and the hyperparameters of the random forest model are tuned based on the validation set during the training process to obtain the corresponding power safety risk assessment model.

[0033] As a preferred option, after obtaining the corresponding power security risk assessment model, the following is also included:

[0034] The accuracy, recall, and F1 score of the power safety risk assessment model are calculated based on the test set, and then the model performance of the power safety risk assessment model is evaluated based on the accuracy, recall, and F1 score.

[0035] Based on the above embodiments, another embodiment of the present invention provides an electronic device, the device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the power safety risk assessment method described in the above embodiments of the invention.

[0036] Based on the above embodiments, another embodiment of the present invention provides a storage medium, the storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the storage medium is located to execute the power safety risk assessment method described in the above embodiments of the invention.

[0037] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0038] This invention provides a method for assessing power safety risks. First, risk assessment data of the power system is acquired. The risk assessment data includes power load data, equipment operating status data, environmental operation data, and historical fault data. This step addresses the problem of limited coverage of risk source data in existing technologies by collecting multi-dimensional data of the power system as risk assessment data. This achieves comprehensive coverage of risk sources from a single dimension to a full dimension of "equipment-environment-operation-fault," ensuring the reliability of subsequent assessment results.

[0039] Furthermore, based on the risk assessment data, corresponding data features are calculated, and the information gain value between each data feature and a preset target variable is calculated. Data features with information gain values ​​greater than a preset information gain threshold are selected as initial target data features. The target variable is whether a power failure occurs. The pairwise correlation coefficient between each initial target data feature is calculated, and initial target data features with pairwise correlation coefficients greater than a preset correlation coefficient threshold are removed to obtain the corresponding target data features. This step addresses the problem of high feature redundancy in existing technologies. By filtering data features based on the information gain value between the data features and the preset target variable, firstly, data features with larger information gain values ​​are selected as useful data features, and then redundancy is eliminated by removing redundant features with pairwise correlation coefficients greater than a preset correlation coefficient threshold (retaining features with higher information gain). This can improve feature quality and model input efficiency, thereby improving the accuracy of safety risk assessment.

[0040] Finally, the target data features are input into a preset power safety risk assessment model, so that the power safety risk assessment model calculates the risk probability value of the power system being in a risky state based on the target data features, and then matches the corresponding risk level according to the risk probability value and outputs it. Attached Figure Description

[0041] Figure 1 This is a flowchart illustrating a power safety risk assessment method according to an embodiment of the present invention;

[0042] Figure 2 This is a schematic diagram of the structure of a power safety risk assessment device provided in an embodiment of the present invention. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0045] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0046] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0047] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0048] In the description of the embodiments of this application, the terms "multiple" and "several" refer to two or more (including two), similarly, "multiple groups" refer to two or more (including two groups), and "multiple pieces" refer to two or more (including two pieces).

[0049] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0050] Example 1

[0051] Please refer to Figure 1 To address the problems of incomplete risk source coverage and feature redundancy in existing technologies, resulting in low reliability and accuracy of safety risk assessment results, an embodiment of the present invention provides a flowchart of a power safety risk assessment method, including the following specific steps:

[0052] S1. Obtain risk assessment data of the power system; wherein, the risk assessment data includes: power load data, equipment operating status data, environmental operation data, and historical fault data;

[0053] In a specific embodiment, for step S1, in order to overcome the limitation of single-dimensional risk source data coverage in the prior art, this invention collects four types of core data from the power system as risk assessment data, realizing full-dimensional coverage of risk sources from a single dimension to "equipment-environment-operation-fault". The collected risk assessment data includes:

[0054] (1) Power load data: includes real-time operating parameters such as total active power, current / voltage of each line, and total harmonic distortion of voltage. The sampling interval is set to 1 minute to ensure the timeliness of the data.

[0055] (2) Equipment operating status data: including online monitoring data such as transformer oil temperature / winding temperature, circuit breaker opening and closing status, equipment vibration amplitude, line insulation resistance, etc., as well as the equipment's factory rated parameters, maintenance records (such as maintenance time, replaced parts, test data) and other full life cycle information, which fully reflect the evolution of equipment status;

[0056] (3) Environmental and operational data: including ambient temperature, humidity, wind speed, extreme weather warning signals (such as rainstorms and typhoons), and human operation logs (operation time, operation type, operator qualifications, and historical misoperation records), covering environmental interference and human influence factors;

[0057] (4) Historical fault data: including fault occurrence time, fault type (such as short circuit, equipment damage), fault root cause (such as tree obstruction, insulation aging), handling plan and effect (such as recovery time after clearing the fault).

[0058] S2. Calculate the corresponding data features based on the risk assessment data, and calculate the information gain value between each data feature and the preset target variable. Select data features with information gain values ​​greater than the preset information gain threshold as initial target data features; wherein, the target variable is: whether a power failure occurs;

[0059] Preferably, the step of calculating the information gain value between each data feature and the preset target variable, and selecting data features with information gain values ​​greater than a preset information gain threshold as initial target data features, includes: calculating the information gain value between each data feature and the preset target variable, and counting the number of data features with information gain values ​​greater than the preset information gain threshold; if the number of data features is not greater than a preset quantity threshold, then all data features with information gain values ​​greater than the information gain threshold are selected as initial target data features; if the number of data features is greater than the quantity threshold, then data features with the same number as the quantity threshold are selected as initial target data features in descending order of information gain value; calculating the Pearson correlation coefficient between the initial target data features and the target variable, and removing data features with absolute values ​​of Pearson correlation coefficients less than a preset Pearson correlation coefficient threshold.

[0060] In a specific embodiment, for step S2, to address the problems of static and redundant feature processing in the prior art, the present invention adopts a processing flow of "cleaning-normalization-feature filtering-redundancy removal" to improve feature quality and model input efficiency:

[0061] 1. Data cleaning:

[0062] (1) Handling missing values: The operation data adopts the "time series interpolation method" (linear interpolation based on the data of the first 15 minutes and the last 15 minutes) to avoid the influence of data deviation at a single moment; the equipment maintenance data adopts the "average value filling method of similar equipment" (such as the average insulation resistance of transformers of the same model) to ensure data integrity.

[0063] (2) Outlier handling: Based on the dual judgment of “3σ principle + domain rules”, if the current exceeds twice the rated value and the duration is >10 seconds, it is judged as abnormal. The duration of the equipment start-up impact current is usually ≤5 seconds, so 10 seconds is set as the threshold to exclude normal impacts. The total harmonic distortion rate of voltage exceeds 5%, which is judged as abnormal to ensure the authenticity of the data.

[0064] 2. Data normalization: Scale all data to the [0,1] interval using a linear transformation (formula: Where x represents the original data, x max x min The maximum and minimum values ​​of the feature are respectively, and the normalized data is mapped to the [0,1] interval. This eliminates the difference in units (such as the influence of units between current "kiloamperes" and temperature "degrees Celsius") and ensures that the weights of each feature are balanced during model training.

[0065] 3. Feature Selection: A combination of "information gain + Pearson correlation analysis" is used. First, the information gain value between each feature and the target variable (e.g., "whether the fault occurs") is calculated, and features with an information gain ≥ 0.1 (preset information gain threshold) are selected. If the number of selected features is > 20 (preset quantity threshold), the top 20 features with the highest gain values ​​are retained; if the number is ≤ 20, all features are retained. The corresponding initial target data features are obtained, and then the Pearson correlation coefficient between these initial target data features and the target variable is calculated. Weakly correlated features with an absolute correlation coefficient < 0.1 (preset Pearson correlation coefficient threshold) are eliminated.

[0066] Specifically, for the feature selection step, the feature selection in this invention follows the logic of "first selecting useful features, then selecting strongly correlated features," and the specific process is as follows:

[0067] (1) Calculation of information gain values ​​for features and target variables:

[0068] Calculate the information gain value of each feature and the target variable (e.g., "whether a fault occurs"). Filter features with an information gain ≥ 0.1. If the number of features > 20, retain the first 20 (in descending order of gain value). The parameter symbols defined in the above calculation process are shown in Table 1 below.

[0069]

[0070]

[0071]

[0072] Table 1. Definitions of parameter symbols in the information gain calculation process.

[0073] Calculation formula and explanation:

[0074] Calculation of empirical entropy H(D):

[0075] Empirical entropy is used to measure the uncertainty of "determining the target variable (fault status) when there are no features," and the formula is:

[0076]

[0077] If the proportion of a certain category of samples is extreme (e.g., no fault samples account for 95%), then A smaller absolute value results in a lower H(D), meaning that the uncertainty in determining the fault is low when there are no features; conversely, a larger absolute value results in a higher H(D).

[0078] Application example: When N = 1000, N1 = 50, N2 = 950, H(D) ≈ 0.286 (unit: bits), which means that the uncertainty of "fault or not" when there are no features is 0.286 bits.

[0079] Calculation of conditional entropy H(D|A):

[0080] Conditional entropy is used to measure the uncertainty in determining the target variable given a known feature A. The formula is:

[0081]

[0082] Explanation: First, split the sample set according to the discrete values ​​of feature A, calculate the empirical entropy of each subset (the part in parentheses), and then divide the subset by sample proportion. The weighted summation reflects the impact of feature A on the uncertainty of the target variable. Application example: H(D|A)≈0.225 for feature A (transformer winding temperature change rate), indicating that after knowing the temperature change rate, the uncertainty of "fault or not" is reduced to 0.225 bits.

[0083] Information gain IG(D,A) calculation:

[0084] IG(D,A)=H(D)-H(D|A);

[0085] Note: The larger the difference, the stronger the contribution of feature A to reducing the uncertainty of fault diagnosis; the smaller the difference, the weaker the practicality of the feature.

[0086] Screening rules: Retain features with IG(D,A)≥0.1; if the number of features to retain is >20, retain the top 20 features in descending order of IG(D,A); if the number of features to retain is ≤20, retain all features. Example: If a feature IG(D,A)=0.061<0.1, it will be removed.

[0087] (2) Calculate the Pearson correlation coefficient between the initial target data features and the target variable, and remove weakly correlated features with an absolute value of <0.1; the parameter symbols in the Pearson correlation coefficient calculation process are defined as shown in Table 2 below:

[0088]

[0089]

[0090] Table 2. Definitions of parameter symbols in the calculation of Pearson correlation coefficient.

[0091] Calculation formula and explanation:

[0092] The Pearson correlation coefficient is used to quantify the "strength of the linear association between the initial target data feature X and the target variable Y", and the formula is:

[0093]

[0094] Where, r XY→1: Feature X and Y show a strong positive linear correlation (e.g., "the larger the active power deviation rate, the higher the probability of failure"); r XY →-1: Feature X and Y show a strong negative linear correlation (e.g., "the higher the insulation resistance of the equipment, the lower the probability of failure"); r XY →0: The linear correlation between features X and Y is extremely weak.

[0095] Filtering rule: Remove features from the initial target data that contain |r XY Weak association features where |<0.1, retain |r XY Features with a value ≥ 0.1. Example: A feature r XY =0.08 < 0.1, then it is rejected; Characteristic X (active power deviation rate) r XY =0.35≥0.1, then keep it.

[0096] S3. Calculate the pairwise correlation coefficient between each of the initial target data features, and remove the initial target data features whose pairwise correlation coefficient is greater than the preset correlation coefficient threshold to obtain the corresponding target data features.

[0097] In a preferred embodiment, step S3 is used for redundancy removal, that is, calculating the pairwise correlation coefficient between the initial target data features after screening in step S2, removing redundant features whose absolute value of the correlation coefficient between the initial target data features is >0.8 (preset correlation coefficient threshold) (such as "maximum load rate in 24 hours" and "maximum load rate in 12 hours" are highly correlated, retaining the former with higher information gain), and finally retaining 15-20 key features as target data features (typically such as real-time active power deviation rate, transformer winding temperature change rate, and number of protection alarm signal triggers in 24 hours).

[0098] Specifically, the parameter symbols in the pairwise computation process are defined as shown in Table 3 below:

[0099] Parameter definition:

[0100]

[0101] Table 3. Parameter symbol definitions in the pairwise calculation process.

[0102] Calculation formula and explanation:

[0103] The pairwise correlation coefficient is used to quantify the "linear redundancy between two features," and its formula is the same as that of the Pearson correlation coefficient:

[0104]

[0105] Where, |r XZThe closer the value is to 1, the higher the information overlap between the two features (the stronger the redundancy); XZ The closer to 0, the weaker the redundancy.

[0106] Removal Rules: Redundancy removal in this step follows: |r XZ If the information gain is greater than 0.8, it is determined to be a "highly redundant feature pair"; compare the information gain values ​​IG(D,X) and IG(D,Z) of the initial target data features X and Z, and remove features with lower information gain; traverse all feature pairs until no highly redundant features remain, and finally retain 15-20 key features. Example: Initial target data feature X (maximum 24-hour load rate) (IG(D,X)=0.25), initial target data feature Z (maximum 12-hour load rate) IG(D,Z)=0.18, r XZ =0.85>0.8), therefore Z is removed and X is retained.

[0107] S4. Input the target data features into a preset power safety risk assessment model so that the power safety risk assessment model calculates the risk probability value of the power system being in a risky state based on the target data features, and then matches the corresponding risk level according to the risk probability value and outputs it.

[0108] Preferably, the power safety risk assessment model includes a random forest model; the generation of the power safety risk assessment model includes: acquiring historical risk assessment data of the power system; initializing the model parameters of a preset random forest model; wherein the model parameters include: number of trees, maximum depth, and minimum number of sample splits; dividing the historical risk assessment data into training sets, validation sets, and test sets of corresponding proportions; training the random forest model with initialized model parameters based on the training set; and optimizing the hyperparameters of the random forest model based on the validation set during the training process to obtain the corresponding power safety risk assessment model.

[0109] Preferably, after obtaining the corresponding power safety risk assessment model, the method further includes: calculating the accuracy, recall, and F1 score of the power safety risk assessment model based on the test set, and then evaluating the model performance of the power safety risk assessment model based on the accuracy, recall, and F1 score.

[0110] In a preferred embodiment, step S4 is used to input the target feature vector obtained in step S3 into the pre-trained power safety risk assessment model, output the "probability value (0-1) of the system being in a high-risk state", and match it with a preset risk level standard:

[0111] Low risk (Level 1): Probability < 0.3, the judgment criterion is "all key parameters are within the safety threshold and no risk source is triggered", the operation and maintenance recommendation is "routine monitoring, no intervention required";

[0112] Medium risk (level 2): ​​0.3 ≤ probability < 0.7, the judgment criterion is "single parameter abnormality (such as voltage harmonic distortion rate approaching the threshold), no risk of spread", and the operation and maintenance recommendation is "focus on tracking abnormal parameters and develop an inspection plan";

[0113] High risk (Level 3): Probability ≥ 0.7, the judgment criteria are "multiple abnormal parameters superimposed, or a single parameter seriously exceeding the safety threshold", the operation and maintenance recommendation is "immediately shut down for maintenance and activate the backup plan";

[0114] Prediction results output: The risk level is visually presented in the form of "monitoring interface color indicators (green / yellow / red corresponding to low / medium / high risk) + pop-up prompts", and an "abnormal parameter list" (such as "transformer winding temperature 85℃, exceeding the safety threshold of 10℃") is also output to help maintenance personnel quickly locate the abnormal point.

[0115] In another preferred embodiment, addressing the issues of existing technologies regarding machine-based early warning and lack of closed-loop optimization, this invention also provides a machine-cooperative intelligent early warning mechanism. This mechanism constructs an intelligent early warning system of "automatic alarm - manual intervention - log recording," improving operational flexibility and traceability. The specific implementation is as follows:

[0116] (1) Automatic alarm function:

[0117] Medium risk (Level 2): ​​Trigger local alarm - A yellow pop-up window appears on the monitoring interface, displaying the name of the abnormal parameter, its current value and safety threshold, and pushing targeted suggested measures (such as "Voltage harmonic distortion rate is too high, it is recommended to check the filter device of substation #3").

[0118] High risk (Level 3): Triggers a global alarm—Sends SMS / email / APP push notifications to maintenance teams and dispatch centers simultaneously, automatically retrieves preset emergency plans (such as "#1 transformer temperature exceeds the standard, start the backup transformer switching process"), and shortens the emergency response time;

[0119] (2) Manual intervention function: Allows maintenance personnel to flexibly adjust the early warning mechanism according to the actual scenario—such as "if the equipment is known to be under planned maintenance, temporarily turn off the alarm threshold of the equipment," or "mark and correct" false alarms (such as "mark medium-risk alarms caused by short-term voltage fluctuations as false alarms and adjust the corresponding feature weights"), reducing ineffective maintenance;

[0120] (3) Early warning log recording: Automatically record the "full-link information" of each early warning - including early warning time, risk level, triggering parameters (such as "2025-06-28 14:30, medium risk, voltage harmonic distortion rate 4.6%), handling personnel, handling results, and whether it is a false alarm. The log retention time is ≥3 years. The recorded content includes early warning time, risk level, triggering parameters, handling results, etc., to provide compliant data support for subsequent model optimization and operation and maintenance process improvement, forming a "prediction-handling-optimization" closed loop.

[0121] In another preferred embodiment, the generation of the power security risk assessment model includes the following steps:

[0122] 1. Select a machine learning model that is suitable for the scenario:

[0123] To address the issues of fixed model structures and poor adaptability in existing technologies, this paper proposes a method that dynamically selects targeted machine learning algorithms based on the three core characteristics of power systems (high-dimensional data, nonlinearity, and imbalanced positive and negative samples) to ensure a deep match between the model and the scenario.

[0124] Feature 1: High-dimensional data (15-20 features) + non-linearity: Support Vector Machine (SVM) algorithm is selected, and Radial Basis Function (RBF) is used as the kernel function (kernel function formula: K(x,y)=exp(-γ||xy|| 2 ), γ=0.1), where γ is the radial basis function kernel, which can map high-dimensional data to a low-dimensional feature space and effectively capture nonlinear correlations (such as the nonlinear relationship between voltage harmonic distortion rate and equipment failure).

[0125] Feature 2: High imbalance between positive and negative samples (proportion of faulty samples <5%): The random forest algorithm is selected, and 200 decision trees are constructed using the idea of ​​ensemble learning. By setting "class weight = balanced" (assigning higher weights to a small number of faulty samples), the recognition rate of high-risk samples is improved, and model bias caused by sample imbalance is avoided.

[0126] Specifically, the construction process of the random forest decision tree includes:

[0127] (1) Sample and feature sources: The training samples for the decision tree are “70% of the collected power load, equipment status, environmental operation, and historical fault data, and after preprocessing in the above steps”; the candidate features are “15-20 key features selected in steps S2” (such as “real-time active power deviation rate” derived from load data and “transformer winding temperature change rate” derived from equipment data).

[0128] (2) Construction process:

[0129] Sampling: by n cstimators= 200. For each tree, bootstrap the training set (with replacement, the sample size is the same as the original training set) to retain the characteristics of the failure sample distribution;

[0130] Feature selection: Randomly select m (m is the number of key features) step - one derivative features as split candidates;

[0131] Splitting: Split with "minimizing weighted Gini impurity" (the label is "failure / non - failure" of historical failure data), formula (p k is the proportion of node classes, w k is the class weight);

[0132] Stopping: Stop when the parameters are met - the tree depth reaches max_depth = 15, the number of node samples < min_samples_split = 5, or the weighted Gini impurity = 0.

[0133] Characteristic 3: Data time - series (need to capture the parameter change trend): Select the neural network algorithm, adopt a three - layer perceptron structure (input layer 20 - dimensional - hidden layer 64 - dimensional - output layer 1 - dimensional), the activation function is ReLU, which can capture time - series features such as the progressive increase of device temperature and the periodic fluctuation of load, and adapt to the dynamic change scenario of parameters.

[0134] Specifically, for the characteristic that the data time - series needs to capture the parameter change trend, the selected neural network (three - layer perceptron structure: input layer 20 - dimensional - hidden layer 64 - dimensional - output layer 1 - dimensional, activation function is ReLU) combines (fully - dimensionally collects multi - source heterogeneous data) data in the following way to achieve time - series feature capture and adaptation to the dynamic change scenario of parameters: Pre - processing and derivation of 20 - dimensional features in the input layer (1 - minute - level power load data, device operation status data, environmental data, etc.), such as "real - time active power time - series deviation rate", "transformer winding temperature time - series change rate", etc., and retain the chronological order of the data; The 64 - dimensional hidden layer encodes the information of short - term sudden dynamics (such as new energy output fluctuations), long - term progressive dynamics (such as slow increase of device temperature), and multi - parameter coupling dynamics (such as the联动 change of heavy rain and line current) in the data of step one through non - linear mapping; The ReLU activation function can retain the positive change trend of parameters in the data (such as progressive increase of temperature, peak load fluctuation), avoiding the loss of dynamic information; At the same time, the training samples are constructed by binding "historical failure data + time - series parameter sequence before failure", enabling the network to learn the association rule of "parameter dynamic change - failure", and finally adapting to the dynamic change scenarios of multi - dimensional parameters such as devices, environments, and loads.

[0135] Model selection rules: Automatically triggered in real time based on the power system operation scenario—when “new energy output fluctuation rate > 15%”, the correlation between output and equipment load and voltage exhibits strong nonlinearity (e.g., a sudden drop in wind power output will cause nonlinear fluctuations in voltage harmonic distortion rate), so it is determined that the nonlinear characteristics are significant, and SVM is selected first; when “fault sample ratio < 3%” (important imbalance characteristics), random forest is selected first; when “parameter time series change rate > 10% / hour” (important time series characteristics), neural network is selected first.

[0136] 2. Model training for multi-objective optimization:

[0137] This invention ensures model accuracy and generalization ability by constructing a standardized training process of "parameter initialization - dataset partitioning - iterative optimization - multi-metric evaluation".

[0138] (1) Initialize model parameters:

[0139] Support Vector Machine: Penalty coefficient C = 10, RBF kernel parameter γ = 0.1;

[0140] Random Forest: Number of trees n cstimators =200, maximum depth max_depth=15, minimum number of sample splits min_samples_split=5;

[0141] Neural network: learning rate lr = 0.001, number of iterations epochs = 500, batch size = 32;

[0142] (2) Training dataset partitioning: The preprocessed dataset is divided into a training set (70%, used for model learning of feature patterns), a validation set (20%, used for parameter tuning), and a test set (10%, used for final performance evaluation) in a ratio of 7:2:1 to avoid misjudgment of generalization ability caused by a single data partition.

[0143] (3) Model Iteration Optimization: The combination of "grid search + early stopping" is used for optimization. The key parameter combination is traversed by grid search (e.g., the max_depth of random forest is 10 / 15 / 20), and the optimal parameters are selected with the "F1 score" of the validation set as the objective function. At the same time, the early stopping method is enabled (training is stopped when the validation set loss does not decrease for 10 consecutive rounds), which effectively prevents the model from overfitting.

[0144] Specifically, the aforementioned "key parameters" refer to the core adjustable parameters of the three types of core machine learning models (random forest, support vector machine (SVM), and neural network) adapted to power system scenarios, including but not limited to the following categories:

[0145] Key parameters of the random forest model: number of trees n cstimatorsMaximum depth (max_depth), minimum number of sample splits (min_samples_split);

[0146] Key parameters of the Support Vector Machine (SVM) model: penalty coefficient (C), RBF kernel parameter (γ);

[0147] 3. Key parameters of neural network models: learning rate (lr) and batch size (batch_size).

[0148] Key parameter combination definitions and examples:

[0149] The "key parameter combination" refers to the combination of different candidate values ​​of the aforementioned key parameters traversed through a grid search. The candidate values ​​are expanded based on the preset values ​​of the initialized model parameters (to ensure parameter rationality). The goal is to select the combination that yields the optimal F1 score on the validation set. A specific example is as follows:

[0150] Example 1. Key parameter combinations for random forest models: Based on "max_depth is 10 / 15 / 20", combinations are formed by combining other candidate values ​​for key parameters, such as:

[0151] Combination 1: n cstimators =150, max_depth=10, min_samples_spl it=5;

[0152] Combination 2: n cstimators =200, max_depth=15, min_samples_spl it=5;

[0153] Combination 3: n cstimators =250, max_depth=20, min_samples_spl it=8;

[0154] Example 2. Key parameter combinations for a Support Vector Machine (SVM) model: Expanding candidate values ​​based on the initialization parameters "C = 10, γ = 0.1" to form combinations such as:

[0155] Combination 1: C = 8, γ = 0.05; Combination 2: C = 10, γ = 0.1; Combination 3: C = 12, γ = 0.15;

[0156] Example 3. Key parameter combinations for a neural network model: Expanding candidate values ​​based on the initialization parameters "lr = 0.001, batch_size = 32" to form combinations such as:

[0157] Combination 1: lr = 0.0005, batch_size = 32;

[0158] Combination 2: lr = 0.001, batch_size = 32 (document initialization parameters);

[0159] Combination 3: lr = 0.002, batch_size = 64.

[0160] All parameter combinations are iterated around the goal of “improving the F1 score on the validation set”, and the optimal parameter combination that best suits the characteristics of power system data (high dimensionality, nonlinearity, and imbalanced sample) is finally selected.

[0161] (4) Model performance evaluation: The model is evaluated using a combination of multiple indicators, including accuracy, recall, and F1 score. The focus is on the recall of high-risk samples (target ≥ 90%). Specifically, the random forest model must meet the following requirements: accuracy ≥ 92%, recall ≥ 95%, and F1 score ≥ 0.93 on the test set; the SVM model must meet the following requirements: accuracy ≥ 91%, recall ≥ 94%, and F1 score ≥ 0.92; and the neural network model must meet the following requirements: accuracy ≥ 90%, recall ≥ 93%, and F1 score ≥ 0.91. Only then can the training be considered successful.

[0162] Specifically, the "accuracy, recall, and F1 score" of the model performance evaluation are all calculated based on a binary classification confusion matrix (the target variable in the power scenario is "whether a fault occurs or not", i.e., positive class = fault / high-risk sample, negative class = normal / low-risk sample).

[0163] The confusion matrix is ​​used to statistically analyze the matching between the model's prediction results and the actual samples. In the context of this invention, the four core elements are defined as shown in Table 4 below:

[0164]

[0165]

[0166] Table 4 Definition of Core Elements

[0167] Specific calculation methods for each indicator:

[0168] (a) Accuracy: Accuracy is defined as the proportion of correctly predicted samples out of all the predictions made by the model, reflecting the overall accuracy of the model's predictions.

[0169] Calculation formula:

[0170]

[0171] For example, if the total number of samples in the test set of the random forest model is 1000, where TP = 48 (actual failure and correct prediction), TN = 920 (actual normal and correct prediction), FP = 12 (false alarms) and FN = 20 (false negatives), then: accuracy = (48+920) / (48+12+920+20) = 968 / 1000 = 96.8%.

[0172] (b) Recall: Recall (positive class recall) measures the proportion of "actual fault samples" that the model can successfully capture out of all "actual fault samples", reflecting the model's ability to avoid "fault underreporting" - "focus on the recall of high-risk samples", precisely because underreporting faults can directly lead to power safety accidents.

[0173] Calculation formula:

[0174]

[0175] For example, if the actual total number of faulty samples = TP + FN = 48 + 20 = 68, then: recall = 48 / 68 ≈ 70.6% (this example is for calculation demonstration. If a recall of ≥95% is required for random forest, model optimization is needed to make TP as large as possible and FN as small as possible).

[0176] (c) F1 Score: The F1 score is the harmonic mean of precision and recall, used to comprehensively balance "avoiding false positives" (precision) and "avoiding false negatives" (recall). Due to the sample imbalance problem in power scenarios (where the proportion of faulty samples is <5%), precision alone is easily affected by normal samples (negative classes). The F1 score more objectively reflects the model's predictive performance on high-risk samples. Precision (the proportion of samples predicted as faults by the model that are actually faults) must be calculated first, and then the F1 score is derived.

[0177]

[0178] F1 score calculation formula:

[0179]

[0180] For example, if the model predicts the total number of fault samples = TP + FP = 48 + 12 = 60, then: accuracy = 48 / 60 = 80%, F1 score = 2 × (80% × 70.6%) / (80% + 70.6%) ≈ 2 × 0.565 / 1.506 ≈ 0.75.

[0181] (5) Model saving and deployment: The parameters of the trained model are serialized and saved in Joblib format (loading time < 1 second, adapting to real-time prediction requirements), and deployed to the power system monitoring platform, which supports real-time calls through API interface.

[0182] 5. Robustness-enhanced model validation:

[0183] A dual validation system of "K-fold cross-validation + extreme scenario testing" is adopted to ensure the stability of the model in complex scenarios:

[0184] (1) K-fold cross-validation: The training set is evenly divided into 10 folds (K=10). Each time, 9 folds are used as the training set and 1 fold is used as the validation set. The validation process is repeated 10 times. The average of the "precision, recall and F1 score" of the 10 validations is taken as the robust performance of the model (the average F1 score is required to be ≥0.92) to avoid performance bias caused by a single data partition.

[0185] (2) Extreme scenario test: Under three extreme operating scenarios, namely “new energy output drops by 30%”, “equipment temperature exceeds the threshold by 10℃”, and “extreme rainstorm (24-hour rainfall > 100mm and humidity > 95%, in accordance with GB / T 28592-2012), the prediction accuracy of the model is tested (the F1 score is required to decrease by ≤ 5% under extreme scenarios) to verify the model’s anti-interference ability and scenario adaptability.

[0186] Therefore, this invention provides a method for assessing power safety risks, which effectively addresses the core limitations of existing technologies.

[0187] More comprehensive risk identification: By collecting multi-source heterogeneous data, the risk sources are covered from a "single dimension" to a full-dimensional "equipment-environment-operation-fault" approach. Existing technologies mostly focus on single-dimensional risks, with risk identification coverage rates typically ranging from 60% to 70%. This invention, through multi-source heterogeneous data collection, achieves full-dimensional coverage of risk sources from a "single dimension" to a "equipment-environment-operation-fault" approach, increasing the coverage rate to over 90% and completely resolving the problem of missed risk identification in existing technologies.

[0188] Superior prediction accuracy: Through feature processing optimized by dynamic redundancy and multi-objective model training, the model test set F1 score is ≥0.93 and the recall rate of high-risk samples is ≥95%, which is 1-2 percentage points higher than the existing technology, effectively reducing false negatives;

[0189] Enhanced scenario adaptability: Through feature-driven model selection rules, the model's F1 score remains stable above 0.90 in multiple scenarios such as "new energy fluctuations, equipment aging, and extreme weather," solving the problem of poor adaptability of fixed models in existing technologies.

[0190] Greater operational practicality: Risk level segmentation and abnormal parameter location improve operational efficiency by 40%, manual intervention reduces false alarm rate to below 5%, and early warning logs provide data support for continuous optimization, forming a closed loop of "prediction-handling-optimization", far exceeding the mechanical early warning mechanism of existing technologies.

[0191] Example 2

[0192] Please refer to Figure 2 This is a schematic diagram of the structure of a power safety risk assessment device according to an embodiment of the present invention. The device includes: a risk assessment data acquisition module, an initial target data feature screening module, a target data feature screening module, and a power safety risk assessment module.

[0193] The risk assessment data acquisition module is used to acquire risk assessment data of the power system; wherein, the risk assessment data includes: power load data, equipment operating status data, environmental operation data, and historical fault data;

[0194] The initial target data feature filtering module is used to calculate the corresponding data features based on the risk assessment data, and to calculate the information gain value between each data feature and the preset target variable, and to filter out data features with an information gain value greater than the preset information gain threshold as initial target data features; wherein, the target variable is: whether a power failure has occurred;

[0195] The target data feature filtering module is used to calculate the pairwise correlation coefficient between each of the initial target data features, remove the initial target data features whose pairwise correlation coefficient is greater than a preset correlation coefficient threshold, and obtain the corresponding target data features.

[0196] The power safety risk assessment module is used to input the target data features into a preset power safety risk assessment model, so that the power safety risk assessment model calculates the risk probability value of the power system being in a risky state based on the target data features, and then matches the corresponding risk level according to the risk probability value and outputs it.

[0197] Preferably, the step of calculating the information gain value between each data feature and the preset target variable, and selecting data features with an information gain value greater than a preset information gain threshold as initial target data features, includes:

[0198] Calculate the information gain value between each data feature and the preset target variable, and count the number of data features whose information gain value is greater than the preset information gain threshold. If the number of data features is not greater than the preset number threshold, then all data features whose information gain value is greater than the information gain threshold are taken as the initial target data features. If the number of data features is greater than the number threshold, then select the same number of data features as the number threshold in descending order of information gain value as the initial target data features.

[0199] Calculate the Pearson correlation coefficient between the initial target data features and the target variable, and remove data features whose absolute value of the Pearson correlation coefficient is less than a preset Pearson correlation coefficient threshold.

[0200] Preferably, the power security risk assessment model includes: a random forest model;

[0201] The generation of the power security risk assessment model includes:

[0202] Obtain historical risk assessment data for the power system;

[0203] The model parameters of a pre-defined random forest model are initialized; wherein the model parameters include: number of trees, maximum depth, and minimum number of sample splits;

[0204] The historical risk assessment data is divided into training, validation, and test sets in corresponding proportions. The random forest model with initialized model parameters is trained based on the training set, and the hyperparameters of the random forest model are tuned based on the validation set during the training process to obtain the corresponding power safety risk assessment model.

[0205] Preferably, after obtaining the corresponding power security risk assessment model, the following steps are also included:

[0206] The accuracy, recall, and F1 score of the power safety risk assessment model are calculated based on the test set, and then the model performance of the power safety risk assessment model is evaluated based on the accuracy, recall, and F1 score.

[0207] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0208] Those skilled in the art will clearly understand that, for convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0209] Example 3

[0210] Accordingly, embodiments of the present invention provide an electronic device, the device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the power safety risk assessment method described in the above embodiments of the invention.

[0211] The electronic device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The device may include, but is not limited to, a processor and a memory.

[0212] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the device, connecting various parts of the device via various interfaces and lines.

[0213] Example 4

[0214] Accordingly, embodiments of the present invention provide a storage medium, the storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the storage medium is located to execute the power safety risk assessment method described in the above embodiments of the invention.

[0215] The memory can be used to store the computer program. The processor implements various functions of the device by running or executing the computer program stored in the memory and calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0216] The storage medium is a computer-readable storage medium, and the computer program is stored in the computer-readable storage medium. When executed by a processor, the computer program can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0217] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for assessing power safety risks, characterized in that, include: Obtain risk assessment data for the power system; wherein, the risk assessment data includes: power load data, equipment operating status data, environmental operation data, and historical fault data; Based on the risk assessment data, the corresponding data features are calculated, and the information gain value between each data feature and the preset target variable is calculated. Data features with information gain values ​​greater than the preset information gain threshold are selected as initial target data features. The target variable is: whether a power failure occurs. Calculate the pairwise correlation coefficient between each of the initial target data features, and remove the initial target data features whose pairwise correlation coefficient is greater than a preset correlation coefficient threshold to obtain the corresponding target data features; The target data features are input into a preset power safety risk assessment model, so that the power safety risk assessment model calculates the risk probability value of the power system being in a risky state based on the target data features, and then matches the corresponding risk level based on the risk probability value and outputs it.

2. The power safety risk assessment method as described in claim 1, characterized in that, The calculation of the information gain value between each data feature and the preset target variable, and the selection of data features with an information gain value greater than the preset information gain threshold as initial target data features, includes: Calculate the information gain value between each data feature and the preset target variable, and count the number of data features whose information gain value is greater than the preset information gain threshold. If the number of data features is not greater than the preset number threshold, then all data features whose information gain value is greater than the information gain threshold are taken as the initial target data features. If the number of data features is greater than the number threshold, then select the same number of data features as the number threshold in descending order of information gain value as the initial target data features. Calculate the Pearson correlation coefficient between the initial target data features and the target variable, and remove data features whose absolute value of the Pearson correlation coefficient is less than a preset Pearson correlation coefficient threshold.

3. The power safety risk assessment method as described in claim 1, characterized in that, The power security risk assessment model includes: a random forest model; The generation of the power security risk assessment model includes: Obtain historical risk assessment data for the power system; The model parameters of a pre-defined random forest model are initialized; wherein the model parameters include: number of trees, maximum depth, and minimum number of sample splits; The historical risk assessment data is divided into training, validation, and test sets in corresponding proportions. The random forest model with initialized model parameters is trained based on the training set, and the hyperparameters of the random forest model are tuned based on the validation set during the training process to obtain the corresponding power safety risk assessment model.

4. The power safety risk assessment method as described in claim 3, characterized in that, After obtaining the corresponding power security risk assessment model, the following is also included: The accuracy, recall, and F1 score of the power safety risk assessment model are calculated based on the test set, and then the model performance of the power safety risk assessment model is evaluated based on the accuracy, recall, and F1 score.

5. A power safety risk assessment device, characterized in that, include: The system includes a risk assessment data acquisition module, an initial target data feature screening module, a target data feature screening module, and a power safety risk assessment module. The risk assessment data acquisition module is used to acquire risk assessment data of the power system; wherein, the risk assessment data includes: power load data, equipment operating status data, environmental operation data, and historical fault data; The initial target data feature filtering module is used to calculate the corresponding data features based on the risk assessment data, and to calculate the information gain value between each data feature and the preset target variable, and to filter out data features with an information gain value greater than the preset information gain threshold as initial target data features; wherein, the target variable is: whether a power failure has occurred; The target data feature filtering module is used to calculate the pairwise correlation coefficient between each of the initial target data features, remove the initial target data features whose pairwise correlation coefficient is greater than a preset correlation coefficient threshold, and obtain the corresponding target data features. The power safety risk assessment module is used to input the target data features into a preset power safety risk assessment model, so that the power safety risk assessment model calculates the risk probability value of the power system being in a risky state based on the target data features, and then matches the corresponding risk level according to the risk probability value and outputs it.

6. The power safety risk assessment device as described in claim 5, characterized in that, The calculation of the information gain value between each data feature and the preset target variable, and the selection of data features with an information gain value greater than the preset information gain threshold as initial target data features, includes: Calculate the information gain value between each data feature and the preset target variable, and count the number of data features whose information gain value is greater than the preset information gain threshold. If the number of data features is not greater than the preset number threshold, then all data features whose information gain value is greater than the information gain threshold are taken as the initial target data features. If the number of data features is greater than the number threshold, then select the same number of data features as the number threshold in descending order of information gain value as the initial target data features. Calculate the Pearson correlation coefficient between the initial target data features and the target variable, and remove data features whose absolute value of the Pearson correlation coefficient is less than a preset Pearson correlation coefficient threshold.

7. The power safety risk assessment device as described in claim 5, characterized in that, The power security risk assessment model includes: a random forest model; The generation of the power security risk assessment model includes: Obtain historical risk assessment data for the power system; The model parameters of a pre-defined random forest model are initialized; wherein the model parameters include: number of trees, maximum depth, and minimum number of sample splits; The historical risk assessment data is divided into training, validation, and test sets in corresponding proportions. The random forest model with initialized model parameters is trained based on the training set, and the hyperparameters of the random forest model are tuned based on the validation set during the training process to obtain the corresponding power safety risk assessment model.

8. The power safety risk assessment device as described in claim 7, characterized in that, After obtaining the corresponding power security risk assessment model, the following is also included: The accuracy, recall, and F1 score of the power safety risk assessment model are calculated based on the test set, and then the model performance of the power safety risk assessment model is evaluated based on the accuracy, recall, and F1 score.

9. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the power safety risk assessment method as described in any one of claims 1 to 4.

10. A storage medium, characterized in that, The storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device containing the storage medium to perform the power safety risk assessment method as described in any one of claims 1 to 4.