A large model driven power grid fault research and judgment evaluation method and system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID SHANDONG ELECTRIC POWER CO
- Filing Date
- 2026-03-13
- Publication Date
- 2026-06-26
Smart Images

Figure CN122286368A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system fault handling technology, and more specifically, to a large model-driven method and system for power grid fault assessment and evaluation. Background Technology
[0002] Relay protection systems are crucial for the stable operation of power systems. Through the coordinated work of measurement units, logic judgment units, and execution units, they promptly isolate faulty components and handle abnormal operating states, meeting the requirements of selectivity, speed, sensitivity, and reliability. However, with the increasing scale and complexity of power systems, traditional power grid fault diagnosis methods struggle to meet the demands for real-time performance and accuracy.
[0003] Traditional relay protection setting calculations require comprehensive consideration of multiple factors, including power system operating mode, protected equipment characteristics, fault type and location, protection device type and principle, and coordination requirements. However, system parameters and operating characteristics vary greatly under different operating modes, limiting the effectiveness of traditional methods in handling complex and ever-changing situations. Furthermore, the application of large-scale models in power system fault analysis faces challenges across multiple levels, including technical, data, economic, and application aspects, such as non-interpretability, high data quality requirements, high training costs, and industry adaptability issues. Therefore, this invention provides a large-scale model-driven method and system for power grid fault assessment and evaluation. Summary of the Invention
[0004] The purpose of this invention is to provide a large model-driven method and system for power grid fault assessment, which utilizes the advantages of large models to improve the efficiency of power grid fault detection, analysis and recovery, and realizes the dynamic binding of power system operation mode and protection settings, so as to solve the problems of insufficient real-time performance and accuracy of traditional methods mentioned in the background art.
[0005] To achieve the above objectives, the present invention aims to provide a large model-driven method for power grid fault assessment and evaluation, comprising the following steps: S1. Collect power system data and preprocess it to obtain preprocessed data; among which, power system data includes electrical quantity data and switching quantity data; S2. A large model based on the Transformer architecture performs a regression task on the preprocessed data and outputs the order of the power system's operating modes. ; S3. Determine the number of internal storage levels. and the number of operating modes Are they equal? S4, if the internal storage levels Equal to the number of operation levels If the current variable setpoint of the electrical quantity remains unchanged, then the variable setpoint of the electrical quantity is maintained. The function, and It is an integer greater than or equal to 4; S5, if the internal storage levels Not equal to the number of operating modes This increases the number of internal storage levels. Equal to the number of operation levels And based on the updated series Update the variable setpoints of electrical quantities for power system relay protection; S6. Use a large model based on the Transformer architecture to perform a classification task on the preprocessed data and generate fault diagnosis results.
[0006] As a further improvement to this technical solution, in S1, the electrical quantity data includes real-time measured values of voltage, current and power, and the switching quantity data includes the status information of circuit breakers and disconnectors.
[0007] As a further improvement to this technical solution, the specific steps involved in the preprocessing of power system data in step S1 are as follows: The collected power system data is cleaned by removing outliers using the power system parameter threshold method and filling in missing values using linear interpolation. The cleaned data is then subjected to Min-Max normalization to scale the data to... The range is used to obtain normalized data; Feature engineering was performed on the normalized data to extract fault analysis-related features, including voltage fluctuation rate and current harmonics. After undergoing the aforementioned data cleaning, normalization, and feature engineering extraction processes, the power system data is preprocessed.
[0008] As a further improvement to this technical solution, in S2, the large model based on the Transformer architecture includes an input embedding layer, a positional encoding layer, a Transformer encoder layer, a fully connected layer, and an output layer; wherein, The input embedding layer is used to convert the preprocessed data into a vector form suitable for model processing, resulting in an embedding vector. ; The location encoding layer is used to provide the model with temporal information from time-series data, generate location vectors, and correlate them with embedded vectors. Adding them together yields a vector containing positional information. ; The Transformer encoder layer extracts features through a multi-head self-attention mechanism and a feedforward neural network, based on vectors with positional information. pass through in sequence Each Transformer encoder layer has an identical structure. The output of each layer is processed by residual connection and layer normalization before being used as the input to the next layer, ultimately yielding the encoder layer output. ; The fully connected layer outputs the encoder layer. Mapping to the output format required for the regression task, we obtain the output of the fully connected layer. ; The output layer will output the fully connected layer. Direct output yields the power system's operating mode level. .
[0009] As a further improvement to this technical solution, in the large model based on the Transformer architecture, the input embedding layer is used to convert the preprocessed data into a vector form suitable for model processing. The specific steps involved in obtaining the embedding vector are as follows: Based on preprocessed data With weight matrix Perform matrix multiplication and then map the result to a vector of the model dimension through a linear transformation. The result of the linear transformation mapping is the embedding vector. , where the embedding vector The feature dimension is .
[0010] As a further improvement to this technical solution, in the large model based on the Transformer architecture, the position encoding layer is used to provide the model with temporal information of the time series data. The specific steps involved in generating the position vector are as follows: The time step position is determined based on the time sequence of data collection. Based on embedding vectors Feature Dimensions Determine the location encoding dimension and dimension index The range of values for ; Position based on time step and dimensional index The positional encoding value for even-numbered dimensions is calculated using a sine function; Position based on time step and dimensional index The positional encoding value for odd-numbered dimensions is calculated using the cosine function; The position encoding values of even-numbered and odd-numbered dimensions are combined to form a unique position vector corresponding to each time step.
[0011] As a further improvement to this technical solution, in the large model based on the Transformer architecture, the specific steps involved in the Transformer encoder layer extracting features through a multi-head self-attention mechanism and a feedforward neural network are as follows: Location-based vectors The learnable weight matrix in the multi-head self-attention mechanism is invoked to apply the input features. Perform a linear transformation to calculate the query vector. Key vector Sum value vector and by increasing the feature dimension Divide by the number of attention heads Obtain the key vector The dimension is ; query vector With key vector Perform matrix multiplication on the transpose of the matrix, and then divide the result by the dimension of the key vector. Scaling the square root; The attention weights are obtained by applying the Softmax function to the scaled result. Compare attention weights with value vectors Perform matrix multiplication to obtain the output features of the multi-head self-attention mechanism. ; Output features of multi-head self-attention mechanism As input to the feedforward neural network, the learnable parameters in the feedforward neural network are called, including the first weight matrix of the feedforward neural network. The first bias parameter The second weight matrix The second bias parameter ; The first weight matrix based on the feedforward neural network The first bias parameter The input of the feedforward neural network is subjected to a first linear transformation and the ReLU activation function is applied to obtain the intermediate layer output. The second weight matrix based on the feedforward neural network The second bias parameter The intermediate layer output is then subjected to a second linear transformation to obtain the output of the feedforward neural network.
[0012] As a further improvement to this technical solution, in step S5, based on the updated level... The specific steps involved in updating the variable setting values of electrical quantities in power system relay protection are as follows: If the number of internal storage levels Not equal to the number of operating modes Then first, the number of levels in the internal storage. Update to runtime level ; Calling predefined electrical quantity variable setpoints and levels The functional relationship will update the series. Substitute into function In this process, new variable constants for electrical quantities are obtained through function calculations; The new variable electrical setting values are sent to the power system's relay protection devices through the system's communication interface, thus completing the update of the variable electrical setting values for the relay protection devices. and All values are integers greater than or equal to 4, and the variable setpoints of electrical quantities are series. The function.
[0013] On the other hand, the present invention provides a large model-driven power grid fault assessment and evaluation system, including... The acquisition module collects power system data and preprocesses it to obtain preprocessed data. This data includes electrical quantity data and switching quantity data. Based on a large model using the Transformer architecture, the preprocessed data is analyzed and processed, ultimately outputting the power system's operating mode level. ; The comparison module is used to determine the number of internal storage levels. and the number of operating modes Are they equal? The update module is used to update the number of internal storage levels. Not equal to the number of operating modes This increases the number of internal storage levels. Equal to the number of operation levels And based on the updated series Update the variable setpoints of electrical quantities for power system relay protection, wherein the variable setpoints of electrical quantities are of the number of stages. The function, and It is an integer greater than or equal to 4.
[0014] As another embodiment of the present invention, a large model-driven power grid fault assessment system further includes a large model module based on the Transformer architecture, which is used to perform regression tasks on the preprocessed data to obtain the operating mode level. The preprocessed data is then classified to generate fault diagnosis results.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This large-model-driven power grid fault assessment method and system integrates a large-model module based on the Transformer architecture, which can give full play to the advantages of the large model, realize efficient analysis and processing of power system data and fault diagnosis, further improve the system's intelligence level and fault handling capabilities, and provide strong support for the stable operation of the power system.
[0016] 2. This large-model-driven power grid fault assessment method and system utilizes a large model based on the Transformer architecture to effectively capture long-distance dependencies and complex patterns in power system data. Compared to traditional methods, it offers higher accuracy and real-time performance in fault detection and analysis. The large model's multi-head self-attention mechanism and feedforward neural network extract richer features, providing a more reliable basis for updating relay protection settings, improving the performance of relay protection devices, and enhancing the stability and security of power system operation. This solution leverages the powerful analytical capabilities of the large model to achieve dynamic binding between operating modes and protection settings, improving the timeliness and flexibility of fault response and reducing the difficulty of relay protection coordination. Through preprocessing of power system data and optimized model training, the model's adaptability to power system data under different operating conditions is improved, reducing the impact of data quality issues on fault analysis results. Attached Figure Description
[0017] Figure 1 This is a flowchart of a large model-driven power grid fault assessment method in some embodiments of this application; Figure 2 This is a schematic diagram of the structure of a large model for power system fault handling in some embodiments of this application; Figure 3 This is a schematic diagram of the structure of a large model-driven power grid fault assessment system in some embodiments of this application. Detailed Implementation
[0018] 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.
[0019] Example 1: Please see Figure 1 As shown, this embodiment provides a large model-driven method for power grid fault assessment, including the following steps: S1. Collect electrical quantity data (such as voltage and current) and switching quantity data (such as circuit breaker status) of the power system and preprocess them to obtain preprocessed data. The feature dimensions of the electrical quantity data and the switching quantity data are as follows: ; In this embodiment, electrical quantity data includes real-time measured values such as voltage, current, and power, and switching quantity data includes status information of circuit breakers and disconnectors; In this embodiment, the specific steps involved in preprocessing power system data are as follows: The collected power system data is cleaned by removing outliers using the power system parameter threshold method and filling in missing values using linear interpolation. The cleaned data is then subjected to Min-Max normalization to scale the data to... The range is used to obtain normalized data; Feature engineering was performed on the normalized data to extract fault analysis-related features, including voltage fluctuation rate and current harmonics. Among them, fault analysis-related features include voltage fluctuation rate ((current voltage - previous voltage) / previous voltage) and current harmonic content (calculated by decomposing the current signal through Fourier transform and calculating the amplitude ratio of each harmonic). After undergoing the aforementioned data cleaning, normalization, and feature engineering extraction processes, the power system data is preprocessed.
[0020] S2. A large model based on the Transformer architecture performs a regression task on the preprocessed data and outputs the order of the power system's operating modes. ; In this embodiment, the number of operation levels It is an integer abstraction of the complexity of power system operating states. Its core is related to the system operating characteristics reflected by the power system topology, electrical quantity data, and switching quantity data. Specifically, it is reflected in the operating scenario level determined by the combination of component switching on / off, power distribution, and equipment operating states in the system, and the different operating modes. The values correspond to different operating conditions of the system (such as differentiated operating scenarios like multi-branch operation versus few-branch operation, high power output versus low power output, etc.). The classification criteria are based on the requirements for safe and stable operation of the power system, combined with the normal fluctuation range of electrical quantity data (real-time measurements of voltage, current, and power), the combination logic of switch quantity data (circuit breaker and disconnector status information), and the parameter thresholds preset by the system for different operating conditions. This divides the system operating status into multiple levels, and the number of operating mode levels is... The value should be no less than 4 to cover common complex operating scenarios in the system; the number of levels in this operating mode is... This provides a crucial basis for subsequent judgments on whether to update the variable settings of electrical quantities in relay protection; For example, the number of operation levels =4 (Basic Guarantee Operation Scenario) corresponds to the minimum operating mode of the power grid. The switch quantity display shows that the core components (1 main transformer and 2 110kV tie lines) are closed and the rest are open for maintenance. The electrical quantities show that the voltage is close to the lower limit of the rated voltage (9.5-9.8kV for 10kV system), the current is low load (30%-40% of the rated current), and the power only meets the basic electricity needs of residents. The variable setting value of the electrical quantities is set according to the sensitivity priority (overcurrent protection 1.2 times the rated current). Operational level =5 (normal transition operation scenario) corresponds to the power grid maintenance transition mode. The switch quantity display shows that one additional tie line is closed, and one main transformer is still in operation. The electrical quantities show that the voltage returns to the rated range (9.8-10.2kV for 10kV system), the current increases to 50%-60% of the rated value, and the power is increased by 20%-30% compared to the basic guarantee operation scenario. The variable setting value of the electrical quantities is set according to the balance between sensitivity and reliability (overcurrent protection 1.5 times the rated current). Operational level =6 (normal operation scenario) corresponds to the daily operation mode of the power grid. The core components of the switch display (2 main transformers and 3 tie lines) are all closed. The electrical quantities are in stable rated voltage (10.0-10.3kV for 10kV system), current is maintained at 60%-70% of the rated value, power is matched with load demand, and the variable setpoints of the electrical quantities are set according to reliability priority (overcurrent protection 1.8 times the rated current). Operational level =7 (Peak-segment normal operation scenario) corresponds to the grid load peak-segment operation mode. The switching quantities are the same as the normal operation scenario of the flat segment. The electrical quantities are characterized by voltage close to the rated lower limit (9.7-10.0kV for 10kV system), current increased to 80%-90% of the rated value, and power reaching the daily peak value. The electrical quantities can be finely adjusted with variable setpoints (overcurrent protection 1.8 times the rated current, voltage protection 9.5kV). Operational level =8 (maximum redundancy operation scenario) corresponds to the power grid's critical power supply / extreme peak mode. The switch quantity display shows that the redundant components (3 main transformers and 4 tie lines) are closed and 1 is on standby. The electrical quantities show that the voltage is higher than the rated voltage (10.2-10.5kV for 10kV systems), the current is close to the rated voltage (90%-100%), and the power has a margin. The variable setting values of the electrical quantities are set according to the priority of anti-disturbance (overcurrent protection 2.0 times the rated current, voltage protection upper limit 10.6kV). S3. Determine the number of internal storage levels. and the number of operating modes Are they equal? In this embodiment, specifically, the number of internal storage levels is calculated using a built-in numerical comparison algorithm. and the number of operating modes The difference; If the difference is not 0, the result is that they are not equal; if the difference is equal to 0, the result is that they are equal. S4, if the internal storage levels Equal to the number of operation levels If the current variable setpoint of the electrical quantity remains unchanged, then the variable setpoint of the electrical quantity is maintained. The function, and It is an integer greater than or equal to 4; Specifically, the variable setpoints of electrical quantities include variable setpoints of current, variable setpoints of voltage, variable setpoints of time, variable setpoints of impedance, and variable setpoints of directional element angles; Formulas for calculating variable constant values for current: in, For series-based The current setting (such as the overcurrent protection setting). The rated current of the protected equipment (the rated current of a 110kV line is usually taken as 400A-630A, and the rated current of a 220kV main transformer is usually taken as 1000A-1500A). This is the slope coefficient of the current setpoint (e.g., 0.08 for a 110kV power grid). This is the current setpoint intercept coefficient (e.g., 1.1 for 110kV lines), preset according to the fault current level under different power grid operating modes, used for adapting to different levels. Current fluctuations and fault current characteristics under corresponding operating scenarios; Formulas for calculating variable constants in voltage categories: in, For series-based Voltage setting (such as undervoltage protection setting). The system's rated voltage (e.g., 10kV, 35kV); This is the voltage setpoint slope coefficient (e.g., 0.05 for a 10kV power grid). This is the voltage setpoint intercept factor (e.g., 0.88 for a 10kV system), based on the stage. The voltage stability range is preset for the corresponding operating scenario to match the allowable voltage fluctuation range under different operating modes; Formula for calculating time-related variable constants: in, For series-based Time settings (such as overcurrent protection time limit). The base time setting is (typically 0.5s-1s, such as 0.5s for distribution network overcurrent protection). The slope coefficient for the time constant (e.g., 0.15 for distribution networks). The time setpoint intercept coefficient (e.g., 0.9 for distribution networks) is determined based on the level. Pre-set protection coordination requirements for corresponding operating scenarios to ensure a balance between the selectivity and speed of protection actions under different operating modes; It is the natural logarithm; Impedance-type variable constant calculation formula: in, For series-based Impedance setting (such as distance protection impedance setting). The rated impedance of the protected line (approximately 0.4Ω-0.6Ω per kilometer for 10kV lines and approximately 0.01Ω-0.02Ω per kilometer for 220kV lines). This is the slope coefficient for the impedance setpoint (e.g., 0.03 for a 10kV line). The impedance setpoint intercept factor (e.g., 1.0 for a 10kV line) is determined based on the series. Preset system impedance changes for corresponding operating scenarios to adapt to differences in equivalent system impedance under different operating modes; Formula for calculating the variable constant value of the directional element angle: in, For series-based The directional element angle setting value, The basic angle setting (typical value is -30° to 30°, such as 0° for line direction protection); The slope coefficient is a constant value for the angle (e.g., 2°). The angle intercept coefficient is a fixed value (e.g., 6°), based on the series. The power flow direction and fault direction characteristics are preset according to the corresponding operating scenarios to ensure the accuracy of the directional element in different operating modes; S5, if the internal storage levels Not equal to the number of operating modes This increases the number of internal storage levels. Equal to the number of operation levels And based on the updated series Update the variable setting values of electrical quantities for power system relay protection; In this embodiment, based on the updated level The specific steps involved in updating the variable setting values of electrical quantities in power system relay protection are as follows: If the number of internal storage levels Not equal to the number of operating modes Then first, the number of levels in the internal storage. Update to runtime level ; Calling predefined electrical quantity variable setpoints and levels The functional relationship will update the series. Substitute into function In this process, new variable setpoints for electrical quantities are obtained through function calculations; where the function... Including the current-type variable constant calculation formula (i.e. The voltage-type variable constant calculation formula (i.e.) The time-class variable constant calculation formula (i.e.) The formula for calculating the variable constant value of impedance (i.e.) ) and the formula for calculating the variable constant value of the direction element angle (i.e. Before updating the variable setpoints of electrical quantities, the power system data is preprocessed. Specifically, the collected power system data is preprocessed, outliers are removed using the power system parameter threshold method, and missing values are filled in using linear interpolation to obtain cleaned data; The principle of the power system parameter threshold method is as follows: Combined with the rules of the power system field, a reasonable range of values is preset. Values exceeding the range are judged as abnormal values and deleted. For example, switch quantity data (circuit breaker status) is only allowed to be 0 (open) or 1 (closed). If other values appear, they are directly deleted. The normal range of voltage data is 9.5kV~10.5kV. Values exceeding this range are judged as abnormal and deleted. The principle of linear interpolation: If the time series data contains the first... Time data missing (denoted as) Then, using the two adjacent valid data points before and after the missing point, the imputation value is calculated using a linear formula, which is: .
[0021] S6. Use a large model based on the Transformer architecture to perform a classification task on the preprocessed data, generate fault diagnosis results, and generate fault handling suggestions based on the diagnosis results. The Transformer model maps the feature vectors output by the encoder to the output format required for fault classification or regression tasks through a fully connected layer based on the preprocessed data. The output layer generates fault diagnosis results, such as fault type, fault location, and fault severity; fault handling suggestions include protection action strategies and equipment maintenance plans. The new variable electrical setting values are sent to the power system's relay protection devices through the system's communication interface, thus completing the update of the variable electrical setting values for the relay protection devices. and All values are integers greater than or equal to 4, and the variable setpoints of electrical quantities are series. The function.
[0022] By monitoring changes in the power system topology in real time and updating the variable settings of electrical quantities in relay protection, this solution can quickly adapt to changes in the power system's operating mode, improving the accuracy and reliability of relay protection and reducing false or missed fault diagnoses caused by topology changes. This solution leverages the powerful analytical capabilities of a large model to dynamically bind operating modes and protection settings, improving the timeliness and flexibility of fault response and reducing the difficulty of relay protection coordination.
[0023] The following specific embodiment illustrates the implementation process of the present invention: When a power system topology change occurs (such as a line disconnection), the acquisition module monitors this change in real time and preprocesses the data to obtain preprocessed data. The large model module then analyzes and processes the preprocessed data to determine the operating mode level. .
[0024] The comparison module compares the number of levels before the change. sum series ,Discover If so, the update module will be triggered.
[0025] The update module will It is updated to level 5, and a new variable setpoint for electrical quantities is calculated based on level 5, which is then applied to the relay protection device.
[0026] The large model module analyzes the preprocessed data and generates fault diagnosis results. The fault diagnosis module generates fault handling suggestions based on the diagnosis results and displays them to maintenance personnel through the user interface module.
[0027] The logging module records the topology changes, value updates, and fault handling processes. The self-learning module optimizes the parameters and structure of the large model module based on historical data.
[0028] By monitoring and dynamically adjusting relay protection settings in real time, the protection devices are ensured to always match the operating status of the power system, thereby improving the safety and stability of the system.
[0029] By leveraging large models based on the Transformer architecture, efficient and accurate fault diagnosis can be achieved, reducing fault handling time and mitigating the impact of faults on the power system.
[0030] Through data storage, log recording, and self-learning modules, the system can achieve continuous optimization and intelligent upgrading, adapting to the dynamic changes and complex operating conditions of the power system.
[0031] It provides an intuitive user interface and secure communication mechanisms, making it convenient for operation and maintenance personnel to operate and manage, and ensuring the reliability and ease of use of the system.
[0032] Example 2: Please see Figure 2 As shown, this embodiment provides a large model-driven power grid fault assessment and evaluation system, including... A large model module based on the Transformer architecture is used to analyze and process power system data to obtain the number of operating modes. The large model module includes an input embedding layer, a positional encoding layer, a Transformer encoder layer, a fully connected layer, and an output layer. In specific applications, the model may be adjusted appropriately according to task requirements, such as removing the decoder layer in certain situations.
[0033] The role of the input embedding layer is to transform raw power system data (such as voltage, current, gas concentration, etc.) into a vector form suitable for model processing. This layer typically includes standardization of the input data and embedding operations. For example, when processing dissolved gas analysis (DGA) data, the numerical values of different gas concentrations are converted into fixed-dimensional embedding vectors. The purpose of this step is to map the raw data to a low-dimensional space while preserving the key features of the data so that subsequent encoder layers can process it more effectively.
[0034] The encoder layer is the core of the Transformer model, responsible for learning the feature representation of the input data. It consists of multiple identical encoder modules stacked together, each of which includes two main sub-layers: a multi-head self-attention mechanism sub-layer and a feedforward neural network sub-layer.
[0035] Multi-head self-attention is one of the key innovations of the Transformer model. It allows the model to learn different features of the input data simultaneously in different subspaces. Specifically, the input data is first divided into multiple heads, and each head independently calculates attention weights for the input data. These weights reflect the correlations between different input features, enabling the model to dynamically focus on important features. For example, in power system fault analysis, the model can use multi-head self-attention to simultaneously focus on the relationships between features such as voltage fluctuations, current changes, and gas concentrations.
[0036] The role of the feedforward neural network sublayer is to perform further nonlinear transformations on the output of the multi-head self-attention mechanism. It is a simple two-layer fully connected neural network, typically containing a ReLU activation function. The purpose of this sublayer is to perform more complex processing on the features at each location to extract higher-level feature representations.
[0037] The role of a fully connected layer is to transform the feature vector output by the encoder layer into a form suitable for classification or regression tasks. This layer typically contains multiple neurons, each corresponding to a specific fault type or output value.
[0038] The output layer generates the final fault analysis result based on the output of the fully connected layer. In classification tasks, the output layer normalizes the data using an activation function (such as Softmax), calculates the probability of each fault type, and selects the category with the highest probability as the final fault diagnosis result. In regression tasks, the output layer outputs an integer greater than or equal to 4, representing the operating mode level of the power system.
[0039] Before training the model, power system data needs to be preprocessed. This includes steps such as data cleaning, normalization, and feature engineering. For example, for DGA data, feature engineering methods can be used to extract features related to fault types. Furthermore, to address data imbalance, oversampling techniques (such as SMOTE) can be employed to increase the number of minority class samples.
[0040] The model training process consists of two phases: forward propagation and back propagation. In the forward propagation phase, the input data passes sequentially through the input embedding layer, encoder layer, fully connected layer, and output layer to obtain the model's predictions. Then, the model's performance is evaluated by calculating the loss function (such as the cross-entropy loss function) between the predictions and the ground truth labels. In the back propagation phase, the model's parameters are updated based on the gradient of the loss function. This process is repeated until the model's performance no longer improves.
[0041] Tuning hyperparameters is crucial to model performance. For example, hyperparameters such as the number of encoder layers, the number of heads in the multi-head self-attention mechanism, and the number of neurons in fully connected layers all need to be optimized based on the specific task. Typically, optimal hyperparameter combinations can be found using methods such as grid search or random search.
[0042] Model evaluation typically uses methods such as cross-validation.
[0043] The large-scale power system fault analysis model based on the Transformer model is a deep learning model that combines the advantages of the Transformer architecture. It can effectively process complex time-series data in power systems, capture fault characteristics, and perform accurate fault diagnosis. The following is a detailed structure of the model and the algorithm implementation for each layer: A large model based on the Transformer architecture includes an input embedding layer, a positional encoding layer, a Transformer encoder layer, a fully connected layer, and an output layer; among which, Input Embedding Layer: Converts preprocessed data into a vector form suitable for model processing.
[0044] The role of the input embedding layer is to convert preprocessed data (such as voltage, current, power, etc.) into fixed-dimensional embedding vectors. The specific implementation is as follows: Specifically, based on the preprocessed data With weight matrix Perform matrix multiplication and then map the result to a vector of the model dimension through a linear transformation. in, The input is preprocessed data; The input embedding layer has a learnable weight matrix with dimension O(n). ( The feature dimensions of the preprocessed data, (The vector dimension of the data processed by the model). For embedding layer; The result of the linear transformation mapping is the embedding vector. , where the embedding vector The feature dimension is ; Positional Encoding Layer: Provides the model with temporal information from the time series data, helping the model capture temporal dependencies; positional encoding generates a unique position vector for each time step using sine and cosine functions; Specifically, the position of the time step is determined based on the time sequence of data acquisition. Based on embedding vectors Feature Dimensions Determine the location encoding dimension and dimension index The range of values for ; in, The time step is the position used to indicate the chronological order of data in the time series. The time step corresponding to the data collected this time ; The position encoding dimension, and the embedding vector The feature dimensions are consistent; This is the dimension index, used to distinguish different dimensions of the positional encoding vector, with a value ranging from 0 to... ; Position based on time step and dimensional index Even-numbered dimensions (the 1st dimension) are calculated using a sine function. Location encoding values (in each dimension); in, Scaling factor The positional encoding value for even-numbered dimensions; Position based on time step and dimensional index Calculate odd-numbered dimensions (the first dimension) using the cosine function. Location encoding values (in each dimension); in, For odd-numbered dimensions, the positional encoding value is used. The position encoding values of even-numbered and odd-numbered dimensions are combined to form a unique position vector corresponding to each time step; Transformer Encoder Layer: The core component, each encoder layer consists of two sub-layers: a multi-head self-attention mechanism sub-layer and a feedforward neural network sub-layer.
[0045] The Transformer encoder layer extracts features through a multi-head self-attention mechanism and a feedforward neural network, based on vectors with positional information. pass through in sequence There are two identical Transformer encoder layers, in which The preset total number of encoder layers is a positive integer. The output of each layer is processed by residual connection and layer normalization before being used as the input of the next layer, ultimately yielding the encoder layer output. ; Specifically, vectors based on location information The learnable weight matrix in the multi-head self-attention mechanism is invoked to apply the input features. Perform a linear transformation to calculate the query vector. Key vector Sum value vector and by increasing the feature dimension Divide by the number of attention heads Obtain the key vector The dimension is ; in, The input features of the multi-head self-attention mechanism sublayer are initialized as vectors with positional information. ; , , These are the learnable query, key, and value weight matrices in a multi-head self-attention mechanism; Let be the dimension of the key vector. The number of attention heads in a multi-head self-attention mechanism; For query vector, For key vectors, It is a value vector; query vector With key vector Perform matrix multiplication on the transpose of the matrix, and then divide the result by the dimension of the key vector. Scaling the square root; The attention weights are obtained by applying the Softmax function to the scaled result. Compare attention weights with value vectors Perform matrix multiplication to obtain the output features of the multi-head self-attention mechanism. ; in, This represents the softmax normalization function. Attention weights; This is a multi-head self-attention mechanism. The output features of the multi-head self-attention mechanism sublayer; Output features of multi-head self-attention mechanism As input to the feedforward neural network, the learnable parameters in the feedforward neural network are called, including the first weight matrix of the feedforward neural network. The first bias parameter The second weight matrix The second bias parameter ; in, This is the first weight matrix of the feedforward neural network. This represents the number of neurons in the intermediate layer of the feedforward neural network. This is the first bias parameter of the feedforward neural network; This is the second weight matrix of the feedforward neural network; This is the second bias parameter of the feedforward neural network; The first weight matrix based on the feedforward neural network The first bias parameter The input of the feedforward neural network is subjected to a first linear transformation and the ReLU activation function is applied to obtain the intermediate layer output. The second weight matrix based on the feedforward neural network The second bias parameter The intermediate layer output is subjected to a second linear transformation to obtain the output of the feedforward neural network. in, It is a feedforward neural network; The function implements ReLU activation, retaining positive values and suppressing negative values; Residual connectivity and layer normalization: in, For layer normalization processing, This is the output of the sublayer; Fully Connected Layer: Maps the feature vectors output by the encoder to the output format required for fault classification or regression tasks; The fully connected layer outputs the encoder layer. Mapping to the output format required for the regression task, we obtain the output of the fully connected layer. ; in, The weight matrix is a learnable matrix for the fully connected layer. These are the learnable bias parameters for the fully connected layer. It is a fully connected layer. This is the output of the fully connected layer; Output Layer: Generates the final fault diagnosis results; In the regression task, the output layer outputs the fully connected layer. Direct output yields the power system's operating mode level. ; In classification tasks, the output layer outputs the fully connected layer's output through the Softmax function. The results are converted into category probabilities, and then the category with the highest probability is selected as the final fault diagnosis result. in, It is the softmax activation function; The index function that maximizes the value determines the final category label from the probability distribution; This represents the probability distribution of fault categories; This is the result of the fault diagnosis; Before training the model, the power system data needs to be preprocessed, including data cleaning, normalization and feature engineering.
[0046] Loss function: For classification tasks, the cross-entropy loss function is used; for regression tasks, the mean squared error loss function is used. Optimizer: The Adam optimizer is typically used, and its learning rate can be adjusted according to the training process.
[0047] Tuning hyperparameters is crucial to model performance. Common hyperparameters include the number of encoder layers, the number of heads in a multi-head attention mechanism, and the number of neurons in a feedforward neural network. These can be optimized using methods such as grid search or random search.
[0048] The Transformer-based power system fault analysis model offers the following advantages: Powerful feature extraction capabilities: The Transformer model, through its multi-head self-attention mechanism, can capture long-range dependencies and complex patterns in the data. Global awareness: Compared to traditional convolutional neural networks, the Transformer model can globally perceive the input data, quickly and accurately identifying fault characteristics. Interpretability: The attention mechanism of the Transformer model can be visualized, aiding in the analysis of the model's decision-making process. This model is suitable for various fault analysis tasks in power systems, such as transient stability assessment, fault classification, and fault location.
[0049] Topology analysis and operation mode determination of power systems are crucial for their safe and stable operation. With the continuous expansion and increasing complexity of power systems, traditional analysis methods are no longer sufficient to meet the demands for efficient and accurate analysis. In recent years, the Transformer model, as a powerful deep learning architecture, has achieved significant results in natural language processing and computer vision. Its application in power systems has also gradually attracted attention, particularly in topology analysis and operation mode determination. This paper will detail the specific process of power system topology analysis and operation mode determination based on the Transformer model.
[0050] The topology of a power system reflects the connections between its various components (such as generators, transformers, and lines). Accurate topology analysis can help identify weak points in the system, optimize network configuration, and provide a foundation for fault analysis and operational optimization.
[0051] The topology analysis method based on the Transformer model includes the following steps: The first step is data preprocessing.
[0052] Data source: The input data required for topology analysis includes node information, branch information, and electrical parameters of components in the power system.
[0053] Data formatting: Convert this data into a format suitable for Transformer model processing, such as representing the connection relationship between nodes and branches in the form of an adjacency matrix or edge list.
[0054] Normalization: Electrical parameters are normalized to improve the training efficiency of the model.
[0055] The second step is the construction of the Transformer model.
[0056] Input embedding layer: Embeds the feature vectors of nodes and branches into a fixed-dimensional vector space. For example, features such as the voltage level of a node and the impedance of a branch can be used as the input for embedding.
[0057] Location coding: In power system topology analysis, location coding can be used to represent the relative positions of nodes in the network. Through location coding, the model can better capture the spatial relationships between nodes.
[0058] Multi-head self-attention mechanism: The core of the Transformer model is the multi-head self-attention mechanism, which can simultaneously extract the relationships between nodes and branches from multiple subspaces. For example, the model can identify which nodes or branches play a key role in the topology through attention weights.
[0059] Feedforward neural networks: perform further nonlinear transformations on the output of the self-attention mechanism to extract higher-level features.
[0060] Layer normalization and residual connections: Apply layer normalization and residual connections after each sub-layer to reduce the gradient vanishing problem during training.
[0061] Then comes model training and optimization.
[0062] Loss function: Choose a loss function suitable for topology analysis, such as the cross-entropy loss function, to measure the difference between the topology output by the model and the true topology.
[0063] Optimizer: The Adam optimizer is used to update the model parameters and optimize the training process through a learning rate adjustment strategy.
[0064] Training data: Using historical topology data and known network configurations as training data, the model is trained with a large number of samples so that it can learn the characteristics of the topology.
[0065] Finally, there is the model output and interpretation.
[0066] Topology recognition: The model output can be represented as a matrix of connection relationships between nodes and branches, and the topology can be displayed through visualization tools.
[0067] Attention weight analysis: By analyzing the weight distribution of multi-head self-attention mechanisms, nodes and branches that play a key role in the topology can be identified. For example, nodes with high attention weights may represent critical hubs in the system.
[0068] The operating mode of a power system refers to the system's operating state over a certain period of time, including generator start-up and shutdown, line connection and disconnection, and load distribution. Determining the operating mode requires consideration of system safety and economy; common operating modes include maximum operating mode and minimum operating mode.
[0069] Feature extraction of operating mode.
[0070] Feature selection: Extract features related to the operating mode from the results of topology analysis, such as the voltage level of nodes and the power flow distribution of branches.
[0071] Feature fusion: The topological features are fused with the operating status features (such as generator output, load level, etc.) to form a comprehensive feature vector.
[0072] Classification and prediction of operating modes Model building: Based on the Transformer model, add a classification or regression module to predict how the system will operate.
[0073] Training data: Historical operating data is used as training samples, including system states under different operating modes.
[0074] Model training: By optimizing the loss function, the model is trained to learn the mapping relationship between the operating mode and the system state.
[0075] Model output: The model output is the classification result of the system's operating mode, such as the maximum operating mode or the minimum operating mode.
[0076] Dynamic adjustment of operating mode Real-time data input: During actual operation, the system's status data is monitored in real time and input into the model.
[0077] Dynamic prediction: The model dynamically predicts the current operating mode based on real-time data and adjusts the system's operating strategy according to the prediction results.
[0078] The method for power system topology analysis and operation mode determination based on the Transformer model has significant advantages. The multi-head self-attention mechanism of the Transformer model can efficiently capture complex relationships in the topology, and provides important support for the safe operation of the power system by dynamically predicting operation modes. However, this method still faces some challenges, such as model interpretability and computational complexity. Future research directions include further optimizing the model structure to improve interpretability, and combining the Transformer model with other techniques (such as graph neural networks) to better address the complexity of power systems.
[0079] Example 3: Please see Figure 3 As shown, this embodiment provides a large model-driven power grid fault assessment and evaluation system, including... The acquisition module collects power system data and preprocesses it to obtain preprocessed data, including electrical quantity data and switching quantity data. Based on a large model using the Transformer architecture, the preprocessed data is analyzed and processed, ultimately outputting the power system's operating mode level. ; The comparison module is used to determine the number of internal storage levels. and the number of operating modes Are they equal? The update module is used to update the number of internal storage levels. Not equal to the number of operating modes This increases the number of internal storage levels. Equal to the number of operation levels And based on the updated series Update the variable setpoints of electrical quantities for power system relay protection, wherein the variable setpoints of electrical quantities are of the number of stages. The function, and It is an integer greater than or equal to 4; A modularly designed power system fault handling system can automate and intelligently handle power system faults, improve system maintainability and scalability, reduce manual intervention costs, and enhance the operating efficiency and reliability of the power system.
[0080] As another embodiment of the present invention, the large model-driven power grid fault assessment system further includes a large model module based on the Transformer architecture, which is used to analyze and process power system data to obtain the operating mode level. The large model module includes an input embedding layer, a position encoding layer, a Transformer encoder layer, a fully connected layer, and an output layer.
[0081] The large model-driven power grid fault assessment system integrates a large model module based on the Transformer architecture, which can give full play to the advantages of the large model, realize efficient analysis and processing of power system data and fault diagnosis, further improve the system's intelligence level and fault handling capabilities, and provide strong support for the stable operation of the power system.
[0082] This invention presents a large-model-driven power grid fault assessment method and system. Utilizing a large model based on the Transformer architecture, it effectively captures long-range dependencies and complex patterns in power system data, offering higher accuracy and real-time performance in fault detection and analysis compared to traditional methods. The large model's multi-head self-attention mechanism and feedforward neural network extract richer features, providing a more reliable basis for updating relay protection settings, improving the performance of relay protection devices, and enhancing the stability and security of power system operation. Through preprocessing of power system data and optimized model training, the model's adaptability to power system data under different operating conditions is improved, reducing the impact of data quality issues on fault analysis results.
[0083] In another embodiment of the present invention, the acquisition module dynamically obtains the operating mode level of the power system by monitoring the topology changes of the power system in real time. The data is then transmitted to the comparison module for processing.
[0084] By monitoring and dynamically acquiring the operating mode level in real time, the system can be ensured to respond quickly to changes in the power system topology, thereby improving the timeliness and accuracy of fault handling.
[0085] In another embodiment of the present invention, the comparison module calculates the number of internal storage levels. and the number of operating modes The system determines whether the variable setpoints of the electrical quantities of the relay protection need to be updated based on the differences in the values, and transmits the determination result to the update module.
[0086] By automatically comparing the differences in protection levels, manual intervention is reduced, ensuring that the updating of relay protection settings is more intelligent and efficient, and avoiding protection maloperation or failure to operate due to setting mismatch.
[0087] In another embodiment of the present invention, the updating module automatically adjusts the variable setpoint of the electrical quantity of the relay protection according to the judgment result of the comparison module, and applies the updated setpoint to the relay protection device of the power system.
[0088] Automatic updating of relay protection settings ensures that protection devices are always matched with the operating status of the power system, thereby improving the safety and stability of the power system.
[0089] As another embodiment of the present invention, the large model-driven power grid fault assessment system further includes a data storage module for storing historical operating data of the power system, records of topology changes, and update history of relay protection settings.
[0090] By storing historical data, we can provide data support for subsequent fault analysis, system optimization and decision-making, while also facilitating the tracking of system operating status and setpoint update process.
[0091] As another embodiment of the present invention, the large model-driven power grid fault assessment system further includes a fault diagnosis module, which is used to generate fault handling suggestions based on the fault diagnosis results output by the large model module, and transmit the suggestions to the power system control center.
[0092] By generating fault handling suggestions, it assists maintenance personnel in quickly locating and handling faults, reducing fault handling time and mitigating the impact of faults on the power system.
[0093] As another embodiment of the present invention, the large model-driven power grid fault assessment system further includes a user interface module for displaying the real-time operating status of the power system, topology changes, relay protection setting updates, and fault diagnosis results.
[0094] The intuitive user interface allows maintenance personnel to easily monitor system status and fault information in real time, improving system operability and user experience.
[0095] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A large-model-driven method for power grid fault assessment, characterized in that, Includes the following steps: S1. Collect power system data and preprocess it to obtain preprocessed data; among which, power system data includes electrical quantity data and switching quantity data; S2. A large model based on the Transformer architecture performs a regression task on the preprocessed data and outputs the order of the power system's operating modes. ; S3. Determine the number of internal storage levels. and the number of operating modes Are they equal? S4, if the internal storage levels Equal to the number of operation levels If the current variable setpoint of the electrical quantity remains unchanged, then the variable setpoint of the electrical quantity is maintained. The function, and It is an integer greater than or equal to 4; S5, if the internal storage levels Not equal to the number of operating modes This increases the number of internal storage levels. Equal to the number of operation levels And based on the updated series Update the variable setting values of electrical quantities for power system relay protection; S6. The large model based on the Transformer architecture performs a classification task on the preprocessed data to generate fault diagnosis results.
2. The large-model-driven power grid fault assessment method according to claim 1, characterized in that: In S1, the electrical quantity data includes real-time measured values of voltage, current, and power, and the switching quantity data includes the status information of circuit breakers and disconnectors.
3. The large-model-driven power grid fault assessment method according to claim 1, characterized in that: The specific steps involved in preprocessing power system data in step S1 are as follows: The collected power system data is cleaned by removing outliers using the power system parameter threshold method and filling in missing values using linear interpolation. The cleaned data is then subjected to Min-Max normalization to scale the data to... The range is used to obtain normalized data; Feature engineering was performed on the normalized data to extract fault analysis-related features, including voltage fluctuation rate and current harmonics. After undergoing the aforementioned data cleaning, normalization, and feature engineering extraction processes, the power system data is preprocessed.
4. The large-model-driven power grid fault assessment method according to claim 1, characterized in that: In S2, the large model based on the Transformer architecture includes an input embedding layer, a positional encoding layer, a Transformer encoder layer, a fully connected layer, and an output layer; wherein, The input embedding layer is used to convert the preprocessed data into a vector form suitable for model processing, resulting in an embedding vector. ; The location encoding layer is used to provide the model with temporal information from time-series data, generate location vectors, and correlate them with embedded vectors. Adding them together yields a vector containing positional information. ; The Transformer encoder layer extracts features through a multi-head self-attention mechanism and a feedforward neural network, based on vectors with positional information. pass through in sequence Each Transformer encoder layer has an identical structure. The output of each layer is processed by residual connection and layer normalization before being used as the input to the next layer, ultimately yielding the encoder layer output. ; The fully connected layer outputs the encoder layer. Mapping to the output format required by the task yields the output of the fully connected layer. ; The output layer will output the fully connected layer. Direct output yields the power system's operating mode level. .
5. The large-model-driven power grid fault assessment method according to claim 4, characterized in that: In the large model based on the Transformer architecture, the input embedding layer is used to convert the preprocessed data into a vector form suitable for model processing. The specific steps involved in obtaining the embedding vector are as follows: Based on preprocessed data With weight matrix Perform matrix multiplication and then map the result to a vector of the model dimension through a linear transformation. The result of the linear transformation mapping is the embedding vector. , where the embedding vector The feature dimension is .
6. The large-model-driven power grid fault assessment method according to claim 4, characterized in that: In the large model based on the Transformer architecture, the position encoding layer is used to provide the model with temporal information from the time series data. The specific steps involved in generating the position vector are as follows: The time step position is determined based on the time sequence of data collection. Based on embedding vectors Feature Dimensions Determine the location encoding dimension and dimension index The range of values for ; Position based on time step and dimensional index The positional encoding value for even-numbered dimensions is calculated using a sine function; Position based on time step and dimensional index The positional encoding value for odd-numbered dimensions is calculated using the cosine function; The position encoding values of even-numbered and odd-numbered dimensions are combined to form a unique position vector corresponding to each time step.
7. The large-model-driven power grid fault assessment method according to claim 4, characterized in that: In the large model based on the Transformer architecture, the specific steps involved in the Transformer encoder layer extracting features through a multi-head self-attention mechanism and a feedforward neural network are as follows: Location-based vectors The learnable weight matrix in the multi-head self-attention mechanism is invoked to apply the input features. Perform a linear transformation to calculate the query vector. Key vector Sum value vector and by increasing the feature dimension Divide by the number of attention heads Obtain the key vector The dimension is ; query vector With key vector Perform matrix multiplication on the transpose of the matrix, and then divide the result by the dimension of the key vector. Scaling the square root; The attention weights are obtained by applying the Softmax function to the scaled result. Compare attention weights with value vectors Perform matrix multiplication to obtain the output features of the multi-head self-attention mechanism. ; Output features of multi-head self-attention mechanism As input to the feedforward neural network, the learnable parameters in the feedforward neural network are called, including the first weight matrix of the feedforward neural network. The first bias parameter The second weight matrix The second bias parameter ; The first weight matrix based on the feedforward neural network The first bias parameter The input of the feedforward neural network is subjected to a first linear transformation and the ReLU activation function is applied to obtain the intermediate layer output. The second weight matrix based on the feedforward neural network The second bias parameter The intermediate layer output is then subjected to a second linear transformation to obtain the output of the feedforward neural network.
8. The large-model-driven power grid fault assessment method according to claim 1, characterized in that: In S5, based on the updated level The specific steps involved in updating the variable setting values of electrical quantities in power system relay protection are as follows: If the number of internal storage levels Not equal to the number of operating modes Then first, the number of levels in the internal storage. Update to runtime level ; Calling predefined electrical quantity variable setpoints and levels The functional relationship will update the series. Substitute into function In this process, new variable constants for electrical quantities are obtained through function calculations; The new variable electrical setting values are sent to the power system's relay protection devices through the system's communication interface, thus completing the update of the variable electrical setting values for the relay protection devices. and All values are integers greater than or equal to 4, and the variable setpoints of electrical quantities are series. The function.
9. A large-model-driven power grid fault assessment system, used to implement the large-model-driven power grid fault assessment method as described in any one of claims 1-8, characterized in that: include: The acquisition module collects power system data and preprocesses it to obtain preprocessed data, including electrical quantity data and switching quantity data. Based on a large model using the Transformer architecture, the preprocessed data is analyzed and processed, ultimately outputting the power system's operating mode level. ; The comparison module is used to determine the number of internal storage levels. and the number of operating modes Are they equal? The update module is used to update the number of internal storage levels. Not equal to the number of operating modes This increases the number of internal storage levels. Equal to the number of operation levels And based on the updated series Update the variable setpoints of electrical quantities for power system relay protection, wherein the variable setpoints of electrical quantities are of the number of stages. The function, and It is an integer greater than or equal to 4.
10. The large-model-driven power grid fault assessment system according to claim 9, characterized in that, It also includes a large model module based on the Transformer architecture, which is used to perform regression tasks on the preprocessed data to obtain the running order. The preprocessed data is then classified to generate fault diagnosis results.