Power grid transmission line fault early warning method and system
By constructing a fault early warning system based on big data and artificial intelligence, and using the random forest algorithm to extract feature variables, the system monitors the status of power grid transmission lines in real time, solving the problem of low efficiency in traditional manual inspections and achieving efficient early warning and accurate prediction of transmission line faults.
Patent Information
- Application Number
- CN202511771059.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-05-01
AI Technical Summary
Traditional power grid transmission line fault detection relies on manual inspections and regular maintenance, lacking real-time monitoring and analysis, resulting in maintenance work that is not targeted, inefficient, and costly.
By employing big data and artificial intelligence technologies, a fault probability and type prediction model is constructed using the random forest algorithm. Feature variables are extracted using historical environmental factors and power grid operation status data to monitor the operation status of transmission lines in real time, predict fault probability and type, and initiate an early warning when the probability exceeds a threshold.
It enables efficient and accurate early warning of transmission line faults, improves the reliability and safety of the power grid, reduces errors in human judgment, shortens emergency response time, and rationally allocates maintenance resources.
Smart Images

Figure CN121965527A_ABST
Abstract
Description
A method and system for early warning of power grid transmission line faults Technical Field
[0001] This application relates to the field of power engineering technology, and in particular to a method and system for early warning of power grid transmission line faults. Background Technology
[0002] Power transmission lines are a crucial component of the power system, responsible for transmitting electricity generated by power plants to end users. However, due to the complexity of the natural environment and the uncertainty of power grid operation, transmission lines frequently face various faults, such as short circuits, open circuits, overloads, and insulation damage. These faults not only affect the reliability and security of power supply but also lead to significant economic losses and social impacts.
[0003] Traditional fault detection and maintenance methods mainly rely on manual inspections and periodic maintenance. While this approach can prevent faults to some extent, the lack of real-time monitoring and analysis of the actual operating status of the lines makes it difficult to detect potential faults in a timely manner. This results in a lack of targeted maintenance work, high maintenance costs, and unsatisfactory results. Therefore, there is an urgent need for a more efficient, accurate, and intelligent fault early warning method that can monitor the operating status of transmission lines in real time, predict the probability and type of faults in advance, and take timely preventive and handling measures to improve the reliability and security of the power grid. Summary of the Invention
[0004] The purpose of this invention is to overcome the problem that existing fault detection methods mainly rely on manual inspection and regular maintenance, which is inefficient, and to provide a method and system for early warning of power grid transmission line faults based on big data and artificial intelligence technologies.
[0005] To achieve the above objectives, the technical solution of the present invention is:
[0006] In a first aspect, the present invention provides a method for early warning of faults in power grid transmission lines, comprising:
[0007] S1. Obtain historical environmental factor data and historical power grid operation status data;
[0008] S2. Extract feature variables based on the historical environmental factor data and historical power grid operation status data, and extract features related to transmission line faults and effective features corresponding to different types of transmission line faults based on the feature variables;
[0009] S3. Based on the characteristics related to transmission line faults, a fault probability prediction model is constructed using the random forest algorithm to predict the probability of transmission line faults.
[0010] Based on the effective characteristics corresponding to different types of transmission line faults, a fault type prediction model is constructed using the random forest algorithm to predict the type of fault that will occur on the transmission line.
[0011] S4. Real-time acquisition of current environmental factor data and power grid operation status data, and input into the fault probability prediction model and fault type prediction model. The fault probability prediction model and fault type prediction model predict the probability of transmission line faults and the type of faults based on the input data.
[0012] S5. When the probability of a failure exceeds a preset probability threshold, an early warning program is activated.
[0013] The feature variables extracted based on the historical environmental factor data and historical power grid operation status data include:
[0014] S201. Extract weather phenomenon data, temperature data, humidity data, and wind speed and direction data based on historical environmental factor data, and record the above data as feature variables respectively;
[0015] Load factor data, current data, voltage data, and power factor data are extracted from historical power grid operation status data, and these data are recorded as feature variables respectively.
[0016] S202. Construct a feature matrix based on all feature variables, where each row of the feature matrix represents a time point and each column represents a feature variable.
[0017] The extraction of features related to transmission line faults based on the aforementioned feature variables includes:
[0018] S211. For each feature variable in the feature matrix and the occurrence of transmission line faults, calculate the first correlation coefficient between each feature variable and the transmission line fault, and record the relevant feature vectors whose first correlation coefficient is greater than the first preset threshold as significant variables.
[0019] S212. Calculate the second correlation coefficient between each significant variable, and record two significant variables whose second correlation coefficient is greater than the second preset threshold as a group of significant variables.
[0020] S213. Retain the significant variables with larger first correlation coefficients in the significant variable group, remove the significant variables with smaller first correlation coefficients in the significant variable group, and record the retained significant variables as features related to transmission line faults.
[0021] The extraction of effective features corresponding to different types of transmission line faults based on the aforementioned feature variables includes:
[0022] S221. Calculate the correlation between each characteristic variable and different types of transmission line faults;
[0023] S222. For any type of transmission line fault, the feature variables whose correlation with it is greater than the preset correlation threshold shall be used as its effective features.
[0024] The construction of the failure probability prediction model includes:
[0025] S301. Select a random forest model as the initial model, and configure the number of decision trees, the maximum depth of the decision trees, and the feature sampling ratio in the initial model;
[0026] S302. Construct a training set based on the data in the features related to transmission line faults, and label each data in the training set.
[0027] For any data in the training set, if the transmission line is in a fault state at the time corresponding to the data, it is assigned the first label; otherwise, it is assigned the second label.
[0028] S303. Randomly select a certain number of data from the training set to construct a subset dataset;
[0029] S304. Using all samples in the subset as initial input, create the root node of the decision tree;
[0030] S305. At the current node of the decision tree, randomly select a subset of features from all available features related to transmission line faults, calculate the information gain of each selected feature, and select the feature with the largest information gain as the best splitting feature for the current node.
[0031] S306. Based on the data values of the best splitting features, divide the dataset corresponding to the current node into several subsets, with each subset corresponding to a new child node;
[0032] S307. Repeat steps 305 to 306 for each new child node until the current node has no remaining features that can be used for splitting, and record the current node as a leaf node.
[0033] For each leaf node, if the number of samples assigned the first label is greater than the number of samples assigned the second label in the dataset corresponding to the leaf node, then the category label of the leaf node is "faulty"; if the number of samples assigned the second label is greater than the number of samples assigned the first label in the dataset corresponding to the leaf node, then the category label of the leaf node is "not faulty".
[0034] After constructing the failure probability prediction model, the performance of the failure prediction model is evaluated through cross-validation, and the failure prediction model is optimized by adjusting the number and maximum depth of decision trees; the evaluation of the failure prediction model performance through cross-validation and the optimization of the failure prediction model by adjusting the number and maximum depth of decision trees include:
[0035] S311. Select the model parameters to be adjusted and their value ranges. The model parameters include: the number of decision trees, the maximum depth of each tree, and the feature sampling ratio.
[0036] S312. Use grid search to traverse all parameter combinations, perform N-fold cross-validation on each parameter combination, and obtain the average evaluation index for each parameter combination.
[0037] The N-fold cross-validation includes the following steps:
[0038] The training set is divided into N mutually exclusive subsets of equal size, and training is performed N times. Each iteration of training includes:
[0039] Select a subset as the optimization validation set, and the remaining N-1 subsets as the optimization training set. Use the optimization training set to train the fault prediction model to obtain the trained fault prediction model. Use the optimization validation set to evaluate the performance of the trained fault prediction model and record the evaluation metrics, which include accuracy, recall and F1 score.
[0040] Calculate the average evaluation metric for N iterations of training;
[0041] S313. Select the parameter combination with the highest average evaluation index as the optimal parameters, and retrain the random forest model using the optimal parameters.
[0042] The construction of the fault type prediction model includes: for each type of transmission line fault, constructing a corresponding stochastic forest model to obtain the fault type prediction model; wherein, for a selected type of transmission line fault, constructing a corresponding stochastic forest model includes:
[0043] S321. Select a random forest model as the initial model, and configure the number of decision trees, the maximum depth of the decision trees, and the feature sampling ratio in the initial model;
[0044] S322. For a selected type of transmission line fault, construct a corresponding feature subset based on its effective features;
[0045] S323. Construct a training set based on the data in the corresponding feature subset, and label each data in the training set;
[0046] For any data in the training set, if the transmission line at the time corresponding to the data has a selected type of transmission line fault, then the data is assigned a first label; otherwise, the data is assigned a second label.
[0047] S324. Randomly select a certain number of data from the training set to construct a subset dataset;
[0048] S325. Using all samples in the subset as initial input, create the root node of the decision tree;
[0049] S326. At the current node of the decision tree, randomly select a subset of features from the corresponding feature set, calculate the information gain of each selected feature, and select the feature with the largest information gain as the best splitting feature for the current node.
[0050] S327. Based on the data values of the best splitting features, divide the dataset corresponding to the current node into several subsets, with each subset corresponding to a new child node;
[0051] S328. Repeat steps S326 to S327 for each new child node until the current node has no remaining features that can be used for splitting, and record the current node as a leaf node.
[0052] For each leaf node, if the number of samples in the dataset corresponding to the leaf node that are assigned the first label is greater than the number of samples assigned the second label, then the category label of the leaf node is "selected type fault"; if the number of samples in the dataset corresponding to the leaf node that are assigned the second label is greater than the number of samples assigned the first label, then the category label of the leaf node is "non-selected type fault".
[0053] The power grid transmission line fault early warning method further includes:
[0054] Obtain the geographic coordinate data of the power transmission lines;
[0055] By combining geographic coordinate data with the predicted probability and type of transmission line failure, a visual map is generated, which marks areas where transmission line failures may occur.
[0056] The power grid transmission line fault early warning method further includes:
[0057] Establish a maintenance suggestion library, which contains maintenance suggestions for different fault types;
[0058] When the probability of a transmission line failure is predicted to exceed a preset threshold, the corresponding maintenance suggestion is matched from the maintenance suggestion library based on the predicted type of failure.
[0059] Send maintenance recommendations to external terminals.
[0060] Secondly, the present invention provides a power grid transmission line fault early warning system, comprising:
[0061] The first processing module is used to acquire historical environmental factor data and historical power grid operation status data;
[0062] The second processing module is used to extract feature variables based on the historical environmental factor data and historical power grid operation status data, and to extract features related to transmission line faults and effective features corresponding to different types of transmission line faults based on the feature variables.
[0063] The third processing module is used to construct a fault probability prediction model based on the random forest algorithm according to the characteristics related to transmission line faults, so as to predict the probability of transmission line faults; and to construct a fault type prediction model based on the random forest algorithm according to the effective characteristics corresponding to different types of transmission line faults, so as to predict the type of transmission line faults.
[0064] The fourth processing module is used to acquire current environmental factor data and power grid operation status data in real time and input them into the fault probability prediction model and the fault type prediction model. The fault probability prediction model and the fault type prediction model predict the probability of transmission line faults and the type of faults based on the input data.
[0065] The fifth processing module is used to activate an early warning program when the probability of a fault occurring exceeds a preset probability threshold.
[0066] Thirdly, the present invention provides an electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the above-described method for early warning of faults in power grid transmission lines.
[0067] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0068] 1. In the present invention, a method for early warning of power grid transmission line faults extracts features related to transmission line faults based on historical environmental factor data and historical power grid operation status data. A fault prediction model is constructed based on the random forest algorithm. Through the fault prediction model, we can predict the probability and type of faults that will occur in the transmission line in the future based on real-time data. When the probability of a fault exceeds a preset threshold, an early warning procedure is initiated to provide safety assurance for the power grid transmission line. At the same time, this method is based on big data and intelligent algorithm technology. By monitoring the environmental status and the operation status of the transmission line in real time, it can predict the probability and type of faults in advance so as to take corresponding measures for prevention and treatment in a timely manner, thereby improving the reliability and safety of the power grid.
[0069] 2. In the power grid transmission line fault early warning method of the present invention, environmental data is extracted based on historical environmental factor data, and power grid operation status-related data is extracted based on historical power grid operation status data. Based on these data, multiple feature variables are constructed, and based on the occurrence of transmission line faults and the correlation between feature variables and feature variables, features related to transmission line faults are extracted from multiple feature variables. This realizes the analysis of massive power grid operation data, extracts valuable information data from the data, can more accurately retain key feature data, simplifies the model structure, reduces the amount of calculation, and improves the accuracy of fault prediction model in predicting transmission line faults.
[0070] 3. In the power grid transmission line fault early warning method of the present invention, by acquiring the geographical coordinate data of the transmission line, the geographical coordinate data is combined with the predicted probability of transmission line fault and the type of fault to generate a visual map marking the area where transmission line fault may occur. This map can intuitively display the distribution of fault risk, which is conducive to the rational allocation of maintenance personnel and equipment resources and improves the efficiency of fault handling.
[0071] 4. In the power grid transmission line fault early warning method of the present invention, a maintenance suggestion library is established. The maintenance suggestion library contains maintenance suggestions for different fault types. When the probability of a fault occurring in the transmission line is predicted to exceed a preset threshold, the corresponding maintenance suggestion is matched in the maintenance suggestion library according to the predicted fault type, and the maintenance suggestion is sent to an external terminal. This can reduce the error and delay of manual judgment, shorten the emergency response time, and improve the standardization and intelligence of operation and maintenance. Attached Figure Description
[0072] Figure 1 is a flowchart illustrating a power grid transmission line fault early warning method provided in an embodiment of the present invention.
[0073] Figure 2 is a schematic diagram of a process for extracting feature variables provided in an embodiment of the present invention.
[0074] Figure 3 is a schematic diagram of a process for extracting features related to power transmission line faults according to an embodiment of the present invention.
[0075] Figure 4 is a schematic diagram of a process for extracting effective features provided in an embodiment of the present invention.
[0076] Figure 5 is a schematic diagram of a process for constructing a fault probability prediction model provided in an embodiment of the present invention.
[0077] Figure 6 is a flowchart illustrating an optimized fault prediction model provided in an embodiment of the present invention.
[0078] Figure 7 is a schematic diagram of a process for constructing a fault type prediction model provided in an embodiment of the present invention.
[0079] Figure 8 is a schematic diagram of a power grid transmission line fault early warning system provided in an embodiment of the present invention.
[0080] Figure 9 is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0081] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0082] Traditional fault detection methods mainly rely on manual inspections and regular maintenance. While this approach can prevent faults to some extent, it lacks real-time monitoring and analysis of the actual operating status of the line, making it difficult to detect potential faults in a timely manner, and maintenance work lacks specificity.
[0083] To address the technical problems existing in related technologies, this invention provides a method for early warning of power grid transmission line faults. Please refer to Figure 1, which is a flowchart of an embodiment of the power grid transmission line fault early warning method provided by this invention. The method includes steps S1 to S5.
[0084] S1. Obtain historical environmental factor data and historical power grid operation status data.
[0085] Historical power grid operation status data can be obtained from the power company's internal systems, such as Energy Management Systems (EMS) and Supervisory Control and Data Acquisition (SCADA) systems. Historical environmental factor data can be obtained from publicly available data platforms or, as needed, by monitoring areas near target transmission lines.
[0086] S2. Extract feature variables based on the historical environmental factor data and historical power grid operation status data, and extract features related to transmission line faults and effective features corresponding to different types of transmission line faults based on the feature variables.
[0087] Figure 2 is a flowchart illustrating the extraction of features related to transmission line faults according to an embodiment of the present invention. As shown in Figure 2, the feature variables are extracted based on the historical environmental factor data and historical power grid operation status data. Specifically, the extraction of feature variables based on the historical environmental factor data and historical power grid operation status data includes steps S201 to S202:
[0088] S201. Extract weather phenomenon data, temperature data, humidity data, and wind speed and direction data based on historical environmental factor data, and record the above data as feature variables respectively; wherein, the weather phenomenon data is used to indicate the weather phenomenon at the time of data collection, and the weather phenomenon includes sunny, rainy, or cloudy.
[0089] Load rate data, current data, voltage data, and power factor data are extracted from historical power grid operation status data, and these data are recorded as feature variables.
[0090] Specifically, the feature variables extracted from environmental factor data are selected and determined based on the multi-dimensional needs of prediction. It should be noted that the feature variables extracted from environmental factor data provided in this embodiment are not limited to the weather condition data, temperature change data, humidity change data, and wind speed and direction data mentioned in the above embodiments, but may also include other environment-related data, such as lightning density data, etc., which are not specifically limited here. Each type of environmental factor data is denoted as one feature variable.
[0091] Similarly, the feature variables extracted from the power grid operation status data are selected and determined based on the predicted multi-dimensional demand. The feature variables extracted from the power grid operation status data provided in this embodiment are not limited to the load rate data, current data, and voltage data mentioned in the above embodiments, but may also include other environment-related data, such as power factor data and harmonic data, etc., which are not specifically limited here. Each type of power grid operation status data is denoted as a feature variable.
[0092] S202. Construct a feature matrix based on all feature variables, where each row of the feature matrix represents a time point and each column represents a feature variable.
[0093] Specifically, the feature matrix provided in this embodiment is a two-dimensional data structure used to organize time series data. Each row represents a time point, and each time point corresponds to a specific value of a set of feature variables. Each column represents a feature variable, and each feature variable has a corresponding value at different time points.
[0094] Figure 3 is a flowchart illustrating the extraction of features related to transmission line faults according to an embodiment of the present invention. As shown in Figure 3, the extraction of features related to transmission line faults based on the feature variables includes steps S211 to S213:
[0095] S211. For each feature variable in the feature matrix and the occurrence of transmission line faults, calculate the first correlation coefficient between each feature variable and the transmission line fault, and record the relevant feature vectors whose first correlation coefficient is greater than the first preset threshold as significant variables.
[0096] In this embodiment, the occurrence of a transmission line fault refers to whether a fault has occurred on the transmission line at the time the corresponding feature vector is collected. The correlation coefficient between the feature vector and the occurrence of the transmission line fault is based on existing technology. Specifically, we can use Pearson correlation coefficient, Spearman correlation coefficient, or other statistical methods to calculate the first correlation coefficient between each feature variable and the transmission line fault. Based on the first correlation coefficient, the association between each feature variable and the transmission line fault can be determined. The feature vectors are sorted according to the magnitude of the corresponding first correlation coefficient to initially screen out significant variables with a high correlation to the transmission line fault. By calculating the first correlation coefficient and setting a corresponding coefficient threshold, feature variables with a high correlation to the occurrence of transmission line faults can be initially screened from the feature matrix.
[0097] S212. Calculate the second correlation coefficient between each significant variable, and record two significant variables whose second correlation coefficient is greater than the second preset threshold as a significant variable group.
[0098] In this embodiment, calculating the second correlation coefficient between any two significant variables can reveal the potential association between them, thereby facilitating the identification of multicollinearity issues among features, obtaining a highly correlated set of significant variables, and subsequently removing redundant data based on the set of significant variables to simplify the prediction model and reduce computational complexity.
[0099] S213. Retain the significant variables with larger first correlation coefficients in the significant variable group, and remove the significant variables with smaller first correlation coefficients in the significant variable group. Record the retained significant variables as features related to transmission line faults.
[0100] Specifically, by analyzing environmental factors such as weather conditions, temperature changes, humidity changes, wind speed and direction, as well as power grid operating status data such as load rate, current intensity, voltage intensity, and power factor, a feature matrix reflecting the operating environment of transmission lines is constructed. Statistical methods are used to calculate the first correlation coefficient between each feature variable and transmission line faults, and these coefficients are ranked to select highly correlated significant variables. By calculating the second correlation coefficient between any two significant variables, multicollinearity issues among features are identified. Only variables with stronger correlations are retained from the highly correlated significant variable group, ensuring that the final selected features are both highly correlated and independent. This improves the accuracy of the fault prediction model while simplifying the model structure and reducing computational complexity.
[0101] Figure 4 is a flowchart illustrating the extraction of effective features according to an embodiment of the present invention. As shown in Figure 4, the extraction of effective features corresponding to different types of transmission line faults based on the feature variables includes steps S221 to S222:
[0102] S221. Calculate the correlation between each characteristic variable and different types of transmission line faults;
[0103] S222. For any type of transmission line fault, the feature variables whose correlation with it is greater than the preset correlation threshold shall be used as its effective features.
[0104] In this embodiment, the feature vector selection method starts from the correlation between a single feature and the fault, and gradually optimizes the feature set to more specifically focus on the features related to transmission line faults. When dealing with multicollinearity, the operation is performed directly between significant variables, which can more accurately retain key features, simplify the model structure, reduce the amount of computation, and improve the accuracy of the fault prediction model in predicting transmission line faults.
[0105] Meanwhile, by collecting historical environmental factor data and power grid operation status data, and extracting features closely related to transmission line faults, a fault probability prediction model can be constructed to predict transmission line faults and effectively prevent potential power accidents. Furthermore, by extracting effective features corresponding to different types of transmission line faults from historical environmental factor data and power grid operation status data, a fault type prediction model can be constructed to predict the types of transmission line faults that may occur. Based on the predicted transmission line probability, the types of faults that may occur can be further evaluated.
[0106] S3. Based on the characteristics related to transmission line faults, a fault probability prediction model is constructed using the random forest algorithm to predict the probability of transmission line faults.
[0107] Based on the effective characteristics corresponding to different types of transmission line faults, a fault type prediction model is constructed using the random forest algorithm to predict the type of fault that may occur on transmission lines.
[0108] After obtaining the features related to transmission line faults, a fault probability prediction model can be constructed based on the extracted features. Figure 5 is a flowchart illustrating the construction of a fault probability prediction model provided in an embodiment of the present invention. As shown in Figure 5, the construction of the fault prediction model includes steps S301 to S307:
[0109] S301. Select the random forest model as the initial model, and configure the number of decision trees, the maximum depth of the decision trees, and the feature sampling ratio in the initial model.
[0110] S302. Use the data from the features related to transmission line faults as the training set, and label each data in the training set.
[0111] In this embodiment, we use a portion of the data related to transmission line faults as the training set and another portion as the validation set. The data in the training set is used to construct a fault prediction model to predict the probability of transmission line faults, and the validation set is used to validate the prediction model.
[0112] For any data in the training set, if the transmission line is in a fault state at the corresponding time, it is assigned a first label; if the transmission line is in normal operating condition at the corresponding time, it is assigned a second label.
[0113] Specifically, based on the transmission line circuit operating status at the corresponding time for each data point, if the transmission line is in a fault condition (including but not limited to short circuits, overloads, grounding, and other abnormal states) at the time of data acquisition, then the data point is assigned a first-type status identifier, i.e., the first label; if the transmission line is in a normal operating state (i.e., no fault characteristics are detected) at the time of data acquisition, then a second-type status identifier, i.e., the second label, is assigned. During this process, it is necessary to ensure that each current data point strictly matches its corresponding circuit state information, ultimately forming a training dataset with fault state labels.
[0114] S303. Randomly select a certain number of data from the training set to construct a subset dataset. The size of this subset dataset is usually smaller than or equal to the original training set, and it is used for iterative training of the local model.
[0115] S304. Using all samples in the subset as initial input, create the root node of the decision tree. The root node serves as the starting point of the decision tree and is the benchmark for subsequent feature selection and sample splitting.
[0116] S305. At the current node of the decision tree, randomly select a subset of features from all available features, calculate the information gain of each selected feature, and select the feature with the largest information gain as the best splitting feature for the current node. In this step, by randomly selecting a subset of features, the risk of model overfitting can be reduced and the model's generalization ability can be enhanced.
[0117] S306. Based on the data values of the best splitting features, divide the dataset corresponding to the current node into several subsets, with each subset corresponding to a new child node;
[0118] S307. Repeat steps 305 to 306 for each new child node until the current node has no remaining features that can be used for splitting, and record the current node as a leaf node.
[0119] For each leaf node, a category label is determined based on the number of first and second labels in the dataset corresponding to that node. The category labels include "faulty" and "not faulty".
[0120] In this embodiment, for each leaf node, the category label is determined according to the label corresponding to the sample in the node. Specifically, if the number of samples assigned the first label in the dataset corresponding to the leaf node is greater than the number of samples assigned the second label, then the category label of the leaf node is "fault"; if the number of samples assigned the second label in the dataset corresponding to the node is greater than the number of samples assigned the first label, then the category label of the leaf node is "not faulty".
[0121] After determining the category labels for all leaf nodes, the decision tree is constructed to obtain a fault prediction model for predicting the probability of transmission line faults. This model predicts the probability of transmission line faults in the following way:
[0122] Each decision tree in the fault prediction model classifies the input feature vector samples and calculates the probability that the corresponding feature vector sample belongs to the fault category based on the classification path of the decision tree and the category distribution of the leaf nodes.
[0123] The system combines the probability results from multiple decision trees to output a specific failure probability value.
[0124] By predicting the probability of failure, maintenance resources (such as manpower, materials, and equipment) can be deployed in advance before a failure occurs, avoiding emergency repair costs (such as additional expenses for nighttime operations and traffic coordination) caused by sudden failures.
[0125] In this embodiment, during the construction of the fault prediction model, the optimal splitting feature is determined by randomly selecting a subset of features from all available features at each node and calculating the information gain, thus avoiding overfitting. As the decision tree continues to grow until no remaining features are available for splitting at the leaf nodes, each leaf node determines its class label (faulty or not faulty) based on the majority class of its samples, thereby completing the construction of a single decision tree. Once all decision trees are constructed, the entire random forest model is completed.
[0126] After constructing a fault prediction model for predicting the probability of transmission line faults, the performance of the fault prediction model is evaluated through cross-validation, and the model is optimized by adjusting the number and maximum depth of decision trees. Figure 6 is a flowchart illustrating an optimized fault prediction model provided in an embodiment of the present invention. As shown in Figure 6, the optimized fault prediction model provided in this embodiment includes steps S311 to S313:
[0127] S311. Select the model parameters to be adjusted and their value ranges. The model parameters include: the number of decision trees, the maximum depth of each tree, and the feature sampling ratio.
[0128] S312. Use grid search to traverse all parameter combinations, perform N-fold cross-validation on each parameter combination, and obtain the average evaluation index for each parameter combination.
[0129] The N-fold cross-validation includes the following steps:
[0130] The training set is divided into N mutually exclusive subsets of equal size, and N iterations of training are performed, in which a different subset is selected as the validation set in each iteration.
[0131] Each iteration of training includes:
[0132] Select a subset as the optimization validation set, and the remaining N-1 subsets as the optimization training set. Use the optimization training set to train the fault prediction model to obtain the trained fault prediction model. Use the optimization validation set to evaluate the performance of the trained fault prediction model and record the evaluation metrics, which include accuracy, recall and F1 score.
[0133] Calculate the average evaluation metric for N iterations of training to evaluate the performance of the fault prediction model on different subsets;
[0134] S313. Select the combination with the highest average evaluation index from all parameter combinations as the optimal parameters, and retrain the random forest model using the optimal parameters.
[0135] In this embodiment, the training set is uniformly divided into N mutually exclusive subsets. In each round of cross-validation, one subset is selected as the validation set, and the remaining N-1 subsets are combined into the training set. The model is trained and its performance is evaluated, with key metrics such as accuracy, recall, and F1 score recorded. After N rounds of iteration, the average performance metrics across all rounds are calculated to obtain the model's overall performance on different data subsets. Subsequently, the number of decision trees, the maximum depth of each tree, and the feature sampling ratio are selected as model parameters to be tuned. A grid search strategy is used to traverse all possible combinations of these parameters, and N-fold cross-validation is performed on each combination, recording its average performance metrics. The set with the best performance metrics from all parameter combinations is selected as the optimal parameter settings for the model. The random forest model is retrained using these optimal parameters to improve the model's prediction accuracy.
[0136] To further predict the types of faults that may occur in transmission lines, after obtaining the effective features corresponding to different types of transmission line faults, a fault type prediction model can be constructed based on the effective features corresponding to different types of transmission line faults. Figure 7 is a flowchart illustrating the construction of a fault type prediction model provided by an embodiment of the present invention. As shown in Figure 7, the construction of the fault type prediction model includes steps S321 to S328:
[0137] S321. Select a random forest model as the initial model, and configure the number of decision trees, the maximum depth of the decision trees, and the feature sampling ratio in the initial model;
[0138] S322. For a selected type of transmission line fault, construct a corresponding feature subset based on its effective features;
[0139] S323. Construct a training set based on the data in the corresponding feature subset, and label each data in the training set;
[0140] For any data in the training set, if the transmission line at the time corresponding to the data has a selected type of transmission line fault, then the data is assigned a first label; otherwise, the data is assigned a second label.
[0141] S324. Randomly select a certain number of data from the training set to construct a subset dataset;
[0142] S325. Using all samples in the subset as initial input, create the root node of the decision tree;
[0143] S326. At the current node of the decision tree, randomly select a subset of features from the corresponding feature set, calculate the information gain of each selected feature, and select the feature with the largest information gain as the best splitting feature for the current node.
[0144] S327. Based on the data values of the best splitting features, divide the dataset corresponding to the current node into several subsets, with each subset corresponding to a new child node;
[0145] S328. Repeat steps S326 to S327 for each new child node until the current node has no remaining features that can be used for splitting, and record the current node as a leaf node.
[0146] For each leaf node, if the number of samples in the dataset corresponding to the leaf node that are assigned the first label is greater than the number of samples assigned the second label, then the category label of the leaf node is "selected type fault"; if the number of samples in the dataset corresponding to the leaf node that are assigned the second label is greater than the number of samples assigned the first label, then the category label of the leaf node is "non-selected type fault".
[0147] Real-time environmental factor data and power grid operation status data are input into the fault type classification model. The fault type classification model outputs the predicted fault type based on the input data and sends the fault type to external equipment.
[0148] In this embodiment, historical data on various types of transmission line faults, including short circuits, open circuits, overloads, and insulation damage, are collected. Based on the extracted feature matrix, the relationship between each feature and different fault types is analyzed, and the correlation degree between each feature and each fault type is calculated. Based on the correlation degree, effective features corresponding to different types of transmission line faults are extracted. Based on the effective features corresponding to different types of transmission line faults, a fault type classification model is constructed based on the random forest algorithm. When real-time environmental factor data and power grid operation status data are input into the model, the fault type classification model can predict potential fault types based on the input data and send the prediction results to external devices so that corresponding prevention or response measures can be taken in a timely manner.
[0149] After constructing the fault probability prediction model, the fault type classification model is trained using the training set. When the confidence level of the fault type classification model reaches the preset confidence level, the trained fault type classification model is obtained, specifically including steps S331 to S336:
[0150] S331. Divide the training set for each type of transmission line fault into N mutually exclusive subsets, each subset being of equal size, and perform N iterations of training. Each iteration of training includes: selecting one subset as the optimization validation set, and combining the remaining N-1 subsets into the optimization training set.
[0151] S332. Use the optimized training set to train a random forest model for the corresponding transmission line fault type to obtain a trained random forest model.
[0152] S333. Use the optimized validation set to evaluate the performance of the trained random forest model and record the evaluation metrics, including accuracy, recall and F1 score.
[0153] S334. Calculate the average evaluation metric for N iterations of training;
[0154] S335. Determine whether the average evaluation index has reached the preset reliability. If it has, then determine that the random forest model is a trained model for the corresponding transmission line fault type. If it has not, then adjust the number of decision trees, the maximum depth of the decision trees, and the feature sampling ratio in the initial model, and return to step S332 to continue training.
[0155] S336. Repeat steps S331 to S335 to complete the training of the random forest model corresponding to all transmission line fault types, and obtain the trained fault type classification model.
[0156] S4. Real-time acquisition of current environmental factor data and power grid operation status data, and input into the fault probability prediction model and fault type prediction model. The fault probability prediction model and fault type prediction model predict the probability of transmission line faults and the type of faults based on the input data.
[0157] S5. When the probability of a failure exceeds a preset threshold, an early warning program is activated.
[0158] In this embodiment, as one implementation of a power grid transmission line fault early warning method, the early warning procedure includes:
[0159] After the fault prediction model outputs the fault prediction result, early warning information is generated based on the prediction result. The early warning information includes the identification of the transmission line, the probability of fault, the expected time of fault occurrence, and the area that may be affected.
[0160] The generated early warning information is sent to the power grid dispatching system in real time;
[0161] After receiving the early warning information, the power grid dispatching system activates the early warning analysis module. The early warning analysis module generates various power grid operation mode adjustment schemes based on the current power grid operation status data, power grid topology information, and historical fault handling data.
[0162] A multi-objective optimization algorithm is used to evaluate the various generated adjustment schemes in order to select the optimal power grid operation mode adjustment scheme;
[0163] The power grid dispatching system generates specific control commands based on the selected optimal adjustment scheme. These control commands include switching operation commands and generator output adjustment commands.
[0164] In some embodiments, to visually demonstrate the location distribution of fault risks, we visualize the results output by the prediction model, including the following steps:
[0165] Obtain the geographic coordinate data of the power transmission lines;
[0166] By combining geographic coordinate data with the predicted probability and type of transmission line failure, a visual map is generated, which marks areas where transmission line failures may occur.
[0167] Specifically, by acquiring the geographical coordinate data of transmission lines and combining it with fault prediction results, a map visualization can be generated. Possible fault areas can be marked on the map, enabling an intuitive display of the location of power grid faults. This allows maintenance personnel to quickly locate the specific location of potential faults, thereby rationally allocating maintenance personnel and equipment resources and improving fault handling efficiency.
[0168] In other embodiments, to improve maintenance efficiency, a maintenance suggestion library is established, which contains maintenance suggestions for different fault types;
[0169] When a high-risk failure is predicted, a corresponding maintenance recommendation is matched and sent to an external terminal.
[0170] Specifically, by establishing a maintenance suggestion library containing suggestions for different fault types, when the fault prediction model detects a high-risk fault in a transmission line, the system can quickly retrieve the most suitable solution for the current fault type from the maintenance suggestion library and notify the operation and maintenance personnel in a timely manner, thereby shortening the emergency response time and improving the standardization and intelligence of operation and maintenance.
[0171] In summary, this invention provides a method for early warning of power grid transmission line faults. This method extracts feature variables based on historical environmental factor data and historical power grid operating status data. Based on these feature variables, it extracts features related to transmission line faults and effective features corresponding to different types of transmission line faults. Based on these features, it constructs a fault probability prediction model and a fault type prediction model. The prediction models predict the probability of transmission line faults and the potential types of faults, and initiate an early warning procedure based on the prediction results. Using this invention, environmental conditions and the operating status of transmission lines can be monitored in real time, and the probability and type of line faults can be determined in advance, allowing for timely preventative and handling measures to improve the reliability and security of the power grid.
[0172] Based on the method described in the above embodiments, this embodiment will further describe it from the perspective of a power grid transmission line fault early warning system. This power grid transmission line fault early warning system can be implemented as an independent entity or integrated into an electronic device, such as a terminal, which may include a mobile phone, tablet computer, etc.
[0173] Figure 8 is a structural schematic diagram of a power grid transmission line fault early warning system provided in an embodiment of the present invention. As shown in Figure 8, the power grid transmission line fault early warning system provided in an embodiment of the present invention includes:
[0174] The first processing module is used to acquire historical environmental factor data and historical power grid operation status data. The first processing module is used to execute the steps in S1.
[0175] The second processing module is used to extract feature variables based on the historical environmental factor data and historical power grid operation status data, and to extract features related to transmission line faults and effective features corresponding to different types of transmission line faults based on the feature variables. The second processing module is used to execute the steps in S2.
[0176] The third processing module is used to construct a fault probability prediction model based on the random forest algorithm according to the characteristics related to the transmission line fault, so as to predict the probability of the transmission line fault occurring; and to construct a fault type prediction model based on the random forest algorithm according to the effective characteristics corresponding to different types of transmission line faults, so as to predict the type of transmission line fault occurring. The third processing module is used to execute the steps in S3.
[0177] The fourth processing module is used to acquire current environmental factor data and power grid operation status data in real time and input them into the fault probability prediction model and the fault type prediction model. The fault probability prediction model and the fault type prediction model predict the probability of transmission line faults and the type of faults based on the input data. The fourth processing module is used to execute the steps in S4.
[0178] The fifth processing module is used to initiate an early warning program when the probability of a fault occurring exceeds a preset probability threshold. The fifth processing module is used to execute the steps in S5.
[0179] In practice, the above processing modules can be implemented as independent entities or combined arbitrarily as the same or several entities. For the specific implementation of the above processing modules, please refer to the previous method embodiments. For the specific beneficial effects that can be achieved, please also refer to the beneficial effects in the previous method embodiments, which will not be repeated here.
[0180] Additionally, Figure 9 is a schematic diagram of an electronic device provided in an embodiment of the present invention. This electronic device can be a mobile terminal such as a smartphone or tablet computer. As shown in Figure 9, the electronic device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the aforementioned power grid transmission line fault early warning method.
[0181] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. Therefore, embodiments of the present invention provide a storage medium storing multiple instructions that, when executed by a processor, can implement the steps in the above-described power grid transmission line fault early warning method.
[0182] Generally, the computer instructions for implementing the method of the present invention can be carried on any combination of one or more computer-readable storage media. Non-transitory computer-readable storage media can include any computer-readable medium except for the signal itself, which is temporarily propagating.
[0183] Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (not an exhaustive list) of computer-readable storage media include: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with a system, apparatus, or device that executes instructions.
[0184] Computer program code for performing the operations of this invention can be written using one or more programming languages or a combination thereof. These programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. In particular, Python, suitable for neural network computation, and platform frameworks based on TensorFlow, PyTorch, etc., can be used. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of remote computers, the remote computer can be connected to the user's computer via various types of networks, including local area networks (LANs) or wide area networks (WANs), or via an internet service provider.
[0185] Although embodiments of the present invention have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for early warning of faults in power grid transmission lines, characterized in that, include: S1. Acquire historical environmental factor data and historical power grid operation status data; S2. Extract feature variables based on the historical environmental factor data and historical power grid operation status data, and extract features related to transmission line faults and effective features corresponding to different types of transmission line faults based on the feature variables; S3. Construct a fault probability prediction model based on the random forest algorithm based on the features related to transmission line faults to predict the probability of transmission line faults; construct a fault type prediction model based on the random forest algorithm based on the effective features corresponding to different types of transmission line faults to predict the type of transmission line faults; S4. Acquire current environmental factor data and power grid operation status data in real time and input them into the fault probability prediction model and the fault type prediction model. The fault probability prediction model and the fault type prediction model predict the probability of transmission line faults and the type of faults based on the input data; S5. Activate an early warning program when the probability of a fault exceeds a preset probability threshold.
2. The method for early warning of power grid transmission line faults according to claim 1, characterized in that, The extraction of feature variables based on the historical environmental factor data and historical power grid operation status data includes: S201, extracting weather phenomenon data, temperature data, humidity data, and wind speed and direction data based on the historical environmental factor data, and recording the above data as feature variables respectively; extracting load rate data, current data, voltage data, and power factor data based on the historical power grid operation status data, and recording the above data as feature variables respectively; S202, constructing a feature matrix based on all feature variables, wherein each row of the feature matrix represents a time point, and each column represents a feature variable.
3. The method for early warning of power grid transmission line faults according to claim 2, characterized in that, The step of extracting features related to transmission line faults based on the feature variables includes: S211, calculating the first correlation coefficient between each feature variable in the feature matrix and the occurrence of transmission line faults, and recording the relevant feature vectors with the first correlation coefficient greater than a first preset threshold as significant variables; S212, calculating the second correlation coefficient between each significant variable, and recording two significant variables with the second correlation coefficient greater than a second preset threshold as a significant variable group; S213, retaining the significant variables with the larger first correlation coefficient in the significant variable group, and removing the significant variables with the smaller first correlation coefficient in the significant variable group, and recording the retained significant variables as features related to transmission line faults; The step of extracting effective features corresponding to different types of transmission line faults based on the feature variables includes: S221, calculating the correlation degree between each feature variable and different types of transmission line faults; S222, for any type of transmission line fault, the feature variable with a correlation degree greater than a preset correlation degree threshold is taken as its effective feature.
4. The method for early warning of power grid transmission line faults according to claim 3, characterized in that, The construction of the fault probability prediction model includes: S301, selecting a random forest model as the initial model, and configuring the number of decision trees, the maximum depth of the decision trees, and the feature sampling ratio in the initial model; S302, constructing a training set based on the data in the features related to transmission line faults, and labeling each data in the training set; for any data in the training set, if the transmission line is in a fault state at the time corresponding to the data, assign it a first label, otherwise assign it a second label; S303, randomly selecting a certain number of data from the training set to construct a subset; S304, using all samples in the subset as initial input to create the root node of the decision tree; S305, at the current node of the decision tree, randomly selecting a portion of features from all available features related to transmission line faults, and calculating each... S306. Based on the information gain of the selected features, the feature with the largest information gain is selected as the best splitting feature for the current node; S307. According to the data value of the best splitting feature, the dataset corresponding to the current node is divided into several subsets, and each subset corresponds to a new child node; S308. For each new child node, steps 309 to 301 are repeated until the current node has no remaining features that can be used for splitting, and the current node is recorded as a leaf node; For each leaf node, if the number of samples assigned the first label in the dataset corresponding to the leaf node is greater than the number of samples assigned the second label, then the category label of the leaf node is "fault"; if the number of samples assigned the second label in the dataset corresponding to the leaf node is greater than the number of samples assigned the first label, then the category label of the leaf node is "not faulty".
5. The method for early warning of power grid transmission line faults according to claim 4, characterized in that, After constructing the failure probability prediction model, the performance of the failure prediction model is evaluated through cross-validation, and the failure prediction model is optimized by adjusting the number and maximum depth of decision trees. The evaluation of the failure prediction model performance through cross-validation and the optimization of the failure prediction model by adjusting the number and maximum depth of decision trees include: S311, selecting the model parameters to be adjusted and their value ranges, the model parameters including: the number of decision trees, the maximum depth of each tree, and the feature sampling ratio; S312, using grid search to traverse all parameter combinations, performing N-fold cross-validation on each parameter combination to obtain the average evaluation index for each parameter combination; the N-fold cross-validation includes... The following steps are performed: The training set is divided into N mutually exclusive subsets of equal size, and N iterations of training are conducted. Each iteration includes: selecting one subset as the optimization validation set, and combining the remaining N-1 subsets into the optimization training set; training the fault prediction model using the optimization training set to obtain the trained fault prediction model; evaluating the performance of the trained fault prediction model using the optimization validation set and recording the evaluation metrics, including accuracy, recall, and F1 score; calculating the average evaluation metric for N iterations of training; S313, selecting the parameter combination with the highest average evaluation metric as the optimal parameters, and retraining the random forest model using the optimal parameters.
6. The method for early warning of power grid transmission line faults according to claim 3, characterized in that, The construction of the fault type prediction model includes: for each type of transmission line fault, constructing a corresponding random forest model to obtain the fault type prediction model; wherein, for a selected type of transmission line fault, constructing the corresponding random forest model includes: S321, selecting a random forest model as the initial model, configuring the number of decision trees, the maximum depth of the decision trees, and the feature sampling ratio in the initial model; S322, for the selected type of transmission line fault, constructing a corresponding feature subset based on its effective features; S323, constructing a training set based on the data in the corresponding feature subset, and labeling each data in the training set; for any data in the training set, if the transmission line at the time corresponding to the data has a selected type of transmission line fault, then assigning the data a first label, otherwise assigning the data a second label; S324, randomly extracting a certain number of data from the training set to construct a subset dataset; S325, using all samples in the subset dataset as initial input. Create the root node of the decision tree; S326. At the current node of the decision tree, randomly select a subset of features from the corresponding feature subset, calculate the information gain of each selected feature, and select the feature with the largest information gain as the best splitting feature for the current node; S327. Based on the data value of the best splitting feature, divide the dataset corresponding to the current node into several subsets, each subset corresponding to a new child node; S328. Repeat steps S326 to S327 for each new child node until the current node has no remaining features that can be used for splitting, and denote the current node as a leaf node; For each leaf node, if the number of samples assigned the first label in the dataset corresponding to the leaf node is greater than the number of samples assigned the second label, then the category label of the leaf node is "selected type fault"; if the number of samples assigned the second label in the dataset corresponding to the leaf node is greater than the number of samples assigned the first label, then the category label of the leaf node is "non-selected type fault".
7. The method for early warning of power grid transmission line faults according to claim 1, characterized in that, The method for early warning of power grid transmission line faults further includes: acquiring the geographical coordinate data of the transmission line; combining the geographical coordinate data with the predicted probability and type of transmission line faults to generate a visual map, wherein the visual map marks areas where transmission line faults may occur.
8. The method for early warning of power grid transmission line faults according to claim 1, characterized in that, The power grid transmission line fault early warning method further includes: establishing a maintenance suggestion library containing maintenance suggestions for different fault types; when the predicted probability of a fault occurring in the transmission line exceeds a preset threshold, matching the corresponding maintenance suggestion in the maintenance suggestion library according to the predicted fault type; and sending the maintenance suggestion to an external terminal.
9. A fault early warning system for power grid transmission lines, characterized in that, The system is used to execute the power grid transmission line fault early warning method as described in any one of claims 1 to 8, comprising: a first processing module for acquiring historical environmental factor data and historical power grid operating status data; a second processing module for extracting feature variables based on the historical environmental factor data and historical power grid operating status data, and extracting features related to transmission line faults and effective features corresponding to different types of transmission line faults based on the feature variables; a third processing module for constructing a fault probability prediction model based on a random forest algorithm according to the features related to transmission line faults, to predict the probability of transmission line faults; and constructing a fault type prediction model based on a random forest algorithm according to the effective features corresponding to different types of transmission line faults, to predict the type of transmission line faults; a fourth processing module for acquiring current environmental factor data and power grid operating status data in real time and inputting them into the fault probability prediction model and the fault type prediction model, wherein the fault probability prediction model and the fault type prediction model predict the probability of transmission line faults and the type of faults based on the input data; and a fifth processing module for activating an early warning program when the probability of a fault exceeds a preset probability threshold.
10. An electronic device, characterized in that, The electronic device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method as described in any one of claims 1 to 8.
