A power grid fault probability prediction method based on semantic vectorization normalization and adaptive regression
Through semantic vectorization normalization and adaptive regression methods, using one-hot encoding and model training, the problem of low power grid fault prediction accuracy is solved and higher prediction accuracy is achieved.
Patent Information
- Application Number
- CN202510329945.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-03-20
AI Technical Summary
The accuracy of power grid fault prediction in existing technologies is low, and it is difficult to effectively use historical fault event data of the power grid for accurate prediction.
A method based on semantic vectorization normalization and adaptive regression is adopted to encode unstructured data through the one-hot encoding algorithm to generate semantic feature vectors. The model is trained in combination with structured data, and regular backtesting and selection of the optimal model are used to predict the probability of power grid failure.
The accuracy of power grid fault prediction has been improved by combining structured and unstructured data for feature learning, regular training and backtesting to select the optimal model, thereby improving the accuracy of prediction.
Smart Images

Figure CN119848685B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power grid fault prediction, and in particular to a power grid fault probability prediction method based on semantic vectorization normalization and adaptive regression. Background Art
[0002] With the development of automated data collection and drone technology, real-time data on power grid operations and the environment in which they operate can be obtained more and more easily. Furthermore, with the widespread application of digital information, information previously manually generated by maintenance and inspection personnel, such as inspection logs and equipment defect descriptions, is now stored and managed centrally in local databases or cloud services.
[0003] After years of monitoring and maintenance, power grids have accumulated a wealth of historical fault event data, which can be used to predict grid failure probabilities. Utilizing this historical fault event data is a key factor in determining prediction accuracy. Therefore, there is an urgent need for an effective grid failure probability prediction solution to achieve accurate predictions. Summary of the Invention
[0004] The purpose of this application is to solve at least one of the above technical deficiencies, especially the technical defect of low prediction accuracy in the prior art.
[0005] In a first aspect, an embodiment of the present application provides a method for predicting power grid fault probability based on semantic vectorization normalization and adaptive regression, the method comprising:
[0006] In response to the arrival of the current update cycle, historical fault event data corresponding to the previous update cycle is obtained; wherein the historical fault event data includes structured data and unstructured data, the structured data includes power grid operation data and meteorological data, and the unstructured data includes fault description information and manual operation and maintenance information;
[0007] Encoding the unstructured data using a one-hot encoding algorithm to obtain a semantic feature vector;
[0008] Classifying the unstructured data according to the semantic feature vector and obtaining a semantic description type; wherein the semantic description type is used to reflect the power grid state described by the content of the unstructured data;
[0009] Using the semantic description types corresponding to the structured data and the unstructured data as training sets, model training is performed on at least two first fault prediction models, and at least two second fault prediction models are obtained; wherein the first fault prediction model is a fault prediction model obtained by training in the previous update cycle, and the second fault prediction model is a fault prediction model obtained by training in the current update cycle;
[0010] Backtesting each of the second fault prediction models respectively, and determining an optimal model among the second fault prediction models based on the backtesting results of each of the second fault prediction models;
[0011] The optimal model is deployed as a real-time prediction model for predicting the probability of power grid failure.
[0012] In some embodiments, the classifying the unstructured data according to the semantic feature vector and obtaining a semantic description type includes:
[0013] Calculating a vector distance between the semantic feature vector and a preset reference feature vector;
[0014] The unstructured data is classified according to the vector distance to obtain the semantic description type.
[0015] In some embodiments, at least two of the first fault prediction models include a first linear regression model and a first XGBoost regression model, and at least two of the second fault prediction models include a second linear regression model and a second XGBoost regression model.
[0016] In some embodiments, backtesting each of the second fault prediction models includes:
[0017] Backtesting the second linear regression model using a backtest data set to obtain a linear regression prediction result output by the second linear regression model, and transforming the linear regression prediction result to obtain a first fault prediction probability;
[0018] Backtesting the second XGBoost regression model using the backtest dataset, and obtaining a second fault prediction probability output by the second XGBoost regression model;
[0019] Calculating a third fault prediction probability based on a preset weight coefficient, the first fault prediction probability, and the second fault prediction probability;
[0020] Calculating a first backtest result according to a preset backtest algorithm and the first fault prediction probability;
[0021] Calculating a second backtest result according to the preset backtest algorithm and the second fault prediction probability;
[0022] A third backtest result is calculated according to the preset backtest algorithm and the third fault prediction probability.
[0023] In some embodiments, the preset backtesting algorithm includes a mean absolute error (MAE) algorithm, a mean square error (MSE) algorithm, and an R-squared algorithm.
[0024] In some embodiments, calculating a first backtest result according to a preset backtest algorithm and the first fault prediction probability includes:
[0025] Based on the first fault prediction probability, calculate a first MAE value using the mean absolute error (MAE) algorithm;
[0026] Based on the first fault prediction probability, using the mean square error (MSE) algorithm to calculate a first MSE value;
[0027] Based on the first fault prediction probability, calculate a first result using the R-squared algorithm, and subtract the difference between 1 and the first result as a first R-squared value;
[0028] Performing a weighted summation on the first MAE value, the first MSE value, and the first R-squared value to obtain the first backtest result;
[0029] The calculating a second backtest result according to the preset backtest algorithm and the second fault prediction probability includes:
[0030] Based on the second fault prediction probability, calculating a second MAE value using the mean absolute error (MAE) algorithm;
[0031] Based on the second fault prediction probability, using the mean square error (MSE) algorithm to calculate a second MSE value;
[0032] Based on the second fault prediction probability, calculate a second result using the R-squared algorithm, and subtract the difference between 1 and the second result as a second R-squared value;
[0033] Performing a weighted summation on the second MAE value, the second MSE value, and the second R-squared value to obtain the second backtest result;
[0034] The calculating a third backtest result according to the preset backtest algorithm and the third fault prediction probability includes:
[0035] Based on the third fault prediction probability, calculating a third MAE value using the mean absolute error (MAE) algorithm;
[0036] Based on the third fault prediction probability, calculating a third MSE value using the mean square error (MSE) algorithm;
[0037] Based on the third fault prediction probability, calculate a third result using the R-squared algorithm, and subtract the difference between 1 and the third result as a third R-squared value;
[0038] A weighted sum is performed on the third MAE value, the third MSE value, and the third R-squared value to obtain the third backtest result.
[0039] In a second aspect, an embodiment of the present application provides a power grid fault probability prediction device based on semantic vectorization normalization and adaptive regression, the device comprising:
[0040] A data acquisition module, configured to, in response to the arrival of a current update cycle, acquire historical fault event data corresponding to a previous update cycle; wherein the historical fault event data includes structured data and unstructured data, the structured data including power grid operation data and meteorological data, and the unstructured data including fault description information and manual operation and maintenance information;
[0041] An encoding module, configured to encode the unstructured data using a one-hot encoding algorithm and obtain a semantic feature vector;
[0042] a classification module, configured to classify the unstructured data according to the semantic feature vector and obtain a semantic description type; wherein the semantic description type is used to reflect the power grid state described by the content of the unstructured data;
[0043] A model training module, configured to perform model training on at least two first fault prediction models using the semantic description types corresponding to the structured data and the unstructured data as training sets, and obtain at least two second fault prediction models; wherein the first fault prediction model is a fault prediction model obtained by training in the previous update cycle, and the second fault prediction model is a fault prediction model obtained by training in the current update cycle;
[0044] a backtesting module, configured to backtest each of the second fault prediction models respectively, and determine an optimal model among the second fault prediction models based on the backtesting results of each of the second fault prediction models;
[0045] A model deployment module is used to deploy the optimal model as a real-time prediction model for predicting the probability of power grid failure.
[0046] In a third aspect, the present application further provides a computer device. The computer device includes: one or more processors, and a memory;
[0047] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the power grid fault probability prediction method based on semantic vectorization normalization and adaptive regression described in any of the above embodiments are executed.
[0048] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for predicting power grid fault probability based on semantic vectorization normalization and adaptive regression as described in any of the above embodiments.
[0049] In a fifth aspect, the present application further provides a computer program product, comprising a computer program that, when executed by a processor, implements the steps of the method for predicting power grid fault probability based on semantic vectorization normalization and adaptive regression as described in any of the above embodiments.
[0050] In a power grid fault probability prediction method based on semantic vectorization normalization and adaptive regression provided in some embodiments of the present application, on the one hand, structured data and unstructured data during the power grid operation process can be used simultaneously for model training, so that the fault prediction model can combine multiple information such as power grid operation data, meteorological data, fault description information, and manual operation and maintenance information for feature learning, thereby improving the model training effect and, in turn, improving the accuracy of fault prediction. On the other hand, the present application can regularly retrain and backtest at least two fault prediction models, and automatically select the optimal model as the real-time prediction model based on the backtest results, thereby further improving the accuracy of fault prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0052] Figure 1 A flowchart of a method for predicting power grid fault probability based on semantic vectorization normalization and adaptive regression in some embodiments is provided;
[0053] Figure 2 Schematic diagram of a power grid fault probability prediction device based on semantic vectorization normalization and adaptive regression in some embodiments;
[0054] Figure 3 This is a diagram of the internal structure of a computer device in some embodiments. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0056] In some embodiments, this application provides a method for predicting power grid fault probabilities based on semantic vectorization normalization and adaptive regression. The following embodiments illustrate this method using a computer device as an example. It should be understood that the computer device described herein can be any device capable of data acquisition and processing, including but not limited to desktop computers, laptops, notebook computers, tablet computers, servers, smartphones, and IoT devices.
[0057] like Figure 1 As shown, the power grid fault probability prediction method based on semantic vectorization normalization and adaptive regression of the present application may include the following steps:
[0058] S102: In response to the arrival of the current update cycle, historical fault event data corresponding to the previous update cycle is obtained.
[0059] Among them, historical fault event data refers to historical data related to power grid fault events, which may include structured data and unstructured data. Furthermore, historical fault event data may also include a predetermined true fault probability, which may be manually determined or automatically generated using other algorithms, and this application does not impose specific restrictions on this. Exemplarily, the process of determining the true fault probability may be: first, obtaining the historical operating data of the power grid and classifying the historical operating data, so that the operating data corresponding to the same operating condition are classified into the same category. Then, according to the historical operating status of the power grid, the fault probability corresponding to each operating condition is statistically calculated to obtain the true fault probability. For example, the power grid operates 10 times under a certain operating condition, 9 of which are without fault and 1 is with fault, then the true fault probability corresponding to the operating condition may be 10%.
[0060] Among them, structured data can be data with precise formats and rules, for example, data collected by sensor collection equipment. In the present application, structured data may include power grid operation data and meteorological data. Power grid operation data refers to data that can be used to reflect the operation status of the power grid, including but not limited to at least one of the voltage data, current data, active power data, reactive power data, frequency data, etc. of the power grid before and after the fault event occurs. Meteorological data refers to environmental data of the environment in which the power grid facilities are located, including but not limited to at least one of the temperature data, humidity data, wind direction data, irradiance data, lightning probability data, etc.
[0061] Unstructured data may be data with irregular data structures, such as text information entered by operation and maintenance personnel. In this application, unstructured data may include fault description information and manual operation and maintenance information. Fault description information refers to text used to describe the power grid fault situation, including but not limited to at least one of the following: text describing the fault location, text describing the fault type, and text describing the environment at the fault location. Manual operation and maintenance information refers to text data generated during the power grid operation and maintenance process and used to describe the operation and maintenance situation. For example, manual operation and maintenance information may include data such as inspection records and equipment defect history records.
[0062] In this application, the computer device may periodically execute steps S102 to S112 based on the duration of the update cycle to periodically train and backtest the fault prediction model based on historical fault event data. Specifically, when the current update cycle arrives, the computer device may obtain historical fault event data generated or recorded during the previous update cycle to train the model using the most recently generated or recorded historical fault event data. It will be understood that the duration of the update cycle can be determined based on actual circumstances, and this application does not impose any specific restrictions on this.
[0063] S104: Encode the unstructured data using a one-hot encoding algorithm and obtain a semantic feature vector.
[0064] In this step, since the unstructured data's content describes the fault event and is therefore a characteristic of the fault event, it is necessary to use it for model training. However, since unstructured data is not a specific value and cannot be directly used in model training, it is necessary to vectorize the unstructured data so that the vectorized structure reflects the data content.
[0065] Specifically, computer equipment can use a one-hot encoding algorithm to encode fault description information and manual operation and maintenance information, thereby vectorizing and normalizing unstructured data and generating semantic feature vectors. It can be understood that semantic feature vectors can represent the data content in unstructured data in the form of vectors.
[0066] Among them, the one-hot encoding algorithm refers to the use of an N-bit state register to encode N states, which is a representation of a categorical variable as a binary vector. In the process of encoding using the one-hot encoding algorithm, a dictionary can be first constructed based on the provided text. Then, based on the one-hot encoding expression, an N-dimensional vector corresponding to the unstructured data (for example, an N-dimensional vector corresponding to the fault description information) is constructed. The dimension of this vector is consistent with the length of the dictionary. When a given word is expressed in a vector, the register at the corresponding position where it appears in the dictionary is assigned a value of 1, and the rest are 0. The assignment can be regarded as the label information of the corresponding word or the classification information of the object. In some examples, the text construction dictionary can be constructed based on power keywords, for example, it can include keywords such as grounding, overcurrent, and external force damage.
[0067] S106: Classify the unstructured data according to the semantic feature vector and obtain a semantic description type.
[0068] In this step, because the semantic feature vector reflects the content of the unstructured data, the power keyword status represented by the semantic feature vector can be determined and classified accordingly, resulting in a semantic description type that reflects the power grid status described by the unstructured data. For example, semantic description types may include ground fault, overcurrent, external force damage, and the simultaneous presence of ground fault and overcurrent.
[0069] It is understood that the computer device can implement classification processing and obtain semantic description types in any manner, for example, classification can be implemented through a neural network model. In some examples, S106 may include the following sub-steps:
[0070] Step A1: Calculate the vector distance between the semantic feature vector and the preset reference feature vector;
[0071] Step A2: Classify the unstructured data according to the vector distance and obtain the semantic description type.
[0072] In this example, the baseline feature vector can be pre-set based on actual conditions such as the vector format of the one-hot encoding algorithm. For example, an all-zero vector can be used as the baseline feature vector. The computer device can calculate the vector distance between the semantic feature vector and the baseline feature vector to reflect the difference between the semantic feature vector and the baseline feature vector through the vector distance. It is understood that the vector distance can be any type of vector distance, such as the Euclidean distance, and this application does not impose any specific limitations on this.
[0073] In this example, by calculating the vector distance between the semantic feature vector and the preset reference feature vector and performing classification based on the distance, both classification accuracy and classification efficiency can be taken into account.
[0074] S108: Using the semantic description types corresponding to the structured data and the unstructured data as training sets, perform model training on at least two first fault prediction models, and obtain at least two second fault prediction models.
[0075] The first fault prediction model is a fault prediction model obtained by training in the previous update cycle, and the second fault prediction model is a fault prediction model obtained by training in the current update cycle.
[0076] In this step, in each update cycle, the computer device can perform model training on multiple first fault prediction models trained in the previous update cycle based on the historical fault event data corresponding to the previous update cycle, and obtain the second fault prediction model trained in the current update cycle.
[0077] Specifically, the computer device can use structured data such as power grid operation data and meteorological data, as well as semantic description types of unstructured data, as training sets to train multiple first fault prediction models trained in the previous update cycle until a preset training end condition is met, and a second fault prediction model corresponding to the current update cycle is obtained. The multiple second fault prediction models corresponding to the current update cycle are used as the multiple first fault prediction models corresponding to the next update cycle.
[0078] It is understandable that the model types of multiple fault prediction models can be selected according to actual conditions, and this application does not impose specific restrictions on this. In some examples, linear regression models and XGBoost regression models can be used as fault prediction models. That is, in the current update cycle, the training set corresponding to the current update cycle can be used to perform synchronous machine learning training on the first linear regression model and the first XGBoost regression model trained in the previous update cycle, and obtain the trained second linear regression model and the second XGBoost regression model. In this way, both prediction efficiency and prediction accuracy can be taken into account.
[0079] S110: backtesting each second fault prediction model respectively, and determining an optimal model among the second fault prediction models according to the backtesting results of each second fault prediction model.
[0080] In this step, after completing model training for the current update cycle, the computer device may backtest each second fault prediction model and obtain a backtest result corresponding to each second fault prediction model. Because the backtest results can reflect the prediction accuracy of the second fault prediction model, after obtaining the backtest results for each second fault prediction model, the present application may determine the optimal model with the best prediction effect among the multiple second fault prediction models based on the individual backtest results.
[0081] It is understood that the present application may implement model backtesting in any manner. In some examples, backtesting each second fault prediction model may include the following sub-steps:
[0082] Step B1: backtesting the second linear regression model using the backtest data set, obtaining a linear regression prediction result output by the second linear regression model, and transforming the linear regression prediction result to obtain a first fault prediction probability;
[0083] Step B2: backtesting the second XGBoost regression model using the backtest dataset, and obtaining a second fault prediction probability output by the second XGBoost regression model;
[0084] Step B3: Calculating a third fault prediction probability based on a preset weight coefficient, the first fault prediction probability, and the second fault prediction probability;
[0085] Step B4: Calculating a first backtest result according to a preset backtest algorithm and the first fault prediction probability;
[0086] Step B5: Calculating a second backtest result according to a preset backtest algorithm and a second fault prediction probability;
[0087] Step B6: Calculate the third backtest result according to the preset backtest algorithm and the third fault prediction probability.
[0088] In this example, the backtest dataset can be a subset of the training dataset. That is, the computer device can select a portion of the data from the training dataset as the backtest dataset, and use the backtest dataset to backtest the second linear regression model, the second XGBoost regression model, and the combined model. The combined model refers to a model that is obtained by combining the second linear regression model and the second XGBoost regression model according to preset weight coefficients.
[0089] Specifically, the computer device may input the structured data and unstructured data in the backtest dataset into a second linear regression model and obtain a linear regression prediction result output by the second linear regression model. The linear regression prediction result may be transformed to obtain a first fault prediction probability. For the second XGBoost regression model, the computer device may input the structured data and unstructured data in the backtest dataset into the second XGBoost regression model and obtain a second fault prediction probability output by the second XGBoost regression model.
[0090] After obtaining the first and second predicted failure probabilities, the computer device may perform a weighted summation of the first and second predicted failure probabilities based on a preset weight coefficient to obtain a third predicted failure probability corresponding to the combined model. It is understood that the specific value of the weight coefficient may be determined based on actual circumstances, such as 0.5 / 0.5 (i.e., the third predicted failure probability is the average of the first and second predicted failure probabilities), and this application does not impose any specific limitations on this.
[0091] When the fault prediction probability is obtained from the model output, the computer device can compare the model prediction result with the entire training set, and use the preset backtesting algorithm to obtain the backtesting result corresponding to the second linear regression model (i.e., the first backtesting result), the backtesting result corresponding to the second XGBoost regression model (i.e., the second backtesting result), and the backtesting result corresponding to the combined model (i.e., the third backtesting result).
[0092] It is understood that the preset backtesting algorithm may be one or more, and the number and type of algorithms can be determined based on actual conditions. In some examples, the preset backtesting algorithm may include a mean absolute error (MAE) algorithm, a mean square error (MSE) algorithm, and an R-squared algorithm to comprehensively and accurately determine the backtesting effect of the fault prediction model. The calculation formula for the mean absolute error (MAE) algorithm may be as follows:
[0093]
[0094] Where m is the number of data samples in the backtest dataset, is the true failure probability, is the predicted failure probability output by the model.
[0095] The calculation formula of the mean square error MSE algorithm can be shown as follows:
[0096]
[0097] The calculation formula of the R-squared algorithm can be shown as follows:
[0098]
[0099] Where n is the number of data samples in the backtest dataset, is the average value of all true failure probabilities corresponding to the backtest dataset.
[0100] In some examples, when the preset backtesting algorithm may include a mean absolute error (MAE) algorithm, a mean square error (MSE) algorithm, and an R-squared algorithm, the step of calculating the first backtesting result may include:
[0101] Step B41: Calculate a first MAE value using a mean absolute error (MAE) algorithm based on the first fault prediction probability;
[0102] Step B42: Based on the first fault prediction probability, a first MSE value is calculated using a mean square error (MSE) algorithm;
[0103] Step B43: Based on the first fault prediction probability, an R-squared algorithm is used to calculate a first result, and the difference between 1 and the first result is used as a first R-squared value.
[0104] Step B44: performing weighted summation on the first MAE value, the first MSE value, and the first R-squared value to obtain a first backtest result.
[0105] In this example, the computer device may use a mean absolute error (MAE) algorithm, a mean square error (MSE) algorithm, and an R-squared algorithm to calculate the difference between the first predicted fault probability and the actual fault probability, and obtain a first MAE value, a first MSE value, and a first R-squared value, respectively. The computer device may perform a weighted summation of the first MAE value, the first MSE value, and the first R-squared value to obtain the backtest result corresponding to the second linear regression model. In some examples, the weights corresponding to the first MAE value, the first MSE value, and the first R-squared value are all 1 / 3.
[0106] In some examples, when the preset backtesting algorithm may include a mean absolute error (MAE) algorithm, a mean square error (MSE) algorithm, and an R-squared algorithm, the step of calculating the second backtesting result may include:
[0107] Step B51: Based on the second fault prediction probability, a second MAE value is calculated using a mean absolute error (MAE) algorithm;
[0108] Step B52: Based on the second fault prediction probability, a second MSE value is calculated using a mean square error (MSE) algorithm;
[0109] Step B53: Based on the second fault prediction probability, an R-squared algorithm is used to calculate a second result, and the difference between 1 and the second result is used as a second R-squared value;
[0110] Step B54: Perform weighted summation on the second MAE value, the second MSE value, and the second R-squared value to obtain a second backtest result.
[0111] In this example, the computer device may use the mean absolute error (MAE) algorithm, the mean square error (MSE) algorithm, and the R-squared algorithm to calculate the difference between the second fault prediction probability and the actual fault probability, and obtain a second MAE value, a second MSE value, and a second R-squared value, respectively. The computer device may perform a weighted summation of the second MAE value, the second MSE value, and the second R-squared value to obtain the backtest effect corresponding to the second XGBoost regression model. In some examples, the weights corresponding to the second MAE value, the second MSE value, and the second R-squared value are all 1 / 3.
[0112] In some examples, when the preset backtesting algorithm may include a mean absolute error (MAE) algorithm, a mean square error (MSE) algorithm, and an R-squared algorithm, the step of calculating the third backtesting result may include:
[0113] Step B61: Based on the third fault prediction probability, a third MAE value is calculated using a mean absolute error (MAE) algorithm;
[0114] Step B62: Based on the third fault prediction probability, a third MSE value is calculated using a mean square error (MSE) algorithm;
[0115] Step B63: Based on the third fault prediction probability, an R-squared algorithm is used to calculate a third result, and the difference between 1 and the third result is used as a third R-squared value;
[0116] Step B64: Perform weighted summation on the third MAE value, the third MSE value, and the third R-squared value to obtain a third backtest result.
[0117] In this example, the computer device may use a mean absolute error (MAE) algorithm, a mean square error (MSE) algorithm, and an R-squared algorithm to calculate the difference between the third predicted fault probability and the actual fault probability, and obtain a third MAE value, a third MSE value, and a third R-squared value, respectively. The computer device may perform a weighted sum of the third MAE value, the third MSE value, and the third R-squared value to obtain a backtesting result corresponding to the combined model. In some examples, the weights corresponding to the third MAE value, the third MSE value, and the third R-squared value are all 1 / 3.
[0118] S112: Deploy the optimal model as a real-time prediction model for predicting power grid failure probability.
[0119] In this step, the computer device can automatically select the optimal model with the highest prediction accuracy as the real-time prediction model based on the backtest results corresponding to the current update cycle, and deploy the real-time prediction model online to use the real-time prediction model to predict the failure rate of lines or equipment at various points in the power grid in the future.
[0120] In the above embodiment, on the one hand, model training can be performed using both structured and unstructured data from the grid operation process. This allows the fault prediction model to combine multiple types of information, such as grid operation data, meteorological data, fault description information, and manual operation and maintenance information, for feature learning. This improves the model training effect and, in turn, the accuracy of fault prediction. On the other hand, the present application can periodically retrain and backtest at least two fault prediction models and automatically select the optimal model as the real-time prediction model based on the backtest results, thereby further improving the accuracy of fault prediction.
[0121] The following describes the power grid fault probability prediction device based on semantic vectorization normalization and adaptive regression provided in an embodiment of the present application. The power grid fault probability prediction device based on semantic vectorization normalization and adaptive regression described below and the power grid fault probability prediction method based on semantic vectorization normalization and adaptive regression described above can be referenced to each other.
[0122] In some embodiments, as Figure 2 As shown, the present application provides a power grid fault probability prediction device 200 based on semantic vectorization normalization and adaptive regression, comprising:
[0123] Data acquisition module 202 is configured to, in response to the arrival of the current update cycle, acquire historical fault event data corresponding to the previous update cycle; wherein the historical fault event data includes structured data and unstructured data, the structured data including power grid operation data and meteorological data, and the unstructured data including fault description information and manual operation and maintenance information;
[0124] An encoding module 204 is configured to encode the unstructured data using a one-hot encoding algorithm and obtain a semantic feature vector;
[0125] A classification module 206 is configured to classify the unstructured data according to the semantic feature vector and obtain a semantic description type, wherein the semantic description type is used to reflect the power grid state described by the content of the unstructured data;
[0126] A model training module 208 is configured to perform model training on at least two first fault prediction models using the semantic description types corresponding to the structured data and the unstructured data as training sets, and obtain at least two second fault prediction models; wherein the first fault prediction model is a fault prediction model obtained by training in the previous update cycle, and the second fault prediction model is a fault prediction model obtained by training in the current update cycle;
[0127] A backtesting module 210 is configured to backtest each of the second fault prediction models and determine an optimal model among the second fault prediction models based on the backtesting results of each of the second fault prediction models;
[0128] The model deployment module 212 is configured to deploy the optimal model as a real-time prediction model for predicting power grid failure probability.
[0129] In some embodiments, the classification module 206 of the present application includes:
[0130] A distance calculation unit, configured to calculate a vector distance between the semantic feature vector and a preset reference feature vector;
[0131] A classification unit is used to classify the unstructured data according to the vector distance and obtain the semantic description type.
[0132] In some embodiments, at least two of the first fault prediction models include a first linear regression model and a first XGBoost regression model, and at least two of the second fault prediction models include a second linear regression model and a second XGBoost regression model.
[0133] In some embodiments, the backtest module 210 of the present application includes:
[0134] a first probability acquisition unit, configured to backtest the second linear regression model using a backtest data set, obtain a linear regression prediction result output by the second linear regression model, and transform the linear regression prediction result to obtain a first fault prediction probability;
[0135] a second probability acquisition unit, configured to backtest the second XGBoost regression model using the backtest dataset and obtain a second fault prediction probability output by the second XGBoost regression model;
[0136] A third probability acquisition unit, configured to calculate a third fault prediction probability based on a preset weight coefficient, the first fault prediction probability, and the second fault prediction probability;
[0137] A first result obtaining unit, configured to calculate a first backtest result according to a preset backtest algorithm and the first fault prediction probability;
[0138] A second result obtaining unit, configured to calculate a second backtest result according to the preset backtest algorithm and the second fault prediction probability;
[0139] The third result obtaining unit is configured to calculate a third backtest result according to the preset backtest algorithm and the third fault prediction probability.
[0140] In some embodiments, the preset backtesting algorithm includes a mean absolute error (MAE) algorithm, a mean square error (MSE) algorithm, and an R-squared algorithm.
[0141] In some embodiments, the first result obtaining unit of the present application includes:
[0142] A first score calculation unit is configured to calculate a first MAE value based on the first fault prediction probability using the mean absolute error (MAE) algorithm;
[0143] A second score calculation unit is configured to calculate a first MSE value based on the first fault prediction probability by using the mean square error (MSE) algorithm;
[0144] a third score calculation unit, configured to calculate a first result based on the first fault prediction probability using the R-squared algorithm, and subtract a difference between 1 and the first result as a first R-squared value;
[0145] A first weighted summation unit is configured to perform weighted summation on the first MAE value, the first MSE value, and the first R-squared value to obtain the first backtest result.
[0146] The second result obtaining unit of the present application includes:
[0147] a fourth score calculation unit, configured to calculate a second MAE value based on the second fault prediction probability by using the mean absolute error (MAE) algorithm;
[0148] a fifth score calculation unit, configured to calculate a second MSE value based on the second fault prediction probability by using the mean square error (MSE) algorithm;
[0149] a sixth score calculation unit, configured to calculate a second result based on the second fault prediction probability using the R-squared algorithm, and subtract a difference between 1 and the second result as a second R-squared value;
[0150] The second weighted summation unit is used to perform weighted summation on the second MAE value, the second MSE value and the second R-squared value to obtain the second backtest result.
[0151] The third result obtaining unit of this application includes:
[0152] a seventh score calculation unit, configured to calculate a third MAE value based on the third fault prediction probability by using the mean absolute error (MAE) algorithm;
[0153] an eighth score calculation unit, configured to calculate a third MSE value based on the third fault prediction probability by using the mean square error (MSE) algorithm;
[0154] a ninth score calculation unit, configured to calculate a third result based on the third fault prediction probability using the R-squared algorithm, and subtract a difference between 1 and the third result as a third R-squared value;
[0155] The third weighted summation unit is used to perform weighted summation on the third MAE value, the third MSE value and the third R-squared value to obtain the third backtest result.
[0156] In one embodiment, the present application also provides a computer device having computer-readable instructions stored therein. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the power grid fault probability prediction method based on semantic vectorization normalization and adaptive regression as in any embodiment.
[0157] Schematically, Figure 3 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. In one example, the computer device may be a server. Figure 3 Computer device 900 includes a processing component 902, which further includes one or more processors, and memory resources represented by memory 901 for storing instructions executable by processing component 902, such as application programs. The application programs stored in memory 901 may include one or more modules, each corresponding to a set of instructions. Furthermore, processing component 902 is configured to execute the instructions to perform the steps of the power grid fault probability prediction method based on semantic vectorization normalization and adaptive regression described in any of the above embodiments.
[0158] The computer device 900 may further include a power supply component 903 configured to perform power management of the computer device 900, a wired or wireless network interface 904 configured to connect the computer device 900 to a network, and an input / output (I / O) interface 905. The computer device 900 may operate based on an operating system stored in the memory 901, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or the like.
[0159] Those skilled in the art will understand that the internal structure of the computer device shown in the present application is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0160] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the power grid fault probability prediction method based on semantic vectorization normalization and adaptive regression described in any of the above embodiments are implemented.
[0161] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the steps of the power grid fault probability prediction method based on semantic vectorization normalization and adaptive regression described in any of the above embodiments.
[0162] Finally, it should be noted that, in this article, relational terms such as first and second are merely used to distinguish one entity or operation from another, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. Without further restriction, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element. Herein, "one," "said," "the," and "its" may also include plural forms unless the context clearly indicates otherwise. A plurality refers to at least two, such as 2, 3, 5, or 8. "And / or" includes any and all combinations of the relevant listed items.
[0163] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referenced to each other.
[0164] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for predicting power grid fault probability based on semantic vectorization normalization and adaptive regression, characterized in that: The method comprises: In response to the arrival of the current update cycle, historical fault event data corresponding to the previous update cycle is obtained; wherein the historical fault event data includes structured data and unstructured data, the structured data includes power grid operation data and meteorological data, and the unstructured data includes fault description information and manual operation and maintenance information; Encoding the unstructured data using a one-hot encoding algorithm to obtain a semantic feature vector; Classifying the unstructured data according to the semantic feature vector and obtaining a semantic description type; wherein the semantic description type is used to reflect the power grid state described by the content of the unstructured data; Using the semantic description types corresponding to the structured data and the unstructured data as training sets, model training is performed on at least two first fault prediction models, and at least two second fault prediction models are obtained; wherein, the first fault prediction model is a fault prediction model obtained by training in the previous update cycle, the second fault prediction model is a fault prediction model obtained by training in the current update cycle, at least two of the first fault prediction models include a first linear regression model and a first XGBoost regression model, and at least two of the second fault prediction models include a second linear regression model and a second XGBoost regression model; Backtesting each of the second fault prediction models respectively, and determining an optimal model among the second fault prediction models based on the backtesting results of each of the second fault prediction models; deploying the optimal model as a real-time prediction model for predicting power grid failure probability; The backtesting of each of the second fault prediction models includes: Backtesting the second linear regression model using a backtest data set to obtain a linear regression prediction result output by the second linear regression model, and transforming the linear regression prediction result to obtain a first fault prediction probability; Backtesting the second XGBoost regression model using the backtest dataset, and obtaining a second fault prediction probability output by the second XGBoost regression model; Calculating a third fault prediction probability based on a preset weight coefficient, the first fault prediction probability, and the second fault prediction probability; Calculate a first backtest result according to a preset backtest algorithm and the first fault prediction probability; wherein the preset backtest algorithm includes a mean absolute error (MAE) algorithm, a mean square error (MSE) algorithm, and an R-squared algorithm; Calculating a second backtest result according to the preset backtest algorithm and the second fault prediction probability; A third backtest result is calculated according to the preset backtest algorithm and the third fault prediction probability.
2. The method according to claim 1, characterized in that The classifying and processing the unstructured data according to the semantic feature vector to obtain a semantic description type includes: Calculating a vector distance between the semantic feature vector and a preset reference feature vector; The unstructured data is classified according to the vector distance to obtain the semantic description type.
3. The method according to claim 1, characterized in that The calculating a first backtest result according to a preset backtest algorithm and the first fault prediction probability includes: Based on the first fault prediction probability, calculate a first MAE value using the mean absolute error (MAE) algorithm; Based on the first fault prediction probability, using the mean square error (MSE) algorithm to calculate a first MSE value; Based on the first fault prediction probability, calculate a first result using the R-squared algorithm, and subtract the difference between 1 and the first result as a first R-squared value; Performing a weighted summation on the first MAE value, the first MSE value, and the first R-squared value to obtain the first backtest result; The calculating a second backtest result according to the preset backtest algorithm and the second fault prediction probability includes: Based on the second fault prediction probability, calculating a second MAE value using the mean absolute error (MAE) algorithm; Based on the second fault prediction probability, using the mean square error (MSE) algorithm to calculate a second MSE value; Based on the second fault prediction probability, calculate a second result using the R-squared algorithm, and subtract the difference between 1 and the second result as a second R-squared value; Performing a weighted summation on the second MAE value, the second MSE value, and the second R-squared value to obtain the second backtest result; The calculating a third backtest result according to the preset backtest algorithm and the third fault prediction probability includes: Based on the third fault prediction probability, calculating a third MAE value using the mean absolute error (MAE) algorithm; Based on the third fault prediction probability, calculating a third MSE value using the mean square error (MSE) algorithm; Based on the third fault prediction probability, calculate a third result using the R-squared algorithm, and subtract the difference between 1 and the third result as a third R-squared value; A weighted sum is performed on the third MAE value, the third MSE value, and the third R-squared value to obtain the third backtest result.
4. A power grid fault probability prediction device based on semantic vectorization normalization and adaptive regression, characterized in that: The device comprises: A data acquisition module, configured to, in response to the arrival of a current update cycle, acquire historical fault event data corresponding to a previous update cycle; wherein the historical fault event data includes structured data and unstructured data, the structured data including power grid operation data and meteorological data, and the unstructured data including fault description information and manual operation and maintenance information; An encoding module, configured to encode the unstructured data using a one-hot encoding algorithm and obtain a semantic feature vector; a classification module, configured to classify the unstructured data according to the semantic feature vector and obtain a semantic description type; wherein the semantic description type is used to reflect the power grid state described by the content of the unstructured data; A model training module, configured to perform model training on at least two first fault prediction models using the semantic description types corresponding to the structured data and the unstructured data as training sets, and obtain at least two second fault prediction models; wherein the first fault prediction model is a fault prediction model obtained by training in the previous update cycle, the second fault prediction model is a fault prediction model obtained by training in the current update cycle, the at least two first fault prediction models include a first linear regression model and a first XGBoost regression model, and the at least two second fault prediction models include a second linear regression model and a second XGBoost regression model; a backtesting module, configured to backtest each of the second fault prediction models respectively, and determine an optimal model among the second fault prediction models based on the backtesting results of each of the second fault prediction models; A model deployment module, configured to deploy the optimal model as a real-time prediction model for predicting power grid failure probability; Wherein, the backtest module includes: a first probability acquisition unit, configured to backtest the second linear regression model using a backtest data set, obtain a linear regression prediction result output by the second linear regression model, and transform the linear regression prediction result to obtain a first fault prediction probability; a second probability acquisition unit, configured to backtest the second XGBoost regression model using the backtest dataset and obtain a second fault prediction probability output by the second XGBoost regression model; A third probability acquisition unit, configured to calculate a third fault prediction probability based on a preset weight coefficient, the first fault prediction probability, and the second fault prediction probability; A first result acquisition unit is configured to calculate a first backtest result based on a preset backtest algorithm and the first fault prediction probability; wherein the preset backtest algorithm includes a mean absolute error (MAE) algorithm, a mean square error (MSE) algorithm, and an R-squared algorithm; A second result obtaining unit, configured to calculate a second backtest result according to the preset backtest algorithm and the second fault prediction probability; The third result obtaining unit is configured to calculate a third backtest result according to the preset backtest algorithm and the third fault prediction probability.
5. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, which, when executed by the one or more processors, execute the steps of the power grid fault probability prediction method based on semantic vectorization normalization and adaptive regression as described in any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the power grid fault probability prediction method based on semantic vectorization normalization and adaptive regression as described in any one of claims 1 to 3 are implemented.
7. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the power grid fault probability prediction method based on semantic vectorization normalization and adaptive regression as described in any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Model training method and device, computer device and computer readable storage medium
CN109885378A
Information prediction method and device
CN114519610A
Visual early warning analysis method and device for electrical equipment damage, equipment and medium
CN119379266A