Power grid fault analysis auxiliary research and judgment method, system, device and storage medium
Patent Information
- Application Number
- CN202611168312.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-10-09
AI Technical Summary
[0003]本发明的目的在于克服上述背景技术中存在的不足,提供一种电网故障分析辅助研判方法、系统、电子设备及计算机可读存储介质,用于解决现有技术中电网运行数据经降维后时序动态信息易丢失、特征归因静态化而无法反映模型持续更新过程中特征贡献度的变化、数值化预测输出与调度研判结论之间存在语义鸿沟、以及模型难以随电网结构与运行方式的演化而安全持续更新的技术问题
[0029]与现有技术相比,本发明具有以下有益效果: 1、在变分自编码器的目标函数中设置由重构数据与输入数据在多个预设滞后量下的样本自相关系数之差加权求和构成的多时间尺度自相关一致性约束项,并使各时间尺度的约束项分别在长度满足其统计有效性要求的片段上交替计算,使解码器在降低逐点重构误差的同时受到时序相关结构的约束,潜在特征得以保留电网运行数据自秒级至日级的自相关特性,避免了仅以逐点重构误差为约束时时序动态信息的丢失。
Smart Images

Figure CN122885510A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power grid fault analysis technology, and more specifically, to a power grid fault analysis auxiliary judgment method, system, electronic device, and computer-readable storage medium. Background Technology
[0002] Traditional power grid fault diagnosis methods often rely on manual experience or fixed rules, which may be inflexible and inefficient when facing complex and ever-changing power grid operating conditions. With the development of smart grids, the amount and variety of collected data are increasing dramatically, including electrical parameters, switch states, and environmental factors. This data typically has high dimensionality, making it difficult for traditional data analysis methods to handle effectively. The power grid operating environment is complex and ever-changing, and new fault types may emerge at any time. Many existing fault analysis systems lack sufficient flexibility to quickly adapt to these new situations. Fault prediction models based on deep neural networks often provide judgment results in a black-box manner, lacking quantitative attribution of the judgment criteria. Even when attribution methods are introduced, they typically assume that feature importance remains static after model training, failing to reflect changes in feature contribution as the model is continuously updated with new data. The output of existing systems is mostly fault... There is a semantic gap between probability or fault category labels and the actual fault types, fault sections, and handling procedures required by dispatching personnel, necessitating secondary manual translation and hindering the timeliness of auxiliary judgment. While general-purpose large language models have the ability to organize multi-source information into natural language conclusions, they lack knowledge in areas such as power grid dispatching procedures, protection settings, and equipment ledgers. Furthermore, their static weights, deployed in a one-time manner, cannot be updated with the evolution of power grid structure and operation modes, and it is difficult to trace the basis for generating conclusions, posing a risk of unreliable conclusions. Therefore, how to provide a power grid fault analysis auxiliary judgment scheme that can retain the dynamic characteristics of power grid operation data across multiple time scales, allow attribution results to evolve dynamically with model updates, ensure traceability and verifiability of judgment conclusions, and enable the model to be continuously and securely updated with the evolution of power grid structure and operation modes is a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0003] The purpose of this invention is to overcome the shortcomings of the above-mentioned background technology and provide a method, system, electronic device and computer-readable storage medium for auxiliary judgment of power grid fault analysis. It is used to solve the technical problems in the prior art, such as the easy loss of time-series dynamic information of power grid operation data after dimensionality reduction, the inability to reflect the change of feature contribution during the continuous updating of the model due to static feature attribution, the semantic gap between numerical prediction output and scheduling judgment conclusion, and the difficulty of the model to be safely and continuously updated with the evolution of power grid structure and operation mode.
[0004] To achieve the above objectives, the present invention adopts the following technical solution:
[0005] In a first aspect, the present invention provides a method for auxiliary judgment of power grid fault analysis, comprising the following steps:
[0006] Acquire power grid operation data; the power grid operation data includes electrical parameters, switch status, equipment identification information, historical fault records, and environmental parameters;
[0007] After preprocessing the power grid operation data, it is mapped to the latent space through a variational autoencoder to obtain latent features. The objective function of the variational autoencoder includes a multi-timescale autocorrelation consistency constraint term, which is a weighted sum of the differences between the sample autocorrelation coefficients of the reconstructed data and the input data under multiple preset lags. This allows the latent features to retain the temporal correlation structure of the input data at multiple time scales while reducing dimensionality.
[0008] The potential features are organized into sequence samples according to time windows and input into a long short-term memory network model for fault prediction to obtain the probability of fault occurrence and the urgency of fault.
[0009] The attribution values of each feature of the sequence sample to the prediction results of the long short-term memory network model are calculated, and the attribution values are recursively updated with the model update cycle to obtain dynamic attribution values; wherein, the attribution update weight used for recursive update is adaptively determined according to the drift index characterizing the degree of change of the power grid operation mode, so that the attribution results evolve synchronously with the continuous update of the model.
[0010] A domain knowledge base is constructed, and a retrieval context is obtained from the domain knowledge base based on the structured operation snapshot generated from the power grid operation data; the structured operation snapshot, the probability of fault occurrence, the urgency of fault, the attribution summary composed of the dynamic attribution value, and the retrieval context are filled into the prompt template, input into the large language model, generate a structured judgment report, and perform constraint verification on the structured judgment report;
[0011] Collect expert feedback on the structured analysis report;
[0012] Self-learning and self-updating are performed through three update channels, and the updated model version is evaluated and rolled back based on performance monitoring metrics. The three update channels include an online mini-batch update channel for the long short-term memory network model, a periodic retraining and latent space alignment channel for the variational autoencoder, and a low-rank incremental fine-tuning channel for the large language model based on expert feedback.
[0013] As a preferred embodiment of the present invention, the objective function of the variational autoencoder consists of a reconstruction error term, a KL divergence term, and a multi-timescale autocorrelation consistency constraint term. The sample autocorrelation coefficient under any lag is calculated on a statistical window, the length of which is not less than the sum of the lag and a preset minimum effective statistical point. During training the variational autoencoder, continuous qualified data is divided into short segments and long segments. The autocorrelation consistency constraint term corresponding to the short lag is calculated on the short segment, and the autocorrelation consistency constraint term corresponding to the long lag is calculated on the long segment. The short segment training step and the long segment training step are executed alternately according to a preset ratio, ensuring that the constraint terms at each time scale are calculated on segments that meet their statistical validity requirements. The weight coefficient of the KL divergence term increases linearly from zero to a preset upper limit value within a preset number of training rounds to avoid posterior collapse of latent variables in the early stages of training. During the inference phase, the latent mean vector output by the encoder of the variational autoencoder is used as the latent feature, making the feature output of the same input reproducible.
[0014] As a preferred embodiment of the present invention, the latent features are organized into sequence samples according to a time window and input into a long short-term memory network model for fault prediction. This includes: organizing the latent features into sequence samples using a sliding window of a preset length and a preset step size; constructing classification labels and regression labels for each sequence sample based on the historical fault records. The classification label represents whether a fault has occurred within the warning time domain from the end of the sequence sample, and the regression label represents the fault urgency. The fault urgency is determined by the ratio of the time interval from the end of the sequence sample to the next fault occurrence time to the warning time domain, and increases as the time interval decreases. When the time interval is greater than the warning time domain, the fault urgency is determined by the ratio of the time interval from the end of the sequence sample to the next fault occurrence time to the warning time domain. The fault urgency is set to zero; the sequence samples are divided into training, validation, and test sets according to physical time sequence, and an interval band with a length not less than the sum of the sliding window length and the warning time domain is set between adjacent sets, and the sequence samples falling into the interval band are discarded to avoid data leakage caused by window overlap or label time domain cross-boundary; oversampling is performed on the sequence samples with positive classification labels in the training set, or a positive sample weight coefficient is applied to the sequence samples with positive classification labels in the classification loss term to alleviate the class imbalance caused by the low proportion of fault samples; the sequence samples are input into the long short-term memory network model, and the fault occurrence probability is output through the classification branch and the fault urgency is output through the regression branch.
[0015] As a preferred technical solution of the present invention, the attribution value of each feature of the sequence sample to the prediction result of the long short-term memory network model is calculated, and the attribution value is recursively updated with the model update cycle. This includes: using the value sequence of each dimension of the latent feature in the time window as the feature, determining the attribution value of each feature to the classification branch output of the long short-term memory network model according to the Shapley additive interpretation method, and approximating the attribution value using Monte Carlo permutation sampling, wherein the operation of masking any feature is to replace the value sequence of that dimension with the value sequence of the corresponding dimension in the background sample set; convexly combining the recalculated attribution value of the current update cycle with the dynamic attribution value of the previous update cycle according to the attribution update weight to obtain the dynamic attribution value of the current update cycle; the attribution update weight is obtained by linearly adjusting the baseline value and the drift index through the drift response gain, and then truncating according to preset upper and lower bounds, and is always greater than zero and less than one, so that the sum of the contributions of each feature equals the predicted value. The additivity between relative baseline offsets is maintained; the drift index is obtained by weighted summation of the proportion of new fault mode samples in the current update cycle and the relative change in the F1 value of the long short-term memory network model according to weight coefficients, wherein when the minimum Mahalanobis distance between the latent vector of the sequence sample and each cluster center obtained by clustering historical fault samples is greater than a preset distance threshold, the sequence sample is determined to be a new fault mode sample; a preset number of features are selected in descending order of the absolute value of the dynamic attribution value to form the attribution summary, the attribution summary is composed of the latent dimension index, the dynamic attribution value and the original measurement field name corresponding to the latent dimension, the original measurement field name is selected in descending order of the absolute value mean of the partial derivatives of the latent dimension output by the encoder with respect to each input field on the validation set; the calculation of the attribution value is deployed in an asynchronous analysis channel independent of the online inference path, the online inference path only performs the extraction of the latent features and the forward inference of the long short-term memory network model.
[0016] As a preferred technical solution of the present invention, the entries in the domain knowledge base include scheduling operation procedures, relay protection setting instructions, primary equipment ledgers and wiring method instructions, and historical fault handling cases; a retrieval context is obtained from the domain knowledge base based on a structured operation snapshot, including encoding the structured operation snapshot and each knowledge entry into a vector using the same text embedding model, selecting a preset number of knowledge entries in descending order of cosine similarity to form the retrieval context, and assigning a citation number to each knowledge entry; the prompt template includes five slots, namely the structured operation snapshot, prediction conclusion, attribution summary, retrieval context, and output constraints, the prediction conclusion including the fault occurrence probability, the fault urgency, and the expected fault time window obtained by inverse solving the fault urgency, the output... The constraints limit the output of the structured analysis report to a fixed structured data pattern, with each conclusion marked with the citation number of its source. Constraint validation is performed on the structured analysis report, including: when the similarity of the knowledge entry with the highest similarity in the retrieval context is lower than a preset similarity threshold, or when the large language model cannot associate any action step with the citation number of the source, setting the insufficient evidence flag to true, outputting an empty list of action steps, and listing missing information items requiring manual confirmation; and performing data pattern validation and citation number existence validation on the structured analysis report. If the validation fails, the report is regenerated a preset number of times. If it still fails, the output is downgraded to a numerical report consisting only of the structured operation snapshot, the probability of failure, the urgency of the failure, and the attribution summary, and the format failure event is recorded.
[0017] As a preferred technical solution of the present invention, collecting expert feedback on the structured assessment report includes: receiving confirmation and revision of each item in the structured assessment report, generating a feedback quadruple consisting of the used prompts, the report generated by the large language model, the revised report, and the adoption score, and writing it into the feedback corpus; when the event corresponding to the structured assessment report is confirmed to belong to a new fault mode, writing the case of the event into the domain knowledge base according to a preset structured template, and reconstructing the vector index of the domain knowledge base so that the newly added case can be retrieved and take effect in subsequent assessments without fine-tuning; using the average adoption score of each feedback quadruple in the monitoring window as the expert adoption rate of the assessment report, and the expert adoption rate of the assessment report constitutes one of the performance monitoring indicators.
[0018] As a preferred technical solution of the present invention, self-learning and self-updating are performed through three update channels, and the updated model version is evaluated and rolled back based on performance monitoring indicators. This includes: in the online small-batch update channel, newly arriving power grid operation data is standardized according to standardized statistics persistently stored during the training phase, mapped to latent features by the variational autoencoder and organized into sequence samples, and back-filled with labels after the expiration of the warning time domain. When the number of back-filled label sequence samples reaches a preset batch size, the gradient is calculated using a loss function consisting of a positive sample-weighted classification cross-entropy term and a fault urgency mean square error term weighted by weighted coefficients. The gradient is then subjected to norm pruning and updated with a learning rate that decays with the update step sequence. The parameters are as follows: In the periodic retraining and latent space alignment channel, qualified data from the most recent period and data obtained by stratified sampling from historical data are mixed to form retraining data and the variational autoencoder is retrained. On the alignment sample set shared by the new and old encoders, the latent space alignment transformation matrix is obtained by minimizing the sum of squared distances between the transformed new latent mean vector and the old latent mean vector as the criterion. The latent features transformed by the latent space alignment transformation matrix are fed into the long short-term memory network model and fine-tuned with the long short-term memory network model using the most recent sequence samples. The ratio of the sum of squared distances to the sum of squared old latent mean vectors is used as the normalized alignment residual. When the normalized alignment residual exceeds a preset residual threshold... When the value is reached, the entire Long Short-Term Memory network model is retrained, and the active version continues to run during the retraining period. In the low-rank incremental fine-tuning channel, the training set is composed of samples with positive adoption scores in the feedback quadruples. The sequence cross-entropy with adoption scores as sample weights is used as the objective function. The base weights of the large language model are frozen, and only the low-rank adaptation matrix is updated. A preset proportion of historical high adoption score samples are mixed into the training set in each round. Feedback quadruples with adoption scores of zero do not participate in the calculation of the objective function and are used to lower the retrieval priority of their corresponding knowledge items in the same scenario. A set of performance indicators is calculated on the sliding monitoring window. The set of performance indicators includes average end-to-end response time, false positive rate, false negative rate, F1 score, and the judgment report. When any metric in the performance metric set falls below a preset minimum acceptable threshold, or the F1 score decreases by more than a preset amount relative to the previous accepted version, or the format failure rate exceeds a preset proportion, the current update channel is frozen, rolled back to the most recent accepted version, and an alarm is generated. New versions generated by any update channel are first run in parallel with the active version in a shadow running mode. Once each metric in the performance metric set reaches a preset target value, it is switched to the active version. The encoder weights, decoder weights, the latent space alignment transformation matrix, the long short-term memory network model weights, the low-rank adaptation matrix, the standardized statistics, the background sample set, and the vector index snapshot of the domain knowledge base are uniformly released and rolled back as atomic version packages.
[0019] Secondly, the present invention provides a power grid fault analysis and auxiliary judgment system, comprising:
[0020] The data acquisition module is used to acquire power grid operation data, which includes electrical parameters, switch status, equipment identification information, historical fault records, and environmental quantities.
[0021] The feature extraction module is used to preprocess the power grid operation data and then map it to the latent space through a variational autoencoder to obtain latent features. The objective function of the variational autoencoder is set with a multi-time-scale autocorrelation consistency constraint term, which is a weighted sum of the differences between the sample autocorrelation coefficients of the reconstructed data and the input data under multiple preset lags.
[0022] The fault prediction module is used to organize the potential features into sequential samples according to time windows, input them into a long short-term memory network model, and obtain the probability of fault occurrence and the urgency of fault.
[0023] The dynamic attribution module is used to calculate the attribution value of each feature of the sequence sample to the prediction result of the long short-term memory network model, and to recursively update the attribution value with the model update cycle to obtain the dynamic attribution value. The attribution update weight used for recursive update is adaptively determined according to the drift index that characterizes the degree of change in the power grid operation mode.
[0024] The assessment report generation module is used to construct a domain knowledge base and obtain the retrieval context based on the structured operation snapshot. The structured operation snapshot, the probability of failure, the urgency of failure, the attribution summary composed of the dynamic attribution value, and the retrieval context are filled into the prompt template, input into the large language model to generate a structured assessment report, and perform constraint verification on the structured assessment report.
[0025] The expert feedback module is used to collect expert feedback on the structured analysis report.
[0026] The self-learning and self-updating module is used to perform self-learning and self-updating through three update channels, and to evaluate and roll back the updated model version based on performance monitoring metrics. The three update channels include an online mini-batch update channel for the long short-term memory network model, a periodic retraining and latent space alignment channel for the variational autoencoder, and a low-rank incremental fine-tuning channel for the large language model based on expert feedback.
[0027] Thirdly, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the power grid fault analysis and auxiliary judgment method described in the first aspect.
[0028] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the power grid fault analysis and auxiliary judgment method described in the first aspect.
[0029] Compared with the prior art, the present invention has the following beneficial effects: 1. In the objective function of the variational autoencoder, a multi-timescale autocorrelation consistency constraint term is set, which is composed of the weighted sum of the differences between the sample autocorrelation coefficients of the reconstructed data and the input data under multiple preset lags. The constraint terms of each time scale are calculated alternately on segments whose length meets the requirements of their statistical validity. This allows the decoder to be constrained by the temporal correlation structure while reducing point-by-point reconstruction error. The latent features can be preserved from the second level to the day level of the power grid operation data, avoiding the loss of temporal dynamic information when only point-by-point reconstruction error is used as a constraint.
[0030] 2. The attribution values of each feature are recursively updated in a convex combination manner with the dynamic attribution values of the previous period and the model update cycle. The attribution update weight is determined by the drift index composed of the proportion of new failure mode samples and the relative change of the model F1 value, after linear adjustment and truncation. This allows the feature contribution to evolve synchronously during the continuous model update process. Each feature has an independent historical trajectory and its relative ranking can change with the model update, overcoming the problem that static attribution cannot reflect the current model behavior. The calculation of attribution values is deployed on an asynchronous analysis channel that is independent of the online inference path, without occupying the latency budget of online inference.
[0031] 3. The structured operation snapshot, failure probability, failure urgency, attribution summary composed of dynamic attribution values, and retrieval context obtained from the domain knowledge base are filled into the prompt template and input into the large language model. This converts the numerical prediction and attribution results into a structured judgment report containing suspected failure types, suspected failure segments, and handling steps, with each conclusion marked with the source citation number. This reduces the need for manual secondary translation from numerical output to judgment conclusions. When the constraint verification is below the threshold for retrieval similarity or the handling steps cannot be associated with the source, an insufficient evidence flag is set and no handling suggestions are output. If the format verification fails again after retry, it is downgraded to outputting the original numerical report, reducing the risk of the large language model outputting untraceable conclusions.
[0032] 4. Through three update channels—online mini-batch updates of the long short-term memory network model, periodic retraining and orthogonal alignment of the variational autoencoder, and low-rank incremental fine-tuning of the large language model based on expert feedback—the system continuously adapts to changes in the power grid structure and operation mode. The latent space alignment transformation and normalized alignment residual criteria ensure the consistency between the output semantics of the encoder after retraining and the input of the existing long short-term memory network model. Shadow running, atomic version package release, and rollback mechanisms based on multiple criteria ensure the availability of the in-service version and the consistency between versions of various components during the update process. Attached Figure Description
[0033] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 This is an overall flowchart of the power grid fault analysis and auxiliary judgment method provided in the embodiments of the present invention;
[0035] Figure 2 This is a schematic diagram of the network structure of the variational autoencoder in an embodiment of the present invention;
[0036] Figure 3 This is a schematic diagram of multi-timescale autocorrelation consistency constraints and alternating training of dual-granularity segments in an embodiment of the present invention;
[0037] Figure 4 This is a flowchart of the long short-term memory network fault prediction and dynamic attribution calculation in an embodiment of the present invention;
[0038] Figure 5 This is a flowchart of the structured assessment report generation and constraint verification in an embodiment of the present invention;
[0039] Figure 6 This is a schematic diagram of the self-learning and self-updating three-channel and version management mechanism in an embodiment of the present invention;
[0040] Figure 7 This is a structural block diagram of the power grid fault analysis and auxiliary judgment system provided in an embodiment of the present invention;
[0041] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0042] In the diagram: 10, Data Acquisition Module; 20, Feature Extraction Module; 30, Fault Prediction Module; 40, Dynamic Attribution Module; 50, Analysis Report Generation Module; 60, Expert Feedback Module; 70, Self-Learning and Self-Update Module; 80, Electronic Equipment; 81, Processor; 82, Memory; 83, Bus; 84, Communication Interface. Detailed Implementation
[0043] 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 of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0044] Example 1: Please refer to Figure 1 As shown, this embodiment provides a method for auxiliary judgment of power grid fault analysis. This method is based on a self-learning and self-updating mechanism and a large language model, and includes the following steps:
[0045] S1. Determine the requirements for improving fault detection speed, such as the expectation of completing a detection within a few seconds, and establish performance indicators, such as the average response time, false alarm rate, and false negative rate of fault detection.
[0046] In this embodiment, the upper limit of the end-to-end delay for a single fault assessment is denoted as... ,Pick The upper limit of the latency between feature extraction in S3 and prediction in S4 in the online inference path is denoted as . ,Pick The upper limit of the S5 analysis report generation latency is denoted as ,Pick The set of performance indicators is denoted as ,in This represents the average end-to-end response time. The false alarm rate represents the proportion of faultless samples that are incorrectly identified as faulty. The false negative rate represents the proportion of faulty samples that are classified as fault-free. The F1 value represents the fault category. This indicates the expert adoption rate of the assessment report, the definition of which is given in S5.5; Each indicator in the document gives a target value. With the minimum acceptable threshold In this embodiment, , , , , To set the target value, take , , , , The minimum acceptable threshold is defined as follows: performance metrics are measured offline on a holdout test set partitioned according to S4.3, and online on a set of length [missing information]. The calculation is performed on the sliding monitoring window. In this embodiment, we take... The aforementioned performance metrics have three uses in subsequent steps: as the release threshold for S3.1 data quality verification, as the basis for S4.4 model structure selection and S4.5 early stop criteria, and as the criteria for S6.11 performance monitoring and version rollback.
[0047] S2. Collect power grid operation data from sources such as SCADA systems and sensors;
[0048] In this embodiment, the data access configuration class DataIngestConfig is used to specify how to acquire and process these input data. The input of this class is configuration items, and the output is a structured data frame with unified time scale alignment. Its fields include: source_type, which indicates the data source type, and the value range is SCADA / EMS real-time interface, synchronous phasor measurement device data stream, sensor message queue, relay protection and fault recording device file, local file, and manual input; connection, which indicates connection parameters, including address, port, protocol type and authentication credential reference; sampling_rate, which indicates the sampling rate. In this embodiment, the SCADA channel is set to 1Hz and the synchronous phasor measurement channel is set to 50Hz; field_mapping, which indicates the mapping table from the source field to the unified field name and unified device code; time_zone and time_base, which indicate the time zone and time reference. In this embodiment, Beidou or GPS second-level time synchronization is used; persist_output, which is a boolean type, indicating whether to persist the structured data frame; and output_path, which indicates the persistent storage path.
[0049] The power grid operation data includes electrical parameters (voltage, current, active power, reactive power, frequency, phase angle, etc.), switch status (circuit breaker open / closed position, disconnector switch position, protection action signals and alarm signals, etc.), equipment identification information (plant name, voltage level, line name, bay name, equipment unique code, etc.), historical fault records (fault start and end time, fault equipment code, fault type, fault phase, handling measures and handling results, etc.), and environmental quantities (temperature, humidity, wind speed, precipitation, lightning location information, etc.). Among them, the equipment identification information is used for cross-source identification consistency verification in S3.1, and the historical fault records are used for tag construction in S4.2 and knowledge base construction in S5.2.
[0050] Furthermore, time-stamp alignment is performed on the data from each channel, and resampling is uniformly performed to the sampling interval. In this embodiment, Synchronous phasor measurement channel according to Dual-channel downsampling of inner mean and extreme values preserves the transient envelope; missing sampling points are marked with a missing flag instead of being silently padded; the aligned structured data frame is denoted as... ,in Indicates the physical sampling time. This represents the aligned field dimension, in this embodiment. .
[0051] S3. Use a variational autoencoder to extract fault detection-related features from the power grid operation data. Optimize the extraction process of the variational autoencoder based on the dynamic characteristics of the power grid operation data over time.
[0052] In this embodiment, the variational autoencoder (VAE) achieves unsupervised dimensionality reduction by learning the latent distribution of data, while simultaneously generating new data samples. Its core principle is to use an encoder to map high-dimensional input data to a low-dimensional latent space, and then a decoder to reconstruct the original data from the latent space, thereby extracting features useful for fault detection. VAE is an unsupervised learning method, meaning it can work without labeled data. For power grid operation data, obtaining large amounts of labeled data can be very difficult and expensive because fault events are relatively few and difficult to predict. VAE can learn the latent structure of data without labels, thus helping to identify those... Features useful for fault detection: Power grid operation data typically contains a large amount of high-dimensional information, such as electrical parameters like voltage, current, and power, as well as various switch states. VAEs can effectively reduce the dimensionality of the data while retaining key information by mapping this high-dimensional data to a low-dimensional latent space. This helps improve the efficiency of subsequent analysis or modeling processes and reduces the demand for computing resources. VAEs learn data representations by introducing randomness (i.e., the probability distribution of latent variables), which makes the model more robust and better able to handle noise and unseen data. This is especially important for complex systems like power grids, as various unforeseen situations may occur in actual operation.
[0053] The following steps are used to extract fault detection-related features from power grid operation data using a variational autoencoder (VAE):
[0054] S3.1 Preprocess the power grid operation data, including data cleaning, data standardization / normalization, etc. Use the DataQualityValidator method to verify and ensure the consistency and quality of the data, and ensure the quality and integrity of the data to meet the set performance indicators.
[0055] In this embodiment, DataQualityValidator executes the following validation rules: Rule R1 is an identifier consistency check, which means that the plant name, line name, and bay name across data sources should be completely consistent after being mapped to a unified equipment code via field_mapping; those that are inconsistent are marked as requiring manual confirmation; Rule R2 is a range reasonableness check, which means that each electrical quantity should fall within the reasonable range determined by its rated value. Within the specified limits, those exceeding the limits are marked; Rule R3 is a time continuity check, meaning the missing rate of a single channel within the statistical window does not exceed [a certain threshold]. The maximum consecutive missing length does not exceed Each sampling point is used in this embodiment. , Rule R4 is a topology and measurement consistency check, which means that when a circuit breaker in a certain bay is in the open position, the current amplitude of that bay should not exceed the tolerance. In this embodiment, The value is 1% of the rated current of the interval; the processing order of the verification results is as follows: repairable items are repaired by linear interpolation or by maintaining the previous value (only applicable to short-term missing items that meet rule R3), unrepairable items are removed, and samples that violate rule R1 or rule R4 are not included in the training set and online inference path and trigger alarms. The data pass rate after the above processing should not be lower than the release threshold set by S1. In this embodiment, the pass rate is not lower than 98%.
[0056] Furthermore, z-score standardization is performed on each field, using the mean vector for standardization. with standard deviation vector The training set is used for computation and persistence, while the same set is reused for the validation set, test set, and online inference and update phases. Instead of recalculating, to avoid introducing distribution shift;
[0057] S3.2 Construct a neural network as an encoder and another neural network as a decoder;
[0058] In this embodiment, please refer to Figure 2 As shown, the encoder consists of a one-dimensional causal convolutional layer with 64 channels and a kernel length of 3, a one-dimensional causal convolutional layer with 128 channels and a kernel length of 3, two layers of long short-term memory network with 128 hidden units each, and two parallel fully connected layers. The two parallel fully connected layers output the mean vectors of each dimension of the latent variables. With log-variance vector Among them, the potential spatial dimensions The value range is from 16 to 64, and in this embodiment, we take... The purpose of using causal convolution is to avoid introducing data from later times into the convolution window; the decoder consists of... The network consists of a fully connected layer, two layers of Long Short-Term Memory (LSTM) networks with 128 hidden units each, and an output dimension of [missing information]. The system consists of a fully connected output layer; the hidden layer activation function is ReLU, and the output layer does not have an activation function because the input data has already been standardized.
[0059] S3.3 Determine the hyperparameters of the variational autoencoder, such as the learning rate, batch size, and number of training rounds. Define the objective function and optimize it according to the dynamic characteristics of the power grid operation data in the time series. Further optimize the objective function according to the changes at different time scales and train the variational autoencoder (by calculating the mean and variance of the latent variables through the encoder).
[0060] In this embodiment, the optimizer is Adam, and the initial learning rate is... Batch size is set to 128, maximum number of training rounds is set to 200, and early stop patience value is set to 20.
[0061] Furthermore, due to latent variables It is necessary to start from the conditional distribution In mid-sampling, to ensure the differentiability of the sampling operation and that the gradient can be propagated back to the encoder, a reparameterization method is used to generate latent variables:
[0062]
[0063] in, Indicates element-wise multiplication; Indicates by The standard deviation vector obtained by exponentiation and square root operations; Indicates and Standard normal random vectors of the same dimension;
[0064] Furthermore, the objective function is:
[0065]
[0066] in, The objective function of the variational autoencoder is the value that needs to be minimized during model training. This represents the expectation operator, i.e., the operator for the conditional distribution. All latent variables extracted from Find the average; This represents the conditional distribution given by the encoder; Indicate latent variables; This represents the power grid operation data after preprocessing in S3.1; This represents the reconstructed data generated by the decoder; This represents a hyperparameter used to balance the weights between the reconstruction error term and the KL divergence term; The first latent variable represents the... The mean of the dimension; The first latent variable represents the... The variance of the dimension; The dimension of the potential space; Indicates a dimension index;
[0067] It should be noted that the KL divergence under the standard normal prior is Therefore, the second term in the above equation equals The negative sign is a necessary condition to ensure that the objective function has a lower bound and the training process can converge.
[0068] To address the dynamic characteristics of power grid operation data over time, the objective function is optimized. (Power grid operation data exhibits significant time-series characteristics, implying a correlation between current and past data. Faults in power systems are often not isolated events but rather the result of a gradual accumulation of changing conditions. If only point-by-point reconstruction error is used as a constraint, the decoder can disrupt the temporal correlation structure of the signal with relatively small point-by-point errors, causing latent features to lose dynamic information. The optimized objective function helps latent features retain the dynamic characteristics of power grid operation data and ensures that the model can continuously improve its performance.)
[0069] First, define the input data in the hysteresis. The following are the sample autocorrelation coefficients:
[0070]
[0071] in, This represents the length of the autocorrelation statistical window, measured in terms of the number of sampling points; considering the lag... For the autocorrelation coefficient to be statistically effective, the statistical window length must be greater than the lag. The hysteresis value is set according to the selected hysteresis value. ,in This represents the minimum number of valid statistical points; in this embodiment, it is taken as... ; Indicates the start time of the statistics window; Indicates the lag, expressed in terms of the number of sampling points; The sample mean within the statistical window; the sample autocorrelation coefficient of the reconstructed data. The same formula is used to calculate the mean on the reconstructed sequence, where the mean is obtained from the reconstructed sequence itself;
[0072] Therefore, the objective function optimized based on the dynamic characteristics of power grid operation data over time series is:
[0073]
[0074] in, This represents the objective function optimized to account for the dynamic characteristics of power grid operation data over time series. The hyperparameter representing the strength of the consistency penalty term for controlling the time series autocorrelation; Indicates the selected lag; This penalty term represents the absolute value of the difference between the sample autocorrelation coefficients of the reconstructed data and the input data under the same lag; this penalty term also includes the reconstructed data. Therefore, there are non-zero gradients for the encoder and decoder parameters, which can actually participate in the optimization. Moreover, the value of this term decreases as the difference between the autocorrelation structure of the reconstructed sequence and the input sequence decreases. Therefore, minimizing this term is to make the reconstructed signal retain the temporal correlation of the input signal, which is consistent with the optimization objective.
[0075] To address changes at different time scales, the objective function is further optimized. (Phenomena in the power grid may involve multiple time scales, ranging from millisecond-level transient processes to seasonal load changes. An objective function that considers the correlation between multiple time scales can help the model simultaneously grasp short-term fluctuations and long-term trends, which is crucial for a comprehensive understanding of power grid behavior. Faults in the power system may be the result of a series of short-term events or may be influenced by long-term operating patterns. An optimized objective function allows the model to consider these changes at different time scales during training, thereby enhancing its generalization ability on unseen data.)
[0076]
[0077] in, This represents the objective function after further optimization for changes at different time scales; Indicates a time-scale index; This represents the total number of selected time scales; in this embodiment, we take... ; Indicates the first The lag corresponding to each time scale, in this embodiment, is taken as... Each sampling point corresponds to changes at the second, minute, hour, and day levels, respectively. Indicates the first The weight hyperparameters of the time-scale penalty terms; obviously... for exist In this special case, the training process in this embodiment adopts... As the objective function;
[0078] For further details, please refer to Figure 3 As shown, due to the hysteresis is The autocorrelation statistics require the training fragment length to be no less than To balance statistical effectiveness with training resource consumption, a two-granularity alternation method is adopted for training: continuous qualified data is divided into segments of varying lengths. Short segments and length The long segment, in this embodiment, is taken , The short fragment training step calculates the reconstruction error term, KL divergence term, and... using a batch size of 128. The autocorrelation consistency term of the scale, the reconstruction error term, the KL divergence term calculated with a batch size of 8 for long fragment training steps, and the other terms are also included. The autocorrelation consistency terms at each scale are calculated on segments that meet their statistical validity requirements by alternating between the two types of training steps in a 4:1 ratio.
[0079] Furthermore, An annealing strategy is used, with the temperature linearly increasing from 0 to 1000 during the first 20 training rounds. In this embodiment, To avoid posterior collapse of latent variables in the early stages of training; The search interval was determined by a grid search on the validation set. The criterion is to minimize the weighted sum of the reconstruction error and autocorrelation bias on the validation set; the variational autoencoder is trained according to the above settings until the early stopping condition is met, and the encoder and decoder weights and standardized statistics are saved. ;
[0080] S3.4. Using the trained encoder, all power grid operation data are mapped to the latent space to obtain latent variables, i.e., the extracted features; during the inference stage, the mean vector is directly taken as the feature output, i.e. The random sampling described in S3.3 will no longer be performed to ensure that the feature output of the same input can be reproduced.
[0081] S4. Based on the extracted features, fault prediction is performed using a long short-term memory network model;
[0082] In this embodiment, the Long Short-Term Memory (LSTM) network controls the flow of information through its unique gating mechanism (input gate, forget gate, and output gate), thereby effectively capturing long-term dependencies in time-series data. This makes it suitable for tasks requiring historical information, such as fault prediction in power grid operation data. LSTM is a special type of recurrent neural network (RNN) that can effectively capture and utilize data dependencies over long time spans. This is particularly important for power grid fault prediction because power system faults are often caused by the gradual accumulation of a series of continuous events or changes in conditions. LSTM can use its gating mechanism to remember important historical information and forget irrelevant information, thus better simulating such long-term dependencies. Power grid operation data is typically time-series data, including changes in electrical parameters such as voltage, current, and power over time. LSTM excels at processing this type of data, naturally incorporating temporal sequence, which helps to more accurately predict future states.
[0083] Fault prediction is performed based on the extracted features of the power grid operation data using a Long Short-Term Memory (LSTM) network model, including the following steps:
[0084] S4.1. The latent variables obtained from the variational autoencoder (VAE) are used as input features. Since the power grid operation data has time-series characteristics, the features are organized into a sequence according to time order. The data at each time point is used as a sample, and a time window of a certain length is used to capture the dependencies between data.
[0085] In this embodiment, the length of the sliding window is denoted as... The sliding step size is 1 sampling point, the first... The sample is In this embodiment, That is, a 60-second historical window is used as a sample.
[0086] S4.2 Determine whether a fault occurred at each time point based on historical fault records and the remaining time until the fault occurs, and use this as the label for the training set. The purpose of this is to clarify the target that the model needs to learn during the training process.
[0087] In this embodiment, the warning time domain is set. ,Pick Each sampling point is 30 minutes; for each time point... End of sample Construct two labels, one of which is a category label. When the interval When the equipment or interval malfunctions, take Otherwise take Secondly, the regression label is the urgency of the fault. Its definition is:
[0088]
[0089] in, Indicates time The time interval until the next fault occurs is determined directly from the fault start time in the historical fault record, based on the number of sampling points; when the interval... When there is no internal fault ,at this time ; The closer it is to 1, the closer the fault is to occurring; It is a dimensionless quantity, and They all originate from historical fault records and require no additional annotation.
[0090] S4.3 Divide the extracted power grid operation data into training set, validation set and test set so that the model can learn knowledge from the training set, be fine-tuned on the validation set, and finally evaluate performance on the unseen test set.
[0091] In this embodiment, the sample sequence is divided into a training set, a validation set, and a test set according to physical time sequence, with proportions of 70%, 15%, and 15%, respectively; a length of not less than [amount missing] is left between adjacent sets. The interval band is defined, and any window samples falling into the interval band are discarded to avoid data leakage caused by window overlap or label temporal domain crossing. In this embodiment, the interval band length is taken as... Because the proportion of faulty samples is extremely low, the training set contains only a small percentage of samples with high failure rates. The samples are oversampled at a ratio of 1:5, or a weighting coefficient is applied to positive samples in the classification loss term. In this embodiment, The validation set and test set maintain their original distribution without resampling to ensure that the evaluation results of each S1 indicator reflect the real operating conditions.
[0092] S4.4 Define the architecture of the Long Short-Term Memory (LSTM) network model to meet performance metrics, including determining the number of LSM network layers and the number of units per layer, deciding whether to use a bidirectional LSM network to better capture contextual information within the window, and defining the output layer structure.
[0093] In this embodiment, the backbone is a two-layer Long Short-Term Memory network with 128 hidden units per layer and a dropout ratio of 0.2 between layers; bidirectional here refers to the length of the network. Within the historical window, the sequence is read in both forward and reverse directions, and all sampling points within the window are located at the current time. Before and before, no introduction The data is collected after a certain time step, thus not violating the causality constraint of real-time prediction, nor increasing data waiting latency; the output layer is a fully connected layer followed by two parallel branches, and the output of the classification branch is activated by a sigmoid function to obtain the probability of fault occurrence. The fault urgency is obtained by activating the sigmoid function on the regression branch output. The choice of the number of layers and hidden units should satisfy the S1 setting on the validation set. The target value, and the sum of the single-sample forward inference latency and the feature extraction latency of S3 does not exceed [a certain value]. As a standard;
[0094] S4.5 Create a Long Short-Term Memory Network model instance and initialize the weights. Given a time series sample, perform forward computation through the Long Short-Term Memory Network to obtain the prediction result. As the training process progresses, the model will continuously adjust its parameters to improve the prediction accuracy.
[0095] In this embodiment, the weights are initialized according to the Xavier method, as defined in S6.6. The objective function for offline training is Adam, the optimizer is Adam, and the initial learning rate is... Batch size is 256, based on the validation set. Stop early, and set the patience value to 15; verify on the test set after training is complete. Have all indicators been met? If the target is not met, return to S4.4 to adjust the architecture or return to S3.3 to adjust. , ;
[0096] S4.6 After the Long Short-Term Memory (LSTM) network model generates prediction results, the SHAP value is calculated to interpret the prediction results. Given the unclear coupling between the SHAP value calculation and the model's self-learning and self-updating process, the SHAP value calculation process is optimized. If the SHAP value of a feature is positive, then that feature tends to increase the model's prediction value; conversely, if the SHAP value is negative, then that feature tends to decrease the model's prediction value. The larger the absolute value of the SHAP value, the more significant the impact of that feature on the model's prediction results. For example, in power grid fault prediction, if the SHAP value of the latent dimension corresponding to voltage fluctuation is large, it indicates that voltage fluctuation has a significant impact on determining whether a fault has occurred.
[0097] Furthermore, SHAP values are a method for interpreting machine learning model predictions based on the concept of Shapley values in game theory. Specifically, SHAP values quantify the contribution of each feature to the model's prediction results, which helps identify which features are most critical for a particular prediction, thereby understanding how the model makes decisions. By explaining the model's prediction process, SHAP values increase the model's transparency, enabling users to better understand and trust the model's output, which is particularly important for applications requiring high reliability (such as power grid fault detection).
[0098] For further details, please refer to Figure 4 As shown, the feature set is defined. ,in , No. The feature refers to the th feature of the latent vector. Dimensions throughout the window The sequence of values on; masking the first The operation of each feature is defined as using a background sample set randomly drawn from the training set. Replace the sequence of the corresponding dimension with the sequence of the same dimension in this embodiment. ;because , The value is explicitly set to 32, which is consistent with the potential spatial dimension set in S3.2;
[0099] Calculate the SHAP value as follows:
[0100]
[0101] in, Representation of features The degree of contribution to the model's prediction results; Indicates no features A subset of features; Representing a subset The number of elements; Indicates the total number of features; Represents a set of features; Indicates feature index; This represents the input sequence sample to be interpreted; Indicates that only a subset is retained. The true values of each feature and the input sequence after masking the remaining features in the above manner; Indicates in the background sample set Seeking higher expectations; This represents the output of the classification branch in a Long Short-Term Memory (LSTM) network model.
[0102] Furthermore, the precise calculation of the above formula requires traversing... A subset of features, in Since this is not feasible at the moment, this embodiment uses Monte Carlo permutation sampling approximation calculation, that is, random sampling. For each of the given features, features are sequentially added one by one, and their marginal contributions are accumulated. The final average is then taken as the result. The estimated value has the following number of forward inference steps: The computational complexity is In this embodiment, Meanwhile, the calculation of SHAP values is deployed on an asynchronous analysis channel independent of the online inference path. The online inference path only performs feature extraction in S3.4 and forward inference in S4.4, and its latency is affected by... Constraints: The calculation of the SHAP value is performed on the asynchronous channel after a fault warning is triggered or according to the scheduling cycle, and the result is... Provided to S5 within the time limit, the calculation of the SHAP value does not occupy the latency budget of online detection and does not conflict with the response time target set by S1;
[0103] To address the unclear coupling between SHAP value calculation and the model's self-learning and self-updating process, the SHAP value calculation process is optimized. (Traditional SHAP value calculation assumes that feature importance is static, meaning that the influence of features on prediction results is considered fixed after model training. However, under the self-learning and self-updating mechanism of this method, feature importance may change with the continuous input of new data and automatic adjustment of prediction model parameters. If SHAP value calculation does not take this into account, its interpretation may no longer accurately reflect the current model behavior. When the model improves its performance through the self-learning mechanism (e.g., improving the accuracy of fault detection), without a method to dynamically quantify the change in the contribution of each feature, it is difficult to determine which factors are key to the performance improvement. The optimized SHAP value calculation method can help identify these key factors, thereby better guiding further model optimization.)
[0104]
[0105] in, Indicates the optimized first... Each update cycle feature The degree of contribution to the model's prediction results; Indicates the first The Long Short-Term Memory network model after one update cycle; Indicates that the index is updated periodically; Indicates the first The attribution update weights for each update cycle are parameters used to adjust the model's sensitivity to changes in grid operation modes; due to The above equation is a convex combination, therefore the dynamic attribution value is recursively applied to each feature, each feature has an independent historical trajectory, and its relative size and order can change with model updates, while the interpretation convention for the attribution value sign remains unchanged. A convex combination equal to the efficiency values of adjacent model versions maintains the additive interpretation that the sum of the contributions of each feature equals the offset of the predicted value relative to the baseline.
[0106] The range of values can be set according to specific circumstances, for example... During the model initialization phase, a baseline value is taken. , It is a fixed value; in this embodiment, it is taken as... If, during the self-learning and self-updating process, the model learns a new fault mode or power grid operation mode, the drift index is... ,So The update formula is:
[0107]
[0108] in, This represents the drift response gain; in this embodiment, we take... ; , This indicates the truncation of upper and lower bounds; in this embodiment, we take... , ; This represents a truncation function that restricts the values to a given interval. Henglu Within the interval, the aforementioned convex combination properties are guaranteed; it should be noted that... It itself does not contain historical recursive terms; historical information is provided by Bear, Its function is to determine the acceptance ratio of the new version of the attribution result based on the degree of drift in the current cycle; the greater the drift, the faster the new attribution result is accepted.
[0109] Drift Index The evaluation indicators are quantified and defined as follows:
[0110]
[0111] in, Indicates the first The percentage of new failure mode samples within each update cycle; This represents the total number of samples within that period; This represents the number of samples identified as new failure modes within that period. The determination rule is that the minimum Mahalanobis distance between the latent vector of the sample and the cluster centers of historical failure samples is greater than a threshold. The cluster centers are obtained by K-means clustering of historical failure samples. Take the 99th percentile of this distance distribution for historical fault samples; Representation Model The relative change in value; Indicates the first Measured on the monitoring window after one update cycle. value; This represents the weighting coefficient of the two components, with a value range of [value range missing]. In this embodiment, ;because and Therefore Both are dimensionless quantities and can be directly weighted and summed.
[0112] Furthermore, according to Sort in descending order, take the first few. Attribution Summary of Features In this embodiment, To make the attribution summary understandable to personnel, a mapping table is established between the latent dimensions and the original measurement fields, i.e., for the first... Given ... For each input field The absolute mean of the partial derivatives on the validation set The first three original field names, in descending order, are taken as the physical interpretations of the potential dimension. Indicates the input field index; attribution summary The triple, consisting of the latent dimension index, the dynamic attribution value, and the corresponding original measurement field name, serves as one of the inputs for constructing the S5.3 hint.
[0113] S5. Based on the large language model, the prediction results and attribution results are converted into a structured analysis report, and expert feedback is collected.
[0114] In this embodiment, please refer to Figure 5 As shown, the output of S4 is the fault probability, fault urgency, and attribution values. There is a semantic gap between these values and the actual judgment conclusions required by dispatching personnel. Therefore, a large language model is introduced to complete the conversion from numerical conclusions to judgment conclusions, while simultaneously making expert feedback the input for a self-learning and self-updating closed loop. A structured judgment report is generated based on the large language model, including the following steps:
[0115] S5.1 Determine the selection of the large language model and the domain adaptation method;
[0116] In this embodiment, the base model is denoted as... , The parameters are represented using an open-source large language model that can be privately deployed, with parameter sizes ranging from 7B to 14B. Deployed on an inference server within the scheduling intranet, the entire inference and fine-tuning process remains within the network to meet the relevant security regulations for power monitoring systems. Domain adaptation employs a low-rank adaptation method, meaning that for each adapted weight matrix... Introducing low-rank increments:
[0117]
[0118] in, This represents the frozen base weight matrix; , Represents a low-rank fitness matrix; , Indicates the number of rows and columns of the weight matrix; This represents the rank of the low-rank fit, with a value ranging from 8 to 32. In this embodiment, we take... Freeze during training Update only , ,in Initialize as a zero matrix. Initialize according to a Gaussian distribution to ensure that the adaptation begins. ;
[0119] S5.2 Build a domain knowledge base and establish a retrieval mechanism;
[0120] In this embodiment, the domain knowledge base is denoted as... The sources of its entries include dispatching operation procedures, relay protection setting instructions, primary equipment ledgers and wiring method descriptions, and historical fault handling cases. The historical fault handling cases are automatically written from historical fault records collected by S2 using a structured template. Fields include fault equipment code, fault type, fault phase, key pre-fault measurement characteristics, actual handling measures, and handling results. The retrieval method involves using the current structured operation snapshot. With each knowledge item Each vector is encoded using the same text embedding model, and the cosine similarity is calculated.
[0121]
[0122] in, Represents a structured runtime snapshot; Indicates the first One knowledge item; Represents an index of knowledge entries; This represents a text embedding function; sorted by similarity in descending order. Each entry constitutes the search context. And assign a reference number to each entry. In this embodiment, we take... The retrieval is implemented using an approximate nearest neighbor index to ensure... Search latency still meets requirements even as scale increases constraint;
[0123] S5.3, Construct prompts and generate a structured analysis report;
[0124] In this embodiment, the prompt is as follows From template functions Generation, i.e. The template contains five slots: one of which is a structured runtime snapshot. The first part includes the following: First, the exceeding of limits for key electrical quantities before and after the warning time; second, the time-stamped switch change sequence; third, protection actions and alarm signals; and fourth, the identification information of the equipment involved. The fifth part includes the prediction conclusion, including the probability of fault occurrence output from S4.4. urgency of the fault and by The predicted failure time window obtained by inverse solution Thirdly, dynamic attribution summary. This includes the latent dimension index, dynamic attribution values, and their corresponding original measurement field names output according to S4.6; the fourth is the retrieval context. This includes those retrieved according to S5.2. The fifth constraint is the output requirement, which mandates that the output be in a fixed JSON format and that each conclusion must be supported by the relevant documentation. , or The specific source number in the document;
[0125] The analysis report is recorded as Its JSON schema includes fields such as suspected fault type, suspected fault segment or device code, confidence level, list of evidence (each item includes source number and description), list of orderly handling steps (each item must be associated with at least one piece of evidence), items requiring manual confirmation, and insufficient evidence flag;
[0126] S5.4, Perform constraint verification on the analysis report;
[0127] In this embodiment, when the retrieval context The item with the highest similarity Value below threshold (This embodiment takes) If the model cannot associate any action step with a specific source number, the insufficient evidence flag is set to true, the action step list is empty, and missing information items are listed in the items requiring manual confirmation. Based on this, the system outputs the conclusion of insufficient evidence without generating action recommendations when there is insufficient evidence. Furthermore, for... Perform JSON schema validation and reference number existence validation. If the validation fails, regenerate the data a preset number of times (twice in this example). If it still fails, the process is downgraded to simply outputting the data. , , and The original numerical report, and record a formatting failure event;
[0128] S5.5 Collect expert feedback through the ExpertFeedback module;
[0129] In this embodiment, on-duty personnel and professionals view the analysis report on a human-machine interface. Each item is reviewed and modified, including the fault type, fault segment, and handling steps. An overall adoption score is then provided, generating a feedback quadruple. ,in Indicates the prompt used. This refers to the report generated by the model. This indicates the report as revised by personnel. This indicates the adoption score, with a value range of [value range missing]. This embodiment adopts the direct adoption method. The revised version is adopted. Not adopted Three-level discrete assignment; feedback quadruples written to the feedback corpus. If personnel confirm that this incident belongs to a new failure mode, then the case will be written into the domain knowledge base according to the structured template of S5.2. And rebuild the vector index; the expert adoption rate of the assessment report is defined as:
[0130]
[0131] in, Indicates monitoring window The set of feedback quadruples generated internally; As a set of S1 performance indicators It is a component of the S6.11 monitoring criteria.
[0132] S6. Design a dynamic learning mechanism to enable the model to automatically adjust its parameters based on newly emerging data, maintain high prediction accuracy, and perform auxiliary analysis.
[0133] In this embodiment, please refer to Figure 6As shown, the main purpose of fine-tuning the Long Short-Term Memory (LSTM) network model based on the online gradient descent algorithm is to enable the model to quickly adapt to new data, continuously optimize its performance, and maintain predictive accuracy and robustness in a constantly changing environment. Online gradient descent allows the model to adjust its weights immediately upon receiving new data, rather than waiting for a large amount of data to accumulate before batch updating. This enables the model to respond quickly to the latest data changes, ensuring that its parameters always reflect the current data distribution. By continuously fine-tuning with new data, the model can avoid over-reliance on historical data, thereby reducing the risk of overfitting. This is particularly important for handling non-stationary data streams, as historical data may no longer represent the current situation. Simultaneously, to avoid the feature space and analytical capabilities lagging behind changes in the power grid, this step also sets up update channels for the variational autoencoder and the large language model. The dynamic learning mechanism includes the following steps:
[0134] S6.1. Set up three update channels and their triggering conditions. One of them is the online small-batch update channel for the Long Short-Term Memory network, which updates every accumulated... Each newly labeled sample triggers a new event once; in this embodiment, it takes... The second is the variational autoencoder periodic retraining and latent space alignment channel, which is used for each cycle. Or the drift index satisfies Time-triggered, this embodiment takes sky, Thirdly, the large language model uses a low-rank incremental fine-tuning channel based on expert feedback, with each accumulated... Feedback quadruple or every cycle Trigger, in this embodiment, is taken , sky;
[0135] S6.2 Select the initial learning rate, which will be used to adjust the step size of weight updates and set the system to continuously receive new data samples; in this embodiment, the initial learning rate is selected. The learning rate decays according to the update step sequence, i.e. ,in This indicates the step sequence index for online updates, and sets the capacity to [value]. Online sample buffer;
[0136] S6.3 Preprocessing the new data includes removing noise and outliers, scaling the data to the same level, and mapping it to latent features. In this embodiment, quality checks are performed according to rules R1 to R4 in S3.1, and persistently stored statistics are used as described in S3.1. Standardization is performed without recalculating statistics, and all data are then mapped to latent vectors by the encoder in S3 and organized according to length in S4.1. The sequence samples; it should be noted that during the online update phase, no branch is set to directly use the original data, so as to ensure that the input dimension is consistent with the input layer dimension of the S4 instantiated model;
[0137] S6.4 Generate labels according to the rules in S4.2; due to the classification labels With regression labels All require known warning time domain Whether a fault occurs within the label, the label needs to be updated at any time. Only then can backfilling be performed, meaning the inherent length of the online update is... The label latency, which should be a separate indicator for model update latency in S1, is taken as an upper limit in this embodiment. This delay does not affect the response time of the online reasoning and judgment path consisting of S3, S4, and S5. ;
[0138] S6.5. Take new data points from the data stream, perform forward propagation on the new data, and obtain the prediction output; in this embodiment, when the number of samples with backfilled labels in the buffer reaches... At that time, take out the small batch. The forward propagation is performed to obtain the predicted output. and ;
[0139] S6.6 Calculate the loss function of the Long Short-Term Memory network model based on the difference between the actual labels and the predicted output;
[0140] Furthermore, the loss function for the Long Short-Term Memory (LSTM) network model is:
[0141]
[0142] in, This represents the loss function of the Long Short-Term Memory (LSTM) network model. Indicates the first The model parameter vector for each step; Indicates the first The small batch of samples extracted step by step; The weighting coefficients represent the loss of the classification task; The weight coefficients represent the loss of the regression task, and In this embodiment, , ; Indicates the number of samples in a mini-batch; Indicates the first The true classification label (0 or 1) of each sample; Indicates the first The predicted probability value of each sample; Indicates the first The true value of the fault urgency as defined in S4.2 for each sample; Indicates the first The urgency of prediction for each sample; This represents the positive sample weighting coefficients set according to S4.3; This represents the numerical stability constant to prevent the logarithmic term from diverging; in this embodiment, it is taken as... This formula is also used for offline training of S4.5, at which point... Get the batch size for offline training;
[0143] S6.7. Perform backpropagation to calculate gradients, initializing the gradients of the output layer, typically the derivative of the loss function with respect to the activation values of the output layer; starting from the output layer, backpropagate the gradients layer by layer in time, calculating the gradient of the loss function with respect to the weights and biases of each layer for each layer; using the chain rule, connect these gradients to calculate the gradient of the loss function with respect to the weights and biases of each layer; perform norm clipping on the gradients, i.e., when... Scaling up proportionally ,in This represents the gradient clipping threshold; in this embodiment, it is taken as... To suppress gradient explosion in recurrent networks;
[0144] S6.8 Update the weights of the Long Short-Term Memory network model using the online gradient descent formula;
[0145] The formula for online gradient descent is:
[0146]
[0147] in, This represents the updated model parameter vector; Indicates the first The model parameter vector for each step; Indicates the first The learning rate determines the step size of parameter changes during each update; Indicates the current parameter and newly arrived small batches of samples Below, the loss function of the Long Short-Term Memory network model For parameters The gradient;
[0148] S6.9, Order Repeat steps S6.3 to S6.8 above; this channel runs continuously with the data stream, and its termination condition is the termination of the data stream or manual stopping, with no fixed upper limit on the number of iterations; each completed Each update involves submitting an evaluation request to S6.11. In this embodiment, we take... If the evaluation fails, freeze the channel and roll back according to S6.11;
[0149] S6.10 Perform cyclic retraining and latent space alignment on the variational autoencoder;
[0150] In this embodiment, the retraining data is from the most recent The qualified data within the window is mixed with an equal amount of data obtained from stratified sampling of historical data in a 1:1 ratio to suppress catastrophic amnesia of historical operating conditions while incorporating the new operating mode; according to the objective function in S3.3 Retrain the encoder and decoder to obtain the first... The encoder's output mean vector is denoted as... Since retraining causes rotation and permutation of the coordinate axes in the latent space, directly feeding the output of the new encoder into the existing long short-term memory network will alter its input semantics. Therefore, in the alignment sample set shared by the old and new encoders, [further steps are needed]. orthogonal transformation :
[0151]
[0152] This problem is an orthogonal Procrustes problem, and its closed-form solution is: Let the cross-correlation matrix... ,right Perform singular value decomposition ,but ;in, This indicates the alignment sample set; in this embodiment, 10,000 qualified samples from the most recent 7 days are selected. , These represent the new and old encoder versions for the samples, respectively. The output latent mean vector; , They represent The left and right singular vector matrices; Represents a singular value diagonal matrix; express The characteristics of the alignment of the identity matrix and its input into the long short-term memory network are: Then, following steps S6.3 to S6.8, the Long Short-Term Memory network was fine-tuned using the most recent samples. Step, in this embodiment, take Complete the adaptation;
[0153] Furthermore, the normalized alignment residuals are calculated:
[0154]
[0155] in, Represents the normalized aligned residual; when Exceeding the threshold (This embodiment takes) When it is determined that the potential space has undergone structural changes, linear alignment is not used. Instead, full retraining of the Long Short-Term Memory network is initiated. During the retraining period, the old version continues to be in use, while the new version runs in parallel using the shadow operation mode of S6.11. Switching is only performed after the indicators are met.
[0156] S6.11 Set performance monitoring metrics and test model performance regularly, and perform evaluation and version rollback;
[0157] In this embodiment, at a length of Calculation on the sliding monitoring window Various indicators; the rollback criterion is that if If any of the indicators is worse than the one set by S1 ,or The decrease compared to the previous accepted version exceeded (This embodiment takes) (percentage points), or the format failure rate of S5.4 records exceeds [percentage points], or the format failure rate of S5.4 records exceeds [percentage points]. (This embodiment takes) If the current update channel is frozen, the current update channel is rolled back to the most recently accepted version, an alert is generated, and the event and triggering metrics are recorded. New versions generated by any channel are first inferred in parallel with the existing version in a bypass manner, for a duration of [duration missing]. (This embodiment takes) During this period, only the indicators are recorded and not output to external parties. All items achieved The following steps switch to the active version; the encoder weights, decoder weights, and alignment matrix are then adjusted. Long Short-Term Memory Network Weights Low-rank adaptation weights Standardized statistics Background sample set The knowledge base vector index snapshot is released and rolled back as an atomic version package, and the repository retains the most recent version. This embodiment takes one version. This is to ensure semantic consistency between components after rollback;
[0158] S6.12. Perform low-rank incremental fine-tuning on the large language model based on expert feedback collected by the ExpertFeedback module;
[0159] The fine-tuned objective function is the sequential cross-entropy weighted by adoption score:
[0160]
[0161] in, This represents the incremental fine-tuning loss of a large language model. This represents the set of feedback samples with positive adoption ratings; Indicates the prompt used; This indicates the original report generated by the model, which is not directly involved in the loss calculation in this formula and is only used for sample tracing and auditing. The token sequence of the report, as indicated by the personnel revision, is denoted as... ; This represents the total number of tokens in the sequence; Indicates the token index; Indicates the first The token sequence preceding each token; The adoption score is used as the sample weight to give higher weight to high-quality feedback. Representing a large language model; Indicates the frozen base weight; , This represents the low-rank fitness matrix as defined in S5.1; the gradient is only applied to... , Calculate and update;
[0162] Furthermore, The feedback samples are not used in the training of the above formula, but only for constructing negative example filtering rules on the retrieval side, that is, to lower the retrieval priority of their corresponding knowledge items in the same scenario; to suppress catastrophic forgetting, the proportion of samples mixed into the training set in each round of fine-tuning is 1. Historical high-score feedback samples (i.e.) (sample), this embodiment takes After fine-tuning, the adoption rate proxy metric (the field-level consistency rate between the manually pre-annotated reference report and the generated report) and the JSON format compliance rate are measured on a fixed evaluation set. If the threshold is not reached, the process is rolled back. Upgrade to the previous version and record events according to S6.11;
[0163] Furthermore, newly added fault cases are written via S5.5. After rebuilding the vector index, it can take effect in the next assessment without fine-tuning. For feedback that requires changes to the output organization or reasoning habits, the low-rank fine-tuning in this step is solidified into the model capability. The two constitute a dual-channel knowledge update that complements timeliness and stability.
[0164] Furthermore, to facilitate understanding of the complete execution process of this method, an application example is given: During the approach of a thunderstorm, S2 collects operational data such as a slow increase in leakage current, an increase in zero-sequence current imbalance, and a continuous shortening of lightning location distance for a 110kV overhead line (unified equipment code L-0117); the encoder in S3 maps the time-stamped data frames into 32-dimensional latent vectors; and the long short-term memory network in S4 outputs the probability of fault occurrence for the 60-second window samples ending at the current time. urgency of the fault The corresponding expected fault time window is within 11.4 minutes from the current moment; the asynchronous attribution channel in S4.6 provides an attribution summary, with the top 3 potential dimensions and their physical interpretations being the 7th dimension (zero-sequence current, A-phase current, lightning location distance), the 21st dimension (leakage current, relative humidity, A-phase voltage), and the 3rd dimension (active power, load factor, frequency), with corresponding dynamic attribution values of +0.31, +0.24, and -0.08, respectively; the knowledge entries with the highest similarity found in S5.2 are the overhead line lightning strike and insulation flashover early warning and handling procedures (citation number R1, similarity 0.83) and historical handling cases of the same type of line. (Citation R2, similarity 0.79); The structured assessment report generated in S5.3 indicates a suspected fault type of single-phase grounding risk caused by A-phase insulation degradation, a suspected fault section corresponding to line L-0117, and a confidence level of 0.86. The handling steps include strengthening monitoring of the line and notifying the maintenance team to be on-site, verifying the load transfer conditions of adjacent lines according to procedures, and pre-setting fault isolation and recovery plans. Each handling step is associated with the references R1, R2, and the attribution summary entries; After verification in S5.4, the report is pushed to the on-duty personnel. The on-duty personnel add a step to contact the meteorological department to confirm the thunderstorm's movement path before adopting the report. S5.5 records the adoption score. The event was subsequently confirmed to be a new failure mode, and its case was written into the domain knowledge base according to the structured template of S5.2 and included in the feedback count of the third update channel of S6.1.
[0165] Example 2: Please refer to Figure 7 As shown, this embodiment provides a power grid fault analysis and auxiliary judgment system to implement the power grid fault analysis and auxiliary judgment method described in Embodiment 1. The system includes:
[0166] Data acquisition module 10 is used to execute S2, which is to collect power grid operation data from sources such as SCADA system and sensors, complete time-scale alignment through the data access configuration class DataIngestConfig, and output structured data frames.
[0167] Feature extraction module 20 is used to execute S3, which involves preprocessing and quality verification of power grid operation data, and then extracting the data according to the objective function. The trained variational autoencoder maps it to latent features;
[0168] The fault prediction module 30 is used to execute S4.1 to S4.5, which organizes potential features into sequence samples and outputs the probability of fault occurrence and fault urgency through a long short-term memory network model.
[0169] The dynamic attribution module 40 is used to perform S4.6, which calculates the SHAP value in the asynchronous analysis channel and recursively obtains the dynamic attribution value and attribution summary according to the attribution update weight adaptively determined by the drift index.
[0170] The analysis report generation module 50 is used to execute S5.1 to S5.4, namely, maintaining the domain knowledge base and vector index, performing retrieval and suggestion construction, calling the large language model to generate a structured analysis report and performing constraint verification;
[0171] The expert feedback module 60 is used to execute S5.5, that is, to collect expert feedback quadruples through the human-machine interface and write them into the feedback corpus.
[0172] The self-learning and self-updating module 70 is used to execute S6, which maintains three update channels, performance monitoring, and the release and rollback of atomic version packages;
[0173] The specific processing procedures of each module have been described in detail in Example 1 and will not be repeated here. It should be noted that the above module division is only a logical functional division. In actual implementation, there may be other division methods. Each module can be fully or partially integrated into one processing unit, or each module can exist physically separately. It can be implemented in hardware or as a software functional unit. Among them, the fault prediction module 30 is located in the affected area. The constrained online reasoning path, dynamic attribution module 40 and judgment report generation module 50 are located in the subject The constraint asynchronous analysis channel and the self-learning and self-updating module 70 operate independently of the above two channels. The deployment relationship of the three is consistent with that described in S4.6 and S6 of Embodiment 1.
[0174] Example 3: Please refer to Figure 8As shown, this embodiment provides an electronic device 80, including a processor 81, a memory 82, and a bus 83, and may also include a communication interface 84. The memory 82 stores a computer program that can be executed by the processor 81. When the processor 81 reads and executes the computer program through the bus 83, it implements the power grid fault analysis auxiliary judgment method described in Embodiment 1. The processor 81 can be one or more of a central processing unit, a graphics processing unit, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices, wherein the inference of the large language model and the low-rank incremental fine-tuning are preferably deployed on a computing node configured with a graphics processing unit. The memory 82 may include non-volatile memory and volatile memory, such as read-only memory, random access memory, flash memory, hard disk, or solid-state drive. The communication interface 84 is used to interact with the SCADA / EMS real-time interface, the data stream of the synchronous phasor measurement device, the sensor message queue, and the human-machine interface. In the power grid dispatching application scenario, this electronic device can be deployed as an inference server located on the dispatching intranet side. All the inference and fine-tuning processes described in Embodiment 1 are completed on the intranet side without leaving the network, so as to meet the relevant regulations for the security protection of the power monitoring system.
[0175] Example 4: This example provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the power grid fault analysis and auxiliary judgment method described in Example 1. The storage medium can be any medium capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory, a random access memory, a magnetic disk, or an optical disk.
[0176] Example 5: This example provides a computer program product, including a computer program or instructions. When the computer program or instructions are executed by a processor, they implement the power grid fault analysis and auxiliary judgment method described in Example 1. The computer program product can be distributed in the form of a software installation package and deployed on the electronic device described in Example 3.
[0177] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for auxiliary judgment of power grid fault analysis, characterized in that, Includes the following steps: Acquire power grid operation data; the power grid operation data includes electrical parameters, switch status, equipment identification information, historical fault records, and environmental parameters; After preprocessing the power grid operation data, it is mapped to the latent space through a variational autoencoder to obtain latent features; wherein, the objective function of the variational autoencoder is provided with a multi-time-scale autocorrelation consistency constraint term, which is a weighted sum of the differences between the sample autocorrelation coefficients of the reconstructed data and the input data under multiple preset lags; The potential features are organized into sequence samples according to time windows and input into a long short-term memory network model for fault prediction to obtain the probability of fault occurrence and the urgency of fault. The attribution values of each feature of the sequence sample to the prediction results of the long short-term memory network model are calculated, and the attribution values are recursively updated with the model update cycle to obtain dynamic attribution values; wherein, the attribution update weights used for recursive updates are adaptively determined according to the drift index characterizing the degree of change in the power grid operation mode. A domain knowledge base is constructed, and a retrieval context is obtained from the domain knowledge base based on the structured operation snapshot generated from the power grid operation data; the structured operation snapshot, the probability of fault occurrence, the urgency of fault, the attribution summary composed of the dynamic attribution value, and the retrieval context are filled into the prompt template, input into the large language model, generate a structured judgment report, and perform constraint verification on the structured judgment report; Collect expert feedback on the structured analysis report; Self-learning and self-updating are performed through three update channels, and the updated model version is evaluated and rolled back based on performance monitoring metrics. The three update channels include an online mini-batch update channel for the long short-term memory network model, a periodic retraining and latent space alignment channel for the variational autoencoder, and a low-rank incremental fine-tuning channel for the large language model based on expert feedback.
2. The power grid fault analysis and auxiliary judgment method according to claim 1, characterized in that: The objective function of the variational autoencoder consists of a reconstruction error term, a KL divergence term, and a multi-timescale autocorrelation consistency constraint term. The sample autocorrelation coefficient under any lag is calculated on a statistical window, the length of which is not less than the sum of the lag and the preset minimum number of effective statistical points; When training the variational autoencoder, continuous qualified data is divided into short segments and long segments. The autocorrelation consistency constraint term corresponding to the short lag is calculated on the short segment, and the autocorrelation consistency constraint term corresponding to the long lag is calculated on the long segment. The short segment training step and the long segment training step are executed alternately according to a preset ratio. The weight coefficient of the KL divergence term increases linearly from zero to a preset upper limit value within a preset number of training rounds. During the inference phase, the latent mean vector of the encoder output of the variational autoencoder is used as the latent feature.
3. The power grid fault analysis and auxiliary judgment method according to claim 1, characterized in that, The latent features are organized into sequence samples according to time windows and input into a long short-term memory network model for fault prediction, including: The latent features are organized into sequence samples using a sliding window of preset length and at preset step sizes; Based on the historical fault records, classification labels and regression labels are constructed for each sequence sample; the classification label indicates whether a fault has occurred within the warning time domain starting from the end of the sequence sample; the regression label is the fault urgency, which is determined by the ratio of the time interval from the end of the sequence sample to the next fault occurrence time to the warning time domain, and increases as the time interval decreases, and the fault urgency is zero when the time interval is greater than the warning time domain; The sequence samples are divided into training set, validation set and test set according to the physical time sequence. An interval band with a length not less than the sum of the sliding window length and the warning time domain is set between adjacent sets, and the sequence samples falling into the interval band are discarded. Oversampling is performed on the sequence samples with positive classification labels in the training set, or a positive sample weight coefficient is applied to the sequence samples with positive classification labels in the classification loss term. The sequence samples are input into the long short-term memory network model, and the probability of the fault occurrence is output through the classification branch, and the urgency of the fault is output through the regression branch.
4. The power grid fault analysis and auxiliary judgment method according to claim 1, characterized in that, Calculate the attribution value of each feature of the sequence sample to the prediction result of the Long Short-Term Memory network model, and recursively update the attribution value with the model update cycle, including: Using the value sequence of each dimension of the latent feature over the time window as the feature, the attribution value of each feature to the classification branch output of the long short-term memory network model is determined by the Shapley additive interpretation method, and the attribution value is approximated by Monte Carlo permutation sampling; wherein, the operation of masking any feature is to replace the value sequence of the corresponding dimension with the value sequence of the background sample set. The dynamic attribution value of the current update cycle is obtained by convexly combining the recalculated attribution value of the previous update cycle with the dynamic attribution value of the previous update cycle according to the attribution update weight. The attribution update weight is obtained by linearly adjusting the baseline value and the drift index through the drift response gain, and then truncating them according to preset upper and lower bounds, and is always greater than zero and less than one. The drift index is obtained by weighting and summing the proportion of new fault mode samples in the current update cycle and the relative change in the F1 value of the long short-term memory network model according to the weight coefficients; wherein, when the minimum Mahalanobis distance between the latent vector of the sequence sample and each cluster center obtained by clustering historical fault samples is greater than a preset distance threshold, the sequence sample is determined to be a new fault mode sample. The attribution summary is constructed by selecting a preset number of features in descending order of the absolute value of the dynamic attribution value. The attribution summary consists of a latent dimension index, a dynamic attribution value and the original measurement field name corresponding to the latent dimension. The original measurement field name is selected in descending order of the mean of the absolute values of the partial derivatives of the latent dimension output by the encoder with respect to each input field on the validation set. The calculation of the attribution value is deployed on an asynchronous analysis channel that is independent of the online inference path, which only performs the extraction of the latent features and the forward inference of the long short-term memory network model.
5. The power grid fault analysis and auxiliary judgment method according to claim 1, characterized in that: The sources of entries in the domain knowledge base include dispatching operation procedures, relay protection setting instructions, primary equipment ledgers and wiring method descriptions, and historical fault handling cases; The retrieval context is obtained from the domain knowledge base based on the structured runtime snapshot, including: encoding the structured runtime snapshot and each knowledge entry into vectors using the same text embedding model, selecting a preset number of knowledge entries in descending order of cosine similarity to form the retrieval context, and assigning a reference number to each knowledge entry; The prompt template includes five slots: the structured operation snapshot, the prediction conclusion, the attribution summary, the retrieval context, and the output constraints. The prediction conclusion includes the failure probability, the failure urgency, and the expected failure time window obtained by inverse solving the failure urgency. The output constraints limit the structured analysis report to be output in a fixed structured data pattern, and each conclusion is marked with the citation number of its source. The structured analysis report is subjected to constraint verification, including: when the similarity of the knowledge item with the highest similarity in the retrieval context is lower than a preset similarity threshold, or when the large language model cannot associate any action step with the citation number of the source, the insufficient evidence flag is set to true, the action step list is output as empty, and the missing information items that need to be manually confirmed are listed; and the structured analysis report is subjected to data pattern verification and citation number existence verification. If the verification fails, it is regenerated a preset number of times. If it still fails, it is downgraded to outputting only a numerical report consisting of the structured operation snapshot, the probability of failure, the urgency of failure, and the attribution summary, and the format failure event is recorded.
6. The power grid fault analysis and auxiliary judgment method according to claim 5, characterized in that, Collect expert feedback on the structured analysis report, including: Receive confirmation and revision of each item in the structured assessment report, generate a feedback quadruple consisting of the prompts used, the report generated by the large language model, the revised report and the adoption score, and write it into the feedback corpus; When the event corresponding to the structured assessment report is confirmed to belong to a new fault mode, the case of the event is written into the domain knowledge base according to the preset structured template, and the vector index of the domain knowledge base is reconstructed. The average of the adoption scores of each feedback quadruple within the monitoring window is used as the expert adoption rate of the assessment report, which constitutes one of the performance monitoring indicators.
7. The power grid fault analysis and auxiliary judgment method according to claim 6, characterized in that, Self-learning and self-updating are performed through three update channels, and the updated model version is evaluated and rolled back based on performance monitoring metrics, including: In the online small-batch update channel, newly arrived power grid operation data is standardized according to the standardized statistics that are persistently saved during the training phase. The data is then mapped to latent features by the variational autoencoder and organized into sequence samples. Labels are backfilled after the expiration of the warning time domain. When the number of backfilled sequence samples reaches the preset batch size, the gradient is calculated using the loss function formed by the weighted sum of the positive sample-weighted classification cross-entropy term and the mean square error term of the fault urgency according to the weight coefficients. After norm pruning of the gradient, the parameters of the long short-term memory network model are updated according to the learning rate that decays with the update step. In the periodic retraining and latent space alignment channel, the retraining data is formed by mixing qualified data from the most recent period with data obtained by stratified sampling from historical data, and the variational autoencoder is retrained. On the alignment sample set shared by the new and old encoders, the latent space alignment transformation matrix is obtained within the orthogonal matrix range, with the minimum sum of squared distances between the transformed new latent mean vector and the old latent mean vector as the criterion. The latent features transformed by the latent space alignment transformation matrix are fed into the long short-term memory network model, and the long short-term memory network model is fine-tuned with the most recent sequence samples. The ratio of the sum of squared distances to the sum of squared squares of the old latent mean vector is used as the normalized alignment residual. When the normalized alignment residual exceeds a preset residual threshold, the long short-term memory network model is fully retrained, and the active version continues to run during the retraining period. In the low-rank incremental fine-tuning channel, the training set is composed of samples with positive adoption scores in the feedback quadruples. The objective function is the sequence cross-entropy with adoption scores as sample weights. The base weights of the large language model are frozen and only the low-rank adaptation matrix is updated. A preset proportion of historical high adoption score samples are mixed into the training set in each round. Feedback quadruples with adoption scores of zero do not participate in the calculation of the objective function and are used to lower the retrieval priority of their corresponding knowledge items in the same scenario. A set of performance metrics is calculated on a sliding monitoring window. The set of performance metrics includes average end-to-end response time, false positive rate, false negative rate, F1 score, and expert adoption rate of the assessment report. When any metric in the set of performance metrics is worse than a preset minimum acceptable threshold, or the F1 score decreases by more than a preset amount relative to the previous accepted version, or the format failure rate exceeds a preset proportion, the current update channel is frozen, rolled back to the most recent accepted version, and an alarm is generated. A new version generated by any update channel is first run in parallel with the active version in a shadow running mode. After each item in the set of performance metrics reaches a preset target value, it is switched to the active version. The encoder weight, decoder weight, latent space alignment transformation matrix, long short-term memory network model weight, low-rank adaptation matrix, standardized statistics, background sample set, and vector index snapshot of the domain knowledge base are uniformly released and rolled back as atomic version packages.
8. A power grid fault analysis and auxiliary judgment system, characterized in that, include: The data acquisition module is used to acquire power grid operation data, which includes electrical parameters, switch status, equipment identification information, historical fault records, and environmental quantities. The feature extraction module is used to preprocess the power grid operation data and then map it to the latent space through a variational autoencoder to obtain latent features. The objective function of the variational autoencoder is set with a multi-time-scale autocorrelation consistency constraint term, which is a weighted sum of the differences between the sample autocorrelation coefficients of the reconstructed data and the input data under multiple preset lags. The fault prediction module is used to organize the potential features into sequential samples according to time windows, input them into a long short-term memory network model, and obtain the probability of fault occurrence and the urgency of fault. The dynamic attribution module is used to calculate the attribution value of each feature of the sequence sample to the prediction result of the long short-term memory network model, and to recursively update the attribution value with the model update cycle to obtain the dynamic attribution value. The attribution update weight used for recursive update is adaptively determined according to the drift index that characterizes the degree of change in the power grid operation mode. The assessment report generation module is used to construct a domain knowledge base and obtain the retrieval context based on the structured operation snapshot. The structured operation snapshot, the probability of failure, the urgency of failure, the attribution summary composed of the dynamic attribution value, and the retrieval context are filled into the prompt template, input into the large language model to generate a structured assessment report, and perform constraint verification on the structured assessment report. The expert feedback module is used to collect expert feedback on the structured analysis report. The self-learning and self-updating module is used to perform self-learning and self-updating through three update channels, and to evaluate and roll back the updated model version based on performance monitoring metrics. The three update channels include an online mini-batch update channel for the long short-term memory network model, a periodic retraining and latent space alignment channel for the variational autoencoder, and a low-rank incremental fine-tuning channel for the large language model based on expert feedback.
9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the power grid fault analysis and auxiliary judgment method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the power grid fault analysis and auxiliary judgment method as described in any one of claims 1 to 7.